Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge commit '045db1657e870c721be490b411868f4181a12ced' into surf++
authorPaul Bédaride <paul.bedaride@gmail.com>
Wed, 30 Oct 2013 14:26:47 +0000 (15:26 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Wed, 30 Oct 2013 14:26:47 +0000 (15:26 +0100)
Conflicts:
buildtools/Cmake/DefinePackages.cmake
src/include/surf/datatypes.h
src/include/surf/surf.h
src/simgrid/sg_config.c
src/simix/smx_io.c
src/simix/smx_smurf_private.h
src/surf/cpu_cas01.c
src/surf/cpu_ti.c
src/surf/network.c
src/surf/network_constant.c
src/surf/network_gtnets.c
src/surf/new_model.c
src/surf/storage.c
src/surf/storage_private.h
src/surf/surf.c
src/surf/surf_action.c
src/surf/surf_model.c
src/surf/surf_routing.cpp
src/surf/surf_routing_cluster.c
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_none.c
src/surf/surf_routing_vivaldi.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c

1467 files changed:
.classpath [new file with mode: 0644]
.gitignore
.project [new file with mode: 0644]
CITATION.bib [new file with mode: 0644]
CMakeLists.txt
COPYING
ChangeLog
NEWS
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Distrib.cmake
buildtools/Cmake/Flags.cmake
buildtools/Cmake/GenerateDocWin.cmake
buildtools/Cmake/MakeExe.cmake
buildtools/Cmake/MakeJava.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindValgrind.cmake
buildtools/Cmake/Option.cmake
buildtools/Cmake/Pipol.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/Scripts/generate_memcheck_tests.pl
buildtools/Cmake/Scripts/tesh.pl
buildtools/Cmake/src/internal_config.h.in
buildtools/Cmake/src/simgrid.nsi.in
buildtools/Cmake/test_prog/prog_gnu_dynlinker.c
buildtools/Cmake/test_prog/prog_mutex_timedlock.c
buildtools/Cmake/test_prog/prog_sem_init.c
buildtools/Cmake/test_prog/prog_sem_open.c
buildtools/Cmake/test_prog/prog_thread_storage.c
buildtools/jenkins/run.bat [changed mode: 0644->0755]
buildtools/jenkins/run.sh [changed mode: 0644->0755]
buildtools/jenkins/runmingw.sh [changed mode: 0644->0755]
buildtools/pipol/Experimental_bindings.sh
buildtools/pipol/Nightly_simgrid.sh
contrib/benchmarking_code_block/Rhist.R [new file with mode: 0644]
contrib/benchmarking_code_block/bench.h [new file with mode: 0644]
contrib/benchmarking_code_block/inject.h [new file with mode: 0644]
doc/doxygen/bindings.doc
doc/doxygen/inside_release.doc
doc/doxygen/introduction.doc
doc/doxygen/module-smpi.doc
doc/doxygen/options.doc
doc/doxygen/platform.doc
doc/doxygen/tracing.doc
doc/msg-tuto-src/masterworker0.c
doc/msg-tuto-src/masterworker1.c
doc/msg-tuto-src/masterworker2.c
doc/msg-tuto-src/masterworker3.c
doc/msg-tuto-src/masterworker4.c
doc/webcruft/AS_hierarchy.png [moved from doc/AS_hierarchy.png with 100% similarity]
doc/webcruft/smpi_simgrid_alltoall_pair_16.png [new file with mode: 0644]
doc/webcruft/smpi_simgrid_alltoall_ring_16.png [new file with mode: 0644]
examples/java/async/AsyncTest.java
examples/java/async/FinalizeTask.java
examples/java/async/Forwarder.java
examples/java/async/Master.java
examples/java/async/Slave.java
examples/java/async/async.tesh
examples/java/bittorrent/Bittorrent.java
examples/java/bittorrent/Common.java
examples/java/bittorrent/Connection.java
examples/java/bittorrent/MessageTask.java
examples/java/bittorrent/Peer.java
examples/java/bittorrent/Tracker.java
examples/java/bittorrent/TrackerTask.java
examples/java/chord/Chord.java
examples/java/chord/ChordTask.java
examples/java/chord/Common.java
examples/java/chord/FindSuccessorAnswerTask.java
examples/java/chord/FindSuccessorTask.java
examples/java/chord/GetPredecessorAnswerTask.java
examples/java/chord/GetPredecessorTask.java
examples/java/chord/Node.java
examples/java/chord/NotifyTask.java
examples/java/cloud/Cloud.java
examples/java/cloud/FinalizeTask.java
examples/java/cloud/Master.java
examples/java/cloud/Slave.java
examples/java/commTime/CommTimeTest.java
examples/java/commTime/FinalizeTask.java
examples/java/commTime/Master.java
examples/java/commTime/Slave.java
examples/java/kademlia/Answer.java
examples/java/kademlia/Bucket.java
examples/java/kademlia/Common.java
examples/java/kademlia/Contact.java
examples/java/kademlia/FindNodeAnswerTask.java
examples/java/kademlia/FindNodeTask.java
examples/java/kademlia/Kademlia.java
examples/java/kademlia/KademliaTask.java
examples/java/kademlia/Node.java
examples/java/kademlia/PingAnswerTask.java
examples/java/kademlia/PingTask.java
examples/java/kademlia/RoutingTable.java
examples/java/master_slave_bypass/FinalizeTask.java
examples/java/master_slave_bypass/Master.java
examples/java/master_slave_bypass/MsBypass.java
examples/java/master_slave_bypass/Slave.java
examples/java/master_slave_kill/FinalizeTask.java
examples/java/master_slave_kill/Master.java
examples/java/master_slave_kill/MsKill.java
examples/java/master_slave_kill/Slave.java
examples/java/masterslave/FinalizeTask.java
examples/java/masterslave/Forwarder.java
examples/java/masterslave/Master.java
examples/java/masterslave/Masterslave.java
examples/java/masterslave/Slave.java
examples/java/migration/Policeman.java
examples/java/mutualExclusion/Coordinator.java
examples/java/mutualExclusion/GrantTask.java
examples/java/mutualExclusion/MutexCentral.java
examples/java/mutualExclusion/Node.java
examples/java/mutualExclusion/ReleaseTask.java
examples/java/mutualExclusion/RequestTask.java
examples/java/mutualExclusion/mutex_centralized_deployment.xml
examples/java/mutualExclusion/mutualexclusion.tesh
examples/java/pingPong/PingPongTask.java
examples/java/pingPong/PingPongTest.java
examples/java/pingPong/Receiver.java
examples/java/pingPong/Sender.java
examples/java/priority/Priority.java
examples/java/startKillTime/Master.java
examples/java/startKillTime/Slave.java
examples/java/startKillTime/StartKillTime.java
examples/java/suspend/DreamMaster.java
examples/java/suspend/LazyGuy.java
examples/java/suspend/Suspend.java
examples/java/tracing/PingPongTask.java
examples/java/tracing/Receiver.java
examples/java/tracing/Sender.java
examples/java/tracing/TracingTest.java
examples/msg/actions/actions.c
examples/msg/bittorrent/bittorrent.c
examples/msg/bittorrent/bittorrent.h
examples/msg/bittorrent/bittorrent_platfgen.c
examples/msg/bittorrent/connection.c
examples/msg/bittorrent/connection.h
examples/msg/bittorrent/messages.c
examples/msg/bittorrent/messages.h
examples/msg/bittorrent/peer.c
examples/msg/bittorrent/peer.h
examples/msg/bittorrent/tracker.c
examples/msg/bittorrent/tracker.h
examples/msg/chainsend/broadcaster.c
examples/msg/chainsend/chainsend.c
examples/msg/chainsend/common.h
examples/msg/chainsend/messages.c
examples/msg/chainsend/messages.h
examples/msg/chainsend/peer.c
examples/msg/chainsend/peer.h
examples/msg/chord/chord.c
examples/msg/chord/chord.tesh
examples/msg/chord/chord_crosstraffic.tesh
examples/msg/cloud/masterslave_virtual_machines.c
examples/msg/energy/e1/CMakeLists.txt [new file with mode: 0644]
examples/msg/energy/e1/deployment_e1.xml [new file with mode: 0644]
examples/msg/energy/e1/e1.c [new file with mode: 0644]
examples/msg/energy/e1/platform_e1.xml [new file with mode: 0644]
examples/msg/energy/e1/pstate.tesh [new file with mode: 0644]
examples/msg/energy/e2/CMakeLists.txt [new file with mode: 0644]
examples/msg/energy/e2/deployment_e2.xml [moved from examples/msg/mc/test/deploy_snapshot_comparison.xml with 64% similarity]
examples/msg/energy/e2/e2.c [new file with mode: 0644]
examples/msg/energy/e2/energy_consumption.tesh [new file with mode: 0644]
examples/msg/energy/e2/platform_e2.xml [new file with mode: 0644]
examples/msg/energy/e3/CMakeLists.txt [new file with mode: 0644]
examples/msg/energy/e3/concurrent_tasks.tesh [new file with mode: 0644]
examples/msg/energy/e3/deployment_e3.xml [new file with mode: 0644]
examples/msg/energy/e3/e3.c [new file with mode: 0644]
examples/msg/energy/e3/platform_e3.xml [new file with mode: 0644]
examples/msg/gpu/test_MSG_gpu_task_create.c
examples/msg/gtnets/gtnets.c
examples/msg/icomms/peer.c
examples/msg/icomms/peer2.c
examples/msg/icomms/peer3.c
examples/msg/io/file.c
examples/msg/io/file_unlink.c
examples/msg/io/io.tesh
examples/msg/kademlia/answer.c
examples/msg/kademlia/node.c
examples/msg/kademlia/routing_table.c
examples/msg/masterslave/masterslave_arg.c
examples/msg/masterslave/masterslave_bypass.c
examples/msg/masterslave/masterslave_cluster.c
examples/msg/masterslave/masterslave_cpu_ti_crosstraffic.tesh
examples/msg/masterslave/masterslave_failure.c
examples/msg/masterslave/masterslave_failure.tesh
examples/msg/masterslave/masterslave_failure_crosstraffic.tesh
examples/msg/masterslave/masterslave_failure_platfgen.c
examples/msg/masterslave/masterslave_forwarder.c
examples/msg/masterslave/masterslave_kill.c
examples/msg/masterslave/masterslave_mailbox.c
examples/msg/masterslave/masterslave_platfgen.c
examples/msg/mc/CMakeLists.txt
examples/msg/mc/bugged1.c
examples/msg/mc/bugged1.tesh
examples/msg/mc/bugged1_liveness.c
examples/msg/mc/bugged1_liveness.tesh
examples/msg/mc/bugged1_liveness_visited.tesh [new file with mode: 0644]
examples/msg/mc/bugged2.c
examples/msg/mc/bugged2.tesh
examples/msg/mc/bugged2_liveness.c
examples/msg/mc/bugged3.c
examples/msg/mc/centralized_mutex.c
examples/msg/mc/chord/chord.c [deleted file]
examples/msg/mc/chord/chord_neverjoin.tesh [deleted file]
examples/msg/mc/chord/chord_neverjoin_timeout_visited.tesh [deleted file]
examples/msg/mc/chord/deploy_chord4.xml [deleted file]
examples/msg/mc/deploy_bugged1_liveness_visited.xml [new file with mode: 0644]
examples/msg/mc/parse_dwarf [deleted file]
examples/msg/mc/test/promela [deleted file]
examples/msg/mc/test/snapshot_comparison1.c [deleted file]
examples/msg/mc/test/snapshot_comparison1.tesh [deleted file]
examples/msg/mc/test/snapshot_comparison2.c [deleted file]
examples/msg/mc/test/snapshot_comparison2.tesh [deleted file]
examples/msg/mc/test/snapshot_comparison3.c [deleted file]
examples/msg/mc/test/snapshot_comparison3.tesh [deleted file]
examples/msg/mc/test/snapshot_comparison4.c [deleted file]
examples/msg/mc/test/snapshot_comparison4.tesh [deleted file]
examples/msg/mc/test/snapshot_comparison5.c [deleted file]
examples/msg/mc/test/snapshot_comparison5.tesh [deleted file]
examples/msg/mc/test/snapshot_comparison_platform.xml [deleted file]
examples/msg/migration/migration.c
examples/msg/ns3/ns3.c
examples/msg/parallel_task/parallel_task.c
examples/msg/parallel_task/test_ptask.c
examples/msg/pmm/msg_pmm.c
examples/msg/priority/priority.c
examples/msg/properties/msg_prop.c
examples/msg/sendrecv/sendrecv.c
examples/msg/start_kill_time/sk_time.c
examples/msg/suspend/suspend.c
examples/msg/token_ring/ring_call.c
examples/msg/token_ring/token_bypass.c
examples/msg/tracing/categories.c
examples/msg/tracing/ms.c
examples/msg/tracing/procmig.c
examples/msg/tracing/simple.c
examples/msg/tracing/trace_platform.c
examples/msg/tracing/trace_platform.tesh
examples/msg/tracing/user_variables.c
examples/platforms/cluster_and_one_host.xml
examples/platforms/content/storage_content.txt
examples/platforms/content/win_storage_content.txt [new file with mode: 0644]
examples/platforms/storage.xml
examples/scala/master_slave_bypass/FinalizeTask.scala
examples/scala/master_slave_bypass/Master.scala
examples/scala/master_slave_bypass/MsBypass.scala
examples/scala/master_slave_bypass/Slave.scala
examples/scala/master_slave_kill/FinalizeTask.scala
examples/scala/master_slave_kill/Master.scala
examples/scala/master_slave_kill/MsKill.scala
examples/scala/master_slave_kill/Slave.scala
examples/scala/masterslave/FinalizeTask.scala
examples/scala/masterslave/Forwarder.scala
examples/scala/masterslave/Master.scala
examples/scala/masterslave/Masterslave.scala
examples/scala/masterslave/Slave.scala
examples/simdag/dax/dax_test.c
examples/simdag/dot/dot_test.c
examples/simdag/dot/dot_test2.c
examples/simdag/dot/simulate_dot.c
examples/simdag/dot/test_simdag_dotload.tesh
examples/simdag/goal/goal_test.c
examples/simdag/io/CMakeLists.txt [new file with mode: 0644]
examples/simdag/io/io.tesh [new file with mode: 0644]
examples/simdag/io/sd_io.c [new file with mode: 0644]
examples/simdag/metaxml/sd_meta.c
examples/simdag/properties/sd_prop.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_avail.c
examples/simdag/sd_comm_throttling.c
examples/simdag/sd_fail.c
examples/simdag/sd_seq_access.c
examples/simdag/sd_test.c
examples/simdag/sd_test2.c
examples/simdag/sd_typed_tasks_test.c
examples/simdag/simdag_trace.c
examples/smpi/CMakeLists.txt
examples/smpi/MM/2.5D_MM.c
examples/smpi/MM/Summa.c
examples/smpi/MM/command_exemple
examples/smpi/NAS/EP-sampling/ep.c
examples/smpi/NAS/EP-trace/ep-trace.c
examples/smpi/NAS/EP/ep.c
examples/smpi/bcbench.c
examples/smpi/mc/bugged1.c [moved from examples/smpi/mc_bugged1.c with 91% similarity]
examples/smpi/mc/bugged1_liveness.c [new file with mode: 0644]
examples/smpi/mc/bugged2.c [moved from examples/smpi/mc_bugged2.c with 96% similarity]
examples/smpi/mc/hostfile_bugged1 [new file with mode: 0644]
examples/smpi/mc/hostfile_bugged1_liveness [new file with mode: 0644]
examples/smpi/mc/hostfile_bugged2 [new file with mode: 0644]
examples/smpi/mc/promela_bugged1_liveness [new file with mode: 0644]
examples/smpi/mvmul.c
examples/smpi/replay/actions_allgatherv.txt
examples/smpi/replay/actions_alltoallv.txt
examples/smpi/replay/replay.c
examples/smpi/replay/smpi_replay.tesh
examples/smpi/tracing/smpi_traced.c
examples/smpi/tracing/smpi_traced.tesh
examples/xbt/sem_basic.c
examples/xbt/sem_sched.c
include/instr/instr.h
include/msg/datatypes.h
include/msg/msg.h
include/simdag/datatypes.h
include/simdag/simdag.h
include/simgrid/modelchecker.h
include/simgrid/platf.h
include/simgrid/platf_generator.h
include/simgrid/simix.h
include/simgrid_config.h.in
include/smpi/mpi.h
include/smpi/mpif.h.in [moved from include/smpi/mpif.h with 57% similarity]
include/smpi/smpi.h
include/smpi/smpi_cocci.h
include/smpi/smpif.h.in
include/surf/simgrid_dtd.h
include/surf/surf_routing.h
include/surf/surfxml_parse.h
include/xbt.h
include/xbt/asserts.h
include/xbt/config.h
include/xbt/cunit.h
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/ex.h
include/xbt/fifo.h
include/xbt/function_types.h
include/xbt/graph.h
include/xbt/graphxml_parse.h
include/xbt/hash.h
include/xbt/heap.h
include/xbt/lib.h
include/xbt/log.h
include/xbt/mallocator.h
include/xbt/matrix.h
include/xbt/misc.h
include/xbt/mmalloc.h
include/xbt/module.h
include/xbt/parmap.h
include/xbt/peer.h
include/xbt/queue.h
include/xbt/replay.h
include/xbt/set.h
include/xbt/str.h
include/xbt/strbuff.h
include/xbt/swag.h
include/xbt/synchro_core.h
include/xbt/sysdep.h
include/xbt/virtu.h
include/xbt/xbt_os_thread.h
src/bindings/bindings_global.c
src/bindings/java/jmsg.c
src/bindings/java/jmsg.h
src/bindings/java/jmsg_as.c
src/bindings/java/jmsg_as.h
src/bindings/java/jmsg_comm.c
src/bindings/java/jmsg_comm.h
src/bindings/java/jmsg_file.c
src/bindings/java/jmsg_file.h
src/bindings/java/jmsg_host.c
src/bindings/java/jmsg_host.h
src/bindings/java/jmsg_process.c
src/bindings/java/jmsg_process.h
src/bindings/java/jmsg_rngstream.c
src/bindings/java/jmsg_rngstream.h
src/bindings/java/jmsg_synchro.c
src/bindings/java/jmsg_synchro.h
src/bindings/java/jmsg_task.c
src/bindings/java/jmsg_task.h
src/bindings/java/jmsg_vm.c
src/bindings/java/jmsg_vm.h
src/bindings/java/jtrace.c
src/bindings/java/jxbt_utilities.c
src/bindings/java/jxbt_utilities.h
src/bindings/java/org/simgrid/msg/As.java
src/bindings/java/org/simgrid/msg/Comm.java
src/bindings/java/org/simgrid/msg/File.java
src/bindings/java/org/simgrid/msg/Host.java
src/bindings/java/org/simgrid/msg/HostFailureException.java
src/bindings/java/org/simgrid/msg/HostNotFoundException.java
src/bindings/java/org/simgrid/msg/JniException.java
src/bindings/java/org/simgrid/msg/Msg.java
src/bindings/java/org/simgrid/msg/MsgException.java
src/bindings/java/org/simgrid/msg/Mutex.java
src/bindings/java/org/simgrid/msg/NativeException.java
src/bindings/java/org/simgrid/msg/Process.java
src/bindings/java/org/simgrid/msg/ProcessKilledError.java
src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java
src/bindings/java/org/simgrid/msg/RngStream.java
src/bindings/java/org/simgrid/msg/Semaphore.java
src/bindings/java/org/simgrid/msg/Task.java
src/bindings/java/org/simgrid/msg/TaskCancelledException.java
src/bindings/java/org/simgrid/msg/TimeoutException.java
src/bindings/java/org/simgrid/msg/TransferFailureException.java
src/bindings/java/org/simgrid/msg/VM.java
src/bindings/java/org/simgrid/trace/Trace.java
src/bindings/java/smx_context_cojava.c
src/bindings/java/smx_context_cojava.h
src/bindings/java/smx_context_java.c
src/bindings/java/smx_context_java.h
src/bindings/lua/lua_comm.c
src/bindings/lua/lua_host.c
src/bindings/lua/lua_platf.c
src/bindings/lua/lua_private.h
src/bindings/lua/lua_process.c
src/bindings/lua/lua_state_cloner.c
src/bindings/lua/lua_state_cloner.h
src/bindings/lua/lua_task.c
src/bindings/lua/lua_utils.c
src/bindings/lua/lua_utils.h
src/bindings/lua/simgrid_lua.c
src/include/mc/datatypes.h
src/include/mc/mc.h
src/include/simgrid/platf_interface.h
src/include/simgrid/sg_config.h
src/include/smpi/smpi_interface.h
src/include/surf/datatypes.h
src/include/surf/maxmin.h
src/include/surf/random_mgr.h
src/include/surf/surf.h
src/include/surf/surf_resource.h
src/include/surf/surf_resource_lmm.h
src/include/surf/surfxml_parse_values.h
src/include/surf/trace_mgr.h
src/include/xbt/xbt_os_time.h
src/instr/instr_config.c
src/instr/instr_interface.c
src/instr/instr_paje_containers.c
src/instr/instr_paje_header.c
src/instr/instr_paje_trace.c
src/instr/instr_paje_values.c
src/instr/instr_private.h
src/instr/instr_resource_utilization.c
src/instr/jedule/jedule_sd_binding.c
src/mc/mc_checkpoint.c
src/mc/mc_compare.c
src/mc/mc_dpor.c
src/mc/mc_global.c
src/mc/mc_liveness.c
src/mc/mc_memory.c
src/mc/mc_pair.c
src/mc/mc_private.h
src/mc/mc_request.c
src/mc/mc_state.c
src/mc/memory_map.c
src/msg/instr_msg_process.c
src/msg/instr_msg_task.c
src/msg/instr_msg_vm.c
src/msg/msg_actions.c
src/msg/msg_deployment.c
src/msg/msg_environment.c
src/msg/msg_global.c
src/msg/msg_gos.c
src/msg/msg_host.c
src/msg/msg_io.c
src/msg/msg_mailbox.c
src/msg/msg_mailbox.h
src/msg/msg_new_api.c
src/msg/msg_private.h
src/msg/msg_process.c
src/msg/msg_synchro.c
src/msg/msg_task.c
src/msg/msg_vm.c
src/portable.h
src/simdag/private.h
src/simdag/sd_daxloader.c
src/simdag/sd_dotloader.c
src/simdag/sd_global.c
src/simdag/sd_link.c
src/simdag/sd_task.c
src/simdag/sd_workstation.c
src/simgrid/sg_config.c
src/simix/README_attempt_without_stack
src/simix/smx_context.c
src/simix/smx_context_base.c
src/simix/smx_context_raw.c
src/simix/smx_context_sysv.c
src/simix/smx_context_thread.c
src/simix/smx_deployment.c
src/simix/smx_environment.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_host_private.h
src/simix/smx_io.c
src/simix/smx_io_private.h
src/simix/smx_network.c
src/simix/smx_network_private.h
src/simix/smx_new_api.c
src/simix/smx_new_api_private.h
src/simix/smx_private.h
src/simix/smx_process.c
src/simix/smx_process_private.h
src/simix/smx_smurf_private.h
src/simix/smx_synchro.c
src/simix/smx_user.c
src/smpi/colls/COPYRIGHTS [deleted file]
src/smpi/colls/allgather-2dmesh.c
src/smpi/colls/allgather-3dmesh.c
src/smpi/colls/allgather-GB.c
src/smpi/colls/allgather-NTSLR-NB.c
src/smpi/colls/allgather-NTSLR.c
src/smpi/colls/allgather-SMP-NTS.c
src/smpi/colls/allgather-bruck.c
src/smpi/colls/allgather-loosely-lr.c
src/smpi/colls/allgather-lr.c [deleted file]
src/smpi/colls/allgather-ompi-neighborexchange.c
src/smpi/colls/allgather-pair.c
src/smpi/colls/allgather-rdb.c
src/smpi/colls/allgather-rhv.c
src/smpi/colls/allgather-ring.c
src/smpi/colls/allgather-smp-simple.c
src/smpi/colls/allgather-spreading-simple.c
src/smpi/colls/allgatherv-mpich-rdb.c
src/smpi/colls/allgatherv-mpich-ring.c [new file with mode: 0644]
src/smpi/colls/allgatherv-ompi-bruck.c
src/smpi/colls/allgatherv-ompi-neighborexchange.c
src/smpi/colls/allgatherv-pair.c
src/smpi/colls/allgatherv-ring.c
src/smpi/colls/allreduce-NTS.c [deleted file]
src/smpi/colls/allreduce-lr.c
src/smpi/colls/allreduce-rab-rdb.c
src/smpi/colls/allreduce-rab-reduce-scatter.c [deleted file]
src/smpi/colls/allreduce-rab-rsag.c [deleted file]
src/smpi/colls/allreduce-rab1.c
src/smpi/colls/allreduce-rdb.c
src/smpi/colls/allreduce-redbcast.c
src/smpi/colls/allreduce-smp-binomial-pipeline.c
src/smpi/colls/allreduce-smp-binomial.c
src/smpi/colls/allreduce-smp-rdb.c
src/smpi/colls/allreduce-smp-rsag-lr.c
src/smpi/colls/allreduce-smp-rsag-rab.c
src/smpi/colls/allreduce-smp-rsag.c
src/smpi/colls/alltoall-2dmesh.c
src/smpi/colls/alltoall-3dmesh.c
src/smpi/colls/alltoall-bruck.c
src/smpi/colls/alltoall-pair-light-barrier.c
src/smpi/colls/alltoall-pair-mpi-barrier.c
src/smpi/colls/alltoall-pair-one-barrier.c
src/smpi/colls/alltoall-pair.c
src/smpi/colls/alltoall-rdb.c
src/smpi/colls/alltoall-ring-light-barrier.c
src/smpi/colls/alltoall-ring-mpi-barrier.c
src/smpi/colls/alltoall-ring-one-barrier.c
src/smpi/colls/alltoall-ring.c
src/smpi/colls/alltoall-simple.c [deleted file]
src/smpi/colls/alltoallv-bruck.c
src/smpi/colls/alltoallv-ompi-basic-linear.c [new file with mode: 0644]
src/smpi/colls/alltoallv-pair-light-barrier.c
src/smpi/colls/alltoallv-pair-mpi-barrier.c
src/smpi/colls/alltoallv-pair-one-barrier.c
src/smpi/colls/alltoallv-pair.c
src/smpi/colls/alltoallv-ring-light-barrier.c
src/smpi/colls/alltoallv-ring-mpi-barrier.c
src/smpi/colls/alltoallv-ring-one-barrier.c
src/smpi/colls/alltoallv-ring.c
src/smpi/colls/barrier-ompi.c
src/smpi/colls/bcast-NTSB.c
src/smpi/colls/bcast-NTSL-Isend.c
src/smpi/colls/bcast-NTSL.c
src/smpi/colls/bcast-SMP-binary.c
src/smpi/colls/bcast-SMP-binomial.c
src/smpi/colls/bcast-SMP-linear.c
src/smpi/colls/bcast-arrival-nb.c [deleted file]
src/smpi/colls/bcast-arrival-pattern-aware-wait.c
src/smpi/colls/bcast-arrival-pattern-aware.c
src/smpi/colls/bcast-arrival-scatter.c
src/smpi/colls/bcast-binomial-tree.c
src/smpi/colls/bcast-flattree-pipeline.c
src/smpi/colls/bcast-flattree.c
src/smpi/colls/bcast-ompi-pipeline.c
src/smpi/colls/bcast-ompi-split-bintree.c
src/smpi/colls/bcast-scatter-LR-allgather.c
src/smpi/colls/bcast-scatter-rdb-allgather.c
src/smpi/colls/coll_tuned_topo.c
src/smpi/colls/colls.h
src/smpi/colls/gather-ompi.c
src/smpi/colls/reduce-NTSL.c
src/smpi/colls/reduce-arrival-pattern-aware.c
src/smpi/colls/reduce-binomial.c
src/smpi/colls/reduce-flat-tree.c
src/smpi/colls/reduce-ompi.c
src/smpi/colls/reduce-scatter-gather.c
src/smpi/colls/reduce_scatter-mpich.c
src/smpi/colls/reduce_scatter-ompi.c
src/smpi/colls/scatter-ompi.c
src/smpi/colls/smpi_automatic_selector.c [new file with mode: 0644]
src/smpi/colls/smpi_mpich_selector.c
src/smpi/colls/smpi_openmpi_selector.c
src/smpi/instr_smpi.c
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_c99.c
src/smpi/smpi_coll.c
src/smpi/smpi_comm.c
src/smpi/smpi_f77.c
src/smpi/smpi_global.c
src/smpi/smpi_group.c
src/smpi/smpi_mpi.c
src/smpi/smpi_mpi_dt.c
src/smpi/smpi_mpi_dt_private.h
src/smpi/smpi_pmpi.c
src/smpi/smpi_replay.c
src/smpi/smpif2c.in
src/smpi/smpif90.in
src/smpi/smpiff.in
src/surf/cpu.cpp
src/surf/cpu.hpp
src/surf/cpu_cas01.c [new file with mode: 0644]
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_cas01_private.h [new file with mode: 0644]
src/surf/cpu_ti.c [new file with mode: 0644]
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/cpu_ti_private.h
src/surf/fair_bottleneck.c
src/surf/gtnets/gtnets_interface.h
src/surf/gtnets/gtnets_simulator.h
src/surf/gtnets/gtnets_topology.h
src/surf/instr_routing.c
src/surf/instr_surf.c
src/surf/lagrange.c
src/surf/maxmin.c
src/surf/maxmin_private.h
src/surf/network.c [new file with mode: 0644]
src/surf/network.cpp
src/surf/network_constant.c [new file with mode: 0644]
src/surf/network_constant.cpp
src/surf/network_gtnets.c [new file with mode: 0644]
src/surf/network_gtnets_private.h
src/surf/network_ns3.c
src/surf/network_ns3_private.h
src/surf/network_private.h
src/surf/network_smpi.cpp
src/surf/new_model.c [new file with mode: 0644]
src/surf/ns3/ns3_interface.cc
src/surf/ns3/ns3_interface.h
src/surf/ns3/ns3_simulator.cc
src/surf/ns3/ns3_simulator.h
src/surf/random_mgr.c
src/surf/sg_platf.c
src/surf/simgrid.dtd
src/surf/simgrid_dtd.c
src/surf/storage.c [new file with mode: 0644]
src/surf/storage.cpp
src/surf/storage.hpp
src/surf/storage_private.h
src/surf/surf.c [new file with mode: 0644]
src/surf/surf.cpp
src/surf/surf.hpp
src/surf/surf_action.c [new file with mode: 0644]
src/surf/surf_interface.cpp
src/surf/surf_model.c [new file with mode: 0644]
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surf_routing_cluster.c [new file with mode: 0644]
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_generic.cpp
src/surf/surf_routing_none.c [new file with mode: 0644]
src/surf/surf_routing_private.h
src/surf/surf_routing_vivaldi.c [new file with mode: 0644]
src/surf/surfxml_parse.c
src/surf/surfxml_parseplatf.c
src/surf/trace_mgr.c
src/surf/trace_mgr_private.h
src/surf/workstation.c [new file with mode: 0644]
src/surf/workstation.cpp
src/surf/workstation.hpp
src/surf/workstation_ptask_L07.c [new file with mode: 0644]
src/surf/workstation_ptask_L07.cpp
src/surf/workstation_ptask_L07.hpp
src/win32/config.h
src/xbt/automaton/automaton.c
src/xbt/automaton/automatonparse_promela.c
src/xbt/backtrace_dummy.c
src/xbt/backtrace_linux.c
src/xbt/backtrace_windows.c
src/xbt/config.c
src/xbt/cunit.c
src/xbt/dict.c
src/xbt/dict_cursor.c
src/xbt/dict_elm.c
src/xbt/dict_multi.c
src/xbt/dict_private.h
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/ex_interface.h
src/xbt/fifo.c
src/xbt/fifo_private.h
src/xbt/graph.c
src/xbt/graph_private.h
src/xbt/graphxml_parse.c
src/xbt/heap.c
src/xbt/heap_private.h
src/xbt/lib.c
src/xbt/log.c
src/xbt/mallocator.c
src/xbt/mallocator_private.h
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm.c
src/xbt/mmalloc/mm_diff.c
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/parmap.c
src/xbt/set.c
src/xbt/swag.c
src/xbt/xbt_log_appender_file.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c
src/xbt/xbt_main.c
src/xbt/xbt_matrix.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_os_time.c
src/xbt/xbt_peer.c
src/xbt/xbt_queue.c
src/xbt/xbt_replay.c
src/xbt/xbt_sg_stubs.c
src/xbt/xbt_sg_synchro.c
src/xbt/xbt_sha.c
src/xbt/xbt_str.c
src/xbt/xbt_strbuff.c
src/xbt/xbt_virtu.c
src/xbt_modinter.h
teshsuite/CMakeLists.txt [deleted file]
teshsuite/SimGrid.tesh [deleted file]
teshsuite/msg/get_sender.c
teshsuite/msg/pid.c
teshsuite/msg/storage/CMakeLists.txt [new file with mode: 0644]
teshsuite/msg/storage/deployment.xml [new file with mode: 0644]
teshsuite/msg/storage/platform.xml [new file with mode: 0644]
teshsuite/msg/storage/storage.c [new file with mode: 0644]
teshsuite/msg/storage/storage.tesh [new file with mode: 0644]
teshsuite/msg/storage/storage_content_c.txt [new file with mode: 0644]
teshsuite/msg/storage/storage_content_s1.txt [new file with mode: 0644]
teshsuite/msg/storage/storage_content_s2.txt [new file with mode: 0644]
teshsuite/msg/trace/test_trace_integration.c
teshsuite/simdag/availability/availability_test.tesh
teshsuite/simdag/network/mxn/test_intra_all2all.c
teshsuite/simdag/network/mxn/test_intra_all2all.tesh
teshsuite/simdag/network/mxn/test_intra_independent_comm.c
teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh
teshsuite/simdag/network/mxn/test_intra_scatter.c
teshsuite/simdag/network/mxn/test_intra_scatter.tesh
teshsuite/simdag/network/p2p/test_latency1.c
teshsuite/simdag/network/p2p/test_latency1.tesh
teshsuite/simdag/network/p2p/test_latency2.c
teshsuite/simdag/network/p2p/test_latency2.tesh
teshsuite/simdag/network/p2p/test_latency3.c
teshsuite/simdag/network/p2p/test_latency3.tesh
teshsuite/simdag/network/p2p/test_latency_bound.c
teshsuite/simdag/network/p2p/test_latency_bound.tesh
teshsuite/simdag/network/test_reinit_costs.c
teshsuite/simdag/network/test_reinit_costs.tesh
teshsuite/simdag/partask/test_comp_only_par.c
teshsuite/simdag/partask/test_comp_only_par.tesh
teshsuite/simdag/partask/test_comp_only_seq.c
teshsuite/simdag/partask/test_comp_only_seq.tesh
teshsuite/simdag/platforms/Evaluate_get_route_time.c
teshsuite/simdag/platforms/Evaluate_parse_time.c
teshsuite/simdag/platforms/basic_link_test.c
teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/basic_parsing_test.tesh
teshsuite/simdag/platforms/basic_parsing_test_bypass.tesh
teshsuite/simdag/platforms/basic_parsing_test_sym_full.tesh
teshsuite/simdag/platforms/basic_tracing.c
teshsuite/simdag/platforms/flatifier.c
teshsuite/simdag/platforms/flatifier.tesh
teshsuite/simdag/platforms/get_full_link.tesh
teshsuite/simdag/platforms/is_router_test.c
teshsuite/simix/CMakeLists.txt [new file with mode: 0644]
teshsuite/simix/check_defaults.c [new file with mode: 0644]
teshsuite/simix/factory_raw.tesh [new file with mode: 0644]
teshsuite/simix/factory_thread.tesh [new file with mode: 0644]
teshsuite/simix/factory_ucontext.tesh [new file with mode: 0644]
teshsuite/smpi/CMakeLists.txt
teshsuite/smpi/allgather_coll.c
teshsuite/smpi/allgather_coll.tesh
teshsuite/smpi/allgatherv_coll.c
teshsuite/smpi/allgatherv_coll.tesh
teshsuite/smpi/allreduce_coll.c
teshsuite/smpi/allreduce_coll.tesh
teshsuite/smpi/allreduce_coll_large.tesh [new file with mode: 0644]
teshsuite/smpi/alltoall_basic.c
teshsuite/smpi/alltoall_coll.c
teshsuite/smpi/alltoall_coll.tesh
teshsuite/smpi/alltoallv_coll.tesh
teshsuite/smpi/barrier.c
teshsuite/smpi/barrier_coll.tesh
teshsuite/smpi/bcast.c
teshsuite/smpi/bcast.tesh
teshsuite/smpi/bcast_coll.c
teshsuite/smpi/bcast_coll.tesh
teshsuite/smpi/compute.c
teshsuite/smpi/compute.tesh
teshsuite/smpi/compute2.c
teshsuite/smpi/compute3.c
teshsuite/smpi/dsend.c
teshsuite/smpi/gather_coll.c
teshsuite/smpi/gather_coll.tesh
teshsuite/smpi/get_processor_name.c
teshsuite/smpi/hvector.tesh
teshsuite/smpi/indexed.tesh
teshsuite/smpi/mpich-test/README [deleted file]
teshsuite/smpi/mpich-test/coll/CMakeLists.txt [deleted file]
teshsuite/smpi/mpich-test/coll/allgatherf.f [deleted file]
teshsuite/smpi/mpich-test/coll/allred.c [deleted file]
teshsuite/smpi/mpich-test/coll/allred.std [deleted file]
teshsuite/smpi/mpich-test/coll/allred2.c [deleted file]
teshsuite/smpi/mpich-test/coll/allredf.f [deleted file]
teshsuite/smpi/mpich-test/coll/allredf.std [deleted file]
teshsuite/smpi/mpich-test/coll/allredmany.std [deleted file]
teshsuite/smpi/mpich-test/coll/alltoallv.c [deleted file]
teshsuite/smpi/mpich-test/coll/assocf.f [deleted file]
teshsuite/smpi/mpich-test/coll/barrier.c [deleted file]
teshsuite/smpi/mpich-test/coll/bcast.c [deleted file]
teshsuite/smpi/mpich-test/coll/bcast2.f [deleted file]
teshsuite/smpi/mpich-test/coll/bcastbug.c [deleted file]
teshsuite/smpi/mpich-test/coll/bcastbug2.c [deleted file]
teshsuite/smpi/mpich-test/coll/bcastlog.f [deleted file]
teshsuite/smpi/mpich-test/coll/bcastvec.c [deleted file]
teshsuite/smpi/mpich-test/coll/coll1.c [deleted file]
teshsuite/smpi/mpich-test/coll/coll13.c [deleted file]
teshsuite/smpi/mpich-test/coll/coll13.std [deleted file]
teshsuite/smpi/mpich-test/coll/coll4.c [deleted file]
teshsuite/smpi/mpich-test/coll/grouptest.c [deleted file]
teshsuite/smpi/mpich-test/coll/nbcoll.c [deleted file]
teshsuite/smpi/mpich-test/coll/redtst.c [deleted file]
teshsuite/smpi/mpich-test/coll/runtests [deleted file]
teshsuite/smpi/mpich-test/coll/scantst.c [deleted file]
teshsuite/smpi/mpich-test/coll/scatterv.c [deleted file]
teshsuite/smpi/mpich-test/coll/scatterv.std [deleted file]
teshsuite/smpi/mpich-test/coll/shortint.c [deleted file]
teshsuite/smpi/mpich-test/coll/temprun [deleted file]
teshsuite/smpi/mpich-test/coll/test.c [deleted file]
teshsuite/smpi/mpich-test/coll/test.h [deleted file]
teshsuite/smpi/mpich-test/context/CMakeLists.txt [deleted file]
teshsuite/smpi/mpich-test/context/attrerr.std [deleted file]
teshsuite/smpi/mpich-test/context/attrt.c [deleted file]
teshsuite/smpi/mpich-test/context/attrt.std [deleted file]
teshsuite/smpi/mpich-test/context/attrtest.f [deleted file]
teshsuite/smpi/mpich-test/context/commnames.c [deleted file]
teshsuite/smpi/mpich-test/context/commnames.std [deleted file]
teshsuite/smpi/mpich-test/context/commnamesf.f [deleted file]
teshsuite/smpi/mpich-test/context/context.std [deleted file]
teshsuite/smpi/mpich-test/context/icdup.c [deleted file]
teshsuite/smpi/mpich-test/context/ictest.c [deleted file]
teshsuite/smpi/mpich-test/context/ictest2.c [deleted file]
teshsuite/smpi/mpich-test/context/ictest3.c [deleted file]
teshsuite/smpi/mpich-test/context/runtests [deleted file]
teshsuite/smpi/mpich-test/context/test.c [deleted file]
teshsuite/smpi/mpich-test/context/test.h [deleted file]
teshsuite/smpi/mpich-test/env/CMakeLists.txt [deleted file]
teshsuite/smpi/mpich-test/env/aborttest.c [deleted file]
teshsuite/smpi/mpich-test/env/aborttest.std [deleted file]
teshsuite/smpi/mpich-test/env/argstest.c [deleted file]
teshsuite/smpi/mpich-test/env/baseattr.c [deleted file]
teshsuite/smpi/mpich-test/env/baseattrf.f [deleted file]
teshsuite/smpi/mpich-test/env/cmdline.c [deleted file]
teshsuite/smpi/mpich-test/env/env.std [deleted file]
teshsuite/smpi/mpich-test/env/errhand.c [deleted file]
teshsuite/smpi/mpich-test/env/errhand2.c [deleted file]
teshsuite/smpi/mpich-test/env/errhandf.f [deleted file]
teshsuite/smpi/mpich-test/env/errstringsf.f [deleted file]
teshsuite/smpi/mpich-test/env/errstringsf.std [deleted file]
teshsuite/smpi/mpich-test/env/getproc.c [deleted file]
teshsuite/smpi/mpich-test/env/getprocf.f [deleted file]
teshsuite/smpi/mpich-test/env/gtime.c [deleted file]
teshsuite/smpi/mpich-test/env/hang.c [deleted file]
teshsuite/smpi/mpich-test/env/init.c [deleted file]
teshsuite/smpi/mpich-test/env/runtests [deleted file]
teshsuite/smpi/mpich-test/env/sigchk.c [deleted file]
teshsuite/smpi/mpich-test/env/test.c [deleted file]
teshsuite/smpi/mpich-test/env/test.h [deleted file]
teshsuite/smpi/mpich-test/env/testerr.c [deleted file]
teshsuite/smpi/mpich-test/env/timers.c [deleted file]
teshsuite/smpi/mpich-test/env/timertest.c [deleted file]
teshsuite/smpi/mpich-test/profile/CMakeLists.txt [deleted file]
teshsuite/smpi/mpich-test/profile/colluses.c [deleted file]
teshsuite/smpi/mpich-test/profile/ptest.c [deleted file]
teshsuite/smpi/mpich-test/profile/ptest.std [deleted file]
teshsuite/smpi/mpich-test/profile/runtests [deleted file]
teshsuite/smpi/mpich-test/pt2pt/CMakeLists.txt [deleted file]
teshsuite/smpi/mpich-test/pt2pt/README [deleted file]
teshsuite/smpi/mpich-test/pt2pt/allpair.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/allpair.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/allpair2.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/allpair2.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/bsendtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancel.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancel2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancel3.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancelibm.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancelissend.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/cancelmessages.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/commit.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/dataalign.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/dtypelife.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/dtyperecv.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/dtypes.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/dtypes.h [deleted file]
teshsuite/smpi/mpich-test/pt2pt/exittest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/README [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/fairness-euih.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/fairness.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2m.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fairness/fairnessm.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fifth.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/flood.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/flood2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/fourth.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/gcomm.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/gcomm.h [deleted file]
teshsuite/smpi/mpich-test/pt2pt/getelm.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hindexed.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hindexed.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/htmsg.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hvec.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hvec.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hvectest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/hvectest2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/irecvtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/irsend.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/irsendinit.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/isendf.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/isendtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/isndrcv.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/isndrcv2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/issend2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/issendinit.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/issendtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/longmsgs.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/mpitest.h [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nblock.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nblock.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nbtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nbtest.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nullproc.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nullproc.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nullproc2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/nullproc2.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/order.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/overtake.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/pack.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/persist.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/persist2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/persistent.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/persistent.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/pingpong.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/probe.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/probe1.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/relrank.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/reqcreate.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/reqcreate.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/reqfree.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/runtests [deleted file]
teshsuite/smpi/mpich-test/pt2pt/secondf.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/self.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/self.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/selfvsworld.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/send1.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendcplx.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendcplx.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendfort.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendmany.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendmany.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendorder.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendrecv.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendrecv2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendrecv3.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sendrecv4.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sixth.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sndrcv.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/sndrcvrpl2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/ssendtest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/ssendtest2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/ssendtest2.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/structf.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/structf.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/structlb.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/systest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/systest1.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/test.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/test.h [deleted file]
teshsuite/smpi/mpich-test/pt2pt/testall.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/testhetero [deleted file]
teshsuite/smpi/mpich-test/pt2pt/testsome.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/testtest1.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/testtypes.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/third.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/trunc.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/truncmult.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typebase.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typebase.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typebasef.f [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typecreate.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typecreate.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typetest.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typeub.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typeub2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typeub2.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typeub3.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/typeub3.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitall.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitall.std [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitall2.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitall3.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitall4.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitany.c [deleted file]
teshsuite/smpi/mpich-test/pt2pt/waitany.std [deleted file]
teshsuite/smpi/mpich-test/runbase [deleted file]
teshsuite/smpi/mpich-test/topol/cart.c [deleted file]
teshsuite/smpi/mpich-test/topol/cart1f.f [deleted file]
teshsuite/smpi/mpich-test/topol/cart2.c [deleted file]
teshsuite/smpi/mpich-test/topol/cart2f.f [deleted file]
teshsuite/smpi/mpich-test/topol/cartc.f90 [deleted file]
teshsuite/smpi/mpich-test/topol/cartf.f [deleted file]
teshsuite/smpi/mpich-test/topol/cartf.std [deleted file]
teshsuite/smpi/mpich-test/topol/cartmap.c [deleted file]
teshsuite/smpi/mpich-test/topol/cartmap.std [deleted file]
teshsuite/smpi/mpich-test/topol/cartorder.c [deleted file]
teshsuite/smpi/mpich-test/topol/dims.c [deleted file]
teshsuite/smpi/mpich-test/topol/graphtest.c [deleted file]
teshsuite/smpi/mpich-test/topol/graphtest.std [deleted file]
teshsuite/smpi/mpich-test/topol/test.c [deleted file]
teshsuite/smpi/mpich-test/topol/test.h [deleted file]
teshsuite/smpi/mpich-test/topol/twod.f [deleted file]
teshsuite/smpi/mpich-test/topol/twod2.f [deleted file]
teshsuite/smpi/mpich3-test/CMakeLists.txt [moved from teshsuite/smpi/mpich-test/CMakeLists.txt with 68% similarity]
teshsuite/smpi/mpich3-test/README [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attr2type.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrend.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrend2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrerr.c [moved from teshsuite/smpi/mpich-test/context/attrerr.c with 73% similarity]
teshsuite/smpi/mpich3-test/attr/attrerrcomm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrerrtype.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attric.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrorder.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrordercomm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrordertype.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/attrt.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/baseattr2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/baseattrcomm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/fkeyval.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/fkeyvalcomm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/fkeyvaltype.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/keyval_double_free.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/attr/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/checktests [new file with mode: 0755]
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allgather2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allgather3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allgatherv2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allgatherv3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allgatherv4.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred4.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred5.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allred6.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/allredmany.c [moved from teshsuite/smpi/mpich-test/coll/allredmany.c with 62% similarity]
teshsuite/smpi/mpich3-test/coll/alltoall1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/alltoallv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/alltoallv0.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/alltoallw1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/alltoallw2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/alltoallw_zeros.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/bcast2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/bcast3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/bcasttest.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/bcastzerotype.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/coll10.c [moved from teshsuite/smpi/mpich-test/coll/coll10.c with 77% similarity]
teshsuite/smpi/mpich3-test/coll/coll11.c [moved from teshsuite/smpi/mpich-test/coll/coll11.c with 84% similarity]
teshsuite/smpi/mpich3-test/coll/coll12.c [moved from teshsuite/smpi/mpich-test/coll/coll12.c with 82% similarity]
teshsuite/smpi/mpich3-test/coll/coll13.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/coll2.c [moved from teshsuite/smpi/mpich-test/coll/coll2.c with 73% similarity]
teshsuite/smpi/mpich3-test/coll/coll3.c [moved from teshsuite/smpi/mpich-test/coll/coll3.c with 84% similarity]
teshsuite/smpi/mpich3-test/coll/coll4.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/coll5.c [moved from teshsuite/smpi/mpich-test/coll/coll5.c with 82% similarity]
teshsuite/smpi/mpich3-test/coll/coll6.c [moved from teshsuite/smpi/mpich-test/coll/coll6.c with 78% similarity]
teshsuite/smpi/mpich3-test/coll/coll7.c [moved from teshsuite/smpi/mpich-test/coll/coll7.c with 79% similarity]
teshsuite/smpi/mpich3-test/coll/coll8.c [moved from teshsuite/smpi/mpich-test/coll/coll8.c with 77% similarity]
teshsuite/smpi/mpich3-test/coll/coll9.c [moved from teshsuite/smpi/mpich-test/coll/coll9.c with 70% similarity]
teshsuite/smpi/mpich3-test/coll/exscan.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/exscan2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/gather.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/gather2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/gather2_save.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/iallred.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/ibarrier.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icallgather.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icallgatherv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icallreduce.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icalltoall.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icalltoallv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icalltoallw.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icbarrier.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icbcast.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icgather.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icgatherv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icreduce.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icscatter.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/icscatterv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/longuser.c [moved from teshsuite/smpi/mpich-test/coll/longuser.c with 88% similarity]
teshsuite/smpi/mpich3-test/coll/nonblocking.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/nonblocking2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/nonblocking3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/op_commutative.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opband.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opbor.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opbxor.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opland.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/oplor.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/oplxor.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opmax.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opmaxloc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opmin.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opminloc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opprod.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/opsum.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/red3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/red4.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/red_scat_block.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/red_scat_block2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/redscat.c [moved from teshsuite/smpi/mpich-test/coll/redscat.c with 71% similarity]
teshsuite/smpi/mpich3-test/coll/redscat2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/redscat3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/redscatbkinter.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/redscatblk3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/redscatinter.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/reduce.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/reduce_local.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/scantst.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/scatter2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/scatter3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/scattern.c [moved from teshsuite/smpi/mpich-test/coll/scattern.c with 89% similarity]
teshsuite/smpi/mpich3-test/coll/scatterv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/coll/uoplong.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/cmfree.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/cmsplit.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/cmsplit2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/cmsplit_type.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/comm_create_group.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/comm_group_half.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/comm_group_rand.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/comm_idup.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/comm_info.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/commcreate1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/commname.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/ctxalloc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/ctxsplit.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/dup.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/dup_with_info.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/dupic.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/ic1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/ic2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/iccreate.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/icgroup.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/icm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/icsplit.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/probe-intercomm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/comm/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/blockindexed-misc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/blockindexed-zero-count.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/contents.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/contig-zero-count.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/contigstruct.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/cxx-types.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/darray-cyclic.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/darray-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/gaddress.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/get-elements-pairtype.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/get-elements.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/getpartelm.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/hindexed_block.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/hindexed_block_contents.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/indexed-misc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/large-count.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/lbub.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/localpack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/longdouble.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/lots-of-types.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/pairtype-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/pairtype-size-extent.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/simple-commit.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/simple-pack-external.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/simple-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/simple-resized.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/simple-size-extent.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/sizedtypes.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/slice-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-derived-zeros.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-ezhov.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-no-real-types.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-verydeep.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/subarray-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/subarray.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/tfree.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/tmatchsize.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/transpose-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/tresized.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/tresized2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/triangular-pack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/typecommit.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/typefree.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/typelb.c [moved from teshsuite/smpi/mpich-test/pt2pt/typelb.c with 62% similarity]
teshsuite/smpi/mpich3-test/datatype/typename.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/unpack.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/zero-blklen-vector.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/zeroblks.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/datatype/zeroparms.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/attraints.h [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/attrmpi1f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/baseattr2f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/baseattrf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/commattr2f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/commattr3f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/commattrf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/typeattr2f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/typeattr3f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/attr/typeattrf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/allredint8f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/allredopttf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/alltoallvf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/alltoallwf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/exscanf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/inplacef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/nonblocking_inpf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/red_scat_blockf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/redscatf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/reducelocalf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/split_typef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/uallreducef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/vw_inplacef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/comm/commerrf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/comm/commnamef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/comm/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/allctypesf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/gaddressf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/hindex1f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/packef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typecntsf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typem2f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typename3f.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typenamef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typesnamef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/datatype/typesubf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/add1size.h [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/allocmemf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/c2f2c.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/c2f2cf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/c2fmult.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/ctypesfromc.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/ctypesinf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/ext/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/init/baseenvf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/init/checksizes.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/init/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/attr1aints.h [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/dummyf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/greqf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/mprobef.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/statusesf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/pt2pt/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/util/mtestf.f [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/allredint8f90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/allredopttf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/alltoallvf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/alltoallwf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/exscanf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/inplacef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/nonblocking_inpf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/nonblockingf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/red_scat_blockf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/reducelocalf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/split_typef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/uallreducef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/createf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/get_elem_d.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/get_elem_u.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/hindex1f90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/indtype.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/kinds.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/packef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/sizeof.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/structf.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/trf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typem2f90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typename3f90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typenamef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typesnamef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/datatype/typesubf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/init/baseenvf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/init/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/dummyf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/mprobef90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/statusesf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/pt2pt/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/groupcreate.c [moved from teshsuite/smpi/mpich-test/context/groupcreate.c with 75% similarity]
teshsuite/smpi/mpich3-test/group/groupnullincl.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/grouptest.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/grouptest2.c [moved from teshsuite/smpi/mpich-test/context/grouptest.c with 72% similarity]
teshsuite/smpi/mpich3-test/group/gtranks.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/gtranksperf.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/group/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/hostfile [new file with mode: 0644]
teshsuite/smpi/mpich3-test/include/mpitest.h [new file with mode: 0644]
teshsuite/smpi/mpich3-test/include/mpitestconf.h [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/attrself.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/exitst1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/exitst2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/exitst3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/finalized.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/initstat.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/library_version.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/timeout.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/init/version.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/anyall.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bottom.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsend1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsend2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsend3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsend4.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsend5.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsendalign.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/cancelrecv.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/eagerdt.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/greq1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/icsend.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/inactivereq.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/isendself.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/isendselfprobe.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/large_message.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/mprobe.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/pingping.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/probe-unexp.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/probenull.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/pscancel.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/rcancel.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/rqfreeb.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/rqstatus.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/scancel.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/scancel2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendall.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendflood.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendrecv1.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendrecv2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendrecv3.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/sendself.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/pt2pt/waittestnull.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/runtests [new file with mode: 0755]
teshsuite/smpi/mpich3-test/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/util/mtest.c [new file with mode: 0644]
teshsuite/smpi/pingpong.c
teshsuite/smpi/pt2pt.tesh
teshsuite/smpi/reduce.c
teshsuite/smpi/reduce.tesh
teshsuite/smpi/reduce_coll.c
teshsuite/smpi/reduce_coll.tesh
teshsuite/smpi/reduce_scatter_coll.c
teshsuite/smpi/reduce_scatter_coll.tesh
teshsuite/smpi/scatter.c
teshsuite/smpi/scatter_coll.tesh
teshsuite/smpi/sendrecv.c
teshsuite/smpi/sendtest.c
teshsuite/smpi/shared.c [new file with mode: 0644]
teshsuite/smpi/shared.tesh [new file with mode: 0644]
teshsuite/smpi/split.c
teshsuite/smpi/struct.tesh
teshsuite/smpi/struct_test.c
teshsuite/smpi/ttest01.c
teshsuite/smpi/vector.tesh
teshsuite/xbt/CMakeLists.txt
teshsuite/xbt/log_large_test.c
teshsuite/xbt/mmalloc_32.tesh
teshsuite/xbt/mmalloc_64.tesh
teshsuite/xbt/mmalloc_test.c
teshsuite/xbt/parallel_log_crashtest.c
teshsuite/xbt/parmap_test.c
testsuite/surf/lmm_usage.c
testsuite/surf/maxmin_bench.c
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c
testsuite/surf/trace_usage.c
testsuite/xbt/graphxml_usage.c
testsuite/xbt/heap_bench.c
testsuite/xbt/log_usage.c
tools/CMakeLists.txt
tools/check_dist_archive
tools/check_dist_archive.exclude
tools/doxygen/index_create.pl
tools/graphicator/graphicator.c
tools/simgrid.supp [new file with mode: 0644]
tools/simgrid_update_xml.pl
tools/spell/lspell.pl [new file with mode: 0644]
tools/spell/lspell2.pl [new file with mode: 0644]
tools/spell/sg_stopwords.txt [new file with mode: 0644]
tools/spell/spell.sh [new file with mode: 0644]
tools/tesh/CMakeLists.txt
tools/tesh/background.tesh
tools/tesh/run_context.c
tools/tesh/run_context.h
tools/tesh/signal.c
tools/tesh/tesh.c
tools/tesh/tesh.h

diff --git a/.classpath b/.classpath
new file mode 100644 (file)
index 0000000..7393058
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src/bindings/java">
+               <attributes>
+                       <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="simgrid/lib"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry excluding="*/CMakeFiles/|CMakeFiles/" kind="src" path="examples/java"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
index 8ed5023..dbcfa12 100644 (file)
@@ -33,6 +33,7 @@ src/bindings/ruby/libsimgrid.so
 examples/msg/masterslave/simgrid.so
 examples/simdag/simgrid.so
 examples/lua/console/simgrid.so
+simgrid.jar
 
 ################################################
 ### Units and supernovae files
@@ -52,6 +53,7 @@ src/internal_config.h
 src/smpi/smpicc
 src/smpi/smpirun
 simgrid-*.tar.gz
+testprog
 
 ################################################
 ### Cmake files
@@ -104,8 +106,8 @@ doc/simgrid_modules.map
 
 ################################################
 ### Specific of project 
-.project
 .settings/
+.csettings/
 .anjuta
 .anjuta_sym_db.db
 simgrid.anjuta
@@ -132,6 +134,11 @@ examples/msg/toto.txt
 examples/msg/z_gtnets.trace
 examples/msg/gpu/test_MSG_gpu_task_create
 examples/msg/cloud/masterslave_virtual_machines
+examples/msg/energy/e1/e1
+examples/msg/energy/e2/e2
+examples/msg/energy/e3/e3
+examples/msg/pastry/pastry
+examples/msg/semaphores/synchro
 examples/msg/tracing/link_srcdst_user_variables
 examples/msg/tracing/link_user_variables
 examples/msg/tracing/simple
@@ -164,6 +171,7 @@ examples/msg/icomms/toto.txt
 examples/msg/masterslave/masterslave_console
 examples/msg/irc_isend/peer
 examples/msg/irc_isend/toto.txt
+examples/simdag/sd_avail
 examples/simdag/ex_sd_seq_access
 examples/simdag/sd_seq_access
 examples/simdag/sd_comm_throttling
@@ -183,6 +191,7 @@ examples/simdag/sd_test2
 examples/simdag/dax/dax_test
 examples/simdag/goal/goal_test
 examples/simdag/scheduling/minmin_test
+examples/simdag/io/sd_io
 examples/msg/actions/actions
 examples/msg/bittorrent/bittorrent
 examples/msg/bittorrent/bittorrent_platfgen
@@ -229,6 +238,11 @@ examples/msg/mc/bugged1_stateful
 examples/msg/mc/bugged2_liveness
 examples/msg/mc/bugged2_stateful
 examples/msg/mc/centralized_liveness
+examples/msg/mc/electric_fence
+examples/smpi/mc/bugged1
+examples/smpi/mc/bugged1_liveness
+examples/smpi/mc/bugged2
+
 
 src/replay/replay
 src/testall
@@ -237,8 +251,11 @@ teshsuite/smpi/allgatherv_coll
 teshsuite/smpi/allreduce_coll
 teshsuite/smpi/alltoall_coll
 teshsuite/smpi/alltoallv_coll
+teshsuite/smpi/barrier_coll
 teshsuite/smpi/bcast_coll
+teshsuite/smpi/gather_coll
 teshsuite/smpi/reduce_coll
+teshsuite/smpi/reduce_scatter_coll
 teshsuite/smpi/allreduce
 teshsuite/smpi/alltoall2
 teshsuite/smpi/alltoall_basic
@@ -253,6 +270,7 @@ teshsuite/smpi/indexed_test
 teshsuite/smpi/pingpong
 teshsuite/smpi/reduce
 teshsuite/smpi/scatter
+teshsuite/smpi/shared
 teshsuite/smpi/smpi_sendrecv
 teshsuite/smpi/split
 teshsuite/smpi/struct_test
@@ -401,6 +419,303 @@ teshsuite/smpi/mpich-test/pt2pt/waitall2
 teshsuite/smpi/mpich-test/pt2pt/waitall3
 teshsuite/smpi/mpich-test/pt2pt/waitall4
 teshsuite/smpi/mpich-test/pt2pt/waitany
+teshsuite/smpi/mpich3-test/attr/attr2type
+teshsuite/smpi/mpich3-test/attr/attrend
+teshsuite/smpi/mpich3-test/attr/attrend2
+teshsuite/smpi/mpich3-test/attr/attrerr
+teshsuite/smpi/mpich3-test/attr/attrerrcomm
+teshsuite/smpi/mpich3-test/attr/attrerrtype
+teshsuite/smpi/mpich3-test/attr/attric
+teshsuite/smpi/mpich3-test/attr/attrorder
+teshsuite/smpi/mpich3-test/attr/attrordercomm
+teshsuite/smpi/mpich3-test/attr/attrordertype
+teshsuite/smpi/mpich3-test/attr/attrt
+teshsuite/smpi/mpich3-test/attr/baseattr2
+teshsuite/smpi/mpich3-test/attr/baseattrcomm
+teshsuite/smpi/mpich3-test/attr/fkeyval
+teshsuite/smpi/mpich3-test/attr/fkeyvalcomm
+teshsuite/smpi/mpich3-test/attr/fkeyvaltype
+teshsuite/smpi/mpich3-test/attr/keyval_double_free
+teshsuite/smpi/mpich3-test/coll/allgather2
+teshsuite/smpi/mpich3-test/coll/allgather3
+teshsuite/smpi/mpich3-test/coll/allgatherv2
+teshsuite/smpi/mpich3-test/coll/allgatherv3
+teshsuite/smpi/mpich3-test/coll/allgatherv4
+teshsuite/smpi/mpich3-test/coll/allred2
+teshsuite/smpi/mpich3-test/coll/allred3
+teshsuite/smpi/mpich3-test/coll/allred4
+teshsuite/smpi/mpich3-test/coll/allred5
+teshsuite/smpi/mpich3-test/coll/allred6
+teshsuite/smpi/mpich3-test/coll/allredmany
+teshsuite/smpi/mpich3-test/coll/alltoall1
+teshsuite/smpi/mpich3-test/coll/alltoallv
+teshsuite/smpi/mpich3-test/coll/alltoallv0
+teshsuite/smpi/mpich3-test/coll/alltoallw1
+teshsuite/smpi/mpich3-test/coll/alltoallw2
+teshsuite/smpi/mpich3-test/coll/alltoallw_zeros
+teshsuite/smpi/mpich3-test/coll/bcast2
+teshsuite/smpi/mpich3-test/coll/bcast3
+teshsuite/smpi/mpich3-test/coll/bcasttest
+teshsuite/smpi/mpich3-test/coll/bcastzerotype
+teshsuite/smpi/mpich3-test/coll/coll10
+teshsuite/smpi/mpich3-test/coll/coll11
+teshsuite/smpi/mpich3-test/coll/coll12
+teshsuite/smpi/mpich3-test/coll/coll13
+teshsuite/smpi/mpich3-test/coll/coll2
+teshsuite/smpi/mpich3-test/coll/coll3
+teshsuite/smpi/mpich3-test/coll/coll4
+teshsuite/smpi/mpich3-test/coll/coll5
+teshsuite/smpi/mpich3-test/coll/coll6
+teshsuite/smpi/mpich3-test/coll/coll7
+teshsuite/smpi/mpich3-test/coll/coll8
+teshsuite/smpi/mpich3-test/coll/coll9
+teshsuite/smpi/mpich3-test/coll/exscan
+teshsuite/smpi/mpich3-test/coll/exscan2
+teshsuite/smpi/mpich3-test/coll/gather
+teshsuite/smpi/mpich3-test/coll/gather2
+teshsuite/smpi/mpich3-test/coll/gather2_save
+teshsuite/smpi/mpich3-test/coll/iallred
+teshsuite/smpi/mpich3-test/coll/ibarrier
+teshsuite/smpi/mpich3-test/coll/icallgather
+teshsuite/smpi/mpich3-test/coll/icallgatherv
+teshsuite/smpi/mpich3-test/coll/icallreduce
+teshsuite/smpi/mpich3-test/coll/icalltoall
+teshsuite/smpi/mpich3-test/coll/icalltoallv
+teshsuite/smpi/mpich3-test/coll/icalltoallw
+teshsuite/smpi/mpich3-test/coll/icbarrier
+teshsuite/smpi/mpich3-test/coll/icbcast
+teshsuite/smpi/mpich3-test/coll/icgather
+teshsuite/smpi/mpich3-test/coll/icgatherv
+teshsuite/smpi/mpich3-test/coll/icreduce
+teshsuite/smpi/mpich3-test/coll/icscatter
+teshsuite/smpi/mpich3-test/coll/icscatterv
+teshsuite/smpi/mpich3-test/coll/longuser
+teshsuite/smpi/mpich3-test/coll/nonblocking
+teshsuite/smpi/mpich3-test/coll/nonblocking2
+teshsuite/smpi/mpich3-test/coll/nonblocking3
+teshsuite/smpi/mpich3-test/coll/op_commutative
+teshsuite/smpi/mpich3-test/coll/opband
+teshsuite/smpi/mpich3-test/coll/opbor
+teshsuite/smpi/mpich3-test/coll/opbxor
+teshsuite/smpi/mpich3-test/coll/opland
+teshsuite/smpi/mpich3-test/coll/oplor
+teshsuite/smpi/mpich3-test/coll/oplxor
+teshsuite/smpi/mpich3-test/coll/opmax
+teshsuite/smpi/mpich3-test/coll/opmaxloc
+teshsuite/smpi/mpich3-test/coll/opmin
+teshsuite/smpi/mpich3-test/coll/opminloc
+teshsuite/smpi/mpich3-test/coll/opprod
+teshsuite/smpi/mpich3-test/coll/opsum
+teshsuite/smpi/mpich3-test/coll/red3
+teshsuite/smpi/mpich3-test/coll/red4
+teshsuite/smpi/mpich3-test/coll/red_scat_block
+teshsuite/smpi/mpich3-test/coll/red_scat_block2
+teshsuite/smpi/mpich3-test/coll/redscat
+teshsuite/smpi/mpich3-test/coll/redscat2
+teshsuite/smpi/mpich3-test/coll/redscat3
+teshsuite/smpi/mpich3-test/coll/redscatbkinter
+teshsuite/smpi/mpich3-test/coll/redscatblk3
+teshsuite/smpi/mpich3-test/coll/redscatinter
+teshsuite/smpi/mpich3-test/coll/reduce_local
+teshsuite/smpi/mpich3-test/coll/reduce_mpich
+teshsuite/smpi/mpich3-test/coll/scantst
+teshsuite/smpi/mpich3-test/coll/scatter2
+teshsuite/smpi/mpich3-test/coll/scatter3
+teshsuite/smpi/mpich3-test/coll/scattern
+teshsuite/smpi/mpich3-test/coll/scatterv
+teshsuite/smpi/mpich3-test/coll/uoplong
+teshsuite/smpi/mpich3-test/comm/cmfree
+teshsuite/smpi/mpich3-test/comm/cmsplit
+teshsuite/smpi/mpich3-test/comm/cmsplit2
+teshsuite/smpi/mpich3-test/comm/cmsplit_type
+teshsuite/smpi/mpich3-test/comm/comm_create_group
+teshsuite/smpi/mpich3-test/comm/comm_group_half
+teshsuite/smpi/mpich3-test/comm/comm_group_rand
+teshsuite/smpi/mpich3-test/comm/comm_info
+teshsuite/smpi/mpich3-test/comm/commcreate1
+teshsuite/smpi/mpich3-test/comm/commname
+teshsuite/smpi/mpich3-test/comm/ctxalloc
+teshsuite/smpi/mpich3-test/comm/ctxsplit
+teshsuite/smpi/mpich3-test/comm/dup
+teshsuite/smpi/mpich3-test/comm/dup_with_info
+teshsuite/smpi/mpich3-test/comm/dupic
+teshsuite/smpi/mpich3-test/comm/ic1
+teshsuite/smpi/mpich3-test/comm/ic2
+teshsuite/smpi/mpich3-test/comm/iccreate
+teshsuite/smpi/mpich3-test/comm/icgroup
+teshsuite/smpi/mpich3-test/comm/icm
+teshsuite/smpi/mpich3-test/comm/icsplit
+teshsuite/smpi/mpich3-test/comm/probe-intercomm
+teshsuite/smpi/mpich3-test/datatype/blockindexed-misc
+teshsuite/smpi/mpich3-test/datatype/blockindexed-zero-count
+teshsuite/smpi/mpich3-test/datatype/contents
+teshsuite/smpi/mpich3-test/datatype/contig-zero-count
+teshsuite/smpi/mpich3-test/datatype/contigstruct
+teshsuite/smpi/mpich3-test/datatype/cxx-types
+teshsuite/smpi/mpich3-test/datatype/darray-cyclic
+teshsuite/smpi/mpich3-test/datatype/darray-pack
+teshsuite/smpi/mpich3-test/datatype/gaddress
+teshsuite/smpi/mpich3-test/datatype/get-elements
+teshsuite/smpi/mpich3-test/datatype/get-elements-pairtype
+teshsuite/smpi/mpich3-test/datatype/getpartelm
+teshsuite/smpi/mpich3-test/datatype/hindexed-zeros
+teshsuite/smpi/mpich3-test/datatype/hindexed_block
+teshsuite/smpi/mpich3-test/datatype/hindexed_block_contents
+teshsuite/smpi/mpich3-test/datatype/indexed-misc
+teshsuite/smpi/mpich3-test/datatype/large-count
+teshsuite/smpi/mpich3-test/datatype/lbub
+teshsuite/smpi/mpich3-test/datatype/localpack
+teshsuite/smpi/mpich3-test/datatype/longdouble
+teshsuite/smpi/mpich3-test/datatype/lots-of-types
+teshsuite/smpi/mpich3-test/datatype/pairtype-pack
+teshsuite/smpi/mpich3-test/datatype/pairtype-size-extent
+teshsuite/smpi/mpich3-test/datatype/simple-commit
+teshsuite/smpi/mpich3-test/datatype/simple-pack
+teshsuite/smpi/mpich3-test/datatype/simple-pack-external
+teshsuite/smpi/mpich3-test/datatype/simple-resized
+teshsuite/smpi/mpich3-test/datatype/simple-size-extent
+teshsuite/smpi/mpich3-test/datatype/sizedtypes
+teshsuite/smpi/mpich3-test/datatype/slice-pack
+teshsuite/smpi/mpich3-test/datatype/slice-pack-external
+teshsuite/smpi/mpich3-test/datatype/struct-derived-zeros
+teshsuite/smpi/mpich3-test/datatype/struct-empty-el
+teshsuite/smpi/mpich3-test/datatype/struct-ezhov
+teshsuite/smpi/mpich3-test/datatype/struct-no-real-types
+teshsuite/smpi/mpich3-test/datatype/struct-pack
+teshsuite/smpi/mpich3-test/datatype/struct-verydeep
+teshsuite/smpi/mpich3-test/datatype/struct-zero-count
+teshsuite/smpi/mpich3-test/datatype/subarray
+teshsuite/smpi/mpich3-test/datatype/subarray-pack
+teshsuite/smpi/mpich3-test/datatype/tfree
+teshsuite/smpi/mpich3-test/datatype/tmatchsize
+teshsuite/smpi/mpich3-test/datatype/transpose-pack
+teshsuite/smpi/mpich3-test/datatype/tresized
+teshsuite/smpi/mpich3-test/datatype/tresized2
+teshsuite/smpi/mpich3-test/datatype/triangular-pack
+teshsuite/smpi/mpich3-test/datatype/typecommit
+teshsuite/smpi/mpich3-test/datatype/typefree
+teshsuite/smpi/mpich3-test/datatype/typelb
+teshsuite/smpi/mpich3-test/datatype/typename
+teshsuite/smpi/mpich3-test/datatype/unpack
+teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs
+teshsuite/smpi/mpich3-test/datatype/zero-blklen-vector
+teshsuite/smpi/mpich3-test/datatype/zeroblks
+teshsuite/smpi/mpich3-test/datatype/zeroparms
+teshsuite/smpi/mpich3-test/f77/coll/allredint8f
+teshsuite/smpi/mpich3-test/f77/coll/allredopttf
+teshsuite/smpi/mpich3-test/f77/coll/alltoallvf
+teshsuite/smpi/mpich3-test/f77/coll/alltoallwf
+teshsuite/smpi/mpich3-test/f77/coll/exscanf
+teshsuite/smpi/mpich3-test/f77/coll/inplacef
+teshsuite/smpi/mpich3-test/f77/coll/red_scat_blockf
+teshsuite/smpi/mpich3-test/f77/coll/redscatf
+teshsuite/smpi/mpich3-test/f77/coll/reducelocalf
+teshsuite/smpi/mpich3-test/f77/coll/split_typef
+teshsuite/smpi/mpich3-test/f77/coll/uallreducef
+teshsuite/smpi/mpich3-test/f77/coll/vw_inplacef
+teshsuite/smpi/mpich3-test/f77/comm/commnamef
+teshsuite/smpi/mpich3-test/f77/datatype/allctypesf
+teshsuite/smpi/mpich3-test/f77/datatype/gaddressf
+teshsuite/smpi/mpich3-test/f77/datatype/hindex1f
+teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf
+teshsuite/smpi/mpich3-test/f77/datatype/packef
+teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h
+teshsuite/smpi/mpich3-test/f77/datatype/typecntsf
+teshsuite/smpi/mpich3-test/f77/datatype/typem2f
+teshsuite/smpi/mpich3-test/f77/datatype/typename3f
+teshsuite/smpi/mpich3-test/f77/datatype/typenamef
+teshsuite/smpi/mpich3-test/f77/datatype/typesnamef
+teshsuite/smpi/mpich3-test/f77/datatype/typesubf
+teshsuite/smpi/mpich3-test/f77/ext/add1size
+teshsuite/smpi/mpich3-test/f77/init/baseenvf
+teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf
+teshsuite/smpi/mpich3-test/f77/pt2pt/greqf
+teshsuite/smpi/mpich3-test/f77/pt2pt/statusesf
+teshsuite/smpi/mpich3-test/f90/coll/allredint8f90
+teshsuite/smpi/mpich3-test/f90/coll/allredopttf90
+teshsuite/smpi/mpich3-test/f90/coll/alltoallvf90
+teshsuite/smpi/mpich3-test/f90/coll/alltoallwf90
+teshsuite/smpi/mpich3-test/f90/coll/array.mod
+teshsuite/smpi/mpich3-test/f90/coll/exscanf90
+teshsuite/smpi/mpich3-test/f90/coll/inplacef90
+teshsuite/smpi/mpich3-test/f90/coll/red_scat_blockf90
+teshsuite/smpi/mpich3-test/f90/coll/redscatf90
+teshsuite/smpi/mpich3-test/f90/coll/reducelocalf90
+teshsuite/smpi/mpich3-test/f90/coll/split_typef90
+teshsuite/smpi/mpich3-test/f90/coll/uallreducef90
+teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90
+teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90
+teshsuite/smpi/mpich3-test/f90/datatype/array.mod
+teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90
+teshsuite/smpi/mpich3-test/f90/datatype/hindex1f90
+teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90
+teshsuite/smpi/mpich3-test/f90/datatype/indtype
+teshsuite/smpi/mpich3-test/f90/datatype/kinds
+teshsuite/smpi/mpich3-test/f90/datatype/packef90
+teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90
+teshsuite/smpi/mpich3-test/f90/datatype/typem2f90
+teshsuite/smpi/mpich3-test/f90/datatype/typename3f90
+teshsuite/smpi/mpich3-test/f90/datatype/typenamef90
+teshsuite/smpi/mpich3-test/f90/datatype/typesnamef90
+teshsuite/smpi/mpich3-test/f90/datatype/typesubf90
+teshsuite/smpi/mpich3-test/f90/init/array.mod
+teshsuite/smpi/mpich3-test/f90/init/baseenvf90
+teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90
+teshsuite/smpi/mpich3-test/f90/pt2pt/array.mod
+teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90
+teshsuite/smpi/mpich3-test/f90/pt2pt/statusesf90
+teshsuite/smpi/mpich3-test/group/groupcreate
+teshsuite/smpi/mpich3-test/group/groupnullincl
+teshsuite/smpi/mpich3-test/group/grouptest
+teshsuite/smpi/mpich3-test/group/grouptest2
+teshsuite/smpi/mpich3-test/group/gtranks
+teshsuite/smpi/mpich3-test/group/gtranksperf
+teshsuite/smpi/mpich3-test/init/attrself
+teshsuite/smpi/mpich3-test/init/exitst1
+teshsuite/smpi/mpich3-test/init/exitst2
+teshsuite/smpi/mpich3-test/init/exitst3
+teshsuite/smpi/mpich3-test/init/finalized
+teshsuite/smpi/mpich3-test/init/initstat
+teshsuite/smpi/mpich3-test/init/library_version
+teshsuite/smpi/mpich3-test/init/timeout
+teshsuite/smpi/mpich3-test/init/version
+teshsuite/smpi/mpich3-test/pt2pt/anyall
+teshsuite/smpi/mpich3-test/pt2pt/bottom
+teshsuite/smpi/mpich3-test/pt2pt/bsend1
+teshsuite/smpi/mpich3-test/pt2pt/bsend2
+teshsuite/smpi/mpich3-test/pt2pt/bsend3
+teshsuite/smpi/mpich3-test/pt2pt/bsend4
+teshsuite/smpi/mpich3-test/pt2pt/bsend5
+teshsuite/smpi/mpich3-test/pt2pt/bsendalign
+teshsuite/smpi/mpich3-test/pt2pt/bsendfrag
+teshsuite/smpi/mpich3-test/pt2pt/bsendpending
+teshsuite/smpi/mpich3-test/pt2pt/cancelrecv
+teshsuite/smpi/mpich3-test/pt2pt/eagerdt
+teshsuite/smpi/mpich3-test/pt2pt/greq1
+teshsuite/smpi/mpich3-test/pt2pt/icsend
+teshsuite/smpi/mpich3-test/pt2pt/inactivereq
+teshsuite/smpi/mpich3-test/pt2pt/isendself
+teshsuite/smpi/mpich3-test/pt2pt/isendselfprobe
+teshsuite/smpi/mpich3-test/pt2pt/large_message
+teshsuite/smpi/mpich3-test/pt2pt/mprobe
+teshsuite/smpi/mpich3-test/pt2pt/pingping
+teshsuite/smpi/mpich3-test/pt2pt/probe-unexp
+teshsuite/smpi/mpich3-test/pt2pt/probenull
+teshsuite/smpi/mpich3-test/pt2pt/pscancel
+teshsuite/smpi/mpich3-test/pt2pt/rcancel
+teshsuite/smpi/mpich3-test/pt2pt/rqfreeb
+teshsuite/smpi/mpich3-test/pt2pt/rqstatus
+teshsuite/smpi/mpich3-test/pt2pt/scancel
+teshsuite/smpi/mpich3-test/pt2pt/scancel2
+teshsuite/smpi/mpich3-test/pt2pt/sendall
+teshsuite/smpi/mpich3-test/pt2pt/sendflood
+teshsuite/smpi/mpich3-test/pt2pt/sendrecv1
+teshsuite/smpi/mpich3-test/pt2pt/sendrecv2
+teshsuite/smpi/mpich3-test/pt2pt/sendrecv3
+teshsuite/smpi/mpich3-test/pt2pt/sendself
+teshsuite/smpi/mpich3-test/pt2pt/waitany-null
+teshsuite/smpi/mpich3-test/pt2pt/waittestnull
+
 teshsuite/msg/pid
 teshsuite/msg/get_sender
 teshsuite/msg/trace/test_trace_integration
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..d935a7a
--- /dev/null
+++ b/.project
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+  <name>simgrid</name>
+  <comment></comment>
+  <projects>
+  </projects>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+      <triggers>clean,full,incremental,</triggers>
+      <arguments>
+        <dictionary>
+          <key>?name?</key>
+          <value></value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.append_environment</key>
+          <value>true</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+          <value>all</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.buildArguments</key>
+          <value></value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.buildCommand</key>
+          <value>make</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+          <value>clean</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.contents</key>
+          <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+          <value>false</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+          <value>true</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+          <value>true</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+          <value>all</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.stopOnError</key>
+          <value>true</value>
+        </dictionary>
+        <dictionary>
+          <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+          <value>true</value>
+        </dictionary>
+      </arguments>
+    </buildCommand>
+    <buildCommand>
+      <name>org.rubypeople.rdt.core.rubybuilder</name>
+      <arguments>
+      </arguments>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+      <triggers>full,incremental,</triggers>
+      <arguments>
+      </arguments>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments>
+      </arguments>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.cdt.core.ccnature</nature>
+    <nature>org.eclipse.cdt.core.cnature</nature>
+    <nature>org.rubypeople.rdt.core.rubynature</nature>
+    <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+    <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
diff --git a/CITATION.bib b/CITATION.bib
new file mode 100644 (file)
index 0000000..d238b86
--- /dev/null
@@ -0,0 +1,15 @@
+@InProceedings{Casanova:2008:SGF:1397760.1398183,
+  author =  {Casanova, Henri and Legrand, Arnaud and Quinson, Martin},
+  title =  {SimGrid: a Generic Framework for Large-Scale Distributed Experiments},
+  booktitle = {Proceedings of the Tenth International Conference on Computer Modeling and Simulation},
+  series = {UKSIM '08},
+  year = {2008},
+  isbn = {978-0-7695-3114-4},
+  pages = {126--131},
+  numpages = {6},
+  url = {http://dx.doi.org/10.1109/UKSIM.2008.28},
+  doi = {10.1109/UKSIM.2008.28},
+  acmid = {1398183},
+  publisher = {IEEE Computer Society},
+  address = {Washington, DC, USA},
+}
index d7a0107..0a44682 100644 (file)
@@ -48,11 +48,13 @@ set(CMAKE_Fortran_LINK_FLAGS "" CACHE TYPE INTERNAL FORCE)
 # 3.7.{0,1} -> release 3.7, 3.7.1
 # 3.8.{0,1} -> release 3.8, 3.8.1
 # 3.9.0 -> release 3.9
+
+# 3.9.90 -> release 3.10pre1
 # 3.10.0 -> release 3.10
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "10")
-set(SIMGRID_VERSION_PATCH "0")
+set(SIMGRID_VERSION_MINOR "9")
+set(SIMGRID_VERSION_PATCH "90")
 
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
   set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
@@ -77,8 +79,7 @@ else()
   endif()
 endif()
 
-string(REGEX MATCH "gcc" GCC "${CMAKE_C_COMPILER}")
-if(GCC)
+if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
   exec_program("${CMAKE_C_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_C_VERSION")
   exec_program("${CMAKE_CXX_COMPILER} --version" OUTPUT_VARIABLE "COMPILER_CXX_VERSION")
   string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_C_VERSION "${COMPILER_C_VERSION}")
@@ -194,10 +195,6 @@ endif()
 
 include_directories(${INCLUDES})
 
-### Determine the assembly flavor that we need today
-include(CMakeDetermineSystem)
-set(PROCESSOR_${CMAKE_SYSTEM_PROCESSOR} 1)
-
 ### Setup Options
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Option.cmake)
 
@@ -209,9 +206,7 @@ include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/DefinePackages.cmake)
 
 ### Build some Maintainer files
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MaintainerMode.cmake)
-if(NOT WIN32)
-  include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/UnitTesting.cmake)
-endif()
+include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/UnitTesting.cmake)
 
 ### Setup gcc flags
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Flags.cmake)
diff --git a/COPYING b/COPYING
index 3870bb5..d8bb07b 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -155,9 +155,11 @@ List of files:
 
 =========================================================================
 
-examples/smpi/alltoallv.c was borowed from the MPICH2 test files. It
-can be found for example in mpich2 1.2.1.1 under the name
-test/mpi/coll/alltoallv.c The copyright mention is the following:
+The SMPI testsuite was borrowed from the MPICH3 test files. It can be found 
+inside ./teshsuite/smpi/mpich3-test. Some of the collective algorithms 
+available in src/smpi/colls/ were also copied from MPICH
+
+
 /*
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
@@ -176,12 +178,14 @@ Copyright Notice
 Permission is hereby granted to use, reproduce, prepare derivative works, and
 to redistribute to others.  This software was authored by:
 
-Argonne National Laboratory Group
-W. Gropp: (630) 252-4318; FAX: (630) 252-5986; e-mail: gropp@mcs.anl.gov
-E. Lusk:  (630) 252-7852; FAX: (630) 252-5986; e-mail: lusk@mcs.anl.gov
 Mathematics and Computer Science Division
 Argonne National Laboratory, Argonne IL 60439
 
+(and)
+
+Department of Computer Science
+University of Illinois at Urbana-Champaign
+
 
                              GOVERNMENT LICENSE
 
@@ -201,15 +205,6 @@ for the accuracy, completeness, or usefulness of any information, apparatus,
 product, or process disclosed, or represents that its use would not infringe
 privately owned rights.
 
-Portions of this code were written by Microsoft. Those portions are
-Copyright (c) 2007 Microsoft Corporation. Microsoft grants permission to
-use, reproduce, prepare derivative works, and to redistribute to
-others. The code is licensed "as is." The User bears the risk of using
-it. Microsoft gives no express warranties, guarantees or
-conditions. To the extent permitted by law, Microsoft excludes the
-implied warranties of merchantability, fitness for a particular
-purpose and non-infringement.
-
 
 <-------------------- end of MPICH2 COPYRIGHT file -------------------->
 
@@ -232,3 +227,143 @@ licences, at your option.
 
 ==========================================================================
 
+Some of the collective algorithms inside src/smpi/colls folder are taken
+from the STAR-MPI suite. The original software was retrieved from here:
+http://star-mpi.sourceforge.net/
+
+Copyright (c) 2006, Ahmad Faraj & Xin Yuan,
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+  * Neither the name of the Florida State University nor the names of its
+    contributors may be used to endorse or promote products derived from this
+    software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+  ***************************************************************************
+  *     Any results obtained from executing this software require the       *
+  *     acknowledgment and citation of the software and its owners.         *
+  *     The full citation is given below:                                   *
+  *                                                                         *
+  *     A. Faraj, X. Yuan, and D. Lowenthal. "STAR-MPI: Self Tuned Adaptive *
+  *     Routines for MPI Collective Operations." The 20th ACM International *
+  *     Conference on Supercomputing (ICS), Queensland, Australia           *
+  *     June 28-July 1, 2006.                                               *
+  ***************************************************************************
+
+==========================================================================
+
+Some of the collective algorithms inside src/smpi/colls folder are taken
+from the OpenMPI. The original software was retrieved from here:
+http://www.open-mpi.org/
+
+Most files in this release are marked with the copyrights of the
+organizations who have edited them.  The copyrights below are in no
+particular order and generally reflect members of the Open MPI core
+team who have contributed code to this release.  The copyrights for
+code used under license from other parties are included in the
+corresponding files.
+
+Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
+                        University Research and Technology
+                        Corporation.  All rights reserved.
+Copyright (c) 2004-2010 The University of Tennessee and The University
+                        of Tennessee Research Foundation.  All rights
+                        reserved.
+Copyright (c) 2004-2010 High Performance Computing Center Stuttgart, 
+                        University of Stuttgart.  All rights reserved.
+Copyright (c) 2004-2008 The Regents of the University of California.
+                        All rights reserved.
+Copyright (c) 2006-2010 Los Alamos National Security, LLC.  All rights
+                        reserved. 
+Copyright (c) 2006-2010 Cisco Systems, Inc.  All rights reserved.
+Copyright (c) 2006-2010 Voltaire, Inc. All rights reserved.
+Copyright (c) 2006-2011 Sandia National Laboratories. All rights reserved.
+Copyright (c) 2006-2010 Sun Microsystems, Inc.  All rights reserved.
+                        Use is subject to license terms.
+Copyright (c) 2006-2010 The University of Houston. All rights reserved.
+Copyright (c) 2006-2009 Myricom, Inc.  All rights reserved.
+Copyright (c) 2007-2008 UT-Battelle, LLC. All rights reserved.
+Copyright (c) 2007-2010 IBM Corporation.  All rights reserved.
+Copyright (c) 1998-2005 Forschungszentrum Juelich, Juelich Supercomputing 
+                        Centre, Federal Republic of Germany
+Copyright (c) 2005-2008 ZIH, TU Dresden, Federal Republic of Germany
+Copyright (c) 2007      Evergrid, Inc. All rights reserved.
+Copyright (c) 2008      Chelsio, Inc.  All rights reserved.
+Copyright (c) 2008-2009 Institut National de Recherche en
+                        Informatique.  All rights reserved.
+Copyright (c) 2007      Lawrence Livermore National Security, LLC.
+                        All rights reserved.
+Copyright (c) 2007-2009 Mellanox Technologies.  All rights reserved.
+Copyright (c) 2006-2010 QLogic Corporation.  All rights reserved.
+Copyright (c) 2008-2010 Oak Ridge National Labs.  All rights reserved.
+Copyright (c) 2006-2010 Oracle and/or its affiliates.  All rights reserved.
+Copyright (c) 2009      Bull SAS.  All rights reserved.
+Copyright (c) 2010      ARM ltd.  All rights reserved.
+Copyright (c) 2010-2011 Alex Brick <bricka@ccs.neu.edu>.  All rights reserved.
+Copyright (c) 2012      The University of Wisconsin-La Crosse. All rights
+                        reserved.
+
+$COPYRIGHT$
+
+Additional copyrights may follow
+
+$HEADER$
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer listed
+  in this license in the documentation and/or other materials
+  provided with the distribution.
+
+- Neither the name of the copyright holders nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+The copyright holders provide no reassurances that the source code
+provided does not infringe any patent, copyright, or any other
+intellectual property rights of third parties.  The copyright holders
+disclaim any liability to any recipient for claims brought against
+recipient by any third party for infringement of that parties
+intellectual property rights.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+==========================================================================
+
+
index c6c0132..2afb0d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,4 @@
-SimGrid (3.10) NOT RELEASED; urgency=low
-
- XBT:
- * Our own implementation of getline is renamed xbt_getline, and gets
-   used even if the OS provide a getline(). This should reduce the
-   configuration complexity by using the same code on all platforms.
- * new xbt_cfg_elm_boolean type
+SimGrid (3.10pre1) unstable; urgency=low
 
  Java:
  * Reintegrate Java to the main archive as desynchronizing these
@@ -17,25 +11,71 @@ SimGrid (3.10) NOT RELEASED; urgency=low
  * Dramatically change the way files are handled. API and internals changed, but
    this part of MSG was not considered as production grade either.
  * Add explicit synchronization facilities through semaphores
+ * Add a new function MSG_host_get_process_list()
+ * Preliminary DVFS support (see /examples/msg/energy for details)
 
  SMPI:
  * SMPI is now included directly in the libsimgrid as the windows
-   linker dont forces us on splitting it anymore.
+   linker doesn't force us on splitting it anymore.
  * Improvements of the SMPI replay tool:
    - Most of the collective communications are now rooted in the same process as
      in the original application.
-   - Traces now rely on the same MPI datatype as the application (MPI_BYTE was
-     used until now). Multiple datatypes can now be used in a trace.
+   - Traces now rely on the same MPI data type as the application (MPI_BYTE was
+     used until now). Multiple data types can now be used in a trace.
    - The replay tool now supports traces produce either by TAU or a modified
      version of MPE.
    - Bug Fix: the compute part of the reduce action is now taken into account.
  * smpirun generates the hostfile if needed (with given hostcount and platform)
+ * Integration of more than 100 STAR-MPI, MPICH, OpenMPI collective algorithms
+   - allows to select one in particular with --cfg=smpi/coll_name:algorithm
+   - allows to use the decision logic of OpenMPI(1.7) or MPICH(3.0.4) by setting
+     --cfg=smpi/coll_selector:(mpich/ompi)
+ * Support for new functions : MPI_Issend, MPI_Ssend, Commutative operations in
+   Reduce
+ * Add a --cfg:tracing/smpi/internals option, to trace internal communications
+   happening inside a collective SMPI call.
+ * Fix the behavior of complex data types handling
+ * replace MPICH-1 test suite by the one from MPICH 3.0.4. Can be built using
+   enable_smpi_MPICH3_testsuite flag in cmake. Run with ctest.
+ * Add all missing Fortran bindings, SMPI should work with Fortran 90
+   (no privatization of global variables yet)
+
+ Model-Checking;
+ * Verification of liveness properties is now available for SMPI applications
+   (in addition to MSG applications)
+ * Bugged examples using SMPI in examples/smpi/mc/
+ * Add --cfg=model-check/visited option. Allows the verification of infinite
+   programs. Detection of loops in the execution thanks to the system state
+   comparison and reduction of the state space to explore. Can be combined with
+   DPOR for safety properties.
+
+ SimDag:
+ * Allow to change SimGrid configuration (see --help) within the code
+   thanks to SD_config() as it can be done in MSG.
+ * Add a new function SD_task_set_amount() upon user request.
 
  PLATFORM:
- * Handle units for values (10ms, 10kiloflops, 10Bps, ...)
- * Remove rule based routing (no more pcre dependency)
+ * Handle units for values (10ms, 10kiloflops, 10Bps, 1GB, ...)
+ * Remove rule based routing (no more PCRE dependency)
+ * Add a limiter_link option to cluster tag, to specify a maximum reachable
+   bandwidth in fullduplex mode when it is less than twice the nominal bandwidth.
+ * Add a loopback_bw and loopback_lat options to cluster tag.
+ * Fix the peer tag that could not be mixed with other AS within a Vivaldi
+   routing. Now peers are encapsulated in an AS and have their own private
+   router but this is transparent.
+
+ XBT:
+ * Our own implementation of getline is renamed xbt_getline, and gets
+   used even if the OS provide a getline(). This should reduce the
+   configuration complexity by using the same code on all platforms.
+ * new xbt_cfg_elm_boolean type
+ * Allow to disable SimGrid cleanups at exit from command line option.
+   There are situations where one may want a simulation to end with an exit.
+   Unfortunately, calling exit may cause SimGrid to segfault, which is quite
+   annoying when scripting around the simulator. Adding a
+   --cfg=clean_atexit:yes allows to circumvent this issue.
 
--- $date Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
+-- Mon Oct 7 2013 Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.9) stable; urgency=low
 
diff --git a/NEWS b/NEWS
index b4ddce2..c658b01 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,16 @@ __   _____ _ __ ___(_) ___  _ __   |___ / / |/ _ \
  \ V /  __/ |  \__ \ | (_) | | | |  ___) || | |_| |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_|\___/
 
-(to complete)
+The "to be named" release. Major changes:
+
+ * Preliminary DVFS support to track the energy consumption
+ * Java is back in the main package (and is very stable).
+ * The storage sub-modules is now believed to be usable.
+ * SMPI is now very stable (we pass most MPICH tests).
+ * Verification and model checking further improved: 
+   liveness+SMPI works; reduction through state equality detection
+ Plus the usual load of bug fixes and small improvements
                     _               _____ ___
 __   _____ _ __ ___(_) ___  _ __   |___ // _ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ (_) |
@@ -130,7 +139,7 @@ The "Winter in Frejus" release. Also known as "ANR/ADT funding helps"
 Major changes are:
 
  * New feature: Model check any simgrid simulation
- * SMPI: now considered stable
+ * SMPI is now very usable.
  * Visualization:
     - now covers the whole framework
     - major usability improvements
index 55fe3bd..bc9cff0 100644 (file)
@@ -21,26 +21,36 @@ SET(DROP_SITE_CDASH TRUE)
 SET(TRIGGER_SITE "http://cdash.inria.fr/CDash/cgi-bin/Submit-Random-TestingResults.cgi")
 #If you use the --read-var-info option Memcheck will run more slowly but may give a more detailed description of any illegal address.
 
+if(WIN32)
+SET(TESH_COMMAND perl.exe ${CMAKE_BINARY_DIR}/bin/tesh)
+SET(TESH_OPTION $TESH_OPTION --timeout 50)
+else()
+SET(TESH_COMMAND ${CMAKE_BINARY_DIR}/bin/tesh)
+endif()
+
 INCLUDE(CTest)
 ENABLE_TESTING()
 
 if(NOT enable_memcheck)
-  ADD_TEST(tesh-self-basic                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" basic.tesh)
-  ADD_TEST(tesh-self-cd                         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh)
-  ADD_TEST(tesh-self-IO-broken-pipe             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-broken-pipe.tesh)
-  ADD_TEST(tesh-self-IO-orders                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh)
-  ADD_TEST(tesh-self-IO-bigsize                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-bigsize.tesh)
-  ADD_TEST(tesh-self-set-return                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-return.tesh)
-  ADD_TEST(tesh-self-set-signal                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-signal.tesh)
-  ADD_TEST(tesh-self-set-timeout                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-timeout.tesh)
-  ADD_TEST(tesh-self-set-ignore-output          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-ignore-output.tesh)
-  ADD_TEST(tesh-self-catch-return               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh)
-  ADD_TEST(tesh-self-catch-signal               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh)
-  ADD_TEST(tesh-self-catch-timeout              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh)
-  ADD_TEST(tesh-self-catch-wrong-output         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh)
-  ADD_TEST(tesh-self-bg-basic                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-basic.tesh)
-  ADD_TEST(tesh-self-bg-set-signal              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-set-signal.tesh)
-  ADD_TEST(tesh-self-background                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" background.tesh)
+  ADD_TEST(tesh-self-basic                      ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" basic.tesh)
+  ADD_TEST(tesh-self-cd                         ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh)
+  ADD_TEST(tesh-self-IO-broken-pipe             ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-broken-pipe.tesh)
+  ADD_TEST(tesh-self-IO-orders                  ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh)
+  ADD_TEST(tesh-self-IO-bigsize                 ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" IO-bigsize.tesh)
+  ADD_TEST(tesh-self-set-return                 ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-return.tesh)
+  ADD_TEST(tesh-self-set-timeout                ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-timeout.tesh)
+  ADD_TEST(tesh-self-set-ignore-output          ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-ignore-output.tesh)
+  ADD_TEST(tesh-self-catch-return               ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh)
+  ADD_TEST(tesh-self-catch-timeout              ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh)
+  ADD_TEST(tesh-self-catch-wrong-output         ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh)
+  ADD_TEST(tesh-self-bg-basic                   ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-basic.tesh)
+  ADD_TEST(tesh-self-background                 ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" background.tesh)
+
+  if(NOT WIN32)
+    ADD_TEST(tesh-self-set-signal                 ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-signal.tesh)
+    ADD_TEST(tesh-self-bg-set-signal              ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" bg-set-signal.tesh)
+    ADD_TEST(tesh-self-catch-signal               ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-signal.tesh)
+  endif()
 
   # BEGIN TESH TESTS
 
@@ -49,284 +59,315 @@ if(NOT enable_memcheck)
   ADD_TEST(help-models                          ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-models)
 
   # teshsuite/xbt
-  ADD_TEST(xbt-log-large                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
-  ADD_TEST(xbt-log-parallel                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
+  ADD_TEST(xbt-log-large                        ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh)
+  ADD_TEST(xbt-log-parallel                     ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh)
   IF(HAVE_MMAP)
     IF(${ARCH_32_BITS})
-      ADD_TEST(xbt-mmalloc-32                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh)
+      ADD_TEST(xbt-mmalloc-32                   ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh)
     ELSE()
-      ADD_TEST(xbt-mmalloc-64                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_64.tesh)
+      ADD_TEST(xbt-mmalloc-64                   ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_64.tesh)
     ENDIF()
   ENDIF()
-  ADD_TEST(xbt-parmap                           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test.tesh)
+  ADD_TEST(xbt-parmap                           ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test.tesh)
 
   # BEGIN CONTEXTS FACTORY
-  ADD_TEST(tesh-msg-get-sender-thread           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
   if(HAVE_RAWCTX)
-    ADD_TEST(tesh-msg-get-sender-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+    ADD_TEST(simix_factory_default              ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh)
+  elseif(CONTEXT_UCONTEXT)
+    ADD_TEST(simix_factory_default              ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh)
+  else()
+    ADD_TEST(simix_factory_default              ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh)
+  endif()
+  ADD_TEST(simix_factory_thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh)
+  if(HAVE_RAWCTX)
+    ADD_TEST(simix_factory_raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh)
   endif()
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(tesh-msg-get-sender-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+    ADD_TEST(simix_factory_ucontext             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh)
   endif()
 
-  ADD_TEST(tesh-msg-pid-thread           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
+  ADD_TEST(tesh-msg-get-sender-thread           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
   if(HAVE_RAWCTX)
-    ADD_TEST(tesh-msg-pid-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
+    ADD_TEST(tesh-msg-get-sender-raw            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
   endif()
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(tesh-msg-pid-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
+    ADD_TEST(tesh-msg-get-sender-ucontext       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh)
+  endif()
+
+  ADD_TEST(tesh-msg-pid-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
+  if(HAVE_RAWCTX)
+    ADD_TEST(tesh-msg-pid-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
+  endif()
+  if(CONTEXT_UCONTEXT)
+    ADD_TEST(tesh-msg-pid-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid.tesh)
   endif()
 
 
   IF(enable_debug) # these tests need the assertion mechanism
-    ADD_TEST(tesh-simdag-parser-bogus-symmetric ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
+    ADD_TEST(tesh-simdag-parser-bogus-symmetric ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms two_hosts_asymetric.tesh)
   ENDIF()
 
-  ADD_TEST(tesh-simdag-bypass                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_bypass.tesh)
-  ADD_TEST(tesh-simdag-flatifier                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
-  ADD_TEST(tesh-simdag-link                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_link_test.tesh)
-
-  ADD_TEST(tesh-simdag-reinit-costs             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
-  ADD_TEST(tesh-simdag-parser                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
-  ADD_TEST(tesh-simdag-parser-sym-full          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
-  ADD_TEST(tesh-simdag-full-links               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
-  ADD_TEST(tesh-simdag-basic0                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
-  ADD_TEST(tesh-simdag-basic1                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
-  ADD_TEST(tesh-simdag-basic2                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
-  ADD_TEST(tesh-simdag-basic3                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
-  ADD_TEST(tesh-simdag-basic4                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
-  ADD_TEST(tesh-simdag-basic5                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
-  ADD_TEST(tesh-simdag-basic6                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
-  ADD_TEST(tesh-simdag-incomplete               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/incomplete.tesh)
-  ADD_TEST(tesh-simdag-p2p-1                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
-  ADD_TEST(tesh-simdag-p2p-2                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
-  ADD_TEST(tesh-simdag-p2p-3                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
-  ADD_TEST(tesh-simdag-p2p-4                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
-  ADD_TEST(tesh-simdag-mxn-1                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
-  ADD_TEST(tesh-simdag-mxn-2                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
-  ADD_TEST(tesh-simdag-mxn-3                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
-  ADD_TEST(tesh-simdag-par-1                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
-  ADD_TEST(tesh-simdag-par-2                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
-  ADD_TEST(tesh-simdag-availability             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability/availability_test.tesh)
+  ADD_TEST(tesh-simdag-bypass                   ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_bypass.tesh)
+  ADD_TEST(tesh-simdag-flatifier                ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms flatifier.tesh)
+  ADD_TEST(tesh-simdag-link                     ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_link_test.tesh)
+
+  ADD_TEST(tesh-simdag-reinit-costs             ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/test_reinit_costs.tesh)
+  ADD_TEST(tesh-simdag-parser                   ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test.tesh)
+  ADD_TEST(tesh-simdag-parser-sym-full          ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms basic_parsing_test_sym_full.tesh)
+  ADD_TEST(tesh-simdag-full-links               ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms get_full_link.tesh)
+  ADD_TEST(tesh-simdag-basic0                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic0.tesh)
+  ADD_TEST(tesh-simdag-basic1                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic1.tesh)
+  ADD_TEST(tesh-simdag-basic2                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic2.tesh)
+  ADD_TEST(tesh-simdag-basic3                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic3.tesh)
+  ADD_TEST(tesh-simdag-basic4                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic4.tesh)
+  ADD_TEST(tesh-simdag-basic5                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic5.tesh)
+  ADD_TEST(tesh-simdag-basic6                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic6.tesh)
+  ADD_TEST(tesh-simdag-incomplete               ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/incomplete.tesh)
+  ADD_TEST(tesh-simdag-p2p-1                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency1.tesh)
+  ADD_TEST(tesh-simdag-p2p-2                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency2.tesh)
+  ADD_TEST(tesh-simdag-p2p-3                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency3.tesh)
+  ADD_TEST(tesh-simdag-p2p-4                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p/test_latency_bound.tesh)
+  ADD_TEST(tesh-simdag-mxn-1                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_all2all.tesh)
+  ADD_TEST(tesh-simdag-mxn-2                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_independent_comm.tesh)
+  ADD_TEST(tesh-simdag-mxn-3                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn/test_intra_scatter.tesh)
+  ADD_TEST(tesh-simdag-par-1                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_seq.tesh)
+  ADD_TEST(tesh-simdag-par-2                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask/test_comp_only_par.tesh)
+  ADD_TEST(tesh-simdag-availability             ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability/availability_test.tesh)
 
   # MSG examples
-  ADD_TEST(msg-file                             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/io.tesh)
-  ADD_TEST(msg-start-kill-time                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/start_kill_time/start_kill_time.tesh)
-  ADD_TEST(msg-chainsend                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chainsend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend/chainsend.tesh)
-
-  ADD_TEST(msg-sendrecv-CLM03-thread            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-  ADD_TEST(msg-sendrecv-Vegas-thread            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-  ADD_TEST(msg-sendrecv-Reno-thread             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-  ADD_TEST(msg-suspend-thread                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-  ADD_TEST(msg-pmm-thread                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
-  ADD_TEST(msg-masterslave-bypass-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-  ADD_TEST(msg-masterslave-kill-thread          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
-  ADD_TEST(msg-masterslave-multicore-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-
-  ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-  ADD_TEST(msg-masterslave-no-crosstraffic-thread               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-  ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-  ADD_TEST(msg-masterslave-no-crosstraffic-failure-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-
-  ADD_TEST(msg-masterslave-thread               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
-  ADD_TEST(msg-masterslave-forwarder-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
-  ADD_TEST(msg-masterslave-failure-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
-  ADD_TEST(msg-masterslave-mailbox-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
-  ADD_TEST(msg-masterslave-cpu-ti-thread        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
-
-  ADD_TEST(msg-masterslave-virtual-machines     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/masterslave_virtual_machines.tesh)
-
+  ADD_TEST(msg-file                             ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/io.tesh)
+  ADD_TEST(msg-start-kill-time                  ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/start_kill_time/start_kill_time.tesh)
+  ADD_TEST(msg-chainsend                        ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chainsend --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend/chainsend.tesh)
+
+  ADD_TEST(msg-sendrecv-CLM03-thread            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+  ADD_TEST(msg-sendrecv-Vegas-thread            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+  ADD_TEST(msg-sendrecv-Reno-thread             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+  ADD_TEST(msg-suspend-thread                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+  ADD_TEST(msg-pmm-thread                       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
+  ADD_TEST(msg-masterslave-bypass-thread        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+  ADD_TEST(msg-masterslave-kill-thread          ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
+  ADD_TEST(msg-masterslave-multicore-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+
+  ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+  ADD_TEST(msg-masterslave-no-crosstraffic-thread               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+  ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+  ADD_TEST(msg-masterslave-no-crosstraffic-failure-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+
+  ADD_TEST(msg-masterslave-thread               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
+  ADD_TEST(msg-masterslave-forwarder-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
+  ADD_TEST(msg-masterslave-failure-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
+  ADD_TEST(msg-masterslave-mailbox-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
+  ADD_TEST(msg-masterslave-cpu-ti-thread        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
+
+  ADD_TEST(msg-masterslave-virtual-machines     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/cloud/masterslave_virtual_machines.tesh)
+
+  ADD_TEST(msg-energy-pstates                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh)
+  ADD_TEST(msg-energy-consumption               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh)
+  ADD_TEST(msg-energy-concurrent-tasks          ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh)
+  ADD_TEST(msg-storage                          ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage.tesh)
+  
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(msg-sendrecv-CLM03-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-    ADD_TEST(msg-sendrecv-Vegas-ucontext        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-    ADD_TEST(msg-sendrecv-Reno-ucontext         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-    ADD_TEST(msg-suspend-ucontext               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-    ADD_TEST(msg-pmm-ucontext                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
-    ADD_TEST(msg-masterslave-bypass-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-    ADD_TEST(msg-masterslave-kill-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
-    ADD_TEST(msg-masterslave-multicore-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-ucontext           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-failure-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-
-    ADD_TEST(msg-masterslave-ucontext           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-forwarder-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-failure-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-mailbox-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-cpu-ti-ucontext    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
+    ADD_TEST(msg-sendrecv-CLM03-ucontext        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+    ADD_TEST(msg-sendrecv-Vegas-ucontext        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+    ADD_TEST(msg-sendrecv-Reno-ucontext         ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+    ADD_TEST(msg-suspend-ucontext               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+    ADD_TEST(msg-pmm-ucontext                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
+    ADD_TEST(msg-masterslave-bypass-ucontext    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+    ADD_TEST(msg-masterslave-kill-ucontext      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
+    ADD_TEST(msg-masterslave-multicore-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-ucontext           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-failure-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+
+    ADD_TEST(msg-masterslave-ucontext           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-forwarder-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-failure-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-mailbox-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-cpu-ti-ucontext    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
+
+    ADD_TEST(msg-energy-pstates-ucontext                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh)
+    ADD_TEST(msg-energy-consumption-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh)
+    ADD_TEST(msg-energy-concurrent-tasks-ucontext       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh)
+
   endif()
 
   if(HAVE_RAWCTX)
-    ADD_TEST(msg-sendrecv-CLM03-raw             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
-    ADD_TEST(msg-sendrecv-Vegas-raw             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
-    ADD_TEST(msg-sendrecv-Reno-raw              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
-    ADD_TEST(msg-suspend-raw                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
-    ADD_TEST(msg-pmm-raw                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
-    ADD_TEST(msg-masterslave-bypass-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
-    ADD_TEST(msg-masterslave-kill-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
-    ADD_TEST(msg-masterslave-multicore-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
-    ADD_TEST(msg-masterslave-no-crosstraffic-failure-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
-
-    ADD_TEST(msg-masterslave-raw                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-forwarder-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-failure-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-mailbox-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
-    ADD_TEST(msg-masterslave-cpu-ti-raw         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
+    ADD_TEST(msg-sendrecv-CLM03-raw             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_CLM03.tesh)
+    ADD_TEST(msg-sendrecv-Vegas-raw             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Vegas.tesh)
+    ADD_TEST(msg-sendrecv-Reno-raw              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/sendrecv/sendrecv_Reno.tesh)
+    ADD_TEST(msg-suspend-raw                    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/suspend/suspend.tesh)
+    ADD_TEST(msg-pmm-raw                        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/pmm/pmm.tesh)
+    ADD_TEST(msg-masterslave-bypass-raw         ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_bypass.tesh)
+    ADD_TEST(msg-masterslave-kill-raw           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_kill.tesh)
+    ADD_TEST(msg-masterslave-multicore-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_multicore.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-mailbox-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-raw                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-forwarder-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder.tesh)
+    ADD_TEST(msg-masterslave-no-crosstraffic-failure-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure.tesh)
+
+    ADD_TEST(msg-masterslave-raw                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-forwarder-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_forwarder_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-failure-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_failure_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-mailbox-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_mailbox_crosstraffic.tesh)
+    ADD_TEST(msg-masterslave-cpu-ti-raw         ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/masterslave --cd ${CMAKE_HOME_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti_crosstraffic.tesh)
+
+    ADD_TEST(msg-energy-pstates-raw             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1/pstate.tesh)
+    ADD_TEST(msg-energy-consumption-raw         ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2/energy_consumption.tesh)
+    ADD_TEST(msg-energy-concurrent-tasks-raw    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3/concurrent_tasks.tesh)
+
   endif()
 
-  ADD_TEST(msg-masterslave-vivaldi-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-  ADD_TEST(msg-token-ring-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+  ADD_TEST(msg-masterslave-vivaldi-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+  ADD_TEST(msg-token-ring-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
   if(HAVE_RAWCTX)
-    ADD_TEST(msg-masterslave-vivaldi-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-    ADD_TEST(msg-token-ring-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+    ADD_TEST(msg-masterslave-vivaldi-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+    ADD_TEST(msg-token-ring-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
   endif()
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(msg-masterslave-vivaldi-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
-    ADD_TEST(msg-token-ring-ucontext            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
+    ADD_TEST(msg-masterslave-vivaldi-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/masterslave/masterslave_vivaldi.tesh)
+    ADD_TEST(msg-token-ring-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg/token_ring ${CMAKE_HOME_DIRECTORY}/examples/msg/token_ring/token_ring.tesh)
   endif()
 
-  ADD_TEST(msg-migration-thread                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-  ADD_TEST(msg-ptask-thread                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-  ADD_TEST(msg-priority-thread                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-  ADD_TEST(msg-properties-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-  ADD_TEST(msg-icomms-thread                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-  ADD_TEST(msg-actions-thread                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-  ADD_TEST(msg-trace-thread                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
-  ADD_TEST(msg-chord-no-crosstraffic-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-  ADD_TEST(msg-chord-no-crosstraffic-thread-parallel ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-  ADD_TEST(msg-chord-thread                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-  ADD_TEST(msg-chord-thread-parallel            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-  ADD_TEST(msg-bittorrent-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-  ADD_TEST(msg-bittorrent-thread-parallel       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-  ADD_TEST(msg-kademlia-thread                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
-  ADD_TEST(msg-kademlia-thread-parallel         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+  ADD_TEST(msg-migration-thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+  ADD_TEST(msg-ptask-thread                     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+  ADD_TEST(msg-priority-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+  ADD_TEST(msg-properties-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+  ADD_TEST(msg-icomms-thread                    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+  ADD_TEST(msg-actions-thread                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+  ADD_TEST(msg-trace-thread                     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
+  ADD_TEST(msg-chord-no-crosstraffic-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+  ADD_TEST(msg-chord-no-crosstraffic-thread-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+  ADD_TEST(msg-chord-thread                     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+  ADD_TEST(msg-chord-thread-parallel            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+  ADD_TEST(msg-bittorrent-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+  ADD_TEST(msg-bittorrent-thread-parallel       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+  ADD_TEST(msg-kademlia-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+  ADD_TEST(msg-kademlia-thread-parallel         ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:thread --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
 
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(msg-migration-ucontext             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-    ADD_TEST(msg-ptask-ucontext                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-    ADD_TEST(msg-priority-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-    ADD_TEST(msg-properties-ucontext            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-    ADD_TEST(msg-icomms-ucontext                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-    ADD_TEST(msg-actions-ucontext               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-    ADD_TEST(msg-trace-ucontext                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
-    ADD_TEST(msg-chord-no-crosstraffic-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-    ADD_TEST(msg-chord-no-crosstraffic-ucontext-parallel ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-    ADD_TEST(msg-chord-ucontext                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-    ADD_TEST(msg-chord-ucontext-parallel        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-    ADD_TEST(msg-bittorrent-ucontext            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-    ADD_TEST(msg-bittorrent-ucontext-parallel   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-    ADD_TEST(msg-kademlia-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
-    ADD_TEST(msg-kademlia-ucontext-parallel     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+    ADD_TEST(msg-migration-ucontext             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+    ADD_TEST(msg-ptask-ucontext                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+    ADD_TEST(msg-priority-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+    ADD_TEST(msg-properties-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+    ADD_TEST(msg-icomms-ucontext                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+    ADD_TEST(msg-actions-ucontext               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+    ADD_TEST(msg-trace-ucontext                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
+    ADD_TEST(msg-chord-no-crosstraffic-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+    ADD_TEST(msg-chord-no-crosstraffic-ucontext-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+    ADD_TEST(msg-chord-ucontext                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+    ADD_TEST(msg-chord-ucontext-parallel        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+    ADD_TEST(msg-bittorrent-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+    ADD_TEST(msg-bittorrent-ucontext-parallel   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+    ADD_TEST(msg-kademlia-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+    ADD_TEST(msg-kademlia-ucontext-parallel     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
 
   endif()
   if(HAVE_RAWCTX)
-    ADD_TEST(msg-migration-raw                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
-    ADD_TEST(msg-ptask-raw                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
-    ADD_TEST(msg-priority-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
-    ADD_TEST(msg-actions-raw                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
-    ADD_TEST(msg-icomms-raw                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
-    ADD_TEST(msg-properties-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
-    ADD_TEST(msg-trace-raw                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
-    ADD_TEST(msg-chord-no-crosstraffic-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-    ADD_TEST(msg-chord-no-crosstraffic-raw-parallel ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
-    ADD_TEST(msg-chord-raw                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-    ADD_TEST(msg-chord-raw-parallel             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
-    ADD_TEST(msg-bittorrent-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-    ADD_TEST(msg-bittorrent-raw-parallel        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
-    ADD_TEST(msg-kademlia-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
-    ADD_TEST(msg-kademlia-raw-parallel          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+    ADD_TEST(msg-migration-raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/migration/migration.tesh)
+    ADD_TEST(msg-ptask-raw                      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/parallel_task/parallel_task.tesh)
+    ADD_TEST(msg-priority-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/priority/priority.tesh)
+    ADD_TEST(msg-actions-raw                    ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/actions --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/actions actions.tesh)
+    ADD_TEST(msg-icomms-raw                     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg/icomms --cd ${CMAKE_BINARY_DIR}/examples/msg/icomms ${CMAKE_HOME_DIRECTORY}/examples/msg/icomms/peer.tesh)
+    ADD_TEST(msg-properties-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/properties/msg_prop.tesh)
+    ADD_TEST(msg-trace-raw                      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg trace/trace.tesh)
+    ADD_TEST(msg-chord-no-crosstraffic-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+    ADD_TEST(msg-chord-no-crosstraffic-raw-parallel ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord.tesh)
+    ADD_TEST(msg-chord-raw                      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+    ADD_TEST(msg-chord-raw-parallel             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cfg contexts/nthreads:4 --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/chord chord_crosstraffic.tesh)
+    ADD_TEST(msg-bittorrent-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+    ADD_TEST(msg-bittorrent-raw-parallel        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/bittorrent --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent bittorrent.tesh)
+    ADD_TEST(msg-kademlia-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
+    ADD_TEST(msg-kademlia-raw-parallel          ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/nthreads:4 --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/kademlia --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/kademlia kademlia.tesh)
   endif()
 
   # simdag examples
   if(HAVE_GRAPHVIZ)
-    ADD_TEST(simdag-test-dotload                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dot --cd ${CMAKE_BINARY_DIR}/examples/simdag/dot ${CMAKE_HOME_DIRECTORY}/examples/simdag/dot/test_simdag_dotload.tesh)
+    ADD_TEST(simdag-test-dotload                ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dot --cd ${CMAKE_BINARY_DIR}/examples/simdag/dot ${CMAKE_HOME_DIRECTORY}/examples/simdag/dot/test_simdag_dotload.tesh)
   endif()
-  ADD_TEST(simdag-test-simdag                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
-  ADD_TEST(simdag-test-simdag2                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
-  ADD_TEST(simdag-test-seq-access               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
-  ADD_TEST(simdag-test-typed-tasks              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh)
-  ADD_TEST(simdag-test-fail                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh)
-  ADD_TEST(simdag-test-avail                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_avail.tesh)
-  ADD_TEST(simdag-test-comm-throttling          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh)
-  ADD_TEST(simdag-test-dax                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh)
-  ADD_TEST(simdag-test-dax-cycle                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh)
-  ADD_TEST(simdag-test-prop                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
-  ADD_TEST(simdag-test-minmin-scheduling        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
-
-  ADD_TEST(msg-gtnets-crosstraffic-thread       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
+  ADD_TEST(simdag-test-simdag                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag.tesh)
+  ADD_TEST(simdag-test-simdag2                  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag2.tesh)
+  ADD_TEST(simdag-test-seq-access               ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_seq_access.tesh)
+  ADD_TEST(simdag-test-typed-tasks              ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_typed_tasks.tesh)
+  ADD_TEST(simdag-test-fail                     ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_fail.tesh)
+  ADD_TEST(simdag-test-avail                    ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag test_simdag_avail.tesh)
+  ADD_TEST(simdag-test-comm-throttling          ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_comm_throttling.tesh)
+  ADD_TEST(simdag-test-dax                      ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/dax --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax smalldax.tesh)
+  ADD_TEST(simdag-test-dax-cycle                ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag/dax --cd ${CMAKE_BINARY_DIR}/examples/simdag/dax ${CMAKE_HOME_DIRECTORY}/examples/simdag/dax/simple_dax_with_cycle.tesh)
+  ADD_TEST(simdag-test-prop                     ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/properties/test_prop.tesh)
+  ADD_TEST(simdag-test-minmin-scheduling        ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/scheduling --cd ${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling test_minmin.tesh)
+  ADD_TEST(simdag-test-io                       ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/simdag/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/simdag/io/io.tesh)
+
+  ADD_TEST(msg-gtnets-crosstraffic-thread       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
   if(CONTEXT_UCONTEXT)
-    ADD_TEST(msg-gtnets-crosstraffic-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
+    ADD_TEST(msg-gtnets-crosstraffic-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
   endif()
   if(HAVE_RAWCTX)
-    ADD_TEST(msg-gtnets-crosstraffic-raw        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
+    ADD_TEST(msg-gtnets-crosstraffic-raw        ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-crosstraffic.tesh)
   endif()
 
   if(HAVE_GTNETS)
-    ADD_TEST(msg-gtnets-waxman-thread           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-    ADD_TEST(msg-gtnets-dogbone-thread          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-    ADD_TEST(msg-gtnets-onelink-thread          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-    ADD_TEST(msg-gtnets-dogbone-lv08-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-    ADD_TEST(msg-gtnets-onelink-lv08-thread     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+    ADD_TEST(msg-gtnets-waxman-thread           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+    ADD_TEST(msg-gtnets-dogbone-thread          ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+    ADD_TEST(msg-gtnets-onelink-thread          ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+    ADD_TEST(msg-gtnets-dogbone-lv08-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+    ADD_TEST(msg-gtnets-onelink-lv08-thread     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
     if(CONTEXT_UCONTEXT)
-      ADD_TEST(msg-gtnets-waxman-ucontext       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-      ADD_TEST(msg-gtnets-dogbone-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-      ADD_TEST(msg-gtnets-onelink-ucontext      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-      ADD_TEST(msg-gtnets-dogbone-lv08-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-      ADD_TEST(msg-gtnets-onelink-lv08-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+      ADD_TEST(msg-gtnets-waxman-ucontext       ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+      ADD_TEST(msg-gtnets-dogbone-ucontext      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+      ADD_TEST(msg-gtnets-onelink-ucontext      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+      ADD_TEST(msg-gtnets-dogbone-lv08-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+      ADD_TEST(msg-gtnets-onelink-lv08-ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
     endif()
     if(HAVE_RAWCTX)
-      ADD_TEST(msg-gtnets-waxman-raw            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
-      ADD_TEST(msg-gtnets-dogbone-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
-      ADD_TEST(msg-gtnets-onelink-raw           ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
-      ADD_TEST(msg-gtnets-dogbone-lv08-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
-      ADD_TEST(msg-gtnets-onelink-lv08-raw      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
+      ADD_TEST(msg-gtnets-waxman-raw            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-waxman.tesh)
+      ADD_TEST(msg-gtnets-dogbone-raw           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-gtnets.tesh)
+      ADD_TEST(msg-gtnets-onelink-raw           ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-gtnets.tesh)
+      ADD_TEST(msg-gtnets-dogbone-lv08-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-dogbone-lv08.tesh)
+      ADD_TEST(msg-gtnets-onelink-lv08-raw      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/gtnets-onelink-lv08.tesh)
     endif()
 
     if(HAVE_TRACING)
-      ADD_TEST(msg-tracing-gtnets-waxman        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh)
-      ADD_TEST(msg-tracing-gtnets-dogbone       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh)
-      ADD_TEST(msg-tracing-gtnets-onelink       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh)
-      ADD_TEST(msg-tracing-gtnets-dogbone-lv08  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh)
-      ADD_TEST(msg-tracing-gtnets-onelink-lv08  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh)
+      ADD_TEST(msg-tracing-gtnets-waxman        ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-waxman.tesh)
+      ADD_TEST(msg-tracing-gtnets-dogbone       ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-gtnets.tesh)
+      ADD_TEST(msg-tracing-gtnets-onelink       ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-gtnets.tesh)
+      ADD_TEST(msg-tracing-gtnets-dogbone-lv08  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-dogbone-lv08.tesh)
+      ADD_TEST(msg-tracing-gtnets-onelink-lv08  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/msg --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets/tracing-gtnets-onelink-lv08.tesh)
     endif()
   endif()
 
   if(HAVE_NS3)
-    ADD_TEST(msg-ns3-thread                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+    ADD_TEST(msg-ns3-thread                     ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
     if(CONTEXT_UCONTEXT)
-      ADD_TEST(msg-ns3-ucontext                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+      ADD_TEST(msg-ns3-ucontext                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
     endif()
     if(HAVE_RAWCTX)
-      ADD_TEST(msg-ns3-raw                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
+      ADD_TEST(msg-ns3-raw                      ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_BINARY_DIR}/examples/msg ${CMAKE_HOME_DIRECTORY}/examples/msg/ns3/ns3.tesh)
     endif()
   endif()
 
   IF(HAVE_TRACING)
     ADD_TEST(tracing-help                       ${CMAKE_BINARY_DIR}/teshsuite/simdag/platforms/basic_parsing_test --help-tracing)
-    ADD_TEST(tracing-ms                         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh)
-    ADD_TEST(tracing-simdag                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_tracing.tesh)
-    ADD_TEST(tracing-trace_platform             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/trace_platform.tesh)
-    ADD_TEST(tracing-user_variables             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/user_variables.tesh)
-    ADD_TEST(tracing-link_user_variables        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_user_variables.tesh)
-    ADD_TEST(tracing-link_srcdst_user_variables ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_srcdst_user_variables.tesh)
-    ADD_TEST(tracing-categories                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh)
-    ADD_TEST(tracing-process-migration          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh)
-    ADD_TEST(graphicator                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
+    ADD_TEST(tracing-ms                         ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/ms.tesh)
+    ADD_TEST(tracing-simdag                     ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/simdag --cd ${CMAKE_BINARY_DIR}/examples/simdag ${CMAKE_HOME_DIRECTORY}/examples/simdag/test_simdag_tracing.tesh)
+    ADD_TEST(tracing-trace_platform             ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/trace_platform.tesh)
+    ADD_TEST(tracing-user_variables             ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/user_variables.tesh)
+    ADD_TEST(tracing-link_user_variables        ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_user_variables.tesh)
+    ADD_TEST(tracing-link_srcdst_user_variables ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/link_srcdst_user_variables.tesh)
+    ADD_TEST(tracing-categories                 ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/categories.tesh)
+    ADD_TEST(tracing-process-migration          ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg --cd ${CMAKE_HOME_DIRECTORY}/examples/msg tracing/procmig.tesh)
+    ADD_TEST(graphicator                        ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_HOME_DIRECTORY}/tools/graphicator graphicator.tesh)
   ENDIF()
 
   # Lua examples
   if(HAVE_LUA)
-    ADD_TEST(lua-duplicated-globals             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/state_cloner duplicated_globals.tesh)
-    ADD_TEST(lua-masterslave                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh)
-    ADD_TEST(lua-mult-matrix                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh)
-    ADD_TEST(lua-masterslave-bypass             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh)
-    ADD_TEST(lua-chord                          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/chord chord.tesh)
-    ADD_TEST(lua-bittorrent                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/bittorrent bittorrent.tesh)
-    ADD_TEST(lua-kademlia                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/kademlia kademlia.tesh)
+    ADD_TEST(lua-duplicated-globals             ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/state_cloner duplicated_globals.tesh)
+    ADD_TEST(lua-masterslave                    ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/masterslave master_slave.tesh)
+    ADD_TEST(lua-mult-matrix                    ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/multi_matrix mult_matrix.tesh)
+    ADD_TEST(lua-masterslave-bypass             ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/console master_slave_bypass.tesh)
+    ADD_TEST(lua-chord                          ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/chord chord.tesh)
+    ADD_TEST(lua-bittorrent                     ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/bittorrent bittorrent.tesh)
+    ADD_TEST(lua-kademlia                       ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_HOME_DIRECTORY}/examples/lua/kademlia kademlia.tesh)
     set_tests_properties(lua-duplicated-globals         PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
     set_tests_properties(lua-masterslave                PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
     set_tests_properties(lua-mult-matrix                PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/examples/lua/?.so")
@@ -338,153 +379,189 @@ if(NOT enable_memcheck)
 
   if(enable_smpi)
     # smpi examples
-    ADD_TEST(smpi-bcast-thread                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
-    ADD_TEST(smpi-reduce-thread                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
-    ADD_TEST(smpi-vector-thread                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
-    ADD_TEST(smpi-hvector-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
-    ADD_TEST(smpi-indexed-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
-    ADD_TEST(smpi-struct-thread                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
-    ADD_TEST(smpi-pt2pt-thread                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
-    ADD_TEST(smpi-compute-thread                ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+    ADD_TEST(smpi-bcast-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
+    ADD_TEST(smpi-reduce-thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
+    ADD_TEST(smpi-vector-thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
+    ADD_TEST(smpi-hvector-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
+    ADD_TEST(smpi-indexed-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
+    ADD_TEST(smpi-struct-thread                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
+    ADD_TEST(smpi-pt2pt-thread                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
+    ADD_TEST(smpi-compute-thread                ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+    if (NOT WIN32)
+      ADD_TEST(smpi-shared-thread               ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh)
+    endif()
     if(CONTEXT_UCONTEXT)
-      ADD_TEST(smpi-bcast-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
-      ADD_TEST(smpi-reduce-ucontext             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
-      ADD_TEST(smpi-vector-ucontex              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
-      ADD_TEST(smpi-hvector-ucontex             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
-      ADD_TEST(smpi-indexed-ucontext            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
-      ADD_TEST(smpi-struct-ucontext             ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
-      ADD_TEST(smpi-pt2pt-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
-      ADD_TEST(smpi-compute-ucontext            ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+      ADD_TEST(smpi-bcast-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
+      ADD_TEST(smpi-reduce-ucontext             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
+      ADD_TEST(smpi-vector-ucontex              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
+      ADD_TEST(smpi-hvector-ucontex             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
+      ADD_TEST(smpi-indexed-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
+      ADD_TEST(smpi-struct-ucontext             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
+      ADD_TEST(smpi-pt2pt-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
+      ADD_TEST(smpi-compute-ucontext            ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+      if (NOT WIN32)
+        ADD_TEST(smpi-shared-ucontext             ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh)
+      endif()
     endif()
     if(HAVE_RAWCTX)
-      ADD_TEST(smpi-bcast-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
-      ADD_TEST(smpi-reduce-raw                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
-      ADD_TEST(smpi-vector-raw                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
-      ADD_TEST(smpi-hvector-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
-      ADD_TEST(smpi-indexed-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
-      ADD_TEST(smpi-struct-raw                  ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
-      ADD_TEST(smpi-pt2pt-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
-      ADD_TEST(smpi-compute-raw                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+      ADD_TEST(smpi-bcast-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast.tesh)
+      ADD_TEST(smpi-reduce-raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce.tesh)
+      ADD_TEST(smpi-vector-raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/vector.tesh)
+      ADD_TEST(smpi-hvector-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/hvector.tesh)
+      ADD_TEST(smpi-indexed-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/indexed.tesh)
+      ADD_TEST(smpi-struct-raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/struct.tesh)
+      ADD_TEST(smpi-pt2pt-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/pt2pt.tesh)
+      ADD_TEST(smpi-compute-raw                 ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/compute.tesh)
+      if (NOT WIN32)
+        ADD_TEST(smpi-shared-raw                  ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/shared.tesh)
+      endif()
     endif()
     if(HAVE_TRACING)
-      ADD_TEST(smpi-tracing-ptp                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh)
-      ADD_TEST(smpi-replay                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
+      ADD_TEST(smpi-tracing-ptp                 ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/tracing/smpi_traced.tesh)
+      ADD_TEST(smpi-replay                      ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi --cd ${CMAKE_BINARY_DIR}/examples/smpi ${CMAKE_HOME_DIRECTORY}/examples/smpi/replay/smpi_replay.tesh)
     endif()
 
-
     FOREACH (GATHER_COLL default ompi mpich ompi_basic_linear ompi_linear_sync ompi_binomial)
-        ADD_TEST(smpi-gather-coll-${GATHER_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/gather:${GATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather_coll.tesh)
+      ADD_TEST(smpi-gather-coll-${GATHER_COLL}  ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/gather:${GATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/gather_coll.tesh)
     ENDFOREACH()
-    
-    FOREACH (ALLGATHER_COLL default  2dmesh 3dmesh bruck GB loosely_lr lr
-                           NTSLR NTSLR_NB pair rdb  rhv ring SMP_NTS
-                           smp_simple spreading_simple ompi mpich ompi_neighborexchange)
-        ADD_TEST(smpi-allgather-coll-${ALLGATHER_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/allgather:${ALLGATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgather_coll.tesh)
+
+    FOREACH (ALLGATHER_COLL default  2dmesh 3dmesh bruck GB loosely_lr
+                            NTSLR NTSLR_NB pair rdb  rhv ring SMP_NTS
+                            smp_simple spreading_simple ompi mpich ompi_neighborexchange)
+      ADD_TEST(smpi-allgather-coll-${ALLGATHER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allgather:${ALLGATHER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgather_coll.tesh)
+    ENDFOREACH()
+
+    FOREACH (ALLGATHERV_COLL default GB pair ring ompi mpich ompi_neighborexchange ompi_bruck mpich_rdb mpich_ring)
+      ADD_TEST(smpi-allgatherv-coll-${ALLGATHERV_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv_coll.tesh)
     ENDFOREACH()
-    
-    FOREACH (ALLGATHERV_COLL default GB pair ring ompi mpich ompi_neighborexchange ompi_bruck)
-        ADD_TEST(smpi-allgatherv-coll-${ALLGATHERV_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/allgatherv:${ALLGATHERV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allgatherv_coll.tesh)
+
+    FOREACH (ALLREDUCE_COLL default lr rab1 rab2 rab_rdb
+                            rdb smp_binomial smp_binomial_pipeline
+                            smp_rdb smp_rsag smp_rsag_lr smp_rsag_rab redbcast ompi mpich ompi_ring_segmented)
+      ADD_TEST(smpi-allreduce-coll-${ALLREDUCE_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allreduce:${ALLREDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce_coll.tesh)
     ENDFOREACH()
-    
-    FOREACH (ALLREDUCE_COLL default lr NTS rab1 rab2 rab_rdb
-                           rab_rsag rdb smp_binomial smp_binomial_pipeline
-                           smp_rdb smp_rsag smp_rsag_lr smp_rsag_rab redbcast ompi mpich ompi_ring_segmented)
-        ADD_TEST(smpi-allreduce-coll-${ALLREDUCE_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/allreduce:${ALLREDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce_coll.tesh)
+
+    FOREACH (ALLREDUCE_COLL_LARGE ompi_ring_segmented)
+      ADD_TEST(smpi-allreduce-coll-${ALLREDUCE_COLL_LARGE} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/allreduce:${ALLREDUCE_COLL_LARGE} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/allreduce_coll_large.tesh)
     ENDFOREACH()
-    
+
     FOREACH (ALLTOALL_COLL 2dmesh 3dmesh pair pair_one_barrier pair_light_barrier
-                          pair_mpi_barrier rdb ring ring_light_barrier
-                          ring_mpi_barrier ring_one_barrier
-                          simple bruck basic_linear ompi)
-        ADD_TEST(smpi-alltoall-coll-${ALLTOALL_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/alltoall:${ALLTOALL_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall_coll.tesh)
+                           pair_mpi_barrier rdb ring ring_light_barrier
+                           ring_mpi_barrier ring_one_barrier
+                           bruck basic_linear ompi mpich)
+      ADD_TEST(smpi-alltoall-coll-${ALLTOALL_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/alltoall:${ALLTOALL_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoall_coll.tesh)
     ENDFOREACH()
-    
+
     FOREACH (ALLTOALLV_COLL default pair pair_light_barrier pair_mpi_barrier
-                           pair_one_barrier  ring ring_light_barrier
-                           ring_mpi_barrier ring_one_barrier bruck ompi)
-        ADD_TEST(smpi-alltoallv-coll-${ALLTOALLV_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv_coll.tesh)
+                            pair_one_barrier  ring ring_light_barrier
+                            ring_mpi_barrier ring_one_barrier bruck ompi mpich ompi_basic_linear)
+      ADD_TEST(smpi-alltoallv-coll-${ALLTOALLV_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/alltoallv:${ALLTOALLV_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/alltoallv_coll.tesh)
     ENDFOREACH()
-    
-    FOREACH (BCAST_COLL default arrival_nb arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter
-                       binomial_tree flattree flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather
-                       scatter_rdb_allgather SMP_binary SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline)
-               ADD_TEST(smpi-bcast-coll-${BCAST_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/bcast:${BCAST_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast_coll.tesh)
+
+    FOREACH (BCAST_COLL default arrival_pattern_aware arrival_pattern_aware_wait arrival_scatter
+                        binomial_tree flattree flattree_pipeline NTSB NTSL NTSL_Isend scatter_LR_allgather
+                        scatter_rdb_allgather SMP_binary SMP_binomial SMP_linear ompi mpich ompi_split_bintree ompi_pipeline)
+      ADD_TEST(smpi-bcast-coll-${BCAST_COLL}    ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/bcast:${BCAST_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/bcast_coll.tesh)
     ENDFOREACH()
-    
+
     FOREACH (REDUCE_COLL default arrival_pattern_aware binomial flat_tree NTSL scatter_gather ompi mpich ompi_chain ompi_binary ompi_basic_linear ompi_binomial ompi_in_order_binary)
-        ADD_TEST(smpi-reduce-coll-${REDUCE_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/reduce:${REDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_coll.tesh)
+      ADD_TEST(smpi-reduce-coll-${REDUCE_COLL}  ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/reduce:${REDUCE_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_coll.tesh)
     ENDFOREACH()
 
     FOREACH (REDUCE_SCATTER_COLL default  ompi mpich ompi_basic_recursivehalving ompi_ring mpich_noncomm mpich_pair mpich_rdb)
-        ADD_TEST(smpi-reduce_scatter-coll-${REDUCE_SCATTER_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/reduce_scatter:${REDUCE_SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_scatter_coll.tesh)
+      ADD_TEST(smpi-reduce_scatter-coll-${REDUCE_SCATTER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/reduce_scatter:${REDUCE_SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/reduce_scatter_coll.tesh)
     ENDFOREACH()
 
     FOREACH (SCATTER_COLL default  ompi mpich ompi_basic_linear ompi_binomial)
-        ADD_TEST(smpi-scatter-coll-${SCATTER_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/scatter:${SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter_coll.tesh)
+      ADD_TEST(smpi-scatter-coll-${SCATTER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/scatter:${SCATTER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/scatter_coll.tesh)
     ENDFOREACH()
 
     FOREACH (BARRIER_COLL default  ompi mpich ompi_basic_linear ompi_tree ompi_bruck ompi_recursivedoubling ompi_doublering)
-        ADD_TEST(smpi-barrier-coll-${BARRIER_COLL} ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg smpi/barrier:${BARRIER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier_coll.tesh)
+      ADD_TEST(smpi-barrier-coll-${BARRIER_COLL} ${TESH_COMMAND} ${TESH_OPTION} --cfg smpi/barrier:${BARRIER_COLL} --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/barrier_coll.tesh)
     ENDFOREACH()
 
   endif()
 
   # END TESH TESTS
 
-  if(enable_smpi)
+  if(enable_smpi_MPICH3_testsuite)
+    ADD_TEST(smpi-mpich3-coll-thread            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread)
+    ADD_TEST(smpi-mpich3-coll-ompi-thread       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0)
+    ADD_TEST(smpi-mpich3-coll-mpich-thread      ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich)
+    set_tests_properties(smpi-mpich3-coll-thread smpi-mpich3-coll-ompi-thread smpi-mpich3-coll-mpich-thread PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     if(HAVE_RAWCTX)
-      ADD_TEST(smpi-mpich-env-raw               ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/env ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/env/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/env -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C})
-      ADD_TEST(smpi-mpich-pt2pt-raw             ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/pt2pt ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/pt2pt/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/pt2pt -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C})
-      ADD_TEST(smpi-mpich-context-raw           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/context ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/context/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/context -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C})
-      ADD_TEST(smpi-mpich-profile-raw           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/profile  ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/profile/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/profile -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C} )
-      ADD_TEST(smpi-mpich-coll-raw              ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich-test/coll ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/coll/runtests -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/coll -basedir=${CMAKE_BINARY_DIR}/smpi_script/ -fort=${SMPI_F2C})
-      set_tests_properties(smpi-mpich-env-raw smpi-mpich-context-raw  smpi-mpich-pt2pt-raw smpi-mpich-coll-raw smpi-mpich-profile-raw PROPERTIES PASS_REGULAR_EXPRESSION "-- No differences found; test successful")
+      ADD_TEST(smpi-mpich3-attr-raw             ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/attr perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      ADD_TEST(smpi-mpich3-comm-raw             ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/comm perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/comm -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      ADD_TEST(smpi-mpich3-init-raw             ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/init perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/init -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      ADD_TEST(smpi-mpich3-datatype-raw         ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/datatype perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      ADD_TEST(smpi-mpich3-group-raw            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/group perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/group -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      ADD_TEST(smpi-mpich3-pt2pt-raw            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/pt2pt perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt -tests=testlist -execarg=--cfg=contexts/factory:raw)
+      set_tests_properties(smpi-mpich3-attr-raw smpi-mpich3-comm-raw smpi-mpich3-init-raw smpi-mpich3-datatype-raw smpi-mpich3-group-raw smpi-mpich3-pt2pt-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+    endif()
+
+    if(SMPI_F2C)
+      ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=contexts/stack_size:8000)
+      set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+      if(NOT HAVE_MC)
+        ADD_TEST(smpi-mpich3-thread-f90         ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
+        set_tests_properties(smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+      endif()
     endif()
   endif()
 
   # Java examples
   if(enable_java)
+    if(WIN32)
+    set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${SIMGRID_JAR}")
+    else()
     set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${SIMGRID_JAR}")
-    ADD_TEST(java-async                         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/async/async.tesh)
-    ADD_TEST(java-bittorrent                    ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent/bittorrent.tesh)
-    ADD_TEST(java-bypass                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_bypass/bypass.tesh)
-    ADD_TEST(java-chord                         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh)
-    ADD_TEST(java-cloud                         ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/cloud.tesh)
-    ADD_TEST(java-commTime                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/commTime/commtime.tesh)
-    ADD_TEST(java-kademlia                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh)
-    ADD_TEST(java-kill                          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_kill/kill.tesh)
-    ADD_TEST(java-masterslave                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/masterslave/masterslave.tesh)
-    ADD_TEST(java-migration                     ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/migration/migration.tesh)
-    ADD_TEST(java-mutualExclusion               ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/mutualExclusion/mutualexclusion.tesh)
-    ADD_TEST(java-pingPong                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/pingPong/pingpong.tesh)
-    ADD_TEST(java-priority                      ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh)
-    ADD_TEST(java-startKillTime                 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime/startKillTime.tesh)
-    ADD_TEST(java-suspend                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/suspend/suspend.tesh)
+    endif()
+    ADD_TEST(java-async                         ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/async/async.tesh)
+    ADD_TEST(java-bittorrent                    ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/bittorrent/bittorrent.tesh)
+    ADD_TEST(java-bypass                        ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_bypass/bypass.tesh)
+    ADD_TEST(java-chord                         ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/chord/chord.tesh)
+    ADD_TEST(java-cloud                         ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/cloud/cloud.tesh)
+    ADD_TEST(java-commTime                      ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/commTime/commtime.tesh)
+    ADD_TEST(java-kademlia                      ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/kademlia/kademlia.tesh)
+    ADD_TEST(java-kill                          ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/master_slave_kill/kill.tesh)
+    ADD_TEST(java-masterslave                   ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/masterslave/masterslave.tesh)
+    ADD_TEST(java-migration                     ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/migration/migration.tesh)
+    ADD_TEST(java-mutualExclusion               ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/mutualExclusion/mutualexclusion.tesh)
+    ADD_TEST(java-pingPong                      ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/pingPong/pingpong.tesh)
+    ADD_TEST(java-priority                      ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/priority/priority.tesh)
+    ADD_TEST(java-startKillTime                 ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime/startKillTime.tesh)
+    ADD_TEST(java-suspend                       ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/suspend/suspend.tesh)
     if(HAVE_TRACING)
-      ADD_TEST(java-tracing                       ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh)
+      ADD_TEST(java-tracing                     ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/tracing/tracingPingPong.tesh)
     endif()
   endif()
 
   # Scala examples
   if(enable_scala)
+    if(WIN32)
+    set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/\;${SIMGRID_JAR}\;${SCALA_JARS}")
+    else()
     set(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/scala/:${SIMGRID_JAR}:${SCALA_JARS}")
-    ADD_TEST(scala-bypass                        ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_bypass/bypass.tesh)
-    ADD_TEST(scala-kill                          ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_kill/kill.tesh)
-    ADD_TEST(scala-masterslave                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave/masterslave.tesh)
+    endif()
+
+    ADD_TEST(scala-bypass                       ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_bypass/bypass.tesh)
+    ADD_TEST(scala-kill                         ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/master_slave_kill/kill.tesh)
+    ADD_TEST(scala-masterslave                  ${TESH_COMMAND} ${TESH_OPTION} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/scala --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/scala ${CMAKE_HOME_DIRECTORY}/examples/scala/masterslave/masterslave.tesh)
   endif()
 
   # examples/msg/mc
   if(HAVE_MC)
     if(CONTEXT_UCONTEXT)
-      ADD_TEST(mc-bugged1-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
-      ADD_TEST(mc-bugged2-ucontext              ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
+      ADD_TEST(mc-bugged1-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
+      ADD_TEST(mc-bugged2-ucontext              ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
       if(PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
-        ADD_TEST(mc-bugged1-liveness-ucontext   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
+        ADD_TEST(mc-bugged1-liveness-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
+        ADD_TEST(mc-bugged1-liveness-visited-ucontext   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited.tesh)
       endif()
     endif()
     if(HAVE_RAWCTX)
-      ADD_TEST(mc-bugged1-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
-      ADD_TEST(mc-bugged2-raw                   ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
+      ADD_TEST(mc-bugged1-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
+      ADD_TEST(mc-bugged2-raw                   ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
     endif()
   endif()
 
index 4727446..846f9ea 100644 (file)
@@ -7,16 +7,15 @@ set(CMAKE_MODULE_PATH
 # x86
 # i.86
 
-IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
+### Determine the assembly flavor that we need today
+include(CMakeDetermineSystem)
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64")
   IF(${ARCH_32_BITS})
+    message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
     set(PROCESSOR_i686 1)
-    set(SIMGRID_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
-    message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
   ELSE()
-    message(STATUS "System processor: amd64")
-    set(SIMGRID_SYSTEM_PROCESSOR "amd64")
+    message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
     set(PROCESSOR_x86_64 1)
-    set(PROCESSOR_i686 0)
   ENDIF()
   set(HAVE_RAWCTX 1)
 
@@ -57,6 +56,12 @@ ELSE() #PROCESSOR NOT FOUND
 
 ENDIF()
 
+if(ARCH_32_BITS)
+  set(MPI_ADDRESS_SIZE 4)
+else()
+  set(MPI_ADDRESS_SIZE 8)
+endif()
+
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
 
 include(CheckFunctionExists)
@@ -98,12 +103,12 @@ if(enable_ns3)
 endif()
 
 # Checks for header libraries functions.
-CHECK_LIBRARY_EXISTS(pthread   pthread_create                  "" pthread)
-CHECK_LIBRARY_EXISTS(pthread   sem_init                                "" HAVE_SEM_INIT_LIB)
-CHECK_LIBRARY_EXISTS(pthread   sem_open                                "" HAVE_SEM_OPEN_LIB)
-CHECK_LIBRARY_EXISTS(pthread   sem_timedwait                   "" HAVE_SEM_TIMEDWAIT_LIB)
-CHECK_LIBRARY_EXISTS(pthread   pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
-CHECK_LIBRARY_EXISTS(rt                clock_gettime                   "" HAVE_POSIX_GETTIME)
+CHECK_LIBRARY_EXISTS(pthread pthread_create          "" pthread)
+CHECK_LIBRARY_EXISTS(pthread sem_init                "" HAVE_SEM_INIT_LIB)
+CHECK_LIBRARY_EXISTS(pthread sem_open                "" HAVE_SEM_OPEN_LIB)
+CHECK_LIBRARY_EXISTS(pthread sem_timedwait           "" HAVE_SEM_TIMEDWAIT_LIB)
+CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
+CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 
 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
 CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
@@ -236,8 +241,8 @@ if (HAVE_DLFCN_H)
     else()
 
       execute_process(COMMAND ./test_gnu_ld
-          WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 
-          RESULT_VARIABLE HAVE_GNU_LD_run 
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE HAVE_GNU_LD_run
           OUTPUT_VARIABLE var_exec
       )
 
@@ -248,7 +253,7 @@ if (HAVE_DLFCN_H)
         set(HAVE_GNU_LD 0)
         message(STATUS "Warning: error while checking for GNU ld:")
         message(STATUS "Test output: '${var_exec}'")
-       message(STATUS "Exit status: ${HAVE_GNU_LD_run}")
+        message(STATUS "Exit status: ${HAVE_GNU_LD_run}")
       endif()
       file(REMOVE test_gnu_ld)
     endif()
@@ -283,8 +288,8 @@ if(pthread)
     endif()
 
     execute_process(COMMAND ./sem_open
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 
-    RESULT_VARIABLE HAVE_SEM_OPEN_run 
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    RESULT_VARIABLE HAVE_SEM_OPEN_run
     OUTPUT_VARIABLE var_compil
     )
     file(REMOVE sem_open)
@@ -310,9 +315,9 @@ if(pthread)
 
   if(HAVE_SEM_INIT_LIB)
     execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -lpthread -o sem_init
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     RESULT_VARIABLE HAVE_SEM_INIT_run OUTPUT_VARIABLE HAVE_SEM_INIT_compil)
-    
+
     if(HAVE_SEM_INIT_compil)
       set(HAVE_SEM_INIT 0)
       message(STATUS "Warning: sem_init not compilable")
@@ -321,9 +326,9 @@ if(pthread)
       set(HAVE_SEM_INIT 1)
       message(STATUS "sem_init is compilable")
     endif()
-    execute_process(COMMAND ./sem_init 
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR} 
-    RESULT_VARIABLE HAVE_SEM_INIT_run 
+    execute_process(COMMAND ./sem_init
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    RESULT_VARIABLE HAVE_SEM_INIT_run
     OUTPUT_VARIABLE var_compil
     )
     file(REMOVE sem_init)
@@ -550,7 +555,7 @@ if(HAVE_MAKECONTEXT OR WIN32)
     message(STATUS "${pth_skaddr_makecontext}")
     message(STATUS "${pth_sksize_makecontext}")
   else()
-    #      message(FATAL_ERROR "makecontext is not compilable")
+    # message(FATAL_ERROR "makecontext is not compilable")
   endif()
 endif()
 
@@ -607,39 +612,44 @@ set(diff_va "va_copy((d),(s))"
 
 foreach(fct ${diff_va})
   write_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" "#include <stdlib.h>
-       #include <stdarg.h>
-       #include <string.h>
-       #define DO_VA_COPY(d,s) ${fct}
-       void test(char *str, ...)
-       {
-           va_list ap, ap2;
-           int i;
-           va_start(ap, str);
-           DO_VA_COPY(ap2, ap);
-           for (i = 1; i <= 9; i++) {
-               int k = (int)va_arg(ap, int);
-               if (k != i)
-                   abort();
-           }
-           DO_VA_COPY(ap, ap2);
-           for (i = 1; i <= 9; i++) {
-               int k = (int)va_arg(ap, int);
-               if (k != i)
-                   abort();
-           }
-           va_end(ap);
-       }
-       int main(void)
-       {
-           test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9);
-           exit(0);
-       }"
-    )
-  try_compile(COMPILE_VA_NULL_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c
+#include <stdarg.h>
+#include <string.h>
+#define DO_VA_COPY(d,s) ${fct}
+void test(char *str, ...)
+{
+  va_list ap, ap2;
+  int i;
+  va_start(ap, str);
+  DO_VA_COPY(ap2, ap);
+  for (i = 1; i <= 9; i++) {
+    int k = (int)va_arg(ap, int);
+    if (k != i)
+      abort();
+  }
+  DO_VA_COPY(ap, ap2);
+  for (i = 1; i <= 9; i++) {
+    int k = (int)va_arg(ap, int);
+    if (k != i)
+      abort();
+  }
+  va_end(ap);
+}
+int main(void)
+{
+  test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9);
+  exit(0);
+}"
     )
-  if(COMPILE_VA_NULL_VAR)
+
+  execute_process(
+  COMMAND ${CMAKE_C_COMPILER} "${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" 
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  RESULT_VARIABLE COMPILE_VA_NULL_VAR
+  OUTPUT_QUIET
+  ERROR_QUIET
+  )
+
+  if(NOT COMPILE_VA_NULL_VAR)
     string(REGEX REPLACE "\;" "" fctbis ${fct})
     if(${fctbis} STREQUAL "va_copy((d),(s))")
       set(HAVE_VA_COPY 1)
@@ -762,12 +772,13 @@ endif()
 
 ### File to create
 
-configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"
+  "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)
 
 SET( CMAKEDEFINE "#cmakedefine" )
-configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/internal_config.h.in"     "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE)
-configure_file("${CMAKE_BINARY_DIR}/src/internal_config.h"                     "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE)
-configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in"           "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE)
+configure_file("${CMAKE_BINARY_DIR}/src/internal_config.h" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE)
 
 set(top_srcdir "${CMAKE_HOME_DIRECTORY}")
 set(srcdir "${CMAKE_HOME_DIRECTORY}/src")
@@ -778,8 +789,16 @@ set(exec_prefix ${CMAKE_INSTALL_PREFIX})
 set(includeflag "-I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/smpi")
 set(includedir "${CMAKE_INSTALL_PREFIX}/include")
 set(libdir ${exec_prefix}/lib)
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib")
+if(GTNETS_LIB_PATH)
+  set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}")
+endif()
+if(HAVE_NS3_LIB)
+  set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${HAVE_NS3_LIB}")
+endif()
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
 
+configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/mpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/mpif.h @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/bin/smpicc @ONLY)
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY)
@@ -792,7 +811,14 @@ set(includeflag "-I${CMAKE_HOME_DIRECTORY}/include -I${CMAKE_HOME_DIRECTORY}/inc
 set(includeflag "${includeflag} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_BINARY_DIR}/include/smpi")
 set(includedir "${CMAKE_HOME_DIRECTORY}/include")
 set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
-set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
+set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib")
+if(GTNETS_LIB_PATH)
+  set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}")
+endif()
+if(HAVE_NS3_LIB)
+  set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${HAVE_NS3_LIB}")
+endif()
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
 set(libdir "${CMAKE_BINARY_DIR}/lib")
 
 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc @ONLY)
@@ -817,6 +843,7 @@ if(NOT WIN32)
 endif()
 
 set(generated_headers_to_install
+  ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/mpif.h
   ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
   ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
   )
@@ -888,4 +915,4 @@ IF(${ARCH_32_BITS})
 ELSE()
   set(WIN_ARCH "64")
 ENDIF()
-configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/simgrid.nsi.in"   "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/src/simgrid.nsi.in" "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)
index d279c1a..cdef08e 100644 (file)
@@ -10,7 +10,7 @@ set(EXTRA_DIST
   src/include/simgrid/sg_config.h
   src/include/smpi/smpi_interface.h
   src/include/surf/datatypes.h
-  src/include/surf/maxmin.h 
+  src/include/surf/maxmin.h
   src/include/surf/random_mgr.h
   src/include/surf/surf.h
   src/include/surf/surf_resource.h
@@ -49,7 +49,6 @@ set(EXTRA_DIST
   src/surf/gtnets/gtnets_simulator.h
   src/surf/gtnets/gtnets_topology.h
   src/surf/maxmin_private.h
-  #src/surf/network_gtnets_private.h
   src/surf/network_gtnets.hpp
   src/surf/network_ns3_private.h
   src/surf/network_private.h
@@ -139,7 +138,6 @@ set(SMPI_SRC
   src/smpi/colls/allgather-bruck.c
   src/smpi/colls/allgather-GB.c
   src/smpi/colls/allgather-loosely-lr.c
-  src/smpi/colls/allgather-lr.c
   src/smpi/colls/allgather-NTSLR.c
   src/smpi/colls/allgather-NTSLR-NB.c
   src/smpi/colls/allgather-pair.c
@@ -156,13 +154,11 @@ set(SMPI_SRC
   src/smpi/colls/allgatherv-ompi-neighborexchange.c
   src/smpi/colls/allgatherv-ompi-bruck.c
   src/smpi/colls/allgatherv-mpich-rdb.c
+  src/smpi/colls/allgatherv-mpich-ring.c
   src/smpi/colls/allreduce-lr.c
-  src/smpi/colls/allreduce-NTS.c
   src/smpi/colls/allreduce-rab1.c
   src/smpi/colls/allreduce-rab2.c
   src/smpi/colls/allreduce-rab-rdb.c
-  #src/smpi/colls/allreduce-rab-reduce-scatter.c
-  src/smpi/colls/allreduce-rab-rsag.c
   src/smpi/colls/allreduce-rdb.c
   src/smpi/colls/allreduce-redbcast.c
   src/smpi/colls/allreduce-smp-binomial.c
@@ -174,7 +170,7 @@ set(SMPI_SRC
   src/smpi/colls/allreduce-ompi-ring-segmented.c
   src/smpi/colls/alltoall-2dmesh.c
   src/smpi/colls/alltoall-3dmesh.c
-  #src/smpi/colls/alltoall-bruck.c
+#  src/smpi/colls/alltoall-bruck.c
   src/smpi/colls/alltoall-pair.c
   src/smpi/colls/alltoall-pair-light-barrier.c
   src/smpi/colls/alltoall-pair-mpi-barrier.c
@@ -184,7 +180,6 @@ set(SMPI_SRC
   src/smpi/colls/alltoall-ring-light-barrier.c
   src/smpi/colls/alltoall-ring-mpi-barrier.c
   src/smpi/colls/alltoall-ring-one-barrier.c
-  src/smpi/colls/alltoall-simple.c
   src/smpi/colls/alltoallv-pair.c   
   src/smpi/colls/alltoallv-pair-light-barrier.c
   src/smpi/colls/alltoallv-pair-mpi-barrier.c
@@ -194,7 +189,7 @@ set(SMPI_SRC
   src/smpi/colls/alltoallv-ring-mpi-barrier.c
   src/smpi/colls/alltoallv-ring-one-barrier.c
   src/smpi/colls/alltoallv-bruck.c
-  src/smpi/colls/bcast-arrival-nb.c
+  src/smpi/colls/alltoallv-ompi-basic-linear.c
   src/smpi/colls/bcast-arrival-pattern-aware.c
   src/smpi/colls/bcast-arrival-pattern-aware-wait.c
   src/smpi/colls/bcast-arrival-scatter.c
@@ -221,6 +216,7 @@ set(SMPI_SRC
   src/smpi/colls/gather-ompi.c
   src/smpi/colls/reduce_scatter-ompi.c
   src/smpi/colls/reduce_scatter-mpich.c
+  src/smpi/colls/smpi_automatic_selector.c
   src/smpi/colls/scatter-ompi.c
   src/smpi/colls/barrier-ompi.c
   )
@@ -556,7 +552,6 @@ set(headers_to_install
   include/simgrid/platf_generator.h
   include/simgrid/simix.h
   include/smpi/mpi.h
-  include/smpi/mpif.h
   include/smpi/smpi.h
   include/smpi/smpi_cocci.h
   include/smpi/smpi_main.h
@@ -602,6 +597,7 @@ set(headers_to_install
   )
 set(source_of_generated_headers
   include/simgrid_config.h.in
+  include/smpi/mpif.h.in
   include/smpi/smpif.h.in
   src/context_sysv_config.h.in)
 
@@ -726,7 +722,6 @@ else()
 endif()
 
 set(DOC_SOURCES
-  doc/AS_hierarchy.png
   doc/Doxyfile.in
   doc/Layout.xml
   doc/sg_thread_model.fig
@@ -791,6 +786,8 @@ set(DOC_SOURCES
   doc/msg-tuto-src/platforms/griffon.xml
   doc/msg-tuto-src/platforms/peers.xml
   doc/msg-tuto-src/platforms/platform.xml
+  
+  CITATION.bib
   )
 
 set(DOC_FIGS
@@ -808,6 +805,7 @@ set(DOC_TOOLS
 set(DOC_IMG
   ${CMAKE_HOME_DIRECTORY}/doc/simgrid.css
   ${CMAKE_HOME_DIRECTORY}/doc/sc3-description.png
+  ${CMAKE_HOME_DIRECTORY}/doc/webcruft/AS_hierarchy.png
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot.jpg
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/Paje_MSG_screenshot_thn.jpg
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/SGicon.gif
@@ -827,6 +825,8 @@ set(DOC_IMG
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_04.png
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_05.png
   ${CMAKE_HOME_DIRECTORY}/doc/webcruft/win_install_06.png
+  ${CMAKE_HOME_DIRECTORY}/doc/webcruft/smpi_simgrid_alltoall_pair_16.png
+  ${CMAKE_HOME_DIRECTORY}/doc/webcruft/smpi_simgrid_alltoall_ring_16.png
   )
 
 set(bin_files
@@ -879,6 +879,9 @@ set(EXAMPLES_CMAKEFILES_TXT
   examples/msg/chainsend/CMakeLists.txt
   examples/msg/chord/CMakeLists.txt
   examples/msg/cloud/CMakeLists.txt
+  examples/msg/energy/e1/CMakeLists.txt
+  examples/msg/energy/e2/CMakeLists.txt
+  examples/msg/energy/e3/CMakeLists.txt
   examples/msg/gpu/CMakeLists.txt
   examples/msg/gtnets/CMakeLists.txt
   examples/msg/icomms/CMakeLists.txt
@@ -907,6 +910,7 @@ set(EXAMPLES_CMAKEFILES_TXT
   examples/simdag/dax/CMakeLists.txt
   examples/simdag/dot/CMakeLists.txt
   examples/simdag/goal/CMakeLists.txt
+  examples/simdag/io/CMakeLists.txt
   examples/simdag/metaxml/CMakeLists.txt
   examples/simdag/properties/CMakeLists.txt
   examples/simdag/scheduling/CMakeLists.txt
@@ -916,8 +920,8 @@ set(EXAMPLES_CMAKEFILES_TXT
   )
 
 set(TESHSUITE_CMAKEFILES_TXT
-  teshsuite/CMakeLists.txt
   teshsuite/msg/CMakeLists.txt
+  teshsuite/msg/storage/CMakeLists.txt
   teshsuite/msg/trace/CMakeLists.txt
   teshsuite/simdag/CMakeLists.txt
   teshsuite/simdag/availability/CMakeLists.txt
@@ -926,13 +930,27 @@ set(TESHSUITE_CMAKEFILES_TXT
   teshsuite/simdag/network/p2p/CMakeLists.txt
   teshsuite/simdag/partask/CMakeLists.txt
   teshsuite/simdag/platforms/CMakeLists.txt
+  teshsuite/simix/CMakeLists.txt
   teshsuite/smpi/CMakeLists.txt
-  teshsuite/smpi/mpich-test/CMakeLists.txt
-  teshsuite/smpi/mpich-test/coll/CMakeLists.txt
-  teshsuite/smpi/mpich-test/context/CMakeLists.txt
-  teshsuite/smpi/mpich-test/env/CMakeLists.txt
-  teshsuite/smpi/mpich-test/profile/CMakeLists.txt
-  teshsuite/smpi/mpich-test/pt2pt/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/attr/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/group/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/init/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
+#  teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
   teshsuite/xbt/CMakeLists.txt
   )
 
@@ -1021,6 +1039,7 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/conf/transform_optorsim_platform.pl
   examples/platforms/config.xml
   examples/platforms/content/storage_content.txt
+  examples/platforms/content/win_storage_content.txt
   examples/platforms/data_center.xml
   examples/platforms/g5k.xml
   examples/platforms/generation_scripts/create_hierarchical_clusters.pl
index 6a9c66c..7c9a201 100644 (file)
@@ -241,7 +241,7 @@ foreach(file ${source_to_pack})
   # Actually copy the file
   add_custom_command(
     TARGET dist-dir
-    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/${file} ${PROJECT_NAME}-${release_version}/${file_location}/
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/${file} ${PROJECT_NAME}-${release_version}/${file_location}
     )
 endforeach(file ${source_to_pack})
 
@@ -309,7 +309,7 @@ add_custom_target(distcheck
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM}
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Test"
-  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ctest
+  COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ctest --output-on-failure
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Install"
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} install
index 2a2a96f..68cae01 100644 (file)
@@ -4,6 +4,7 @@ set(optCFLAGS "")
 if(NOT __VISUALC__ AND NOT __BORLANDC__)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-g3")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-g3")
+  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
 else()
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}/Zi")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/Zi")
@@ -18,15 +19,23 @@ if(enable_compile_warnings)
     string(REPLACE "-Wclobbered " "" warnCFLAGS "${warnCFLAGS}")
   endif()
 
-  set(CMAKE_Fortran_FLAGS "-Wall") # FIXME: Q&D hack
+  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") # FIXME: Q&D hack
 
   set(CMAKE_JAVA_COMPILE_FLAGS "-Xlint")
 endif()
 
 if(enable_compile_optimizations)
   set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
-  if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
-    set(optCFLAGS "${optCFLAGS}-flto ")
+  if(WIN32)
+    if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.7")
+    # On windows, we need 4.8 or higher to enable lto because of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50293
+      set(optCFLAGS "${optCFLAGS} -flto ")
+    endif()
+  else()    
+    # On non-windows, 4.6 is enough for that
+    if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.5")
+      set(optCFLAGS "${optCFLAGS} -flto ")
+    endif()
   endif()
 else()
   set(optCFLAGS "-O0 ")
index a7bc518..71b7f8d 100644 (file)
@@ -16,8 +16,8 @@ endif()
 if(NSIS_PATH)
   ADD_CUSTOM_TARGET(nsis
     COMMENT "Generating the SimGrid installor for Windows..."
-    DEPENDS simgrid simgrid graphicator tesh simgrid-colorizer simgrid_update_xml
+    DEPENDS simgrid simgrid graphicator simgrid-colorizer simgrid_update_xml
     COMMAND ${NSIS_PATH}/makensis.exe simgrid.nsi
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/
     )
-endif()
\ No newline at end of file
+endif()
index 92c7005..51fb860 100644 (file)
@@ -1,14 +1,6 @@
 ###################################################################
 ### Load all files declaring binaries (tools, examples and tests) #
 ###################################################################
-##################################################################
-# Those CMakelists are just added to define files in dist    #
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/lua)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools)
-##################################################################
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/async)
@@ -29,11 +21,17 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/startKillTime)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/suspend)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/java/tracing)
 
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/lua)
+
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/actions)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/bittorrent)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/chainsend)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/chord)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/cloud)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e1)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e2)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/energy/e3)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/gpu)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/gtnets)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/msg/icomms)
@@ -64,6 +62,7 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dax)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/dot)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/goal)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/io)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/metaxml)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/properties)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling)
@@ -71,8 +70,12 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/simdag/scheduling)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/smpi/MM)
 
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/examples/xbt)
+
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace)
+
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/availability)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network)
@@ -80,17 +83,36 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/mxn)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms)
+
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix)
+
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/coll)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/context)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/env)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/profile)
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich-test/pt2pt)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/comm)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/group)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/init)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt)
+
+#add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/attr)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/coll)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/comm)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/datatype)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ext)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/init)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/pt2pt)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/coll)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/datatype)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/init)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/pt2pt)
+
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/xbt)
 
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/surf)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/testsuite/xbt)
 
-add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/graphicator/)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools)
+add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/graphicator)
 add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools/tesh)
index 86d7dd3..c6a77b7 100644 (file)
@@ -28,7 +28,17 @@ message("-- [Java] SG_java includes: ${CHECK_INCLUDES}")
 
 target_link_libraries(SG_java simgrid)
 
+
+
+
 if(WIN32)
+  exec_program("java -d32 -version"
+                OUTPUT_VARIABLE IS_32_BITS_JVM)
+  STRING( FIND ${IS_32_BITS_JVM} "Error" POSITION )
+  if(${POSITION} GREATER -1) 
+    message(FATAL_ERROR "Java JVM needs to be 32 bits to be able to run with Simgrid on Windows for now")
+  endif()
+
   set_target_properties(SG_java PROPERTIES
     LINK_FLAGS "-Wl,--subsystem,windows,--kill-at"
     PREFIX "")
@@ -36,7 +46,7 @@ if(WIN32)
   message(STATUS "pexports: ${PEXPORTS_PATH}")
   if(PEXPORTS_PATH)
     add_custom_command(TARGET SG_java POST_BUILD
-      COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/SG_java.dll > ${CMAKE_BINARY_DIR}/SG_java.def)
+      COMMAND ${PEXPORTS_PATH}/pexports.exe ${CMAKE_BINARY_DIR}/lib/SG_java.dll > ${CMAKE_BINARY_DIR}/lib/SG_java.def)
   endif(PEXPORTS_PATH)
 endif()
 
@@ -48,7 +58,7 @@ endif()
 set(SIMGRID_JAR "${CMAKE_BINARY_DIR}/simgrid.jar")
 set(MANIFEST_FILE "${CMAKE_HOME_DIRECTORY}/src/bindings/java/MANIFEST.MF")
 set(LIBSIMGRID_SO
-  ${CMAKE_SHARED_LIBRARY_PREFIX}simgrid${CMAKE_SHARED_LIBRARY_SUFFIX})
+  libsimgrid${CMAKE_SHARED_LIBRARY_SUFFIX})
 set(LIBSG_JAVA_SO
   ${CMAKE_SHARED_LIBRARY_PREFIX}SG_java${CMAKE_SHARED_LIBRARY_SUFFIX})
 
@@ -62,7 +72,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES ".86")
   endif()
 else()
   message(WARNING "Unknown system type. Processor: ${CMAKE_SYSTEM_PROCESSOR}; System: ${CMAKE_SYSTEM_NAME}")
-  set(JSG_BUNDLE "NATIVE/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR/")
+  set(JSG_BUNDLE "NATIVE/${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}/")
 endif()
 message("-- [Java] Native libraries bundled into: ${JSG_BUNDLE}")
 
index 206ab5c..f596b1f 100644 (file)
@@ -1,6 +1,9 @@
 ### Make Libs
 #>gcc c:\simgrid-trunk\examples\msg\icomms\peer.c -static -Lc:\simgrid-trunk\lib -lsimgrid -Ic:\simgrid-trunk\include -lwsock32
 
+if(enable_java)
+  include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
+endif()
 
 add_library(simgrid SHARED ${simgrid_sources})
 
index 7f0c74a..5bee952 100644 (file)
@@ -21,7 +21,7 @@ if(VALGRIND_EXE)
   if(NEW_VALGRIND_VERSION)
     message(STATUS "Valgrind version: ${NEW_VALGRIND_VERSION}")
     exec_program("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/generate_memcheck_tests.pl ${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake > ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/memcheck_tests.cmake" OUTPUT_VARIABLE SHUTT)
-    set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --trace-children-skip=/usr/bin/*,/bin/* --leak-check=full --show-reachable=yes --track-origins=no --read-var-info=no")
+    set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --trace-children-skip=/usr/bin/*,/bin/* --leak-check=full --show-reachable=yes --track-origins=no --read-var-info=no --num-callers=20 --suppressions=${CMAKE_HOME_DIRECTORY}/tools/simgrid.supp")
     message(STATUS "Valgrind options: ${MEMORYCHECK_COMMAND_OPTIONS}")
   else()
     set(enable_memcheck false)
index 76622f5..f9f4d28 100644 (file)
@@ -16,8 +16,6 @@ mark_as_advanced(pipol_user)
 
 option(release "Whether Release Mode is activated (disable tests on experimental parts)" on)
 option(enable_compile_optimizations "Whether to produce efficient code for the SimGrid library" on)
-option(enable_debug "Set NDEBUG flag" on)
-
 option(enable_gtnets "Whether gtnets model is activated." off)
 option(enable_ns3    "Whether ns3 model is activated." off)
 option(enable_java   "Whether the Java bindings are activated." off)
@@ -43,8 +41,10 @@ option(enable_msg_deprecated "This option enable the use of msg deprecated funct
 
 if(WIN32)
   option(enable_smpi "Whether SMPI in included in library." off)
+  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 else()
   option(enable_smpi "Whether SMPI in included in library." on)
+  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 endif()
 
 if(enable_scala AND NOT enable_java)
index 6f34b4e..f1108fb 100644 (file)
@@ -14,6 +14,7 @@ IF(pipol_user)
 
   if(enable_smpi)
     set(CMAKE_OPTIONS "${CMAKE_OPTIONS}        -Denable_smpi=on")
+    set(CMAKE_OPTIONS "${CMAKE_OPTIONS}        -Denable_smpi_MPICH3_testsuite=on")
   endif()
 
   if(enable_lua)
@@ -167,4 +168,4 @@ IF(pipol_user)
   COMMAND scp ${CMAKE_HOME_DIRECTORY}/buildtools/pipol/pre-simgrid.sh ${pipol_user}@pipol.inria.fr:~/
   COMMAND ssh ${pipol_user}@pipol.inria.fr "chmod a=rwx ~/* ~/.pipol/rc.* ~/.pipol/nightly/*"
   )
-ENDIF()
\ No newline at end of file
+ENDIF()
index fa0fa1f..d15127a 100644 (file)
@@ -109,6 +109,7 @@ message("        Compile Java ........: ${HAVE_Java}")
 message("        Compile Scala........: ${HAVE_Scala}")
 message("        Compile Lua .........: ${HAVE_LUA}")
 message("        Compile Smpi ........: ${HAVE_SMPI}")
+message("        Compile MPI testsuite: ${enable_smpi_MPICH3_testsuite}")
 message("        Compile Smpi f77 ....: ${SMPI_F2C}")
 message("        Compile Static ......: ${enable_lib_static}")
 message("")
@@ -122,7 +123,6 @@ message("        Graphviz mode .......: ${HAVE_GRAPHVIZ}")
 message("        Mallocators .........: ${enable_mallocators}")
 message("")
 message("        Simgrid dependencies : ${SIMGRID_DEP}")
-message("        Smpi dependencies ...: ${SMPI_DEP}")
 message("")
 message("        INSTALL_PREFIX ......: ${CMAKE_INSTALL_PREFIX}")
 
index 3f7652f..df08806 100755 (executable)
@@ -8,7 +8,7 @@ if ( $#ARGV != 1 ) {
 }
 
 my ($proj_dir) = $ARGV[0];
-open MAKETEST, $ARGV[1] or die "Unable to open $ARGV[1]. $!\n";
+open MAKETEST, $ARGV[1] or die "Unable to open file: \"$ARGV[1]\". $!\n";
 
 sub var_subst {
     my ($text, $name, $value) = @_;
@@ -47,7 +47,7 @@ while ( defined( $line = <MAKETEST> ) ) {
     }
     if ($dump) {
         $line =~ s/^  //;
-        if ( $line =~ /^\s*ADD_TEST\(\S+\s+\S*\/tesh\s/ ) {
+        if ( $line =~ /^\s*ADD_TEST\(\S+\s+\S*TESH\_COMMAND\}\s/ ) {
             undef %environ;
             $config_var = "";
             $path       = "";
@@ -71,7 +71,7 @@ while ( defined( $line = <MAKETEST> ) ) {
                 my ( $env_var, $value_var ) = ( $1, $2 );
                 $environ{$env_var} = $value_var;
             }
-            if ( $line =~ /(\S+)\)$/ ) {
+            if ( $line =~ /(\S+)\s*\)$/ ) {
                 $tesh_file = $1;
                 $tesh_file =~ s/^[^\/\$]/$path\/$&/;
                 $tesh_file =~ s/\${CMAKE_HOME_DIRECTORY}/$proj_dir/g;
@@ -96,7 +96,7 @@ while ( defined( $line = <MAKETEST> ) ) {
             my ($count)        = 0;
             my ($count_first)  = 0;
             my ($count_second) = 0;
-            open TESH_FILE, $tesh_file or die "Unable to open $tesh_file $!\n";
+            open TESH_FILE, $tesh_file or die "Unable to open tesh file: \"$tesh_file\". $!\n";
             my ($input) = "";
             my ($l);
             while ( defined( $l = <TESH_FILE> ) ) {
index a5b53c4..9170663 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 eval 'exec perl -S $0 ${1+"$@"}'
-    if $running_under_some_shell;
+  if $running_under_some_shell;
 
 =encoding UTF-8
 
@@ -13,9 +13,19 @@ tesh -- testing shell
 B<tesh> [I<options>] I<tesh_file>
 
 =cut
-my($bindir);
-my($srcdir);
+my($bindir)=".";
+my($srcdir)=".";
+my($timeout)=0;
+my($time_to_wait)=0;
 my $path = $0;
+my $OS;
+my $enable_coverage=0;
+my $tesh_file;
+my $tesh_name;
+my $error=0;
+my $exitcode=0;
+my @bg_cmds;
+
 $path =~ s|[^/]*$||;
 push @INC,$path;
 
@@ -23,101 +33,135 @@ use Getopt::Long qw(GetOptions);
 use strict;
 use Term::ANSIColor;
 use IPC::Open3;
+use IO::File;
 
-my($OS)=`echo %OS%`;
-if($OS eq "%OS%"){
-       $OS = "UNIX";
+if($^O eq "linux"){
+    $OS = "UNIX";
 }
 else{
-       $OS = "WIN";
+    $OS = "WIN";
+    $ENV{"PRINTF_EXPONENT_DIGITS"} = "2"; 
 }
 
-print "OS: ".$OS."\n";
+
+sub trim($)
+{
+    my $string = shift;
+    $string =~ s/^\s+//;
+    $string =~ s/\s+$//;
+    return $string;
+}
 
 # make sure we received a tesh file
-scalar @ARGV > 0 || die "Usage:\n    tesh [*options*] *tesh_file*\n";
+scalar @ARGV > 0 || die "Usage:\n  tesh [*options*] *tesh_file*\n";
 
 #Add current directory to path
 $ENV{PATH} = "$ENV{PATH}:.";
 
-
 ##
 ## Command line option handling
 ##
 
 # option handling helper subs
 sub cd_cmd {
-    my $directory=$_[1];
-    if (-e $directory && -d $directory) {
-       chdir("$directory");
-       print "[Tesh/INFO] change directory to $directory\n";
-    } elsif (-e $directory) {
-       die "[Tesh/CRITICAL] Cannot change directory to '$directory': it is not a directory\n";
-    } else {
-       die "[Tesh/CRITICAL] Cannot change directory to '$directory': no such directory\n";
-    }
+  my $directory=$_[1];
+  my $failure=1;
+  if (-e $directory && -d $directory) {
+    chdir("$directory");
+    print "[Tesh/INFO] change directory to $directory\n";
+  $failure=0;
+  } elsif (-e $directory) {
+    print "Cannot change directory to '$directory': it is not a directory\n";
+  } else {
+    print "Chdir to $directory failed: No such file or directory\n";
+  }
+  if($failure==1){
+  $error=1;
+  $exitcode=4;
+  print "Test suite `$tesh_file': NOK (system error)\n";
+  exit 4;
+  }
 }
 
 sub setenv_cmd {
-    if ($_[1] =~ /^(.*)=(.*)$/) {
-       my($var,$ctn)=($1,$2);
-       
-       if($var =~ /bindir/){
-               print "[Tesh/INFO] setenv $var=$ctn\n";
-               $bindir = $ctn;
-       }
-       else
-       {
-               if($var =~ /srcdir/){
-                       $srcdir = $ctn;
-               }
-               else{
-                       $ENV{$var} = $ctn;
-                       print "[Tesh/INFO] setenv $var=$ctn\n";
-               }
-       }       
-       } else { 
-       die "[Tesh/CRITICAL] Malformed argument to setenv: expected 'name=value' but got '$_[1]'\n";
+  my($var,$ctn);
+  if ($_[0] =~ /^(.*)=(.*)$/) {
+    ($var,$ctn)=($1,$2);
+  }elsif ($_[1] =~ /^(.*)=(.*)$/) {
+    ($var,$ctn)=($1,$2);
+  } else { 
+      die "[Tesh/CRITICAL] Malformed argument to setenv: expected 'name=value' but got '$_[1]'\n";
+  }
+    
+    if($var =~ /bindir/){
+        print "[Tesh/INFO] setenv $var=$ctn\n";
+        $bindir = $ctn;
     }
+    else
+    {
+        if($var =~ /srcdir/){
+            $srcdir = $ctn;
+        }
+        else{
+            $ENV{$var} = $ctn;
+            print "[Tesh/INFO] setenv $var=$ctn\n";
+        }
+    }    
 }
 
 # Main option parsing sub
-my $tesh_file;
-sub get_options {
-    # remove the tesh file from the ARGV used
-    my @ARGV = @_;
-    $tesh_file = pop @ARGV;
-
-    # temporary arrays for GetOption
-    my @verbose = ();
-    my @cfg;
-    my $log; # ignored
-
-    my %opt = (
-       "help"    => 0,
-       "debug"   => 0,
-       "verbose" => 0
-       );
-
-    Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
-    
-    GetOptions(
-       'help|h'     => \$opt{'help'},
-
-        'verbose|v'  => \@verbose,
-        'debug|d'    => \$opt{"debug"},
-
-       'cd=s'       => \&cd_cmd,
-       'setenv=s'   => \&setenv_cmd,
-       'cfg=s'      => \@cfg,
-       'log=s'      => \$log,
-       );
 
-    $opt{'verbose'} = scalar @verbose;
-    foreach (@cfg) {
-       $opt{'cfg'} .= " --cfg=$_";
-    }
-    return %opt;
+sub get_options {
+  # remove the tesh file from the ARGV used
+  my @ARGV = @_;
+  $tesh_file = pop @ARGV;
+
+  # temporary arrays for GetOption
+  my @verbose = ();
+  my @cfg;
+  my $log; # ignored
+
+
+  my %opt = (
+    "help"  => 0,
+    "debug"   => 0,
+    "verbose" => 0
+    );
+
+  Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
+  
+  GetOptions(
+    'help|h'   => \$opt{'help'},
+
+    'verbose|v'  => \@verbose,
+    'debug|d'  => \$opt{"debug"},
+
+    'cd=s'     => \&cd_cmd,
+    'timeout=s'  => \$opt{'timeout'},    
+    'setenv=s'   => \&setenv_cmd,
+    'cfg=s'    => \@cfg,
+    'log=s'    => \$log,
+    'enable-coverage+'  => \$enable_coverage,    
+    );
+
+  if($enable_coverage){
+    print "Enable coverage\n";
+  }
+
+  unless($tesh_file=~/(.*)\.tesh/){
+    $tesh_file="(stdin)";
+    $tesh_name="(stdin)";
+    print "Test suite from stdin\n";
+  }else{
+    $tesh_name=$1;
+    print "Test suite `$tesh_name'\n";
+  }
+
+  $opt{'verbose'} = scalar @verbose;
+  foreach (@cfg) {
+    $opt{'cfg'} .= " --cfg=$_";
+  }
+  return %opt;
 }
 
 my %opts = get_options(@ARGV);
@@ -125,13 +169,10 @@ my %opts = get_options(@ARGV);
 ##
 ## File parsing
 ##
-my($sort)=0;
 my($nb_arg)=0;
-my($timeout)=0;
 my($old_buffer);
 my($linebis);
 my($SIGABRT)=0;
-my($no_output_ignore)=1;
 my($verbose)=0;
 my($return)=-1;
 my($pid);
@@ -139,249 +180,423 @@ my($result);
 my($result_err);
 my($forked);
 my($config)="";
-
 my($tesh_command)=0;
 my(@buffer_tesh)=();
 
-eval {
-    use POSIX;
-    sub exit_status {
-       my $status = shift;
-       if (POSIX::WIFEXITED($status)) {
-           return "returned code ".POSIX::WEXITSTATUS($status);
-       } elsif (POSIX::WIFSIGNALED($status)) {
-           return "got signal ".$SIG{POSIX::WTERMSIG($status)};
-       }
-       return "Unparsable status. Is the process stopped?";
-    }
-};
-if ($@) { # no POSIX available?
-    warn "POSIX not usable to parse the return value of forked child: $@\n";
-    sub exit_status {
-       return "returned code 0";
+#eval {
+  use POSIX;
+
+  sub exit_status {
+    my $status = shift;
+    if (POSIX::WIFEXITED($status)) {
+      $exitcode=POSIX::WEXITSTATUS($status)+40;
+      return "returned code ".POSIX::WEXITSTATUS($status);
+    } elsif (POSIX::WIFSIGNALED($status)) {
+      my $code;
+      if (POSIX::WTERMSIG($status) == SIGINT){$code="SIGINT"; }
+      elsif  (POSIX::WTERMSIG($status) == SIGTERM) {$code="SIGTERM"; }
+      elsif  (POSIX::WTERMSIG($status) == SIGKILL) {$code= "SIGKILL"; }
+      elsif  (POSIX::WTERMSIG($status) == SIGABRT) {$code="SIGABRT"; }
+      elsif  (POSIX::WTERMSIG($status) == SIGSEGV) {$code="SIGSEGV" ;}
+      $exitcode=POSIX::WTERMSIG($status)+4;
+      return "got signal $code";
     }
-}
+    return "Unparsable status. Is the process stopped?";
+  }
+#};
+#if ($@) { # no POSIX available?
+#  warn "POSIX not usable to parse the return value of forked child: $@\n";
+#  sub exit_status {
+#    return "returned code -1 $@ ";
+#  }
+#}
 
 sub exec_cmd { 
-    my %cmd = %{$_[0]};
-    if ($opts{'debug'}) {
-       print "IN BEGIN\n";
-       map {print "  $_"} @{$cmd{'in'}};
-       print "IN END\n";
-       print "OUT BEGIN\n";
-       map {print "  $_"} @{$cmd{'out'}};
-       print "OUT END\n";
-       print "CMD: $cmd{'cmd'}\n";
+  my %cmd = %{$_[0]};
+  if ($opts{'debug'}) {
+    print "IN BEGIN\n";
+    map {print "  $_"} @{$cmd{'in'}};
+    print "IN END\n";
+    print "OUT BEGIN\n";
+    map {print "  $_"} @{$cmd{'out'}};
+    print "OUT END\n";
+    print "CMD: $cmd{'cmd'}\n";
+  }
+
+  # cleanup the command line
+  if($OS eq "WIN"){
+        $cmd{'cmd'} =~ s/\${EXEEXT:=}/.exe/g;
+        $cmd{'cmd'} =~ s/\${EXEEXT}/.exe/g;
+        $cmd{'cmd'} =~ s/\$EXEEXT/.exe/g;
     }
-
-    # cleanup the command line
-    if($OS eq "WIN"){
-               $cmd{'cmd'} =~ s/\${EXEEXT:=}/.exe/g;
-               $cmd{'cmd'} =~ s/\${EXEEXT}/.exe/g;
-               $cmd{'cmd'} =~ s/\$EXEEXT/.exe/g;
-       }
-       else{
-               $cmd{'cmd'} =~ s/\${EXEEXT:=}//g;
-       }
-    $cmd{'cmd'} =~ s/\${bindir:=}/$bindir/g;
-    $cmd{'cmd'} =~ s/\${srcdir:=}/$srcdir/g;
-    $cmd{'cmd'} =~ s/\${bindir:=.}/$bindir/g;
-    $cmd{'cmd'} =~ s/\${srcdir:=.}/$srcdir/g;
-    $cmd{'cmd'} =~ s/\${bindir}/$bindir/g;
-    $cmd{'cmd'} =~ s/\${srcdir}/$srcdir/g;
-    $cmd{'cmd'} =~ s|^\./||g;
-#    $cmd{'cmd'} =~ s|tesh|tesh.pl|g;
-    $cmd{'cmd'} =~ s/\(%i:%P@%h\)/\\\(%i:%P@%h\\\)/g;
-    $cmd{'cmd'} .= " $opts{'cfg'}" if (defined($opts{'cfg'}) && length($opts{'cfg'}));
-
-    print "[$cmd{'file'}:$cmd{'line'}] $cmd{'cmd'}\n";
-
-    ###
-    # exec the command line
-    ###
-    $pid = open3(\*IN, \*OUT, \*OUT, $cmd{'cmd'} );
-
-    # if timeout specified, fork and kill executing child at the end of timeout
-    if ($timeout){
-       $forked = fork();
-       die "fork() failed: $!" unless defined $forked;
-       if ( $forked == 0 ) { # child
-           sleep $timeout;
-           kill(9, $pid);
-           exit;
-       }
+    else{
+        $cmd{'cmd'} =~ s/\${EXEEXT:=}//g;
+    }
+  $cmd{'cmd'} =~ s/\${bindir:=}/$bindir/g;
+  $cmd{'cmd'} =~ s/\${srcdir:=}/$srcdir/g;
+  $cmd{'cmd'} =~ s/\${bindir:=.}/$bindir/g;
+  $cmd{'cmd'} =~ s/\${srcdir:=.}/$srcdir/g;
+  $cmd{'cmd'} =~ s/\${bindir}/$bindir/g;
+  $cmd{'cmd'} =~ s/\${srcdir}/$srcdir/g;
+# $cmd{'cmd'} =~ s|^\./||g;
+#  $cmd{'cmd'} =~ s|tesh|tesh.pl|g;
+  $cmd{'cmd'} =~ s/\(%i:%P@%h\)/\\\(%i:%P@%h\\\)/g;
+  $cmd{'cmd'} .= " $opts{'cfg'}" if (defined($opts{'cfg'}) && length($opts{'cfg'}));
+
+  print "[$tesh_name:$cmd{'line'}] $cmd{'cmd'}\n" ;
+
+  ###
+  # exec the command line
+  ###  $line =~ s/\r//g;
+
+  $cmd{'got'} = IO::File->new_tmpfile;
+  $cmd{'got'}->autoflush(1);
+  local *E = $cmd{'got'}; 
+  $cmd{'pid'} = open3(\*CHILD_IN,  ">&E",  ">&E", $cmd{'cmd'} );
+
+  # push all provided input to executing child
+  map { print CHILD_IN "$_\n"; }  @{$cmd{'in'}};
+  close CHILD_IN;
+
+  # if timeout specified, fork and kill executing child at the end of timeout
+  if (defined($cmd{'timeout'}) or defined($opts{'timeout'})){
+    $time_to_wait= defined($cmd{'timeout'}) ? $cmd{'timeout'} : $opts{'timeout'};
+    $forked = fork();
+    $timeout=-1;
+    die "fork() failed: $!" unless defined $forked;
+    if ( $forked == 0 ) { # child
+      sleep $time_to_wait;
+      kill(SIGKILL, $cmd{'pid'});
+      exit $time_to_wait;
+    }
+  }
+
+  
+  # Cleanup the executing child, and kill the timeouter brother on need
+  $cmd{'return'} = 0 unless defined($cmd{'return'});
+  if($cmd{'background'} != 1){
+    waitpid ($cmd{'pid'}, 0);
+    $cmd{'gotret'} = exit_status($?);
+    parse_out(\%cmd);
+  }else{
+    # & commands, which will be handled at the end
+    push @bg_cmds, \%cmd;
+    # no timeout for background commands
+    if($forked){
+       kill(SIGKILL, $forked);
+       $timeout=0;
+       $forked=0;
     }
+  }
+}
 
-    # push all provided input to executing child
-    map { print IN "$_\n" } $cmd{'in'};
-    close IN;
-
-    # pop all output from executing child
-    my @got;
-    while(defined(my $got=<OUT>)) {
-       $got =~ s/\r//g;
-       #$got =~ s/^( )*//g;
-       chomp $got;
-       push @got, "$got";
-    }  
-    close OUT;
-    
-    # Cleanup the executing child, and kill the timeouter brother on need
-    $cmd{'return'} = 0 unless defined($cmd{'return'});
-    my $wantret = "returned code ".(defined($cmd{'return'})? $cmd{'return'} : 0);
-    waitpid ($pid, 0);
-    my $gotret = exit_status($?);
-    if($gotret ne $wantret) {
-       my $msg = "Test suite `$cmd{'file'}': NOK (<$cmd{'file'}:$cmd{'line'}> $gotret)\n".
-           "Output of <$cmd{'file'}:$cmd{'line'}> so far:\n";      
-       map {$msg .=  "|| $_\n"} @got;
-       print STDERR "$msg";
-       exit(1);
+
+sub parse_out { 
+  my %cmd = %{$_[0]};
+  my $gotret=$cmd{'gotret'};
+
+  my $wantret;
+
+  if(defined($cmd{'expect'}) and ($cmd{'expect'} ne "")){
+    $wantret = "got signal $cmd{'expect'}";
+  }else{
+    $wantret = "returned code ".(defined($cmd{'return'})? $cmd{'return'} : 0);
+  }
+
+  local *got = $cmd{'got'};
+  seek(got,0,0);
+  # pop all output from executing child
+  my @got;
+  while(defined(my $got=<got>)) {
+    $got =~ s/\r//g;
+    $got =~ s/^( )*//g;
+    chomp $got;
+    $got=trim($got);
+    if( $got ne ""){
+        if (!($enable_coverage and $got=~ /^profiling:/)){    
+        push @got, "$got";
+     }
+  }
+  }    
+
+  if ($cmd{'sort'}){   
+    sub mysort{
+    $a cmp $b
     }
-    if($timeout){kill(9, $forked);$timeout=0;}
-    $timeout = 0;
-           
-    ###
-    # Check the result of execution 
-    ###
-    my $diff = build_diff(\@{$cmd{'out'}}, \@got);
-    if (length $diff) {
-       print color("red")."[TESH/CRITICAL$$] Output mismatch\n";
-       map { print "[TESH/CRITICAL] $_\n" } split(/\n/,$diff);
-       print color("reset");
-       die "Tesh failed\n";
+    use sort qw(defaults _quicksort); # force quicksort
+    @got = sort mysort @got;
+    #also resort the other one, as perl sort is not the same as the C one used to generate teshes
+    if(defined($cmd{'out'})){
+      @{$cmd{'out'}}=sort mysort @{$cmd{'out'}};
+    }
+  }
+
+  #Did we timeout ? If yes, handle it. If not, kill the forked process.
+
+  if($timeout==-1 and $gotret eq "got signal SIGKILL"){
+    $gotret="return code 0";
+    $timeout=1;
+    $gotret= "timeout after $time_to_wait sec";
+    $error=1;
+    $exitcode=3;
+    print STDERR "<$cmd{'file'}:$cmd{'line'}> timeouted. Kill the process.\n";
+  }else{
+    $timeout=0;  
+  }
+  if($gotret ne $wantret) {
+    $error=1;
+    my $msg = "Test suite `$cmd{'file'}': NOK (<$cmd{'file'}:$cmd{'line'}> $gotret)\n";
+    if ($timeout!=1) {
+        $msg=$msg."Output of <$cmd{'file'}:$cmd{'line'}> so far:\n";    
+    }
+    map {$msg .=  "|| $_\n"} @got;
+    if(!@got) {
+        if($timeout==1){
+        print STDERR "<$cmd{'file'}:$cmd{'line'}> No output before timeout\n";
+        }else{
+        $msg .= "||\n";
+        }
     }
+    $timeout = 0;
+    print STDERR "$msg";
+  }
+
+      
+  ###
+  # Check the result of execution 
+  ###
+  my $diff;
+  if (!defined($cmd{'output ignore'})){
+    $diff = build_diff(\@{$cmd{'out'}}, \@got);
+  }else{
+  print "(ignoring the output of <$cmd{'file'}:$cmd{'line'}> as requested)\n"
+  }
+  if (length $diff) {
+    print "Output of <$cmd{'file'}:$cmd{'line'}> mismatch:\n";
+    map { print "$_\n" } split(/\n/,$diff);
+
+    print "Test suite `$cmd{'file'}': NOK (<$cmd{'file'}:$cmd{'line'}> output mismatch)\n";
+    $error=1;
+    $exitcode=2;
+  }
 }
 
 sub mkfile_cmd {
-    my %cmd = %{$_[0]};
-    my $file = $cmd{'arg'};
-    print "[Tesh/INFO] mkfile $file\n";
-
-    die "[TESH/CRITICAL] no input provided to mkfile\n" unless defined($cmd{'in'}) && scalar @{$cmd{'in'}};
-    unlink($file);
-    open(FILE,">$file") or die "[Tesh/CRITICAL] Unable to create file $file: $!\n";
-    print FILE join("\n", @{$cmd{'in'}});
-    print FILE "\n" if (scalar @{$cmd{'in'}} > 0);
-    close(FILE);
+  my %cmd = %{$_[0]};
+  my $file = $cmd{'arg'};
+  print "[Tesh/INFO] mkfile $file\n";
+
+  unlink($file);
+  open(FILE,">$file") or die "[Tesh/CRITICAL] Unable to create file $file: $!\n";
+  print FILE join("\n", @{$cmd{'in'}});
+  print FILE "\n" if (scalar @{$cmd{'in'}} > 0);
+  close(FILE);
 }
 
 # parse tesh file
-print "Test suite $tesh_file\n";
-open TESH_FILE, $tesh_file or die "[Tesh/CRITICAL] Unable to open $tesh_file $!\n";
+#my $teshfile=$tesh_file;
+#$teshfile=~ s{\.[^.]+$}{};
 
+unless($tesh_file eq "(stdin)"){
+  open TESH_FILE, $tesh_file or die "[Tesh/CRITICAL] Unable to open $tesh_file $!\n";
+}
 
 my %cmd; # everything about the next command to run
 my $line_num=0;
-LINE: while (defined(my $line=<TESH_FILE>)) {
+my $finished =0;
+LINE: while (not $finished and not $error) {
+  my $line;
+
+
+  if ($tesh_file ne "(stdin)" and !defined($line=<TESH_FILE>)){
+    $finished=1;
+    next LINE;
+  }elsif ($tesh_file eq "(stdin)" and !defined($line=<>)){
+    $finished=1;
+    next LINE;
+  }
+
+
+  $line_num++;
+  chomp $line;
+  $line =~ s/\r//g;
+  print "[TESH/debug] $line_num: $line\n" if $opts{'debug'};
+  my $next;
+  # deal with line continuations
+  while ($line =~ /^(.*?)\\$/) {
+    $next=<TESH_FILE>;
+    die "[TESH/CRITICAL] Continued line at end of file\n"
+      unless defined($next);
     $line_num++;
-    chomp $line;
-    print "[TESH/debug] $line_num: $line\n" if $opts{'debug'};
-
-    # deal with line continuations
-    while ($line =~ /^(.*?)\\$/) {
-       my $next=<TESH_FILE>;
-       die "[TESH/CRITICAL] Continued line at end of file\n"
-           unless defined($next);
-       chomp $next;
-       print "[TESH/debug] $line_num: $next\n" if $opts{'debug'};
-       $line = $1.$next;
+    chomp $next;
+    print "[TESH/debug] $line_num: $next\n" if $opts{'debug'};
+    $line = $1.$next;
+  }
+
+  # Push delayed commands on empty lines
+  unless ($line =~ m/^(.).(.*)$/) {
+    if (defined($cmd{'cmd'}))  {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-
-    # Push delayed commands on empty lines
-    unless ($line =~ m/^(..)(.*)$/) {
-       if (defined($cmd{'cmd'})) {
-           exec_cmd(\%cmd);
-           %cmd = ();
-       }
-       next LINE;
-    }  
+    next LINE;
+  }     
  
-    my ($cmd,$arg) = ($1,$2);
-    $arg =~ s/\r//g;
-
-    # handle the commands
-    if ($cmd =~ /^#/) {        #comment
-    } elsif ($cmd eq '> '){    #expected result line
-       print "[TESH/debug] push expected result\n" if $opts{'debug'};
-       push @{$cmd{'out'}}, $arg;
-
-    } elsif ($cmd eq '< ') {   # provided input
-       print "[TESH/debug] push provided input\n" if $opts{'debug'};
-       push @{$cmd{'in'}}, $arg;
-
-    } elsif ($cmd eq 'p ') {   # comment
-       print "[Tesh/INFO] $arg\n";
-
-    } elsif ($cmd eq '$ ') {  # Command
-       # if we have something buffered, run it now
-       if (defined($cmd{'cmd'})) {
-           exec_cmd(\%cmd);
-           %cmd = ();
-       }
-       if ($arg =~ /^ *mkfile /){      # "mkfile" command line
-           die "[TESH/CRITICAL] Output expected from mkfile command!\n" if scalar @{cmd{'out'}};
-
-           $cmd{'arg'} = $arg;
-           $cmd{'arg'} =~ s/ *mkfile //;
-           mkfile_cmd(\%cmd);
-           %cmd = ();
-
-       } elsif ($arg =~ /^ *cd /) {
-           die "[TESH/CRITICAL] Input provided to cd command!\n" if scalar @{cmd{'in'}};
-           die "[TESH/CRITICAL] Output expected from cd command!\n" if scalar @{cmd{'out'}};
-
-           $arg =~ s/^ *cd //;
-           cd_cmd("",$arg);
-           %cmd = ();
-
-       } else { # regular command
-           $cmd{'cmd'} = $arg;
-           $cmd{'file'} = $tesh_file;
-           $cmd{'line'} = $line_num;
-       }
+  my ($cmd,$arg) = ($1,$2);
+  $arg =~ s/\r//g;
+  $arg =~ s/\\\\/\\/g;
+  # handle the commands
+  if ($cmd =~ /^#/) {    #comment
+  } elsif ($cmd eq '>'){    #expected result line
+    print "[TESH/debug] push expected result\n" if $opts{'debug'};
+  $arg=trim($arg);
+    if($arg ne ""){
+    push @{$cmd{'out'}}, $arg;
+  }
+
+  } elsif ($cmd eq '<') {    # provided input
+    print "[TESH/debug] push provided input\n" if $opts{'debug'};
+    push @{$cmd{'in'}}, $arg;
+
+  } elsif ($cmd eq 'p') {    # comment
+    print "[$tesh_name:$line_num] $arg\n";
+
+  } elsif ($cmd eq '$') {  # Command
+    # if we have something buffered, run it now
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($cmd eq '& '){       # parallel command line
-       $cmd{'background'} = 1;
-       $cmd{'cmd'} = $arg;
-    }  
-    elsif($line =~ /^! output sort/){  #output sort
-       $cmd{'sort'} = 1;
+    if ($arg =~ /^\s*mkfile /){      # "mkfile" command line
+      die "[TESH/CRITICAL] Output expected from mkfile command!\n" if scalar @{cmd{'out'}};
+
+      $cmd{'arg'} = $arg;
+      $cmd{'arg'} =~ s/\s*mkfile //;
+      mkfile_cmd(\%cmd);
+      %cmd = ();
+
+    } elsif ($arg =~ /^\s*cd /) {
+      die "[TESH/CRITICAL] Input provided to cd command!\n" if scalar @{cmd{'in'}};
+      die "[TESH/CRITICAL] Output expected from cd command!\n" if scalar @{cmd{'out'}};
+
+      $arg =~ s/^ *cd //;
+      cd_cmd("",$arg);
+      %cmd = ();
+
+    } else { # regular command
+      $cmd{'cmd'} = $arg;
+      $cmd{'file'} = $tesh_file;
+      $cmd{'line'} = $line_num;
     }
-    elsif($line =~ /^! output ignore/){        #output ignore
-       $cmd{'output ignore'} = 1;
+  }
+  elsif($cmd eq '&'){      # parallel command line
+
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
+    }
+    $cmd{'background'} = 1;
+    $cmd{'cmd'} = $arg;
+    $cmd{'file'} = $tesh_file;
+    $cmd{'line'} = $line_num;
+  }    
+  elsif($line =~ /^!\s*output sort/){    #output sort
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
+    }
+    $cmd{'sort'} = 1;
+  }
+  elsif($line =~ /^!\s*output ignore/){    #output ignore
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($line =~ /^! expect signal SIGABRT$/) {#expect signal SIGABRT
-       $cmd{'expect'} = "SIGABRT";
+    $cmd{'output ignore'} = 1;
+  }
+  elsif($line =~ /^!\s*expect signal (\w*)/) {#expect signal SIGABRT
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($line =~ /^! expect return/){        #expect return
-       $line =~ s/^! expect return //g;
-       $line =~ s/\r//g;
-       $cmd{'return'} = $line;
+print "hey\n";
+    $cmd{'expect'} = "$1";
+  }
+  elsif($line =~ /^!\s*expect return/){    #expect return
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($line =~ /^! setenv/){       #setenv
-       $line =~ s/^! setenv //g;
-       $line =~ s/\r//g;
-       setenv_cmd($line);
+    $line =~ s/^! expect return //g;
+    $line =~ s/\r//g;
+    $cmd{'return'} = $line;
+  }
+  elsif($line =~ /^!\s*setenv/){    #setenv
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($line =~ /^! include/){      #output sort
-       print color("red"), "[Tesh/CRITICAL] need include";
-       print color("reset"), "\n";
-       die;
+    $line =~ s/^! setenv //g;
+    $line =~ s/\r//g;
+    setenv_cmd($line);
+  }
+  elsif($line =~ /^!\s*include/){    #output sort
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
-    elsif($line =~ /^! timeout/){      #timeout
-       $line =~ s/^! timeout //;
-       $line =~ s/\r//g;
-       $cmd{'timeout'} = $line;
-    } else {
-       die "[TESH/CRITICAL] parse error: $line\n";
+    print color("red"), "[Tesh/CRITICAL] need include";
+    print color("reset"), "\n";
+    die;
+  }
+  elsif($line =~ /^!\s*timeout/){    #timeout
+    if (defined($cmd{'cmd'})) {
+      exec_cmd(\%cmd);
+      %cmd = ();
     }
+    $line =~ s/^! timeout //;
+    $line =~ s/\r//g;
+    $cmd{'timeout'} = $line;
+  } else {
+    die "[TESH/CRITICAL] parse error: $line\n";
+  }
+  if($forked){
+   kill(SIGKILL, $forked);
+   $timeout=0;
+  }
+
 }
 
+
+
 # Deal with last command
 if (defined($cmd{'cmd'})) {
-    exec_cmd(\%cmd);
-    %cmd = ();
+  exec_cmd(\%cmd);
+  %cmd = ();
+}
+
+
+if($forked){
+   kill(SIGKILL, $forked);
+   $timeout=0;
+}
+
+foreach(@bg_cmds){
+  my %test=%{$_};
+  waitpid ($test{'pid'}, 0);
+  $test{'gotret'} = exit_status($?);
+  parse_out(\%test);
+}
+
+@bg_cmds=();
+
+
+if($error !=0){
+    exit $exitcode;
+}elsif($tesh_file eq "(stdin)"){
+    print "Test suite from stdin OK\n";
+}else{
+    print "Test suite `$tesh_name' OK\n";
 }
 
 #my (@a,@b);
@@ -406,35 +621,37 @@ if (defined($cmd{'cmd'})) {
 #push @a,"AZE"; push @b,"EZA";
 #print "Different:\n".build_diff(\@a,\@b);
 
+use lib "@CMAKE_BINARY_DIR@/bin" ;
+
 use Diff qw(diff); # postpone a bit to have time to change INC
 
 sub build_diff {
-    my $res;
-    my $diff = Diff->new(@_);
-    
-    $diff->Base( 1 );   # Return line numbers, not indices
-    my $chunk_count = $diff->Next(-1); # Compute the amount of chuncks
-    return ""     if ($chunk_count == 1 && $diff->Same());
-    $diff->Reset();
-    while(  $diff->Next()  ) {
-       my @same = $diff->Same();
-       if ($diff->Same() ) {
-           if ($diff->Next(0) > 1) { # not first chunk: print 2 first lines
-               $res .= '  '.$same[0]."\n" ;
-               $res .= '  '.$same[1]."\n" if (scalar @same>1);
-           }   
-           $res .= "...\n"  if (scalar @same>2);
-#      $res .= $diff->Next(0)."/$chunk_count\n";
-           if ($diff->Next(0) < $chunk_count) { # not last chunk: print 2 last lines
-               $res .= '  '.$same[scalar @same -2]."\n" if (scalar @same>1);
-               $res .= '  '.$same[scalar @same -1]."\n";
-           
-       
-       next if  $diff->Same();
-       map { $res .= "- $_\n" } $diff->Items(1);
-       map { $res .= "+ $_\n" } $diff->Items(2);
-    }
-    return $res;
+  my $res;
+  my $diff = Diff->new(@_);
+  
+  $diff->Base( 1 );   # Return line numbers, not indices
+  my $chunk_count = $diff->Next(-1); # Compute the amount of chuncks
+  return ""   if ($chunk_count == 1 && $diff->Same());
+  $diff->Reset();
+  while(  $diff->Next()  ) {
+    my @same = $diff->Same();
+    if ($diff->Same() ) {
+      if ($diff->Next(0) > 1) { # not first chunk: print 2 first lines
+        $res .= '  '.$same[0]."\n" ;
+        $res .= '  '.$same[1]."\n" if (scalar @same>1);
+      }     
+      $res .= "...\n"  if (scalar @same>2);
+#    $res .= $diff->Next(0)."/$chunk_count\n";
+      if ($diff->Next(0) < $chunk_count) { # not last chunk: print 2 last lines
+        $res .= '  '.$same[scalar @same -2]."\n" if (scalar @same>1);
+        $res .= '  '.$same[scalar @same -1]."\n";
+      } 
+    } 
+    next if  $diff->Same();
+    map { $res .= "- $_\n" } $diff->Items(1);
+    map { $res .= "+ $_\n" } $diff->Items(2);
+  }
+  return $res;
 }
 
 
index 1b1a714..3e988d1 100644 (file)
@@ -3,7 +3,8 @@
 /* This file is AUTOMATICALLY GENERATED by Cmake. Edit the following
    template instead buildtools/Cmake/src/internal_config.h.in               */
 
-/* Copyright (c) 2004-2013. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2013. 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. */
index 1323865..2550b85 100644 (file)
@@ -27,7 +27,7 @@
 ;--------------------------------\r
 \r
 Name "Simgrid"\r
-outFile "SimGrid@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_SGjava_@NSIS_WIN_VERSION@@BIN_EXE@"\r
+outFile "SimGrid-@SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@_SGjava_@NSIS_WIN_VERSION@@BIN_EXE@"\r
 Icon "@CMAKE_HOME_DIRECTORY@\doc\webcruft\SGicon.ico"\r
 \r
 RequestExecutionLevel admin\r
@@ -90,7 +90,6 @@ Section "Libraries and Headers" LibSection
        file @CMAKE_HOME_DIRECTORY@\include\xbt\mmalloc.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\parmap.h\r
        file @CMAKE_HOME_DIRECTORY@\include\xbt\automaton.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\xbt\file_stat.h\r
     file @CMAKE_HOME_DIRECTORY@\include\xbt\xbt_os_thread.h\r
     file @CMAKE_HOME_DIRECTORY@\include\xbt\RngStream.h\r
 \r
@@ -175,11 +174,11 @@ Section "Java Bindings" JavaSection
        # install java library and examples\r
        CreateDirectory $INSTDIR\examples\simgrid-java\r
        setOutPath $INSTDIR\lib\r
-       file /nonfatal "$%SIMGRID_JAVA_SRC%\build\SG_java.dll"\r
-       file /nonfatal "$%SIMGRID_JAVA_SRC%\build\SG_java.def"\r
-       file /nonfatal "$%SIMGRID_JAVA_SRC%\simgrid.jar"\r
+       file /nonfatal "lib\SG_java.dll"\r
+       file /nonfatal "lib\SG_java.def"\r
+       file /nonfatal "simgrid.jar"\r
        setOutPath $INSTDIR\examples\simgrid-java\r
-       file /nonfatal /r "$%SIMGRID_JAVA_SRC%\examples\"\r
+       file /nonfatal /r ".\examples\"\r
        # create shortcuts in the start menu programs directory\r
        createShortCut  "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\Java project.lnk" "$INSTDIR\examples\simgrid-java"\r
        # create a popup box, with an OK button"\r
@@ -195,16 +194,14 @@ Section "SMPI Library" SMPISection
        file bin\smpif90\r
        \r
     setOutPath $INSTDIR\lib\r
-       file lib\libsmpi.dll\r
-       file lib\libsmpi.def\r
        \r
        CreateDirectory  $INSTDIR\include\smpi\r
        setOutPath $INSTDIR\include\smpi\r
        file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi.h\r
        file @CMAKE_HOME_DIRECTORY@\include\smpi\mpi.h\r
-       file @CMAKE_HOME_DIRECTORY@\include\smpi\mpif.h\r
        file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi_cocci.h\r
        file @CMAKE_HOME_DIRECTORY@\include\smpi\smpi_main.h\r
+       file include\smpi\mpif.h\r
        file include\smpi\smpif.h\r
        \r
        CreateDirectory $INSTDIR\examples\smpi\r
@@ -213,8 +210,7 @@ Section "SMPI Library" SMPISection
        setOutPath $INSTDIR\examples\smpi\r
        file @CMAKE_HOME_DIRECTORY@\examples\smpi\bcbench.c\r
        file @CMAKE_HOME_DIRECTORY@\examples\smpi\mvmul.c\r
-       file @CMAKE_HOME_DIRECTORY@\examples\smpi\mc_bugged1.c\r
-       file @CMAKE_HOME_DIRECTORY@\examples\smpi\mc_bugged2.c\r
+       file /r @CMAKE_HOME_DIRECTORY@\examples\smpi\mc\r
        file @CMAKE_HOME_DIRECTORY@\examples\smpi\hostfile\r
        file @CMAKE_HOME_DIRECTORY@\examples\msg\small_platform_with_routers.xml\r
        file @CMAKE_HOME_DIRECTORY@\examples\smpi\CMakeLists.txt\r
@@ -388,4 +384,4 @@ section "Uninstall"
     RMDir  /r "$INSTDIR"\r
     \r
 # uninstall section end\r
-sectionEnd
\ No newline at end of file
+sectionEnd\r
index 43b1333..fde4577 100644 (file)
@@ -1,5 +1,6 @@
 /* prog_gnu_dynlinker.c -- check that RTLD_NEXT is defined as in GNU linker */
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 8c394ed..cb9d070 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e822e64..01d3ff3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2295b0e..be4a92d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 060be0a..732a000 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
old mode 100644 (file)
new mode 100755 (executable)
index 867f69c..16c8cd6
@@ -1 +1 @@
-c:\mingw\msys\1.0\bin\sh -login .\buildtools\Jenkins\runmingw.sh %1 %2
+c:\mingw\msys\1.0\bin\sh -login .\buildtools\jenkins\runmingw.sh %1 %2
old mode 100644 (file)
new mode 100755 (executable)
index fe5a509..deceff5
 WORKSPACE=$1
 build_mode=$2
 
+
 rm -rf $WORKSPACE/build
-rm -rf $WORKSPACE/install
 
 mkdir $WORKSPACE/build
-mkdir $WORKSPACE/install
 cd $WORKSPACE/build
 
-cmake $WORKSPACE
-make dist
-tar xzf `cat VERSION`.tar.gz
-cd `cat VERSION`
+export PATH=./lib/:../../lib:$PATH
 
-if [ "$build_mode" = "Debug" ]
-then
-cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON -Denable_compile_warnings=ON .
-fi
+if test "$(uname -o)" = "Msys"
+then 
+    
+    cmake -G "MSYS Makefiles" $WORKSPACE
+    #$NUMBER_OF_PROCESSORS should be already set on win
+    if [ -z "$NUMBER_OF_PROCESSORS" ]; then
+        NUMBER_OF_PROCESSORS=1
+    fi  
 
-if [ "$build_mode" = "ModelChecker" ]
-then
-cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=ON -Denable_lua=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON .
-fi
+    if [ $? -ne 0 ] ; then
+        echo "Failed to do the first cmake - Halting"
+        exit 1
+    fi
 
-if [ "$build_mode" = "DynamicAnalysis" ]
-then
-cmake -Denable_lua=OFF -Denable_java=ON -Denable_tracing=ON -Denable_smpi=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON -Denable_lib_static=OFF -Denable_model-checking=OFF -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF -Denable_mallocators=OFF -Denable_memcheck=ON .
-fi
+    make dist
 
-make
+    if [ $? -ne 0 ] ; then
+        echo "Failed to build dist - Halting"
+        exit 2
+    fi
 
-TRES=0
+    cmake -G "MSYS Makefiles" -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=ON  -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=OFF .
 
-ctest -T test --no-compress-output || true
-if [ -f Testing/TAG ] ; then
-   /usr/bin/xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
-   mv CTestResults.xml $WORKSPACE
-fi
+    if [ $? -ne 0 ] ; then
+        echo "Failed to perform the Cmake for $build_mode - Halting"
+        exit 5
+    fi
 
-if [ "$build_mode" = "Debug" ]
-then
-cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON -Denable_compile_warnings=ON .
-fi
+    make -j$NUMBER_OF_PROCESSORS
+
+    if [ $? -ne 0 ] ; then
+        echo "Build failure - Halting"
+        exit 5
+    fi
+
+    make nsis
+
+    if [ $? -ne 0 ] ; then
+        echo "Failure while generating the Windows executable - Halting"
+        exit 6
+    fi
+
+else
+    NUMBER_OF_PROCESSORS=0
+    # Linux:
+    cpuinfo_file="/proc/cpuinfo"
+    if [ -f "${cpuinfo_file}" ]; then
+      NUMBER_OF_PROCESSORS=$(grep -c "processor.: " ${cpuinfo_file}) 
+    fi
+    # grep returns 0 or cpuinfo not found
+    if [ $NUMBER_OF_PROCESSORS = 0 ]; then
+      NUMBER_OF_PROCESSORS=1
+    fi
+
+    cmake $WORKSPACE
+
+    if [ $? -ne 0 ] ; then
+        echo "Failed to do the first cmake - Halting"
+        exit 1
+    fi
+
+    rm Simgrid*.tar.gz
+    make dist
+
+    if [ $? -ne 0 ] ; then
+        echo "Failed to build dist - Halting"
+        exit 2
+    fi
+
+    tar xzf `cat VERSION`.tar.gz
+
+    if [ $? -ne 0 ] ; then
+        echo "Failed to extract the generated tgz - Halting"
+        exit 3
+    fi
+
+    cd `cat VERSION`
+
+    if [ $? -ne 0 ] ; then
+        echo "Path `cat VERSION` cannot be found - Halting"
+        exit 4
+    fi
+
+    if [ "$build_mode" = "Debug" ]
+    then
+    cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON  -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON .
+    fi
+
+    if [ "$build_mode" = "ModelChecker" ]
+    then
+    cmake -Denable_coverage=ON -Denable_java=ON -Denable_smpi=ON -Denable_model-checking=ON -Denable_lua=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON .
+    fi
+
+    if [ "$build_mode" = "DynamicAnalysis" ]
+    then
+    cmake -Denable_lua=OFF -Denable_java=ON -Denable_tracing=ON -Denable_smpi=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON -Denable_lib_static=OFF -Denable_model-checking=OFF -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF -Denable_mallocators=OFF -Denable_memcheck=ON .
+    fi
+
+    if [ $? -ne 0 ] ; then
+        echo "Failed to perform the Cmake for $build_mode - Halting"
+        exit 5
+    fi
+
+    make -j$NUMBER_OF_PROCESSORS
+
+    if [ $? -ne 0 ] ; then
+        echo "Build failure - Halting"
+        exit 6
+    fi
 
-if [ "$build_mode" = "ModelChecker" ]
-then
-cmake -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=ON -Denable_lua=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON .
 fi
 
-if [ "$build_mode" = "DynamicAnalysis" ]
-then
-  ctest -D ContinuousStart
-  ctest -D ContinuousConfigure
-  ctest -D ContinuousBuild
-  ctest -D ContinuousMemCheck
-  ctest -D ContinuousSubmit
+
+echo "running tests with $NUMBER_OF_PROCESSORS processors"
+
+ctest -T test --no-compress-output  --timeout 100 -j$NUMBER_OF_PROCESSORS || true
+if [ -f Testing/TAG ] ; then
+   xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl -o "$WORKSPACE/CTestResults.xml" Testing/`head -n 1 < Testing/TAG`/Test.xml
 fi
 
 ctest -D ContinuousStart
old mode 100644 (file)
new mode 100755 (executable)
index c88899f..7cb21a9 100755 (executable)
@@ -30,7 +30,8 @@ mkdir build-def
 cd build-def
 
 #DEFAULT CONF
-cmake ..
+cmake \
+-Denable_smpi_MPICH3_testsuite=on ..
 ctest -D ExperimentalStart
 ctest -D ExperimentalConfigure
 ctest -D ExperimentalBuild
index e99c3e3..a19e890 100755 (executable)
@@ -72,7 +72,8 @@ mkdir build-def
 cd build-def
 
 #DEFAULT CONF
-cmake ..
+cmake \
+-Denable_smpi_MPICH3_testsuite=on ..
 ctest -D NightlyStart
 ctest -D NightlyConfigure
 ctest -D NightlyBuild
diff --git a/contrib/benchmarking_code_block/Rhist.R b/contrib/benchmarking_code_block/Rhist.R
new file mode 100644 (file)
index 0000000..92fe61b
--- /dev/null
@@ -0,0 +1,37 @@
+# R script that produces histograms from benchmarked values
+
+# Can be called from the bash script with the following code:
+# export R_INPUT=$inputfile
+# export R_OUTPUT=$outputfile
+# R CMD BATCH $this_script.R
+
+# Use functions from bench.h to benchmark execution time of the desired block,
+# then Rhist.R script to read all timings and produce histograms
+# and finally inject.h to inject values instead of executing block
+
+  
+inputfile<-Sys.getenv("R_INPUT")
+outputfile<-Sys.getenv("R_OUTPUT")
+
+df<-read.table(inputfile,header=F)
+df<-df[,c(1,4)]
+names(df)<-c("NAME","TIME")
+attach(df)
+
+for(i in unique(NAME))
+{
+  vector1<-df[NAME==i,2]
+  h<-hist(vector1)
+  
+  cat(i, file = outputfile, sep = "\t", append = TRUE)
+  cat("  ", file = outputfile, sep = "\t", append = TRUE)
+  cat(sprintf("%.8f", mean(vector1)), file =outputfile, sep = "\t ", append = TRUE)
+  cat("\t", file = outputfile,  append = TRUE)
+  cat(length(h$breaks), file = outputfile, append = TRUE)
+  cat("\t", file = outputfile,  append = TRUE)
+  cat(sprintf("%.8f", h$breaks), file = outputfile, sep = " \t", append = TRUE)
+  cat("\t", file = outputfile,  append = TRUE)
+  h$density = h$counts/sum(h$counts)
+  cat(sprintf("%.14f", h$density), file = outputfile, sep = " \t", append = TRUE)
+  cat("\n", file = outputfile,  append = TRUE)
+}
diff --git a/contrib/benchmarking_code_block/bench.h b/contrib/benchmarking_code_block/bench.h
new file mode 100644 (file)
index 0000000..fc86bc3
--- /dev/null
@@ -0,0 +1,162 @@
+/* Copy to src/include/xbt/ folder  */
+
+/* Benchmarking a code block */
+
+/* Use functions from bench.h to benchmark execution time of the desired block,
+ * then Rhist.R script to read all timings and produce histograms
+ * and finally inject.h to inject values instead of executing block*/
+
+#ifndef __BENCH_H__
+#define __BENCH_H__
+
+#include <time.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Structure that has all benchmarking information for the block*/
+typedef struct bench {
+       struct timespec start_time;
+       struct timespec end_time;
+       int benchmarking;
+       char block_id[256];
+       char suffix[100];
+       FILE* output;
+}*bench_t;
+
+extern bench_t get_mybench(void);
+typedef bench_t (*get_bench_func_t)(void);
+
+/* In order to divide nanoseconds and get result in seconds */
+#define BILLION  1000000000L
+
+/* Macros for benchmarking */
+#define BENCH_BLOCK(block_id) for(bench_begin_block();bench_end_block(block_id);)
+#define BENCH_EXTEND(block_id) xbt_bench_extend(block_id)
+
+static inline void xbt_bench_init(char *tracefile);
+static inline void bench_init_starpu(char *tracefile, bench_t *bench);
+
+static inline void bench_begin_block();
+static inline int bench_end_block(char* block_id);
+
+static inline void xbt_bench_begin(char* block_id);
+static inline int xbt_bench_end(char* block_id);
+
+static inline void xbt_bench_extend(char* block_id);
+
+/* Additional functions in order to manipulate with struct timespec */
+static inline void xbt_diff_time(struct timespec* start, struct timespec* end, struct timespec* result_time);
+static inline double xbt_get_time(struct timespec* timer);
+
+/* Initializing SMPI benchmarking */
+static inline void xbt_bench_init(char *tracefile)
+{
+       bench_t mybench = get_mybench();
+       mybench->output = fopen(tracefile, "a+");
+       if (mybench->output == NULL)
+               printf("Error while opening the tracefile");
+
+}
+
+/* Initializing StarPU benchmarking */
+static inline void bench_init_starpu(char *tracefile, bench_t *bench)
+{
+  *bench = (bench_t) malloc(sizeof(**bench));
+  bench_t mybench = *bench;
+  mybench->output = fopen(tracefile, "a+");
+  if (mybench->output == NULL)
+               printf("Error while opening the tracefile");
+
+}
+
+/* Start benchmarking using macros */
+static inline void bench_begin_block()
+{
+       bench_t mybench = get_mybench();
+       clock_gettime(CLOCK_REALTIME, &mybench->start_time);
+       mybench->benchmarking = 1; // Only benchmarking once
+}
+
+/* End benchmarking using macros */
+static inline int bench_end_block(char* block_id)
+{
+       bench_t mybench = get_mybench();
+       if (mybench->benchmarking > 0)
+       {
+               mybench->benchmarking--;
+               return 1;
+       }
+       else
+       {
+               clock_gettime(CLOCK_REALTIME, &mybench->end_time);
+               struct timespec interval;
+               xbt_diff_time(&mybench->start_time, &mybench->end_time, &interval);
+               fprintf(mybench->output, "%s %lf %lf %lf\n", block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+               return 0;
+       }
+}
+
+/* Start SMPI benchmarking */
+static inline void xbt_bench_begin(char* block_id)
+{
+       bench_t mybench = get_mybench();
+       if(block_id != NULL)
+               strcpy (mybench->block_id, block_id);
+       else
+               strcpy (mybench->block_id, "");
+       clock_gettime(CLOCK_REALTIME, &mybench->start_time);
+       mybench->benchmarking = 1; // Only benchmarking once
+}
+
+/* End SMPI benchmarking */
+static inline int xbt_bench_end(char* block_id)
+{
+       bench_t mybench = get_mybench();
+
+       clock_gettime(CLOCK_REALTIME, &mybench->end_time);
+       struct timespec interval;
+       xbt_diff_time(&mybench->start_time, &mybench->end_time, &interval);
+
+       if(mybench->suffix != NULL)
+       {
+               strcat (mybench->block_id, mybench->suffix);
+               strcpy (mybench->suffix, "");
+       }
+       if(block_id != NULL)
+               strcat (mybench->block_id, block_id);
+       if(mybench->block_id == NULL)
+               strcat (mybench->block_id, "NONAME");
+
+       fprintf(mybench->output, "%s %lf %lf %lf\n", mybench->block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+       return 0;
+}
+
+/* Extending the block_id name*/
+static inline void xbt_bench_extend(char* block_id)
+{
+       bench_t mybench = get_mybench();
+       strcpy (mybench->suffix, block_id);
+}
+
+/* Calculating time difference */
+static inline void xbt_diff_time(struct timespec* start, struct timespec* end, struct timespec* result_time)
+{
+       if ((end->tv_nsec - start->tv_nsec) < 0)
+       {
+               result_time->tv_sec = end->tv_sec - start->tv_sec - 1;
+               result_time->tv_nsec = (double) BILLION + end->tv_nsec - start->tv_nsec;
+       }
+       else
+       {
+               result_time->tv_sec = end->tv_sec - start->tv_sec;
+               result_time->tv_nsec = end->tv_nsec - start->tv_nsec;
+       }
+}
+
+/* Printing time in "double" format */
+static inline double xbt_get_time(struct timespec* timer)
+{
+       return timer->tv_sec + (double) (timer->tv_nsec / (double) BILLION);
+}
+
+#endif //__BENCH_H__
diff --git a/contrib/benchmarking_code_block/inject.h b/contrib/benchmarking_code_block/inject.h
new file mode 100644 (file)
index 0000000..ba23a65
--- /dev/null
@@ -0,0 +1,198 @@
+/* Copy to src/include/xbt/ folder  */
+
+/* Injecting timings for previously benchmarked code blocks */
+
+/* Use functions from bench.h to benchmark execution time of the desired block,
+ * then Rhist.R script to read all timings and produce histograms
+ * and finally inject.h to inject values instead of executing block*/
+
+#ifndef __INJECT_H__
+#define __INJECT_H__
+
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include "xbt/RngStream.h"
+#include "xbt/dict.h"
+#include "xbt/sysdep.h"
+
+#define MAX_LINE_INJ 1000
+
+/*
+ * Histogram entry for each measured block
+ * Each entry is guarded inside xbt dictionary which is read from the file */
+typedef struct xbt_hist {
+       int n;
+       double mean;
+       double *breaks;
+       double *percentage;
+       char* block_id;
+} xbt_hist_t;
+
+extern RngStream get_randgen(void);
+typedef RngStream (*get_randgen_func_t)(void);
+
+extern xbt_dict_t get_dict(void);
+typedef xbt_dict_t (*get_dict_func_t)(void);
+
+static inline void xbt_inject_init(char *inputfile);
+static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStream *rng);
+
+static inline double xbt_inject_time(char *key);
+static inline double xbt_mean_time(char *key);
+static inline double xbt_hist_time(char *key);
+
+/* Initializing xbt dictionary for SMPI version, reading xbt_hist_t entries line by line */
+static inline void xbt_inject_init(char *inputfile)
+{
+       xbt_dict_t mydict = get_dict();
+       FILE* fpInput = fopen(inputfile, "r");
+       if (fpInput == NULL)
+               printf("Error while opening the inputfile");
+       fseek(fpInput, 0, 0);
+
+       char line[200];
+       char *key;
+       int i;
+       xbt_hist_t* data;
+
+       if (fgets(line, 200, fpInput) == NULL)
+               printf("Error input file is empty!");//Skipping first row
+       while (fgets(line, 200, fpInput) != NULL)
+       {
+               key = strtok(line, " \t");
+
+               data = xbt_dict_get_or_null(mydict, key);
+               if (data)
+                       printf("Error, data with that block_id already exists!");
+
+               data = (xbt_hist_t *) xbt_new(xbt_hist_t, 1);
+
+               data->block_id = key;
+               data->mean = atof(strtok(NULL, " \t"));
+               data->n = atoi(strtok(NULL, " \t"));
+
+               data->breaks = (double*) malloc(sizeof(double) * data->n);
+               data->percentage = (double*) malloc(sizeof(double) * (data->n - 1));
+               for (i = 0; i < data->n; i++)
+                       data->breaks[i] = atof(strtok(NULL, " \t"));
+               for (i = 0; i < (data->n - 1); i++)
+                       data->percentage[i] = atof(strtok(NULL, " \t"));
+
+               xbt_dict_set(mydict, key, data, NULL);
+       }
+}
+
+/* Initializing xbt dictionary for StarPU version, reading xbt_hist_t entries line by line */
+static inline void inject_init_starpu(char *inputfile, xbt_dict_t *dict, RngStream *rng)
+{
+       *dict = xbt_dict_new_homogeneous(free);
+       *rng = RngStream_CreateStream("Randgen1");
+       unsigned long seed[] = {134, 233445, 865, 2634, 424242, 876541};
+       RngStream_SetSeed(*rng, seed);
+
+       xbt_dict_t mydict = *dict;
+       mydict = *dict;
+       FILE* fpInput = fopen(inputfile, "r");
+       if (fpInput == NULL)
+               printf("Error while opening the inputfile");
+
+       fseek(fpInput, 0, 0);
+
+       char line[MAX_LINE_INJ];
+       char *key;
+       int i;
+       xbt_hist_t* data;
+
+       if (fgets(line, MAX_LINE_INJ, fpInput) == NULL)
+               printf("Error input file is empty!");//Skipping first row
+
+
+       while (fgets(line, MAX_LINE_INJ, fpInput) != NULL)
+       {
+               key = strtok(line, " \t");
+
+               data = xbt_dict_get_or_null(mydict, key);
+               if (data)
+                       printf("Error, data with that block_id already exists!");
+
+               data = (xbt_hist_t *) xbt_new(xbt_hist_t, 1);
+               data->block_id = key;
+               data->mean = atof(strtok(NULL, " \t"));
+               data->n = atoi(strtok(NULL, " \t"));
+               data->breaks = (double*) malloc(sizeof(double) * data->n);
+               data->percentage = (double*) malloc(sizeof(double) * (data->n - 1));
+
+               for (i = 0; i < data->n; i++)
+                       data->breaks[i] = atof(strtok(NULL, " \t"));
+                       for (i = 0; i < (data->n - 1); i++)
+                       {
+                               data->percentage[i] = atof(strtok(NULL, " \t"));
+                       }
+
+               xbt_dict_set(mydict, key, data, NULL);
+       }
+}
+
+/* Injecting time */
+static inline double xbt_inject_time(char *key)
+{
+       return xbt_hist_time(key);
+       //return xbt_mean_time(key);
+}
+
+/* Injecting mean value */
+static inline double xbt_mean_time(char *key)
+{
+       xbt_dict_t mydict = get_dict();
+       xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
+
+       if (!data)
+       {
+         printf("Warning: element with specified key does not exist (%s)\n",key);
+         return 0;
+       }
+
+       return data->mean;
+}
+
+/* Injecting random value from the histogram */
+static inline double xbt_hist_time(char *key)
+{
+       int i, k = 0;
+       double left = 0, right = 1;
+       double timer = 0;
+       RngStream rng_stream;
+       double r, r2;
+
+       xbt_dict_t mydict = get_dict();
+       xbt_hist_t* data = xbt_dict_get_or_null(mydict, key);
+
+       if (!data)
+               {
+                 printf("Warning: element with specified key does not exist (%s)\n",key);
+                 return 0;
+               }
+
+       /* Choosing random interval of the histogram */
+       rng_stream = get_randgen();
+       r = RngStream_RandU01(rng_stream);
+       for (i = 0; i < (data->n - 1); i++)
+       {
+               left += (i == 0) ? 0 : data->percentage[i - 1];
+               right += data->percentage[i];
+               if (left < r && r <= right)
+                       k = i;
+       }
+
+       /* Choosing random value inside the interval of the histogram */
+       r2 = RngStream_RandU01(rng_stream);
+       timer = data->breaks[k] + r2 * (data->breaks[k + 1] - data->breaks[k]);
+
+       return timer;
+}
+
+#endif // __INJECT_H__
+
index accc6b9..25721cc 100644 (file)
@@ -179,7 +179,7 @@ grep GLOBAL_GUARDS patches/make/* -r
 
 # Finish the setup
 (cd patches/make; make setup && make force && make && make FORCE_VERSIONS=1 && echo "Sources are properly setup")
-# If this last command failed, check your mercurial config within ~/.hgrc (see above)
+# If this last command failed, check your mercurial config within ~/.hgrc (see above)
 ~~~~       
  -# Compile it all
 ~~~~{.sh}
index 7da810f..91c6de2 100644 (file)
@@ -12,7 +12,7 @@ Please apply the following checklist before releasing.
     SIMGRID_VERSION_MAJOR and friends. Please also update the
     comments right before these macros so that we keep a track of the
     version numbers that were used.
-  - Themake distcheck" target works (testing that every files needed
+  - The "make distcheck" target works (testing that every files needed
     to build and install are included in the archive)
   - The URL provided to download in the examples of
     doc/doxygen/install.doc is accurate. Note that updating the 
@@ -94,11 +94,10 @@ Please apply the above checklists before and after releasing the bindings.
 
 Then, clean your git repository and build the archive. It will give
 you an archive file in the build dir:
-'SimGrid-Java-${inside_release_version}.tar.gz' or
 'SimGrid-Ruby-${inside_release_version}.tar.gz'. 
 
 \verbatim
-$ cd simgrid-java (or simgrid-ruby)
+$ cd simgrid-ruby
 $ git reset --hard master
 $ git clean -dfx
 $ mkdir build
index 6b2fa09..0cf579c 100644 (file)
@@ -160,10 +160,10 @@ sudo apt-get install vite
 ~~~~
 
 # Let's get Started
-## Setting up and Compiling.
+## Setting up and Compiling
    
 The corresponding archive with all source files and platform files
-can be obtained [here](msg-tuto-src.tgz). 
+can be obtained [here](http://simgrid.gforge.inria.fr/tutorials/msg-tuto/msg-tuto.tgz).
 
 ~~~~{.sh}
 tar zxf msg-tuto.tgz
@@ -196,7 +196,7 @@ For a more "fancy" output, you can try:
 For a really fancy output, you should use [viva/triva][fn:1]:
 
 ~~~~{.sh}
-./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1\
+./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1 \
     --cfg=tracing/uncategorized:1 --cfg=viva/uncategorized:uncat.plist
 LANG=C ; viva simgrid.trace uncat.plist
 ~~~~
@@ -213,7 +213,7 @@ LANG=C ; Paje simgrid.trace
 Alternatively, you can use [vite][fn:6].
 
 ~~~~{.sh}
-./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1\
+./masterworker0 platforms/platform.xml deployment0.xml --cfg=tracing:1 \
     --cfg=tracing/msg/process:1 --cfg=tracing/basic:1
 vite simgrid.trace
 ~~~~
@@ -312,14 +312,14 @@ In the current version, the number of tasks is defined in the
 worker arguments. Hence, tasks are created at the very beginning of
 the simulation. Instead, create tasks as needed and provide a time
 limit indicating when it stops sending tasks. To this end, you will
-obviously need to know what time it is[fn:7]:
+obviously need to know what time it is ([reference manual][fn:7]):
 
 ~~~~{.c}
 double MSG_get_clock(void);
 ~~~~
 
 Otherwise, a quite effective way of terminating the simulation
-would be to use some of the following function[fn:7]:
+would be to use some of the following [function][fn:7]:
 
 ~~~~{.c}
 void MSG_process_kill(msg_process_t process);
@@ -352,7 +352,7 @@ tasks processed). These debug messages can be activated as follows:
 ## Using the Tracing Mechanism
 
 SimGrid can trace all resource consumption and the outcome can be
-displayed with viva as illustrated [[*Setting%20up%20and%20Compiling.][here]]. However, when several
+displayed with viva as illustrated in the section "Setting up and Compiling". However, when several
 masters are deployed, it is hard to understand what happens. 
 
 ~~~~{.xml}
@@ -378,7 +378,7 @@ masters are deployed, it is hard to understand what happens.
 ~~~~
 
 So let's use categories to track more precisely who does what and
-when[fn:7].
+[when][fn:7].
 
 ~~~~{.c}
 void TRACE_category(const char *category);
@@ -418,7 +418,7 @@ name. This way, the master can keep track of which workers are idle
 and willing to work.
 
 To know whether it has pending requests, the master can use the
-following function[fn:7]:
+following [function][fn:7]:
 
 ~~~~{.c}
 int MSG_task_listen(const char *alias);
@@ -426,7 +426,7 @@ int MSG_task_listen(const char *alias);
 
 If so, it should get the request and push the corresponding host
 into a dynar so that they can later be retrieved when sending a
-real task[fn:7].
+real [task][fn:7].
 
 ~~~~{.c}
 xbt_dynar_t xbt_dynar_new(const unsigned long elm_size,
@@ -439,7 +439,7 @@ unsigned long xbt_dynar_length(const xbt_dynar_t dynar);
 As you will soon realize, with such simple mechanisms, simple
 deadlocks will soon appear. They can easily be removed with a
 simple polling mechanism, hence the need for the following
-function[fn:7]:
+[function][fn:7]:
 
 ~~~~{.c}
 msg_error_t MSG_process_sleep(double nb_sec);
index a5c5099..b51f5df 100644 (file)
@@ -39,7 +39,7 @@ Our coverage of the interface is very decent, but still incomplete;
 Given the size of the MPI standard, it may well be that we never
 implement absolutely all existing primitives. One sided communications
 and I/O primitives are not targeted for now. Our current state is
-still very decent: we pass most of the MPICH coverage tests.
+still very decent: we pass most of the MPICH coverage tests.
 
 The full list of not yet implemented functions is documented in the
 file <tt>include/smpi/smpi.h</tt> of the archive, between two lines
@@ -158,4 +158,303 @@ This feature is demoed by the example file
 <tt>examples/smpi/NAS/EP-sampling/ep.c</tt>
 
 
-*/
\ No newline at end of file
+\section SMPI_collective_algorithms Simulating collective operations
+
+MPI collective operations can be implemented very differently from one library 
+to another. Actually, all existing libraries implement several algorithms 
+for each collective operation, and by default select at runtime which one 
+should be used for the current operation, depending on the sizes sent, the number
+ of nodes, the communicator, or the communication library being used. These 
+decisions are based on empirical results and theoretical complexity estimation, 
+but they can sometimes be suboptimal. Manual selection is possible in these cases, 
+to allow the user to tune the library and use the better collective if the 
+default one is not good enough.
+
+SMPI tries to apply the same logic, regrouping algorithms from OpenMPI, MPICH 
+libraries, and from StarMPI (<a href="http://star-mpi.sourceforge.net/">STAR-MPI</a>).
+This collection of more than a hundred algorithms allows a simple and effective
+ comparison of their behavior and performance, making SMPI a tool of choice for the
+development of such algorithms.
+
+\subsection Tracing_internals Tracing of internal communications
+
+For each collective, default tracing only outputs only global data. 
+Internal communication operations are not traced to avoid outputting too much data
+to the trace. To debug and compare algorithm, this can be changed with the item 
+\b tracing/smpi/internals , which has 0 for default value.
+Here are examples of two alltoall collective algorithms runs on 16 nodes, 
+the first one with a ring algorithm, the second with a pairwise one :
+
+\htmlonly
+<a href="smpi_simgrid_alltoall_ring_16.png" border=0><img src="smpi_simgrid_alltoall_ring_16.png" width="30%" border=0 align="center"></a>
+<a href="smpi_simgrid_alltoall_pair_16.png" border=0><img src="smpi_simgrid_alltoall_pair_16.png" width="30%" border=0 align="center"></a>
+<br/>
+\endhtmlonly
+
+\subsection Selectors
+
+The default selection logic implemented by default in OpenMPI (version 1.7) 
+and MPICH (version 3.0.4) has been replicated and can be used by setting the
+\b smpi/coll_selector item to either ompi or mpich. The code and details for each 
+selector can be found in the <tt>src/smpi/colls/smpi_(openmpi/mpich)_selector.c</tt> file.
+As this is still in development, we do not insure that all algorithms are correctly
+ replicated and that they will behave exactly as the real ones. If you notice a difference,
+please contact <a href="http://lists.gforge.inria.fr/mailman/listinfo/simgrid-devel">SimGrid developers mailing list</a>
+
+The default selector uses the legacy algorithms used in versions of SimGrid
+ previous to the 3.10. they should not be used to perform performance study and 
+may be removed in the future, a different selector being used by default.
+
+\subsection algos Available algorithms
+
+For each one of the listed algorithms, several versions are available,
+ either coming from STAR-MPI, MPICH or OpenMPI implementations. Details can be
+ found in the code or in <a href="http://www.cs.arizona.edu/~dkl/research/papers/ics06.pdf">STAR-MPI</a> for STAR-MPI algorithms.
+
+Each collective can be selected using the corresponding configuration item. For example, to use the pairwise alltoall algorithm, one should add \b --cfg=smpi/alltoall:pair to the line. This will override the selector (for this algorithm only) if provided, allowing better flexibility.
+
+Warning: Some collective may require specific conditions to be executed correctly (for instance having a communicator with a power of two number of nodes only), which are currently not enforced by Simgrid. Some crashes can be expected while trying these algorithms with unusual sizes/parameters
+
+\subsubsection MPI_Alltoall
+
+Most of these are best described in <a href="http://www.cs.arizona.edu/~dkl/research/papers/ics06.pdf">STAR-MPI</a>
+
+ - default : naive one, by default
+ - ompi : use openmpi selector for the alltoall operations
+ - mpich : use mpich selector for the alltoall operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - 2dmesh : organizes the nodes as a two dimensional mesh, and perform allgather 
+along the dimensions
+ - 3dmesh : adds a third dimension to the previous algorithm
+ - rdb : recursive doubling : extends the mesh to a nth dimension, each one 
+containing two nodes
+ - pair : pairwise exchange, only works for power of 2 procs, size-1 steps,
+each process sends and receives from the same process at each step
+ - pair_light_barrier : same, with small barriers between steps to avoid contention
+ - pair_mpi_barrier : same, with MPI_Barrier used
+ - pair_one_barrier : only one barrier at the beginning
+ - ring : size-1 steps, at each step a process send to process (n+i)%size, and receives from (n-i)%size
+ - ring_light_barrier : same, with small barriers between some phases to avoid contention
+ - ring_mpi_barrier : same, with MPI_Barrier used
+ - ring_one_barrier : only one barrier at the beginning
+ - basic_linear :posts all receives and all sends,
+starts the communications, and waits for all communication to finish
+
+\subsubsection MPI_Alltoallv
+
+ - default : naive one, by default
+ - ompi : use openmpi selector for the alltoallv operations
+ - mpich : use mpich selector for the alltoallv operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - bruck : same as alltoall
+ - pair : same as alltoall
+ - pair_light_barrier : same as alltoall
+ - pair_mpi_barrier : same as alltoall
+ - pair_one_barrier : same as alltoall
+ - ring : same as alltoall
+ - ring_light_barrier : same as alltoall
+ - ring_mpi_barrier : same as alltoall
+ - ring_one_barrier : same as alltoall
+ - ompi_basic_linear : same as alltoall
+
+
+\subsubsection MPI_Gather
+
+ - default : naive one, by default
+ - ompi : use openmpi selector for the gather operations
+ - mpich : use mpich selector for the gather operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+which will iterate over all implemented versions and output the best
+ - ompi_basic_linear : basic linear algorithm from openmpi, each process sends to the root
+ - ompi_binomial : binomial tree algorithm
+ - ompi_linear_sync : same as basic linear, but with a synchronization at the
+ beginning and message
+cut into two segments.
+
+\subsubsection MPI_Barrier
+ - default : naive one, by default
+ - ompi : use openmpi selector for the barrier operations
+ - mpich : use mpich selector for the barrier operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - ompi_basic_linear : all processes send to root
+ - ompi_two_procs : special case for two processes
+ - ompi_bruck : nsteps = sqrt(size), at each step, exchange data with rank-2^k and rank+2^k
+ - ompi_recursivedoubling : recursive doubling algorithm
+ - ompi_tree : recursive doubling type algorithm, with tree structure
+ - ompi_doublering : double ring algorithm
+
+
+\subsubsection MPI_Scatter
+ - default : naive one, by default
+ - ompi : use openmpi selector for the scatter operations
+ - mpich : use mpich selector for the scatter operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - ompi_basic_linear : basic linear scatter 
+ - ompi_binomial : binomial tree scatter
+
+
+\subsubsection MPI_Reduce
+ - default : naive one, by default
+ - ompi : use openmpi selector for the reduce operations
+ - mpich : use mpich selector for the reduce operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - arrival_pattern_aware : root exchanges with the first process to arrive
+ - binomial : uses a binomial tree
+ - flat_tree : uses a flat tree
+ - NTSL : Non-topology-specific pipelined linear-bcast function 
+   0->1, 1->2 ,2->3, ....., ->last node : in a pipeline fashion, with segments
+ of 8192 bytes
+ - scatter_gather : scatter then gather
+ - ompi_chain : openmpi reduce algorithms are built on the same basis, but the
+ topology is generated differently for each flavor
+chain = chain with spacing of size/2, and segment size of 64KB 
+ - ompi_pipeline : same with pipeline (chain with spacing of 1), segment size 
+depends on the communicator size and the message size
+ - ompi_binary : same with binary tree, segment size of 32KB
+ - ompi_in_order_binary : same with binary tree, enforcing order on the 
+operations
+ - ompi_binomial : same with binomial algo (redundant with default binomial 
+one in most cases)
+ - ompi_basic_linear : basic algorithm, each process sends to root
+
+\subsubsection MPI_Allreduce
+ - default : naive one, by default
+ - ompi : use openmpi selector for the allreduce operations
+ - mpich : use mpich selector for the allreduce operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - lr : logical ring reduce-scatter then logical ring allgather
+ - rab1 : variations of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm : reduce_scatter then allgather
+ - rab2 : variations of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm : alltoall then allgather
+ - rab_rsag : variation of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm : recursive doubling 
+reduce_scatter then recursive doubling allgather 
+ - rdb : recursive doubling
+ - smp_binomial : binomial tree with smp : 8 cores/SMP, binomial intra 
+SMP reduce, inter reduce, inter broadcast then intra broadcast
+ - smp_binomial_pipeline : same with segment size = 4096 bytes
+ - smp_rdb : 8 cores/SMP, intra : binomial allreduce, inter : Recursive 
+doubling allreduce, intra : binomial broadcast
+ - smp_rsag : 8 cores/SMP, intra : binomial allreduce, inter : reduce-scatter, 
+inter:allgather, intra : binomial broadcast
+ - smp_rsag_lr : 8 cores/SMP, intra : binomial allreduce, inter : logical ring 
+reduce-scatter, logical ring inter:allgather, intra : binomial broadcast
+ - smp_rsag_rab : 8 cores/SMP, intra : binomial allreduce, inter : rab
+reduce-scatter, rab inter:allgather, intra : binomial broadcast
+ - redbcast : reduce then broadcast, using default or tuned algorithms if specified
+ - ompi_ring_segmented : ring algorithm used by OpenMPI
+
+\subsubsection MPI_Reduce_scatter
+ - default : naive one, by default
+ - ompi : use openmpi selector for the reduce_scatter operations
+ - mpich : use mpich selector for the reduce_scatter operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - ompi_basic_recursivehalving : recursive halving version from OpenMPI
+ - ompi_ring : ring version from OpenMPI
+ - mpich_pair : pairwise exchange version from MPICH
+ - mpich_rdb : recursive doubling version from MPICH
+ - mpich_noncomm : only works for power of 2 procs, recursive doubling for noncommutative ops
+
+
+\subsubsection MPI_Allgather
+
+ - default : naive one, by default
+ - ompi : use openmpi selector for the allgather operations
+ - mpich : use mpich selector for the allgather operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - 2dmesh : see alltoall
+ - 3dmesh : see alltoall
+ - bruck : Described by Bruck et.al. in <a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=642949">
+Efficient algorithms for all-to-all communications in multiport message-passing systems</a> 
+ - GB : Gather - Broadcast (uses tuned version if specified)
+ - loosely_lr : Logical Ring with grouping by core (hardcoded, default 
+processes/node: 4)
+ - NTSLR : Non Topology Specific Logical Ring
+ - NTSLR_NB : Non Topology Specific Logical Ring, Non Blocking operations
+ - pair : see alltoall
+ - rdb : see alltoall
+ - rhv : only power of 2 number of processes
+ - ring : see alltoall
+ - SMP_NTS : gather to root of each SMP, then every root of each SMP node 
+post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message, 
+using logical ring algorithm (hardcoded, default processes/SMP: 8)
+ - smp_simple : gather to root of each SMP, then every root of each SMP node 
+post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message, 
+using simple algorithm (hardcoded, default processes/SMP: 8)
+ - spreading_simple : from node i, order of communications is i -> i + 1, i ->
+ i + 2, ..., i -> (i + p -1) % P
+ - ompi_neighborexchange : Neighbor Exchange algorithm for allgather. 
+Described by Chen et.al. in  <a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=1592302">Performance Evaluation of Allgather Algorithms on Terascale Linux Cluster with Fast Ethernet</a>
+
+
+\subsubsection MPI_Allgatherv
+ - default : naive one, by default
+ - ompi : use openmpi selector for the allgatherv operations
+ - mpich : use mpich selector for the allgatherv operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - GB : Gatherv - Broadcast (uses tuned version if specified, but only for 
+Bcast, gatherv is not tuned)
+ - pair : see alltoall
+ - ring : see alltoall
+ - ompi_neighborexchange : see allgather
+ - ompi_bruck : see allgather
+ - mpich_rdb : recursive doubling algorithm from MPICH
+ - mpich_ring : ring algorithm from MPICh - performs differently from the 
+one from STAR-MPI
+
+\subsubsection MPI_Bcast
+ - default : naive one, by default
+ - ompi : use openmpi selector for the bcast operations
+ - mpich : use mpich selector for the bcast operations
+ - automatic (experimental) : use an automatic self-benchmarking algorithm 
+ - arrival_pattern_aware : root exchanges with the first process to arrive
+ - arrival_pattern_aware_wait : same with slight variation
+ - binomial_tree : binomial tree exchange
+ - flattree : flat tree exchange
+ - flattree_pipeline : flat tree exchange, message split into 8192 bytes pieces
+ - NTSB : Non-topology-specific pipelined binary tree with 8192 bytes pieces
+ - NTSL : Non-topology-specific pipelined linear with 8192 bytes pieces
+ - NTSL_Isend : Non-topology-specific pipelined linear with 8192 bytes pieces, asynchronous communications
+ - scatter_LR_allgather : scatter followed by logical ring allgather
+ - scatter_rdb_allgather : scatter followed by recursive doubling allgather
+ - arrival_scatter : arrival pattern aware scatter-allgather
+ - SMP_binary : binary tree algorithm with 8 cores/SMP
+ - SMP_binomial : binomial tree algorithm with 8 cores/SMP
+ - SMP_linear : linear algorithm with 8 cores/SMP
+ - ompi_split_bintree : binary tree algorithm from OpenMPI, with message split in 8192 bytes pieces
+ - ompi_pipeline : pipeline algorithm from OpenMPI, with message split in 128KB pieces
+
+
+\subsection auto Automatic evaluation 
+
+(Warning : This is experimental and may be removed or crash easily)
+
+An automatic version is available for each collective (or even as a selector). This specific 
+version will loop over all other implemented algorithm for this particular collective, and apply 
+them while benchmarking the time taken for each process. It will then output the quickest for 
+each process, and the global quickest. This is still unstable, and a few algorithms which need 
+specific number of nodes may crash.
+
+
+\subsection add Add an algorithm
+
+To add a new algorithm, one should check in the src/smpi/colls folder how other algorithms 
+are coded. Using plain MPI code inside Simgrid can't be done, so algorithms have to be 
+changed to use smpi version of the calls instead (MPI_Send will become smpi_mpi_send). Some functions may have different signatures than their MPI counterpart, please check the other algorithms or contact us using <a href="http://lists.gforge.inria.fr/mailman/listinfo/simgrid-devel">SimGrid developers mailing list</a>.
+
+Example: adding a "pair" version of the Alltoall collective.
+
+ - Implement it in a file called alltoall-pair.c in the src/smpi/colls folder. This file should include colls_private.h.
+
+ - The name of the new algorithm function should be smpi_coll_tuned_alltoall_pair, with the same signature as MPI_Alltoall.
+
+ - Once the adaptation to SMPI code is done, add a reference to the file ("src/smpi/colls/alltoall-pair.c") in the SMPI_SRC part of the DefinePackages.cmake file inside buildtools/cmake, to allow the file to be built and distributed.
+
+ - To register the new version of the algorithm, simply add a line to the corresponding macro in src/smpi/colls/cools.h ( add a "COLL_APPLY(action, COLL_ALLTOALL_SIG, pair)" to the COLL_ALLTOALLS macro ). The algorithm should now be compiled and be selected when using --cfg=smpi/alltoall:pair at runtime.
+
+ - To add a test for the algorithm inside Simgrid's test suite, juste add the new algorithm name in the ALLTOALL_COLL list found inside buildtools/cmake/AddTests.cmake . When running ctest, a test for the new algorithm should be generated and executed. If it does not pass, please check your code or contact us.
+
+ - Feel free to push this new algorithm to the SMPI repository using Git.
+
+
+
+
+*/
index 5f9a58f..1461798 100644 (file)
@@ -253,6 +253,10 @@ manually set for MSG mailboxes, by setting the receiving mode of the mailbox
 with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this 
 mailbox will have this behavior, so consider using two mailboxes if needed. 
 
+This value needs to be smaller than or equals to the threshold set at 
+\ref options_model_smpi_detached , because asynchronous messages are 
+meant to be detached as well.
+
 \subsubsection options_pls Configuring packet-level pseudo-models
 
 When using the packet-level pseudo-models, several specific
@@ -483,8 +487,7 @@ reproduce an experiment. You have two ways to do that:
 
 Please, use these two parameters (for comments) to make reproducible
 simulations. For additional details about this and all tracing
-options, check See the \ref tracing_tracing_options "Tracing
-Configuration Options subsection".
+options, check See the \ref tracing_tracing_options.
 
 \section options_smpi Configuring SMPI
 
@@ -525,6 +528,24 @@ to 1, \c smpirun will display this information when the simulation ends. \verbat
 Simulation time: 1e3 seconds.
 \endverbatim
 
+\subsection options_model_smpi_detached Simulating MPI detached send
+
+(this configuration item is experimental and may change or disapear)
+
+This threshold specifies the size in bytes under which the send will return 
+immediately. This is different from the threshold detailed in  \ref options_model_network_asyncsend
+because the message is not effectively sent when the send is posted. SMPI still waits for the
+correspondant receive to be posted to perform the communication operation. This threshold can be set 
+by changing the \b smpi/send_is_detached item. The default value is 65536.
+
+\subsection options_model_smpi_collectives Simulating MPI collective algorithms
+
+SMPI implements more than 100 different algorithms for MPI collective communication, to accurately 
+simulate the behavior of most of the existing MPI libraries. The \b smpi/coll_selector item can be used
+ to use the decision logic of either OpenMPI or MPICH libraries (values: ompi or mpich, by default SMPI
+uses naive version of collective operations). Each collective operation can be manually selected with a 
+\b smpi/collective_name:algo_name. Available algorithms are listed in \ref SMPI_collective_algorithms .
+
 \section options_generic Configuring other aspects of SimGrid
 
 \subsection options_generic_path XML file inclusion path
@@ -591,6 +612,8 @@ It can be done by using XBT. Go to \ref XBT_log for more details.
 - \c smpi/display_timing: \ref options_smpi_timing
 - \c smpi/cpu_threshold: \ref options_smpi_bench
 - \c smpi/async_small_thres: \ref options_model_network_asyncsend
+- \c smpi/send_is_detached: \ref options_model_smpi_detached
+- \c smpi/coll_selector: \ref options_model_smpi_collectives
 
 - \c path: \ref options_generic_path
 - \c verbose-exit: \ref options_generic_exit
index 0987ed6..1101198 100644 (file)
@@ -16,7 +16,7 @@ For the latest 2 entries, you have basically 2 ways to give it as an input :
 \li You can use two XML files: a platform description file and a
     deployment description one.
 
-For the deployment stuff, please takea look at \ref deployment
+For the deployment stuff, please take a look at \ref deployment
 
 The platform description may be complicated. This documentation is all
 about how to write this file: what are the basic concept it relies on,
@@ -28,10 +28,10 @@ write a good platform description.
 We choose to use XML because of some of its possibilities: if you're
 using an accurate XML editor, or simply using any XML plug-in for
 eclipse, it will allow you to have cool stuff like auto-completion,
-validation and checking, so all syntaxic errors may be avoided this
+validation and checking, so all syntax errors may be avoided this
 way.
 
-the XML checking is done based on the dtd which is nowaday online at
+the XML checking is done based on the dtd which is nowadays online at
 <a href="http://simgrid.gforge.inria.fr/simgrid.dtd">http://simgrid.gforge.inria.fr/simgrid.dtd</a>
 while you might be tempted to read it, it will not help you that much.
 
@@ -82,7 +82,7 @@ handles two different types of entities (<b>host/router</b> and
 <b>AS</b>) you will have to define routes between those elements. A
 network model have to be provided for AS, but you may/will need,
 depending of the network model, or because you want to bypass the
-default beahviour to defines routes manually. There are 3 tags to use: 
+default behavior to defines routes manually. There are 3 tags to use: 
 \li <b>ASroute</b>: to define routes between two  <b>AS</b>
 \li <b>route</b>: to define routes between two <b>host/router</b>
 \li <b>bypassRoute</b>: to define routes between two <b>AS</b> that
@@ -126,12 +126,12 @@ attributes.
     That also have a big impact on how many information you'll have to
     provide to help the simulator to route between the AS elements.
     <b>routing</b> possible values are <b>Full, Floyd, Dijkstra,
-    DijkstraCache, none, RuleBased, Vivaldi, Cluster</b>. For more
+    DijkstraCache, none, Vivaldi, Cluster</b>. For more
     explanation about what to choose, take a look at the section
     devoted to it below.  
 
 Elements into an AS are basically resources (computers, network
-equipments) and some routing informations if necessary (see below for
+equipments) and some routing information if necessary (see below for
 more explanation).
 
 <b>AS example</b>
@@ -162,15 +162,16 @@ contain more than 1 core. Here are the attributes of a host :
     referring to it.
 \li <b>power (mandatory)</b>:the peak number FLOPS the CPU can manage.
     Expressed in flop/s.
-\li <b>core</b>: The number of core of this host. If setted, the power
-    gives the power of one core. The specified computing power will be
+\li <b>core</b>: The number of core of this host (by default, 1). If
+    you specify the amount of cores, the 'power' parameter is the power 
+    of each core. 
+    For example, if you specify that your host has 6 cores, it will be
     available to up to 6 sequential tasks without sharing. If more
     tasks are placed on this host, the resource will be shared
-    accordingly. For example, if you schedule 12 tasks on the host,
-    each will get half of the computing power. Please note that
-    although sound, this model were never scientifically assessed.
+    accordingly. For example, if you schedule 12 tasks on that host,
+    each will get half of the specified computing power. Please note
+    that although sound, this model were never scientifically assessed.
     Please keep this fact in mind when using it.
-
 \li <b>availability</b>: specify if the percentage of power available.
 \li <b>availability_file</b>: Allow you to use a file as input. This
     file will contain availability traces for this computer. The
@@ -190,7 +191,7 @@ between some storage resource and the <b>host</b>. Please refer to the
 storage doc for more information.
 
 An host can also contain the <b>prop</b> tag. the prop tag allows you
-to define additional informations on this host following the
+to define additional information on this host following the
 attribute/value schema. You may want to use it to give information to
 the tool you use for rendering your simulation, for example.
 
@@ -285,7 +286,7 @@ A <b>cluster</b> represents a cluster. It is most of the time used
 when you want to have a bunch of machine defined quickly. It must be
 noted that cluster is meta-tag : <b>from the inner SimGrid point of
 view, a cluster is an AS where some optimized routing is defined</b>.
-The default inner organisation of the cluster is as follow:
+The default inner organization of the cluster is as follow:
 
 \verbatim
                  _________
@@ -300,7 +301,7 @@ The default inner organisation of the cluster is as follow:
 \endverbatim
 
 You have a set of <b>host</b> defined. Each of them has a <b>link</b>
-to a central backbone (backbone is a <b>link</b> itsef, as a link can
+to a central backbone (backbone is a <b>link</b> itself, as a link can
 be used to represent a switch, see the switch or <b>link</b> section
 below for more details about it). A <b>router</b> gives a way to the
 <b>cluster</b> to be connected to the outside world. Internally,
@@ -323,7 +324,7 @@ There is an alternative organization, which is as follow :
 
 The principle is the same, except we don't have the backbone. The way
 to obtain it is simple : you just have to let bb_* attributes
-unsetted.
+unset.
 
 
 
@@ -347,11 +348,11 @@ unsetted.
 \li <b>sharing_policy</b>: sharing policy for the links between nodes
     and backbone (if any). See <b>link</b> section for syntax/details.     
 \li <b>bb_bw </b>: bandwidth for backbone (if any). See <b>link</b>
-    section for syntax/details. If both bb_* attributes are ommited,
+    section for syntax/details. If both bb_* attributes are omitted,
     no backbone is created (alternative cluster architecture described
     before). 
 \li <b>bb_lat </b>: latency for backbone (if any). See <b>link</b>
-    section for syntax/details. If both bb_* attributes are ommited,
+    section for syntax/details. If both bb_* attributes are omitted,
     no backbone is created (alternative cluster architecture described
     before).
 \li <b>bb_sharing_policy</b>: sharing policy for the backbone (if
@@ -391,11 +392,13 @@ A <b>peer</b> represents a peer, as in Peer-to-Peer (P2P). Basically,
 as cluster, <b>A PEER IS INTERNALLY INTERPRETED AS AN \<AS\></b>. It's
 just a kind of shortcut that does the following :
 
+\li It creates a tiny AS whose routing type is cluster
 \li It creates an host
 \li Two links : one for download and one for upload. This is
     convenient to use and simulate stuff under the last mile model (as
-    ADSL peers).  
-\li It creates a gateway that serve as entry point for this peer zone.
+    ADSL peers). 
+\li It connects the two links to the host
+\li It creates a router (a gateway) that serve as entry point for this peer zone.
     This router has coordinates.
 
 <b>peer</b> attributes :
@@ -414,6 +417,27 @@ just a kind of shortcut that does the following :
 \li <b>state_file </b>: state file for the peer. Same as host state
     file. See <b>host</b> description for details. 
 
+In term of XML, the <b>peer</b> construct can be explained as follows: it transforms
+\verbatim
+  <peer id="FOO"
+       coordinates="12.8 14.4 6.4"
+       power="1.5Gf"
+       bw_in="2.25GBps"
+       bw_out="2.25GBps"
+       lat="500us" />
+\endverbatim
+into
+\verbatim
+   <AS id="as_FOO" routing="Cluster">
+      <host id="peer_FOO" power="1.5Gf"/>
+      <link id="link_FOO_UP" bandwidth="2.25GBps" latency="500us"/>
+      <link id="link_FOO_DOWN" bandwidth="2.25GBps" latency="500us"/>
+      <router id="router_FOO" coordinates="25.5 9.4 1.4"/>
+      <host_link id="peer_FOO" up="link_FOO_UP" down="link_FOO_DOWN"/>
+   </AS>
+\endverbatim
+
+
 \subsection pf_ne Network equipments: links and routers
 
 You have basically two entities available to represent network entities:
@@ -620,12 +644,12 @@ resources tags. This should moved to attributes soon or later.
 In order to run fast, it has been chosen to use static routing within
 SimGrid. By static, it means that it is calculated once (or almost),
 and will not change during execution. We chose to do that because it
-is rare to have a real deficience of a resource ; most of the time, a
+is rare to have a real deficiency of a resource ; most of the time, a
 communication fails because the links are too overloaded, and so your
 connection stops before the time out, or because the computer at the
 other end is not answering.
 
-We also chose to use shortests paths algorithms in order to emulate
+We also chose to use shortest paths algorithms in order to emulate
 routing. Doing so is consistent with the reality: RIP, OSPF, BGP are
 all calculating shortest paths. They have some convergence time, but
 at the end, so when the platform is stable (and this should be the
@@ -747,12 +771,6 @@ DijsktraCache example :
 \subsubsection pf_rm_me Manually-entered route models
 
 \li <b>Full</b>: You have to enter all necessary routes manually
-\li <b>RuleBased</b>: Rule-Based routing data; same as Full except you
-    can use regexp to express route. As SimGrid has to evaluate the
-    regexp, it's slower than Full, but requires less memory. Regexp
-    syntax is similar as <a href="http://www.pcre.org">pcre</a> ones,
-    as this is the lib SimGrid use to do so.
-
 
 Full example :
 \verbatim
@@ -764,54 +782,6 @@ Full example :
  </AS>
 \endverbatim
 
-RuleBased example :
-\verbatim
-<AS id="AS_orsay" routing="RuleBased" >
-                       <cluster id="AS_gdx" prefix="gdx-" suffix=".orsay.grid5000.fr"
-                               radical="1-310" power="4.7153E9" bw="1.25E8" lat="1.0E-4"
-                               bb_bw="1.25E9" bb_lat="1.0E-4"></cluster>
-                       <link   id="link_gdx" bandwidth="1.25E9" latency="1.0E-4"/>
-
-                       <cluster id="AS_netgdx" prefix="netgdx-" suffix=".orsay.grid5000.fr"
-                               radical="1-30" power="4.7144E9" bw="1.25E8" lat="1.0E-4"
-                               bb_bw="1.25E9" bb_lat="1.0E-4"></cluster>
-                       <link   id="link_netgdx" bandwidth="1.25E9" latency="1.0E-4"/>
-
-                       <AS id="gw_AS_orsay" routing="Full">
-                               <router id="gw_orsay"/>
-                       </AS>
-                       <link   id="link_gw_orsay" bandwidth="1.25E9" latency="1.0E-4"/>
-
-                       <ASroute src="^AS_(.*)$" dst="^AS_(.*)$"
-                               gw_src="$1src-AS_$1src_router.orsay.grid5000.fr"
-                               gw_dst="$1dst-AS_$1dst_router.orsay.grid5000.fr"
-                               symmetrical="YES">
-                                       <link_ctn id="link_$1src"/>
-                                       <link_ctn id="link_$1dst"/>
-                       </ASroute>
-
-                       <ASroute src="^AS_(.*)$" dst="^gw_AS_(.*)$"
-                               gw_src="$1src-AS_$1src_router.orsay.grid5000.fr"
-                               gw_dst="gw_$1dst"
-                               symmetrical="NO">
-                                       <link_ctn id="link_$1src"/>
-                       </ASroute>
-
-                       <ASroute src="^gw_AS_(.*)$" dst="^AS_(.*)$"
-                               gw_src="gw_$1src"
-                               gw_dst="$1dst-AS_$1dst_router.orsay.grid5000.fr"
-                               symmetrical="NO">
-                                       <link_ctn id="link_$1dst"/>
-                       </ASroute>
-
-               </AS>
-\endverbatim
-
-The example upper contains $1src and $1dst. It's simply a reference to
-string matching regexp enclosed by "()" within respectively <b>src</b>
-and <b>dst</b> attributes. If they were more than 1 "()", then you
-could referer to it as $2src, $3src and so on.
-
 \subsubsection pf_rm_sf Simple/fast models
 
 \li <b>none</b>: No routing (Unless you know what you are doing, avoid
@@ -851,15 +821,15 @@ Consider the example below:
    </route>
 \endverbatim
 
-The route here fom host Alice to Bob will be first link1, then link2,
+The route here from host Alice to Bob will be first link1, then link2,
 and finally link3. What about the reverse route ? <b>route</b> and
 <b>ASroute</b> have an optional attribute <b>symmetrical</b>, that can
 be either YES or NO. YES means that the reverse route is the same
-route in the inverse order, and is setted to YES by default. Note that
+route in the inverse order, and is set to YES by default. Note that
 this is not the case for bypass*Route, as it is more probable that you
 want to bypass only one default route.
 
-For an ASroute, things are just sligthly more complicated, as you have
+For an ASroute, things are just slightly more complicated, as you have
 to give the id of the gateway which is inside the AS you're talking
 about you want to access ... So it looks like this :
 
@@ -891,7 +861,7 @@ a <b>link_ctn</b> is the tag that is used in order to reference a
 \subsubsection pf_asro ASroute
 
 ASroute tag purpose is to let people write manually their routes
-between AS. It's usefull when you're in Full or Rule-based model.
+between AS. It's useful when you're in Full model.
 
 <b>ASroute</b> attributes :
 \li <b>src (mandatory)</b>: the source AS id.
@@ -906,15 +876,6 @@ between AS. It's usefull when you're in Full or Rule-based model.
     will be the opposite of the one defined. Can be either YES or NO,
     default is YES.
 
-<b>Example of ASroute with RuleBased</b>
-\verbatim
-<ASroute src="^gw_AS_(.*)$" dst="^AS_(.*)$"
-                               gw_src="gw_$1src"
-                               gw_dst="$1dst-AS_$1dst_router.orsay.grid5000.fr"
-                               symmetrical="NO">
-                                       <link_ctn id="link_$1dst"/>
-                       </ASroute>
-\endverbatim
 <b>Example of ASroute with Full</b>
 \verbatim
 <AS  id="AS0"  routing="Full">
@@ -945,9 +906,9 @@ between AS. It's usefull when you're in Full or Rule-based model.
 The principle is the same as ASroute : <b>route</b> contains list of
 links that are in the path between src and dst, except that it is for
 routes between a src that can be either <b>host</b> or \b router and a
-dst that can be either <b>host</b> or \b router. Usefull for Full and
-RuleBased, as well as for the shortest-paths based models, where you
-have to give topological informations.
+dst that can be either <b>host</b> or \b router. Useful for Full 
+as well as for the shortest-paths based models, where you
+have to give topological information.
 
 
 <b>route</b> attributes :
@@ -1180,7 +1141,7 @@ and close tag in order to let it work.
 
 \subsection pf_tra trace and trace_connect
 Both tags are an alternate way to passe availability, state, and so on
-files to entity. Instead of refering to the file directly in the host,
+files to entity. Instead of referring to the file directly in the host,
 link, or cluster tag, you proceed by defining a trace with an id
 corresponding to a file, later an host/link/cluster, and finally using
 trace_connect you say that the file trace must be used by the entity.
@@ -1203,7 +1164,7 @@ All constraints you have is that <b>trace_connect</b> is after
     referring to it.
 \li <b>file</b>: filename of the file to include. Possible values :
     absolute or relative path, syntax similar to the one in use on
-    your system. If ommited, the system expects that you provide the
+    your system. If omitted, the system expects that you provide the
     trace values inside the trace tags (see below).
 \li <b>trace periodicity (mandatory)</b>: trace periodicity, same
     definition as in hosts (see upper for details).
@@ -1229,8 +1190,8 @@ Here is an example  of trace when no file name is provided:
 
 \section pf_hints Hints and tips, or how to write a platform efficiently
 
-Now you should know at least the syntax dans be able to create a
-platform. However, after having ourselves wrote some platforms, there
+Now you should know at least the syntax and be able to create a
+platform by your own. However, after having ourselves wrote some platforms, there
 are some best practices you should pay attention to in order to
 produce good platform and some choices you can make in order to have
 faster simulations. Here's some hints and tips, then.
@@ -1245,7 +1206,7 @@ only one host, then you'll also loose all the good AS hierarchy can
 give you. Remind you should always be "reasonable" in your platform
 definition when choosing the hierarchy. A good choice if you try to
 describe a real life platform is to follow the AS described in
-reality, since this kind og trade-off works well for real life
+reality, since this kind of trade-off works well for real life
 platforms.
 
 \subsection pf_exit_as Exit AS: why and how
@@ -1325,14 +1286,37 @@ complicated in using it, here is an example of it:
 \endverbatim
 
 Coordinates are then used to calculate latency between two hosts by
-calculating the euclidian distance between the two hosts coordinates.
+calculating the euclidean distance between the two hosts coordinates.
 The results express the latency in ms.
 
+Note that the previous example defines a routing directly between hosts but it could be also used to define a routing between AS.
+That is for example what is commonly done when using peers (see Section \ref pf_peer).
+\verbatim
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+<config id="General">
+       <prop id="network/coordinates" value="yes"></prop>
+</config>
+ <AS  id="AS0"  routing="Vivaldi">
+   <peer id="peer-0" coordinates="173.0 96.8 0.1" power="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us"/>
+   <peer id="peer-1" coordinates="247.0 57.3 0.6" power="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us" />
+   <peer id="peer-2" coordinates="243.4 58.8 1.4" power="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us" />
+</AS>
+</platform>
+\endverbatim
+In such a case though, we connect the AS created by the <b>peer</b> tag with the Vivaldi routing mechanism. 
+This means that to route between AS1 and AS2, it will use the coordinates of router_AS1 and router_AS2. 
+This is currently a convention and we may offer to change this convention in the DTD later if needed.
+You may have noted that conveniently, a peer named FOO defines an AS named FOO and a router named router_FOO, which is why it works seamlessly with the <b>peer</b> tag.
+
+
 \subsection pf_wisely Choosing wisely the routing model to use
 
 
 Choosing wisely the routing model to use can significantly fasten your
-simulation/save your time when writing the platform/save tremendeous
+simulation/save your time when writing the platform/save tremendous
 disk space. Here is the list of available model and their
 characteristics (lookup : time to resolve a route):
 
@@ -1350,18 +1334,15 @@ characteristics (lookup : time to resolve a route):
     routes.
 \li <b>none</b>: No routing (usable with Constant network only).
     Defines that there is no routes, so if you try to determine a
-    route without constant network within this AS, SimGrid will raie
+    route without constant network within this AS, SimGrid will raise
     an exception.
-\li <b>RuleBased</b>: Rule-Based routing data (fast initialisation,
-    relatively slow lookup, moderate memory requirements, fully
-    expressive): uses regexp to define routes;
 \li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates
 \li <b>Cluster</b>: Cluster routing, specific to cluster tag, should
     not be used. 
 
 \subsection pf_switch Hey, I want to describe a switch but there is no switch tag !
 
-Actually we did not include swith tag, ok. But when you're trying to
+Actually we did not include switch tag, ok. But when you're trying to
 simulate a switch, the only major impact it has when you're using
 fluid model (and SimGrid uses fluid model unless you activate GTNetS,
 ns-3, or constant network mode) is the impact of the upper limit of
index 418b103..3b2a827 100644 (file)
@@ -174,6 +174,33 @@ tracing/smpi/group
 --cfg=tracing/smpi/group:1
 \endverbatim
 
+\li <b>\c
+tracing/smpi/computing
+</b>:
+  This option only has effect if this simulator is SMPI-based. The parts external
+to SMPI are also outputted to the trace. Provides better way to analyze the data automatically.
+\verbatim
+--cfg=tracing/smpi/computing:1
+\endverbatim
+
+\li <b>\c
+tracing/smpi/internals
+</b>:
+  This option only has effect if this simulator is SMPI-based. Display internal communications
+happening during a collective MPI call.
+\verbatim
+--cfg=tracing/smpi/internals:1
+\endverbatim
+
+\li <b>\c
+tracing/smpi/display_sizes
+</b>:
+  This option only has effect if this simulator is SMPI-based. Display the sizes of the messages
+exchanged in the trace, both in the links and on the states. For collective, size means the global size of data sent by the process in general.
+\verbatim
+--cfg=tracing/smpi/display_sizes:1
+\endverbatim
+
 \li <b>\c
 tracing/msg/process
 </b>:
index 519d031..0311b6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index eb91232..8a7acff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f86a47d..98a5687 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ca2bee3..a51c9a9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 24456d6..35755cc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/doc/webcruft/smpi_simgrid_alltoall_pair_16.png b/doc/webcruft/smpi_simgrid_alltoall_pair_16.png
new file mode 100644 (file)
index 0000000..eeef46d
Binary files /dev/null and b/doc/webcruft/smpi_simgrid_alltoall_pair_16.png differ
diff --git a/doc/webcruft/smpi_simgrid_alltoall_ring_16.png b/doc/webcruft/smpi_simgrid_alltoall_ring_16.png
new file mode 100644 (file)
index 0000000..a988744
Binary files /dev/null and b/doc/webcruft/smpi_simgrid_alltoall_ring_16.png differ
index c3a35dc..7777767 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 359c804..9fa045c 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 6e62497..a4913a6 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 5f270cb..e39f041 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
@@ -12,11 +13,10 @@ import java.util.ArrayList;
 
 import org.simgrid.msg.Comm;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.Process;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Process;
 import org.simgrid.msg.Task;
-import org.simgrid.msg.Process;;
 
 public class Master extends Process {
        public Master(Host host, String name, String[]args) {
index ca06965..a4a651f 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2007, 2010, 2013. 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. 
@@ -8,13 +9,12 @@ package async;
 import org.simgrid.msg.Comm;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
+import org.simgrid.msg.Process;
 import org.simgrid.msg.Task;
 import org.simgrid.msg.TaskCancelledException;
 import org.simgrid.msg.TimeoutException;
 import org.simgrid.msg.TransferFailureException;
-import org.simgrid.msg.Process;
 
 public class Slave extends Process {
        public Slave(Host host, String name, String[]args) {
index 6625851..6083344 100644 (file)
@@ -1,7 +1,7 @@
 #! tesh
 
 ! output sort
-
+! timeout 30
 $ java -cp ${classpath:=.} async/AsyncTest ${srcdir:=.}/platform.xml ${srcdir:=.}/async/asyncDeployment.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (10:async.Slave@Robert) Receiving on 'slave_8'
 > [  0.000000] (11:async.Slave@Sirois) Receiving on 'slave_9'
index 0d946f3..5685bd9 100644 (file)
@@ -1,5 +1,6 @@
 /**
-* Copyright 2012 The SimGrid team. All right reserved. 
+* Copyright (c) 2012-2013. 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 
index 3817db9..7e78b5a 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index f0a3339..29a3011 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
@@ -7,7 +8,6 @@
 package bittorrent;
 
 import java.util.Arrays;
-import org.simgrid.msg.Msg;
 public class Connection {
        /**
         * Remote peer id
index 2ea0751..88c04c7 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 47b300f..f1f10c1 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
@@ -8,7 +9,6 @@ package bittorrent;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map.Entry;
 
@@ -16,12 +16,10 @@ import org.simgrid.msg.Comm;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
-import org.simgrid.msg.RngStream;
 import org.simgrid.msg.Process;
+import org.simgrid.msg.RngStream;
 import org.simgrid.msg.Task;
 
-import bittorrent.Connection;
-
 /**
  * Main class for peers execution
  */
@@ -484,8 +482,7 @@ public class Peer extends Process {
                                                peerChoosed = null;
                                        }
                                        j++;
-                               } while (peerChoosed == null && j < 
-       Common.MAXIMUM_PEERS);
+                               } while (peerChoosed == null && j < Common.MAXIMUM_PEERS);
                        }
                        else {
                                Connection fastest = null;
index d41bafd..1a812b6 100644 (file)
@@ -1,21 +1,20 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
  */
 package bittorrent;
 import java.util.ArrayList;
-import java.util.Iterator;
 
 import org.simgrid.msg.Comm;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.Process;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Task;
-
+import org.simgrid.msg.Process;
 import org.simgrid.msg.RngStream;
+import org.simgrid.msg.Task;
 /**
  * Tracker, handle requests from peers.
  */
index 9c0552d..4b06649 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 398058f..36038a1 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 9c6c785..aac5083 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 0348460..6531dc0 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 64e49cd..f0d2c94 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 8708469..51c2310 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index c3d1724..3c58bc1 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index f170188..a3b0c0c 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index f28383f..64db0e5 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 670da59..84094ca 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 1edb24b..3e64460 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index c7b5c54..ffaf4b9 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index 1551521..8710bfb 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index 01e646f..4d9963e 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index afcc18e..ba64851 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2012 The SimGrid Team. All right reserved. 
+ * Copyright (c) 2006-2013. The SimGrid Team. All right 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. 
index 7819b49..d0e3f32 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index dda4718..9dc9772 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
 package commTime;
 
 import org.simgrid.msg.Host;
-import org.simgrid.msg.HostNotFoundException;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Task;
 import org.simgrid.msg.Process;
+import org.simgrid.msg.Task;
 
 public class Master extends Process {
        public Master(Host host, String name, String[]args) {
index 0df92c1..bb81c9f 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 158231c..9373f50 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 04581f3..cd6e635 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 739e18b..576d273 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b4c1063..ac0ba9e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1f56a97..ab85b3a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 39e7941..b5bfa97 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c0b8c60..567987b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a073232..17c5d42 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 486b788..447ff8d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3f83893..097b6a8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 84fcccf..38c02a1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a119aaa..815d1d0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6bbbfbb..77085c5 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index e411e1d..ea894d8 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 035b046..3a61208 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index a66a80d..c342df4 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index c2d7bfa..8b5daa3 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 783e9a1..82c8a9d 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 267dedd..cb54fa1 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index e52dd93..630c25b 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
@@ -27,9 +28,8 @@ public class Slave extends Process {
        Msg.info("Send Mail1!");
        task.send("mail1");
        
-       Task task2;
         try {
-                task2 = Task.receive("mail2");
+                Task.receive("mail2");
         } catch (MsgException e) {
                 Msg.debug("Received failed");
                 return;
index 8c636f1..fc4d97b 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 4c8f102..12a9f83 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 9d23ba0..94e00f5 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 128e753..b91c178 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
+ * under the terms of the license (GNU LGPL) which comes with this package.
  */
 
 package masterslave;
 
+import java.io.File;
+
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.NativeException;
 
 public class Masterslave {
    public static final int TASK_COMP_SIZE = 10000000;
    public static final int TASK_COMM_SIZE = 10000000;
-   /* This only contains the launcher. If you do nothing more than than you can run 
+   /* This only contains the launcher. If you do nothing more than than you can run
     *   java simgrid.msg.Msg
     * which also contains such a launcher
     */
-   
-    public static void main(String[] args) throws NativeException {       
-           /* initialize the MSG simulation. Must be done before anything else (even logging). */
-           Msg.init(args);
-       
-           if (args.length < 2) {              
-                       Msg.info("Usage   : Masterslave platform_file deployment_file");
-                       Msg.info("example : Masterslave basic_platform.xml basic_deployment.xml");
-                       System.exit(1); 
-               }
-               /* construct the platform and deploy the application */
-               Msg.createEnvironment(args[0]);
-               Msg.deployApplication(args[1]);
-               /*  execute the simulation. */
+
+    public static void main(String[] args) throws NativeException {
+        /* initialize the MSG simulation. Must be done before anything else (even logging). */
+        Msg.init(args);
+
+        String platf  = args.length > 1 ? args[0] : "examples/java/platform.xml";
+        String deploy =  args.length > 1 ? args[1] : "examples/java/masterslave/masterslaveDeployment.xml";
+
+        Msg.verb("Platform: "+platf+"; Deployment:"+deploy+"; Current directory: "+new File(".").getAbsolutePath());
+
+        /* construct the platform and deploy the application */
+        Msg.createEnvironment(platf);
+        Msg.deployApplication(deploy);
+        /*  execute the simulation. */
         Msg.run();
     }
 }
index f782195..e3e4f08 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 3e01db3..3dd8d97 100644 (file)
@@ -9,7 +9,6 @@ package migration;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.MsgException;
-import org.simgrid.msg.Task;
 import org.simgrid.msg.Process;
 
 public class Policeman extends Process {
index ad62a60..44fc41b 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. 
  */
 
-package mutualExclusion.centralized;
+package mutualExclusion;
 import java.util.LinkedList;
 
 import org.simgrid.msg.Host;
index e9bdda0..60d59e2 100644 (file)
@@ -4,7 +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. 
  */
-package mutualExclusion.centralized;
+package mutualExclusion;
 import org.simgrid.msg.Task;
 
 
index 0ed4d54..e368c3a 100644 (file)
@@ -4,13 +4,11 @@
  * 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. 
  */
-package mutualExclusion.centralized;
+package mutualExclusion;
 
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.NativeException;
 
-import org.simgrid.msg.*;
-
 public class MutexCentral {
 
        /* This only contains the launcher. If you do nothing more than than you can run 
index 4dfa77a..b316367 100644 (file)
@@ -4,7 +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. 
  */
-package mutualExclusion.centralized;
+package mutualExclusion;
 
 import org.simgrid.msg.Host;
 import org.simgrid.msg.Msg;
index a33bf24..46db893 100644 (file)
@@ -4,6 +4,6 @@
  * 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. 
  */
-package mutualExclusion.centralized;
+package mutualExclusion;
 public class ReleaseTask extends org.simgrid.msg.Task {
 }
index 4615509..d9d9721 100644 (file)
@@ -4,7 +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. 
  */
-package mutualExclusion.centralized;
+package mutualExclusion;
 import org.simgrid.msg.Task;
 
 public class RequestTask extends Task {
index 300dfa8..58b1c5e 100644 (file)
@@ -1,14 +1,14 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
-  <process host="Host 0" function="mutualExclusion.centralized.Coordinator">
+  <process host="Host 0" function="mutualExclusion.Coordinator">
       <argument value="2"/> <!-- Amount of CS to serve -->
   </process>
-  <process host="Host 1" function="mutualExclusion.centralized.Node">
+  <process host="Host 1" function="mutualExclusion.Node">
       <argument value="2"/> <!-- initial sleep time -->
       <argument value="5"/> <!-- CS time -->
   </process>
-  <process host="Host 2" function="mutualExclusion.centralized.Node">
+  <process host="Host 2" function="mutualExclusion.Node">
       <argument value="2"/> <!-- initial sleep time -->
       <argument value="5"/> <!-- CS time -->
   </process>
index 944d916..202b00c 100644 (file)
@@ -2,13 +2,13 @@
 
 ! output sort
 
-$ java -cp ${classpath:=.} mutualExclusion/centralized/MutexCentral ${srcdir:=.}/mutualExclusion/ring3.xml ${srcdir:=.}/mutualExclusion/mutex_centralized_deployment.xml
+$ java -cp ${classpath:=.} mutualExclusion/MutexCentral ${srcdir:=.}/mutualExclusion/ring3.xml ${srcdir:=.}/mutualExclusion/mutex_centralized_deployment.xml
 > [0.000000] [jmsg/INFO] Using regular java threads. Coroutines could speed your simulation up.
 > [0.007806] [jmsg/INFO] MSG_main finished; Cleaning up the simulation...
-> [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.001301] [jmsg/INFO] Got a request from mutualExclusion.centralized.Node. Queue empty: grant it
-> [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.003903] [jmsg/INFO] Got a request from mutualExclusion.centralized.Node. Queue empty: grant it
-> [Host 0:mutualExclusion.centralized.Coordinator:(1) 0.007806] [jmsg/INFO] we should shutdown the simulation now
-> [Host 1:mutualExclusion.centralized.Node:(2) 0.000000] [jmsg/INFO] Send a request to the coordinator
-> [Host 1:mutualExclusion.centralized.Node:(2) 0.001301] [jmsg/INFO] Wait for a grant from the coordinator
-> [Host 2:mutualExclusion.centralized.Node:(3) 0.000000] [jmsg/INFO] Send a request to the coordinator
-> [Host 2:mutualExclusion.centralized.Node:(3) 0.003903] [jmsg/INFO] Wait for a grant from the coordinator
+> [Host 0:mutualExclusion.Coordinator:(1) 0.001301] [jmsg/INFO] Got a request from mutualExclusion.Node. Queue empty: grant it
+> [Host 0:mutualExclusion.Coordinator:(1) 0.003903] [jmsg/INFO] Got a request from mutualExclusion.Node. Queue empty: grant it
+> [Host 0:mutualExclusion.Coordinator:(1) 0.007806] [jmsg/INFO] we should shutdown the simulation now
+> [Host 1:mutualExclusion.Node:(2) 0.000000] [jmsg/INFO] Send a request to the coordinator
+> [Host 1:mutualExclusion.Node:(2) 0.001301] [jmsg/INFO] Wait for a grant from the coordinator
+> [Host 2:mutualExclusion.Node:(3) 0.000000] [jmsg/INFO] Send a request to the coordinator
+> [Host 2:mutualExclusion.Node:(3) 0.003903] [jmsg/INFO] Wait for a grant from the coordinator
index a61700b..5acc673 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 8a31a93..39f7d38 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 5454ba4..e553e2a 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index f2cf7ab..a39430a 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 1b57e43..99f0aac 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index eb04346..47b2c8f 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
@@ -7,11 +8,10 @@
 package startKillTime;
 import org.simgrid.msg.Host;
 import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.TransferFailureException;
-import org.simgrid.msg.TimeoutException;
 import org.simgrid.msg.Msg;
 import org.simgrid.msg.Process;
+import org.simgrid.msg.TimeoutException;
+import org.simgrid.msg.TransferFailureException;
 
 
 public class Master extends Process {
index e9942f0..5978e70 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
  */
 package startKillTime;
 import org.simgrid.msg.Host;
-import org.simgrid.msg.MsgException;
 import org.simgrid.msg.HostFailureException;
-import org.simgrid.msg.HostNotFoundException;
-import org.simgrid.msg.TransferFailureException;
-import org.simgrid.msg.TimeoutException;
 import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
 import org.simgrid.msg.Process;
+import org.simgrid.msg.TimeoutException;
+import org.simgrid.msg.TransferFailureException;
 
 /**
  * Lazy Guy Slave, suspends itself ASAP
index 5a16670..3a2999c 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 3fbc4b9..a27be09 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 627cc36..6a8b17c 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index ae106f3..ec31e22 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 8e2224c..0c3fbd8 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 09da519..3383695 100644 (file)
@@ -2,8 +2,8 @@
  * $Id$
  *
  * Copyright 2006,2007 Martin Quinson, Malek Cherier         
- * Copyright 2012 The SimGrid Team. All rights reserved. 
- * All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index 413cde2..30d0dc3 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Sender of basic ping/pong example
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 380b0a8..6205296 100644 (file)
@@ -2,8 +2,8 @@
  * $Id$
  *
  * Copyright 2006,2007 Martin Quinson, Malek Cherier         
- * Copyright 2012 The SimGrid team         
- * All rights reserved. 
+ * Copyright (c) 2012-2013. 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. 
index 25baa9a..edb9037 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -108,7 +108,7 @@ static void action_send(const char *const *action)
 
   sprintf(to, "%s_%s", MSG_process_get_name(MSG_process_self()), action[2]);
 
-  ACT_DEBUG("Entering Send: %s (size: %lg)", NAME, size);
+  ACT_DEBUG("Entering Send: %s (size: %g)", NAME, size);
   if (size < 65536) {
     action_Isend(action);
   } else {
@@ -437,8 +437,8 @@ static void action_comm_size(const char *const *action)
 
 static void action_compute(const char *const *action)
 {
-  const char *amout = action[2];
-  msg_task_t task = MSG_task_create("task", parse_double(amout), 0, NULL);
+  const char *amount = action[2];
+  msg_task_t task = MSG_task_create("task", parse_double(amount), 0, NULL);
   double clock = MSG_get_clock();
 
   ACT_DEBUG("Entering %s", NAME);
index d6fd85d..741cd2c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2cad1e4..7401336 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8fac6a1..bb9045d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. 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. */
@@ -30,8 +30,9 @@ void promoter(context_node_t node)
     host_parameters.id = NULL;
 
     //Power from 3,000,000 to 10,000,000
-    host_parameters.power_peak =
-        7000000 * RngStream_RandU01(rng_stream) + 3000000;
+    host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL);
+    xbt_dynar_push_as(host_parameters.power_peak, double,
+               7000000 * RngStream_RandU01(rng_stream) + 3000000.0);
     host_parameters.core_amount = 1;
     host_parameters.power_scale = 1;
     host_parameters.power_trace = NULL;
index 725bda1..0378f4a 100644 (file)
@@ -1,4 +1,4 @@
-  /* Copyright (c) 2012. The SimGrid Team.
+  /* Copyright (c) 2012-2013. The SimGrid Team.
    * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 95cfbbf..2d30008 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fae73a7..cd7cd4c 100644 (file)
@@ -1,4 +1,4 @@
-  /* Copyright (c) 2012. The SimGrid Team.
+  /* Copyright (c) 2012-2013. The SimGrid Team.
    * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6f191a4..4357729 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fc3e27f..2ea4729 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b3d003b..3955438 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@ typedef struct s_peer {
 
   xbt_dict_t peers;             //peers list
   xbt_dict_t active_peers;      //active peers list
-  int round;                    //current round for the chocking algortihm.
+  int round;                    //current round for the chocking algorithm.
 
 
   char mailbox[MAILBOX_SIZE];   //peer mailbox.
index 169b5d6..b45d464 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b8752ad..5acc231 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 934e14a..507167a 100644 (file)
@@ -5,13 +5,11 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_broadcaster,
 
 xbt_dynar_t build_hostlist_from_hostcount(int hostcount)
 {
-  xbt_dynar_t host_list = xbt_dynar_new(sizeof(char*), NULL);
-  char *hostname = NULL;
-  int i = 1;
+  xbt_dynar_t host_list = xbt_dynar_new(sizeof(char*), xbt_free_ref);
+  int i;
   
-  for (; i < hostcount+1; i++) {
-    hostname = xbt_new(char, HOSTNAME_LENGTH);
-    snprintf(hostname, HOSTNAME_LENGTH, "host%d", i);
+  for (i = 1; i <= hostcount; i++) {
+    char *hostname = bprintf("host%d", i);
     XBT_DEBUG("%s", hostname);
     xbt_dynar_push(host_list, &hostname);
   }
@@ -48,7 +46,7 @@ int broadcaster_build_chain(broadcaster_t bc)
       XBT_DEBUG("Building chain -- broadcaster:\"%s\" dest:\"%s\" prev:\"%s\" next:\"%s\"", me, current_host, prev, next);
     
       /* Send message to current peer */
-      task = task_message_chain_new(me, current_host, prev, next, bc->piece_count);
+      task = task_message_chain_new(prev, next, bc->piece_count);
       MSG_task_send(task, current_host);
 
       last = current_host;
@@ -67,7 +65,7 @@ int broadcaster_send_file(broadcaster_t bc)
   bc->current_piece = 0;
 
   while (bc->current_piece < bc->piece_count) {
-    task = task_message_data_new(me, bc->first, NULL, PIECE_SIZE);
+    task = task_message_data_new(NULL, PIECE_SIZE);
     XBT_DEBUG("Sending (send) piece %d from %s into mailbox %s", bc->current_piece, me, bc->first);
     MSG_task_send(task, bc->first);
     bc->current_piece++;
index ae6f7d3..06e7bea 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012. The SimGrid Team.
  * Copyright (c) 2012. Maximiliano Geier.
  * All rights reserved.                                                     */
 
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
 
   res = test_all(argv[1], argv[2]);
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
 #ifdef _MSC_VER
   _set_output_format(prev_exponent_format);
index eaf2de1..e28e098 100644 (file)
@@ -11,7 +11,4 @@ static XBT_INLINE void queue_pending_connection(msg_comm_t comm, xbt_dynar_t q)
 
 int process_pending_connections(xbt_dynar_t q);
 
-#define MESSAGE_SIZE 1
-#define HOSTNAME_LENGTH 20
-
 #endif /* KADEPLOY_COMMON_H */
index c91243c..253cdf7 100644 (file)
@@ -1,30 +1,30 @@
 #include "messages.h"
 
-msg_task_t task_message_new(e_message_type type, unsigned int len, const char *issuer_hostname, const char *mailbox)
+msg_task_t task_message_new(e_message_type type, unsigned int len)
 {
   message_t msg = xbt_new(s_message_t, 1);
   msg->type = type;
-  msg->issuer_hostname = issuer_hostname;
-  msg->mailbox = mailbox;
+  msg->prev_hostname = NULL;
+  msg->next_hostname = NULL;
   msg_task_t task = MSG_task_create(NULL, 0, len, msg);
 
   return task;
 }
 
-msg_task_t task_message_chain_new(const char *issuer_hostname, const char *mailbox, const char* prev, const char *next, const unsigned int num_pieces)
+msg_task_t task_message_chain_new(const char* prev, const char *next, const unsigned int num_pieces)
 {
-  msg_task_t task = task_message_new(MESSAGE_BUILD_CHAIN, MESSAGE_BUILD_CHAIN_SIZE, issuer_hostname, mailbox);
+  msg_task_t task = task_message_new(MESSAGE_BUILD_CHAIN, MESSAGE_BUILD_CHAIN_SIZE);
   message_t msg = MSG_task_get_data(task);
-  msg->prev_hostname = prev;
-  msg->next_hostname = next;
+  msg->prev_hostname = xbt_strdup(prev);
+  msg->next_hostname = xbt_strdup(next);
   msg->num_pieces = num_pieces;
 
   return task;
 }
 
-msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len)
+msg_task_t task_message_data_new(const char *block, unsigned int len)
 {
-  msg_task_t task = task_message_new(MESSAGE_SEND_DATA, MESSAGE_SEND_DATA_HEADER_SIZE + len, issuer_hostname, mailbox);
+  msg_task_t task = task_message_new(MESSAGE_SEND_DATA, MESSAGE_SEND_DATA_HEADER_SIZE + len);
   message_t msg = MSG_task_get_data(task);
   msg->data_block = block;
   msg->data_length = len;
index 7118d29..ef1f25c 100644 (file)
@@ -17,19 +17,17 @@ typedef enum {
 /* Message struct */
 typedef struct s_message {
   e_message_type type;
-  const char *issuer_hostname;
-  const char *mailbox;
-  const char *prev_hostname;
-  const char *next_hostname;
+  char *prev_hostname;
+  char *next_hostname;
   const char *data_block;
   unsigned int data_length;
   unsigned int num_pieces;
 } s_message_t, *message_t;
 
 /* Message methods */
-msg_task_t task_message_new(e_message_type type, unsigned int len, const char *issuer_hostname, const char *mailbox);
-msg_task_t task_message_chain_new(const char *issuer_hostname, const char *mailbox, const char* prev, const char *next, const unsigned int num_pieces);
-msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len);
+msg_task_t task_message_new(e_message_type type, unsigned int len);
+msg_task_t task_message_chain_new(const char* prev, const char *next, const unsigned int num_pieces);
+msg_task_t task_message_data_new(const char *block, unsigned int len);
 void task_message_delete(void *);
 
 #endif /* KADEPLOY_MESSAGES_H */
index 9275175..1b76e50 100644 (file)
@@ -17,7 +17,7 @@ void peer_init_chain(peer_t peer, message_t msg)
 
 static void peer_forward_msg(peer_t peer, message_t msg)
 {
-  msg_task_t task = task_message_data_new(peer->me, peer->next, NULL, msg->data_length);
+  msg_task_t task = task_message_data_new(NULL, msg->data_length);
   msg_comm_t comm = NULL;
   XBT_DEBUG("Sending (isend) from %s into mailbox %s", peer->me, peer->next);
   comm = MSG_task_isend(task, peer->next);
@@ -93,12 +93,11 @@ void peer_init(peer_t p, int argc, char *argv[])
   p->bytes = 0;
   p->pending_recvs = xbt_dynar_new(sizeof(msg_comm_t), NULL);
   p->pending_sends = xbt_dynar_new(sizeof(msg_comm_t), NULL);
-  p->me = xbt_new(char, HOSTNAME_LENGTH);
   /* Set mailbox name: use host number from argv or hostname if no argument given */
   if (argc > 1) {
-    snprintf(p->me, HOSTNAME_LENGTH, "host%s", argv[1]);
+    p->me = bprintf("host%s", argv[1]);
   } else {
-    strncpy(p->me, MSG_host_get_name(MSG_host_self()), HOSTNAME_LENGTH);
+    p->me = xbt_strdup(MSG_host_get_name(MSG_host_self()));
   }
 }
 
@@ -127,6 +126,8 @@ void peer_delete(peer_t p)
   xbt_dynar_free(&p->pending_recvs);
   xbt_dynar_free(&p->pending_sends);
   xbt_free(p->me);
+  xbt_free(p->prev);
+  xbt_free(p->next);
 
   xbt_free(p);
 }
index fd20eca..8ee42f7 100644 (file)
@@ -12,8 +12,8 @@
 /* Peer struct */
 typedef struct s_peer {
   int init;
-  const char *prev;
-  const char *next;
+  char *prev;
+  char *next;
   char *me;
   int pieces;
   unsigned long long bytes;
index ca921a7..9e92363 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,6 +10,7 @@
 #include "xbt/log.h"
 #include "xbt/asserts.h"
 #include "simgrid/modelchecker.h"
+#include <xbt/RngStream.h>
 
 /** @addtogroup MSG_examples
  *
@@ -21,7 +22,7 @@
  */
 
  
- XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chord,
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_chord,
                              "Messages specific for this msg example");
 
 #define COMM_SIZE 10
@@ -59,6 +60,7 @@ typedef struct s_node {
   int next_finger_to_fix;                 // index of the next finger to fix in fix_fingers()
   msg_comm_t comm_receive;                // current communication to receive
   double last_change_date;                // last time I changed a finger or my predecessor
+  RngStream stream;                       //RngStream for
 } s_node_t, *node_t;
 
 /**
@@ -71,7 +73,9 @@ typedef enum {
   TASK_GET_PREDECESSOR_ANSWER,
   TASK_NOTIFY,
   TASK_SUCCESSOR_LEAVING,
-  TASK_PREDECESSOR_LEAVING
+  TASK_PREDECESSOR_LEAVING,
+  TASK_PREDECESSOR_ALIVE,
+  TASK_PREDECESSOR_ALIVE_ANSWER  
 } e_task_type_t;
 
 /*
@@ -289,6 +293,12 @@ int node(int argc, char *argv[])
   double next_check_predecessor_date = init_time + periodic_check_predecessor_delay;
   double next_lookup_date = init_time + periodic_lookup_delay;
 
+  #ifdef HAVE_MC
+  int listen = 0;
+  int no_op = 0;
+  int sub_protocol = 0;
+  #endif
+
   xbt_assert(argc == 3 || argc == 5, "Wrong number of arguments for this node");
 
   // initialize my node
@@ -335,67 +345,68 @@ int node(int argc, char *argv[])
         // FIXME: do not make MSG_task_irecv() calls from several functions
       }
 
+      //XBT_INFO("Node %d is ring member : %d", node.id, is_ring_member(known_id, node.id) != -1);
+
       if (!MSG_comm_test(node.comm_receive)) {
 
         // no task was received: make some periodic calls
 
-        #ifdef HAVE_MC
-          if(MC_is_active()){
-            if(MC_random()){
+#ifdef HAVE_MC
+        if(MC_is_active()){
+          if(!MC_visited_reduction() && no_op){
+              MC_cut();
+          }
+          if(listen == 0 && (sub_protocol = MC_random(0, 4)) > 0){
+            if(sub_protocol == 1)
               stabilize(&node);
-            }else if(MC_random()){
+            else if(sub_protocol == 2)
               fix_fingers(&node);
-            }else if(MC_random()){
+            else if(sub_protocol == 3)
               check_predecessor(&node);
-            }else if(MC_random()){
+            else
               random_lookup(&node);
-            }else{
-              MSG_process_sleep(5);
-            }
+            listen = 1;
           }else{
-            if (MSG_get_clock() >= next_stabilize_date) {
-              stabilize(&node);
-              next_stabilize_date = MSG_get_clock() + periodic_stabilize_delay;
-            }
-            else if (MSG_get_clock() >= next_fix_fingers_date) {
-              fix_fingers(&node);
-              next_fix_fingers_date = MSG_get_clock() + periodic_fix_fingers_delay;
-            }
-            else if (MSG_get_clock() >= next_check_predecessor_date) {
-              check_predecessor(&node);
-              next_check_predecessor_date = MSG_get_clock() + periodic_check_predecessor_delay;
-            }
-            else if (MSG_get_clock() >= next_lookup_date) {
-              random_lookup(&node);
-              next_lookup_date = MSG_get_clock() + periodic_lookup_delay;
-            }
-            else {
-              // nothing to do: sleep for a while
-              MSG_process_sleep(5);
-            }
+            MSG_process_sleep(5);
+            if(!MC_visited_reduction())
+              no_op = 1;
           }
-        #else
+        }else{
           if (MSG_get_clock() >= next_stabilize_date) {
             stabilize(&node);
             next_stabilize_date = MSG_get_clock() + periodic_stabilize_delay;
-          }
-          else if (MSG_get_clock() >= next_fix_fingers_date) {
+          }else if (MSG_get_clock() >= next_fix_fingers_date) {
             fix_fingers(&node);
             next_fix_fingers_date = MSG_get_clock() + periodic_fix_fingers_delay;
-          }
-          else if (MSG_get_clock() >= next_check_predecessor_date) {
+          }else if (MSG_get_clock() >= next_check_predecessor_date) {
             check_predecessor(&node);
             next_check_predecessor_date = MSG_get_clock() + periodic_check_predecessor_delay;
-          }
-          else if (MSG_get_clock() >= next_lookup_date) {
+          }else if (MSG_get_clock() >= next_lookup_date) {
             random_lookup(&node);
             next_lookup_date = MSG_get_clock() + periodic_lookup_delay;
-          }
-          else {
+          }else {
             // nothing to do: sleep for a while
             MSG_process_sleep(5);
           }
-        #endif
+        }
+#else
+        if (MSG_get_clock() >= next_stabilize_date) {
+          stabilize(&node);
+          next_stabilize_date = MSG_get_clock() + periodic_stabilize_delay;
+        }else if (MSG_get_clock() >= next_fix_fingers_date) {
+          fix_fingers(&node);
+          next_fix_fingers_date = MSG_get_clock() + periodic_fix_fingers_delay;
+        }else if (MSG_get_clock() >= next_check_predecessor_date) {
+          check_predecessor(&node);
+          next_check_predecessor_date = MSG_get_clock() + periodic_check_predecessor_delay;
+        }else if (MSG_get_clock() >= next_lookup_date) {
+          random_lookup(&node);
+          next_lookup_date = MSG_get_clock() + periodic_lookup_delay;
+        }else {
+          // nothing to do: sleep for a while
+          MSG_process_sleep(5);
+        }
+#endif
 
       } else {
         // a transfer has occurred
@@ -445,74 +456,85 @@ static void handle_task(node_t node, msg_task_t task) {
 
   switch (type) {
 
-    case TASK_FIND_SUCCESSOR:
-      XBT_DEBUG("Receiving a 'Find Successor' request from %s for id %d",
-          task_data->issuer_host_name, task_data->request_id);
-      // is my successor the successor?
-      if (is_in_interval(task_data->request_id, node->id + 1, node->fingers[0].id)) {
-        task_data->type = TASK_FIND_SUCCESSOR_ANSWER;
-        task_data->answer_id = node->fingers[0].id;
-        XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
-            task_data->issuer_host_name,
-            task_data->answer_to,
-            task_data->request_id, task_data->answer_id);
-        MSG_task_dsend(task, task_data->answer_to, task_free);
-      }
-      else {
-        // otherwise, forward the request to the closest preceding finger in my table
-        int closest = closest_preceding_node(node, task_data->request_id);
-        XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
-            task_data->request_id, closest);
-        get_mailbox(closest, mailbox);
-        MSG_task_dsend(task, mailbox, task_free);
-      }
-      break;
-
-    case TASK_GET_PREDECESSOR:
-      XBT_DEBUG("Receiving a 'Get Predecessor' request from %s", task_data->issuer_host_name);
-      task_data->type = TASK_GET_PREDECESSOR_ANSWER;
-      task_data->answer_id = node->pred_id;
-      XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
-          task_data->issuer_host_name,
-          task_data->answer_to, task_data->answer_id);
+  case TASK_FIND_SUCCESSOR:
+    XBT_DEBUG("Receiving a 'Find Successor' request from %s for id %d",
+              task_data->issuer_host_name, task_data->request_id);
+    // is my successor the successor?
+    if (is_in_interval(task_data->request_id, node->id + 1, node->fingers[0].id)) {
+      task_data->type = TASK_FIND_SUCCESSOR_ANSWER;
+      task_data->answer_id = node->fingers[0].id;
+      XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
+                task_data->issuer_host_name,
+                task_data->answer_to,
+                task_data->request_id, task_data->answer_id);
       MSG_task_dsend(task, task_data->answer_to, task_free);
-      break;
-
-    case TASK_NOTIFY:
-      // someone is telling me that he may be my new predecessor
-      XBT_DEBUG("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
-      notify(node, task_data->request_id);
-      task_free(task);
-      break;
-
-    case TASK_PREDECESSOR_LEAVING:
-      // my predecessor is about to quit
-      XBT_DEBUG("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
-      // modify my predecessor
-      set_predecessor(node, task_data->request_id);
-      task_free(task);
-      /*TODO :
+    }
+    else {
+      // otherwise, forward the request to the closest preceding finger in my table
+      int closest = closest_preceding_node(node, task_data->request_id);
+      XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
+                task_data->request_id, closest);
+      get_mailbox(closest, mailbox);
+      MSG_task_dsend(task, mailbox, task_free);
+    }
+    break;
+
+  case TASK_GET_PREDECESSOR:
+    XBT_DEBUG("Receiving a 'Get Predecessor' request from %s", task_data->issuer_host_name);
+    task_data->type = TASK_GET_PREDECESSOR_ANSWER;
+    task_data->answer_id = node->pred_id;
+    XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
+              task_data->issuer_host_name,
+              task_data->answer_to, task_data->answer_id);
+    MSG_task_dsend(task, task_data->answer_to, task_free);
+    break;
+
+  case TASK_NOTIFY:
+    // someone is telling me that he may be my new predecessor
+    XBT_DEBUG("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
+    notify(node, task_data->request_id);
+    task_free(task);
+    break;
+
+  case TASK_PREDECESSOR_LEAVING:
+    // my predecessor is about to quit
+    XBT_DEBUG("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
+    // modify my predecessor
+    set_predecessor(node, task_data->request_id);
+    task_free(task);
+    /*TODO :
       >> notify my new predecessor
       >> send a notify_predecessors !!
-       */
-      break;
-
-    case TASK_SUCCESSOR_LEAVING:
-      // my successor is about to quit
-      XBT_DEBUG("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
-      // modify my successor FIXME : this should be implicit ?
-      set_finger(node, 0, task_data->request_id);
-      task_free(task);
-      /* TODO
-      >> notify my new successor
-      >> update my table & predecessors table */
-      break;
-
-    case TASK_FIND_SUCCESSOR_ANSWER:
-    case TASK_GET_PREDECESSOR_ANSWER:
-      XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
-      task_free(task);
-      break;
+    */
+    break;
+
+  case TASK_SUCCESSOR_LEAVING:
+    // my successor is about to quit
+    XBT_DEBUG("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
+    // modify my successor FIXME : this should be implicit ?
+    set_finger(node, 0, task_data->request_id);
+    task_free(task);
+    /* TODO
+       >> notify my new successor
+       >> update my table & predecessors table */
+    break;
+
+  case TASK_FIND_SUCCESSOR_ANSWER:
+  case TASK_GET_PREDECESSOR_ANSWER:
+  case TASK_PREDECESSOR_ALIVE_ANSWER:
+    XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
+    task_free(task);
+    break;
+
+  case TASK_PREDECESSOR_ALIVE:
+    XBT_DEBUG("Receiving a 'Predecessor Alive' request from %s", task_data->issuer_host_name);
+    task_data->type = TASK_PREDECESSOR_ALIVE_ANSWER;
+    XBT_DEBUG("Sending back a 'Predecessor Alive Answer' to %s (mailbox %s)",
+              task_data->issuer_host_name,
+              task_data->answer_to);
+    MSG_task_dsend(task, task_data->answer_to, task_free);
+    break;
+
   }
 }
 
@@ -566,9 +588,10 @@ static void leave(node_t node)
 {
   XBT_DEBUG("Well Guys! I Think it's time for me to quit ;)");
   quit_notify(node);
+  RngStream_DeleteStream(&node->stream);
 }
 
-/*
+/**
  * \brief Notifies the successor and the predecessor of the current node
  * of the departure
  * \param node the current node
@@ -585,7 +608,12 @@ static void quit_notify(node_t node)
 
   msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
   XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d",node->fingers[0].id);
-  MSG_task_send_with_timeout(task_sent, node->fingers[0].mailbox, timeout);
+  if (MSG_task_send_with_timeout(task_sent, node->fingers[0].mailbox, timeout)==
+      MSG_TIMEOUT) {
+    XBT_DEBUG("Timeout expired when sending a 'PREDECESSOR_LEAVING' to my successor %d",
+        node->fingers[0].id);
+    task_free(task_sent);
+  }
 
   //send the SUCCESSOR_LEAVING to our predecessor
   get_mailbox(node->pred_id, mailbox);
@@ -598,7 +626,12 @@ static void quit_notify(node_t node)
 
   msg_task_t task_sent_s = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data_s);
   XBT_DEBUG("Sending a 'SUCCESSOR_LEAVING' to my predecessor %d",node->pred_id);
-  MSG_task_send_with_timeout(task_sent_s, mailbox, timeout);
+  if (MSG_task_send_with_timeout(task_sent_s, mailbox, timeout)==
+      MSG_TIMEOUT) {
+    XBT_DEBUG("Timeout expired when sending a 'SUCCESSOR_LEAVING' to my predecessor %d",
+        node->pred_id);
+    task_free(task_sent_s);
+  }
 
 }
 
@@ -760,14 +793,15 @@ static int remote_get_predecessor(node_t node, int ask_to)
         stop = 1;
         MSG_comm_destroy(node->comm_receive);
         node->comm_receive = NULL;
+        task_free(task_sent);
       }
       else {
         msg_task_t task_received = MSG_comm_get_task(node->comm_receive);
         task_data_t ans_data = MSG_task_get_data(task_received);
 
-        if (MC_is_active()) {
+        /*if (MC_is_active()) {
           MC_assert(task_received == task_sent);
-        }
+          }*/
 
         if (task_received != task_sent) {
           MSG_comm_destroy(node->comm_receive);
@@ -904,7 +938,65 @@ static void fix_fingers(node_t node) {
 static void check_predecessor(node_t node)
 {
   XBT_DEBUG("Checking whether my predecessor is alive");
-  // TODO
+
+  if(node->pred_id == -1)
+    return;
+
+  int stop = 0;
+
+  char mailbox[MAILBOX_NAME_SIZE];
+  get_mailbox(node->pred_id, mailbox);
+  task_data_t req_data = xbt_new0(s_task_data_t,1);
+  req_data->type = TASK_PREDECESSOR_ALIVE;
+  req_data->request_id = node->pred_id;
+  get_mailbox(node->id, req_data->answer_to);
+  req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
+
+  msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
+  XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", node->pred_id);
+  
+  msg_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
+  
+  if (res != MSG_OK) {
+    XBT_DEBUG("Failed to send the 'Predecessor Alive' request (task %p) to %d", task_sent, node->pred_id);
+    task_free(task_sent);
+  }else{
+
+    // receive the answer
+    XBT_DEBUG("Sent 'Predecessor Alive' request (task %p) to %d, waiting for the answer on my mailbox '%s'",
+              task_sent, node->pred_id, req_data->answer_to);
+
+    do {
+      if (node->comm_receive == NULL) { // FIXME simplify this
+        msg_task_t task_received = NULL;
+        node->comm_receive = MSG_task_irecv(&task_received, node->mailbox);
+      }
+
+      res = MSG_comm_wait(node->comm_receive, timeout);
+
+      if (res != MSG_OK) {
+        XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request (task %p): %d",
+                  task_sent, (int)res);
+        stop = 1;
+        MSG_comm_destroy(node->comm_receive);
+        node->comm_receive = NULL;
+        node->pred_id = -1;
+      }else {
+        msg_task_t task_received = MSG_comm_get_task(node->comm_receive);
+        if (task_received != task_sent) {
+          MSG_comm_destroy(node->comm_receive);
+          node->comm_receive = NULL;
+          handle_task(node, task_received);
+        }else{
+          XBT_DEBUG("Received the answer to my 'Predecessor Alive' request (task %p) : my predecessor %d is alive", task_received, node->pred_id);
+          stop = 1;
+          MSG_comm_destroy(node->comm_receive);
+          node->comm_receive = NULL;
+          task_free(task_received);
+        }
+      }
+    } while (!stop);
+  }
 }
 
 /**
@@ -913,9 +1005,19 @@ static void check_predecessor(node_t node)
  */
 static void random_lookup(node_t node)
 {
-  int id = 1337; // TODO pick a pseudorandom id
-  XBT_DEBUG("Making a lookup request for id %d", id);
+  
+  int id = 1337; 
   find_successor(node, id);
+
+  /*** Random lookup disabled for tesh examples ***/
+  /*if(node->stream == NULL)
+    node->stream = RngStream_CreateStream("");
+  int random_index = RngStream_RandInt (node->stream, 0, nb_bits - 1);
+  int random_id = node->fingers[random_index].id;
+  XBT_DEBUG("Making a lookup request for id %d", random_id);
+  int res = find_successor(node, random_id);
+  XBT_DEBUG("The successor of node %d is %d", random_id, res);*/
+
 }
 
 /**
index d266b29..e2c44d9 100644 (file)
@@ -129,314 +129,296 @@ $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT -nb_bits=6 ${srcdir:=.}/../msg_platfo
 > [141.383330] (1:node@Gatien)    0  |  48 
 > [141.383330] (1:node@Gatien)   16  |  48 
 > [141.383330] (1:node@Gatien) Predecessor: 42
-> [187.430809] (2:node@McGee) My finger table:
-> [187.430809] (2:node@McGee) Start | Succ 
-> [187.430809] (2:node@McGee)   43  |  48 
-> [187.430809] (2:node@McGee)   44  |  42 
-> [187.430809] (2:node@McGee)   46  |  42 
-> [187.430809] (2:node@McGee)   50  |  42 
-> [187.430809] (2:node@McGee)   58  |  42 
-> [187.430809] (2:node@McGee)   10  |  42 
-> [187.430809] (2:node@McGee) Predecessor: 8
-> [224.180932] (2:node@McGee) My finger table:
-> [224.180932] (2:node@McGee) Start | Succ 
-> [224.180932] (2:node@McGee)   43  |  48 
-> [224.180932] (2:node@McGee)   44  |  42 
-> [224.180932] (2:node@McGee)   46  |  42 
-> [224.180932] (2:node@McGee)   50  |  42 
-> [224.180932] (2:node@McGee)   58  |  42 
-> [224.180932] (2:node@McGee)   10  |  42 
-> [224.180932] (2:node@McGee) Predecessor: 38
-> [238.097182] (7:node@Boivin) My finger table:
-> [238.097182] (7:node@Boivin) Start | Succ 
-> [238.097182] (7:node@Boivin)    9  |  38 
-> [238.097182] (7:node@Boivin)   10  |   8 
-> [238.097182] (7:node@Boivin)   12  |   8 
-> [238.097182] (7:node@Boivin)   16  |   8 
-> [238.097182] (7:node@Boivin)   24  |   8 
-> [238.097182] (7:node@Boivin)   40  |   8 
-> [238.097182] (7:node@Boivin) Predecessor: 1
-> [244.544616] (1:node@Gatien) My finger table:
-> [244.544616] (1:node@Gatien) Start | Succ 
-> [244.544616] (1:node@Gatien)   49  |   1 
-> [244.544616] (1:node@Gatien)   50  |   1 
-> [244.544616] (1:node@Gatien)   52  |  48 
-> [244.544616] (1:node@Gatien)   56  |  48 
-> [244.544616] (1:node@Gatien)    0  |  48 
-> [244.544616] (1:node@Gatien)   16  |  48 
-> [244.544616] (1:node@Gatien) Predecessor: 42
-> [251.309962] (7:node@Boivin) My finger table:
-> [251.309962] (7:node@Boivin) Start | Succ 
-> [251.309962] (7:node@Boivin)    9  |  38 
-> [251.309962] (7:node@Boivin)   10  |  38 
-> [251.309962] (7:node@Boivin)   12  |   8 
-> [251.309962] (7:node@Boivin)   16  |   8 
-> [251.309962] (7:node@Boivin)   24  |   8 
-> [251.309962] (7:node@Boivin)   40  |   8 
-> [251.309962] (7:node@Boivin) Predecessor: 1
-> [252.819541] (2:node@McGee) My finger table:
-> [252.819541] (2:node@McGee) Start | Succ 
-> [252.819541] (2:node@McGee)   43  |  48 
-> [252.819541] (2:node@McGee)   44  |  48 
-> [252.819541] (2:node@McGee)   46  |  42 
-> [252.819541] (2:node@McGee)   50  |  42 
-> [252.819541] (2:node@McGee)   58  |  42 
-> [252.819541] (2:node@McGee)   10  |  42 
-> [252.819541] (2:node@McGee) Predecessor: 38
-> [268.906930] (6:node@Jean_Yves) My finger table:
-> [268.906930] (6:node@Jean_Yves) Start | Succ 
-> [268.906930] (6:node@Jean_Yves)   15  |  38 
-> [268.906930] (6:node@Jean_Yves)   16  |  38 
-> [268.906930] (6:node@Jean_Yves)   18  |  14 
-> [268.906930] (6:node@Jean_Yves)   22  |  14 
-> [268.906930] (6:node@Jean_Yves)   30  |  14 
-> [268.906930] (6:node@Jean_Yves)   46  |  14 
-> [268.906930] (6:node@Jean_Yves) Predecessor: -1
-> [272.587457] (3:node@iRMX) My finger table:
-> [272.587457] (3:node@iRMX) Start | Succ 
-> [272.587457] (3:node@iRMX)   39  |  42 
-> [272.587457] (3:node@iRMX)   40  |  38 
-> [272.587457] (3:node@iRMX)   42  |  38 
-> [272.587457] (3:node@iRMX)   46  |  38 
-> [272.587457] (3:node@iRMX)   54  |  38 
-> [272.587457] (3:node@iRMX)    6  |  38 
-> [272.587457] (3:node@iRMX) Predecessor: 8
-> [275.995469] (8:node@Jacquelin) My finger table:
-> [275.995469] (8:node@Jacquelin) Start | Succ 
-> [275.995469] (8:node@Jacquelin)    2  |   8 
-> [275.995469] (8:node@Jacquelin)    3  |   8 
-> [275.995469] (8:node@Jacquelin)    5  |   1 
-> [275.995469] (8:node@Jacquelin)    9  |   1 
-> [275.995469] (8:node@Jacquelin)   17  |   1 
-> [275.995469] (8:node@Jacquelin)   33  |   1 
-> [275.995469] (8:node@Jacquelin) Predecessor: 48
-> [278.895042] (3:node@iRMX) My finger table:
-> [278.895042] (3:node@iRMX) Start | Succ 
-> [278.895042] (3:node@iRMX)   39  |  42 
-> [278.895042] (3:node@iRMX)   40  |  38 
-> [278.895042] (3:node@iRMX)   42  |  38 
-> [278.895042] (3:node@iRMX)   46  |  38 
-> [278.895042] (3:node@iRMX)   54  |  38 
-> [278.895042] (3:node@iRMX)    6  |  38 
-> [278.895042] (3:node@iRMX) Predecessor: 14
-> [285.028728] (3:node@iRMX) My finger table:
-> [285.028728] (3:node@iRMX) Start | Succ 
-> [285.028728] (3:node@iRMX)   39  |  42 
-> [285.028728] (3:node@iRMX)   40  |  42 
-> [285.028728] (3:node@iRMX)   42  |  38 
-> [285.028728] (3:node@iRMX)   46  |  38 
-> [285.028728] (3:node@iRMX)   54  |  38 
-> [285.028728] (3:node@iRMX)    6  |  38 
-> [285.028728] (3:node@iRMX) Predecessor: 14
-> [299.124575] (4:node@Geoff) My finger table:
-> [299.124575] (4:node@Geoff) Start | Succ 
-> [299.124575] (4:node@Geoff)   33  |  38 
-> [299.124575] (4:node@Geoff)   34  |  38 
-> [299.124575] (4:node@Geoff)   36  |  32 
-> [299.124575] (4:node@Geoff)   40  |  32 
-> [299.124575] (4:node@Geoff)   48  |  32 
-> [299.124575] (4:node@Geoff)    0  |  32 
-> [299.124575] (4:node@Geoff) Predecessor: -1
-> [302.471250] (5:node@TeX) My finger table:
-> [302.471250] (5:node@TeX) Start | Succ 
-> [302.471250] (5:node@TeX)   22  |  38 
-> [302.471250] (5:node@TeX)   23  |  38 
-> [302.471250] (5:node@TeX)   25  |  21 
-> [302.471250] (5:node@TeX)   29  |  21 
-> [302.471250] (5:node@TeX)   37  |  21 
-> [302.471250] (5:node@TeX)   53  |  21 
-> [302.471250] (5:node@TeX) Predecessor: -1
-> [309.606629] (3:node@iRMX) My finger table:
-> [309.606629] (3:node@iRMX) Start | Succ 
-> [309.606629] (3:node@iRMX)   39  |  42 
-> [309.606629] (3:node@iRMX)   40  |  42 
-> [309.606629] (3:node@iRMX)   42  |  38 
-> [309.606629] (3:node@iRMX)   46  |  38 
-> [309.606629] (3:node@iRMX)   54  |  38 
-> [309.606629] (3:node@iRMX)    6  |  38 
-> [309.606629] (3:node@iRMX) Predecessor: 32
-> [352.254124] (6:node@Jean_Yves) My finger table:
-> [352.254124] (6:node@Jean_Yves) Start | Succ 
-> [352.254124] (6:node@Jean_Yves)   15  |  32 
-> [352.254124] (6:node@Jean_Yves)   16  |  38 
-> [352.254124] (6:node@Jean_Yves)   18  |  14 
-> [352.254124] (6:node@Jean_Yves)   22  |  14 
-> [352.254124] (6:node@Jean_Yves)   30  |  14 
-> [352.254124] (6:node@Jean_Yves)   46  |  14 
-> [352.254124] (6:node@Jean_Yves) Predecessor: 8
-> [367.424268] (4:node@Geoff) My finger table:
-> [367.424268] (4:node@Geoff) Start | Succ 
-> [367.424268] (4:node@Geoff)   33  |  38 
-> [367.424268] (4:node@Geoff)   34  |  38 
-> [367.424268] (4:node@Geoff)   36  |  32 
-> [367.424268] (4:node@Geoff)   40  |  32 
-> [367.424268] (4:node@Geoff)   48  |  32 
-> [367.424268] (4:node@Geoff)    0  |  32 
-> [367.424268] (4:node@Geoff) Predecessor: 14
-> [368.585330] (1:node@Gatien) My finger table:
-> [368.585330] (1:node@Gatien) Start | Succ 
-> [368.585330] (1:node@Gatien)   49  |   1 
-> [368.585330] (1:node@Gatien)   50  |   1 
-> [368.585330] (1:node@Gatien)   52  |   1 
-> [368.585330] (1:node@Gatien)   56  |  48 
-> [368.585330] (1:node@Gatien)    0  |  48 
-> [368.585330] (1:node@Gatien)   16  |  48 
-> [368.585330] (1:node@Gatien) Predecessor: 42
-> [374.895586] (2:node@McGee) My finger table:
-> [374.895586] (2:node@McGee) Start | Succ 
-> [374.895586] (2:node@McGee)   43  |  48 
-> [374.895586] (2:node@McGee)   44  |  48 
-> [374.895586] (2:node@McGee)   46  |  48 
-> [374.895586] (2:node@McGee)   50  |  42 
-> [374.895586] (2:node@McGee)   58  |  42 
-> [374.895586] (2:node@McGee)   10  |  42 
-> [374.895586] (2:node@McGee) Predecessor: 38
-> [392.072163] (7:node@Boivin) My finger table:
-> [392.072163] (7:node@Boivin) Start | Succ 
-> [392.072163] (7:node@Boivin)    9  |  14 
-> [392.072163] (7:node@Boivin)   10  |  38 
-> [392.072163] (7:node@Boivin)   12  |  14 
-> [392.072163] (7:node@Boivin)   16  |   8 
-> [392.072163] (7:node@Boivin)   24  |   8 
-> [392.072163] (7:node@Boivin)   40  |   8 
-> [392.072163] (7:node@Boivin) Predecessor: 1
-> [398.554276] (4:node@Geoff) My finger table:
-> [398.554276] (4:node@Geoff) Start | Succ 
-> [398.554276] (4:node@Geoff)   33  |  38 
-> [398.554276] (4:node@Geoff)   34  |  38 
-> [398.554276] (4:node@Geoff)   36  |  32 
-> [398.554276] (4:node@Geoff)   40  |  32 
-> [398.554276] (4:node@Geoff)   48  |  32 
-> [398.554276] (4:node@Geoff)    0  |  32 
-> [398.554276] (4:node@Geoff) Predecessor: 21
-> [400.952003] (6:node@Jean_Yves) My finger table:
-> [400.952003] (6:node@Jean_Yves) Start | Succ 
-> [400.952003] (6:node@Jean_Yves)   15  |  21 
-> [400.952003] (6:node@Jean_Yves)   16  |  38 
-> [400.952003] (6:node@Jean_Yves)   18  |  21 
-> [400.952003] (6:node@Jean_Yves)   22  |  14 
-> [400.952003] (6:node@Jean_Yves)   30  |  14 
-> [400.952003] (6:node@Jean_Yves)   46  |  14 
-> [400.952003] (6:node@Jean_Yves) Predecessor: 8
-> [405.305407] (8:node@Jacquelin) My finger table:
-> [405.305407] (8:node@Jacquelin) Start | Succ 
-> [405.305407] (8:node@Jacquelin)    2  |   8 
-> [405.305407] (8:node@Jacquelin)    3  |   8 
-> [405.305407] (8:node@Jacquelin)    5  |   8 
-> [405.305407] (8:node@Jacquelin)    9  |   1 
-> [405.305407] (8:node@Jacquelin)   17  |   1 
-> [405.305407] (8:node@Jacquelin)   33  |   1 
-> [405.305407] (8:node@Jacquelin) Predecessor: 48
-> [410.451746] (3:node@iRMX) My finger table:
-> [410.451746] (3:node@iRMX) Start | Succ 
-> [410.451746] (3:node@iRMX)   39  |  42 
-> [410.451746] (3:node@iRMX)   40  |  42 
-> [410.451746] (3:node@iRMX)   42  |  42 
-> [410.451746] (3:node@iRMX)   46  |  38 
-> [410.451746] (3:node@iRMX)   54  |  38 
-> [410.451746] (3:node@iRMX)    6  |  38 
-> [410.451746] (3:node@iRMX) Predecessor: 32
-> [420.675292] (4:node@Geoff) My finger table:
-> [420.675292] (4:node@Geoff) Start | Succ 
-> [420.675292] (4:node@Geoff)   33  |  38 
-> [420.675292] (4:node@Geoff)   34  |  38 
-> [420.675292] (4:node@Geoff)   36  |  38 
-> [420.675292] (4:node@Geoff)   40  |  32 
-> [420.675292] (4:node@Geoff)   48  |  32 
-> [420.675292] (4:node@Geoff)    0  |  32 
-> [420.675292] (4:node@Geoff) Predecessor: 21
-> [423.624135] (5:node@TeX) My finger table:
-> [423.624135] (5:node@TeX) Start | Succ 
-> [423.624135] (5:node@TeX)   22  |  32 
-> [423.624135] (5:node@TeX)   23  |  38 
-> [423.624135] (5:node@TeX)   25  |  32 
-> [423.624135] (5:node@TeX)   29  |  21 
-> [423.624135] (5:node@TeX)   37  |  21 
-> [423.624135] (5:node@TeX)   53  |  21 
-> [423.624135] (5:node@TeX) Predecessor: -1
-> [437.092117] (5:node@TeX) My finger table:
-> [437.092117] (5:node@TeX) Start | Succ 
-> [437.092117] (5:node@TeX)   22  |  32 
-> [437.092117] (5:node@TeX)   23  |  38 
-> [437.092117] (5:node@TeX)   25  |  32 
-> [437.092117] (5:node@TeX)   29  |  21 
-> [437.092117] (5:node@TeX)   37  |  21 
-> [437.092117] (5:node@TeX)   53  |  21 
-> [437.092117] (5:node@TeX) Predecessor: 14
-> [492.679220] (1:node@Gatien) My finger table:
-> [492.679220] (1:node@Gatien) Start | Succ 
-> [492.679220] (1:node@Gatien)   49  |   1 
-> [492.679220] (1:node@Gatien)   50  |   1 
-> [492.679220] (1:node@Gatien)   52  |   1 
-> [492.679220] (1:node@Gatien)   56  |   1 
-> [492.679220] (1:node@Gatien)    0  |  48 
-> [492.679220] (1:node@Gatien)   16  |  48 
-> [492.679220] (1:node@Gatien) Predecessor: 42
-> [518.542734] (7:node@Boivin) My finger table:
-> [518.542734] (7:node@Boivin) Start | Succ 
-> [518.542734] (7:node@Boivin)    9  |  14 
-> [518.542734] (7:node@Boivin)   10  |  38 
-> [518.542734] (7:node@Boivin)   12  |  14 
-> [518.542734] (7:node@Boivin)   16  |  21 
-> [518.542734] (7:node@Boivin)   24  |   8 
-> [518.542734] (7:node@Boivin)   40  |   8 
-> [518.542734] (7:node@Boivin) Predecessor: 1
-> [535.761185] (2:node@McGee) My finger table:
-> [535.761185] (2:node@McGee) Start | Succ 
-> [535.761185] (2:node@McGee)   43  |  48 
-> [535.761185] (2:node@McGee)   44  |  48 
-> [535.761185] (2:node@McGee)   46  |  48 
-> [535.761185] (2:node@McGee)   50  |   1 
-> [535.761185] (2:node@McGee)   58  |  42 
-> [535.761185] (2:node@McGee)   10  |  42 
-> [535.761185] (2:node@McGee) Predecessor: 38
-> [536.972553] (8:node@Jacquelin) My finger table:
-> [536.972553] (8:node@Jacquelin) Start | Succ 
-> [536.972553] (8:node@Jacquelin)    2  |   8 
-> [536.972553] (8:node@Jacquelin)    3  |   8 
-> [536.972553] (8:node@Jacquelin)    5  |   8 
-> [536.972553] (8:node@Jacquelin)    9  |  14 
-> [536.972553] (8:node@Jacquelin)   17  |   1 
-> [536.972553] (8:node@Jacquelin)   33  |   1 
-> [536.972553] (8:node@Jacquelin) Predecessor: 48
-> [549.045384] (3:node@iRMX) My finger table:
-> [549.045384] (3:node@iRMX) Start | Succ 
-> [549.045384] (3:node@iRMX)   39  |  42 
-> [549.045384] (3:node@iRMX)   40  |  42 
-> [549.045384] (3:node@iRMX)   42  |  42 
-> [549.045384] (3:node@iRMX)   46  |  48 
-> [549.045384] (3:node@iRMX)   54  |  38 
-> [549.045384] (3:node@iRMX)    6  |  38 
-> [549.045384] (3:node@iRMX) Predecessor: 32
-> [555.217155] (6:node@Jean_Yves) My finger table:
-> [555.217155] (6:node@Jean_Yves) Start | Succ 
-> [555.217155] (6:node@Jean_Yves)   15  |  21 
-> [555.217155] (6:node@Jean_Yves)   16  |  38 
-> [555.217155] (6:node@Jean_Yves)   18  |  21 
-> [555.217155] (6:node@Jean_Yves)   22  |  32 
-> [555.217155] (6:node@Jean_Yves)   30  |  14 
-> [555.217155] (6:node@Jean_Yves)   46  |  14 
-> [555.217155] (6:node@Jean_Yves) Predecessor: 8
-> [560.036388] (5:node@TeX) My finger table:
-> [560.036388] (5:node@TeX) Start | Succ 
-> [560.036388] (5:node@TeX)   22  |  32 
-> [560.036388] (5:node@TeX)   23  |  38 
-> [560.036388] (5:node@TeX)   25  |  32 
-> [560.036388] (5:node@TeX)   29  |  32 
-> [560.036388] (5:node@TeX)   37  |  21 
-> [560.036388] (5:node@TeX)   53  |  21 
-> [560.036388] (5:node@TeX) Predecessor: 14
-> [577.866928] (4:node@Geoff) My finger table:
-> [577.866928] (4:node@Geoff) Start | Succ 
-> [577.866928] (4:node@Geoff)   33  |  38 
-> [577.866928] (4:node@Geoff)   34  |  38 
-> [577.866928] (4:node@Geoff)   36  |  38 
-> [577.866928] (4:node@Geoff)   40  |  42 
-> [577.866928] (4:node@Geoff)   48  |  32 
-> [577.866928] (4:node@Geoff)    0  |  32 
-> [577.866928] (4:node@Geoff) Predecessor: 21
-> [803.668927] (0:@) Messages created: 768
-> [803.668927] (0:@) Simulated time: 803.669
+> [193.730889] (2:node@McGee) My finger table:
+> [193.730889] (2:node@McGee) Start | Succ 
+> [193.730889] (2:node@McGee)   43  |  48 
+> [193.730889] (2:node@McGee)   44  |  42 
+> [193.730889] (2:node@McGee)   46  |  42 
+> [193.730889] (2:node@McGee)   50  |  42 
+> [193.730889] (2:node@McGee)   58  |  42 
+> [193.730889] (2:node@McGee)   10  |  42 
+> [193.730889] (2:node@McGee) Predecessor: 8
+> [242.028885] (1:node@Gatien) My finger table:
+> [242.028885] (1:node@Gatien) Start | Succ 
+> [242.028885] (1:node@Gatien)   49  |   1 
+> [242.028885] (1:node@Gatien)   50  |   1 
+> [242.028885] (1:node@Gatien)   52  |  48 
+> [242.028885] (1:node@Gatien)   56  |  48 
+> [242.028885] (1:node@Gatien)    0  |  48 
+> [242.028885] (1:node@Gatien)   16  |  48 
+> [242.028885] (1:node@Gatien) Predecessor: 42
+> [242.939649] (2:node@McGee) My finger table:
+> [242.939649] (2:node@McGee) Start | Succ 
+> [242.939649] (2:node@McGee)   43  |  48 
+> [242.939649] (2:node@McGee)   44  |  42 
+> [242.939649] (2:node@McGee)   46  |  42 
+> [242.939649] (2:node@McGee)   50  |  42 
+> [242.939649] (2:node@McGee)   58  |  42 
+> [242.939649] (2:node@McGee)   10  |  42 
+> [242.939649] (2:node@McGee) Predecessor: 38
+> [246.478479] (2:node@McGee) My finger table:
+> [246.478479] (2:node@McGee) Start | Succ 
+> [246.478479] (2:node@McGee)   43  |  48 
+> [246.478479] (2:node@McGee)   44  |  48 
+> [246.478479] (2:node@McGee)   46  |  42 
+> [246.478479] (2:node@McGee)   50  |  42 
+> [246.478479] (2:node@McGee)   58  |  42 
+> [246.478479] (2:node@McGee)   10  |  42 
+> [246.478479] (2:node@McGee) Predecessor: 38
+> [248.768494] (7:node@Boivin) My finger table:
+> [248.768494] (7:node@Boivin) Start | Succ 
+> [248.768494] (7:node@Boivin)    9  |  38 
+> [248.768494] (7:node@Boivin)   10  |  38 
+> [248.768494] (7:node@Boivin)   12  |   8 
+> [248.768494] (7:node@Boivin)   16  |   8 
+> [248.768494] (7:node@Boivin)   24  |   8 
+> [248.768494] (7:node@Boivin)   40  |   8 
+> [248.768494] (7:node@Boivin) Predecessor: -1
+> [255.578776] (4:node@Geoff) My finger table:
+> [255.578776] (4:node@Geoff) Start | Succ 
+> [255.578776] (4:node@Geoff)   33  |  42 
+> [255.578776] (4:node@Geoff)   34  |  42 
+> [255.578776] (4:node@Geoff)   36  |  32 
+> [255.578776] (4:node@Geoff)   40  |  32 
+> [255.578776] (4:node@Geoff)   48  |  32 
+> [255.578776] (4:node@Geoff)    0  |  32 
+> [255.578776] (4:node@Geoff) Predecessor: -1
+> [268.081369] (8:node@Jacquelin) My finger table:
+> [268.081369] (8:node@Jacquelin) Start | Succ 
+> [268.081369] (8:node@Jacquelin)    2  |   8 
+> [268.081369] (8:node@Jacquelin)    3  |   8 
+> [268.081369] (8:node@Jacquelin)    5  |   1 
+> [268.081369] (8:node@Jacquelin)    9  |   1 
+> [268.081369] (8:node@Jacquelin)   17  |   1 
+> [268.081369] (8:node@Jacquelin)   33  |   1 
+> [268.081369] (8:node@Jacquelin) Predecessor: 48
+> [269.130254] (7:node@Boivin) My finger table:
+> [269.130254] (7:node@Boivin) Start | Succ 
+> [269.130254] (7:node@Boivin)    9  |  38 
+> [269.130254] (7:node@Boivin)   10  |  38 
+> [269.130254] (7:node@Boivin)   12  |   8 
+> [269.130254] (7:node@Boivin)   16  |   8 
+> [269.130254] (7:node@Boivin)   24  |   8 
+> [269.130254] (7:node@Boivin)   40  |   8 
+> [269.130254] (7:node@Boivin) Predecessor: 1
+> [272.405875] (3:node@iRMX) My finger table:
+> [272.405875] (3:node@iRMX) Start | Succ 
+> [272.405875] (3:node@iRMX)   39  |  42 
+> [272.405875] (3:node@iRMX)   40  |  42 
+> [272.405875] (3:node@iRMX)   42  |  38 
+> [272.405875] (3:node@iRMX)   46  |  38 
+> [272.405875] (3:node@iRMX)   54  |  38 
+> [272.405875] (3:node@iRMX)    6  |  38 
+> [272.405875] (3:node@iRMX) Predecessor: -1
+> [284.571172] (5:node@TeX) My finger table:
+> [284.571172] (5:node@TeX) Start | Succ 
+> [284.571172] (5:node@TeX)   22  |  38 
+> [284.571172] (5:node@TeX)   23  |  38 
+> [284.571172] (5:node@TeX)   25  |  21 
+> [284.571172] (5:node@TeX)   29  |  21 
+> [284.571172] (5:node@TeX)   37  |  21 
+> [284.571172] (5:node@TeX)   53  |  21 
+> [284.571172] (5:node@TeX) Predecessor: -1
+> [289.289425] (3:node@iRMX) My finger table:
+> [289.289425] (3:node@iRMX) Start | Succ 
+> [289.289425] (3:node@iRMX)   39  |  42 
+> [289.289425] (3:node@iRMX)   40  |  42 
+> [289.289425] (3:node@iRMX)   42  |  38 
+> [289.289425] (3:node@iRMX)   46  |  38 
+> [289.289425] (3:node@iRMX)   54  |  38 
+> [289.289425] (3:node@iRMX)    6  |  38 
+> [289.289425] (3:node@iRMX) Predecessor: 21
+> [305.097098] (6:node@Jean_Yves) My finger table:
+> [305.097098] (6:node@Jean_Yves) Start | Succ 
+> [305.097098] (6:node@Jean_Yves)   15  |  21 
+> [305.097098] (6:node@Jean_Yves)   16  |  21 
+> [305.097098] (6:node@Jean_Yves)   18  |  14 
+> [305.097098] (6:node@Jean_Yves)   22  |  14 
+> [305.097098] (6:node@Jean_Yves)   30  |  14 
+> [305.097098] (6:node@Jean_Yves)   46  |  14 
+> [305.097098] (6:node@Jean_Yves) Predecessor: -1
+> [313.745063] (3:node@iRMX) My finger table:
+> [313.745063] (3:node@iRMX) Start | Succ 
+> [313.745063] (3:node@iRMX)   39  |  42 
+> [313.745063] (3:node@iRMX)   40  |  42 
+> [313.745063] (3:node@iRMX)   42  |  38 
+> [313.745063] (3:node@iRMX)   46  |  38 
+> [313.745063] (3:node@iRMX)   54  |  38 
+> [313.745063] (3:node@iRMX)    6  |  38 
+> [313.745063] (3:node@iRMX) Predecessor: 32
+> [338.951991] (5:node@TeX) My finger table:
+> [338.951991] (5:node@TeX) Start | Succ 
+> [338.951991] (5:node@TeX)   22  |  32 
+> [338.951991] (5:node@TeX)   23  |  38 
+> [338.951991] (5:node@TeX)   25  |  21 
+> [338.951991] (5:node@TeX)   29  |  21 
+> [338.951991] (5:node@TeX)   37  |  21 
+> [338.951991] (5:node@TeX)   53  |  21 
+> [338.951991] (5:node@TeX) Predecessor: 14
+> [359.463119] (4:node@Geoff) My finger table:
+> [359.463119] (4:node@Geoff) Start | Succ 
+> [359.463119] (4:node@Geoff)   33  |  38 
+> [359.463119] (4:node@Geoff)   34  |  42 
+> [359.463119] (4:node@Geoff)   36  |  32 
+> [359.463119] (4:node@Geoff)   40  |  32 
+> [359.463119] (4:node@Geoff)   48  |  32 
+> [359.463119] (4:node@Geoff)    0  |  32 
+> [359.463119] (4:node@Geoff) Predecessor: 21
+> [365.649491] (1:node@Gatien) My finger table:
+> [365.649491] (1:node@Gatien) Start | Succ 
+> [365.649491] (1:node@Gatien)   49  |   1 
+> [365.649491] (1:node@Gatien)   50  |   1 
+> [365.649491] (1:node@Gatien)   52  |   1 
+> [365.649491] (1:node@Gatien)   56  |  48 
+> [365.649491] (1:node@Gatien)    0  |  48 
+> [365.649491] (1:node@Gatien)   16  |  48 
+> [365.649491] (1:node@Gatien) Predecessor: 42
+> [367.870511] (2:node@McGee) My finger table:
+> [367.870511] (2:node@McGee) Start | Succ 
+> [367.870511] (2:node@McGee)   43  |  48 
+> [367.870511] (2:node@McGee)   44  |  48 
+> [367.870511] (2:node@McGee)   46  |  48 
+> [367.870511] (2:node@McGee)   50  |  42 
+> [367.870511] (2:node@McGee)   58  |  42 
+> [367.870511] (2:node@McGee)   10  |  42 
+> [367.870511] (2:node@McGee) Predecessor: 38
+> [371.550204] (7:node@Boivin) My finger table:
+> [371.550204] (7:node@Boivin) Start | Succ 
+> [371.550204] (7:node@Boivin)    9  |  21 
+> [371.550204] (7:node@Boivin)   10  |  38 
+> [371.550204] (7:node@Boivin)   12  |  21 
+> [371.550204] (7:node@Boivin)   16  |   8 
+> [371.550204] (7:node@Boivin)   24  |   8 
+> [371.550204] (7:node@Boivin)   40  |   8 
+> [371.550204] (7:node@Boivin) Predecessor: 1
+> [388.564124] (4:node@Geoff) My finger table:
+> [388.564124] (4:node@Geoff) Start | Succ 
+> [388.564124] (4:node@Geoff)   33  |  38 
+> [388.564124] (4:node@Geoff)   34  |  42 
+> [388.564124] (4:node@Geoff)   36  |  38 
+> [388.564124] (4:node@Geoff)   40  |  32 
+> [388.564124] (4:node@Geoff)   48  |  32 
+> [388.564124] (4:node@Geoff)    0  |  32 
+> [388.564124] (4:node@Geoff) Predecessor: 21
+> [389.021710] (8:node@Jacquelin) My finger table:
+> [389.021710] (8:node@Jacquelin) Start | Succ 
+> [389.021710] (8:node@Jacquelin)    2  |   8 
+> [389.021710] (8:node@Jacquelin)    3  |   8 
+> [389.021710] (8:node@Jacquelin)    5  |   8 
+> [389.021710] (8:node@Jacquelin)    9  |   1 
+> [389.021710] (8:node@Jacquelin)   17  |   1 
+> [389.021710] (8:node@Jacquelin)   33  |   1 
+> [389.021710] (8:node@Jacquelin) Predecessor: 48
+> [393.088734] (3:node@iRMX) My finger table:
+> [393.088734] (3:node@iRMX) Start | Succ 
+> [393.088734] (3:node@iRMX)   39  |  42 
+> [393.088734] (3:node@iRMX)   40  |  42 
+> [393.088734] (3:node@iRMX)   42  |  42 
+> [393.088734] (3:node@iRMX)   46  |  38 
+> [393.088734] (3:node@iRMX)   54  |  38 
+> [393.088734] (3:node@iRMX)    6  |  38 
+> [393.088734] (3:node@iRMX) Predecessor: 32
+> [412.961674] (5:node@TeX) My finger table:
+> [412.961674] (5:node@TeX) Start | Succ 
+> [412.961674] (5:node@TeX)   22  |  32 
+> [412.961674] (5:node@TeX)   23  |  38 
+> [412.961674] (5:node@TeX)   25  |  32 
+> [412.961674] (5:node@TeX)   29  |  21 
+> [412.961674] (5:node@TeX)   37  |  21 
+> [412.961674] (5:node@TeX)   53  |  21 
+> [412.961674] (5:node@TeX) Predecessor: 14
+> [434.596478] (6:node@Jean_Yves) My finger table:
+> [434.596478] (6:node@Jean_Yves) Start | Succ 
+> [434.596478] (6:node@Jean_Yves)   15  |  21 
+> [434.596478] (6:node@Jean_Yves)   16  |  21 
+> [434.596478] (6:node@Jean_Yves)   18  |  14 
+> [434.596478] (6:node@Jean_Yves)   22  |  14 
+> [434.596478] (6:node@Jean_Yves)   30  |  14 
+> [434.596478] (6:node@Jean_Yves)   46  |  14 
+> [434.596478] (6:node@Jean_Yves) Predecessor: 8
+> [443.806924] (6:node@Jean_Yves) My finger table:
+> [443.806924] (6:node@Jean_Yves) Start | Succ 
+> [443.806924] (6:node@Jean_Yves)   15  |  21 
+> [443.806924] (6:node@Jean_Yves)   16  |  21 
+> [443.806924] (6:node@Jean_Yves)   18  |  21 
+> [443.806924] (6:node@Jean_Yves)   22  |  14 
+> [443.806924] (6:node@Jean_Yves)   30  |  14 
+> [443.806924] (6:node@Jean_Yves)   46  |  14 
+> [443.806924] (6:node@Jean_Yves) Predecessor: 8
+> [488.763595] (1:node@Gatien) My finger table:
+> [488.763595] (1:node@Gatien) Start | Succ 
+> [488.763595] (1:node@Gatien)   49  |   1 
+> [488.763595] (1:node@Gatien)   50  |   1 
+> [488.763595] (1:node@Gatien)   52  |   1 
+> [488.763595] (1:node@Gatien)   56  |   1 
+> [488.763595] (1:node@Gatien)    0  |  48 
+> [488.763595] (1:node@Gatien)   16  |  48 
+> [488.763595] (1:node@Gatien) Predecessor: 42
+> [502.910439] (2:node@McGee) My finger table:
+> [502.910439] (2:node@McGee) Start | Succ 
+> [502.910439] (2:node@McGee)   43  |  48 
+> [502.910439] (2:node@McGee)   44  |  48 
+> [502.910439] (2:node@McGee)   46  |  48 
+> [502.910439] (2:node@McGee)   50  |   1 
+> [502.910439] (2:node@McGee)   58  |  42 
+> [502.910439] (2:node@McGee)   10  |  42 
+> [502.910439] (2:node@McGee) Predecessor: 38
+> [511.133077] (8:node@Jacquelin) My finger table:
+> [511.133077] (8:node@Jacquelin) Start | Succ 
+> [511.133077] (8:node@Jacquelin)    2  |   8 
+> [511.133077] (8:node@Jacquelin)    3  |   8 
+> [511.133077] (8:node@Jacquelin)    5  |   8 
+> [511.133077] (8:node@Jacquelin)    9  |  14 
+> [511.133077] (8:node@Jacquelin)   17  |   1 
+> [511.133077] (8:node@Jacquelin)   33  |   1 
+> [511.133077] (8:node@Jacquelin) Predecessor: 48
+> [528.169747] (7:node@Boivin) My finger table:
+> [528.169747] (7:node@Boivin) Start | Succ 
+> [528.169747] (7:node@Boivin)    9  |  14 
+> [528.169747] (7:node@Boivin)   10  |  38 
+> [528.169747] (7:node@Boivin)   12  |  21 
+> [528.169747] (7:node@Boivin)   16  |  21 
+> [528.169747] (7:node@Boivin)   24  |   8 
+> [528.169747] (7:node@Boivin)   40  |   8 
+> [528.169747] (7:node@Boivin) Predecessor: 1
+> [538.778175] (3:node@iRMX) My finger table:
+> [538.778175] (3:node@iRMX) Start | Succ 
+> [538.778175] (3:node@iRMX)   39  |  42 
+> [538.778175] (3:node@iRMX)   40  |  42 
+> [538.778175] (3:node@iRMX)   42  |  42 
+> [538.778175] (3:node@iRMX)   46  |  48 
+> [538.778175] (3:node@iRMX)   54  |  38 
+> [538.778175] (3:node@iRMX)    6  |  38 
+> [538.778175] (3:node@iRMX) Predecessor: 32
+> [561.853791] (5:node@TeX) My finger table:
+> [561.853791] (5:node@TeX) Start | Succ 
+> [561.853791] (5:node@TeX)   22  |  32 
+> [561.853791] (5:node@TeX)   23  |  38 
+> [561.853791] (5:node@TeX)   25  |  32 
+> [561.853791] (5:node@TeX)   29  |  32 
+> [561.853791] (5:node@TeX)   37  |  21 
+> [561.853791] (5:node@TeX)   53  |  21 
+> [561.853791] (5:node@TeX) Predecessor: 14
+> [564.892126] (4:node@Geoff) My finger table:
+> [564.892126] (4:node@Geoff) Start | Succ 
+> [564.892126] (4:node@Geoff)   33  |  38 
+> [564.892126] (4:node@Geoff)   34  |  42 
+> [564.892126] (4:node@Geoff)   36  |  38 
+> [564.892126] (4:node@Geoff)   40  |  42 
+> [564.892126] (4:node@Geoff)   48  |  32 
+> [564.892126] (4:node@Geoff)    0  |  32 
+> [564.892126] (4:node@Geoff) Predecessor: 21
+> [580.440450] (6:node@Jean_Yves) My finger table:
+> [580.440450] (6:node@Jean_Yves) Start | Succ 
+> [580.440450] (6:node@Jean_Yves)   15  |  21 
+> [580.440450] (6:node@Jean_Yves)   16  |  21 
+> [580.440450] (6:node@Jean_Yves)   18  |  21 
+> [580.440450] (6:node@Jean_Yves)   22  |  32 
+> [580.440450] (6:node@Jean_Yves)   30  |  14 
+> [580.440450] (6:node@Jean_Yves)   46  |  14 
+> [580.440450] (6:node@Jean_Yves) Predecessor: 8
+> [805.312574] (0:@) Messages created: 789
+> [805.312574] (0:@) Simulated time: 805.313
 
 ! output sort
 $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT ${srcdir:=.}/../../platforms/cluster.xml ${srcdir:=.}/chord10.xml --cfg=network/crosstraffic:0 --log=msg_chord.thres:verbose "--log=root.fmt:[%11.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:Constant
@@ -1046,1976 +1028,1949 @@ $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT ${srcdir:=.}/../../platforms/cluster.
 > [ 110.000000] (9:node@c-8.me)  10713112  | 6518808 
 > [ 110.000000] (9:node@c-8.me)  14907416  | 6518808 
 > [ 110.000000] (9:node@c-8.me) Predecessor: 1319738
-> [ 145.000000] (1:node@c-0.me) My finger table:
-> [ 145.000000] (1:node@c-0.me) Start | Succ 
-> [ 145.000000] (1:node@c-0.me)   43  | 1319738 
-> [ 145.000000] (1:node@c-0.me)   44  |  42 
-> [ 145.000000] (1:node@c-0.me)   46  |  42 
-> [ 145.000000] (1:node@c-0.me)   50  |  42 
-> [ 145.000000] (1:node@c-0.me)   58  |  42 
-> [ 145.000000] (1:node@c-0.me)   74  |  42 
-> [ 145.000000] (1:node@c-0.me)  106  |  42 
-> [ 145.000000] (1:node@c-0.me)  170  |  42 
-> [ 145.000000] (1:node@c-0.me)  298  |  42 
-> [ 145.000000] (1:node@c-0.me)  554  |  42 
-> [ 145.000000] (1:node@c-0.me)  1066  |  42 
-> [ 145.000000] (1:node@c-0.me)  2090  |  42 
-> [ 145.000000] (1:node@c-0.me)  4138  |  42 
-> [ 145.000000] (1:node@c-0.me)  8234  |  42 
-> [ 145.000000] (1:node@c-0.me)  16426  |  42 
-> [ 145.000000] (1:node@c-0.me)  32810  |  42 
-> [ 145.000000] (1:node@c-0.me)  65578  |  42 
-> [ 145.000000] (1:node@c-0.me)  131114  |  42 
-> [ 145.000000] (1:node@c-0.me)  262186  |  42 
-> [ 145.000000] (1:node@c-0.me)  524330  |  42 
-> [ 145.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 145.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 145.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 145.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 145.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 157.000000] (4:node@c-3.me) My finger table:
-> [ 157.000000] (4:node@c-3.me) Start | Succ 
-> [ 157.000000] (4:node@c-3.me)  1319739  | 6518808 
-> [ 157.000000] (4:node@c-3.me)  1319740  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319742  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 157.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 184.000000] (7:node@c-6.me) My finger table:
-> [ 184.000000] (7:node@c-6.me) Start | Succ 
-> [ 184.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 184.000000] (7:node@c-6.me)  16728098  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 184.000000] (7:node@c-6.me) Predecessor: 6518808
-> [ 202.000000] (2:node@c-1.me) My finger table:
-> [ 202.000000] (2:node@c-1.me) Start | Succ 
-> [ 202.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 202.000000] (2:node@c-1.me)  366682  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366684  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 202.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 202.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 202.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 202.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 202.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 202.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 202.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 202.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 202.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 202.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 202.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 202.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 202.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 202.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 202.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 202.000000] (2:node@c-1.me) Predecessor: 42
-> [ 221.000000] (9:node@c-8.me) My finger table:
-> [ 221.000000] (9:node@c-8.me) Start | Succ 
-> [ 221.000000] (9:node@c-8.me)  6518809  | 16728096 
-> [ 221.000000] (9:node@c-8.me)  6518810  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518812  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 221.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 240.000000] (6:node@c-5.me) My finger table:
-> [ 240.000000] (6:node@c-5.me) Start | Succ 
-> [ 240.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 240.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 240.000000] (6:node@c-5.me)  10874880  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874884  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 240.000000] (6:node@c-5.me) Predecessor: -1
-> [ 247.000000] (5:node@c-4.me) My finger table:
-> [ 247.000000] (5:node@c-4.me) Start | Succ 
-> [ 247.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 247.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 247.000000] (5:node@c-4.me)  16509409  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509413  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 247.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 250.000000] (1:node@c-0.me) My finger table:
-> [ 250.000000] (1:node@c-0.me) Start | Succ 
-> [ 250.000000] (1:node@c-0.me)   43  | 366680 
-> [ 250.000000] (1:node@c-0.me)   44  | 366680 
-> [ 250.000000] (1:node@c-0.me)   46  |  42 
-> [ 250.000000] (1:node@c-0.me)   50  |  42 
-> [ 250.000000] (1:node@c-0.me)   58  |  42 
-> [ 250.000000] (1:node@c-0.me)   74  |  42 
-> [ 250.000000] (1:node@c-0.me)  106  |  42 
-> [ 250.000000] (1:node@c-0.me)  170  |  42 
-> [ 250.000000] (1:node@c-0.me)  298  |  42 
-> [ 250.000000] (1:node@c-0.me)  554  |  42 
-> [ 250.000000] (1:node@c-0.me)  1066  |  42 
-> [ 250.000000] (1:node@c-0.me)  2090  |  42 
-> [ 250.000000] (1:node@c-0.me)  4138  |  42 
-> [ 250.000000] (1:node@c-0.me)  8234  |  42 
-> [ 250.000000] (1:node@c-0.me)  16426  |  42 
-> [ 250.000000] (1:node@c-0.me)  32810  |  42 
-> [ 250.000000] (1:node@c-0.me)  65578  |  42 
-> [ 250.000000] (1:node@c-0.me)  131114  |  42 
-> [ 250.000000] (1:node@c-0.me)  262186  |  42 
-> [ 250.000000] (1:node@c-0.me)  524330  |  42 
-> [ 250.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 250.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 250.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 250.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 250.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 251.000000] (3:node@c-2.me) My finger table:
-> [ 251.000000] (3:node@c-2.me) Start | Succ 
-> [ 251.000000] (3:node@c-2.me)  533745  | 10004760 
-> [ 251.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 251.000000] (3:node@c-2.me)  533748  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533752  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 251.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 251.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 251.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 251.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 251.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 251.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 251.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 251.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 251.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 251.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 251.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 251.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 251.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 251.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 253.000000] (8:node@c-7.me) My finger table:
-> [ 253.000000] (8:node@c-7.me) Start | Succ 
-> [ 253.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 253.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 253.000000] (8:node@c-7.me)  10004764  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 253.000000] (8:node@c-7.me) Predecessor: 533744
-> [ 263.000000] (2:node@c-1.me) My finger table:
-> [ 263.000000] (2:node@c-1.me) Start | Succ 
-> [ 263.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 263.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 263.000000] (2:node@c-1.me)  366684  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 263.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 263.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 263.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 263.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 263.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 263.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 263.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 263.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 263.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 263.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 263.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 263.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 263.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 263.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 263.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 263.000000] (2:node@c-1.me) Predecessor: 42
-> [ 268.000000] (4:node@c-3.me) My finger table:
-> [ 268.000000] (4:node@c-3.me) Start | Succ 
-> [ 268.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 268.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 268.000000] (4:node@c-3.me)  1319742  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 268.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 269.000000] (10:node@c-9.me) My finger table:
-> [ 269.000000] (10:node@c-9.me) Start | Succ 
-> [ 269.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 269.000000] (10:node@c-9.me)  2015255  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015257  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 269.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 274.000000] (10:node@c-9.me) My finger table:
-> [ 274.000000] (10:node@c-9.me) Start | Succ 
-> [ 274.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 274.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 274.000000] (10:node@c-9.me)  2015257  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 274.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 274.000000] (9:node@c-8.me) My finger table:
-> [ 274.000000] (9:node@c-8.me) Start | Succ 
-> [ 274.000000] (9:node@c-8.me)  6518809  | 16728096 
-> [ 274.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 274.000000] (9:node@c-8.me)  6518812  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 274.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 275.000000] (7:node@c-6.me) My finger table:
-> [ 275.000000] (7:node@c-6.me) Start | Succ 
-> [ 275.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 275.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 275.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 275.000000] (7:node@c-6.me) Predecessor: 6518808
-> [ 288.000000] (7:node@c-6.me) My finger table:
-> [ 288.000000] (7:node@c-6.me) Start | Succ 
-> [ 288.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 288.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 288.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 288.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 361.000000] (8:node@c-7.me) My finger table:
-> [ 361.000000] (8:node@c-7.me) Start | Succ 
-> [ 361.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 361.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 361.000000] (8:node@c-7.me)  10004764  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 361.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 364.000000] (6:node@c-5.me) My finger table:
-> [ 364.000000] (6:node@c-5.me) Start | Succ 
-> [ 364.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874884  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 364.000000] (6:node@c-5.me) Predecessor: -1
-> [ 371.000000] (3:node@c-2.me) My finger table:
-> [ 371.000000] (3:node@c-2.me) Start | Succ 
-> [ 371.000000] (3:node@c-2.me)  533745  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533752  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 371.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 371.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 371.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 371.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 371.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 371.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 371.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 371.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 371.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 371.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 371.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 371.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 371.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 371.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 372.000000] (1:node@c-0.me) My finger table:
-> [ 372.000000] (1:node@c-0.me) Start | Succ 
-> [ 372.000000] (1:node@c-0.me)   43  | 366680 
-> [ 372.000000] (1:node@c-0.me)   44  | 366680 
-> [ 372.000000] (1:node@c-0.me)   46  | 366680 
-> [ 372.000000] (1:node@c-0.me)   50  |  42 
-> [ 372.000000] (1:node@c-0.me)   58  |  42 
-> [ 372.000000] (1:node@c-0.me)   74  |  42 
-> [ 372.000000] (1:node@c-0.me)  106  |  42 
-> [ 372.000000] (1:node@c-0.me)  170  |  42 
-> [ 372.000000] (1:node@c-0.me)  298  |  42 
-> [ 372.000000] (1:node@c-0.me)  554  |  42 
-> [ 372.000000] (1:node@c-0.me)  1066  |  42 
-> [ 372.000000] (1:node@c-0.me)  2090  |  42 
-> [ 372.000000] (1:node@c-0.me)  4138  |  42 
-> [ 372.000000] (1:node@c-0.me)  8234  |  42 
-> [ 372.000000] (1:node@c-0.me)  16426  |  42 
-> [ 372.000000] (1:node@c-0.me)  32810  |  42 
-> [ 372.000000] (1:node@c-0.me)  65578  |  42 
-> [ 372.000000] (1:node@c-0.me)  131114  |  42 
-> [ 372.000000] (1:node@c-0.me)  262186  |  42 
-> [ 372.000000] (1:node@c-0.me)  524330  |  42 
-> [ 372.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 372.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 372.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 372.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 372.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 374.000000] (8:node@c-7.me) My finger table:
-> [ 374.000000] (8:node@c-7.me) Start | Succ 
-> [ 374.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 374.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 375.000000] (5:node@c-4.me) My finger table:
-> [ 375.000000] (5:node@c-4.me) Start | Succ 
-> [ 375.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509413  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 375.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 395.000000] (9:node@c-8.me) My finger table:
-> [ 395.000000] (9:node@c-8.me) Start | Succ 
-> [ 395.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 395.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 395.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 395.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 395.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 398.000000] (7:node@c-6.me) My finger table:
-> [ 398.000000] (7:node@c-6.me) Start | Succ 
-> [ 398.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 398.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 405.000000] (4:node@c-3.me) My finger table:
-> [ 405.000000] (4:node@c-3.me) Start | Succ 
-> [ 405.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 405.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 411.000000] (2:node@c-1.me) My finger table:
-> [ 411.000000] (2:node@c-1.me) Start | Succ 
-> [ 411.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 411.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 411.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 411.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 411.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 411.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 411.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 411.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 411.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 411.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 411.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 411.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 411.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 411.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 411.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 411.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 411.000000] (2:node@c-1.me) Predecessor: 42
-> [ 426.000000] (10:node@c-9.me) My finger table:
-> [ 426.000000] (10:node@c-9.me) Start | Succ 
-> [ 426.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 426.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 486.000000] (6:node@c-5.me) My finger table:
-> [ 486.000000] (6:node@c-5.me) Start | Succ 
-> [ 486.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 486.000000] (6:node@c-5.me) Predecessor: -1
-> [ 491.000000] (4:node@c-3.me) My finger table:
-> [ 491.000000] (4:node@c-3.me) Start | Succ 
-> [ 491.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 491.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 492.000000] (1:node@c-0.me) My finger table:
-> [ 492.000000] (1:node@c-0.me) Start | Succ 
-> [ 492.000000] (1:node@c-0.me)   43  | 366680 
-> [ 492.000000] (1:node@c-0.me)   44  | 366680 
-> [ 492.000000] (1:node@c-0.me)   46  | 366680 
-> [ 492.000000] (1:node@c-0.me)   50  | 366680 
-> [ 492.000000] (1:node@c-0.me)   58  |  42 
-> [ 492.000000] (1:node@c-0.me)   74  |  42 
-> [ 492.000000] (1:node@c-0.me)  106  |  42 
-> [ 492.000000] (1:node@c-0.me)  170  |  42 
-> [ 492.000000] (1:node@c-0.me)  298  |  42 
-> [ 492.000000] (1:node@c-0.me)  554  |  42 
-> [ 492.000000] (1:node@c-0.me)  1066  |  42 
-> [ 492.000000] (1:node@c-0.me)  2090  |  42 
-> [ 492.000000] (1:node@c-0.me)  4138  |  42 
-> [ 492.000000] (1:node@c-0.me)  8234  |  42 
-> [ 492.000000] (1:node@c-0.me)  16426  |  42 
-> [ 492.000000] (1:node@c-0.me)  32810  |  42 
-> [ 492.000000] (1:node@c-0.me)  65578  |  42 
-> [ 492.000000] (1:node@c-0.me)  131114  |  42 
-> [ 492.000000] (1:node@c-0.me)  262186  |  42 
-> [ 492.000000] (1:node@c-0.me)  524330  |  42 
-> [ 492.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 492.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 492.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 492.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 492.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 495.000000] (3:node@c-2.me) My finger table:
-> [ 495.000000] (3:node@c-2.me) Start | Succ 
-> [ 495.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 495.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 495.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 495.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 495.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 495.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 495.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 495.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 495.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 495.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 495.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 495.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 495.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 495.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 495.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 495.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 495.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 495.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 495.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 502.000000] (8:node@c-7.me) My finger table:
-> [ 502.000000] (8:node@c-7.me) Start | Succ 
-> [ 502.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 502.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 505.000000] (5:node@c-4.me) My finger table:
-> [ 505.000000] (5:node@c-4.me) Start | Succ 
-> [ 505.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 505.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 521.000000] (7:node@c-6.me) My finger table:
-> [ 521.000000] (7:node@c-6.me) Start | Succ 
-> [ 521.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 521.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 535.000000] (9:node@c-8.me) My finger table:
-> [ 535.000000] (9:node@c-8.me) Start | Succ 
-> [ 535.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 535.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 535.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 537.000000] (4:node@c-3.me) My finger table:
-> [ 537.000000] (4:node@c-3.me) Start | Succ 
-> [ 537.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 537.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 539.000000] (2:node@c-1.me) My finger table:
-> [ 539.000000] (2:node@c-1.me) Start | Succ 
-> [ 539.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 539.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 539.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 539.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 539.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 539.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 539.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 539.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 539.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 539.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 539.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 539.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 539.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 539.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 539.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 539.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 539.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 539.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 539.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 539.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 539.000000] (2:node@c-1.me) Predecessor: 42
-> [ 540.000000] (3:node@c-2.me) My finger table:
-> [ 540.000000] (3:node@c-2.me) Start | Succ 
-> [ 540.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 540.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 540.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 540.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 540.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 540.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 540.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 540.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 540.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 540.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 540.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 540.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 540.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 540.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 540.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 540.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 540.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 540.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 540.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 567.000000] (10:node@c-9.me) My finger table:
-> [ 567.000000] (10:node@c-9.me) Start | Succ 
-> [ 567.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 567.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 613.000000] (1:node@c-0.me) My finger table:
-> [ 613.000000] (1:node@c-0.me) Start | Succ 
-> [ 613.000000] (1:node@c-0.me)   43  | 366680 
-> [ 613.000000] (1:node@c-0.me)   44  | 366680 
-> [ 613.000000] (1:node@c-0.me)   46  | 366680 
-> [ 613.000000] (1:node@c-0.me)   50  | 366680 
-> [ 613.000000] (1:node@c-0.me)   58  | 366680 
-> [ 613.000000] (1:node@c-0.me)   74  |  42 
-> [ 613.000000] (1:node@c-0.me)  106  |  42 
-> [ 613.000000] (1:node@c-0.me)  170  |  42 
-> [ 613.000000] (1:node@c-0.me)  298  |  42 
-> [ 613.000000] (1:node@c-0.me)  554  |  42 
-> [ 613.000000] (1:node@c-0.me)  1066  |  42 
-> [ 613.000000] (1:node@c-0.me)  2090  |  42 
-> [ 613.000000] (1:node@c-0.me)  4138  |  42 
-> [ 613.000000] (1:node@c-0.me)  8234  |  42 
-> [ 613.000000] (1:node@c-0.me)  16426  |  42 
-> [ 613.000000] (1:node@c-0.me)  32810  |  42 
-> [ 613.000000] (1:node@c-0.me)  65578  |  42 
-> [ 613.000000] (1:node@c-0.me)  131114  |  42 
-> [ 613.000000] (1:node@c-0.me)  262186  |  42 
-> [ 613.000000] (1:node@c-0.me)  524330  |  42 
-> [ 613.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 613.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 613.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 613.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 613.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 616.000000] (3:node@c-2.me) My finger table:
-> [ 616.000000] (3:node@c-2.me) Start | Succ 
-> [ 616.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 616.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 616.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 616.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 616.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 616.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 616.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 616.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 616.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 616.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 616.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 616.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 616.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 616.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 616.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 616.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 616.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 616.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 616.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 620.000000] (6:node@c-5.me) My finger table:
-> [ 620.000000] (6:node@c-5.me) Start | Succ 
-> [ 620.000000] (6:node@c-5.me)  10874877  | 16728096 
-> [ 620.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 620.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 620.000000] (6:node@c-5.me) Predecessor: -1
-> [ 629.000000] (8:node@c-7.me) My finger table:
-> [ 629.000000] (8:node@c-7.me) Start | Succ 
-> [ 629.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 629.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 630.000000] (5:node@c-4.me) My finger table:
-> [ 630.000000] (5:node@c-4.me) Start | Succ 
-> [ 630.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 630.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 653.000000] (7:node@c-6.me) My finger table:
-> [ 653.000000] (7:node@c-6.me) Start | Succ 
-> [ 653.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 653.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 663.000000] (2:node@c-1.me) My finger table:
-> [ 663.000000] (2:node@c-1.me) Start | Succ 
-> [ 663.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 663.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 663.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 663.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 663.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 663.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 663.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 663.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 663.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 663.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 663.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 663.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 663.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 663.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 663.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 663.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 663.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 663.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 663.000000] (2:node@c-1.me) Predecessor: 42
-> [ 668.000000] (4:node@c-3.me) My finger table:
-> [ 668.000000] (4:node@c-3.me) Start | Succ 
-> [ 668.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 668.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 683.000000] (5:node@c-4.me) My finger table:
-> [ 683.000000] (5:node@c-4.me) Start | Succ 
-> [ 683.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 683.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 688.000000] (9:node@c-8.me) My finger table:
-> [ 688.000000] (9:node@c-8.me) Start | Succ 
-> [ 688.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 688.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 688.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 699.000000] (10:node@c-9.me) My finger table:
-> [ 699.000000] (10:node@c-9.me) Start | Succ 
-> [ 699.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 699.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 733.000000] (6:node@c-5.me) My finger table:
-> [ 733.000000] (6:node@c-5.me) Start | Succ 
-> [ 733.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 733.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 733.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 733.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 735.000000] (1:node@c-0.me) My finger table:
-> [ 735.000000] (1:node@c-0.me) Start | Succ 
-> [ 735.000000] (1:node@c-0.me)   43  | 366680 
-> [ 735.000000] (1:node@c-0.me)   44  | 366680 
-> [ 735.000000] (1:node@c-0.me)   46  | 366680 
-> [ 735.000000] (1:node@c-0.me)   50  | 366680 
-> [ 735.000000] (1:node@c-0.me)   58  | 366680 
-> [ 735.000000] (1:node@c-0.me)   74  | 366680 
-> [ 735.000000] (1:node@c-0.me)  106  |  42 
-> [ 735.000000] (1:node@c-0.me)  170  |  42 
-> [ 735.000000] (1:node@c-0.me)  298  |  42 
-> [ 735.000000] (1:node@c-0.me)  554  |  42 
-> [ 735.000000] (1:node@c-0.me)  1066  |  42 
-> [ 735.000000] (1:node@c-0.me)  2090  |  42 
-> [ 735.000000] (1:node@c-0.me)  4138  |  42 
-> [ 735.000000] (1:node@c-0.me)  8234  |  42 
-> [ 735.000000] (1:node@c-0.me)  16426  |  42 
-> [ 735.000000] (1:node@c-0.me)  32810  |  42 
-> [ 735.000000] (1:node@c-0.me)  65578  |  42 
-> [ 735.000000] (1:node@c-0.me)  131114  |  42 
-> [ 735.000000] (1:node@c-0.me)  262186  |  42 
-> [ 735.000000] (1:node@c-0.me)  524330  |  42 
-> [ 735.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 735.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 735.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 735.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 735.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 743.000000] (3:node@c-2.me) My finger table:
-> [ 743.000000] (3:node@c-2.me) Start | Succ 
-> [ 743.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 743.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 743.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533776  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 743.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 743.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 743.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 743.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 743.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 743.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 743.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 743.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 743.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 743.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 743.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 743.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 743.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 743.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 743.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 752.000000] (5:node@c-4.me) My finger table:
-> [ 752.000000] (5:node@c-4.me) Start | Succ 
-> [ 752.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509437  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 752.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 753.000000] (6:node@c-5.me) My finger table:
-> [ 753.000000] (6:node@c-5.me) Start | Succ 
-> [ 753.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 753.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 753.000000] (6:node@c-5.me)  10874908  | 16509405 
-> [ 753.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 753.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 765.000000] (8:node@c-7.me) My finger table:
-> [ 765.000000] (8:node@c-7.me) Start | Succ 
-> [ 765.000000] (8:node@c-7.me)  10004761  | 10874876 
-> [ 765.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004792  | 10874876 
-> [ 765.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 765.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 774.000000] (7:node@c-6.me) My finger table:
-> [ 774.000000] (7:node@c-6.me) Start | Succ 
-> [ 774.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728128  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 774.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 796.000000] (2:node@c-1.me) My finger table:
-> [ 796.000000] (2:node@c-1.me) Start | Succ 
-> [ 796.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 796.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 796.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366712  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 796.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 796.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 796.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 796.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 796.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 796.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 796.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 796.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 796.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 796.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 796.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 796.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 796.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 796.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 796.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 796.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 796.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 796.000000] (2:node@c-1.me) Predecessor: 42
-> [ 808.000000] (9:node@c-8.me) My finger table:
-> [ 808.000000] (9:node@c-8.me) Start | Succ 
-> [ 808.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 808.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518840  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 808.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 810.000000] (4:node@c-3.me) My finger table:
-> [ 810.000000] (4:node@c-3.me) Start | Succ 
-> [ 810.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319770  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 810.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 831.000000] (10:node@c-9.me) My finger table:
-> [ 831.000000] (10:node@c-9.me) Start | Succ 
-> [ 831.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015285  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 831.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 859.000000] (1:node@c-0.me) My finger table:
-> [ 859.000000] (1:node@c-0.me) Start | Succ 
-> [ 859.000000] (1:node@c-0.me)   43  | 366680 
-> [ 859.000000] (1:node@c-0.me)   44  | 366680 
-> [ 859.000000] (1:node@c-0.me)   46  | 366680 
-> [ 859.000000] (1:node@c-0.me)   50  | 366680 
-> [ 859.000000] (1:node@c-0.me)   58  | 366680 
-> [ 859.000000] (1:node@c-0.me)   74  | 366680 
-> [ 859.000000] (1:node@c-0.me)  106  | 366680 
-> [ 859.000000] (1:node@c-0.me)  170  |  42 
-> [ 859.000000] (1:node@c-0.me)  298  |  42 
-> [ 859.000000] (1:node@c-0.me)  554  |  42 
-> [ 859.000000] (1:node@c-0.me)  1066  |  42 
-> [ 859.000000] (1:node@c-0.me)  2090  |  42 
-> [ 859.000000] (1:node@c-0.me)  4138  |  42 
-> [ 859.000000] (1:node@c-0.me)  8234  |  42 
-> [ 859.000000] (1:node@c-0.me)  16426  |  42 
-> [ 859.000000] (1:node@c-0.me)  32810  |  42 
-> [ 859.000000] (1:node@c-0.me)  65578  |  42 
-> [ 859.000000] (1:node@c-0.me)  131114  |  42 
-> [ 859.000000] (1:node@c-0.me)  262186  |  42 
-> [ 859.000000] (1:node@c-0.me)  524330  |  42 
-> [ 859.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 859.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 859.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 859.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 859.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 873.000000] (5:node@c-4.me) My finger table:
-> [ 873.000000] (5:node@c-4.me) Start | Succ 
-> [ 873.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509437  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509469  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 873.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 893.000000] (3:node@c-2.me) My finger table:
-> [ 893.000000] (3:node@c-2.me) Start | Succ 
-> [ 893.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 893.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 893.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533776  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533808  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 893.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 893.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 893.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 893.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 893.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 893.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 893.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 893.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 893.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 893.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 893.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 893.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 893.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 893.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 896.000000] (7:node@c-6.me) My finger table:
-> [ 896.000000] (7:node@c-6.me) Start | Succ 
-> [ 896.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728128  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728160  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 896.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 899.000000] (6:node@c-5.me) My finger table:
-> [ 899.000000] (6:node@c-5.me) Start | Succ 
-> [ 899.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 899.000000] (6:node@c-5.me)  10874908  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10874940  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 899.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 899.000000] (8:node@c-7.me) My finger table:
-> [ 899.000000] (8:node@c-7.me) Start | Succ 
-> [ 899.000000] (8:node@c-7.me)  10004761  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004792  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004824  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 899.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 921.000000] (2:node@c-1.me) My finger table:
-> [ 921.000000] (2:node@c-1.me) Start | Succ 
-> [ 921.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 921.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 921.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366712  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366744  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 921.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 921.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 921.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 921.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 921.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 921.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 921.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 921.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 921.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 921.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 921.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 921.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 921.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 921.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 921.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 921.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 921.000000] (2:node@c-1.me) Predecessor: 42
-> [ 928.000000] (9:node@c-8.me) My finger table:
-> [ 928.000000] (9:node@c-8.me) Start | Succ 
-> [ 928.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 928.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518840  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518872  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 928.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 930.000000] (4:node@c-3.me) My finger table:
-> [ 930.000000] (4:node@c-3.me) Start | Succ 
-> [ 930.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319770  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319802  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 930.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 962.000000] (10:node@c-9.me) My finger table:
-> [ 962.000000] (10:node@c-9.me) Start | Succ 
-> [ 962.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015285  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015317  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 962.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 982.000000] (1:node@c-0.me) My finger table:
-> [ 982.000000] (1:node@c-0.me) Start | Succ 
-> [ 982.000000] (1:node@c-0.me)   43  | 366680 
-> [ 982.000000] (1:node@c-0.me)   44  | 366680 
-> [ 982.000000] (1:node@c-0.me)   46  | 366680 
-> [ 982.000000] (1:node@c-0.me)   50  | 366680 
-> [ 982.000000] (1:node@c-0.me)   58  | 366680 
-> [ 982.000000] (1:node@c-0.me)   74  | 366680 
-> [ 982.000000] (1:node@c-0.me)  106  | 366680 
-> [ 982.000000] (1:node@c-0.me)  170  | 366680 
-> [ 982.000000] (1:node@c-0.me)  298  |  42 
-> [ 982.000000] (1:node@c-0.me)  554  |  42 
-> [ 982.000000] (1:node@c-0.me)  1066  |  42 
-> [ 982.000000] (1:node@c-0.me)  2090  |  42 
-> [ 982.000000] (1:node@c-0.me)  4138  |  42 
-> [ 982.000000] (1:node@c-0.me)  8234  |  42 
-> [ 982.000000] (1:node@c-0.me)  16426  |  42 
-> [ 982.000000] (1:node@c-0.me)  32810  |  42 
-> [ 982.000000] (1:node@c-0.me)  65578  |  42 
-> [ 982.000000] (1:node@c-0.me)  131114  |  42 
-> [ 982.000000] (1:node@c-0.me)  262186  |  42 
-> [ 982.000000] (1:node@c-0.me)  524330  |  42 
-> [ 982.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 982.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 982.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 982.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 982.000000] (1:node@c-0.me) Predecessor: 16728096
-> [1154.000000] (0:@) Messages created: 2049
-> [1154.000000] (0:@) Simulated time: 1154
+> [ 174.000000] (1:node@c-0.me) My finger table:
+> [ 174.000000] (1:node@c-0.me) Start | Succ 
+> [ 174.000000] (1:node@c-0.me)   43  | 1319738 
+> [ 174.000000] (1:node@c-0.me)   44  |  42 
+> [ 174.000000] (1:node@c-0.me)   46  |  42 
+> [ 174.000000] (1:node@c-0.me)   50  |  42 
+> [ 174.000000] (1:node@c-0.me)   58  |  42 
+> [ 174.000000] (1:node@c-0.me)   74  |  42 
+> [ 174.000000] (1:node@c-0.me)  106  |  42 
+> [ 174.000000] (1:node@c-0.me)  170  |  42 
+> [ 174.000000] (1:node@c-0.me)  298  |  42 
+> [ 174.000000] (1:node@c-0.me)  554  |  42 
+> [ 174.000000] (1:node@c-0.me)  1066  |  42 
+> [ 174.000000] (1:node@c-0.me)  2090  |  42 
+> [ 174.000000] (1:node@c-0.me)  4138  |  42 
+> [ 174.000000] (1:node@c-0.me)  8234  |  42 
+> [ 174.000000] (1:node@c-0.me)  16426  |  42 
+> [ 174.000000] (1:node@c-0.me)  32810  |  42 
+> [ 174.000000] (1:node@c-0.me)  65578  |  42 
+> [ 174.000000] (1:node@c-0.me)  131114  |  42 
+> [ 174.000000] (1:node@c-0.me)  262186  |  42 
+> [ 174.000000] (1:node@c-0.me)  524330  |  42 
+> [ 174.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 174.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 174.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 174.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 174.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 245.000000] (8:node@c-7.me) My finger table:
+> [ 245.000000] (8:node@c-7.me) Start | Succ 
+> [ 245.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 245.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 245.000000] (8:node@c-7.me)  10004764  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 245.000000] (8:node@c-7.me) Predecessor: 533744
+> [ 246.000000] (3:node@c-2.me) My finger table:
+> [ 246.000000] (3:node@c-2.me) Start | Succ 
+> [ 246.000000] (3:node@c-2.me)  533745  | 10004760 
+> [ 246.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 246.000000] (3:node@c-2.me)  533748  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533752  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 246.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 246.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 246.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 246.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 246.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 246.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 246.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 246.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 246.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 246.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 246.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 246.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 246.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 246.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 246.000000] (5:node@c-4.me) My finger table:
+> [ 246.000000] (5:node@c-4.me) Start | Succ 
+> [ 246.000000] (5:node@c-4.me)  16509406  | 366680 
+> [ 246.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 246.000000] (5:node@c-4.me)  16509409  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509413  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 246.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 247.000000] (6:node@c-5.me) My finger table:
+> [ 247.000000] (6:node@c-5.me) Start | Succ 
+> [ 247.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 247.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 247.000000] (6:node@c-5.me)  10874880  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874884  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 247.000000] (6:node@c-5.me) Predecessor: -1
+> [ 247.000000] (7:node@c-6.me) My finger table:
+> [ 247.000000] (7:node@c-6.me) Start | Succ 
+> [ 247.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 247.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 247.000000] (7:node@c-6.me)  16728100  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 247.000000] (7:node@c-6.me) Predecessor: 2015253
+> [ 253.000000] (1:node@c-0.me) My finger table:
+> [ 253.000000] (1:node@c-0.me) Start | Succ 
+> [ 253.000000] (1:node@c-0.me)   43  | 1319738 
+> [ 253.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 253.000000] (1:node@c-0.me)   46  |  42 
+> [ 253.000000] (1:node@c-0.me)   50  |  42 
+> [ 253.000000] (1:node@c-0.me)   58  |  42 
+> [ 253.000000] (1:node@c-0.me)   74  |  42 
+> [ 253.000000] (1:node@c-0.me)  106  |  42 
+> [ 253.000000] (1:node@c-0.me)  170  |  42 
+> [ 253.000000] (1:node@c-0.me)  298  |  42 
+> [ 253.000000] (1:node@c-0.me)  554  |  42 
+> [ 253.000000] (1:node@c-0.me)  1066  |  42 
+> [ 253.000000] (1:node@c-0.me)  2090  |  42 
+> [ 253.000000] (1:node@c-0.me)  4138  |  42 
+> [ 253.000000] (1:node@c-0.me)  8234  |  42 
+> [ 253.000000] (1:node@c-0.me)  16426  |  42 
+> [ 253.000000] (1:node@c-0.me)  32810  |  42 
+> [ 253.000000] (1:node@c-0.me)  65578  |  42 
+> [ 253.000000] (1:node@c-0.me)  131114  |  42 
+> [ 253.000000] (1:node@c-0.me)  262186  |  42 
+> [ 253.000000] (1:node@c-0.me)  524330  |  42 
+> [ 253.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 253.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 253.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 253.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 253.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 255.000000] (2:node@c-1.me) My finger table:
+> [ 255.000000] (2:node@c-1.me) Start | Succ 
+> [ 255.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 255.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 255.000000] (2:node@c-1.me)  366684  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 255.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 255.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 255.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 255.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 255.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 255.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 255.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 255.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 255.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 255.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 255.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 255.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 255.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 255.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 255.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 255.000000] (2:node@c-1.me) Predecessor: 16509405
+> [ 260.000000] (4:node@c-3.me) My finger table:
+> [ 260.000000] (4:node@c-3.me) Start | Succ 
+> [ 260.000000] (4:node@c-3.me)  1319739  | 6518808 
+> [ 260.000000] (4:node@c-3.me)  1319740  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319742  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 260.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 292.000000] (7:node@c-6.me) My finger table:
+> [ 292.000000] (7:node@c-6.me) Start | Succ 
+> [ 292.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 292.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 292.000000] (7:node@c-6.me)  16728100  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 292.000000] (7:node@c-6.me) Predecessor: 6518808
+> [ 300.000000] (9:node@c-8.me) My finger table:
+> [ 300.000000] (9:node@c-8.me) Start | Succ 
+> [ 300.000000] (9:node@c-8.me)  6518809  | 16728096 
+> [ 300.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 300.000000] (9:node@c-8.me)  6518812  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 300.000000] (9:node@c-8.me) Predecessor: 1319738
+> [ 301.000000] (10:node@c-9.me) My finger table:
+> [ 301.000000] (10:node@c-9.me) Start | Succ 
+> [ 301.000000] (10:node@c-9.me)  2015254  | 16728096 
+> [ 301.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 301.000000] (10:node@c-9.me)  2015257  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 301.000000] (10:node@c-9.me) Predecessor: -1
+> [ 302.000000] (2:node@c-1.me) My finger table:
+> [ 302.000000] (2:node@c-1.me) Start | Succ 
+> [ 302.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 302.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 302.000000] (2:node@c-1.me)  366684  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 302.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 302.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 302.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 302.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 302.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 302.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 302.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 302.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 302.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 302.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 302.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 302.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 302.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 302.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 302.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 302.000000] (2:node@c-1.me) Predecessor: 42
+> [ 306.000000] (4:node@c-3.me) My finger table:
+> [ 306.000000] (4:node@c-3.me) Start | Succ 
+> [ 306.000000] (4:node@c-3.me)  1319739  | 6518808 
+> [ 306.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 306.000000] (4:node@c-3.me)  1319742  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 306.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 339.000000] (9:node@c-8.me) My finger table:
+> [ 339.000000] (9:node@c-8.me) Start | Succ 
+> [ 339.000000] (9:node@c-8.me)  6518809  | 16728096 
+> [ 339.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 339.000000] (9:node@c-8.me)  6518812  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 339.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 367.000000] (6:node@c-5.me) My finger table:
+> [ 367.000000] (6:node@c-5.me) Start | Succ 
+> [ 367.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874884  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 367.000000] (6:node@c-5.me) Predecessor: -1
+> [ 368.000000] (3:node@c-2.me) My finger table:
+> [ 368.000000] (3:node@c-2.me) Start | Succ 
+> [ 368.000000] (3:node@c-2.me)  533745  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533752  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 368.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 368.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 368.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 368.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 368.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 368.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 368.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 368.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 368.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 368.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 368.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 368.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 368.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 368.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 368.000000] (5:node@c-4.me) My finger table:
+> [ 368.000000] (5:node@c-4.me) Start | Succ 
+> [ 368.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 368.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 368.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 368.000000] (5:node@c-4.me)  16509413  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 368.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 370.000000] (8:node@c-7.me) My finger table:
+> [ 370.000000] (8:node@c-7.me) Start | Succ 
+> [ 370.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 370.000000] (8:node@c-7.me) Predecessor: 533744
+> [ 373.000000] (7:node@c-6.me) My finger table:
+> [ 373.000000] (7:node@c-6.me) Start | Succ 
+> [ 373.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 373.000000] (7:node@c-6.me) Predecessor: 6518808
+> [ 375.000000] (2:node@c-1.me) My finger table:
+> [ 375.000000] (2:node@c-1.me) Start | Succ 
+> [ 375.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 375.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 375.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 375.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 375.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 375.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 375.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 375.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 375.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 375.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 375.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 375.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 375.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 375.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 375.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 375.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 375.000000] (2:node@c-1.me) Predecessor: 42
+> [ 382.000000] (1:node@c-0.me) My finger table:
+> [ 382.000000] (1:node@c-0.me) Start | Succ 
+> [ 382.000000] (1:node@c-0.me)   43  | 366680 
+> [ 382.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 382.000000] (1:node@c-0.me)   46  | 366680 
+> [ 382.000000] (1:node@c-0.me)   50  |  42 
+> [ 382.000000] (1:node@c-0.me)   58  |  42 
+> [ 382.000000] (1:node@c-0.me)   74  |  42 
+> [ 382.000000] (1:node@c-0.me)  106  |  42 
+> [ 382.000000] (1:node@c-0.me)  170  |  42 
+> [ 382.000000] (1:node@c-0.me)  298  |  42 
+> [ 382.000000] (1:node@c-0.me)  554  |  42 
+> [ 382.000000] (1:node@c-0.me)  1066  |  42 
+> [ 382.000000] (1:node@c-0.me)  2090  |  42 
+> [ 382.000000] (1:node@c-0.me)  4138  |  42 
+> [ 382.000000] (1:node@c-0.me)  8234  |  42 
+> [ 382.000000] (1:node@c-0.me)  16426  |  42 
+> [ 382.000000] (1:node@c-0.me)  32810  |  42 
+> [ 382.000000] (1:node@c-0.me)  65578  |  42 
+> [ 382.000000] (1:node@c-0.me)  131114  |  42 
+> [ 382.000000] (1:node@c-0.me)  262186  |  42 
+> [ 382.000000] (1:node@c-0.me)  524330  |  42 
+> [ 382.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 382.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 382.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 382.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 382.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 383.000000] (7:node@c-6.me) My finger table:
+> [ 383.000000] (7:node@c-6.me) Start | Succ 
+> [ 383.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 383.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 385.000000] (10:node@c-9.me) My finger table:
+> [ 385.000000] (10:node@c-9.me) Start | Succ 
+> [ 385.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 385.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 385.000000] (10:node@c-9.me)  2015257  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 385.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 427.000000] (9:node@c-8.me) My finger table:
+> [ 427.000000] (9:node@c-8.me) Start | Succ 
+> [ 427.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 427.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 427.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 427.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 427.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 432.000000] (10:node@c-9.me) My finger table:
+> [ 432.000000] (10:node@c-9.me) Start | Succ 
+> [ 432.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 432.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 432.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 432.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 432.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 484.000000] (4:node@c-3.me) My finger table:
+> [ 484.000000] (4:node@c-3.me) Start | Succ 
+> [ 484.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 484.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 484.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 484.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 484.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 487.000000] (6:node@c-5.me) My finger table:
+> [ 487.000000] (6:node@c-5.me) Start | Succ 
+> [ 487.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 487.000000] (6:node@c-5.me) Predecessor: -1
+> [ 490.000000] (8:node@c-7.me) My finger table:
+> [ 490.000000] (8:node@c-7.me) Start | Succ 
+> [ 490.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 490.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 491.000000] (8:node@c-7.me) My finger table:
+> [ 491.000000] (8:node@c-7.me) Start | Succ 
+> [ 491.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 491.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 496.000000] (7:node@c-6.me) My finger table:
+> [ 496.000000] (7:node@c-6.me) Start | Succ 
+> [ 496.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 496.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 497.000000] (3:node@c-2.me) My finger table:
+> [ 497.000000] (3:node@c-2.me) Start | Succ 
+> [ 497.000000] (3:node@c-2.me)  533745  | 6518808 
+> [ 497.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 497.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 497.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 497.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 497.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 497.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 497.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 497.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 497.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 497.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 497.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 497.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 497.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 497.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 497.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 497.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 497.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 497.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 502.000000] (1:node@c-0.me) My finger table:
+> [ 502.000000] (1:node@c-0.me) Start | Succ 
+> [ 502.000000] (1:node@c-0.me)   43  | 366680 
+> [ 502.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 502.000000] (1:node@c-0.me)   46  | 366680 
+> [ 502.000000] (1:node@c-0.me)   50  | 366680 
+> [ 502.000000] (1:node@c-0.me)   58  |  42 
+> [ 502.000000] (1:node@c-0.me)   74  |  42 
+> [ 502.000000] (1:node@c-0.me)  106  |  42 
+> [ 502.000000] (1:node@c-0.me)  170  |  42 
+> [ 502.000000] (1:node@c-0.me)  298  |  42 
+> [ 502.000000] (1:node@c-0.me)  554  |  42 
+> [ 502.000000] (1:node@c-0.me)  1066  |  42 
+> [ 502.000000] (1:node@c-0.me)  2090  |  42 
+> [ 502.000000] (1:node@c-0.me)  4138  |  42 
+> [ 502.000000] (1:node@c-0.me)  8234  |  42 
+> [ 502.000000] (1:node@c-0.me)  16426  |  42 
+> [ 502.000000] (1:node@c-0.me)  32810  |  42 
+> [ 502.000000] (1:node@c-0.me)  65578  |  42 
+> [ 502.000000] (1:node@c-0.me)  131114  |  42 
+> [ 502.000000] (1:node@c-0.me)  262186  |  42 
+> [ 502.000000] (1:node@c-0.me)  524330  |  42 
+> [ 502.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 502.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 502.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 502.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 502.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 505.000000] (2:node@c-1.me) My finger table:
+> [ 505.000000] (2:node@c-1.me) Start | Succ 
+> [ 505.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 505.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 505.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 505.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 505.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 505.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 505.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 505.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 505.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 505.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 505.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 505.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 505.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 505.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 505.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 505.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 505.000000] (2:node@c-1.me) Predecessor: 42
+> [ 513.000000] (5:node@c-4.me) My finger table:
+> [ 513.000000] (5:node@c-4.me) Start | Succ 
+> [ 513.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 513.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 513.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 558.000000] (9:node@c-8.me) My finger table:
+> [ 558.000000] (9:node@c-8.me) Start | Succ 
+> [ 558.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 558.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 558.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 573.000000] (10:node@c-9.me) My finger table:
+> [ 573.000000] (10:node@c-9.me) Start | Succ 
+> [ 573.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 573.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 573.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 600.000000] (4:node@c-3.me) My finger table:
+> [ 600.000000] (4:node@c-3.me) Start | Succ 
+> [ 600.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 600.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 600.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 600.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 600.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 610.000000] (6:node@c-5.me) My finger table:
+> [ 610.000000] (6:node@c-5.me) Start | Succ 
+> [ 610.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 610.000000] (6:node@c-5.me) Predecessor: -1
+> [ 656.000000] (5:node@c-4.me) My finger table:
+> [ 656.000000] (5:node@c-4.me) Start | Succ 
+> [ 656.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 656.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 656.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 657.000000] (7:node@c-6.me) My finger table:
+> [ 657.000000] (7:node@c-6.me) Start | Succ 
+> [ 657.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 657.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 663.000000] (4:node@c-3.me) My finger table:
+> [ 663.000000] (4:node@c-3.me) Start | Succ 
+> [ 663.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 663.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 663.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 665.000000] (1:node@c-0.me) My finger table:
+> [ 665.000000] (1:node@c-0.me) Start | Succ 
+> [ 665.000000] (1:node@c-0.me)   43  | 366680 
+> [ 665.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 665.000000] (1:node@c-0.me)   46  | 366680 
+> [ 665.000000] (1:node@c-0.me)   50  | 366680 
+> [ 665.000000] (1:node@c-0.me)   58  | 366680 
+> [ 665.000000] (1:node@c-0.me)   74  |  42 
+> [ 665.000000] (1:node@c-0.me)  106  |  42 
+> [ 665.000000] (1:node@c-0.me)  170  |  42 
+> [ 665.000000] (1:node@c-0.me)  298  |  42 
+> [ 665.000000] (1:node@c-0.me)  554  |  42 
+> [ 665.000000] (1:node@c-0.me)  1066  |  42 
+> [ 665.000000] (1:node@c-0.me)  2090  |  42 
+> [ 665.000000] (1:node@c-0.me)  4138  |  42 
+> [ 665.000000] (1:node@c-0.me)  8234  |  42 
+> [ 665.000000] (1:node@c-0.me)  16426  |  42 
+> [ 665.000000] (1:node@c-0.me)  32810  |  42 
+> [ 665.000000] (1:node@c-0.me)  65578  |  42 
+> [ 665.000000] (1:node@c-0.me)  131114  |  42 
+> [ 665.000000] (1:node@c-0.me)  262186  |  42 
+> [ 665.000000] (1:node@c-0.me)  524330  |  42 
+> [ 665.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 665.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 665.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 665.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 665.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 669.000000] (8:node@c-7.me) My finger table:
+> [ 669.000000] (8:node@c-7.me) Start | Succ 
+> [ 669.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 669.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 671.000000] (3:node@c-2.me) My finger table:
+> [ 671.000000] (3:node@c-2.me) Start | Succ 
+> [ 671.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 671.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 671.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 671.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 671.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 671.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 671.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 671.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 671.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 671.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 671.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 671.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 671.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 671.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 671.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 671.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 671.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 671.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 671.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 671.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 671.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 671.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 678.000000] (9:node@c-8.me) My finger table:
+> [ 678.000000] (9:node@c-8.me) Start | Succ 
+> [ 678.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 678.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 678.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 683.000000] (2:node@c-1.me) My finger table:
+> [ 683.000000] (2:node@c-1.me) Start | Succ 
+> [ 683.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 683.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 683.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 683.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 683.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 683.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 683.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 683.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 683.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 683.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 683.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 683.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 683.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 683.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 683.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 683.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 683.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 683.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 683.000000] (2:node@c-1.me) Predecessor: 42
+> [ 684.000000] (3:node@c-2.me) My finger table:
+> [ 684.000000] (3:node@c-2.me) Start | Succ 
+> [ 684.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 684.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 684.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 684.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 684.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 684.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 684.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 684.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 684.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 684.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 684.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 684.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 684.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 684.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 684.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 684.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 684.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 684.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 684.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 684.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 684.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 684.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 721.000000] (10:node@c-9.me) My finger table:
+> [ 721.000000] (10:node@c-9.me) Start | Succ 
+> [ 721.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 721.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 721.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 744.000000] (6:node@c-5.me) My finger table:
+> [ 744.000000] (6:node@c-5.me) Start | Succ 
+> [ 744.000000] (6:node@c-5.me)  10874877  | 16728096 
+> [ 744.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 744.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 744.000000] (6:node@c-5.me) Predecessor: -1
+> [ 777.000000] (7:node@c-6.me) My finger table:
+> [ 777.000000] (7:node@c-6.me) Start | Succ 
+> [ 777.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728128  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 777.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 786.000000] (5:node@c-4.me) My finger table:
+> [ 786.000000] (5:node@c-4.me) Start | Succ 
+> [ 786.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 786.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 786.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 787.000000] (4:node@c-3.me) My finger table:
+> [ 787.000000] (4:node@c-3.me) Start | Succ 
+> [ 787.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 787.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319754  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 787.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 788.000000] (1:node@c-0.me) My finger table:
+> [ 788.000000] (1:node@c-0.me) Start | Succ 
+> [ 788.000000] (1:node@c-0.me)   43  | 366680 
+> [ 788.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 788.000000] (1:node@c-0.me)   46  | 366680 
+> [ 788.000000] (1:node@c-0.me)   50  | 366680 
+> [ 788.000000] (1:node@c-0.me)   58  | 366680 
+> [ 788.000000] (1:node@c-0.me)   74  | 366680 
+> [ 788.000000] (1:node@c-0.me)  106  |  42 
+> [ 788.000000] (1:node@c-0.me)  170  |  42 
+> [ 788.000000] (1:node@c-0.me)  298  |  42 
+> [ 788.000000] (1:node@c-0.me)  554  |  42 
+> [ 788.000000] (1:node@c-0.me)  1066  |  42 
+> [ 788.000000] (1:node@c-0.me)  2090  |  42 
+> [ 788.000000] (1:node@c-0.me)  4138  |  42 
+> [ 788.000000] (1:node@c-0.me)  8234  |  42 
+> [ 788.000000] (1:node@c-0.me)  16426  |  42 
+> [ 788.000000] (1:node@c-0.me)  32810  |  42 
+> [ 788.000000] (1:node@c-0.me)  65578  |  42 
+> [ 788.000000] (1:node@c-0.me)  131114  |  42 
+> [ 788.000000] (1:node@c-0.me)  262186  |  42 
+> [ 788.000000] (1:node@c-0.me)  524330  |  42 
+> [ 788.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 788.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 788.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 788.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 788.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 793.000000] (3:node@c-2.me) My finger table:
+> [ 793.000000] (3:node@c-2.me) Start | Succ 
+> [ 793.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 793.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 793.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 793.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533776  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 793.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 793.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 793.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 793.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 793.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 793.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 793.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 793.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 793.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 793.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 793.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 793.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 793.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 793.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 793.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 797.000000] (5:node@c-4.me) My finger table:
+> [ 797.000000] (5:node@c-4.me) Start | Succ 
+> [ 797.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 797.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 797.000000] (5:node@c-4.me) Predecessor: 10874876
+> [ 798.000000] (8:node@c-7.me) My finger table:
+> [ 798.000000] (8:node@c-7.me) Start | Succ 
+> [ 798.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004792  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 798.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 801.000000] (9:node@c-8.me) My finger table:
+> [ 801.000000] (9:node@c-8.me) Start | Succ 
+> [ 801.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 801.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518840  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 801.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 804.000000] (2:node@c-1.me) My finger table:
+> [ 804.000000] (2:node@c-1.me) Start | Succ 
+> [ 804.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366712  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 804.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 804.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 804.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 804.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 804.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 804.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 804.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 804.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 804.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 804.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 804.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 804.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 804.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 804.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 804.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 804.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 804.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 804.000000] (2:node@c-1.me) Predecessor: 42
+> [ 843.000000] (10:node@c-9.me) My finger table:
+> [ 843.000000] (10:node@c-9.me) Start | Succ 
+> [ 843.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 843.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015285  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 843.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 865.000000] (6:node@c-5.me) My finger table:
+> [ 865.000000] (6:node@c-5.me) Start | Succ 
+> [ 865.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 865.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 865.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 865.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 865.000000] (6:node@c-5.me) Predecessor: -1
+> [ 870.000000] (6:node@c-5.me) My finger table:
+> [ 870.000000] (6:node@c-5.me) Start | Succ 
+> [ 870.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 870.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 870.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 870.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 870.000000] (6:node@c-5.me) Predecessor: 10004760
+> [ 910.000000] (5:node@c-4.me) My finger table:
+> [ 910.000000] (5:node@c-4.me) Start | Succ 
+> [ 910.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 910.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509469  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 910.000000] (5:node@c-4.me) Predecessor: 10874876
+> [ 912.000000] (1:node@c-0.me) My finger table:
+> [ 912.000000] (1:node@c-0.me) Start | Succ 
+> [ 912.000000] (1:node@c-0.me)   43  | 366680 
+> [ 912.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 912.000000] (1:node@c-0.me)   46  | 366680 
+> [ 912.000000] (1:node@c-0.me)   50  | 366680 
+> [ 912.000000] (1:node@c-0.me)   58  | 366680 
+> [ 912.000000] (1:node@c-0.me)   74  | 366680 
+> [ 912.000000] (1:node@c-0.me)  106  | 366680 
+> [ 912.000000] (1:node@c-0.me)  170  |  42 
+> [ 912.000000] (1:node@c-0.me)  298  |  42 
+> [ 912.000000] (1:node@c-0.me)  554  |  42 
+> [ 912.000000] (1:node@c-0.me)  1066  |  42 
+> [ 912.000000] (1:node@c-0.me)  2090  |  42 
+> [ 912.000000] (1:node@c-0.me)  4138  |  42 
+> [ 912.000000] (1:node@c-0.me)  8234  |  42 
+> [ 912.000000] (1:node@c-0.me)  16426  |  42 
+> [ 912.000000] (1:node@c-0.me)  32810  |  42 
+> [ 912.000000] (1:node@c-0.me)  65578  |  42 
+> [ 912.000000] (1:node@c-0.me)  131114  |  42 
+> [ 912.000000] (1:node@c-0.me)  262186  |  42 
+> [ 912.000000] (1:node@c-0.me)  524330  |  42 
+> [ 912.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 912.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 912.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 912.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 912.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 913.000000] (3:node@c-2.me) My finger table:
+> [ 913.000000] (3:node@c-2.me) Start | Succ 
+> [ 913.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 913.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 913.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 913.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533776  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533808  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 913.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 913.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 913.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 913.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 913.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 913.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 913.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 913.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 913.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 913.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 913.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 913.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 913.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 913.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 921.000000] (8:node@c-7.me) My finger table:
+> [ 921.000000] (8:node@c-7.me) Start | Succ 
+> [ 921.000000] (8:node@c-7.me)  10004761  | 10874876 
+> [ 921.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004792  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004824  | 10874876 
+> [ 921.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 921.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 964.000000] (2:node@c-1.me) My finger table:
+> [ 964.000000] (2:node@c-1.me) Start | Succ 
+> [ 964.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366712  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366744  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 964.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 964.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 964.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 964.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 964.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 964.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 964.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 964.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 964.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 964.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 964.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 964.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 964.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 964.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 964.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 964.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 964.000000] (2:node@c-1.me) Predecessor: 42
+> [ 966.000000] (4:node@c-3.me) My finger table:
+> [ 966.000000] (4:node@c-3.me) Start | Succ 
+> [ 966.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 966.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319754  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319770  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 966.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 966.000000] (7:node@c-6.me) My finger table:
+> [ 966.000000] (7:node@c-6.me) Start | Succ 
+> [ 966.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728128  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728160  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 966.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 973.000000] (9:node@c-8.me) My finger table:
+> [ 973.000000] (9:node@c-8.me) Start | Succ 
+> [ 973.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 973.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518840  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518872  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 973.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 979.000000] (10:node@c-9.me) My finger table:
+> [ 979.000000] (10:node@c-9.me) Start | Succ 
+> [ 979.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 979.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015285  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015317  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 979.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 987.000000] (6:node@c-5.me) My finger table:
+> [ 987.000000] (6:node@c-5.me) Start | Succ 
+> [ 987.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 987.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10875004  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 987.000000] (6:node@c-5.me) Predecessor: 10004760
+> [1196.000000] (0:@) Messages created: 1827
+> [1196.000000] (0:@) Simulated time: 1196
\ No newline at end of file
index dce7b71..78b5acc 100644 (file)
@@ -128,314 +128,296 @@ $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT -nb_bits=6 ${srcdir:=.}/../msg_platfo
 > [141.383343] (1:node@Gatien)    0  |  48 
 > [141.383343] (1:node@Gatien)   16  |  48 
 > [141.383343] (1:node@Gatien) Predecessor: 42
-> [187.430835] (2:node@McGee) My finger table:
-> [187.430835] (2:node@McGee) Start | Succ 
-> [187.430835] (2:node@McGee)   43  |  48 
-> [187.430835] (2:node@McGee)   44  |  42 
-> [187.430835] (2:node@McGee)   46  |  42 
-> [187.430835] (2:node@McGee)   50  |  42 
-> [187.430835] (2:node@McGee)   58  |  42 
-> [187.430835] (2:node@McGee)   10  |  42 
-> [187.430835] (2:node@McGee) Predecessor: 8
-> [224.180962] (2:node@McGee) My finger table:
-> [224.180962] (2:node@McGee) Start | Succ 
-> [224.180962] (2:node@McGee)   43  |  48 
-> [224.180962] (2:node@McGee)   44  |  42 
-> [224.180962] (2:node@McGee)   46  |  42 
-> [224.180962] (2:node@McGee)   50  |  42 
-> [224.180962] (2:node@McGee)   58  |  42 
-> [224.180962] (2:node@McGee)   10  |  42 
-> [224.180962] (2:node@McGee) Predecessor: 38
-> [238.097222] (7:node@Boivin) My finger table:
-> [238.097222] (7:node@Boivin) Start | Succ 
-> [238.097222] (7:node@Boivin)    9  |  38 
-> [238.097222] (7:node@Boivin)   10  |   8 
-> [238.097222] (7:node@Boivin)   12  |   8 
-> [238.097222] (7:node@Boivin)   16  |   8 
-> [238.097222] (7:node@Boivin)   24  |   8 
-> [238.097222] (7:node@Boivin)   40  |   8 
-> [238.097222] (7:node@Boivin) Predecessor: 1
-> [244.544647] (1:node@Gatien) My finger table:
-> [244.544647] (1:node@Gatien) Start | Succ 
-> [244.544647] (1:node@Gatien)   49  |   1 
-> [244.544647] (1:node@Gatien)   50  |   1 
-> [244.544647] (1:node@Gatien)   52  |  48 
-> [244.544647] (1:node@Gatien)   56  |  48 
-> [244.544647] (1:node@Gatien)    0  |  48 
-> [244.544647] (1:node@Gatien)   16  |  48 
-> [244.544647] (1:node@Gatien) Predecessor: 42
-> [251.309994] (7:node@Boivin) My finger table:
-> [251.309994] (7:node@Boivin) Start | Succ 
-> [251.309994] (7:node@Boivin)    9  |  38 
-> [251.309994] (7:node@Boivin)   10  |  38 
-> [251.309994] (7:node@Boivin)   12  |   8 
-> [251.309994] (7:node@Boivin)   16  |   8 
-> [251.309994] (7:node@Boivin)   24  |   8 
-> [251.309994] (7:node@Boivin)   40  |   8 
-> [251.309994] (7:node@Boivin) Predecessor: 1
-> [252.819580] (2:node@McGee) My finger table:
-> [252.819580] (2:node@McGee) Start | Succ 
-> [252.819580] (2:node@McGee)   43  |  48 
-> [252.819580] (2:node@McGee)   44  |  48 
-> [252.819580] (2:node@McGee)   46  |  42 
-> [252.819580] (2:node@McGee)   50  |  42 
-> [252.819580] (2:node@McGee)   58  |  42 
-> [252.819580] (2:node@McGee)   10  |  42 
-> [252.819580] (2:node@McGee) Predecessor: 38
-> [268.906974] (6:node@Jean_Yves) My finger table:
-> [268.906974] (6:node@Jean_Yves) Start | Succ 
-> [268.906974] (6:node@Jean_Yves)   15  |  38 
-> [268.906974] (6:node@Jean_Yves)   16  |  38 
-> [268.906974] (6:node@Jean_Yves)   18  |  14 
-> [268.906974] (6:node@Jean_Yves)   22  |  14 
-> [268.906974] (6:node@Jean_Yves)   30  |  14 
-> [268.906974] (6:node@Jean_Yves)   46  |  14 
-> [268.906974] (6:node@Jean_Yves) Predecessor: -1
-> [272.587495] (3:node@iRMX) My finger table:
-> [272.587495] (3:node@iRMX) Start | Succ 
-> [272.587495] (3:node@iRMX)   39  |  42 
-> [272.587495] (3:node@iRMX)   40  |  38 
-> [272.587495] (3:node@iRMX)   42  |  38 
-> [272.587495] (3:node@iRMX)   46  |  38 
-> [272.587495] (3:node@iRMX)   54  |  38 
-> [272.587495] (3:node@iRMX)    6  |  38 
-> [272.587495] (3:node@iRMX) Predecessor: 8
-> [275.995507] (8:node@Jacquelin) My finger table:
-> [275.995507] (8:node@Jacquelin) Start | Succ 
-> [275.995507] (8:node@Jacquelin)    2  |   8 
-> [275.995507] (8:node@Jacquelin)    3  |   8 
-> [275.995507] (8:node@Jacquelin)    5  |   1 
-> [275.995507] (8:node@Jacquelin)    9  |   1 
-> [275.995507] (8:node@Jacquelin)   17  |   1 
-> [275.995507] (8:node@Jacquelin)   33  |   1 
-> [275.995507] (8:node@Jacquelin) Predecessor: 48
-> [278.895082] (3:node@iRMX) My finger table:
-> [278.895082] (3:node@iRMX) Start | Succ 
-> [278.895082] (3:node@iRMX)   39  |  42 
-> [278.895082] (3:node@iRMX)   40  |  38 
-> [278.895082] (3:node@iRMX)   42  |  38 
-> [278.895082] (3:node@iRMX)   46  |  38 
-> [278.895082] (3:node@iRMX)   54  |  38 
-> [278.895082] (3:node@iRMX)    6  |  38 
-> [278.895082] (3:node@iRMX) Predecessor: 14
-> [285.028772] (3:node@iRMX) My finger table:
-> [285.028772] (3:node@iRMX) Start | Succ 
-> [285.028772] (3:node@iRMX)   39  |  42 
-> [285.028772] (3:node@iRMX)   40  |  42 
-> [285.028772] (3:node@iRMX)   42  |  38 
-> [285.028772] (3:node@iRMX)   46  |  38 
-> [285.028772] (3:node@iRMX)   54  |  38 
-> [285.028772] (3:node@iRMX)    6  |  38 
-> [285.028772] (3:node@iRMX) Predecessor: 14
-> [299.124613] (4:node@Geoff) My finger table:
-> [299.124613] (4:node@Geoff) Start | Succ 
-> [299.124613] (4:node@Geoff)   33  |  38 
-> [299.124613] (4:node@Geoff)   34  |  38 
-> [299.124613] (4:node@Geoff)   36  |  32 
-> [299.124613] (4:node@Geoff)   40  |  32 
-> [299.124613] (4:node@Geoff)   48  |  32 
-> [299.124613] (4:node@Geoff)    0  |  32 
-> [299.124613] (4:node@Geoff) Predecessor: -1
-> [302.471288] (5:node@TeX) My finger table:
-> [302.471288] (5:node@TeX) Start | Succ 
-> [302.471288] (5:node@TeX)   22  |  38 
-> [302.471288] (5:node@TeX)   23  |  38 
-> [302.471288] (5:node@TeX)   25  |  21 
-> [302.471288] (5:node@TeX)   29  |  21 
-> [302.471288] (5:node@TeX)   37  |  21 
-> [302.471288] (5:node@TeX)   53  |  21 
-> [302.471288] (5:node@TeX) Predecessor: -1
-> [309.606669] (3:node@iRMX) My finger table:
-> [309.606669] (3:node@iRMX) Start | Succ 
-> [309.606669] (3:node@iRMX)   39  |  42 
-> [309.606669] (3:node@iRMX)   40  |  42 
-> [309.606669] (3:node@iRMX)   42  |  38 
-> [309.606669] (3:node@iRMX)   46  |  38 
-> [309.606669] (3:node@iRMX)   54  |  38 
-> [309.606669] (3:node@iRMX)    6  |  38 
-> [309.606669] (3:node@iRMX) Predecessor: 32
-> [352.254169] (6:node@Jean_Yves) My finger table:
-> [352.254169] (6:node@Jean_Yves) Start | Succ 
-> [352.254169] (6:node@Jean_Yves)   15  |  32 
-> [352.254169] (6:node@Jean_Yves)   16  |  38 
-> [352.254169] (6:node@Jean_Yves)   18  |  14 
-> [352.254169] (6:node@Jean_Yves)   22  |  14 
-> [352.254169] (6:node@Jean_Yves)   30  |  14 
-> [352.254169] (6:node@Jean_Yves)   46  |  14 
-> [352.254169] (6:node@Jean_Yves) Predecessor: 8
-> [367.424317] (4:node@Geoff) My finger table:
-> [367.424317] (4:node@Geoff) Start | Succ 
-> [367.424317] (4:node@Geoff)   33  |  38 
-> [367.424317] (4:node@Geoff)   34  |  38 
-> [367.424317] (4:node@Geoff)   36  |  32 
-> [367.424317] (4:node@Geoff)   40  |  32 
-> [367.424317] (4:node@Geoff)   48  |  32 
-> [367.424317] (4:node@Geoff)    0  |  32 
-> [367.424317] (4:node@Geoff) Predecessor: 14
-> [368.585370] (1:node@Gatien) My finger table:
-> [368.585370] (1:node@Gatien) Start | Succ 
-> [368.585370] (1:node@Gatien)   49  |   1 
-> [368.585370] (1:node@Gatien)   50  |   1 
-> [368.585370] (1:node@Gatien)   52  |   1 
-> [368.585370] (1:node@Gatien)   56  |  48 
-> [368.585370] (1:node@Gatien)    0  |  48 
-> [368.585370] (1:node@Gatien)   16  |  48 
-> [368.585370] (1:node@Gatien) Predecessor: 42
-> [374.895628] (2:node@McGee) My finger table:
-> [374.895628] (2:node@McGee) Start | Succ 
-> [374.895628] (2:node@McGee)   43  |  48 
-> [374.895628] (2:node@McGee)   44  |  48 
-> [374.895628] (2:node@McGee)   46  |  48 
-> [374.895628] (2:node@McGee)   50  |  42 
-> [374.895628] (2:node@McGee)   58  |  42 
-> [374.895628] (2:node@McGee)   10  |  42 
-> [374.895628] (2:node@McGee) Predecessor: 38
-> [392.072209] (7:node@Boivin) My finger table:
-> [392.072209] (7:node@Boivin) Start | Succ 
-> [392.072209] (7:node@Boivin)    9  |  14 
-> [392.072209] (7:node@Boivin)   10  |  38 
-> [392.072209] (7:node@Boivin)   12  |  14 
-> [392.072209] (7:node@Boivin)   16  |   8 
-> [392.072209] (7:node@Boivin)   24  |   8 
-> [392.072209] (7:node@Boivin)   40  |   8 
-> [392.072209] (7:node@Boivin) Predecessor: 1
-> [398.554322] (4:node@Geoff) My finger table:
-> [398.554322] (4:node@Geoff) Start | Succ 
-> [398.554322] (4:node@Geoff)   33  |  38 
-> [398.554322] (4:node@Geoff)   34  |  38 
-> [398.554322] (4:node@Geoff)   36  |  32 
-> [398.554322] (4:node@Geoff)   40  |  32 
-> [398.554322] (4:node@Geoff)   48  |  32 
-> [398.554322] (4:node@Geoff)    0  |  32 
-> [398.554322] (4:node@Geoff) Predecessor: 21
-> [400.952052] (6:node@Jean_Yves) My finger table:
-> [400.952052] (6:node@Jean_Yves) Start | Succ 
-> [400.952052] (6:node@Jean_Yves)   15  |  21 
-> [400.952052] (6:node@Jean_Yves)   16  |  38 
-> [400.952052] (6:node@Jean_Yves)   18  |  21 
-> [400.952052] (6:node@Jean_Yves)   22  |  14 
-> [400.952052] (6:node@Jean_Yves)   30  |  14 
-> [400.952052] (6:node@Jean_Yves)   46  |  14 
-> [400.952052] (6:node@Jean_Yves) Predecessor: 8
-> [405.305451] (8:node@Jacquelin) My finger table:
-> [405.305451] (8:node@Jacquelin) Start | Succ 
-> [405.305451] (8:node@Jacquelin)    2  |   8 
-> [405.305451] (8:node@Jacquelin)    3  |   8 
-> [405.305451] (8:node@Jacquelin)    5  |   8 
-> [405.305451] (8:node@Jacquelin)    9  |   1 
-> [405.305451] (8:node@Jacquelin)   17  |   1 
-> [405.305451] (8:node@Jacquelin)   33  |   1 
-> [405.305451] (8:node@Jacquelin) Predecessor: 48
-> [410.451797] (3:node@iRMX) My finger table:
-> [410.451797] (3:node@iRMX) Start | Succ 
-> [410.451797] (3:node@iRMX)   39  |  42 
-> [410.451797] (3:node@iRMX)   40  |  42 
-> [410.451797] (3:node@iRMX)   42  |  42 
-> [410.451797] (3:node@iRMX)   46  |  38 
-> [410.451797] (3:node@iRMX)   54  |  38 
-> [410.451797] (3:node@iRMX)    6  |  38 
-> [410.451797] (3:node@iRMX) Predecessor: 32
-> [420.675344] (4:node@Geoff) My finger table:
-> [420.675344] (4:node@Geoff) Start | Succ 
-> [420.675344] (4:node@Geoff)   33  |  38 
-> [420.675344] (4:node@Geoff)   34  |  38 
-> [420.675344] (4:node@Geoff)   36  |  38 
-> [420.675344] (4:node@Geoff)   40  |  32 
-> [420.675344] (4:node@Geoff)   48  |  32 
-> [420.675344] (4:node@Geoff)    0  |  32 
-> [420.675344] (4:node@Geoff) Predecessor: 21
-> [423.624187] (5:node@TeX) My finger table:
-> [423.624187] (5:node@TeX) Start | Succ 
-> [423.624187] (5:node@TeX)   22  |  32 
-> [423.624187] (5:node@TeX)   23  |  38 
-> [423.624187] (5:node@TeX)   25  |  32 
-> [423.624187] (5:node@TeX)   29  |  21 
-> [423.624187] (5:node@TeX)   37  |  21 
-> [423.624187] (5:node@TeX)   53  |  21 
-> [423.624187] (5:node@TeX) Predecessor: -1
-> [437.092176] (5:node@TeX) My finger table:
-> [437.092176] (5:node@TeX) Start | Succ 
-> [437.092176] (5:node@TeX)   22  |  32 
-> [437.092176] (5:node@TeX)   23  |  38 
-> [437.092176] (5:node@TeX)   25  |  32 
-> [437.092176] (5:node@TeX)   29  |  21 
-> [437.092176] (5:node@TeX)   37  |  21 
-> [437.092176] (5:node@TeX)   53  |  21 
-> [437.092176] (5:node@TeX) Predecessor: 14
-> [492.679275] (1:node@Gatien) My finger table:
-> [492.679275] (1:node@Gatien) Start | Succ 
-> [492.679275] (1:node@Gatien)   49  |   1 
-> [492.679275] (1:node@Gatien)   50  |   1 
-> [492.679275] (1:node@Gatien)   52  |   1 
-> [492.679275] (1:node@Gatien)   56  |   1 
-> [492.679275] (1:node@Gatien)    0  |  48 
-> [492.679275] (1:node@Gatien)   16  |  48 
-> [492.679275] (1:node@Gatien) Predecessor: 42
-> [518.542807] (7:node@Boivin) My finger table:
-> [518.542807] (7:node@Boivin) Start | Succ 
-> [518.542807] (7:node@Boivin)    9  |  14 
-> [518.542807] (7:node@Boivin)   10  |  38 
-> [518.542807] (7:node@Boivin)   12  |  14 
-> [518.542807] (7:node@Boivin)   16  |  21 
-> [518.542807] (7:node@Boivin)   24  |   8 
-> [518.542807] (7:node@Boivin)   40  |   8 
-> [518.542807] (7:node@Boivin) Predecessor: 1
-> [535.761245] (2:node@McGee) My finger table:
-> [535.761245] (2:node@McGee) Start | Succ 
-> [535.761245] (2:node@McGee)   43  |  48 
-> [535.761245] (2:node@McGee)   44  |  48 
-> [535.761245] (2:node@McGee)   46  |  48 
-> [535.761245] (2:node@McGee)   50  |   1 
-> [535.761245] (2:node@McGee)   58  |  42 
-> [535.761245] (2:node@McGee)   10  |  42 
-> [535.761245] (2:node@McGee) Predecessor: 38
-> [536.972611] (8:node@Jacquelin) My finger table:
-> [536.972611] (8:node@Jacquelin) Start | Succ 
-> [536.972611] (8:node@Jacquelin)    2  |   8 
-> [536.972611] (8:node@Jacquelin)    3  |   8 
-> [536.972611] (8:node@Jacquelin)    5  |   8 
-> [536.972611] (8:node@Jacquelin)    9  |  14 
-> [536.972611] (8:node@Jacquelin)   17  |   1 
-> [536.972611] (8:node@Jacquelin)   33  |   1 
-> [536.972611] (8:node@Jacquelin) Predecessor: 48
-> [549.045448] (3:node@iRMX) My finger table:
-> [549.045448] (3:node@iRMX) Start | Succ 
-> [549.045448] (3:node@iRMX)   39  |  42 
-> [549.045448] (3:node@iRMX)   40  |  42 
-> [549.045448] (3:node@iRMX)   42  |  42 
-> [549.045448] (3:node@iRMX)   46  |  48 
-> [549.045448] (3:node@iRMX)   54  |  38 
-> [549.045448] (3:node@iRMX)    6  |  38 
-> [549.045448] (3:node@iRMX) Predecessor: 32
-> [555.217227] (6:node@Jean_Yves) My finger table:
-> [555.217227] (6:node@Jean_Yves) Start | Succ 
-> [555.217227] (6:node@Jean_Yves)   15  |  21 
-> [555.217227] (6:node@Jean_Yves)   16  |  38 
-> [555.217227] (6:node@Jean_Yves)   18  |  21 
-> [555.217227] (6:node@Jean_Yves)   22  |  32 
-> [555.217227] (6:node@Jean_Yves)   30  |  14 
-> [555.217227] (6:node@Jean_Yves)   46  |  14 
-> [555.217227] (6:node@Jean_Yves) Predecessor: 8
-> [560.036449] (5:node@TeX) My finger table:
-> [560.036449] (5:node@TeX) Start | Succ 
-> [560.036449] (5:node@TeX)   22  |  32 
-> [560.036449] (5:node@TeX)   23  |  38 
-> [560.036449] (5:node@TeX)   25  |  32 
-> [560.036449] (5:node@TeX)   29  |  32 
-> [560.036449] (5:node@TeX)   37  |  21 
-> [560.036449] (5:node@TeX)   53  |  21 
-> [560.036449] (5:node@TeX) Predecessor: 14
-> [577.866994] (4:node@Geoff) My finger table:
-> [577.866994] (4:node@Geoff) Start | Succ 
-> [577.866994] (4:node@Geoff)   33  |  38 
-> [577.866994] (4:node@Geoff)   34  |  38 
-> [577.866994] (4:node@Geoff)   36  |  38 
-> [577.866994] (4:node@Geoff)   40  |  42 
-> [577.866994] (4:node@Geoff)   48  |  32 
-> [577.866994] (4:node@Geoff)    0  |  32 
-> [577.866994] (4:node@Geoff) Predecessor: 21
-> [803.668999] (0:@) Messages created: 768
-> [803.668999] (0:@) Simulated time: 803.669
+> [193.730915] (2:node@McGee) My finger table:
+> [193.730915] (2:node@McGee) Start | Succ 
+> [193.730915] (2:node@McGee)   43  |  48 
+> [193.730915] (2:node@McGee)   44  |  42 
+> [193.730915] (2:node@McGee)   46  |  42 
+> [193.730915] (2:node@McGee)   50  |  42 
+> [193.730915] (2:node@McGee)   58  |  42 
+> [193.730915] (2:node@McGee)   10  |  42 
+> [193.730915] (2:node@McGee) Predecessor: 8
+> [242.028917] (1:node@Gatien) My finger table:
+> [242.028917] (1:node@Gatien) Start | Succ 
+> [242.028917] (1:node@Gatien)   49  |   1 
+> [242.028917] (1:node@Gatien)   50  |   1 
+> [242.028917] (1:node@Gatien)   52  |  48 
+> [242.028917] (1:node@Gatien)   56  |  48 
+> [242.028917] (1:node@Gatien)    0  |  48 
+> [242.028917] (1:node@Gatien)   16  |  48 
+> [242.028917] (1:node@Gatien) Predecessor: 42
+> [242.939681] (2:node@McGee) My finger table:
+> [242.939681] (2:node@McGee) Start | Succ 
+> [242.939681] (2:node@McGee)   43  |  48 
+> [242.939681] (2:node@McGee)   44  |  42 
+> [242.939681] (2:node@McGee)   46  |  42 
+> [242.939681] (2:node@McGee)   50  |  42 
+> [242.939681] (2:node@McGee)   58  |  42 
+> [242.939681] (2:node@McGee)   10  |  42 
+> [242.939681] (2:node@McGee) Predecessor: 38
+> [246.478513] (2:node@McGee) My finger table:
+> [246.478513] (2:node@McGee) Start | Succ 
+> [246.478513] (2:node@McGee)   43  |  48 
+> [246.478513] (2:node@McGee)   44  |  48 
+> [246.478513] (2:node@McGee)   46  |  42 
+> [246.478513] (2:node@McGee)   50  |  42 
+> [246.478513] (2:node@McGee)   58  |  42 
+> [246.478513] (2:node@McGee)   10  |  42 
+> [246.478513] (2:node@McGee) Predecessor: 38
+> [248.768529] (7:node@Boivin) My finger table:
+> [248.768529] (7:node@Boivin) Start | Succ 
+> [248.768529] (7:node@Boivin)    9  |  38 
+> [248.768529] (7:node@Boivin)   10  |  38 
+> [248.768529] (7:node@Boivin)   12  |   8 
+> [248.768529] (7:node@Boivin)   16  |   8 
+> [248.768529] (7:node@Boivin)   24  |   8 
+> [248.768529] (7:node@Boivin)   40  |   8 
+> [248.768529] (7:node@Boivin) Predecessor: -1
+> [255.578816] (4:node@Geoff) My finger table:
+> [255.578816] (4:node@Geoff) Start | Succ 
+> [255.578816] (4:node@Geoff)   33  |  42 
+> [255.578816] (4:node@Geoff)   34  |  42 
+> [255.578816] (4:node@Geoff)   36  |  32 
+> [255.578816] (4:node@Geoff)   40  |  32 
+> [255.578816] (4:node@Geoff)   48  |  32 
+> [255.578816] (4:node@Geoff)    0  |  32 
+> [255.578816] (4:node@Geoff) Predecessor: -1
+> [268.081409] (8:node@Jacquelin) My finger table:
+> [268.081409] (8:node@Jacquelin) Start | Succ 
+> [268.081409] (8:node@Jacquelin)    2  |   8 
+> [268.081409] (8:node@Jacquelin)    3  |   8 
+> [268.081409] (8:node@Jacquelin)    5  |   1 
+> [268.081409] (8:node@Jacquelin)    9  |   1 
+> [268.081409] (8:node@Jacquelin)   17  |   1 
+> [268.081409] (8:node@Jacquelin)   33  |   1 
+> [268.081409] (8:node@Jacquelin) Predecessor: 48
+> [269.130295] (7:node@Boivin) My finger table:
+> [269.130295] (7:node@Boivin) Start | Succ 
+> [269.130295] (7:node@Boivin)    9  |  38 
+> [269.130295] (7:node@Boivin)   10  |  38 
+> [269.130295] (7:node@Boivin)   12  |   8 
+> [269.130295] (7:node@Boivin)   16  |   8 
+> [269.130295] (7:node@Boivin)   24  |   8 
+> [269.130295] (7:node@Boivin)   40  |   8 
+> [269.130295] (7:node@Boivin) Predecessor: 1
+> [272.405922] (3:node@iRMX) My finger table:
+> [272.405922] (3:node@iRMX) Start | Succ 
+> [272.405922] (3:node@iRMX)   39  |  42 
+> [272.405922] (3:node@iRMX)   40  |  42 
+> [272.405922] (3:node@iRMX)   42  |  38 
+> [272.405922] (3:node@iRMX)   46  |  38 
+> [272.405922] (3:node@iRMX)   54  |  38 
+> [272.405922] (3:node@iRMX)    6  |  38 
+> [272.405922] (3:node@iRMX) Predecessor: -1
+> [284.571217] (5:node@TeX) My finger table:
+> [284.571217] (5:node@TeX) Start | Succ 
+> [284.571217] (5:node@TeX)   22  |  38 
+> [284.571217] (5:node@TeX)   23  |  38 
+> [284.571217] (5:node@TeX)   25  |  21 
+> [284.571217] (5:node@TeX)   29  |  21 
+> [284.571217] (5:node@TeX)   37  |  21 
+> [284.571217] (5:node@TeX)   53  |  21 
+> [284.571217] (5:node@TeX) Predecessor: -1
+> [289.289472] (3:node@iRMX) My finger table:
+> [289.289472] (3:node@iRMX) Start | Succ 
+> [289.289472] (3:node@iRMX)   39  |  42 
+> [289.289472] (3:node@iRMX)   40  |  42 
+> [289.289472] (3:node@iRMX)   42  |  38 
+> [289.289472] (3:node@iRMX)   46  |  38 
+> [289.289472] (3:node@iRMX)   54  |  38 
+> [289.289472] (3:node@iRMX)    6  |  38 
+> [289.289472] (3:node@iRMX) Predecessor: 21
+> [305.097152] (6:node@Jean_Yves) My finger table:
+> [305.097152] (6:node@Jean_Yves) Start | Succ 
+> [305.097152] (6:node@Jean_Yves)   15  |  21 
+> [305.097152] (6:node@Jean_Yves)   16  |  21 
+> [305.097152] (6:node@Jean_Yves)   18  |  14 
+> [305.097152] (6:node@Jean_Yves)   22  |  14 
+> [305.097152] (6:node@Jean_Yves)   30  |  14 
+> [305.097152] (6:node@Jean_Yves)   46  |  14 
+> [305.097152] (6:node@Jean_Yves) Predecessor: -1
+> [313.745119] (3:node@iRMX) My finger table:
+> [313.745119] (3:node@iRMX) Start | Succ 
+> [313.745119] (3:node@iRMX)   39  |  42 
+> [313.745119] (3:node@iRMX)   40  |  42 
+> [313.745119] (3:node@iRMX)   42  |  38 
+> [313.745119] (3:node@iRMX)   46  |  38 
+> [313.745119] (3:node@iRMX)   54  |  38 
+> [313.745119] (3:node@iRMX)    6  |  38 
+> [313.745119] (3:node@iRMX) Predecessor: 32
+> [338.952043] (5:node@TeX) My finger table:
+> [338.952043] (5:node@TeX) Start | Succ 
+> [338.952043] (5:node@TeX)   22  |  32 
+> [338.952043] (5:node@TeX)   23  |  38 
+> [338.952043] (5:node@TeX)   25  |  21 
+> [338.952043] (5:node@TeX)   29  |  21 
+> [338.952043] (5:node@TeX)   37  |  21 
+> [338.952043] (5:node@TeX)   53  |  21 
+> [338.952043] (5:node@TeX) Predecessor: 14
+> [359.463171] (4:node@Geoff) My finger table:
+> [359.463171] (4:node@Geoff) Start | Succ 
+> [359.463171] (4:node@Geoff)   33  |  38 
+> [359.463171] (4:node@Geoff)   34  |  42 
+> [359.463171] (4:node@Geoff)   36  |  32 
+> [359.463171] (4:node@Geoff)   40  |  32 
+> [359.463171] (4:node@Geoff)   48  |  32 
+> [359.463171] (4:node@Geoff)    0  |  32 
+> [359.463171] (4:node@Geoff) Predecessor: 21
+> [365.649541] (1:node@Gatien) My finger table:
+> [365.649541] (1:node@Gatien) Start | Succ 
+> [365.649541] (1:node@Gatien)   49  |   1 
+> [365.649541] (1:node@Gatien)   50  |   1 
+> [365.649541] (1:node@Gatien)   52  |   1 
+> [365.649541] (1:node@Gatien)   56  |  48 
+> [365.649541] (1:node@Gatien)    0  |  48 
+> [365.649541] (1:node@Gatien)   16  |  48 
+> [365.649541] (1:node@Gatien) Predecessor: 42
+> [367.870562] (2:node@McGee) My finger table:
+> [367.870562] (2:node@McGee) Start | Succ 
+> [367.870562] (2:node@McGee)   43  |  48 
+> [367.870562] (2:node@McGee)   44  |  48 
+> [367.870562] (2:node@McGee)   46  |  48 
+> [367.870562] (2:node@McGee)   50  |  42 
+> [367.870562] (2:node@McGee)   58  |  42 
+> [367.870562] (2:node@McGee)   10  |  42 
+> [367.870562] (2:node@McGee) Predecessor: 38
+> [371.550256] (7:node@Boivin) My finger table:
+> [371.550256] (7:node@Boivin) Start | Succ 
+> [371.550256] (7:node@Boivin)    9  |  21 
+> [371.550256] (7:node@Boivin)   10  |  38 
+> [371.550256] (7:node@Boivin)   12  |  21 
+> [371.550256] (7:node@Boivin)   16  |   8 
+> [371.550256] (7:node@Boivin)   24  |   8 
+> [371.550256] (7:node@Boivin)   40  |   8 
+> [371.550256] (7:node@Boivin) Predecessor: 1
+> [388.564180] (4:node@Geoff) My finger table:
+> [388.564180] (4:node@Geoff) Start | Succ 
+> [388.564180] (4:node@Geoff)   33  |  38 
+> [388.564180] (4:node@Geoff)   34  |  42 
+> [388.564180] (4:node@Geoff)   36  |  38 
+> [388.564180] (4:node@Geoff)   40  |  32 
+> [388.564180] (4:node@Geoff)   48  |  32 
+> [388.564180] (4:node@Geoff)    0  |  32 
+> [388.564180] (4:node@Geoff) Predecessor: 21
+> [389.021761] (8:node@Jacquelin) My finger table:
+> [389.021761] (8:node@Jacquelin) Start | Succ 
+> [389.021761] (8:node@Jacquelin)    2  |   8 
+> [389.021761] (8:node@Jacquelin)    3  |   8 
+> [389.021761] (8:node@Jacquelin)    5  |   8 
+> [389.021761] (8:node@Jacquelin)    9  |   1 
+> [389.021761] (8:node@Jacquelin)   17  |   1 
+> [389.021761] (8:node@Jacquelin)   33  |   1 
+> [389.021761] (8:node@Jacquelin) Predecessor: 48
+> [393.088792] (3:node@iRMX) My finger table:
+> [393.088792] (3:node@iRMX) Start | Succ 
+> [393.088792] (3:node@iRMX)   39  |  42 
+> [393.088792] (3:node@iRMX)   40  |  42 
+> [393.088792] (3:node@iRMX)   42  |  42 
+> [393.088792] (3:node@iRMX)   46  |  38 
+> [393.088792] (3:node@iRMX)   54  |  38 
+> [393.088792] (3:node@iRMX)    6  |  38 
+> [393.088792] (3:node@iRMX) Predecessor: 32
+> [412.961743] (5:node@TeX) My finger table:
+> [412.961743] (5:node@TeX) Start | Succ 
+> [412.961743] (5:node@TeX)   22  |  32 
+> [412.961743] (5:node@TeX)   23  |  38 
+> [412.961743] (5:node@TeX)   25  |  32 
+> [412.961743] (5:node@TeX)   29  |  21 
+> [412.961743] (5:node@TeX)   37  |  21 
+> [412.961743] (5:node@TeX)   53  |  21 
+> [412.961743] (5:node@TeX) Predecessor: 14
+> [434.596538] (6:node@Jean_Yves) My finger table:
+> [434.596538] (6:node@Jean_Yves) Start | Succ 
+> [434.596538] (6:node@Jean_Yves)   15  |  21 
+> [434.596538] (6:node@Jean_Yves)   16  |  21 
+> [434.596538] (6:node@Jean_Yves)   18  |  14 
+> [434.596538] (6:node@Jean_Yves)   22  |  14 
+> [434.596538] (6:node@Jean_Yves)   30  |  14 
+> [434.596538] (6:node@Jean_Yves)   46  |  14 
+> [434.596538] (6:node@Jean_Yves) Predecessor: 8
+> [443.806985] (6:node@Jean_Yves) My finger table:
+> [443.806985] (6:node@Jean_Yves) Start | Succ 
+> [443.806985] (6:node@Jean_Yves)   15  |  21 
+> [443.806985] (6:node@Jean_Yves)   16  |  21 
+> [443.806985] (6:node@Jean_Yves)   18  |  21 
+> [443.806985] (6:node@Jean_Yves)   22  |  14 
+> [443.806985] (6:node@Jean_Yves)   30  |  14 
+> [443.806985] (6:node@Jean_Yves)   46  |  14 
+> [443.806985] (6:node@Jean_Yves) Predecessor: 8
+> [488.763655] (1:node@Gatien) My finger table:
+> [488.763655] (1:node@Gatien) Start | Succ 
+> [488.763655] (1:node@Gatien)   49  |   1 
+> [488.763655] (1:node@Gatien)   50  |   1 
+> [488.763655] (1:node@Gatien)   52  |   1 
+> [488.763655] (1:node@Gatien)   56  |   1 
+> [488.763655] (1:node@Gatien)    0  |  48 
+> [488.763655] (1:node@Gatien)   16  |  48 
+> [488.763655] (1:node@Gatien) Predecessor: 42
+> [502.910503] (2:node@McGee) My finger table:
+> [502.910503] (2:node@McGee) Start | Succ 
+> [502.910503] (2:node@McGee)   43  |  48 
+> [502.910503] (2:node@McGee)   44  |  48 
+> [502.910503] (2:node@McGee)   46  |  48 
+> [502.910503] (2:node@McGee)   50  |   1 
+> [502.910503] (2:node@McGee)   58  |  42 
+> [502.910503] (2:node@McGee)   10  |  42 
+> [502.910503] (2:node@McGee) Predecessor: 38
+> [511.133139] (8:node@Jacquelin) My finger table:
+> [511.133139] (8:node@Jacquelin) Start | Succ 
+> [511.133139] (8:node@Jacquelin)    2  |   8 
+> [511.133139] (8:node@Jacquelin)    3  |   8 
+> [511.133139] (8:node@Jacquelin)    5  |   8 
+> [511.133139] (8:node@Jacquelin)    9  |  14 
+> [511.133139] (8:node@Jacquelin)   17  |   1 
+> [511.133139] (8:node@Jacquelin)   33  |   1 
+> [511.133139] (8:node@Jacquelin) Predecessor: 48
+> [528.169821] (7:node@Boivin) My finger table:
+> [528.169821] (7:node@Boivin) Start | Succ 
+> [528.169821] (7:node@Boivin)    9  |  14 
+> [528.169821] (7:node@Boivin)   10  |  38 
+> [528.169821] (7:node@Boivin)   12  |  21 
+> [528.169821] (7:node@Boivin)   16  |  21 
+> [528.169821] (7:node@Boivin)   24  |   8 
+> [528.169821] (7:node@Boivin)   40  |   8 
+> [528.169821] (7:node@Boivin) Predecessor: 1
+> [538.778249] (3:node@iRMX) My finger table:
+> [538.778249] (3:node@iRMX) Start | Succ 
+> [538.778249] (3:node@iRMX)   39  |  42 
+> [538.778249] (3:node@iRMX)   40  |  42 
+> [538.778249] (3:node@iRMX)   42  |  42 
+> [538.778249] (3:node@iRMX)   46  |  48 
+> [538.778249] (3:node@iRMX)   54  |  38 
+> [538.778249] (3:node@iRMX)    6  |  38 
+> [538.778249] (3:node@iRMX) Predecessor: 32
+> [561.853873] (5:node@TeX) My finger table:
+> [561.853873] (5:node@TeX) Start | Succ 
+> [561.853873] (5:node@TeX)   22  |  32 
+> [561.853873] (5:node@TeX)   23  |  38 
+> [561.853873] (5:node@TeX)   25  |  32 
+> [561.853873] (5:node@TeX)   29  |  32 
+> [561.853873] (5:node@TeX)   37  |  21 
+> [561.853873] (5:node@TeX)   53  |  21 
+> [561.853873] (5:node@TeX) Predecessor: 14
+> [564.892208] (4:node@Geoff) My finger table:
+> [564.892208] (4:node@Geoff) Start | Succ 
+> [564.892208] (4:node@Geoff)   33  |  38 
+> [564.892208] (4:node@Geoff)   34  |  42 
+> [564.892208] (4:node@Geoff)   36  |  38 
+> [564.892208] (4:node@Geoff)   40  |  42 
+> [564.892208] (4:node@Geoff)   48  |  32 
+> [564.892208] (4:node@Geoff)    0  |  32 
+> [564.892208] (4:node@Geoff) Predecessor: 21
+> [580.440544] (6:node@Jean_Yves) My finger table:
+> [580.440544] (6:node@Jean_Yves) Start | Succ 
+> [580.440544] (6:node@Jean_Yves)   15  |  21 
+> [580.440544] (6:node@Jean_Yves)   16  |  21 
+> [580.440544] (6:node@Jean_Yves)   18  |  21 
+> [580.440544] (6:node@Jean_Yves)   22  |  32 
+> [580.440544] (6:node@Jean_Yves)   30  |  14 
+> [580.440544] (6:node@Jean_Yves)   46  |  14 
+> [580.440544] (6:node@Jean_Yves) Predecessor: 8
+> [805.312658] (0:@) Messages created: 789
+> [805.312658] (0:@) Simulated time: 805.313
 
 ! output sort
 $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT ${srcdir:=.}/../../platforms/cluster.xml ${srcdir:=.}/chord10.xml --log=msg_chord.thres:verbose "--log=root.fmt:[%11.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:Constant
@@ -1044,1976 +1026,1949 @@ $ $SG_TEST_EXENV ${bindir:=.}/chord$EXEEXT ${srcdir:=.}/../../platforms/cluster.
 > [ 110.000000] (9:node@c-8.me)  10713112  | 6518808 
 > [ 110.000000] (9:node@c-8.me)  14907416  | 6518808 
 > [ 110.000000] (9:node@c-8.me) Predecessor: 1319738
-> [ 145.000000] (1:node@c-0.me) My finger table:
-> [ 145.000000] (1:node@c-0.me) Start | Succ 
-> [ 145.000000] (1:node@c-0.me)   43  | 1319738 
-> [ 145.000000] (1:node@c-0.me)   44  |  42 
-> [ 145.000000] (1:node@c-0.me)   46  |  42 
-> [ 145.000000] (1:node@c-0.me)   50  |  42 
-> [ 145.000000] (1:node@c-0.me)   58  |  42 
-> [ 145.000000] (1:node@c-0.me)   74  |  42 
-> [ 145.000000] (1:node@c-0.me)  106  |  42 
-> [ 145.000000] (1:node@c-0.me)  170  |  42 
-> [ 145.000000] (1:node@c-0.me)  298  |  42 
-> [ 145.000000] (1:node@c-0.me)  554  |  42 
-> [ 145.000000] (1:node@c-0.me)  1066  |  42 
-> [ 145.000000] (1:node@c-0.me)  2090  |  42 
-> [ 145.000000] (1:node@c-0.me)  4138  |  42 
-> [ 145.000000] (1:node@c-0.me)  8234  |  42 
-> [ 145.000000] (1:node@c-0.me)  16426  |  42 
-> [ 145.000000] (1:node@c-0.me)  32810  |  42 
-> [ 145.000000] (1:node@c-0.me)  65578  |  42 
-> [ 145.000000] (1:node@c-0.me)  131114  |  42 
-> [ 145.000000] (1:node@c-0.me)  262186  |  42 
-> [ 145.000000] (1:node@c-0.me)  524330  |  42 
-> [ 145.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 145.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 145.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 145.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 145.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 157.000000] (4:node@c-3.me) My finger table:
-> [ 157.000000] (4:node@c-3.me) Start | Succ 
-> [ 157.000000] (4:node@c-3.me)  1319739  | 6518808 
-> [ 157.000000] (4:node@c-3.me)  1319740  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319742  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 157.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 157.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 184.000000] (7:node@c-6.me) My finger table:
-> [ 184.000000] (7:node@c-6.me) Start | Succ 
-> [ 184.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 184.000000] (7:node@c-6.me)  16728098  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 184.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 184.000000] (7:node@c-6.me) Predecessor: 6518808
-> [ 202.000000] (2:node@c-1.me) My finger table:
-> [ 202.000000] (2:node@c-1.me) Start | Succ 
-> [ 202.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 202.000000] (2:node@c-1.me)  366682  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366684  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 202.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 202.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 202.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 202.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 202.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 202.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 202.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 202.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 202.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 202.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 202.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 202.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 202.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 202.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 202.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 202.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 202.000000] (2:node@c-1.me) Predecessor: 42
-> [ 221.000000] (9:node@c-8.me) My finger table:
-> [ 221.000000] (9:node@c-8.me) Start | Succ 
-> [ 221.000000] (9:node@c-8.me)  6518809  | 16728096 
-> [ 221.000000] (9:node@c-8.me)  6518810  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518812  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 221.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 221.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 240.000000] (6:node@c-5.me) My finger table:
-> [ 240.000000] (6:node@c-5.me) Start | Succ 
-> [ 240.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 240.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 240.000000] (6:node@c-5.me)  10874880  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874884  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 240.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 240.000000] (6:node@c-5.me) Predecessor: -1
-> [ 247.000000] (5:node@c-4.me) My finger table:
-> [ 247.000000] (5:node@c-4.me) Start | Succ 
-> [ 247.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 247.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 247.000000] (5:node@c-4.me)  16509409  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509413  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 247.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 247.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 250.000000] (1:node@c-0.me) My finger table:
-> [ 250.000000] (1:node@c-0.me) Start | Succ 
-> [ 250.000000] (1:node@c-0.me)   43  | 366680 
-> [ 250.000000] (1:node@c-0.me)   44  | 366680 
-> [ 250.000000] (1:node@c-0.me)   46  |  42 
-> [ 250.000000] (1:node@c-0.me)   50  |  42 
-> [ 250.000000] (1:node@c-0.me)   58  |  42 
-> [ 250.000000] (1:node@c-0.me)   74  |  42 
-> [ 250.000000] (1:node@c-0.me)  106  |  42 
-> [ 250.000000] (1:node@c-0.me)  170  |  42 
-> [ 250.000000] (1:node@c-0.me)  298  |  42 
-> [ 250.000000] (1:node@c-0.me)  554  |  42 
-> [ 250.000000] (1:node@c-0.me)  1066  |  42 
-> [ 250.000000] (1:node@c-0.me)  2090  |  42 
-> [ 250.000000] (1:node@c-0.me)  4138  |  42 
-> [ 250.000000] (1:node@c-0.me)  8234  |  42 
-> [ 250.000000] (1:node@c-0.me)  16426  |  42 
-> [ 250.000000] (1:node@c-0.me)  32810  |  42 
-> [ 250.000000] (1:node@c-0.me)  65578  |  42 
-> [ 250.000000] (1:node@c-0.me)  131114  |  42 
-> [ 250.000000] (1:node@c-0.me)  262186  |  42 
-> [ 250.000000] (1:node@c-0.me)  524330  |  42 
-> [ 250.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 250.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 250.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 250.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 250.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 251.000000] (3:node@c-2.me) My finger table:
-> [ 251.000000] (3:node@c-2.me) Start | Succ 
-> [ 251.000000] (3:node@c-2.me)  533745  | 10004760 
-> [ 251.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 251.000000] (3:node@c-2.me)  533748  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533752  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 251.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 251.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 251.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 251.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 251.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 251.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 251.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 251.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 251.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 251.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 251.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 251.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 251.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 251.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 251.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 251.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 253.000000] (8:node@c-7.me) My finger table:
-> [ 253.000000] (8:node@c-7.me) Start | Succ 
-> [ 253.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 253.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 253.000000] (8:node@c-7.me)  10004764  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 253.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 253.000000] (8:node@c-7.me) Predecessor: 533744
-> [ 263.000000] (2:node@c-1.me) My finger table:
-> [ 263.000000] (2:node@c-1.me) Start | Succ 
-> [ 263.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 263.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 263.000000] (2:node@c-1.me)  366684  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 263.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 263.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 263.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 263.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 263.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 263.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 263.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 263.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 263.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 263.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 263.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 263.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 263.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 263.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 263.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 263.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 263.000000] (2:node@c-1.me) Predecessor: 42
-> [ 268.000000] (4:node@c-3.me) My finger table:
-> [ 268.000000] (4:node@c-3.me) Start | Succ 
-> [ 268.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 268.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 268.000000] (4:node@c-3.me)  1319742  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 268.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 268.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 269.000000] (10:node@c-9.me) My finger table:
-> [ 269.000000] (10:node@c-9.me) Start | Succ 
-> [ 269.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 269.000000] (10:node@c-9.me)  2015255  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015257  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 269.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 269.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 274.000000] (10:node@c-9.me) My finger table:
-> [ 274.000000] (10:node@c-9.me) Start | Succ 
-> [ 274.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 274.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 274.000000] (10:node@c-9.me)  2015257  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 274.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 274.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 274.000000] (9:node@c-8.me) My finger table:
-> [ 274.000000] (9:node@c-8.me) Start | Succ 
-> [ 274.000000] (9:node@c-8.me)  6518809  | 16728096 
-> [ 274.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 274.000000] (9:node@c-8.me)  6518812  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 274.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 274.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 275.000000] (7:node@c-6.me) My finger table:
-> [ 275.000000] (7:node@c-6.me) Start | Succ 
-> [ 275.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 275.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 275.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 275.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 275.000000] (7:node@c-6.me) Predecessor: 6518808
-> [ 288.000000] (7:node@c-6.me) My finger table:
-> [ 288.000000] (7:node@c-6.me) Start | Succ 
-> [ 288.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 288.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 288.000000] (7:node@c-6.me)  16728100  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 288.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 288.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 361.000000] (8:node@c-7.me) My finger table:
-> [ 361.000000] (8:node@c-7.me) Start | Succ 
-> [ 361.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 361.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 361.000000] (8:node@c-7.me)  10004764  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 361.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 361.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 364.000000] (6:node@c-5.me) My finger table:
-> [ 364.000000] (6:node@c-5.me) Start | Succ 
-> [ 364.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 364.000000] (6:node@c-5.me)  10874884  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 364.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 364.000000] (6:node@c-5.me) Predecessor: -1
-> [ 371.000000] (3:node@c-2.me) My finger table:
-> [ 371.000000] (3:node@c-2.me) Start | Succ 
-> [ 371.000000] (3:node@c-2.me)  533745  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 371.000000] (3:node@c-2.me)  533752  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 371.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 371.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 371.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 371.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 371.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 371.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 371.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 371.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 371.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 371.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 371.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 371.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 371.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 371.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 371.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 371.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 372.000000] (1:node@c-0.me) My finger table:
-> [ 372.000000] (1:node@c-0.me) Start | Succ 
-> [ 372.000000] (1:node@c-0.me)   43  | 366680 
-> [ 372.000000] (1:node@c-0.me)   44  | 366680 
-> [ 372.000000] (1:node@c-0.me)   46  | 366680 
-> [ 372.000000] (1:node@c-0.me)   50  |  42 
-> [ 372.000000] (1:node@c-0.me)   58  |  42 
-> [ 372.000000] (1:node@c-0.me)   74  |  42 
-> [ 372.000000] (1:node@c-0.me)  106  |  42 
-> [ 372.000000] (1:node@c-0.me)  170  |  42 
-> [ 372.000000] (1:node@c-0.me)  298  |  42 
-> [ 372.000000] (1:node@c-0.me)  554  |  42 
-> [ 372.000000] (1:node@c-0.me)  1066  |  42 
-> [ 372.000000] (1:node@c-0.me)  2090  |  42 
-> [ 372.000000] (1:node@c-0.me)  4138  |  42 
-> [ 372.000000] (1:node@c-0.me)  8234  |  42 
-> [ 372.000000] (1:node@c-0.me)  16426  |  42 
-> [ 372.000000] (1:node@c-0.me)  32810  |  42 
-> [ 372.000000] (1:node@c-0.me)  65578  |  42 
-> [ 372.000000] (1:node@c-0.me)  131114  |  42 
-> [ 372.000000] (1:node@c-0.me)  262186  |  42 
-> [ 372.000000] (1:node@c-0.me)  524330  |  42 
-> [ 372.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 372.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 372.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 372.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 372.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 374.000000] (8:node@c-7.me) My finger table:
-> [ 374.000000] (8:node@c-7.me) Start | Succ 
-> [ 374.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 374.000000] (8:node@c-7.me)  10004768  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 374.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 374.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 375.000000] (5:node@c-4.me) My finger table:
-> [ 375.000000] (5:node@c-4.me) Start | Succ 
-> [ 375.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 375.000000] (5:node@c-4.me)  16509413  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 375.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 375.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 395.000000] (9:node@c-8.me) My finger table:
-> [ 395.000000] (9:node@c-8.me) Start | Succ 
-> [ 395.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 395.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 395.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 395.000000] (9:node@c-8.me)  6518816  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 395.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 395.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 398.000000] (7:node@c-6.me) My finger table:
-> [ 398.000000] (7:node@c-6.me) Start | Succ 
-> [ 398.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 398.000000] (7:node@c-6.me)  16728104  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 398.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 398.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 405.000000] (4:node@c-3.me) My finger table:
-> [ 405.000000] (4:node@c-3.me) Start | Succ 
-> [ 405.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 405.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 405.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 405.000000] (4:node@c-3.me) Predecessor: 366680
-> [ 411.000000] (2:node@c-1.me) My finger table:
-> [ 411.000000] (2:node@c-1.me) Start | Succ 
-> [ 411.000000] (2:node@c-1.me)  366681  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 411.000000] (2:node@c-1.me)  366688  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 411.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 411.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 411.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 411.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 411.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 411.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 411.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 411.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 411.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 411.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 411.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 411.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 411.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 411.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 411.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 411.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 411.000000] (2:node@c-1.me) Predecessor: 42
-> [ 426.000000] (10:node@c-9.me) My finger table:
-> [ 426.000000] (10:node@c-9.me) Start | Succ 
-> [ 426.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 426.000000] (10:node@c-9.me)  2015261  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 426.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 426.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 486.000000] (6:node@c-5.me) My finger table:
-> [ 486.000000] (6:node@c-5.me) Start | Succ 
-> [ 486.000000] (6:node@c-5.me)  10874877  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 486.000000] (6:node@c-5.me)  10874892  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 486.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 486.000000] (6:node@c-5.me) Predecessor: -1
-> [ 491.000000] (4:node@c-3.me) My finger table:
-> [ 491.000000] (4:node@c-3.me) Start | Succ 
-> [ 491.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 491.000000] (4:node@c-3.me)  1319746  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 491.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 491.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 492.000000] (1:node@c-0.me) My finger table:
-> [ 492.000000] (1:node@c-0.me) Start | Succ 
-> [ 492.000000] (1:node@c-0.me)   43  | 366680 
-> [ 492.000000] (1:node@c-0.me)   44  | 366680 
-> [ 492.000000] (1:node@c-0.me)   46  | 366680 
-> [ 492.000000] (1:node@c-0.me)   50  | 366680 
-> [ 492.000000] (1:node@c-0.me)   58  |  42 
-> [ 492.000000] (1:node@c-0.me)   74  |  42 
-> [ 492.000000] (1:node@c-0.me)  106  |  42 
-> [ 492.000000] (1:node@c-0.me)  170  |  42 
-> [ 492.000000] (1:node@c-0.me)  298  |  42 
-> [ 492.000000] (1:node@c-0.me)  554  |  42 
-> [ 492.000000] (1:node@c-0.me)  1066  |  42 
-> [ 492.000000] (1:node@c-0.me)  2090  |  42 
-> [ 492.000000] (1:node@c-0.me)  4138  |  42 
-> [ 492.000000] (1:node@c-0.me)  8234  |  42 
-> [ 492.000000] (1:node@c-0.me)  16426  |  42 
-> [ 492.000000] (1:node@c-0.me)  32810  |  42 
-> [ 492.000000] (1:node@c-0.me)  65578  |  42 
-> [ 492.000000] (1:node@c-0.me)  131114  |  42 
-> [ 492.000000] (1:node@c-0.me)  262186  |  42 
-> [ 492.000000] (1:node@c-0.me)  524330  |  42 
-> [ 492.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 492.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 492.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 492.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 492.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 495.000000] (3:node@c-2.me) My finger table:
-> [ 495.000000] (3:node@c-2.me) Start | Succ 
-> [ 495.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 495.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 495.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 495.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 495.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 495.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 495.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 495.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 495.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 495.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 495.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 495.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 495.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 495.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 495.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 495.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 495.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 495.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 495.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 495.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 495.000000] (3:node@c-2.me) Predecessor: 10874876
-> [ 502.000000] (8:node@c-7.me) My finger table:
-> [ 502.000000] (8:node@c-7.me) Start | Succ 
-> [ 502.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 502.000000] (8:node@c-7.me)  10004776  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 502.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 502.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 505.000000] (5:node@c-4.me) My finger table:
-> [ 505.000000] (5:node@c-4.me) Start | Succ 
-> [ 505.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 505.000000] (5:node@c-4.me)  16509421  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 505.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 505.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 521.000000] (7:node@c-6.me) My finger table:
-> [ 521.000000] (7:node@c-6.me) Start | Succ 
-> [ 521.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 521.000000] (7:node@c-6.me)  16728112  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 521.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 521.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 535.000000] (9:node@c-8.me) My finger table:
-> [ 535.000000] (9:node@c-8.me) Start | Succ 
-> [ 535.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 535.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 535.000000] (9:node@c-8.me)  6518824  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 535.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 535.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 537.000000] (4:node@c-3.me) My finger table:
-> [ 537.000000] (4:node@c-3.me) Start | Succ 
-> [ 537.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 537.000000] (4:node@c-3.me)  1319754  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 537.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 537.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 539.000000] (2:node@c-1.me) My finger table:
-> [ 539.000000] (2:node@c-1.me) Start | Succ 
-> [ 539.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 539.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 539.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 539.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 539.000000] (2:node@c-1.me)  366696  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 539.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 539.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 539.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 539.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 539.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 539.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 539.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 539.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 539.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 539.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 539.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 539.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 539.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 539.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 539.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 539.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 539.000000] (2:node@c-1.me) Predecessor: 42
-> [ 540.000000] (3:node@c-2.me) My finger table:
-> [ 540.000000] (3:node@c-2.me) Start | Succ 
-> [ 540.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 540.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 540.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 540.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 540.000000] (3:node@c-2.me)  533760  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 540.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 540.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 540.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 540.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 540.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 540.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 540.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 540.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 540.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 540.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 540.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 540.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 540.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 540.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 540.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 540.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 567.000000] (10:node@c-9.me) My finger table:
-> [ 567.000000] (10:node@c-9.me) Start | Succ 
-> [ 567.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 567.000000] (10:node@c-9.me)  2015269  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 567.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 567.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 613.000000] (1:node@c-0.me) My finger table:
-> [ 613.000000] (1:node@c-0.me) Start | Succ 
-> [ 613.000000] (1:node@c-0.me)   43  | 366680 
-> [ 613.000000] (1:node@c-0.me)   44  | 366680 
-> [ 613.000000] (1:node@c-0.me)   46  | 366680 
-> [ 613.000000] (1:node@c-0.me)   50  | 366680 
-> [ 613.000000] (1:node@c-0.me)   58  | 366680 
-> [ 613.000000] (1:node@c-0.me)   74  |  42 
-> [ 613.000000] (1:node@c-0.me)  106  |  42 
-> [ 613.000000] (1:node@c-0.me)  170  |  42 
-> [ 613.000000] (1:node@c-0.me)  298  |  42 
-> [ 613.000000] (1:node@c-0.me)  554  |  42 
-> [ 613.000000] (1:node@c-0.me)  1066  |  42 
-> [ 613.000000] (1:node@c-0.me)  2090  |  42 
-> [ 613.000000] (1:node@c-0.me)  4138  |  42 
-> [ 613.000000] (1:node@c-0.me)  8234  |  42 
-> [ 613.000000] (1:node@c-0.me)  16426  |  42 
-> [ 613.000000] (1:node@c-0.me)  32810  |  42 
-> [ 613.000000] (1:node@c-0.me)  65578  |  42 
-> [ 613.000000] (1:node@c-0.me)  131114  |  42 
-> [ 613.000000] (1:node@c-0.me)  262186  |  42 
-> [ 613.000000] (1:node@c-0.me)  524330  |  42 
-> [ 613.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 613.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 613.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 613.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 613.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 616.000000] (3:node@c-2.me) My finger table:
-> [ 616.000000] (3:node@c-2.me) Start | Succ 
-> [ 616.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 616.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 616.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 616.000000] (3:node@c-2.me)  533776  | 533744 
-> [ 616.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 616.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 616.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 616.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 616.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 616.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 616.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 616.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 616.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 616.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 616.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 616.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 616.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 616.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 616.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 616.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 616.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 620.000000] (6:node@c-5.me) My finger table:
-> [ 620.000000] (6:node@c-5.me) Start | Succ 
-> [ 620.000000] (6:node@c-5.me)  10874877  | 16728096 
-> [ 620.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 620.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 620.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 620.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 620.000000] (6:node@c-5.me) Predecessor: -1
-> [ 629.000000] (8:node@c-7.me) My finger table:
-> [ 629.000000] (8:node@c-7.me) Start | Succ 
-> [ 629.000000] (8:node@c-7.me)  10004761  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 629.000000] (8:node@c-7.me)  10004792  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 629.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 629.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 630.000000] (5:node@c-4.me) My finger table:
-> [ 630.000000] (5:node@c-4.me) Start | Succ 
-> [ 630.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 630.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 630.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 630.000000] (5:node@c-4.me) Predecessor: 10004760
-> [ 653.000000] (7:node@c-6.me) My finger table:
-> [ 653.000000] (7:node@c-6.me) Start | Succ 
-> [ 653.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 653.000000] (7:node@c-6.me)  16728128  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 653.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 653.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 663.000000] (2:node@c-1.me) My finger table:
-> [ 663.000000] (2:node@c-1.me) Start | Succ 
-> [ 663.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 663.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 663.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 663.000000] (2:node@c-1.me)  366712  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 663.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 663.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 663.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 663.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 663.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 663.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 663.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 663.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 663.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 663.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 663.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 663.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 663.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 663.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 663.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 663.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 663.000000] (2:node@c-1.me) Predecessor: 42
-> [ 668.000000] (4:node@c-3.me) My finger table:
-> [ 668.000000] (4:node@c-3.me) Start | Succ 
-> [ 668.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 668.000000] (4:node@c-3.me)  1319770  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 668.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 668.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 683.000000] (5:node@c-4.me) My finger table:
-> [ 683.000000] (5:node@c-4.me) Start | Succ 
-> [ 683.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 683.000000] (5:node@c-4.me)  16509437  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 683.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 683.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 688.000000] (9:node@c-8.me) My finger table:
-> [ 688.000000] (9:node@c-8.me) Start | Succ 
-> [ 688.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 688.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 688.000000] (9:node@c-8.me)  6518840  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 688.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 688.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 699.000000] (10:node@c-9.me) My finger table:
-> [ 699.000000] (10:node@c-9.me) Start | Succ 
-> [ 699.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 699.000000] (10:node@c-9.me)  2015285  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 699.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 699.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 733.000000] (6:node@c-5.me) My finger table:
-> [ 733.000000] (6:node@c-5.me) Start | Succ 
-> [ 733.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 733.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 733.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 733.000000] (6:node@c-5.me)  10874908  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 733.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 733.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 735.000000] (1:node@c-0.me) My finger table:
-> [ 735.000000] (1:node@c-0.me) Start | Succ 
-> [ 735.000000] (1:node@c-0.me)   43  | 366680 
-> [ 735.000000] (1:node@c-0.me)   44  | 366680 
-> [ 735.000000] (1:node@c-0.me)   46  | 366680 
-> [ 735.000000] (1:node@c-0.me)   50  | 366680 
-> [ 735.000000] (1:node@c-0.me)   58  | 366680 
-> [ 735.000000] (1:node@c-0.me)   74  | 366680 
-> [ 735.000000] (1:node@c-0.me)  106  |  42 
-> [ 735.000000] (1:node@c-0.me)  170  |  42 
-> [ 735.000000] (1:node@c-0.me)  298  |  42 
-> [ 735.000000] (1:node@c-0.me)  554  |  42 
-> [ 735.000000] (1:node@c-0.me)  1066  |  42 
-> [ 735.000000] (1:node@c-0.me)  2090  |  42 
-> [ 735.000000] (1:node@c-0.me)  4138  |  42 
-> [ 735.000000] (1:node@c-0.me)  8234  |  42 
-> [ 735.000000] (1:node@c-0.me)  16426  |  42 
-> [ 735.000000] (1:node@c-0.me)  32810  |  42 
-> [ 735.000000] (1:node@c-0.me)  65578  |  42 
-> [ 735.000000] (1:node@c-0.me)  131114  |  42 
-> [ 735.000000] (1:node@c-0.me)  262186  |  42 
-> [ 735.000000] (1:node@c-0.me)  524330  |  42 
-> [ 735.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 735.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 735.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 735.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 735.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 743.000000] (3:node@c-2.me) My finger table:
-> [ 743.000000] (3:node@c-2.me) Start | Succ 
-> [ 743.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 743.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 743.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533776  | 1319738 
-> [ 743.000000] (3:node@c-2.me)  533808  | 533744 
-> [ 743.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 743.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 743.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 743.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 743.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 743.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 743.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 743.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 743.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 743.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 743.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 743.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 743.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 743.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 743.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 743.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 752.000000] (5:node@c-4.me) My finger table:
-> [ 752.000000] (5:node@c-4.me) Start | Succ 
-> [ 752.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509437  | 16728096 
-> [ 752.000000] (5:node@c-4.me)  16509469  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 752.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 752.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 753.000000] (6:node@c-5.me) My finger table:
-> [ 753.000000] (6:node@c-5.me) Start | Succ 
-> [ 753.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 753.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 753.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 753.000000] (6:node@c-5.me)  10874908  | 16509405 
-> [ 753.000000] (6:node@c-5.me)  10874940  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 753.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 753.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 765.000000] (8:node@c-7.me) My finger table:
-> [ 765.000000] (8:node@c-7.me) Start | Succ 
-> [ 765.000000] (8:node@c-7.me)  10004761  | 10874876 
-> [ 765.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 765.000000] (8:node@c-7.me)  10004792  | 10874876 
-> [ 765.000000] (8:node@c-7.me)  10004824  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 765.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 765.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 774.000000] (7:node@c-6.me) My finger table:
-> [ 774.000000] (7:node@c-6.me) Start | Succ 
-> [ 774.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728128  |  42 
-> [ 774.000000] (7:node@c-6.me)  16728160  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 774.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 774.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 796.000000] (2:node@c-1.me) My finger table:
-> [ 796.000000] (2:node@c-1.me) Start | Succ 
-> [ 796.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 796.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 796.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366712  | 533744 
-> [ 796.000000] (2:node@c-1.me)  366744  | 366680 
-> [ 796.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 796.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 796.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 796.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 796.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 796.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 796.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 796.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 796.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 796.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 796.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 796.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 796.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 796.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 796.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 796.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 796.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 796.000000] (2:node@c-1.me) Predecessor: 42
-> [ 808.000000] (9:node@c-8.me) My finger table:
-> [ 808.000000] (9:node@c-8.me) Start | Succ 
-> [ 808.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 808.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518840  | 10004760 
-> [ 808.000000] (9:node@c-8.me)  6518872  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 808.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 808.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 810.000000] (4:node@c-3.me) My finger table:
-> [ 810.000000] (4:node@c-3.me) Start | Succ 
-> [ 810.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319770  | 2015253 
-> [ 810.000000] (4:node@c-3.me)  1319802  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 810.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 810.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 831.000000] (10:node@c-9.me) My finger table:
-> [ 831.000000] (10:node@c-9.me) Start | Succ 
-> [ 831.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015285  | 6518808 
-> [ 831.000000] (10:node@c-9.me)  2015317  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 831.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 831.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 859.000000] (1:node@c-0.me) My finger table:
-> [ 859.000000] (1:node@c-0.me) Start | Succ 
-> [ 859.000000] (1:node@c-0.me)   43  | 366680 
-> [ 859.000000] (1:node@c-0.me)   44  | 366680 
-> [ 859.000000] (1:node@c-0.me)   46  | 366680 
-> [ 859.000000] (1:node@c-0.me)   50  | 366680 
-> [ 859.000000] (1:node@c-0.me)   58  | 366680 
-> [ 859.000000] (1:node@c-0.me)   74  | 366680 
-> [ 859.000000] (1:node@c-0.me)  106  | 366680 
-> [ 859.000000] (1:node@c-0.me)  170  |  42 
-> [ 859.000000] (1:node@c-0.me)  298  |  42 
-> [ 859.000000] (1:node@c-0.me)  554  |  42 
-> [ 859.000000] (1:node@c-0.me)  1066  |  42 
-> [ 859.000000] (1:node@c-0.me)  2090  |  42 
-> [ 859.000000] (1:node@c-0.me)  4138  |  42 
-> [ 859.000000] (1:node@c-0.me)  8234  |  42 
-> [ 859.000000] (1:node@c-0.me)  16426  |  42 
-> [ 859.000000] (1:node@c-0.me)  32810  |  42 
-> [ 859.000000] (1:node@c-0.me)  65578  |  42 
-> [ 859.000000] (1:node@c-0.me)  131114  |  42 
-> [ 859.000000] (1:node@c-0.me)  262186  |  42 
-> [ 859.000000] (1:node@c-0.me)  524330  |  42 
-> [ 859.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 859.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 859.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 859.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 859.000000] (1:node@c-0.me) Predecessor: 16728096
-> [ 873.000000] (5:node@c-4.me) My finger table:
-> [ 873.000000] (5:node@c-4.me) Start | Succ 
-> [ 873.000000] (5:node@c-4.me)  16509406  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509407  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509409  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509413  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509421  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509437  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509469  | 16728096 
-> [ 873.000000] (5:node@c-4.me)  16509533  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16509661  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16509917  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16510429  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16511453  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16513501  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16517597  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16525789  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16542173  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16574941  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16640477  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  16771549  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  256477  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  780765  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  1829341  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  3926493  | 16509405 
-> [ 873.000000] (5:node@c-4.me)  8120797  | 16509405 
-> [ 873.000000] (5:node@c-4.me) Predecessor: 10874876
-> [ 893.000000] (3:node@c-2.me) My finger table:
-> [ 893.000000] (3:node@c-2.me) Start | Succ 
-> [ 893.000000] (3:node@c-2.me)  533745  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533746  | 10004760 
-> [ 893.000000] (3:node@c-2.me)  533748  | 10004760 
-> [ 893.000000] (3:node@c-2.me)  533752  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533760  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533776  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533808  | 1319738 
-> [ 893.000000] (3:node@c-2.me)  533872  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534000  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534256  | 533744 
-> [ 893.000000] (3:node@c-2.me)  534768  | 533744 
-> [ 893.000000] (3:node@c-2.me)  535792  | 533744 
-> [ 893.000000] (3:node@c-2.me)  537840  | 533744 
-> [ 893.000000] (3:node@c-2.me)  541936  | 533744 
-> [ 893.000000] (3:node@c-2.me)  550128  | 533744 
-> [ 893.000000] (3:node@c-2.me)  566512  | 533744 
-> [ 893.000000] (3:node@c-2.me)  599280  | 533744 
-> [ 893.000000] (3:node@c-2.me)  664816  | 533744 
-> [ 893.000000] (3:node@c-2.me)  795888  | 533744 
-> [ 893.000000] (3:node@c-2.me)  1058032  | 533744 
-> [ 893.000000] (3:node@c-2.me)  1582320  | 533744 
-> [ 893.000000] (3:node@c-2.me)  2630896  | 533744 
-> [ 893.000000] (3:node@c-2.me)  4728048  | 533744 
-> [ 893.000000] (3:node@c-2.me)  8922352  | 533744 
-> [ 893.000000] (3:node@c-2.me) Predecessor: 366680
-> [ 896.000000] (7:node@c-6.me) My finger table:
-> [ 896.000000] (7:node@c-6.me) Start | Succ 
-> [ 896.000000] (7:node@c-6.me)  16728097  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728098  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728100  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728104  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728112  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728128  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728160  |  42 
-> [ 896.000000] (7:node@c-6.me)  16728224  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16728352  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16728608  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16729120  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16730144  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16732192  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16736288  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16744480  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16760864  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  16416  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  81952  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  213024  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  475168  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  999456  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  2048032  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  4145184  | 16728096 
-> [ 896.000000] (7:node@c-6.me)  8339488  | 16728096 
-> [ 896.000000] (7:node@c-6.me) Predecessor: 16509405
-> [ 899.000000] (6:node@c-5.me) My finger table:
-> [ 899.000000] (6:node@c-5.me) Start | Succ 
-> [ 899.000000] (6:node@c-5.me)  10874877  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10874878  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874880  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874884  | 533744 
-> [ 899.000000] (6:node@c-5.me)  10874892  | 16728096 
-> [ 899.000000] (6:node@c-5.me)  10874908  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10874940  | 16509405 
-> [ 899.000000] (6:node@c-5.me)  10875004  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875132  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875388  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10875900  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10876924  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10878972  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10883068  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10891260  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10907644  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  10940412  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11005948  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11137020  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11399164  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  11923452  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  12972028  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  15069180  | 10874876 
-> [ 899.000000] (6:node@c-5.me)  2486268  | 10874876 
-> [ 899.000000] (6:node@c-5.me) Predecessor: 10004760
-> [ 899.000000] (8:node@c-7.me) My finger table:
-> [ 899.000000] (8:node@c-7.me) Start | Succ 
-> [ 899.000000] (8:node@c-7.me)  10004761  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004762  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004764  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004768  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004776  | 16509405 
-> [ 899.000000] (8:node@c-7.me)  10004792  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004824  | 10874876 
-> [ 899.000000] (8:node@c-7.me)  10004888  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005016  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005272  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10005784  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10006808  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10008856  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10012952  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10021144  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10037528  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10070296  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10135832  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10266904  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  10529048  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  11053336  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  12101912  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  14199064  | 10004760 
-> [ 899.000000] (8:node@c-7.me)  1616152  | 10004760 
-> [ 899.000000] (8:node@c-7.me) Predecessor: 6518808
-> [ 921.000000] (2:node@c-1.me) My finger table:
-> [ 921.000000] (2:node@c-1.me) Start | Succ 
-> [ 921.000000] (2:node@c-1.me)  366681  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366682  | 1319738 
-> [ 921.000000] (2:node@c-1.me)  366684  | 1319738 
-> [ 921.000000] (2:node@c-1.me)  366688  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366696  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366712  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366744  | 533744 
-> [ 921.000000] (2:node@c-1.me)  366808  | 366680 
-> [ 921.000000] (2:node@c-1.me)  366936  | 366680 
-> [ 921.000000] (2:node@c-1.me)  367192  | 366680 
-> [ 921.000000] (2:node@c-1.me)  367704  | 366680 
-> [ 921.000000] (2:node@c-1.me)  368728  | 366680 
-> [ 921.000000] (2:node@c-1.me)  370776  | 366680 
-> [ 921.000000] (2:node@c-1.me)  374872  | 366680 
-> [ 921.000000] (2:node@c-1.me)  383064  | 366680 
-> [ 921.000000] (2:node@c-1.me)  399448  | 366680 
-> [ 921.000000] (2:node@c-1.me)  432216  | 366680 
-> [ 921.000000] (2:node@c-1.me)  497752  | 366680 
-> [ 921.000000] (2:node@c-1.me)  628824  | 366680 
-> [ 921.000000] (2:node@c-1.me)  890968  | 366680 
-> [ 921.000000] (2:node@c-1.me)  1415256  | 366680 
-> [ 921.000000] (2:node@c-1.me)  2463832  | 366680 
-> [ 921.000000] (2:node@c-1.me)  4560984  | 366680 
-> [ 921.000000] (2:node@c-1.me)  8755288  | 366680 
-> [ 921.000000] (2:node@c-1.me) Predecessor: 42
-> [ 928.000000] (9:node@c-8.me) My finger table:
-> [ 928.000000] (9:node@c-8.me) Start | Succ 
-> [ 928.000000] (9:node@c-8.me)  6518809  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518810  | 16728096 
-> [ 928.000000] (9:node@c-8.me)  6518812  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518816  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518824  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518840  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518872  | 10004760 
-> [ 928.000000] (9:node@c-8.me)  6518936  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519064  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519320  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6519832  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6520856  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6522904  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6527000  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6535192  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6551576  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6584344  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6649880  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  6780952  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  7043096  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  7567384  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  8615960  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  10713112  | 6518808 
-> [ 928.000000] (9:node@c-8.me)  14907416  | 6518808 
-> [ 928.000000] (9:node@c-8.me) Predecessor: 2015253
-> [ 930.000000] (4:node@c-3.me) My finger table:
-> [ 930.000000] (4:node@c-3.me) Start | Succ 
-> [ 930.000000] (4:node@c-3.me)  1319739  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319740  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319742  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319746  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319754  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319770  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319802  | 2015253 
-> [ 930.000000] (4:node@c-3.me)  1319866  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1319994  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1320250  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1320762  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1321786  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1323834  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1327930  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1336122  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1352506  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1385274  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1450810  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1581882  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  1844026  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  2368314  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  3416890  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  5514042  | 1319738 
-> [ 930.000000] (4:node@c-3.me)  9708346  | 1319738 
-> [ 930.000000] (4:node@c-3.me) Predecessor: 533744
-> [ 962.000000] (10:node@c-9.me) My finger table:
-> [ 962.000000] (10:node@c-9.me) Start | Succ 
-> [ 962.000000] (10:node@c-9.me)  2015254  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015255  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015257  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015261  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015269  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015285  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015317  | 6518808 
-> [ 962.000000] (10:node@c-9.me)  2015381  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2015509  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2015765  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2016277  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2017301  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2019349  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2023445  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2031637  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2048021  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2080789  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2146325  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2277397  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  2539541  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  3063829  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  4112405  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  6209557  | 2015253 
-> [ 962.000000] (10:node@c-9.me)  10403861  | 2015253 
-> [ 962.000000] (10:node@c-9.me) Predecessor: 1319738
-> [ 982.000000] (1:node@c-0.me) My finger table:
-> [ 982.000000] (1:node@c-0.me) Start | Succ 
-> [ 982.000000] (1:node@c-0.me)   43  | 366680 
-> [ 982.000000] (1:node@c-0.me)   44  | 366680 
-> [ 982.000000] (1:node@c-0.me)   46  | 366680 
-> [ 982.000000] (1:node@c-0.me)   50  | 366680 
-> [ 982.000000] (1:node@c-0.me)   58  | 366680 
-> [ 982.000000] (1:node@c-0.me)   74  | 366680 
-> [ 982.000000] (1:node@c-0.me)  106  | 366680 
-> [ 982.000000] (1:node@c-0.me)  170  | 366680 
-> [ 982.000000] (1:node@c-0.me)  298  |  42 
-> [ 982.000000] (1:node@c-0.me)  554  |  42 
-> [ 982.000000] (1:node@c-0.me)  1066  |  42 
-> [ 982.000000] (1:node@c-0.me)  2090  |  42 
-> [ 982.000000] (1:node@c-0.me)  4138  |  42 
-> [ 982.000000] (1:node@c-0.me)  8234  |  42 
-> [ 982.000000] (1:node@c-0.me)  16426  |  42 
-> [ 982.000000] (1:node@c-0.me)  32810  |  42 
-> [ 982.000000] (1:node@c-0.me)  65578  |  42 
-> [ 982.000000] (1:node@c-0.me)  131114  |  42 
-> [ 982.000000] (1:node@c-0.me)  262186  |  42 
-> [ 982.000000] (1:node@c-0.me)  524330  |  42 
-> [ 982.000000] (1:node@c-0.me)  1048618  |  42 
-> [ 982.000000] (1:node@c-0.me)  2097194  |  42 
-> [ 982.000000] (1:node@c-0.me)  4194346  |  42 
-> [ 982.000000] (1:node@c-0.me)  8388650  |  42 
-> [ 982.000000] (1:node@c-0.me) Predecessor: 16728096
-> [1154.000000] (0:@) Messages created: 2049
-> [1154.000000] (0:@) Simulated time: 1154
+> [ 174.000000] (1:node@c-0.me) My finger table:
+> [ 174.000000] (1:node@c-0.me) Start | Succ 
+> [ 174.000000] (1:node@c-0.me)   43  | 1319738 
+> [ 174.000000] (1:node@c-0.me)   44  |  42 
+> [ 174.000000] (1:node@c-0.me)   46  |  42 
+> [ 174.000000] (1:node@c-0.me)   50  |  42 
+> [ 174.000000] (1:node@c-0.me)   58  |  42 
+> [ 174.000000] (1:node@c-0.me)   74  |  42 
+> [ 174.000000] (1:node@c-0.me)  106  |  42 
+> [ 174.000000] (1:node@c-0.me)  170  |  42 
+> [ 174.000000] (1:node@c-0.me)  298  |  42 
+> [ 174.000000] (1:node@c-0.me)  554  |  42 
+> [ 174.000000] (1:node@c-0.me)  1066  |  42 
+> [ 174.000000] (1:node@c-0.me)  2090  |  42 
+> [ 174.000000] (1:node@c-0.me)  4138  |  42 
+> [ 174.000000] (1:node@c-0.me)  8234  |  42 
+> [ 174.000000] (1:node@c-0.me)  16426  |  42 
+> [ 174.000000] (1:node@c-0.me)  32810  |  42 
+> [ 174.000000] (1:node@c-0.me)  65578  |  42 
+> [ 174.000000] (1:node@c-0.me)  131114  |  42 
+> [ 174.000000] (1:node@c-0.me)  262186  |  42 
+> [ 174.000000] (1:node@c-0.me)  524330  |  42 
+> [ 174.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 174.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 174.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 174.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 174.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 245.000000] (8:node@c-7.me) My finger table:
+> [ 245.000000] (8:node@c-7.me) Start | Succ 
+> [ 245.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 245.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 245.000000] (8:node@c-7.me)  10004764  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 245.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 245.000000] (8:node@c-7.me) Predecessor: 533744
+> [ 246.000000] (3:node@c-2.me) My finger table:
+> [ 246.000000] (3:node@c-2.me) Start | Succ 
+> [ 246.000000] (3:node@c-2.me)  533745  | 10004760 
+> [ 246.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 246.000000] (3:node@c-2.me)  533748  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533752  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 246.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 246.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 246.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 246.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 246.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 246.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 246.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 246.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 246.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 246.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 246.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 246.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 246.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 246.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 246.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 246.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 246.000000] (5:node@c-4.me) My finger table:
+> [ 246.000000] (5:node@c-4.me) Start | Succ 
+> [ 246.000000] (5:node@c-4.me)  16509406  | 366680 
+> [ 246.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 246.000000] (5:node@c-4.me)  16509409  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509413  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 246.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 246.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 247.000000] (6:node@c-5.me) My finger table:
+> [ 247.000000] (6:node@c-5.me) Start | Succ 
+> [ 247.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 247.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 247.000000] (6:node@c-5.me)  10874880  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874884  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 247.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 247.000000] (6:node@c-5.me) Predecessor: -1
+> [ 247.000000] (7:node@c-6.me) My finger table:
+> [ 247.000000] (7:node@c-6.me) Start | Succ 
+> [ 247.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 247.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 247.000000] (7:node@c-6.me)  16728100  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 247.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 247.000000] (7:node@c-6.me) Predecessor: 2015253
+> [ 253.000000] (1:node@c-0.me) My finger table:
+> [ 253.000000] (1:node@c-0.me) Start | Succ 
+> [ 253.000000] (1:node@c-0.me)   43  | 1319738 
+> [ 253.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 253.000000] (1:node@c-0.me)   46  |  42 
+> [ 253.000000] (1:node@c-0.me)   50  |  42 
+> [ 253.000000] (1:node@c-0.me)   58  |  42 
+> [ 253.000000] (1:node@c-0.me)   74  |  42 
+> [ 253.000000] (1:node@c-0.me)  106  |  42 
+> [ 253.000000] (1:node@c-0.me)  170  |  42 
+> [ 253.000000] (1:node@c-0.me)  298  |  42 
+> [ 253.000000] (1:node@c-0.me)  554  |  42 
+> [ 253.000000] (1:node@c-0.me)  1066  |  42 
+> [ 253.000000] (1:node@c-0.me)  2090  |  42 
+> [ 253.000000] (1:node@c-0.me)  4138  |  42 
+> [ 253.000000] (1:node@c-0.me)  8234  |  42 
+> [ 253.000000] (1:node@c-0.me)  16426  |  42 
+> [ 253.000000] (1:node@c-0.me)  32810  |  42 
+> [ 253.000000] (1:node@c-0.me)  65578  |  42 
+> [ 253.000000] (1:node@c-0.me)  131114  |  42 
+> [ 253.000000] (1:node@c-0.me)  262186  |  42 
+> [ 253.000000] (1:node@c-0.me)  524330  |  42 
+> [ 253.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 253.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 253.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 253.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 253.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 255.000000] (2:node@c-1.me) My finger table:
+> [ 255.000000] (2:node@c-1.me) Start | Succ 
+> [ 255.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 255.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 255.000000] (2:node@c-1.me)  366684  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 255.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 255.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 255.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 255.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 255.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 255.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 255.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 255.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 255.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 255.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 255.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 255.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 255.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 255.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 255.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 255.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 255.000000] (2:node@c-1.me) Predecessor: 16509405
+> [ 260.000000] (4:node@c-3.me) My finger table:
+> [ 260.000000] (4:node@c-3.me) Start | Succ 
+> [ 260.000000] (4:node@c-3.me)  1319739  | 6518808 
+> [ 260.000000] (4:node@c-3.me)  1319740  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319742  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 260.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 260.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 292.000000] (7:node@c-6.me) My finger table:
+> [ 292.000000] (7:node@c-6.me) Start | Succ 
+> [ 292.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 292.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 292.000000] (7:node@c-6.me)  16728100  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 292.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 292.000000] (7:node@c-6.me) Predecessor: 6518808
+> [ 300.000000] (9:node@c-8.me) My finger table:
+> [ 300.000000] (9:node@c-8.me) Start | Succ 
+> [ 300.000000] (9:node@c-8.me)  6518809  | 16728096 
+> [ 300.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 300.000000] (9:node@c-8.me)  6518812  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 300.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 300.000000] (9:node@c-8.me) Predecessor: 1319738
+> [ 301.000000] (10:node@c-9.me) My finger table:
+> [ 301.000000] (10:node@c-9.me) Start | Succ 
+> [ 301.000000] (10:node@c-9.me)  2015254  | 16728096 
+> [ 301.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 301.000000] (10:node@c-9.me)  2015257  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 301.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 301.000000] (10:node@c-9.me) Predecessor: -1
+> [ 302.000000] (2:node@c-1.me) My finger table:
+> [ 302.000000] (2:node@c-1.me) Start | Succ 
+> [ 302.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 302.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 302.000000] (2:node@c-1.me)  366684  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 302.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 302.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 302.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 302.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 302.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 302.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 302.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 302.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 302.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 302.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 302.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 302.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 302.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 302.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 302.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 302.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 302.000000] (2:node@c-1.me) Predecessor: 42
+> [ 306.000000] (4:node@c-3.me) My finger table:
+> [ 306.000000] (4:node@c-3.me) Start | Succ 
+> [ 306.000000] (4:node@c-3.me)  1319739  | 6518808 
+> [ 306.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 306.000000] (4:node@c-3.me)  1319742  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 306.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 306.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 339.000000] (9:node@c-8.me) My finger table:
+> [ 339.000000] (9:node@c-8.me) Start | Succ 
+> [ 339.000000] (9:node@c-8.me)  6518809  | 16728096 
+> [ 339.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 339.000000] (9:node@c-8.me)  6518812  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 339.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 339.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 367.000000] (6:node@c-5.me) My finger table:
+> [ 367.000000] (6:node@c-5.me) Start | Succ 
+> [ 367.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 367.000000] (6:node@c-5.me)  10874884  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 367.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 367.000000] (6:node@c-5.me) Predecessor: -1
+> [ 368.000000] (3:node@c-2.me) My finger table:
+> [ 368.000000] (3:node@c-2.me) Start | Succ 
+> [ 368.000000] (3:node@c-2.me)  533745  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 368.000000] (3:node@c-2.me)  533752  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 368.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 368.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 368.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 368.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 368.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 368.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 368.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 368.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 368.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 368.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 368.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 368.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 368.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 368.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 368.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 368.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 368.000000] (5:node@c-4.me) My finger table:
+> [ 368.000000] (5:node@c-4.me) Start | Succ 
+> [ 368.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 368.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 368.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 368.000000] (5:node@c-4.me)  16509413  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 368.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 368.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 370.000000] (8:node@c-7.me) My finger table:
+> [ 370.000000] (8:node@c-7.me) Start | Succ 
+> [ 370.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 370.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 370.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 370.000000] (8:node@c-7.me) Predecessor: 533744
+> [ 373.000000] (7:node@c-6.me) My finger table:
+> [ 373.000000] (7:node@c-6.me) Start | Succ 
+> [ 373.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 373.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 373.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 373.000000] (7:node@c-6.me) Predecessor: 6518808
+> [ 375.000000] (2:node@c-1.me) My finger table:
+> [ 375.000000] (2:node@c-1.me) Start | Succ 
+> [ 375.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 375.000000] (2:node@c-1.me)  366688  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 375.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 375.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 375.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 375.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 375.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 375.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 375.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 375.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 375.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 375.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 375.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 375.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 375.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 375.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 375.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 375.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 375.000000] (2:node@c-1.me) Predecessor: 42
+> [ 382.000000] (1:node@c-0.me) My finger table:
+> [ 382.000000] (1:node@c-0.me) Start | Succ 
+> [ 382.000000] (1:node@c-0.me)   43  | 366680 
+> [ 382.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 382.000000] (1:node@c-0.me)   46  | 366680 
+> [ 382.000000] (1:node@c-0.me)   50  |  42 
+> [ 382.000000] (1:node@c-0.me)   58  |  42 
+> [ 382.000000] (1:node@c-0.me)   74  |  42 
+> [ 382.000000] (1:node@c-0.me)  106  |  42 
+> [ 382.000000] (1:node@c-0.me)  170  |  42 
+> [ 382.000000] (1:node@c-0.me)  298  |  42 
+> [ 382.000000] (1:node@c-0.me)  554  |  42 
+> [ 382.000000] (1:node@c-0.me)  1066  |  42 
+> [ 382.000000] (1:node@c-0.me)  2090  |  42 
+> [ 382.000000] (1:node@c-0.me)  4138  |  42 
+> [ 382.000000] (1:node@c-0.me)  8234  |  42 
+> [ 382.000000] (1:node@c-0.me)  16426  |  42 
+> [ 382.000000] (1:node@c-0.me)  32810  |  42 
+> [ 382.000000] (1:node@c-0.me)  65578  |  42 
+> [ 382.000000] (1:node@c-0.me)  131114  |  42 
+> [ 382.000000] (1:node@c-0.me)  262186  |  42 
+> [ 382.000000] (1:node@c-0.me)  524330  |  42 
+> [ 382.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 382.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 382.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 382.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 382.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 383.000000] (7:node@c-6.me) My finger table:
+> [ 383.000000] (7:node@c-6.me) Start | Succ 
+> [ 383.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 383.000000] (7:node@c-6.me)  16728104  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 383.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 383.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 385.000000] (10:node@c-9.me) My finger table:
+> [ 385.000000] (10:node@c-9.me) Start | Succ 
+> [ 385.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 385.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 385.000000] (10:node@c-9.me)  2015257  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 385.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 385.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 427.000000] (9:node@c-8.me) My finger table:
+> [ 427.000000] (9:node@c-8.me) Start | Succ 
+> [ 427.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 427.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 427.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 427.000000] (9:node@c-8.me)  6518816  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 427.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 427.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 432.000000] (10:node@c-9.me) My finger table:
+> [ 432.000000] (10:node@c-9.me) Start | Succ 
+> [ 432.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 432.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 432.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 432.000000] (10:node@c-9.me)  2015261  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 432.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 432.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 484.000000] (4:node@c-3.me) My finger table:
+> [ 484.000000] (4:node@c-3.me) Start | Succ 
+> [ 484.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 484.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 484.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 484.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 484.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 484.000000] (4:node@c-3.me) Predecessor: 366680
+> [ 487.000000] (6:node@c-5.me) My finger table:
+> [ 487.000000] (6:node@c-5.me) Start | Succ 
+> [ 487.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 487.000000] (6:node@c-5.me)  10874892  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 487.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 487.000000] (6:node@c-5.me) Predecessor: -1
+> [ 490.000000] (8:node@c-7.me) My finger table:
+> [ 490.000000] (8:node@c-7.me) Start | Succ 
+> [ 490.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 490.000000] (8:node@c-7.me)  10004768  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 490.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 490.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 491.000000] (8:node@c-7.me) My finger table:
+> [ 491.000000] (8:node@c-7.me) Start | Succ 
+> [ 491.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 491.000000] (8:node@c-7.me)  10004776  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 491.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 491.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 496.000000] (7:node@c-6.me) My finger table:
+> [ 496.000000] (7:node@c-6.me) Start | Succ 
+> [ 496.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 496.000000] (7:node@c-6.me)  16728112  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 496.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 496.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 497.000000] (3:node@c-2.me) My finger table:
+> [ 497.000000] (3:node@c-2.me) Start | Succ 
+> [ 497.000000] (3:node@c-2.me)  533745  | 6518808 
+> [ 497.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 497.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 497.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 497.000000] (3:node@c-2.me)  533760  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 497.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 497.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 497.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 497.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 497.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 497.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 497.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 497.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 497.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 497.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 497.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 497.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 497.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 497.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 497.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 497.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 502.000000] (1:node@c-0.me) My finger table:
+> [ 502.000000] (1:node@c-0.me) Start | Succ 
+> [ 502.000000] (1:node@c-0.me)   43  | 366680 
+> [ 502.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 502.000000] (1:node@c-0.me)   46  | 366680 
+> [ 502.000000] (1:node@c-0.me)   50  | 366680 
+> [ 502.000000] (1:node@c-0.me)   58  |  42 
+> [ 502.000000] (1:node@c-0.me)   74  |  42 
+> [ 502.000000] (1:node@c-0.me)  106  |  42 
+> [ 502.000000] (1:node@c-0.me)  170  |  42 
+> [ 502.000000] (1:node@c-0.me)  298  |  42 
+> [ 502.000000] (1:node@c-0.me)  554  |  42 
+> [ 502.000000] (1:node@c-0.me)  1066  |  42 
+> [ 502.000000] (1:node@c-0.me)  2090  |  42 
+> [ 502.000000] (1:node@c-0.me)  4138  |  42 
+> [ 502.000000] (1:node@c-0.me)  8234  |  42 
+> [ 502.000000] (1:node@c-0.me)  16426  |  42 
+> [ 502.000000] (1:node@c-0.me)  32810  |  42 
+> [ 502.000000] (1:node@c-0.me)  65578  |  42 
+> [ 502.000000] (1:node@c-0.me)  131114  |  42 
+> [ 502.000000] (1:node@c-0.me)  262186  |  42 
+> [ 502.000000] (1:node@c-0.me)  524330  |  42 
+> [ 502.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 502.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 502.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 502.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 502.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 505.000000] (2:node@c-1.me) My finger table:
+> [ 505.000000] (2:node@c-1.me) Start | Succ 
+> [ 505.000000] (2:node@c-1.me)  366681  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 505.000000] (2:node@c-1.me)  366696  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 505.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 505.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 505.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 505.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 505.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 505.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 505.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 505.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 505.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 505.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 505.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 505.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 505.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 505.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 505.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 505.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 505.000000] (2:node@c-1.me) Predecessor: 42
+> [ 513.000000] (5:node@c-4.me) My finger table:
+> [ 513.000000] (5:node@c-4.me) Start | Succ 
+> [ 513.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 513.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 513.000000] (5:node@c-4.me)  16509421  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 513.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 513.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 558.000000] (9:node@c-8.me) My finger table:
+> [ 558.000000] (9:node@c-8.me) Start | Succ 
+> [ 558.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 558.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 558.000000] (9:node@c-8.me)  6518824  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 558.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 558.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 573.000000] (10:node@c-9.me) My finger table:
+> [ 573.000000] (10:node@c-9.me) Start | Succ 
+> [ 573.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 573.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 573.000000] (10:node@c-9.me)  2015269  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 573.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 573.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 600.000000] (4:node@c-3.me) My finger table:
+> [ 600.000000] (4:node@c-3.me) Start | Succ 
+> [ 600.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 600.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 600.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 600.000000] (4:node@c-3.me)  1319746  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 600.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 600.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 610.000000] (6:node@c-5.me) My finger table:
+> [ 610.000000] (6:node@c-5.me) Start | Succ 
+> [ 610.000000] (6:node@c-5.me)  10874877  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 610.000000] (6:node@c-5.me)  10874908  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 610.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 610.000000] (6:node@c-5.me) Predecessor: -1
+> [ 656.000000] (5:node@c-4.me) My finger table:
+> [ 656.000000] (5:node@c-4.me) Start | Succ 
+> [ 656.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 656.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 656.000000] (5:node@c-4.me)  16509437  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 656.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 656.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 657.000000] (7:node@c-6.me) My finger table:
+> [ 657.000000] (7:node@c-6.me) Start | Succ 
+> [ 657.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 657.000000] (7:node@c-6.me)  16728128  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 657.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 657.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 663.000000] (4:node@c-3.me) My finger table:
+> [ 663.000000] (4:node@c-3.me) Start | Succ 
+> [ 663.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 663.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 663.000000] (4:node@c-3.me)  1319754  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 663.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 663.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 665.000000] (1:node@c-0.me) My finger table:
+> [ 665.000000] (1:node@c-0.me) Start | Succ 
+> [ 665.000000] (1:node@c-0.me)   43  | 366680 
+> [ 665.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 665.000000] (1:node@c-0.me)   46  | 366680 
+> [ 665.000000] (1:node@c-0.me)   50  | 366680 
+> [ 665.000000] (1:node@c-0.me)   58  | 366680 
+> [ 665.000000] (1:node@c-0.me)   74  |  42 
+> [ 665.000000] (1:node@c-0.me)  106  |  42 
+> [ 665.000000] (1:node@c-0.me)  170  |  42 
+> [ 665.000000] (1:node@c-0.me)  298  |  42 
+> [ 665.000000] (1:node@c-0.me)  554  |  42 
+> [ 665.000000] (1:node@c-0.me)  1066  |  42 
+> [ 665.000000] (1:node@c-0.me)  2090  |  42 
+> [ 665.000000] (1:node@c-0.me)  4138  |  42 
+> [ 665.000000] (1:node@c-0.me)  8234  |  42 
+> [ 665.000000] (1:node@c-0.me)  16426  |  42 
+> [ 665.000000] (1:node@c-0.me)  32810  |  42 
+> [ 665.000000] (1:node@c-0.me)  65578  |  42 
+> [ 665.000000] (1:node@c-0.me)  131114  |  42 
+> [ 665.000000] (1:node@c-0.me)  262186  |  42 
+> [ 665.000000] (1:node@c-0.me)  524330  |  42 
+> [ 665.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 665.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 665.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 665.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 665.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 669.000000] (8:node@c-7.me) My finger table:
+> [ 669.000000] (8:node@c-7.me) Start | Succ 
+> [ 669.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 669.000000] (8:node@c-7.me)  10004792  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 669.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 669.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 671.000000] (3:node@c-2.me) My finger table:
+> [ 671.000000] (3:node@c-2.me) Start | Succ 
+> [ 671.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 671.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 671.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 671.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 671.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 671.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 671.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 671.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 671.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 671.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 671.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 671.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 671.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 671.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 671.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 671.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 671.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 671.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 671.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 671.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 671.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 671.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 671.000000] (3:node@c-2.me) Predecessor: 10874876
+> [ 678.000000] (9:node@c-8.me) My finger table:
+> [ 678.000000] (9:node@c-8.me) Start | Succ 
+> [ 678.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 678.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 678.000000] (9:node@c-8.me)  6518840  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 678.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 678.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 683.000000] (2:node@c-1.me) My finger table:
+> [ 683.000000] (2:node@c-1.me) Start | Succ 
+> [ 683.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 683.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 683.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 683.000000] (2:node@c-1.me)  366712  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 683.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 683.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 683.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 683.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 683.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 683.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 683.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 683.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 683.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 683.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 683.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 683.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 683.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 683.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 683.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 683.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 683.000000] (2:node@c-1.me) Predecessor: 42
+> [ 684.000000] (3:node@c-2.me) My finger table:
+> [ 684.000000] (3:node@c-2.me) Start | Succ 
+> [ 684.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 684.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 684.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 684.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 684.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 684.000000] (3:node@c-2.me)  533776  | 533744 
+> [ 684.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 684.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 684.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 684.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 684.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 684.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 684.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 684.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 684.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 684.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 684.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 684.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 684.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 684.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 684.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 684.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 684.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 721.000000] (10:node@c-9.me) My finger table:
+> [ 721.000000] (10:node@c-9.me) Start | Succ 
+> [ 721.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 721.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 721.000000] (10:node@c-9.me)  2015285  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 721.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 721.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 744.000000] (6:node@c-5.me) My finger table:
+> [ 744.000000] (6:node@c-5.me) Start | Succ 
+> [ 744.000000] (6:node@c-5.me)  10874877  | 16728096 
+> [ 744.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 744.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 744.000000] (6:node@c-5.me)  10874940  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 744.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 744.000000] (6:node@c-5.me) Predecessor: -1
+> [ 777.000000] (7:node@c-6.me) My finger table:
+> [ 777.000000] (7:node@c-6.me) Start | Succ 
+> [ 777.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728128  |  42 
+> [ 777.000000] (7:node@c-6.me)  16728160  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 777.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 777.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 786.000000] (5:node@c-4.me) My finger table:
+> [ 786.000000] (5:node@c-4.me) Start | Succ 
+> [ 786.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 786.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 786.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 786.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 786.000000] (5:node@c-4.me) Predecessor: 10004760
+> [ 787.000000] (4:node@c-3.me) My finger table:
+> [ 787.000000] (4:node@c-3.me) Start | Succ 
+> [ 787.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 787.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319754  | 2015253 
+> [ 787.000000] (4:node@c-3.me)  1319770  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 787.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 787.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 788.000000] (1:node@c-0.me) My finger table:
+> [ 788.000000] (1:node@c-0.me) Start | Succ 
+> [ 788.000000] (1:node@c-0.me)   43  | 366680 
+> [ 788.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 788.000000] (1:node@c-0.me)   46  | 366680 
+> [ 788.000000] (1:node@c-0.me)   50  | 366680 
+> [ 788.000000] (1:node@c-0.me)   58  | 366680 
+> [ 788.000000] (1:node@c-0.me)   74  | 366680 
+> [ 788.000000] (1:node@c-0.me)  106  |  42 
+> [ 788.000000] (1:node@c-0.me)  170  |  42 
+> [ 788.000000] (1:node@c-0.me)  298  |  42 
+> [ 788.000000] (1:node@c-0.me)  554  |  42 
+> [ 788.000000] (1:node@c-0.me)  1066  |  42 
+> [ 788.000000] (1:node@c-0.me)  2090  |  42 
+> [ 788.000000] (1:node@c-0.me)  4138  |  42 
+> [ 788.000000] (1:node@c-0.me)  8234  |  42 
+> [ 788.000000] (1:node@c-0.me)  16426  |  42 
+> [ 788.000000] (1:node@c-0.me)  32810  |  42 
+> [ 788.000000] (1:node@c-0.me)  65578  |  42 
+> [ 788.000000] (1:node@c-0.me)  131114  |  42 
+> [ 788.000000] (1:node@c-0.me)  262186  |  42 
+> [ 788.000000] (1:node@c-0.me)  524330  |  42 
+> [ 788.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 788.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 788.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 788.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 788.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 793.000000] (3:node@c-2.me) My finger table:
+> [ 793.000000] (3:node@c-2.me) Start | Succ 
+> [ 793.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 793.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 793.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 793.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533776  | 1319738 
+> [ 793.000000] (3:node@c-2.me)  533808  | 533744 
+> [ 793.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 793.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 793.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 793.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 793.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 793.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 793.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 793.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 793.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 793.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 793.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 793.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 793.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 793.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 793.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 793.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 797.000000] (5:node@c-4.me) My finger table:
+> [ 797.000000] (5:node@c-4.me) Start | Succ 
+> [ 797.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 797.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 797.000000] (5:node@c-4.me)  16509469  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 797.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 797.000000] (5:node@c-4.me) Predecessor: 10874876
+> [ 798.000000] (8:node@c-7.me) My finger table:
+> [ 798.000000] (8:node@c-7.me) Start | Succ 
+> [ 798.000000] (8:node@c-7.me)  10004761  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004792  | 16509405 
+> [ 798.000000] (8:node@c-7.me)  10004824  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 798.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 798.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 801.000000] (9:node@c-8.me) My finger table:
+> [ 801.000000] (9:node@c-8.me) Start | Succ 
+> [ 801.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 801.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518840  | 10004760 
+> [ 801.000000] (9:node@c-8.me)  6518872  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 801.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 801.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 804.000000] (2:node@c-1.me) My finger table:
+> [ 804.000000] (2:node@c-1.me) Start | Succ 
+> [ 804.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 804.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366712  | 533744 
+> [ 804.000000] (2:node@c-1.me)  366744  | 366680 
+> [ 804.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 804.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 804.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 804.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 804.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 804.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 804.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 804.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 804.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 804.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 804.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 804.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 804.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 804.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 804.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 804.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 804.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 804.000000] (2:node@c-1.me) Predecessor: 42
+> [ 843.000000] (10:node@c-9.me) My finger table:
+> [ 843.000000] (10:node@c-9.me) Start | Succ 
+> [ 843.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 843.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015285  | 6518808 
+> [ 843.000000] (10:node@c-9.me)  2015317  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 843.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 843.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 865.000000] (6:node@c-5.me) My finger table:
+> [ 865.000000] (6:node@c-5.me) Start | Succ 
+> [ 865.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 865.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 865.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 865.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 865.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 865.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 865.000000] (6:node@c-5.me) Predecessor: -1
+> [ 870.000000] (6:node@c-5.me) My finger table:
+> [ 870.000000] (6:node@c-5.me) Start | Succ 
+> [ 870.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 870.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 870.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 870.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 870.000000] (6:node@c-5.me)  10875004  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 870.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 870.000000] (6:node@c-5.me) Predecessor: 10004760
+> [ 910.000000] (5:node@c-4.me) My finger table:
+> [ 910.000000] (5:node@c-4.me) Start | Succ 
+> [ 910.000000] (5:node@c-4.me)  16509406  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509407  | 366680 
+> [ 910.000000] (5:node@c-4.me)  16509409  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509413  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509421  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509437  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509469  | 16728096 
+> [ 910.000000] (5:node@c-4.me)  16509533  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16509661  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16509917  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16510429  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16511453  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16513501  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16517597  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16525789  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16542173  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16574941  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16640477  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  16771549  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  256477  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  780765  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  1829341  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  3926493  | 16509405 
+> [ 910.000000] (5:node@c-4.me)  8120797  | 16509405 
+> [ 910.000000] (5:node@c-4.me) Predecessor: 10874876
+> [ 912.000000] (1:node@c-0.me) My finger table:
+> [ 912.000000] (1:node@c-0.me) Start | Succ 
+> [ 912.000000] (1:node@c-0.me)   43  | 366680 
+> [ 912.000000] (1:node@c-0.me)   44  | 1319738 
+> [ 912.000000] (1:node@c-0.me)   46  | 366680 
+> [ 912.000000] (1:node@c-0.me)   50  | 366680 
+> [ 912.000000] (1:node@c-0.me)   58  | 366680 
+> [ 912.000000] (1:node@c-0.me)   74  | 366680 
+> [ 912.000000] (1:node@c-0.me)  106  | 366680 
+> [ 912.000000] (1:node@c-0.me)  170  |  42 
+> [ 912.000000] (1:node@c-0.me)  298  |  42 
+> [ 912.000000] (1:node@c-0.me)  554  |  42 
+> [ 912.000000] (1:node@c-0.me)  1066  |  42 
+> [ 912.000000] (1:node@c-0.me)  2090  |  42 
+> [ 912.000000] (1:node@c-0.me)  4138  |  42 
+> [ 912.000000] (1:node@c-0.me)  8234  |  42 
+> [ 912.000000] (1:node@c-0.me)  16426  |  42 
+> [ 912.000000] (1:node@c-0.me)  32810  |  42 
+> [ 912.000000] (1:node@c-0.me)  65578  |  42 
+> [ 912.000000] (1:node@c-0.me)  131114  |  42 
+> [ 912.000000] (1:node@c-0.me)  262186  |  42 
+> [ 912.000000] (1:node@c-0.me)  524330  |  42 
+> [ 912.000000] (1:node@c-0.me)  1048618  |  42 
+> [ 912.000000] (1:node@c-0.me)  2097194  |  42 
+> [ 912.000000] (1:node@c-0.me)  4194346  |  42 
+> [ 912.000000] (1:node@c-0.me)  8388650  |  42 
+> [ 912.000000] (1:node@c-0.me) Predecessor: 16728096
+> [ 913.000000] (3:node@c-2.me) My finger table:
+> [ 913.000000] (3:node@c-2.me) Start | Succ 
+> [ 913.000000] (3:node@c-2.me)  533745  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533746  | 10004760 
+> [ 913.000000] (3:node@c-2.me)  533748  | 10004760 
+> [ 913.000000] (3:node@c-2.me)  533752  | 6518808 
+> [ 913.000000] (3:node@c-2.me)  533760  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533776  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533808  | 1319738 
+> [ 913.000000] (3:node@c-2.me)  533872  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534000  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534256  | 533744 
+> [ 913.000000] (3:node@c-2.me)  534768  | 533744 
+> [ 913.000000] (3:node@c-2.me)  535792  | 533744 
+> [ 913.000000] (3:node@c-2.me)  537840  | 533744 
+> [ 913.000000] (3:node@c-2.me)  541936  | 533744 
+> [ 913.000000] (3:node@c-2.me)  550128  | 533744 
+> [ 913.000000] (3:node@c-2.me)  566512  | 533744 
+> [ 913.000000] (3:node@c-2.me)  599280  | 533744 
+> [ 913.000000] (3:node@c-2.me)  664816  | 533744 
+> [ 913.000000] (3:node@c-2.me)  795888  | 533744 
+> [ 913.000000] (3:node@c-2.me)  1058032  | 533744 
+> [ 913.000000] (3:node@c-2.me)  1582320  | 533744 
+> [ 913.000000] (3:node@c-2.me)  2630896  | 533744 
+> [ 913.000000] (3:node@c-2.me)  4728048  | 533744 
+> [ 913.000000] (3:node@c-2.me)  8922352  | 533744 
+> [ 913.000000] (3:node@c-2.me) Predecessor: 366680
+> [ 921.000000] (8:node@c-7.me) My finger table:
+> [ 921.000000] (8:node@c-7.me) Start | Succ 
+> [ 921.000000] (8:node@c-7.me)  10004761  | 10874876 
+> [ 921.000000] (8:node@c-7.me)  10004762  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004764  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004768  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004776  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004792  | 16509405 
+> [ 921.000000] (8:node@c-7.me)  10004824  | 10874876 
+> [ 921.000000] (8:node@c-7.me)  10004888  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005016  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005272  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10005784  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10006808  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10008856  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10012952  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10021144  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10037528  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10070296  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10135832  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10266904  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  10529048  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  11053336  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  12101912  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  14199064  | 10004760 
+> [ 921.000000] (8:node@c-7.me)  1616152  | 10004760 
+> [ 921.000000] (8:node@c-7.me) Predecessor: 6518808
+> [ 964.000000] (2:node@c-1.me) My finger table:
+> [ 964.000000] (2:node@c-1.me) Start | Succ 
+> [ 964.000000] (2:node@c-1.me)  366681  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366682  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366684  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366688  | 1319738 
+> [ 964.000000] (2:node@c-1.me)  366696  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366712  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366744  | 533744 
+> [ 964.000000] (2:node@c-1.me)  366808  | 366680 
+> [ 964.000000] (2:node@c-1.me)  366936  | 366680 
+> [ 964.000000] (2:node@c-1.me)  367192  | 366680 
+> [ 964.000000] (2:node@c-1.me)  367704  | 366680 
+> [ 964.000000] (2:node@c-1.me)  368728  | 366680 
+> [ 964.000000] (2:node@c-1.me)  370776  | 366680 
+> [ 964.000000] (2:node@c-1.me)  374872  | 366680 
+> [ 964.000000] (2:node@c-1.me)  383064  | 366680 
+> [ 964.000000] (2:node@c-1.me)  399448  | 366680 
+> [ 964.000000] (2:node@c-1.me)  432216  | 366680 
+> [ 964.000000] (2:node@c-1.me)  497752  | 366680 
+> [ 964.000000] (2:node@c-1.me)  628824  | 366680 
+> [ 964.000000] (2:node@c-1.me)  890968  | 366680 
+> [ 964.000000] (2:node@c-1.me)  1415256  | 366680 
+> [ 964.000000] (2:node@c-1.me)  2463832  | 366680 
+> [ 964.000000] (2:node@c-1.me)  4560984  | 366680 
+> [ 964.000000] (2:node@c-1.me)  8755288  | 366680 
+> [ 964.000000] (2:node@c-1.me) Predecessor: 42
+> [ 966.000000] (4:node@c-3.me) My finger table:
+> [ 966.000000] (4:node@c-3.me) Start | Succ 
+> [ 966.000000] (4:node@c-3.me)  1319739  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319740  | 6518808 
+> [ 966.000000] (4:node@c-3.me)  1319742  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319746  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319754  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319770  | 2015253 
+> [ 966.000000] (4:node@c-3.me)  1319802  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1319866  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1319994  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1320250  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1320762  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1321786  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1323834  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1327930  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1336122  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1352506  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1385274  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1450810  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1581882  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  1844026  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  2368314  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  3416890  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  5514042  | 1319738 
+> [ 966.000000] (4:node@c-3.me)  9708346  | 1319738 
+> [ 966.000000] (4:node@c-3.me) Predecessor: 533744
+> [ 966.000000] (7:node@c-6.me) My finger table:
+> [ 966.000000] (7:node@c-6.me) Start | Succ 
+> [ 966.000000] (7:node@c-6.me)  16728097  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728098  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728100  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728104  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728112  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728128  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728160  |  42 
+> [ 966.000000] (7:node@c-6.me)  16728224  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16728352  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16728608  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16729120  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16730144  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16732192  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16736288  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16744480  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16760864  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  16416  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  81952  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  213024  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  475168  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  999456  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  2048032  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  4145184  | 16728096 
+> [ 966.000000] (7:node@c-6.me)  8339488  | 16728096 
+> [ 966.000000] (7:node@c-6.me) Predecessor: 16509405
+> [ 973.000000] (9:node@c-8.me) My finger table:
+> [ 973.000000] (9:node@c-8.me) Start | Succ 
+> [ 973.000000] (9:node@c-8.me)  6518809  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518810  | 16728096 
+> [ 973.000000] (9:node@c-8.me)  6518812  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518816  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518824  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518840  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518872  | 10004760 
+> [ 973.000000] (9:node@c-8.me)  6518936  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519064  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519320  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6519832  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6520856  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6522904  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6527000  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6535192  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6551576  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6584344  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6649880  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  6780952  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  7043096  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  7567384  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  8615960  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  10713112  | 6518808 
+> [ 973.000000] (9:node@c-8.me)  14907416  | 6518808 
+> [ 973.000000] (9:node@c-8.me) Predecessor: 2015253
+> [ 979.000000] (10:node@c-9.me) My finger table:
+> [ 979.000000] (10:node@c-9.me) Start | Succ 
+> [ 979.000000] (10:node@c-9.me)  2015254  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015255  | 16728096 
+> [ 979.000000] (10:node@c-9.me)  2015257  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015261  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015269  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015285  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015317  | 6518808 
+> [ 979.000000] (10:node@c-9.me)  2015381  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2015509  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2015765  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2016277  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2017301  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2019349  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2023445  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2031637  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2048021  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2080789  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2146325  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2277397  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  2539541  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  3063829  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  4112405  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  6209557  | 2015253 
+> [ 979.000000] (10:node@c-9.me)  10403861  | 2015253 
+> [ 979.000000] (10:node@c-9.me) Predecessor: 1319738
+> [ 987.000000] (6:node@c-5.me) My finger table:
+> [ 987.000000] (6:node@c-5.me) Start | Succ 
+> [ 987.000000] (6:node@c-5.me)  10874877  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10874878  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874880  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874884  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874892  | 533744 
+> [ 987.000000] (6:node@c-5.me)  10874908  | 16728096 
+> [ 987.000000] (6:node@c-5.me)  10874940  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10875004  | 16509405 
+> [ 987.000000] (6:node@c-5.me)  10875132  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10875388  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10875900  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10876924  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10878972  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10883068  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10891260  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10907644  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  10940412  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11005948  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11137020  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11399164  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  11923452  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  12972028  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  15069180  | 10874876 
+> [ 987.000000] (6:node@c-5.me)  2486268  | 10874876 
+> [ 987.000000] (6:node@c-5.me) Predecessor: 10004760
+> [1196.000000] (0:@) Messages created: 1827
+> [1196.000000] (0:@) Simulated time: 1196
index e1527eb..33513a0 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved.                             */
+/* Copyright (c) 2007-2013. 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. */
diff --git a/examples/msg/energy/e1/CMakeLists.txt b/examples/msg/energy/e1/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d8d7dd8
--- /dev/null
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(e1 e1.c)
+
+### Add definitions for compile
+target_link_libraries(e1 simgrid )
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/pstate.tesh
+  PARENT_SCOPE
+  )
+
+set(xml_files
+  ${xml_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_e1.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/platform_e1.xml
+  PARENT_SCOPE
+  )
+
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/e1.c
+  PARENT_SCOPE
+  )
+
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
diff --git a/examples/msg/energy/e1/deployment_e1.xml b/examples/msg/energy/e1/deployment_e1.xml
new file mode 100644 (file)
index 0000000..8997fbc
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+  <process host="MyHost1" function="dvfs_test" />
+  <process host="MyHost2" function="dvfs_test" />
+
+</platform>
diff --git a/examples/msg/energy/e1/e1.c b/examples/msg/energy/e1/e1.c
new file mode 100644 (file)
index 0000000..74013fb
--- /dev/null
@@ -0,0 +1,119 @@
+/* Copyright (c) 2007-2010, 2013. 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 "msg/msg.h"
+#include "xbt/sysdep.h"         /* calloc */
+
+/* Create a log channel to have nice outputs. */
+#include "xbt/log.h"
+#include "xbt/asserts.h"
+
+
+/** @addtogroup MSG_examples
+ *
+ * - <b>energy/e1/e1.c</b> Shows how a set of pstates can be defined
+ *             for a host and how the current pstate can be accessed/changed
+ *             with @ref MSG_get_host_current_power_peak and @ref
+ *             MSG_set_host_power_peak_at.
+ *             Make sure to read the platform XML file for details on how
+ *             to declare the CPU capacity for each pstate.
+ *
+ */
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(test,
+                             "Pstate properties test");
+
+int dvfs(int argc, char *argv[]);
+
+
+int dvfs(int argc, char *argv[])
+{
+  msg_host_t host = NULL;
+  msg_task_t task1 = NULL;
+  double task_time = 0;
+  double workload = 100E6;
+  int new_peak_index=2;
+  host = MSG_host_self();; //MSG_get_host_by_name("MyHost1");
+
+  int nb = MSG_get_host_nb_pstates(host);
+  XBT_INFO("Number of Processor states=%d", nb);
+
+  double current_peak = MSG_get_host_current_power_peak(host);
+  XBT_INFO("Current power peak=%f", current_peak);
+
+  // Run a task
+  task1 = MSG_task_create ("t1", workload, 0, NULL);
+  MSG_task_execute (task1);
+  MSG_task_destroy(task1);
+
+  task_time = MSG_get_clock();
+  XBT_INFO("Task1 simulation time: %e", task_time);
+
+  // Change power peak
+  if ((new_peak_index >= nb) || (new_peak_index < 0))
+         {
+         XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb);
+         return 0;
+         }
+
+  double peak_at = MSG_get_host_power_peak_at(host, new_peak_index);
+  XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index);
+
+  MSG_set_host_power_peak_at(host, new_peak_index);
+
+  current_peak = MSG_get_host_current_power_peak(host);
+  XBT_INFO("Current power peak=%f", current_peak);
+
+  // Run a second task
+  task1 = MSG_task_create ("t1", workload, 0, NULL);
+  MSG_task_execute (task1);
+  MSG_task_destroy(task1);
+
+  task_time = MSG_get_clock() - task_time;
+  XBT_INFO("Task2 simulation time: %e", task_time);
+
+
+  // Verify the default pstate is set to 0
+  host = MSG_get_host_by_name("MyHost2");
+  int nb2 = MSG_get_host_nb_pstates(host);
+  XBT_INFO("Number of Processor states=%d", nb2);
+
+  double current_peak2 = MSG_get_host_current_power_peak(host);
+  XBT_INFO("Current power peak=%f", current_peak2);
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  msg_error_t res = MSG_OK;
+
+  MSG_init(&argc, argv);
+
+  if (argc != 3) {
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n",
+              argv[0]);
+    XBT_CRITICAL
+        ("example: %s msg_platform.xml msg_deployment.xml\n",
+         argv[0]);
+    exit(1);
+  }
+
+  MSG_create_environment(argv[1]);
+
+  /*   Application deployment */
+  MSG_function_register("dvfs_test", dvfs);
+
+  MSG_launch_application(argv[2]);
+
+  res = MSG_main();
+
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
+
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
+}
+
diff --git a/examples/msg/energy/e1/platform_e1.xml b/examples/msg/energy/e1/platform_e1.xml
new file mode 100644 (file)
index 0000000..7edb768
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+ <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+ <platform version="3">
+ <AS  id="AS0"  routing="Full">
+   <!-- Multiple pstate processor capacities can be defined as a list of powers specified for a given host -->
+   <!-- The enabled pstate can be set through the "pstate" attribute (lowest pstate corresponds to the highest processor power) -->
+   <host id="MyHost1" power="100.0Mf,50.0Mf,20.0Mf" pstate="0" />
+   <host id="MyHost2" power="100.0Mf" />
+  
+ </AS>
+ </platform>
diff --git a/examples/msg/energy/e1/pstate.tesh b/examples/msg/energy/e1/pstate.tesh
new file mode 100644 (file)
index 0000000..cc2d47d
--- /dev/null
@@ -0,0 +1,19 @@
+#! ./tesh
+
+p Testing the DVFS-related functions
+
+! output sort
+$ $SG_TEST_EXENV energy/e1/e1$EXEEXT ${srcdir:=.}/energy/e1/platform_e1.xml ${srcdir:=.}/energy/e1/deployment_e1.xml --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (1:dvfs_test@MyHost1) Number of Processor states=3
+> [  0.000000] (2:dvfs_test@MyHost2) Number of Processor states=1
+> [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
+> [  0.000000] (2:dvfs_test@MyHost2) Current power peak=100000000.000000
+> [  1.000000] (1:dvfs_test@MyHost1) Task1 simulation time: 1.000000e+00
+> [  1.000000] (2:dvfs_test@MyHost2) Task1 simulation time: 1.000000e+00
+> [  1.000000] (2:dvfs_test@MyHost2) Cannot set pstate 2, host supports only 1 pstates
+> [  1.000000] (1:dvfs_test@MyHost1) Changing power peak value to 20000000.000000 (at index 2)
+> [  1.000000] (1:dvfs_test@MyHost1) Current power peak=20000000.000000
+> [  6.000000] (1:dvfs_test@MyHost1) Task2 simulation time: 5.000000e+00
+> [  6.000000] (1:dvfs_test@MyHost1) Number of Processor states=1
+> [  6.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
+> [  6.000000] (0:@) Total simulation time: 6.000000e+00
\ No newline at end of file
diff --git a/examples/msg/energy/e2/CMakeLists.txt b/examples/msg/energy/e2/CMakeLists.txt
new file mode 100644 (file)
index 0000000..98e96dc
--- /dev/null
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(e2 e2.c)
+
+### Add definitions for compile
+target_link_libraries(e2 simgrid )
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/energy_consumption.tesh
+  PARENT_SCOPE
+  )
+
+set(xml_files
+  ${xml_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_e2.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/platform_e2.xml
+  PARENT_SCOPE
+  )
+
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/e2.c
+  PARENT_SCOPE
+  )
+
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
@@ -1,5 +1,7 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
-  <process host="HostA" function="test"/>
-</platform>
\ No newline at end of file
+
+  <process host="MyHost1" function="dvfs_test" />
+
+</platform>
diff --git a/examples/msg/energy/e2/e2.c b/examples/msg/energy/e2/e2.c
new file mode 100644 (file)
index 0000000..d0ea20b
--- /dev/null
@@ -0,0 +1,108 @@
+
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include<stdio.h>
+
+#include "msg/msg.h"
+#include "xbt/sysdep.h"         /* calloc */
+
+/* Create a log channel to have nice outputs. */
+#include "xbt/log.h"
+#include "xbt/asserts.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
+                             "Messages specific for this msg example");
+
+int dvfs(int argc, char *argv[]);
+
+
+int dvfs(int argc, char *argv[])
+{
+  msg_host_t host = NULL;
+  msg_task_t task1 = NULL;
+  double task_time = 0;
+  host = MSG_get_host_by_name("MyHost1");
+
+
+  double current_peak = MSG_get_host_current_power_peak(host);
+  XBT_INFO("Current power peak=%f", current_peak);
+
+  double consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+  // Run a task
+  task1 = MSG_task_create ("t1", 100E6, 0, NULL);
+  MSG_task_execute (task1);
+  MSG_task_destroy(task1);
+
+  task_time = MSG_get_clock();
+  XBT_INFO("Task1 simulation time: %e", task_time);
+  consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+  // ========= Change power peak =========
+  int peak_index=2;
+  double peak_at = MSG_get_host_power_peak_at(host, peak_index);
+  XBT_INFO("=========Changing power peak value to %f (at index %d)", peak_at, peak_index);
+
+  MSG_set_host_power_peak_at(host, peak_index);
+
+  // Run a second task
+  task1 = MSG_task_create ("t2", 100E6, 0, NULL);
+  MSG_task_execute (task1);
+  MSG_task_destroy(task1);
+
+  task_time = MSG_get_clock() - task_time;
+  XBT_INFO("Task2 simulation time: %e", task_time);
+
+  consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+
+  MSG_process_sleep(3);
+
+  task_time = MSG_get_clock() - task_time;
+  XBT_INFO("Task3 (sleep) simulation time: %e", task_time);
+  consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  msg_error_t res = MSG_OK;
+
+  MSG_init(&argc, argv);
+
+  if (argc != 3) {
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n",
+              argv[0]);
+    XBT_CRITICAL
+        ("example: %s msg_platform.xml msg_deployment.xml\n",
+         argv[0]);
+    exit(1);
+  }
+
+  MSG_create_environment(argv[1]);
+
+  /*   Application deployment */
+  MSG_function_register("dvfs_test", dvfs);
+
+  MSG_launch_application(argv[2]);
+
+  res = MSG_main();
+
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
+
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
+}
+
diff --git a/examples/msg/energy/e2/energy_consumption.tesh b/examples/msg/energy/e2/energy_consumption.tesh
new file mode 100644 (file)
index 0000000..7f2087b
--- /dev/null
@@ -0,0 +1,29 @@
+#! ./tesh
+
+p Testing the mechanism for computing host energy consumption 
+
+! output sort
+$ $SG_TEST_EXENV energy/e2/e2$EXEEXT ${srcdir:=.}/energy/e2/platform_e2.xml ${srcdir:=.}/energy/e2/deployment_e2.xml --log=surf_cpu.thres:debug --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) CPU create: peak=100000000.000000, pstate=0
+> [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
+> [  0.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 0.000000
+> [  1.000000] (0:@) [cpu_update_energy] action time interval=(0.000000-1.000000), current power peak=100000000.000000, current pstate=0
+> [  1.000000] (0:@) [get_current_watts] min_power=95.000000, max_power=200.000000, slope=105.000000
+> [  1.000000] (0:@) [get_current_watts] Current power (watts) = 200.000000, load = 1.000000
+> [  1.000000] (0:@) [cpu_update_energy] old_energy_value=0.000000, action_energy_value=200.000000
+> [  1.000000] (1:dvfs_test@MyHost1) Task1 simulation time: 1.000000e+00
+> [  1.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 200.000000
+> [  1.000000] (1:dvfs_test@MyHost1) =========Changing power peak value to 20000000.000000 (at index 2)
+> [  6.000000] (0:@) [cpu_update_energy] action time interval=(1.000000-6.000000), current power peak=20000000.000000, current pstate=2
+> [  6.000000] (0:@) [get_current_watts] min_power=90.000000, max_power=150.000000, slope=60.000000
+> [  6.000000] (0:@) [get_current_watts] Current power (watts) = 150.000000, load = 1.000000
+> [  6.000000] (0:@) [cpu_update_energy] old_energy_value=200.000000, action_energy_value=750.000000
+> [  6.000000] (1:dvfs_test@MyHost1) Task2 simulation time: 5.000000e+00
+> [  6.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 950.000000
+> [  9.000000] (0:@) [cpu_update_energy] action time interval=(6.000000-9.000000), current power peak=20000000.000000, current pstate=2
+> [  9.000000] (0:@) [get_current_watts] min_power=90.000000, max_power=150.000000, slope=60.000000
+> [  9.000000] (0:@) [get_current_watts] Current power (watts) = 90.000000, load = 0.000000
+> [  9.000000] (0:@) [cpu_update_energy] old_energy_value=950.000000, action_energy_value=270.000000
+> [  9.000000] (1:dvfs_test@MyHost1) Task3 (sleep) simulation time: 4.000000e+00
+> [  9.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 1220.000000
+> [  9.000000] (0:@) Total simulation time: 9.000000e+00
diff --git a/examples/msg/energy/e2/platform_e2.xml b/examples/msg/energy/e2/platform_e2.xml
new file mode 100644 (file)
index 0000000..5ab2dcb
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+ <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+ <platform version="3">
+ <AS  id="AS0"  routing="Full">
+   <host id="MyHost1" power="100.0Mf,50.0Mf,20.0Mf" >
+         <!--  List of min_power:max_power pairs (in Watts) corresponding to the power consumed when the processor is idle and when it is fully loaded -->
+         <!--  The list must contain one power pair for each previously defined pstate-->
+         <prop id="power_per_state" value="95.0:200.0, 93.0:170.0, 90.0:150.0" />
+   </host>
+ </AS>
+ </platform>
diff --git a/examples/msg/energy/e3/CMakeLists.txt b/examples/msg/energy/e3/CMakeLists.txt
new file mode 100644 (file)
index 0000000..eb60260
--- /dev/null
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(e3 e3.c)
+
+### Add definitions for compile
+target_link_libraries(e3 simgrid )
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_tasks.tesh
+  PARENT_SCOPE
+  )
+
+set(xml_files
+  ${xml_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/deployment_e3.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/platform_e3.xml
+  PARENT_SCOPE
+  )
+
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/e3.c
+  PARENT_SCOPE
+  )
+
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
diff --git a/examples/msg/energy/e3/concurrent_tasks.tesh b/examples/msg/energy/e3/concurrent_tasks.tesh
new file mode 100644 (file)
index 0000000..2b11ab0
--- /dev/null
@@ -0,0 +1,38 @@
+#! ./tesh
+
+p Testing the mechanism for computing host energy consumption for concurrent tasks 
+
+! output sort
+$ $SG_TEST_EXENV energy/e3/e3$EXEEXT ${srcdir:=.}/energy/e3/platform_e3.xml ${srcdir:=.}/energy/e3/deployment_e3.xml --log=surf_cpu.thres:debug --log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n
+> [  0.000000] (0:@) CPU create: peak=100000000.000000, pstate=0
+> [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
+> [  0.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 0.000000
+> [  2.000000] (0:@) [cpu_update_energy] action time interval=(0.000000-2.000000), current power peak=100000000.000000, current pstate=0
+> [  2.000000] (0:@) [get_current_watts] min_power=95.000000, max_power=200.000000, slope=105.000000
+> [  2.000000] (0:@) [get_current_watts] Current power (watts) = 200.000000, load = 1.000000
+> [  2.000000] (0:@) [cpu_update_energy] old_energy_value=0.000000, action_energy_value=400.000000
+> [  2.000000] (4:proc3@MyHost1) Process proc3 executed task sleep cpu=0.000000, duration = 2.000000
+> [  2.000000] (4:proc3@MyHost1) ==================================================
+> [  2.000000] (3:proc2@MyHost1) Process proc2 executed task sleep cpu=0.000000, duration = 2.000000
+> [  2.000000] (3:proc2@MyHost1) ==================================================
+> [  5.000000] (0:@) [cpu_update_energy] action time interval=(2.000000-5.000000), current power peak=100000000.000000, current pstate=0
+> [  5.000000] (0:@) [get_current_watts] min_power=95.000000, max_power=200.000000, slope=105.000000
+> [  5.000000] (0:@) [get_current_watts] Current power (watts) = 200.000000, load = 1.000000
+> [  5.000000] (0:@) [cpu_update_energy] old_energy_value=400.000000, action_energy_value=600.000000
+> [  5.000000] (4:proc3@MyHost1) Process proc3 executed task cpu=100000000.000000, duration = 3.000000
+> [  5.000000] (4:proc3@MyHost1) ==================================================
+> [  5.000000] (3:proc2@MyHost1) Process proc2 executed task cpu=100000000.000000, duration = 3.000000
+> [  5.000000] (3:proc2@MyHost1) ==================================================
+> [  6.000000] (0:@) [cpu_update_energy] action time interval=(5.000000-6.000000), current power peak=100000000.000000, current pstate=0
+> [  6.000000] (0:@) [get_current_watts] min_power=95.000000, max_power=200.000000, slope=105.000000
+> [  6.000000] (0:@) [get_current_watts] Current power (watts) = 200.000000, load = 1.000000
+> [  6.000000] (0:@) [cpu_update_energy] old_energy_value=1000.000000, action_energy_value=200.000000
+> [  6.000000] (2:proc1@MyHost1) Process proc1 executed task cpu=400000000.000000, duration = 6.000000
+> [  6.000000] (2:proc1@MyHost1) ==================================================
+> [  8.000000] (0:@) [cpu_update_energy] action time interval=(6.000000-8.000000), current power peak=100000000.000000, current pstate=0
+> [  8.000000] (0:@) [get_current_watts] min_power=95.000000, max_power=200.000000, slope=105.000000
+> [  8.000000] (0:@) [get_current_watts] Current power (watts) = 95.000000, load = 0.000000
+> [  8.000000] (0:@) [cpu_update_energy] old_energy_value=1200.000000, action_energy_value=190.000000
+> [  8.000000] (1:dvfs_test@MyHost1) Task simulation time: 8.000000e+00
+> [  8.000000] (1:dvfs_test@MyHost1) Total energy (Joules): 1390.000000
+> [  8.000000] (0:@) Total simulation time: 8.000000e+00
\ No newline at end of file
diff --git a/examples/msg/energy/e3/deployment_e3.xml b/examples/msg/energy/e3/deployment_e3.xml
new file mode 100644 (file)
index 0000000..b9c8941
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+  <process host="MyHost1" function="dvfs_test" />
+
+</platform>
diff --git a/examples/msg/energy/e3/e3.c b/examples/msg/energy/e3/e3.c
new file mode 100644 (file)
index 0000000..4230a8e
--- /dev/null
@@ -0,0 +1,130 @@
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include<stdio.h>
+
+#include "msg/msg.h"
+#include "xbt/sysdep.h"         /* calloc */
+
+/* Create a log channel to have nice outputs. */
+#include "xbt/log.h"
+#include "xbt/asserts.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
+                             "Messages specific for this msg example");
+
+static int dvfs(int argc, char *argv[]);
+static int process_code(int argc, char *argv[]);
+
+static int process_code(int argc, char *argv[])
+{
+  msg_task_t task1 = NULL;
+  double cpu_task = 0;
+  double task_time = MSG_get_clock();
+
+  if (argc == 2)
+  {
+         /* Run a sleep task */
+         double sleep_task = atof(argv[1]);
+
+         MSG_process_sleep(sleep_task);
+         task_time = MSG_get_clock() - task_time;
+         XBT_INFO("Process %s executed task sleep cpu=%f, duration = %f",
+                         MSG_process_get_name(MSG_process_self()), 0.0, task_time);
+         XBT_INFO("==================================================");
+ }
+
+
+  // Run a task
+  cpu_task = atof(argv[0]);
+  task1 = MSG_task_create ("task", cpu_task, 0, NULL);
+  MSG_task_execute (task1);
+  MSG_task_destroy(task1);
+
+  task_time = MSG_get_clock() - task_time;
+  XBT_INFO("Process %s executed task cpu=%f, duration = %f",
+                 MSG_process_get_name(MSG_process_self()), cpu_task, task_time);
+  XBT_INFO("==================================================");
+  return 0;
+}
+
+
+static int dvfs(int argc, char *argv[])
+{
+  msg_host_t host = NULL;
+  double task_time = 0;
+  host = MSG_host_self();
+
+  double current_peak = MSG_get_host_current_power_peak(host);
+
+  XBT_INFO("Current power peak=%f", current_peak);
+  double consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+  // Process 1 - long CPU task
+  int argc1 = 1;
+  char** params1 = xbt_malloc0(sizeof(char *) * argc1);
+  params1[0] = xbt_strdup("400.0E6");
+  MSG_process_create_with_arguments("proc1", process_code, NULL, host, argc1, params1);
+
+  // Process 2 - sleep 2 sec + CPU task
+  int argc2 = 2;
+  char** params2 = xbt_malloc0(sizeof(char *) * argc2);
+  params2[0] = xbt_strdup("100.0E6");
+  params2[1] = xbt_strdup("2");
+  MSG_process_create_with_arguments("proc2", process_code, NULL, host, argc2, params2);
+
+  // Process 3 - sleep 2 sec + CPU task
+  int argc3 = 2;
+  char** params3 = xbt_malloc0(sizeof(char *) * argc3);
+  params3[0] = xbt_strdup("100.0E6");
+  params3[1] = xbt_strdup("2");
+  MSG_process_create_with_arguments("proc3", process_code, NULL, host, argc3, params3);
+
+
+  // Main process
+  MSG_process_sleep(8);
+
+  task_time = MSG_get_clock() - task_time;
+  XBT_INFO("Task simulation time: %e", task_time);
+  consumed_energy = MSG_get_host_consumed_energy(host);
+  XBT_INFO("Total energy (Joules): %f", consumed_energy);
+
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  msg_error_t res = MSG_OK;
+
+  MSG_init(&argc, argv);
+
+  if (argc != 3) {
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n",
+              argv[0]);
+    XBT_CRITICAL
+        ("example: %s msg_platform.xml msg_deployment.xml\n",
+         argv[0]);
+    exit(1);
+  }
+
+  MSG_create_environment(argv[1]);
+
+  /*   Application deployment */
+  MSG_function_register("dvfs_test", dvfs);
+
+  MSG_launch_application(argv[2]);
+
+  res = MSG_main();
+
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
+
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
+}
+
diff --git a/examples/msg/energy/e3/platform_e3.xml b/examples/msg/energy/e3/platform_e3.xml
new file mode 100644 (file)
index 0000000..30ec1b9
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version='1.0'?>
+ <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+ <platform version="3">
+ <AS  id="AS0"  routing="Full">
+   <host id="MyHost1" power="100.0Mf,50.0Mf,20.0Mf" >
+        <!--  List of min_power:max_power pairs (in Watts) corresponding to the power consumed when the processor is idle and when it is fully loaded -->
+        <!--  The list must contain one power pair for each previously defined pstate-->
+         <prop id="power_per_state" value="95.0:200.0, 93.0:170.0, 90.0:150.0" />
+   </host>
+ </AS>
+ </platform>
index 29362af..bb7661d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5236980..488f40b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5ff6a27..ef9e78b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5f165fa..d60cae3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a01f2c7..bfbda57 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 84bded3..ef7808f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include "msg/msg.h"
 #include "surf/surf_private.h"
+#include "inttypes.h"
 
 int host(int argc, char *argv[]);
 
@@ -33,33 +34,33 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file,
 int host(int argc, char *argv[])
 {
   msg_file_t file = NULL;
-  void *ptr = NULL;
   char* mount = xbt_strdup("/home");
-  size_t read,write;
+  sg_storage_size_t read,write;
 
-  if(!strcmp(MSG_process_get_name(MSG_process_self()),"0"))
-    file = MSG_file_open(mount,FILENAME1);
-  else if(!strcmp(MSG_process_get_name(MSG_process_self()),"1"))
-    file = MSG_file_open(mount,FILENAME2);
+  if(!strcmp(MSG_process_get_name(MSG_process_self()),"0")){
+    file = MSG_file_open(mount,FILENAME1, NULL);
+    MSG_file_dump(file);
+  } else if(!strcmp(MSG_process_get_name(MSG_process_self()),"1"))
+    file = MSG_file_open(mount,FILENAME2, NULL);
   else if(!strcmp(MSG_process_get_name(MSG_process_self()),"2"))
-    file = MSG_file_open(mount,FILENAME3);
+    file = MSG_file_open(mount,FILENAME3, NULL);
   else if(!strcmp(MSG_process_get_name(MSG_process_self()),"3"))
-    file = MSG_file_open(mount,FILENAME4);
+    file = MSG_file_open(mount,FILENAME4, NULL);
   else xbt_die("FILENAME NOT DEFINED %s",MSG_process_get_name(MSG_process_self()));
 
-  XBT_INFO("\tOpen file '%s'",file->name);
+  XBT_INFO("\tOpen file '%s'",file->fullname);
 
-  read = MSG_file_read(ptr,10000000,file);     // Read for 10MB
-  XBT_INFO("\tHave read    %zu on %s",read,file->name);
+  read = MSG_file_read(file, 10000000);     // Read for 10MB
+  XBT_INFO("\tHave read    %" PRIu64 " on %s",read,file->fullname);
 
-  write = MSG_file_write(ptr,100000,file);  // Write for 100KB
-  XBT_INFO("\tHave written %zu on %s",write,file->name);
+  write = MSG_file_write(file, 100000);  // Write for 100KB
+  XBT_INFO("\tHave written %" PRIu64 " on %s",write,file->fullname);
 
-  read = MSG_file_read(ptr,110000,file);     // Read for 110KB
-  XBT_INFO("\tHave read    %zu on %s (of size %zu)",read,file->name,
+  read = MSG_file_read(file, 110000);     // Read for 110KB
+  XBT_INFO("\tHave read    %" PRIu64 " on %s (of size %" PRIu64 ")",read,file->fullname,
       MSG_file_get_size(file));
 
-  XBT_INFO("\tClose file '%s'",file->name);
+  XBT_INFO("\tClose file '%s'",file->fullname);
   MSG_file_close(file);
 
   free(mount);
index 30c7c17..ec901da 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include "msg/msg.h"
 #include "surf/surf_private.h"
+#include "inttypes.h"
 
 int host(int argc, char *argv[]);
 
@@ -30,28 +31,27 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_file,
 int host(int argc, char *argv[])
 {
   msg_file_t file = NULL;
-  void *ptr = NULL;
   char* mount = xbt_strdup("/home");
-  size_t write;
+  sg_storage_size_t write;
 
   // First open
   XBT_INFO("\tOpen file '%s'",FILENAME1);
-  file = MSG_file_open(mount,FILENAME1);
+  file = MSG_file_open(mount,FILENAME1, NULL);
 
   // Unlink the file
-  XBT_INFO("\tUnlink file '%s'",file->name);
+  XBT_INFO("\tUnlink file '%s'",file->fullname);
   MSG_file_unlink(file);
 
   // Re Open the file wich is in fact created
   XBT_INFO("\tOpen file '%s'",FILENAME1);
-  file = MSG_file_open(mount,FILENAME1);
+  file = MSG_file_open(mount,FILENAME1, NULL);
 
   // Write into the new file
-  write = MSG_file_write(ptr,100000,file);  // Write for 100Ko
-  XBT_INFO("\tHave written %zu on %s",write,file->name);
+  write = MSG_file_write(file,100000);  // Write for 100Ko
+  XBT_INFO("\tHave written %" PRIu64 " on %s",write,file->fullname);
 
   // Close the file
-  XBT_INFO("\tClose file '%s'",file->name);
+  XBT_INFO("\tClose file '%s'",file->fullname);
   MSG_file_close(file);
 
   xbt_dict_t dict_ls;
index 5b7455a..bf4bdc2 100644 (file)
@@ -2,10 +2,17 @@
 
 $ ${bindir:=.}/io/file ${srcdir:=.}/examples/platforms/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:@) Number of host '4'
-> [  0.000000] (1:0@denise)    Open file './doc/simgrid/examples/platforms/g5k.xml'
 > [  0.000000] (2:1@alice)     Open file './doc/simgrid/examples/platforms/One_cluster_no_backbone.xml'
 > [  0.000000] (3:2@carl)      Open file './doc/simgrid/examples/platforms/g5k_cabinets.xml'
 > [  0.000000] (4:3@bob)       Open file './doc/simgrid/examples/platforms/nancy.xml'
+> [  0.000000] (1:0@denise) File Descriptor information:
+>              Full name: './doc/simgrid/examples/platforms/g5k.xml'
+>              Size: 17028
+>              Mount point: '/home'
+>              Storage Id: 'Disk4'
+>              Storage Type: 'single_SSD'
+>              Content Type: 'txt_unix'
+> [  0.000000] (1:0@denise)    Open file './doc/simgrid/examples/platforms/g5k.xml'
 > [  0.000005] (2:1@alice)     Have read    482 on ./doc/simgrid/examples/platforms/One_cluster_no_backbone.xml
 > [  0.000040] (4:3@bob)       Have read    4028 on ./doc/simgrid/examples/platforms/nancy.xml
 > [  0.000170] (1:0@denise)    Have read    17028 on ./doc/simgrid/examples/platforms/g5k.xml
index 712b6fa..1475d1c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3178993..5cdc918 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 62a73e1..4587f28 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 873fedb..fd97d2a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a7ab122..35e3d93 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@ static int surf_parse_bypass_platform(void)
   XBT_DEBUG("<host id=\"host A\" power=\"100000000.00\"/>");
   SURFXML_BUFFER_SET(host_id, "host A");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
+  SURFXML_BUFFER_SET(host_pstate, "0");
   SURFXML_BUFFER_SET(host_availability, "1.0");
   SURFXML_BUFFER_SET(host_availability___file, "");
   SURFXML_BUFFER_SET(host_core, "1");
@@ -47,6 +48,7 @@ static int surf_parse_bypass_platform(void)
   XBT_DEBUG("<host id=\"host B\" power=\"100000000.00\"/>");
   SURFXML_BUFFER_SET(host_id, "host B");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
+  SURFXML_BUFFER_SET(host_pstate, "0");
   SURFXML_BUFFER_SET(host_availability, "1.0");
   SURFXML_BUFFER_SET(host_availability___file, "");
   SURFXML_BUFFER_SET(host_core, "1");
index 9b1089c..74a7493 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 9ff571d..27ea53a 100644 (file)
@@ -288,8 +288,9 @@ $ ${bindir:=.}/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_
 > [  0.000000] (1:master@Tremblay) Bourassa
 > [  0.000000] (1:master@Tremblay) Tremblay
 > [  0.000000] (1:master@Tremblay) Got 20 task to process :
-> [  1.000000] (0:@) Restart processes on host: Jupiter
+> [  1.000000] (0:@) Restart processes on host: Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'Jupiter'. Nevermind. Let's keep going!
+> [  2.000000] (0:@) Restart processes on host: Jupiter
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
 > [ 12.082474] (4:slave@Ginette) Received "Task"
@@ -352,6 +353,7 @@ $ ${bindir:=.}/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_
 > [ 49.692268] (4:slave@Ginette) Received "Task"
 > [ 49.692268] (4:slave@Ginette) Communication time : "1.082474"
 > [ 49.692268] (4:slave@Ginette) Processing "Task"
+> [ 50.000000] (4:slave@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 50.774742] (1:master@Tremblay) Send completed
 > [ 50.774742] (5:slave@Bourassa) Received "Task"
 > [ 50.774742] (5:slave@Bourassa) Communication time : "1.082474"
index 32b38ce..867c729 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -61,7 +61,7 @@ int master(int argc, char *argv[])
   for (i = 0; i < number_of_tasks; i++) {
     msg_task_t task = MSG_task_create("Task", task_comp_size, task_comm_size,
                                     xbt_new0(double, 1));
-    int a;
+    msg_error_t a;
     *((double *) task->data) = MSG_get_clock();
 
     a = MSG_task_send_with_timeout(task,MSG_host_get_name(slaves[i % slaves_count]),10.0);
@@ -155,6 +155,8 @@ int slave(int argc, char *argv[])
       } else if (a == MSG_HOST_FAILURE) {
         XBT_INFO
             ("Gloups. The cpu on which I'm running just turned off!. See you!");
+        free(task->data);
+        MSG_task_destroy(task);
         return 0;
       } else {
         XBT_INFO("Hey ?! What's up ? ");
index 00e6ee5..9d347f6 100644 (file)
@@ -12,8 +12,9 @@ $ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_l
 > [  0.000000] (1:master@Tremblay) Bourassa
 > [  0.000000] (1:master@Tremblay) Tremblay
 > [  0.000000] (1:master@Tremblay) Got 20 task to process :
-> [  1.000000] (0:@) Restart processes on host: Jupiter
+> [  1.000000] (0:@) Restart processes on host: Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'Jupiter'. Nevermind. Let's keep going!
+> [  2.000000] (0:@) Restart processes on host: Jupiter
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
 > [ 12.030928] (1:master@Tremblay) Send completed
 > [ 12.030928] (4:slave@Ginette) Received "Task"
@@ -76,6 +77,7 @@ $ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_l
 > [ 49.278351] (4:slave@Ginette) Received "Task"
 > [ 49.278351] (4:slave@Ginette) Communication time : "1.030928"
 > [ 49.278351] (4:slave@Ginette) Processing "Task"
+> [ 50.000000] (4:slave@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 50.309278] (1:master@Tremblay) Send completed
 > [ 50.309278] (5:slave@Bourassa) Received "Task"
 > [ 50.309278] (5:slave@Bourassa) Communication time : "1.030928"
index e77fff6..ee6d33c 100644 (file)
@@ -12,8 +12,9 @@ $ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_l
 > [  0.000000] (1:master@Tremblay) Bourassa
 > [  0.000000] (1:master@Tremblay) Tremblay
 > [  0.000000] (1:master@Tremblay) Got 20 task to process :
-> [  1.000000] (0:@) Restart processes on host: Jupiter
+> [  1.000000] (0:@) Restart processes on host: Fafard
 > [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'Jupiter'. Nevermind. Let's keep going!
+> [  2.000000] (0:@) Restart processes on host: Jupiter
 > [ 11.000000] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'Fafard'. Nevermind. Let's keep going!
 > [ 12.082474] (1:master@Tremblay) Send completed
 > [ 12.082474] (4:slave@Ginette) Received "Task"
@@ -76,6 +77,7 @@ $ masterslave/masterslave_failure$EXEEXT --log=xbt_cfg.thres:critical --log=no_l
 > [ 49.692268] (4:slave@Ginette) Received "Task"
 > [ 49.692268] (4:slave@Ginette) Communication time : "1.082474"
 > [ 49.692268] (4:slave@Ginette) Processing "Task"
+> [ 50.000000] (4:slave@Ginette) Gloups. The cpu on which I'm running just turned off!. See you!
 > [ 50.774742] (1:master@Tremblay) Send completed
 > [ 50.774742] (5:slave@Bourassa) Received "Task"
 > [ 50.774742] (5:slave@Bourassa) Communication time : "1.082474"
index 718acd3..1764ba0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -41,8 +41,8 @@ void promoter_1(context_node_t node) {
   static int master_choosen = FALSE;
 
   host_parameters.id = NULL;
-  host_parameters.power_peak = 25000000;
-
+  host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push_as(host_parameters.power_peak, double, 25000000.0);
   host_parameters.core_amount = 1;
   host_parameters.power_scale = 1;
   host_parameters.power_trace = NULL;
index 20f6841..643ca79 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index bc0a2dc..6473646 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e2ab938..76dad72 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 88b1010..9d8f3cd 100644 (file)
@@ -23,8 +23,8 @@ void promoter_1(context_node_t node) {
   s_sg_platf_host_cbarg_t host_parameters;
 
   host_parameters.id = NULL;
-  host_parameters.power_peak = 1000000;
-
+  host_parameters.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push_as(host_parameters.power_peak, double, 1000000.0);
   host_parameters.core_amount = 1;
   host_parameters.power_scale = 1;
   host_parameters.power_trace = NULL;
index 845088e..1cba503 100644 (file)
@@ -3,9 +3,6 @@ cmake_minimum_required(VERSION 2.6)
 if(HAVE_MC)
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
-  file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/")
-  file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/chord/")
-
   add_executable(centralized centralized_mutex.c)
   add_executable(bugged1     bugged1.c)
   add_executable(bugged2      bugged2.c)
@@ -13,12 +10,6 @@ if(HAVE_MC)
   add_executable(electric_fence           electric_fence.c)
   add_executable(bugged1_liveness bugged1_liveness.c)
   add_executable(bugged2_liveness bugged2_liveness.c)
-  add_executable(chord/chord chord/chord.c)
-  add_executable(test/snapshot_comparison1 test/snapshot_comparison1.c)
-  add_executable(test/snapshot_comparison2 test/snapshot_comparison2.c)
-  add_executable(test/snapshot_comparison3 test/snapshot_comparison3.c)
-  add_executable(test/snapshot_comparison4 test/snapshot_comparison4.c)
-  add_executable(test/snapshot_comparison5 test/snapshot_comparison5.c)
 
   target_link_libraries(centralized simgrid )
   target_link_libraries(bugged1     simgrid )
@@ -27,12 +18,6 @@ if(HAVE_MC)
   target_link_libraries(electric_fence     simgrid )
   target_link_libraries(bugged1_liveness     simgrid )
   target_link_libraries(bugged2_liveness     simgrid )
-  target_link_libraries(chord/chord     simgrid )
-  target_link_libraries(test/snapshot_comparison1     simgrid )
-  target_link_libraries(test/snapshot_comparison2     simgrid )
-  target_link_libraries(test/snapshot_comparison3     simgrid )
-  target_link_libraries(test/snapshot_comparison4     simgrid )
-  target_link_libraries(test/snapshot_comparison5     simgrid )
 
 endif()
 
@@ -41,19 +26,14 @@ set(tesh_files
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/centralized.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/chord/chord_neverjoin.tesh 
-  ${CMAKE_CURRENT_SOURCE_DIR}/chord/chord_neverjoin_timeout_visited.tesh 
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison1.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison2.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison3.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison4.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison5.tesh
   PARENT_SCOPE
   )
 set(xml_files
   ${xml_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness_visited.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2_liveness.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged2.xml
@@ -61,9 +41,6 @@ set(xml_files
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_electric_fence.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/deploy_mutex.xml
   ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/chord/deploy_chord4.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/deploy_snapshot_comparison.xml
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison_platform.xml
   PARENT_SCOPE
   )
 set(examples_src
@@ -77,20 +54,12 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/centralized_mutex.c
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.h
   ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/chord/chord.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison4.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/snapshot_comparison5.c
   PARENT_SCOPE
   )
 set(bin_files
   ${bin_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/parse_dwarf
   ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged1_liveness
   ${CMAKE_CURRENT_SOURCE_DIR}/promela_bugged2_liveness
-  ${CMAKE_CURRENT_SOURCE_DIR}/test/promela
   PARENT_SCOPE
   )
 set(txt_files
index 585a1f3..a8f62e7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 78c1f5e..464633f 100644 (file)
@@ -22,16 +22,17 @@ $ ${bindir:=.}/bugged1 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%
 > [  0.000000] (1:server@HostA) *** PROPERTY NOT VALID ***
 > [  0.000000] (1:server@HostA) **************************
 > [  0.000000] (1:server@HostA) Counter-example execution trace:
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv (dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(2)HostB (client)] iSend (src=(2)HostB (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait (comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv (dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(2)HostB (client)] Wait (comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
-> [  0.000000] (1:server@HostA) [(4)HostD (client)] iSend (src=(4)HostD (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait (comm=(verbose only) [(4)HostD (client)-> (1)HostA (server)])
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv (dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend (src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait (comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (1:server@HostA) [(2)HostB (client)] iSend(src=(2)HostB (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)]) (62)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (1:server@HostA) [(2)HostB (client)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)]) (62)
+> [  0.000000] (1:server@HostA) [(4)HostD (client)] iSend(src=(4)HostD (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait(comm=(verbose only) [(4)HostD (client)-> (1)HostA (server)]) (62)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)]) (62)
 > [  0.000000] (1:server@HostA) Expanded states = 22
 > [  0.000000] (1:server@HostA) Visited states = 56
 > [  0.000000] (1:server@HostA) Executed transitions = 52
+
index 90dd58a..b6949dd 100644 (file)
@@ -1,6 +1,6 @@
 /***************** Centralized Mutual Exclusion Algorithm *********************/
 /* This example implements a centralized mutual exclusion algorithm.          */
-/* CS requests of client 1 not satisfied                                      */
+/* Bug : CS requests of client 1 not satisfied                                      */
 /* LTL property checked : G(r->F(cs)); (r=request of CS, cs=CS ok)            */
 /******************************************************************************/
 
@@ -27,15 +27,18 @@ int coordinator(int argc, char *argv[])
 {
 
   int CS_used = 0;   
-  msg_task_t task = NULL, answer = NULL;        
+  msg_task_t task = NULL, answer = NULL; 
+  xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL);
+  char *req;
 
   while(1){  
     MSG_task_receive(&task, "coordinator");
     const char *kind = MSG_task_get_name(task); 
     if (!strcmp(kind, "request")) {    
-      char *req = MSG_task_get_data(task);
+      req = MSG_task_get_data(task);
       if (CS_used) {           
-        XBT_INFO("CS already used.");
+        XBT_INFO("CS already used. Queue the request.");
+        xbt_dynar_push(requests, &req);
       } else {               
         if(strcmp(req, "1") != 0){
           XBT_INFO("CS idle. Grant immediatly");
@@ -45,13 +48,25 @@ int coordinator(int argc, char *argv[])
           answer = NULL;
         }
       }
-    } else {         
-      XBT_INFO("CS release. resource now idle");
-      CS_used = 0;
+    } else {      
+      if (!xbt_dynar_is_empty(requests)) {
+        XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
+        xbt_dynar_shift(requests, &req);
+        if(strcmp(req, "1") != 0){
+          MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+        }else{
+          xbt_dynar_push(requests, &req);
+          CS_used = 0;
+        }
+      }else{
+        XBT_INFO("CS release. resource now idle");
+        CS_used = 0;
+      }
     }
     MSG_task_destroy(task);
     task = NULL;
     kind = NULL;
+    req = NULL;
   }
  
   return 0;
@@ -114,14 +129,19 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
 
+  char **options = &argv[1];
+
   MSG_config("model-check/property","promela_bugged1_liveness");
   MC_automaton_new_propositional_symbol("r", &predR);
   MC_automaton_new_propositional_symbol("cs", &predCS);
+
+  const char* platform_file = options[0];
+  const char* application_file = options[1];
   
-  MSG_create_environment("../msg_platform.xml");
+  MSG_create_environment(platform_file);
   MSG_function_register("coordinator", coordinator);
   MSG_function_register("client", client);
-  MSG_launch_application("deploy_bugged1_liveness.xml");
+  MSG_launch_application(application_file);
   MSG_main();
 
   return 0;
index f69fd27..3413fbb 100644 (file)
@@ -2,9 +2,11 @@
 
 ! expect signal SIGABRT
 ! timeout 20
-$ ${bindir:=.}/bugged1_liveness --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext
+$ ${bindir:=.}/bugged1_liveness ${bindir:=.}/../msg_platform.xml ${bindir:=.}/deploy_bugged1_liveness.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext
 > [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
 > [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
+> [  0.000000] (0:@) Get debug information ...
+> [  0.000000] (0:@) Get debug information done !
 > [  0.000000] (2:client@Boivin) Ask the request
 > [  0.000000] (3:client@Fafard) Ask the request
 > [  0.000000] (2:client@Boivin) Propositions changed : r=1, cs=0
@@ -13,33 +15,35 @@ $ ${bindir:=.}/bugged1_liveness --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%
 > [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
 > [  0.000000] (3:client@Fafard) Ask the request
 > [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (0:@) Pair 22 already reached (equal to pair 10) !
+> [  0.000000] (0:@) Pair 21 already reached (equal to pair 9) !
 > [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 > [  0.000000] (0:@) |             ACCEPTANCE CYCLE            |
 > [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
 > [  0.000000] (0:@) Counter-example that violates formula :
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv (dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(2)Boivin (client)] iSend (src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait (comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv (dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(2)Boivin (client)] Wait (comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(2)Boivin (client)] iRecv (dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(3)Fafard (client)] iSend (src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait (comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend (src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(3)Fafard (client)] Wait (comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(3)Fafard (client)] iRecv (dst=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait (comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)])
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv (dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(3)Fafard (client)] Wait (comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)])
-> [  0.000000] (0:@) [(3)Fafard (client)] iSend (src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait (comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv (dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(3)Fafard (client)] Wait (comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(3)Fafard (client)] iSend (src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait (comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend (src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:@) Expanded pairs = 22
-> [  0.000000] (0:@) Visited pairs = 22
-> [  0.000000] (0:@) Executed transitions = 21
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(3)Fafard (client)] iRecv(dst=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)]) (62)
+> [  0.000000] (0:@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) Expanded pairs = 21
+> [  0.000000] (0:@) Visited pairs = 21
+> [  0.000000] (0:@) Executed transitions = 20
+
+
+
 
diff --git a/examples/msg/mc/bugged1_liveness_visited.tesh b/examples/msg/mc/bugged1_liveness_visited.tesh
new file mode 100644 (file)
index 0000000..3341b5a
--- /dev/null
@@ -0,0 +1,181 @@
+#! ./tesh
+
+! expect signal SIGABRT
+! timeout 90
+$ ${bindir:=.}/bugged1_liveness ${bindir:=.}/../msg_platform.xml ${bindir:=.}/deploy_bugged1_liveness_visited.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100
+> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
+> [  0.000000] (0:@) Configuration change: Set 'model-check/visited' to '100'
+> [  0.000000] (0:@) Check the liveness property promela_bugged1_liveness
+> [  0.000000] (0:@) Get debug information ...
+> [  0.000000] (0:@) Get debug information done !
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (3:client@Fafard) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (3:client@Fafard) Propositions changed : r=1, cs=0
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (3:client@Fafard) Propositions changed : r=1, cs=0
+> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
+> [  0.000000] (2:client@Boivin) Ask the request
+> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
+> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
+> [  0.000000] (0:@) Pair 57 already reached (equal to pair 45) !
+> [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+> [  0.000000] (0:@) |             ACCEPTANCE CYCLE            |
+> [  0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
+> [  0.000000] (0:@) Counter-example that violates formula :
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (0:@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)]) (62)
+> [  0.000000] (0:@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (0:@) Expanded pairs = 57
+> [  0.000000] (0:@) Visited pairs = 365
+> [  0.000000] (0:@) Executed transitions = 364
index c5c98ab..528dd1b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index bbfd7ac..2fe18e9 100644 (file)
@@ -887,13 +887,14 @@ $ ${bindir:=.}/bugged2 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%
 > [  0.000000] (1:server@HostA) *** PROPERTY NOT VALID ***
 > [  0.000000] (1:server@HostA) **************************
 > [  0.000000] (1:server@HostA) Counter-example execution trace:
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv (dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend (src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait (comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
-> [  0.000000] (1:server@HostA) [(3)HostC (client)] Wait (comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv (dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend (src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait (comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)]) (62)
+> [  0.000000] (1:server@HostA) [(3)HostC (client)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)]) (62)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only)) (56)
+> [  0.000000] (1:server@HostA) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only)) (54)
+> [  0.000000] (1:server@HostA) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)]) (62)
 > [  0.000000] (1:server@HostA) Expanded states = 461
 > [  0.000000] (1:server@HostA) Visited states = 2271
 > [  0.000000] (1:server@HostA) Executed transitions = 2117
+
index 7117b49..26f2b31 100644 (file)
@@ -35,7 +35,6 @@ int coordinator(int argc, char *argv[])
         XBT_INFO("CS already used.");
         msg_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
         MSG_task_send(answer, req);
-        MC_compare();
       } else {                  // can serve it immediatly
         XBT_INFO("CS idle. Grant immediatly");
         msg_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
index dbf589f..91d00c1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5b3cd59..3403c88 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@ int coordinator(int argc, char *argv[])
         XBT_INFO("CS release. Grant to queued requests (queue size: %lu)",
               xbt_dynar_length(requests));
         char *req;
-        xbt_dynar_pop(requests, &req);
+        xbt_dynar_shift(requests, &req);
         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         todo--;
       } else {                  // nobody wants it
diff --git a/examples/msg/mc/chord/chord.c b/examples/msg/mc/chord/chord.c
deleted file mode 100644 (file)
index 9d9feae..0000000
+++ /dev/null
@@ -1,1013 +0,0 @@
-
-/* Copyright (c) 2010. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <stdio.h>
-#include "msg/msg.h"
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-#include "simgrid/modelchecker.h"
-#include "mc/mc.h"
-
-/** @addtogroup MSG_examples
- *
- *  - <b>chord/chord.c: Classical Chord P2P protocol</b>
- *    This example implements the well known Chord P2P protocol. Its
- *    main advantage is that it constitute a fully working non-trivial
- *    example. In addition, its implementation is rather efficient, as 
- *    demonstrated in http://hal.inria.fr/inria-00602216/
- */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(mc_chord,
-                             "Messages specific for this example");
-
-#define COMM_SIZE 10
-#define COMP_SIZE 0
-#define MAILBOX_NAME_SIZE 10
-
-static int nb_bits = 24;
-static int nb_keys = 0;
-static int timeout = 50;
-//static int max_simulation_time = 1000;
-static int periodic_stabilize_delay = 20;
-static int periodic_fix_fingers_delay = 120;
-static int periodic_check_predecessor_delay = 120;
-static int periodic_lookup_delay = 10;
-
-// Liveness properties verification
-static int j = 0;
-
-static int predJ(){
-  return j;
-}
-
-//extern long int smx_total_comms;
-
-/*
- * Finger element.
- */
-typedef struct s_finger {
-  int id;
-  char mailbox[MAILBOX_NAME_SIZE]; // string representation of the id
-} s_finger_t, *finger_t;
-
-/*
- * Node data.
- */
-typedef struct s_node {
-  int id;                                 // my id
-  char mailbox[MAILBOX_NAME_SIZE];        // my mailbox name (string representation of the id)
-  s_finger_t *fingers;                    // finger table, of size nb_bits (fingers[0] is my successor)
-  int pred_id;                            // predecessor id
-  char pred_mailbox[MAILBOX_NAME_SIZE];   // predecessor's mailbox name
-  int next_finger_to_fix;                 // index of the next finger to fix in fix_fingers()
-  msg_comm_t comm_receive;                // current communication to receive
-  double last_change_date;                // last time I changed a finger or my predecessor
-} s_node_t, *node_t;
-
-/**
- * Types of tasks exchanged between nodes.
- */
-typedef enum {
-  TASK_FIND_SUCCESSOR,
-  TASK_FIND_SUCCESSOR_ANSWER,
-  TASK_GET_PREDECESSOR,
-  TASK_GET_PREDECESSOR_ANSWER,
-  TASK_NOTIFY,
-  TASK_SUCCESSOR_LEAVING,
-  TASK_PREDECESSOR_LEAVING
-} e_task_type_t;
-
-/*
- * Data attached with the tasks sent and received
- */
-typedef struct s_task_data {
-  e_task_type_t type;                     // type of task
-  int request_id;                         // id paramater (used by some types of tasks)
-  int request_finger;                     // finger parameter (used by some types of tasks)
-  int answer_id;                          // answer (used by some types of tasks)
-  char answer_to[MAILBOX_NAME_SIZE];      // mailbox to send an answer to (if any)
-  const char* issuer_host_name;           // used for logging
-} s_task_data_t, *task_data_t;
-
-static int *powers2;
-
-// utility functions
-static void chord_initialize(void);
-static void chord_exit(void);
-static int normalize(int id);
-static int is_in_interval(int id, int start, int end);
-static void get_mailbox(int host_id, char* mailbox);
-static void task_free(void* task);
-static void print_finger_table(node_t node);
-static void set_finger(node_t node, int finger_index, int id);
-static void set_predecessor(node_t node, int predecessor_id);
-
-// process functions
-static int node(int argc, char *argv[]);
-static void handle_task(node_t node, msg_task_t task);
-
-// Chord core
-static void create(node_t node);
-static int join(node_t node, int known_id);
-static void leave(node_t node);
-static int find_successor(node_t node, int id);
-static int remote_find_successor(node_t node, int ask_to_id, int id);
-static int remote_get_predecessor(node_t node, int ask_to_id);
-static int closest_preceding_node(node_t node, int id);
-static void stabilize(node_t node);
-static void notify(node_t node, int predecessor_candidate_id);
-static void remote_notify(node_t node, int notify_to, int predecessor_candidate_id);
-static void fix_fingers(node_t node);
-static void check_predecessor(node_t node);
-static void random_lookup(node_t);
-static void quit_notify(node_t node);
-
-
-/**
- * \brief Global initialization of the Chord simulation.
- */
-static void chord_initialize(void)
-{
-  // compute the powers of 2 once for all
-  powers2 = xbt_new(int, nb_bits);
-  int pow = 1;
-  int i;
-  for (i = 0; i < nb_bits; i++) {
-    powers2[i] = pow;
-    pow = pow << 1;
-  }
-  nb_keys = pow;
-  XBT_DEBUG("Sets nb_keys to %d", nb_keys);
-}
-
-static void chord_exit(void)
-{
-  xbt_free(powers2);
-}
-
-/**
- * \brief Turns an id into an equivalent id in [0, nb_keys).
- * \param id an id
- * \return the corresponding normalized id
- */
-static int normalize(int id)
-{
-  // like id % nb_keys, but works with negatives numbers (and faster)
-  return id & (nb_keys - 1);
-}
-
-/**
- * \brief Returns whether an id belongs to the interval [start, end].
- *
- * The parameters are noramlized to make sure they are between 0 and nb_keys - 1).
- * 1 belongs to [62, 3]
- * 1 does not belong to [3, 62]
- * 63 belongs to [62, 3]
- * 63 does not belong to [3, 62]
- * 24 belongs to [21, 29]
- * 24 does not belong to [29, 21]
- *
- * \param id id to check
- * \param start lower bound
- * \param end upper bound
- * \return a non-zero value if id in in [start, end]
- */
-static int is_in_interval(int id, int start, int end)
-{
-  id = normalize(id);
-  start = normalize(start);
-  end = normalize(end);
-
-  // make sure end >= start and id >= start
-  if (end < start) {
-    end += nb_keys;
-  }
-
-  if (id < start) {
-    id += nb_keys;
-  }
-
-  return id <= end;
-}
-
-/**
- * \brief Gets the mailbox name of a host given its chord id.
- * \param node_id id of a node
- * \param mailbox pointer to where the mailbox name should be written
- * (there must be enough space)
- */
-static void get_mailbox(int node_id, char* mailbox)
-{
-  snprintf(mailbox, MAILBOX_NAME_SIZE - 1, "%d", node_id);
-}
-
-/**
- * \brief Frees the memory used by a task.
- * \param task the MSG task to destroy
- */
-static void task_free(void* task)
-{
-  // TODO add a parameter data_free_function to MSG_task_create?
-  if(task != NULL){
-    xbt_free(MSG_task_get_data(task));
-    MSG_task_destroy(task);
-    task = NULL;
-  }
-}
-
-/**
- * \brief Displays the finger table of a node.
- * \param node a node
- */
-static void print_finger_table(node_t node)
-{
-  if (XBT_LOG_ISENABLED(mc_chord, xbt_log_priority_verbose)) {
-    int i;
-    XBT_VERB("My finger table:");
-    XBT_VERB("Start | Succ ");
-    for (i = 0; i < nb_bits; i++) {
-      XBT_VERB(" %3d  | %3d ", (node->id + powers2[i]) % nb_keys, node->fingers[i].id);
-    }
-    XBT_VERB("Predecessor: %d", node->pred_id);
-  }
-}
-
-/**
- * \brief Sets a finger of the current node.
- * \param node the current node
- * \param finger_index index of the finger to set (0 to nb_bits - 1)
- * \param id the id to set for this finger
- */
-static void set_finger(node_t node, int finger_index, int id)
-{
-  if (id != node->fingers[finger_index].id) {
-    node->fingers[finger_index].id = id;
-    get_mailbox(id, node->fingers[finger_index].mailbox);
-    node->last_change_date = MSG_get_clock();
-    XBT_DEBUG("My new finger #%d is %d", finger_index, id);
-  }
-}
-
-/**
- * \brief Sets the predecessor of the current node.
- * \param node the current node
- * \param id the id to predecessor, or -1 to unset the predecessor
- */
-static void set_predecessor(node_t node, int predecessor_id)
-{
-  if (predecessor_id != node->pred_id) {
-    node->pred_id = predecessor_id;
-
-    if (predecessor_id != -1) {
-      get_mailbox(predecessor_id, node->pred_mailbox);
-    }
-    node->last_change_date = MSG_get_clock();
-
-    XBT_DEBUG("My new predecessor is %d", predecessor_id);
-  }
-}
-
-/**
- * \brief Node Function
- * Arguments:
- * - my id
- * - the id of a guy I know in the system (except for the first node)
- * - the time to sleep before I join (except for the first node)
- */
-int node(int argc, char *argv[])
-{
-  /* Reduce the run size for the MC */
-  if(MC_is_active()){
-    periodic_stabilize_delay = 8;
-    periodic_fix_fingers_delay = 8;
-    periodic_check_predecessor_delay = 8;
-  }
-
-  double init_time = MSG_get_clock();
-  msg_task_t task_received = NULL;
-  int i;
-  int join_success = 0;
-  //double deadline;
-  double next_stabilize_date = init_time + periodic_stabilize_delay;
-  double next_fix_fingers_date = init_time + periodic_fix_fingers_delay;
-  double next_check_predecessor_date = init_time + periodic_check_predecessor_delay;
-  double next_lookup_date = init_time + periodic_lookup_delay;
-
-  //int stab = 0, fix = 0, check = 0, rand_look = 0;
-  int end = 0;
-
-  xbt_assert(argc == 3 || argc == 5, "Wrong number of arguments for this node");
-
-  // initialize my node
-  s_node_t node = {0};
-  node.id = atoi(argv[1]);
-  get_mailbox(node.id, node.mailbox);
-  node.next_finger_to_fix = 0;
-  node.fingers = xbt_new0(s_finger_t, nb_bits);
-  node.last_change_date = init_time;
-
-  for (i = 0; i < nb_bits; i++) {
-    node.fingers[i].id = -1;
-    set_finger(&node, i, node.id);
-  }
-
-  if (argc == 3) { // first ring
-    //deadline = atof(argv[2]);
-    create(&node);
-    join_success = 1;
-  }
-  else {
-    int known_id = atoi(argv[2]);
-    //double sleep_time = atof(argv[3]);
-    //deadline = atof(argv[4]);
-
-    /*
-    // sleep before starting
-    XBT_DEBUG("Let's sleep during %f", sleep_time);
-    MSG_process_sleep(sleep_time);
-    */
-    XBT_DEBUG("Hey! Let's join the system.");
-
-    join_success = join(&node, known_id);
-
-    if(join_success)
-      j = 1;
-
-    //MC_assert(!join_success);
-
-  }
-
-  if (join_success) {
-
-    XBT_INFO("Node %d joined the ring", node.id);
-
-    //while (MSG_get_clock() < init_time + deadline
-    //      && MSG_get_clock() < node.last_change_date + 1000
-    //&& MSG_get_clock() < max_simulation_time) {
-
-    //while (!(stab == 1 || fix == 1 || check == 1 || rand_look == 1)) {
-
-    while(1){
-
-      if (node.comm_receive == NULL) {
-        task_received = NULL;
-        node.comm_receive = MSG_task_irecv(&task_received, node.mailbox);
-        // FIXME: do not make MSG_task_irecv() calls from several functions
-      }
-
-      if (!MSG_comm_test(node.comm_receive)) {
-
-        #ifdef HAVE_MC
-          if(MC_is_active()){
-            if(end == 0 && MC_random()){
-              stabilize(&node);
-              end = 1;
-            }else if(end == 0 && MC_random()){
-              fix_fingers(&node);
-              end = 1;
-            }else if(end == 0 && MC_random()){
-              check_predecessor(&node);
-              end = 1;
-            }else if(end == 0 && MC_random()){
-              random_lookup(&node);
-              end = 1;
-            }else{
-              MSG_process_sleep(5);
-            }
-          }else{
-            if (MSG_get_clock() >= next_stabilize_date) {
-              stabilize(&node);
-              next_stabilize_date = MSG_get_clock() + periodic_stabilize_delay;
-            }
-            else if (MSG_get_clock() >= next_fix_fingers_date) {
-              fix_fingers(&node);
-              next_fix_fingers_date = MSG_get_clock() + periodic_fix_fingers_delay;
-            }
-            else if (MSG_get_clock() >= next_check_predecessor_date) {
-              check_predecessor(&node);
-              next_check_predecessor_date = MSG_get_clock() + periodic_check_predecessor_delay;
-            }
-            else if (MSG_get_clock() >= next_lookup_date) {
-              random_lookup(&node);
-              next_lookup_date = MSG_get_clock() + periodic_lookup_delay;
-            }
-            else {
-              // nothing to do: sleep for a while
-              MSG_process_sleep(5);
-            }
-          }
-        #else
-          if (MSG_get_clock() >= next_stabilize_date) {
-            stabilize(&node);
-            next_stabilize_date = MSG_get_clock() + periodic_stabilize_delay;
-          }
-          else if (MSG_get_clock() >= next_fix_fingers_date) {
-            fix_fingers(&node);
-            next_fix_fingers_date = MSG_get_clock() + periodic_fix_fingers_delay;
-          }
-          else if (MSG_get_clock() >= next_check_predecessor_date) {
-            check_predecessor(&node);
-            next_check_predecessor_date = MSG_get_clock() + periodic_check_predecessor_delay;
-          }
-          else if (MSG_get_clock() >= next_lookup_date) {
-            random_lookup(&node);
-            next_lookup_date = MSG_get_clock() + periodic_lookup_delay;
-          }
-          else {
-            // nothing to do: sleep for a while
-            MSG_process_sleep(5);
-          }
-        #endif
-
-      }else{
-
-        if (node.comm_receive) {
-
-          XBT_INFO("A transfer has occured");
-
-          // a transfer has occured
-
-          msg_error_t status = MSG_comm_get_status(node.comm_receive);
-
-          if (status != MSG_OK) {
-            XBT_INFO("Failed to receive a task. Nevermind.");
-            MSG_comm_destroy(node.comm_receive);
-            node.comm_receive = NULL;
-          }
-          else {
-            // the task was successfully received
-            XBT_INFO("The task was successfully received by node %d", node.id);
-            MSG_comm_destroy(node.comm_receive);
-            node.comm_receive = NULL;
-            handle_task(&node, task_received);
-          }
-        }
-      }
-    }
-
-    if (node.comm_receive) {
-      MSG_comm_destroy(node.comm_receive);
-      node.comm_receive = NULL;
-    }
-
-    // leave the ring
-    leave(&node);
-
-    XBT_INFO("Node %d leave the ring", node.id);
-    //sleep(15);
-  }
-
-  // stop the simulation
-  xbt_free(node.fingers);
-  return 0;
-}
-
-/**
- * \brief This function is called when the current node receives a task.
- * \param node the current node
- * \param task the task to handle (don't touch it then:
- * it will be destroyed, reused or forwarded)
- */
-static void handle_task(node_t node, msg_task_t task) {
-
-  XBT_DEBUG("Handling task %p", task);
-  char mailbox[MAILBOX_NAME_SIZE];
-  task_data_t task_data = (task_data_t) MSG_task_get_data(task);
-  e_task_type_t type = task_data->type;
-
-  switch (type) {
-
-    case TASK_FIND_SUCCESSOR:
-      XBT_DEBUG("Receiving a 'Find Successor' request from %s for id %d",
-          task_data->issuer_host_name, task_data->request_id);
-      // is my successor the successor?
-      if (is_in_interval(task_data->request_id, node->id + 1, node->fingers[0].id)) {
-        task_data->type = TASK_FIND_SUCCESSOR_ANSWER;
-        task_data->answer_id = node->fingers[0].id;
-        XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
-            task_data->issuer_host_name,
-            task_data->answer_to,
-            task_data->request_id, task_data->answer_id);
-        MSG_task_dsend(task, task_data->answer_to, task_free);
-      }
-      else {
-        // otherwise, forward the request to the closest preceding finger in my table
-        int closest = closest_preceding_node(node, task_data->request_id);
-        XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
-            task_data->request_id, closest);
-        get_mailbox(closest, mailbox);
-        MSG_task_dsend(task, mailbox, task_free);
-      }
-      break;
-
-    case TASK_GET_PREDECESSOR:
-      XBT_DEBUG("Receiving a 'Get Predecessor' request from %s", task_data->issuer_host_name);
-      task_data->type = TASK_GET_PREDECESSOR_ANSWER;
-      task_data->answer_id = node->pred_id;
-      XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
-          task_data->issuer_host_name,
-          task_data->answer_to, task_data->answer_id);
-      MSG_task_dsend(task, task_data->answer_to, task_free);
-      break;
-
-    case TASK_NOTIFY:
-      // someone is telling me that he may be my new predecessor
-      XBT_DEBUG("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
-      notify(node, task_data->request_id);
-      task_free(task);
-      break;
-
-    case TASK_PREDECESSOR_LEAVING:
-      // my predecessor is about to quit
-      XBT_DEBUG("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
-      // modify my predecessor
-      set_predecessor(node, task_data->request_id);
-      task_free(task);
-      /*TODO :
-      >> notify my new predecessor
-      >> send a notify_predecessors !!
-       */
-      break;
-
-    case TASK_SUCCESSOR_LEAVING:
-      // my successor is about to quit
-      XBT_DEBUG("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
-      // modify my successor FIXME : this should be implicit ?
-      set_finger(node, 0, task_data->request_id);
-      task_free(task);
-      /* TODO
-      >> notify my new successor
-      >> update my table & predecessors table */
-      break;
-
-    case TASK_FIND_SUCCESSOR_ANSWER:
-    case TASK_GET_PREDECESSOR_ANSWER:
-      XBT_DEBUG("Ignoring unexpected task of type %d (%p)", (int)type, task);
-      task_free(task);
-      break;
-  }
-}
-
-/**
- * \brief Initializes the current node as the first one of the system.
- * \param node the current node
- */
-static void create(node_t node)
-{
-  XBT_DEBUG("Create a new Chord ring...");
-  set_predecessor(node, -1); // -1 means that I have no predecessor
-  print_finger_table(node);
-}
-
-/**
- * \brief Makes the current node join the ring, knowing the id of a node
- * already in the ring
- * \param node the current node
- * \param known_id id of a node already in the ring
- * \return 1 if the join operation succeeded, 0 otherwise
- */
-static int join(node_t node, int known_id)
-{
-  XBT_INFO("Joining the ring with id %d, knowing node %d", node->id, known_id);
-  set_predecessor(node, -1); // no predecessor (yet)
-
-  /*
-  int i;
-  for (i = 0; i < nb_bits; i++) {
-    set_finger(node, i, known_id);
-  }
-  */
-
-  int successor_id = remote_find_successor(node, known_id, node->id);
-  if (successor_id == -1) {
-    XBT_INFO("Cannot join the ring.");
-  }
-  else {
-    set_finger(node, 0, successor_id);
-    print_finger_table(node);
-  }
-
-  return successor_id != -1;
-}
-
-/**
- * \brief Makes the current node quit the system
- * \param node the current node
- */
-static void leave(node_t node)
-{
-  XBT_DEBUG("Well Guys! I Think it's time for me to quit ;)");
-  quit_notify(node);
-}
-
-/*
- * \brief Notifies the successor and the predecessor of the current node
- * of the departure
- * \param node the current node
- */
-static void quit_notify(node_t node)
-{
-  char mailbox[MAILBOX_NAME_SIZE];
-  //send the PREDECESSOR_LEAVING to our successor
-  task_data_t req_data = xbt_new0(s_task_data_t,1);
-  req_data->type = TASK_PREDECESSOR_LEAVING;
-  req_data->request_id = node->pred_id;
-  get_mailbox(node->id, req_data->answer_to);
-  req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
-  msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-  XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d",node->fingers[0].id);
-  MSG_task_send_with_timeout(task_sent, node->fingers[0].mailbox, timeout);
-
-  //send the SUCCESSOR_LEAVING to our predecessor
-  get_mailbox(node->pred_id, mailbox);
-  task_data_t req_data_s = xbt_new0(s_task_data_t,1);
-  req_data_s->type = TASK_SUCCESSOR_LEAVING;
-  req_data_s->request_id = node->fingers[0].id;
-  req_data_s->request_id = node->pred_id;
-  get_mailbox(node->id, req_data_s->answer_to);
-  req_data_s->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
-  msg_task_t task_sent_s = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data_s);
-  XBT_DEBUG("Sending a 'SUCCESSOR_LEAVING' to my predecessor %d",node->pred_id);
-  MSG_task_send_with_timeout(task_sent_s, mailbox, timeout);
-
-}
-
-/**
- * \brief Makes the current node find the successor node of an id.
- * \param node the current node
- * \param id the id to find
- * \return the id of the successor node, or -1 if the request failed
- */
-static int find_successor(node_t node, int id)
-{
-  // is my successor the successor?
-  if (is_in_interval(id, node->id + 1, node->fingers[0].id)) {
-    return node->fingers[0].id;
-  }
-
-  // otherwise, ask the closest preceding finger in my table
-  int closest = closest_preceding_node(node, id);
-  return remote_find_successor(node, closest, id);
-}
-
-/**
- * \brief Asks another node the successor node of an id.
- * \param node the current node
- * \param ask_to the node to ask to
- * \param id the id to find
- * \return the id of the successor node, or -1 if the request failed
- */
-static int remote_find_successor(node_t node, int ask_to, int id)
-{
-  int successor = -1;
-  int stop = 0;
-  char mailbox[MAILBOX_NAME_SIZE];
-  get_mailbox(ask_to, mailbox);
-  task_data_t req_data = xbt_new0(s_task_data_t, 1);
-  req_data->type = TASK_FIND_SUCCESSOR;
-  req_data->request_id = id;
-  get_mailbox(node->id, req_data->answer_to);
-  req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
-  // send a "Find Successor" request to ask_to_id
-  msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-  XBT_DEBUG("Sending a 'Find Successor' request (task %p) to %d for id %d", task_sent, ask_to, id);
-  msg_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
-
-  if (res != MSG_OK) {
-    XBT_DEBUG("Failed to send the 'Find Successor' request (task %p) to %d for id %d",
-        task_sent, ask_to, id);
-    task_free(task_sent);
-  }
-  else {
-
-    // receive the answer
-    XBT_DEBUG("Sent a 'Find Successor' request (task %p) to %d for key %d, waiting for the answer",
-        task_sent, ask_to, id);
-
-    do {
-      if (node->comm_receive == NULL) {
-        msg_task_t task_received = NULL;
-        node->comm_receive = MSG_task_irecv(&task_received, node->mailbox);
-      }
-
-      res = MSG_comm_wait(node->comm_receive, timeout);
-
-      if (res != MSG_OK) {
-        XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request (task %p): %d",
-                  task_sent, (int)res);
-        stop = 1;
-        MSG_comm_destroy(node->comm_receive);
-        node->comm_receive = NULL;
-      }
-      else {
-        msg_task_t task_received = MSG_comm_get_task(node->comm_receive);
-        XBT_DEBUG("Received a task (%p)", task_received);
-        task_data_t ans_data = MSG_task_get_data(task_received);
-
-        if (MC_is_active()) {
-          // the model-checker is expected to find a counter-example here. 
-         // 
-         // As you can see in the test right below, task_received is not always equal to task_sent 
-         // (as messages from differing round can interleave). But the previous version of this code 
-         // wrongly assumed that, leading to problems. But this only occured on large platforms,
-         // leading to hardly usable traces. So we used the model-checker to track down the issue, 
-         // and we came down to this test, that explained the bug in a snap.
-          //MC_assert(task_received == task_sent);
-        }
-
-        if (task_received != task_sent) {
-          // this is not the expected answer
-          MSG_comm_destroy(node->comm_receive);
-          node->comm_receive = NULL;
-          handle_task(node, task_received);
-        }
-        else {
-          // this is our answer
-          XBT_DEBUG("Received the answer to my 'Find Successor' request for id %d (task %p): the successor of key %d is %d",
-              ans_data->request_id, task_received, id, ans_data->answer_id);
-          successor = ans_data->answer_id;
-          stop = 1;
-          MSG_comm_destroy(node->comm_receive);
-          node->comm_receive = NULL;
-          task_free(task_received);
-        }
-      }
-    } while (!stop);
-  }
-
-  return successor;
-}
-
-/**
- * \brief Asks another node its predecessor.
- * \param node the current node
- * \param ask_to the node to ask to
- * \return the id of its predecessor node, or -1 if the request failed
- * (or if the node does not know its predecessor)
- */
-static int remote_get_predecessor(node_t node, int ask_to)
-{
-  int predecessor_id = -1;
-  int stop = 0;
-  char mailbox[MAILBOX_NAME_SIZE];
-  get_mailbox(ask_to, mailbox);
-  task_data_t req_data = xbt_new0(s_task_data_t, 1);
-  req_data->type = TASK_GET_PREDECESSOR;
-  get_mailbox(node->id, req_data->answer_to);
-  req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
-  // send a "Get Predecessor" request to ask_to_id
-  XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
-  msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-  msg_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
-
-  if (res != MSG_OK) {
-    XBT_DEBUG("Failed to send the 'Get Predecessor' request (task %p) to %d",
-        task_sent, ask_to);
-    task_free(task_sent);
-  }
-  else {
-
-    // receive the answer
-    XBT_DEBUG("Sent 'Get Predecessor' request (task %p) to %d, waiting for the answer on my mailbox '%s'",
-        task_sent, ask_to, req_data->answer_to);
-
-    do {
-      if (node->comm_receive == NULL) { // FIXME simplify this
-        msg_task_t task_received = NULL;
-        node->comm_receive = MSG_task_irecv(&task_received, node->mailbox);
-      }
-
-      res = MSG_comm_wait(node->comm_receive, timeout);
-
-      if (res != MSG_OK) {
-        XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request (task %p): %d",
-            task_sent, (int)res);
-        stop = 1;
-        MSG_comm_destroy(node->comm_receive);
-        node->comm_receive = NULL;
-      }
-      else {
-        msg_task_t task_received = MSG_comm_get_task(node->comm_receive);
-        task_data_t ans_data = MSG_task_get_data(task_received);
-
-        /*if (MC_is_active()) {
-          MC_assert(task_received == task_sent);
-         }*/
-
-        if (task_received != task_sent) {
-          MSG_comm_destroy(node->comm_receive);
-          node->comm_receive = NULL;
-          handle_task(node, task_received);
-        }
-        else {
-          XBT_DEBUG("Received the answer to my 'Get Predecessor' request (task %p): the predecessor of node %d is %d",
-              task_received, ask_to, ans_data->answer_id);
-          predecessor_id = ans_data->answer_id;
-          stop = 1;
-          MSG_comm_destroy(node->comm_receive);
-          node->comm_receive = NULL;
-          task_free(task_received);
-        }
-      }
-    } while (!stop);
-  }
-
-  return predecessor_id;
-}
-
-/**
- * \brief Returns the closest preceding finger of an id
- * with respect to the finger table of the current node.
- * \param node the current node
- * \param id the id to find
- * \return the closest preceding finger of that id
- */
-int closest_preceding_node(node_t node, int id)
-{
-  int i;
-  for (i = nb_bits - 1; i >= 0; i--) {
-    if (is_in_interval(node->fingers[i].id, node->id + 1, id - 1)) {
-      return node->fingers[i].id;
-    }
-  }
-  return node->id;
-}
-
-/**
- * \brief This function is called periodically. It checks the immediate
- * successor of the current node.
- * \param node the current node
- */
-static void stabilize(node_t node)
-{
-  XBT_DEBUG("Stabilizing node %d", node->id);
-
-  // get the predecessor of my immediate successor
-  int candidate_id;
-  int successor_id = node->fingers[0].id;
-  if (successor_id != node->id) {
-    candidate_id = remote_get_predecessor(node, successor_id);
-  }
-  else {
-    candidate_id = node->pred_id;
-  }
-
-  // this node is a candidate to become my new successor
-  if (candidate_id != -1
-      && is_in_interval(candidate_id, node->id + 1, successor_id - 1)) {
-    set_finger(node, 0, candidate_id);
-  }
-  if (successor_id != node->id) {
-    remote_notify(node, successor_id, node->id);
-  }
-}
-
-/**
- * \brief Notifies the current node that its predecessor may have changed.
- * \param node the current node
- * \param candidate_id the possible new predecessor
- */
-static void notify(node_t node, int predecessor_candidate_id) {
-
-  XBT_DEBUG("Notifying node %d", node->id);
-
-  if (node->pred_id == -1
-    || is_in_interval(predecessor_candidate_id, node->pred_id + 1, node->id - 1)) {
-
-    set_predecessor(node, predecessor_candidate_id);
-    print_finger_table(node);
-  }
-  else {
-    XBT_DEBUG("I don't have to change my predecessor to %d", predecessor_candidate_id);
-  }
-}
-
-/**
- * \brief Notifies a remote node that its predecessor may have changed.
- * \param node the current node
- * \param notify_id id of the node to notify
- * \param candidate_id the possible new predecessor
- */
-static void remote_notify(node_t node, int notify_id, int predecessor_candidate_id) {
-
-      task_data_t req_data = xbt_new0(s_task_data_t, 1);
-      req_data->type = TASK_NOTIFY;
-      req_data->request_id = predecessor_candidate_id;
-      req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
-
-      // send a "Notify" request to notify_id
-      msg_task_t task = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-      XBT_DEBUG("Sending a 'Notify' request (task %p) to %d", task, notify_id);
-      char mailbox[MAILBOX_NAME_SIZE];
-      get_mailbox(notify_id, mailbox);
-      MSG_task_dsend(task, mailbox, task_free);
-    }
-
-/**
- * \brief This function is called periodically.
- * It refreshes the finger table of the current node.
- * \param node the current node
- */
-static void fix_fingers(node_t node) {
-
-  XBT_DEBUG("Fixing fingers");
-  int i = node->next_finger_to_fix;
-  int id = find_successor(node, node->id + powers2[i]);
-  if (id != -1) {
-
-    if (id != node->fingers[i].id) {
-      set_finger(node, i, id);
-      print_finger_table(node);
-    }
-    node->next_finger_to_fix = (i + 1) % nb_bits;
-  }
-}
-
-/**
- * \brief This function is called periodically.
- * It checks whether the predecessor has failed
- * \param node the current node
- */
-static void check_predecessor(node_t node)
-{
-  XBT_DEBUG("Checking whether my predecessor is alive");
-  // TODO
-}
-
-/**
- * \brief Performs a find successor request to a random id.
- * \param node the current node
- */
-static void random_lookup(node_t node)
-{
-  int id = 1337; // TODO pick a pseudorandom id
-  XBT_DEBUG("Making a lookup request for id %d", id);
-  find_successor(node, id);
-}
-
-/**
- * \brief Main function.
- */
-int main(int argc, char *argv[])
-{
-  MSG_init(&argc, argv);
-  if (argc < 3) {
-    printf("Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n", argv[0]);
-    printf("example: %s ../../msg_platform.xml deploy_chord1.xml\n", argv[0]);
-    exit(1);
-  }
-
-  char **options = &argv[1];
-  while (!strncmp(options[0], "-", 1)) {
-
-    int length = strlen("-nb_bits=");
-    if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
-      nb_bits = atoi(options[0] + length);
-      XBT_DEBUG("Set nb_bits to %d", nb_bits);
-    }
-    else {
-
-      length = strlen("-timeout=");
-      if (!strncmp(options[0], "-timeout=", length) && strlen(options[0]) > length) {
-        timeout = atoi(options[0] + length);
-        XBT_DEBUG("Set timeout to %d", timeout);
-      }
-      else {
-        xbt_die("Invalid chord option '%s'", options[0]);
-      }
-    }
-    options++;
-  }
-
-  const char* platform_file = options[0];
-  const char* application_file = options[1];
-
-  chord_initialize();
-
-  //MSG_config("model-check/property","promela_join");
-  MC_automaton_new_propositional_symbol("j", &predJ);
-
-  MSG_create_environment(platform_file);
-  
-  MSG_function_register("node", node);
-  MSG_launch_application(application_file);
-
-  msg_error_t res = MSG_main();
-  XBT_INFO("Simulated time: %g", MSG_get_clock());
-
-  chord_exit();
-
-  if (res == MSG_OK)
-    return 0;
-  else
-    return 1;
-}
diff --git a/examples/msg/mc/chord/chord_neverjoin.tesh b/examples/msg/mc/chord/chord_neverjoin.tesh
deleted file mode 100644 (file)
index 5e4fcfb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/chord ../../msg_platform.xml deploy_chord4.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check a safety property
-> [  0.000000] (1:node@Jean_Yves) Joining the ring with id 6, knowing node 16
-> [  0.000000] (2:node@Boivin) Joining the ring with id 10, knowing node 16
-> [  0.000000] (3:node@TeX) Joining the ring with id 8, knowing node 16
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Node 6 joined the ring
-> [  0.000000] (1:node@Jean_Yves) **************************
-> [  0.000000] (1:node@Jean_Yves) *** PROPERTY NOT VALID ***
-> [  0.000000] (1:node@Jean_Yves) **************************
-> [  0.000000] (1:node@Jean_Yves) Counter-example execution trace:
-> [  0.000000] (1:node@Jean_Yves) [(1)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(2)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(3)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(4)node] iRecv (dst=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(1)node] Wait (comm=(verbose only) [(1)node -> (4)node])
-> [  0.000000] (1:node@Jean_Yves) [(1)node] iRecv (dst=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(4)node] Test TRUE (comm=(verbose only) [(1)node -> (4)node])
-> [  0.000000] (1:node@Jean_Yves) [(4)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (1:node@Jean_Yves) [(1)node] Wait (comm=(verbose only) [(4)node -> (1)node])
-> [  0.000000] (1:node@Jean_Yves) Expanded states = 9
-> [  0.000000] (1:node@Jean_Yves) Visited states = 9
-> [  0.000000] (1:node@Jean_Yves) Executed transitions = 9
-
diff --git a/examples/msg/mc/chord/chord_neverjoin_timeout_visited.tesh b/examples/msg/mc/chord/chord_neverjoin_timeout_visited.tesh
deleted file mode 100644 (file)
index a0afde7..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/chord ../../msg_platform.xml deploy_chord4.xml --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/timeout:1 --cfg=model-check/visited:100
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Configuration change: Set 'model-check/timeout' to '1'
-> [  0.000000] (0:@) Configuration change: Set 'model-check/visited' to '100'
-> [  0.000000] (0:@) Check a safety property
-> [  0.000000] (1:node@Jean_Yves) Joining the ring with id 6, knowing node 16
-> [  0.000000] (2:node@Boivin) Joining the ring with id 10, knowing node 16
-> [  0.000000] (3:node@TeX) Joining the ring with id 8, knowing node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (3:node@TeX) Cannot join the ring.
-> [  0.000000] (1:node@Jean_Yves) Cannot join the ring.
-> [  0.000000] (2:node@Boivin) Cannot join the ring.
-> [  0.000000] (4:node@Jacquelin) A transfer has occured
-> [  0.000000] (4:node@Jacquelin) The task was successfully received by node 16
-> [  0.000000] (3:node@TeX) Node 8 joined the ring
-> [  0.000000] (3:node@TeX) **************************
-> [  0.000000] (3:node@TeX) *** PROPERTY NOT VALID ***
-> [  0.000000] (3:node@TeX) **************************
-> [  0.000000] (3:node@TeX) Counter-example execution trace:
-> [  0.000000] (3:node@TeX) [(1)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(1)node] WaitTimeout (comm=(verbose only))
-> [  0.000000] (3:node@TeX) [(2)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(2)node] WaitTimeout (comm=(verbose only))
-> [  0.000000] (3:node@TeX) [(3)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(4)node] iRecv (dst=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(3)node] Wait (comm=(verbose only) [(3)node -> (4)node])
-> [  0.000000] (3:node@TeX) [(4)node] Test TRUE (comm=(verbose only) [(3)node -> (4)node])
-> [  0.000000] (3:node@TeX) [(3)node] iRecv (dst=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(4)node] iSend (src=node, buff=(verbose only), size=(verbose only))
-> [  0.000000] (3:node@TeX) [(3)node] Wait (comm=(verbose only) [(4)node -> (3)node])
-> [  0.000000] (3:node@TeX) Expanded states = 42
-> [  0.000000] (3:node@TeX) Visited states = 170
-> [  0.000000] (3:node@TeX) Executed transitions = 159
diff --git a/examples/msg/mc/chord/deploy_chord4.xml b/examples/msg/mc/chord/deploy_chord4.xml
deleted file mode 100644 (file)
index f03b06b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
-  <process host="Jean_Yves" function="node">
-    <argument value="6"/>        <!-- my id -->
-    <argument value="16"/>         <!-- known id -->
-    <argument value="300"/>        <!-- time to sleep before it starts-->
-    <argument value ="600"/>           <!-- deadline -->
-  </process>
-  
-  <process host="Boivin" function="node">
-    <argument value="10"/>         <!-- my id -->
-    <argument value="16"/>         <!-- known id -->
-    <argument value="300"/>         <!-- time to sleep before it starts-->
-    <argument value ="600"/>           <!-- deadline -->
-  </process>
-
-  <process host="TeX" function="node">
-    <argument value="8"/>         <!-- my id -->
-    <argument value="16"/>         <!-- known id -->
-    <argument value="100"/>         <!-- time to sleep before it starts-->
-    <argument value ="600"/>           <!-- deadline -->
-  </process>
-
-  <process host="Jacquelin" function="node">
-    <argument value="16"/>         <!-- my id -->
-    <argument value ="600"/>             <!-- deadline -->
-  </process>
-
-
-</platform>
diff --git a/examples/msg/mc/deploy_bugged1_liveness_visited.xml b/examples/msg/mc/deploy_bugged1_liveness_visited.xml
new file mode 100644 (file)
index 0000000..ca6bc8e
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+
+<platform version="3">
+
+  <process host="Tremblay" function="coordinator" />
+
+   <process host="Boivin" function="client" >
+    <argument value="2"/>
+  </process>
+
+  <process host="Fafard" function="client" >
+    <argument value="1"/>
+  </process>
+
+</platform>
diff --git a/examples/msg/mc/parse_dwarf b/examples/msg/mc/parse_dwarf
deleted file mode 100644 (file)
index 0073de9..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/perl
-
-# infos = [file, ref, level, type of declaration, parent (if level>1), name, type (base type or ref dwarf), global, size, address]
-# type of declaration : base_type, pointer_type, const_type, structure_type, member, enumeration_type, enumerator
-
-
-use strict;
-use warnings;
-use Switch;
-
-my ($argument) = @ARGV;
-
-my $executable = $argument;
-open (FILE, $executable) or die "E/S : $!\n";
-
-my @infos;
-
-my $ligne="";
-my @champs;
-
-my $file = 0;
-my $level=1;
-my $ref=0; my $parent_ref=0;
-my $type_decl="undef";
-my $name="undef";
-my $type="undef";
-my $size=0;
-my $global = 0;
-my $address=0;
-
-
-while ($ligne=<FILE>) {
-
-    @champs = split /\s+/, $ligne;
-
-    if(@champs > 0){
-
-       if ($champs[0] eq "<") { # new declaration
-
-           # save last information in infos
-           if( $level>0 ) {
-               my @entry = ($file, $ref, $level, $type_decl, $parent_ref, $name, $type, $global, $size, $address);
-               push @infos, \@entry;
-           }
-          
-           # get new information
-           my @lr = split /></, $champs[1];
-
-           if($lr[0] > 0){ # level = 0, information about source file
-               
-               if($level < $lr[0]){
-                   $parent_ref = $ref;
-               }else{
-                   if($lr[0] == 1){
-                       $parent_ref = 0;
-                   }
-               }
-               
-               $level = $lr[0]; # level
-               $ref = substr($lr[1], 0, length($lr[1]) -1 ); # dwarf ref               
-               $type_decl = $champs[2];
-
-           }else{ # create new hashtable
-
-               $file++;
-               $level=0;
-           }
-
-       }else{
-
-           switch ($champs[1]){
-
-               case "DW_AT_name" { $name = substr($champs[2], 1, length($champs[2]) - 2); }
-               case "DW_AT_type" { $type = substr($champs[2], 1, length($champs[2]) - 2); }
-               case "DW_AT_byte_size" { $size = hex($champs[2]); }
-               case "DW_AT_external" { $global = 1; }
-               case "DW_AT_location" { 
-                   if ($global == 1) {
-                       $address = $champs[3]; 
-                   }
-               }
-               else { $global = 0;}
-
-
-           }
-           #print $champs[1]." ".$champs[2]."\n";
-       }
-    }
-} 
-
-# save last information in infos
-my @entry = ($file, $ref, $level, $type_decl, $parent_ref, $name, $type, $global, $size, $address);
-push @infos, \@entry;
-
-my $i;
-
-printf "%5s %12s %6s %30s %11s %60s %15s %9s %5s %10s\n", "file", "ref", "level", "type of declaration", "parent", "name", "type", "isGlobal", "size", "address";
-for($i = 0; $i < @infos; $i++){
-    printf "%5s %12s %6s %30s %11s %60s %15s %9s %5s %10s\n", $infos[$i]->[0], $infos[$i]->[1], $infos[$i]->[2], $infos[$i]->[3], $infos[$i]->[4], $infos[$i]->[5], $infos[$i]->[6], $infos[$i]->[7], $infos[$i]->[8], $infos[$i]->[9];
-}
diff --git a/examples/msg/mc/test/promela b/examples/msg/mc/test/promela
deleted file mode 100644 (file)
index 54b9747..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-never { 
-T0_init :    /* init */
-       if
-       :: (1) -> goto accept_S2
-       fi;
-accept_S2 :    /* 1 */
-       if
-  :: (1) -> goto accept_S2
-  fi;      
-}
\ No newline at end of file
diff --git a/examples/msg/mc/test/snapshot_comparison1.c b/examples/msg/mc/test/snapshot_comparison1.c
deleted file mode 100644 (file)
index 126c590..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (c) 2012. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#include "mc/mc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness1, "Debug information for snasphot comparison liveness1 test example");
-
-int test(int argc, char **argv);
-
-int test(int argc, char **argv){
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("**** Start test ****");
-  XBT_INFO("Take two successive snapshots (No modification)");
-
-  void *snap1 = MC_snapshot();
-
-  XBT_INFO("First snapshot");
-
-  MSG_process_sleep(1);
-  
-  void *snap2 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("Second snapshot");
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
-  
-  XBT_INFO("**** End test ****");
-
-  xbt_abort();
-}
-
-int main(int argc, char **argv){
-  MSG_init(&argc, argv);
-
-  MSG_config("model-check/property","promela");
-
-  MSG_create_environment("snapshot_comparison_platform.xml");
-
-  MSG_function_register("test", test);
-
-  MSG_launch_application("deploy_snapshot_comparison.xml");
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/msg/mc/test/snapshot_comparison1.tesh b/examples/msg/mc/test/snapshot_comparison1.tesh
deleted file mode 100644 (file)
index 119844a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/snapshot_comparison1 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check the liveness property promela
-> [  0.000000] (1:test@HostA) **** Start test ****
-> [  0.000000] (1:test@HostA) Take two successive snapshots (No modification)
-> [  0.000000] (1:test@HostA) First snapshot
-> [  0.000000] (1:test@HostA) Second snapshot
-> [  0.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
-> [  0.000000] (1:test@HostA) **** End test ****
diff --git a/examples/msg/mc/test/snapshot_comparison2.c b/examples/msg/mc/test/snapshot_comparison2.c
deleted file mode 100644 (file)
index 9c08973..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (c) 2012. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#include "mc/mc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness2, "Debug information for snasphot comparison liveness2 test example");
-
-int test(int argc, char **argv);
-
-int test(int argc, char **argv){
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("**** Start test ****");
-  XBT_INFO("Malloc after first snapshot");
-
-  void *snap1 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("First snapshot");
-
-  char *toto = xbt_malloc(5);
-  XBT_INFO("Toto allocated");
-
-  void *snap2 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("Second snapshot");
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
-  
-  XBT_INFO("**** End test ****");
-
-  xbt_free(toto);
-
-  xbt_abort();
-}
-
-int main(int argc, char **argv){
-  MSG_init(&argc, argv);
-
-  MSG_config("model-check/property","promela");
-
-  MSG_create_environment("snapshot_comparison_platform.xml");
-
-  MSG_function_register("test", test);
-
-  MSG_launch_application("deploy_snapshot_comparison.xml");
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/msg/mc/test/snapshot_comparison2.tesh b/examples/msg/mc/test/snapshot_comparison2.tesh
deleted file mode 100644 (file)
index 230bbcc..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/snapshot_comparison2 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check the liveness property promela
-> [  0.000000] (1:test@HostA) **** Start test ****
-> [  0.000000] (1:test@HostA) Malloc after first snapshot
-> [  0.000000] (1:test@HostA) First snapshot
-> [  0.000000] (1:test@HostA) Toto allocated
-> [  0.000000] (1:test@HostA) Second snapshot
-> [  0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [  0.000000] (1:test@HostA) **** End test ****
diff --git a/examples/msg/mc/test/snapshot_comparison3.c b/examples/msg/mc/test/snapshot_comparison3.c
deleted file mode 100644 (file)
index e46578f..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (c) 2012. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#include "mc/mc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness3, "Debug information for snasphot comparison liveness3 test example");
-
-int test(int argc, char **argv);
-
-int test(int argc, char **argv){
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("**** Start test ****");
-  XBT_INFO("Malloc and free after first snapshot");
-
-  char *toto = NULL;
-
-  void *snap1 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("First snapshot");
-
-  toto = xbt_malloc(5);
-  XBT_INFO("Toto allocated");
-  xbt_free(toto);
-  toto = NULL;
-  XBT_INFO("Toto free");
-
-  MSG_process_sleep(1);
-
-  void *snap2 = MC_snapshot();
-
-  XBT_INFO("Second snapshot");
-
-  MC_ignore_stack("snap2", "test");   
-  MC_ignore_stack("snap1", "test");
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
-  
-  XBT_INFO("**** End test ****");
-
-  xbt_abort();
-}
-
-int main(int argc, char **argv){
-  MSG_init(&argc, argv);
-  
-  MSG_config("model-check/property","promela");
-
-  MSG_create_environment("snapshot_comparison_platform.xml");
-
-  MSG_function_register("test", test);
-
-  MSG_launch_application("deploy_snapshot_comparison.xml");
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/msg/mc/test/snapshot_comparison3.tesh b/examples/msg/mc/test/snapshot_comparison3.tesh
deleted file mode 100644 (file)
index 6589319..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/snapshot_comparison3 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check the liveness property promela
-> [  0.000000] (1:test@HostA) **** Start test ****
-> [  0.000000] (1:test@HostA) Malloc and free after first snapshot
-> [  0.000000] (1:test@HostA) First snapshot
-> [  0.000000] (1:test@HostA) Toto allocated
-> [  0.000000] (1:test@HostA) Toto free
-> [  0.000000] (1:test@HostA) Second snapshot
-> [  0.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
-> [  0.000000] (1:test@HostA) **** End test ****
diff --git a/examples/msg/mc/test/snapshot_comparison4.c b/examples/msg/mc/test/snapshot_comparison4.c
deleted file mode 100644 (file)
index bff95bf..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (c) 2012. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#include "mc/mc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness4, "Debug information for snasphot comparison liveness4 test example");
-
-int test(int argc, char **argv);
-
-int test(int argc, char **argv){
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("**** Start test ****");
-  XBT_INFO("Free after first snapshot");
-  
-  char *toto = xbt_malloc(5);
-  XBT_INFO("Toto allocated");
-
-  void *snap1 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("First snapshot");
-
-  xbt_free(toto);
-  XBT_INFO("Toto free");
-
-  void *snap2 = MC_snapshot();
-
-  XBT_INFO("Second snapshot");
-
-  MSG_process_sleep(1);
-  
-  MC_ignore_stack("snap2", "test");   
-  MC_ignore_stack("snap1", "test");
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
-  
-  XBT_INFO("**** End test ****");
-
-  xbt_abort();
-}
-
-int main(int argc, char **argv){
-  MSG_init(&argc, argv);
-  
-  MSG_config("model-check/property","promela");
-
-  MSG_create_environment("snapshot_comparison_platform.xml");
-
-  MSG_function_register("test", test);
-
-  MSG_launch_application("deploy_snapshot_comparison.xml");
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/msg/mc/test/snapshot_comparison4.tesh b/examples/msg/mc/test/snapshot_comparison4.tesh
deleted file mode 100644 (file)
index 6f4ca65..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/snapshot_comparison4 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check the liveness property promela
-> [  0.000000] (1:test@HostA) **** Start test ****
-> [  0.000000] (1:test@HostA) Free after first snapshot
-> [  0.000000] (1:test@HostA) Toto allocated
-> [  0.000000] (1:test@HostA) First snapshot
-> [  0.000000] (1:test@HostA) Toto free
-> [  0.000000] (1:test@HostA) Second snapshot
-> [  0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [  0.000000] (1:test@HostA) **** End test ****
\ No newline at end of file
diff --git a/examples/msg/mc/test/snapshot_comparison5.c b/examples/msg/mc/test/snapshot_comparison5.c
deleted file mode 100644 (file)
index 3078854..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Copyright (c) 2012. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <msg/msg.h>
-#include <simgrid/modelchecker.h>
-#include "mc/mc.h"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness5, "Debug information for snasphot comparison liveness5 test example");
-
-int test(int argc, char **argv);
-
-int test(int argc, char **argv){
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("**** Start test ****");
-  XBT_INFO("Increment local variable");
-
-  int j = 0;
-  XBT_INFO("j = %d", j);
-
-  void *snap1 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("First snapshot");
-
-  j = 1;
-  XBT_INFO("j = %d", j);
-  void *snap2 = MC_snapshot();
-
-  MSG_process_sleep(1);
-
-  XBT_INFO("Second snapshot");
-
-  MC_ignore_stack("snap2", "test");   
-  MC_ignore_stack("snap1", "test");
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
-  
-  XBT_INFO("**** End test ****");
-
-  xbt_abort();
-}
-
-int main(int argc, char **argv){
-  MSG_init(&argc, argv);
-
-  MSG_config("model-check/property","promela");
-
-  MSG_create_environment("snapshot_comparison_platform.xml");
-
-  MSG_function_register("test", test);
-
-  MSG_launch_application("deploy_snapshot_comparison.xml");
-
-  MSG_main();
-
-  return 0;
-}
diff --git a/examples/msg/mc/test/snapshot_comparison5.tesh b/examples/msg/mc/test/snapshot_comparison5.tesh
deleted file mode 100644 (file)
index d483ae3..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#! ./tesh
-
-! expect signal SIGABRT
-! timeout 200
-$ ${bindir:=.}/snapshot_comparison5 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (0:@) Configuration change: Set 'model-check' to '1'
-> [  0.000000] (0:@) Check the liveness property promela
-> [  0.000000] (1:test@HostA) **** Start test ****
-> [  0.000000] (1:test@HostA) Increment local variable
-> [  0.000000] (1:test@HostA) j = 0
-> [  0.000000] (1:test@HostA) First snapshot
-> [  0.000000] (1:test@HostA) j = 1
-> [  0.000000] (1:test@HostA) Second snapshot
-> [  0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [  0.000000] (1:test@HostA) **** End test ****
diff --git a/examples/msg/mc/test/snapshot_comparison_platform.xml b/examples/msg/mc/test/snapshot_comparison_platform.xml
deleted file mode 100644 (file)
index cc4ea2c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version='1.0'?>
- <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
- <platform version="3">
- <AS  id="AS0"  routing="Full">
-   <host id="HostA" power="137.333Mf"/>
-   <host id="HostB" power="98.095Mf"/>
-   <host id="HostC" power="98.095Mf"/>
-   <host id="HostD" power="98.095Mf"/>
-   <link id="1" bandwidth="3.430125MBps" latency="536.941us"/>
-   <link id="2" bandwidth="3.430125MBps" latency="536.941us"/>
-   <link id="3" bandwidth="3.430125MBps" latency="536.941us"/>
-   <route src="HostA" dst="HostB"><link_ctn id="1"/></route>
-   <route src="HostA" dst="HostC"><link_ctn id="2"/></route>
-   <route src="HostA" dst="HostD"><link_ctn id="3"/></route>
- </AS>
- </platform>
\ No newline at end of file
index 95bd58c..898682f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6db54f3..d1ffeee 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e70aa46..5b25179 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index efe1356..0e26463 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ee45fec..1acf31c 100644 (file)
@@ -1,6 +1,6 @@
 /* pmm - parallel matrix multiplication "double diffusion"                  */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_pmm,
 /* This example should always be executed using a deployment of
  * GRID_SIZE * GRID_SIZE nodes. */
 #define GRID_SIZE 3    /* Modify to adjust the grid's size */
-#define NODE_MATRIX_SIZE 300  /* Ammount of work done by each node*/
+#define NODE_MATRIX_SIZE 300  /* Amount of work done by each node*/
 
 #define GRID_NUM_NODES GRID_SIZE * GRID_SIZE
 #define MATRIX_SIZE NODE_MATRIX_SIZE * GRID_SIZE
index f82d132..3940a08 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1594db2..368a09d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -71,7 +71,7 @@ static void test_host(const char*hostname)
               "Value of property %s is defined to %s (where it should be 250)",
               exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
-   
+
   /* Restore the value for the next test */
   MSG_host_set_property_value(thehost, exist, xbt_strdup("180"), NULL);
 }
index 038697c..1f74408 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -14,7 +14,7 @@
 #include "xbt/asserts.h"
 
 /** @addtogroup MSG_examples
- * 
+ *
  *  - <b>sendrecv/sendrecv.c: Ping-pong example</b>. It's hard to
  *    think of a simpler example. The tesh files laying in the
  *    directory are instructive concerning the way to pass options to the simulators (as described in \ref options).
@@ -62,7 +62,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_la, 0.0, task_comm_size_lat, NULL);
   task_la->data = xbt_new(double, 1);
   *(double *) task_la->data = time;
-  XBT_INFO("task_la->data = %le", *((double *) task_la->data));
+  XBT_INFO("task_la->data = %e", *((double *) task_la->data));
   MSG_task_send(task_la, argv[1]);
 
   /* Bandwidth */
@@ -72,7 +72,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_bw, 0.0, task_comm_size_bw, NULL);
   task_bw->data = xbt_new(double, 1);
   *(double *) task_bw->data = time;
-  XBT_INFO("task_bw->data = %le", *((double *) task_bw->data));
+  XBT_INFO("task_bw->data = %e", *((double *) task_bw->data));
   MSG_task_send(task_bw, argv[1]);
 
   return 0;
@@ -89,8 +89,6 @@ int receiver(int argc, char *argv[])
 
   XBT_INFO("receiver");
 
-  time = MSG_get_clock();
-
   /* Get Latency */
   a = MSG_task_receive(&task_la,MSG_host_get_name(MSG_host_self()));
   if (a == MSG_OK) {
@@ -101,13 +99,12 @@ int receiver(int argc, char *argv[])
     XBT_INFO("Task received : %s", task_la->name);
     xbt_free(task_la->data);
     MSG_task_destroy(task_la);
-    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("Communic. time %e", communication_time);
     XBT_INFO("--- la %f ----", communication_time);
   } else {
     xbt_die("Unexpected behavior");
   }
 
-
   /* Get Bandwidth */
   a = MSG_task_receive(&task_bw,MSG_host_get_name(MSG_host_self()));
   if (a == MSG_OK) {
@@ -118,7 +115,7 @@ int receiver(int argc, char *argv[])
     XBT_INFO("Task received : %s", task_bw->name);
     xbt_free(task_bw->data);
     MSG_task_destroy(task_bw);
-    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("Communic. time %e", communication_time);
     XBT_INFO("--- bw %f ----", task_comm_size_bw / communication_time);
   } else {
     xbt_die("Unexpected behavior");
@@ -133,11 +130,8 @@ int receiver(int argc, char *argv[])
 msg_error_t test_all(const char *platform_file,
                      const char *application_file)
 {
-
   msg_error_t res = MSG_OK;
 
-
-
   XBT_INFO("test_all");
 
   /*  Simulation setting */
@@ -167,7 +161,6 @@ int main(int argc, char *argv[])
 
   MSG_init(&argc, argv);
 
-
   if (argc != 3) {
     XBT_CRITICAL("Usage: %s platform_file deployment_file <model>\n",
               argv[0]);
@@ -188,7 +181,7 @@ int main(int argc, char *argv[])
 
   res = test_all(argv[1], argv[2]);
 
-  XBT_INFO("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %e", MSG_get_clock());
 
 #ifdef _MSC_VER
   _set_output_format(prev_exponent_format);
index 03bb06b..fc03c40 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index bdc0085..5edb0af 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fc60925..9a7de6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a5690e7..2091603 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -69,12 +69,14 @@ static int surf_parse_bypass_platform(void)
 
   s_sg_platf_host_cbarg_t bob = SG_PLATF_HOST_INITIALIZER;
   bob.id = "bob";
-  bob.power_peak = 98095000;
+  bob.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push_as(bob.power_peak, double, 98095000.0);
   sg_platf_new_host(&bob);
 
   s_sg_platf_host_cbarg_t alice = SG_PLATF_HOST_INITIALIZER;
   alice.id = "alice";
-  alice.power_peak = 98095000;
+  alice.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push_as(alice.power_peak, double, 98095000.0);
   sg_platf_new_host(&alice);
 
   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
index bb6d765..e62d9b5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8b6d5ce..e831432 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 25ff189..59a1a79 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2010 The SimGrid team. All rights reserved.                */
+/* Copyright (c) 2010-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 25050e7..e8b5ebb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 427a891..a5cdfc0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8186cf3..d69c95a 100644 (file)
@@ -2,11 +2,12 @@
 
 
 p Tracing master/slave application
-$ $SG_TEST_EXENV ${bindir:=.}/tracing/trace_platform$EXEEXT --cfg=tracing:1 --cfg=tracing/categorized:1 ${srcdir:=.}/tracing/platform.xml
+$ $SG_TEST_EXENV ${bindir:=.}/tracing/trace_platform$EXEEXT --cfg=tracing:1 --cfg=tracing/filename:tracing/trace_platform.trace --cfg=tracing/categorized:1 ${srcdir:=.}/tracing/platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'tracing/trace_platform.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to '1'
 
-$ tail -n +3 simgrid.trace
+$ tail -n +3 tracing/trace_platform.trace
 > %EventDef PajeDefineContainerType 0
 > %       Alias string
 > %       Type string
@@ -213,11 +214,14 @@ $ tail -n +3 simgrid.trace
 > 7 0 1 2
 > 7 0 1 4
 
-$ $SG_TEST_EXENV ${bindir:=.}/tracing/trace_platform$EXEEXT --cfg=tracing:1 --cfg=tracing/categorized:1 ${srcdir:=.}/../platforms/g5k.xml
+$ rm -rf tracing/trace_platform.trace
+
+$ $SG_TEST_EXENV ${bindir:=.}/tracing/trace_platform$EXEEXT --cfg=tracing:1  --cfg=tracing/filename:tracing/trace_platform.trace --cfg=tracing/categorized:1 ${srcdir:=.}/../platforms/g5k.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'tracing/trace_platform.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to '1'
 
-$ tail -n +3 simgrid.trace
+$ tail -n +3 tracing/trace_platform.trace
 > %EventDef PajeDefineContainerType 0
 > %       Alias string
 > %       Type string
@@ -30397,4 +30401,4 @@ $ tail -n +3 simgrid.trace
 > 7 0 6 4094
 > 7 0 1 3921
 
-$ rm -rf simgrid.trace
+$ rm -rf tracing/trace_platform.trace
index 0ec8ebf..90e65ba 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 179f405..5ef0ab6 100644 (file)
@@ -6,7 +6,7 @@
           radical="0-1" power="1Gf" bw="125MBps" lat="50us"
            router_id="router1"/>
 
-  <AS id="AS1" routing="none">
+  <AS id="AS1" routing="None">
     <host id="host1" power="1Gf"/>
   </AS>
 
index 5b444d1..b115c53 100644 (file)
-./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx                                                 71            
-./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml                                   1262          
-./doc/simgrid/examples/cxx/autoDestination/Main.cxx                                                         148           
-./doc/simgrid/examples/cxx/autoDestination/Slave.cxx                                                        870           
-./doc/simgrid/examples/cxx/autoDestination/BasicTask.cxx                                                    65            
-./doc/simgrid/examples/cxx/autoDestination/Master.cxx                                                       1891          
-./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml                             2133932   
-./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx                                                    1137          
-./doc/simgrid/examples/cxx/basic/FinalizeTask.cxx                                                           71            
-./doc/simgrid/examples/cxx/basic/Main.cxx                                                                   148           
-./doc/simgrid/examples/cxx/basic/Slave.cxx                                                                  693           
-./doc/simgrid/examples/cxx/basic/BasicTask.cxx                                                              65            
-./doc/simgrid/examples/cxx/basic/basic_platform.xml                                                 2133932   
-./doc/simgrid/examples/cxx/basic/Master.cxx                                                                 2148          
-./doc/simgrid/examples/cxx/basic/basic_deployment.xml                                                       1188          
-./doc/simgrid/examples/cxx/basic/Forwarder.cxx                                                              1244          
-./doc/simgrid/examples/cxx/explicitDestination/FinalizeTask.cxx                                             71            
-./doc/simgrid/examples/cxx/explicitDestination/Main.cxx                                                     148           
-./doc/simgrid/examples/cxx/explicitDestination/explicitDestination_platform.xml                     2133932   
-./doc/simgrid/examples/cxx/explicitDestination/Slave.cxx                                                    913           
-./doc/simgrid/examples/cxx/explicitDestination/BasicTask.cxx                                                65            
-./doc/simgrid/examples/cxx/explicitDestination/explicitDestination_deployment.xml                           1188          
-./doc/simgrid/examples/cxx/explicitDestination/Master.cxx                                                   1896          
-./doc/simgrid/examples/cxx/explicitDestination/Forwarder.cxx                                                1181          
-./doc/simgrid/examples/cxx/ping_pong/Main.cxx                                                               149           
-./doc/simgrid/examples/cxx/ping_pong/Sender.cxx                                                             1073          
-./doc/simgrid/examples/cxx/ping_pong/ping_pong_deployment.xml                                               275           
-./doc/simgrid/examples/cxx/ping_pong/ping_pong_platform.xml                                                 4718          
-./doc/simgrid/examples/cxx/ping_pong/Receiver.cxx                                                           957           
-./doc/simgrid/examples/cxx/ping_pong/PingPongTask.cxx                                                       71            
-./doc/simgrid/examples/cxx/comm_time/FinalizeTask.cxx                                                       71            
-./doc/simgrid/examples/cxx/comm_time/Main.cxx                                                               146           
-./doc/simgrid/examples/cxx/comm_time/CommTimeTask.cxx                                                       71            
-./doc/simgrid/examples/cxx/comm_time/Slave.cxx                                                              889           
-./doc/simgrid/examples/cxx/comm_time/comm_time_platform.xml                                         2133932   
-./doc/simgrid/examples/cxx/comm_time/Master.cxx                                                             1730          
-./doc/simgrid/examples/cxx/comm_time/comm_time_deployment.xml                                               1884          
-./doc/simgrid/examples/cxx/suspend/Main.cxx                                                                 150           
-./doc/simgrid/examples/cxx/suspend/suspend_platform.xml                                             2133932   
-./doc/simgrid/examples/cxx/suspend/suspend_deployment.xml                                                   187           
-./doc/simgrid/examples/cxx/suspend/DreamMaster.cxx                                                          826           
-./doc/simgrid/examples/cxx/suspend/LazyGuy.cxx                                                              429           
-./doc/simgrid/examples/smpi/mc_bugged2.c                                                                    1387          
-./doc/simgrid/examples/smpi/scatter.c                                                                       3496          
-./doc/simgrid/examples/smpi/mc_bugged1.c                                                                    1411          
-./doc/simgrid/examples/smpi/get_processor_name.c                                                            649           
-./doc/simgrid/examples/smpi/NAS/README                                                                      1857          
-./doc/simgrid/examples/smpi/NAS/EP-sampling/README                                                          347           
-./doc/simgrid/examples/smpi/NAS/EP-sampling/randlc.c                                                        3300          
-./doc/simgrid/examples/smpi/NAS/EP-sampling/ep.c                                                            13723         
-./doc/simgrid/examples/smpi/NAS/EP-trace/README                                                             347           
-./doc/simgrid/examples/smpi/NAS/EP-trace/randlc.c                                                           3300          
-./doc/simgrid/examples/smpi/NAS/EP-trace/ep-trace.c                                                         13850         
-./doc/simgrid/examples/smpi/NAS/config/NAS.samples/README                                                   394           
-./doc/simgrid/examples/smpi/NAS/IS-trace/is-trace.c                                                         38276         
-./doc/simgrid/examples/smpi/NAS/DT-trace/README                                                             999           
-./doc/simgrid/examples/smpi/NAS/DT-trace/DGraph.c                                                           5451          
-./doc/simgrid/examples/smpi/NAS/DT-trace/dt.c                                                               23031         
-./doc/simgrid/examples/smpi/NAS/IS/is.c                                                                     38077         
-./doc/simgrid/examples/smpi/NAS/MPI_dummy/README                                                            2406          
-./doc/simgrid/examples/smpi/NAS/MPI_dummy/mpi_dummy.c                                                       5660          
-./doc/simgrid/examples/smpi/NAS/MPI_dummy/wtime_sgi64.c                                                     1700          
-./doc/simgrid/examples/smpi/NAS/MPI_dummy/wtime.c                                                           228           
-./doc/simgrid/examples/smpi/NAS/common/randdp.c                                                             1441          
-./doc/simgrid/examples/smpi/NAS/common/c_timers.c                                                           1159          
-./doc/simgrid/examples/smpi/NAS/common/c_print_results.c                                                    3086          
-./doc/simgrid/examples/smpi/NAS/sys/README                                                                  1461          
-./doc/simgrid/examples/smpi/NAS/sys/setparams.c                                                             38805         
-./doc/simgrid/examples/smpi/NAS/SP/README                                                                   926           
-./doc/simgrid/examples/smpi/NAS/FT/README                                                                   276           
-./doc/simgrid/examples/smpi/NAS/DT/README                                                                   999           
-./doc/simgrid/examples/smpi/NAS/DT/DGraph.c                                                                 5451          
-./doc/simgrid/examples/smpi/NAS/DT/dt.c                                                                     22620         
-./doc/simgrid/examples/smpi/NAS/EP/README                                                                   347           
-./doc/simgrid/examples/smpi/NAS/EP/randlc.c                                                                 3300          
-./doc/simgrid/examples/smpi/NAS/EP/ep.c                                                                     13688         
-./doc/simgrid/examples/smpi/NAS/DT-folding/README                                                           999           
-./doc/simgrid/examples/smpi/NAS/DT-folding/DGraph.c                                                         5451          
-./doc/simgrid/examples/smpi/NAS/DT-folding/dt.c                                                             22704         
-./doc/simgrid/examples/smpi/NAS/MG/README                                                                   5465          
-./doc/simgrid/examples/smpi/bcast.c                                                                         983           
-./doc/simgrid/examples/smpi/compute2.c                                                                      628           
-./doc/simgrid/examples/smpi/sendrecv.c                                                                      1652          
-./doc/simgrid/examples/smpi/allreduce.c                                                                     2135          
-./doc/simgrid/examples/smpi/mvmul.c                                                                         7069          
-./doc/simgrid/examples/smpi/alltoallv.c                                                                     4441          
-./doc/simgrid/examples/smpi/smpi_traced.c                                                                   8529          
-./doc/simgrid/examples/smpi/compute3.c                                                                      816           
-./doc/simgrid/examples/smpi/reduce.c                                                                        3545          
-./doc/simgrid/examples/smpi/bcbench.c                                                                       2466          
-./doc/simgrid/examples/smpi/ttest01.c                                                                       1273          
-./doc/simgrid/examples/smpi/compute.c                                                                       622           
-./doc/simgrid/examples/smpi/barrier.c                                                                       766           
-./doc/simgrid/examples/smpi/alltoall_basic.c                                                                1453          
-./doc/simgrid/examples/smpi/pingpong.c                                                                      2286          
-./doc/simgrid/examples/smpi/alltoall2.c                                                                     2799          
-./doc/simgrid/examples/smpi/split.c                                                                         705           
-./doc/simgrid/examples/xbt/sem_basic.c                                                                      1970          
-./doc/simgrid/examples/xbt/sem_sched.c                                                                      7207          
-./doc/simgrid/examples/msg/small_platform.xml                                                               4582          
-./doc/simgrid/examples/msg/README                                                                           4805          
-./doc/simgrid/examples/msg/properties/deployment_properties.xml                                             272           
-./doc/simgrid/examples/msg/properties/msg_prop.c                                                            3853          
-./doc/simgrid/examples/msg/ns3/3links-p.xml                                                                 856           
-./doc/simgrid/examples/msg/ns3/dogbone-d.xml                                                                582           
-./doc/simgrid/examples/msg/ns3/Two_clusters.xml                                                             1817          
-./doc/simgrid/examples/msg/ns3/3links-d.xml                                                                 927           
-./doc/simgrid/examples/msg/ns3/3links-d-timer.xml                                                           1280          
-./doc/simgrid/examples/msg/ns3/ns3.c                                                                        5177          
-./doc/simgrid/examples/msg/ns3/Two_clusters-d.xml                                                           369           
-./doc/simgrid/examples/msg/ns3/One_cluster-d.xml                                                            367           
-./doc/simgrid/examples/msg/ns3/dogbone-p.xml                                                                1497          
-./doc/simgrid/examples/msg/ns3/3hosts_2links_p.xml                                                          566           
-./doc/simgrid/examples/msg/ns3/3hosts_2links_d.xml                                                          352           
-./doc/simgrid/examples/msg/ns3/One_cluster.xml                                                              658           
-./doc/simgrid/examples/msg/migration/migration.c                                                            2922          
-./doc/simgrid/examples/msg/small_platform_with_failures.xml                                                 4746          
-./doc/simgrid/examples/msg/icomms/small_platform.xml                                                        972           
-./doc/simgrid/examples/msg/icomms/deployment_peer.xml                                                       678           
-./doc/simgrid/examples/msg/icomms/deployment_peer05.xml                                                     891           
-./doc/simgrid/examples/msg/icomms/deployment_peer02.xml                                                     855           
-./doc/simgrid/examples/msg/icomms/peer2.c                                                                   4276          
-./doc/simgrid/examples/msg/icomms/deployment_peer03.xml                                                     851           
-./doc/simgrid/examples/msg/icomms/deployment_peer04.xml                                                     852           
-./doc/simgrid/examples/msg/icomms/peer.c                                                                    5102          
-./doc/simgrid/examples/msg/icomms/deployment_peer01.xml                                                     855           
-./doc/simgrid/examples/msg/icomms/peer3.c                                                                   5258          
-./doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml                                          654           
-./doc/simgrid/examples/msg/parallel_task/test_ptask.c                                                       5423          
-./doc/simgrid/examples/msg/parallel_task/test_ptask_platform.xml                                            2380          
-./doc/simgrid/examples/msg/parallel_task/parallel_task.c                                                    2708          
-./doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c                                         6217          
-./doc/simgrid/examples/msg/trace/test9.xml                                                                  598           
-./doc/simgrid/examples/msg/trace/test3.xml                                                                  372           
-./doc/simgrid/examples/msg/trace/test_trace_integration.xml                                                 206           
-./doc/simgrid/examples/msg/trace/test2.xml                                                                  370           
-./doc/simgrid/examples/msg/trace/test7.xml                                                                  501           
-./doc/simgrid/examples/msg/trace/test11.xml                                                                 683           
-./doc/simgrid/examples/msg/trace/test4.xml                                                                  371           
-./doc/simgrid/examples/msg/trace/test10.xml                                                                 598           
-./doc/simgrid/examples/msg/trace/test6.xml                                                                  372           
-./doc/simgrid/examples/msg/trace/test8.xml                                                                  498           
-./doc/simgrid/examples/msg/trace/test5.xml                                                                  371           
-./doc/simgrid/examples/msg/trace/test_trace_integration.c                                                   1960          
-./doc/simgrid/examples/msg/trace/test1.xml                                                                  366           
-./doc/simgrid/examples/msg/parallel_contexts/pcontexts_platform.xml                                         1002          
-./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts2_4.xml                                    467           
-./doc/simgrid/examples/msg/parallel_contexts/pcontexts2.c                                                   2236          
-./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts_2.xml                                     242           
-./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts_4.xml                                     353           
-./doc/simgrid/examples/msg/parallel_contexts/pcontexts.c                                                    1752          
-./doc/simgrid/examples/msg/tracing/deployment.xml                                                           800           
-./doc/simgrid/examples/msg/tracing/ms.c                                                                     4374          
-./doc/simgrid/examples/msg/tracing/platform.xml                                                             3930          
-./doc/simgrid/examples/msg/tracing/tasks.c                                                                  3594          
-./doc/simgrid/examples/msg/tracing/procmig-deploy.xml                                                       223           
-./doc/simgrid/examples/msg/tracing/procmig.c                                                                3282          
-./doc/simgrid/examples/msg/tracing/categories.c                                                             3358          
-./doc/simgrid/examples/msg/sendrecv/README                                                                  689           
-./doc/simgrid/examples/msg/sendrecv/deployment_sendrecv.xml                                                 321           
-./doc/simgrid/examples/msg/sendrecv/sendrecv.c                                                              5098          
-./doc/simgrid/examples/msg/sendrecv/platform_sendrecv.xml                                                   528           
-./doc/simgrid/examples/msg/gtnets/onelink-p.xml                                                             439           
-./doc/simgrid/examples/msg/gtnets/fullduplex-p.xml                                                          575           
-./doc/simgrid/examples/msg/gtnets/dogbone-d.xml                                                             576           
-./doc/simgrid/examples/msg/gtnets/waxman-d.xml                                                              46642         
-./doc/simgrid/examples/msg/gtnets/waxman-p.xml                                                      4964600   
-./doc/simgrid/examples/msg/gtnets/fullduplex-d.xml                                                          1029          
-./doc/simgrid/examples/msg/gtnets/onelink-d.xml                                                             356           
-./doc/simgrid/examples/msg/gtnets/gtnets.c                                                                  6172          
-./doc/simgrid/examples/msg/gtnets/dogbone-p.xml                                                             1482          
-./doc/simgrid/examples/msg/pmm/msg_pmm.c                                                                    9688          
-./doc/simgrid/examples/msg/pmm/pmm_9_deploy.xml                                                             786           
-./doc/simgrid/examples/msg/mc/bugged1.c                                                                     1378          
-./doc/simgrid/examples/msg/mc/deploy_bugged3.xml                                                            377           
-./doc/simgrid/examples/msg/mc/deploy_mutex.xml                                                              925           
-./doc/simgrid/examples/msg/mc/platform.xml                                                                  876           
-./doc/simgrid/examples/msg/mc/deploy_bugged2.xml                                                            377           
-./doc/simgrid/examples/msg/mc/random_test.c                                                                 563           
-./doc/simgrid/examples/msg/mc/deploy_bugged1.xml                                                            459           
-./doc/simgrid/examples/msg/mc/bugged3.c                                                                     1827          
-./doc/simgrid/examples/msg/mc/deploy_random_test.xml                                                        468           
-./doc/simgrid/examples/msg/mc/bugged2.c                                                                     1957          
-./doc/simgrid/examples/msg/mc/centralized_mutex.c                                                           3375          
-./doc/simgrid/examples/msg/token_ring/two_clusters.xml                                                      1007          
-./doc/simgrid/examples/msg/token_ring/ring_call.c                                                           4205          
-./doc/simgrid/examples/msg/token_ring/two_peers.xml                                                         556           
-./doc/simgrid/examples/msg/msg_platform.xml                                                         2261806   
-./doc/simgrid/examples/msg/priority/deployment_priority.xml                                                 406           
-./doc/simgrid/examples/msg/priority/priority.c                                                              2394          
-./doc/simgrid/examples/msg/actions/actions.c                                                                19339         
-./doc/simgrid/examples/msg/actions/deployment.xml                                                           249           
-./doc/simgrid/examples/msg/actions/NAS_LU_S_4/platform_flat.xml                                             6805          
-./doc/simgrid/examples/msg/actions/NAS_LU_S_4/platform.xml                                                  387           
-./doc/simgrid/examples/msg/actions/NAS_LU_S_4/deploy_MPI_4.xml                                              605           
-./doc/simgrid/examples/msg/actions/sim.0.bordereau.lu.b.8/toto.xml                                          1066          
-./doc/simgrid/examples/msg/actions/sim.0.bordereau.lu.b.8/titi.xml                                          1066          
-./doc/simgrid/examples/msg/actions/deployment_split.xml                                                     525           
-./doc/simgrid/examples/msg/actions/homogeneous_3_hosts.xml                                                  906           
-./doc/simgrid/examples/msg/actions/bcast_deployment.xml                                                     224           
-./doc/simgrid/examples/msg/actions/actions_deployment_split.xml                                             501           
-./doc/simgrid/examples/msg/masterslave/masterslave_bypass.c                                                 9082          
-./doc/simgrid/examples/msg/masterslave/deployment_masterslave_mailbox.xml                                   990           
-./doc/simgrid/examples/msg/masterslave/masterslave_cluster.c                                                6773          
-./doc/simgrid/examples/msg/masterslave/masterslave_console.c                                                3952          
-./doc/simgrid/examples/msg/masterslave/platform_clusters.xml                                                930           
-./doc/simgrid/examples/msg/masterslave/deployment_masterslave_mailbox_multicore.xml                         1078          
-./doc/simgrid/examples/msg/masterslave/masterslave_failure.c                                                7120          
-./doc/simgrid/examples/msg/masterslave/deployment_masterslave_vivaldi.xml                                   4170          
-./doc/simgrid/examples/msg/masterslave/deployment_masterslave_forwarder.xml                                 1382          
-./doc/simgrid/examples/msg/masterslave/masterslave_forwarder.c                                              6438          
-./doc/simgrid/examples/msg/masterslave/platform_script.lua                                                  2535          
-./doc/simgrid/examples/msg/masterslave/deployment_masterslave.xml                                           998           
-./doc/simgrid/examples/msg/masterslave/jumbo_deployment.xml                                                 6805          
-./doc/simgrid/examples/msg/masterslave/jumbo_deployment_masterslave_mailbox.xml                             878           
-./doc/simgrid/examples/msg/masterslave/masterslave_mailbox.c                                                4118          
-./doc/simgrid/examples/msg/suspend/suspend.c                                                                2692          
-./doc/simgrid/examples/msg/suspend/deployment_suspend.xml                                                   183           
-./doc/simgrid/examples/msg/small_platform_with_routers.xml                                                  5295          
-./doc/simgrid/examples/msg/chord/chord90.xml                                                                13992         
-./doc/simgrid/examples/msg/chord/chord.xml                                                                  2236          
-./doc/simgrid/examples/msg/chord/chord10k.xml                                                       1624671   
-./doc/simgrid/examples/msg/chord/chord.c                                                                    28995         
-./doc/simgrid/examples/lua/multi_matrix/quicksort_platform.xml                                              4628          
-./doc/simgrid/examples/lua/multi_matrix/mult_matrix.lua                                                     227           
-./doc/simgrid/examples/lua/multi_matrix/receiver.lua                                                        1199          
-./doc/simgrid/examples/lua/multi_matrix/quicksort_deployment.xml                                            524           
-./doc/simgrid/examples/lua/multi_matrix/sender.lua                                                          748           
-./doc/simgrid/examples/lua/mult_matrix.lua                                                                  2196          
-./doc/simgrid/examples/lua/README                                                                           1416          
-./doc/simgrid/examples/lua/deploy.xml                                                                       879           
-./doc/simgrid/examples/lua/splaySim/master.lua                                                              1125          
-./doc/simgrid/examples/lua/splaySim/slave.lua                                                               729           
-./doc/simgrid/examples/lua/splaySim/splay_platform.lua                                                      1950          
-./doc/simgrid/examples/lua/splaySim/splay_ctrl.lua                                                          304           
-./doc/simgrid/examples/lua/splaySim/splay_deploy_masterslave.lua                                            487           
-./doc/simgrid/examples/lua/tracing/master.lua                                                               1390          
-./doc/simgrid/examples/lua/tracing/slave.lua                                                                713           
-./doc/simgrid/examples/lua/tracing/master_slave_trace.lua                                                   491           
-./doc/simgrid/examples/lua/SimSplay/sim_splay.lua                                                           2298          
-./doc/simgrid/examples/lua/SimSplay/splay_school.lua                                                        402           
-./doc/simgrid/examples/lua/SimSplay/chord.lua                                                               1906          
-./doc/simgrid/examples/lua/SimSplay/platform_script.lua                                                     1706          
-./doc/simgrid/examples/lua/console/master.lua                                                               1125          
-./doc/simgrid/examples/lua/console/deploy.lua                                                               480           
-./doc/simgrid/examples/lua/console/slave.lua                                                                730           
-./doc/simgrid/examples/lua/console/platform.lua                                                             2424          
-./doc/simgrid/examples/lua/console/master_slave_bypass.lua                                                  158           
-./doc/simgrid/examples/lua/masterslave/master.lua                                                           1125          
-./doc/simgrid/examples/lua/masterslave/slave.lua                                                            730           
-./doc/simgrid/examples/lua/masterslave/platform.lua                                                         2424          
-./doc/simgrid/examples/lua/masterslave/master_slave.lua                                                     378           
-./doc/simgrid/examples/simdag/properties/sd_prop.c                                                          3012          
-./doc/simgrid/examples/simdag/dax/Strassen.xml                                                              9663          
-./doc/simgrid/examples/simdag/dax/Montage_25.xml                                                            23087         
-./doc/simgrid/examples/simdag/dax/Sipht_30.xml                                                      267014    
-./doc/simgrid/examples/simdag/dax/dax_test.c                                                                4346          
-./doc/simgrid/examples/simdag/dax/Montage_50.xml                                                            48868         
-./doc/simgrid/examples/simdag/dax/Inspiral_30.xml                                                           28774         
-./doc/simgrid/examples/simdag/dax/sagittaire.xml                                                            289           
-./doc/simgrid/examples/simdag/scheduling/minmin_test.c                                                      11328         
-./doc/simgrid/examples/simdag/scheduling/Montage_25.xml                                                     23087         
-./doc/simgrid/examples/simdag/scheduling/simulacrum_7_hosts.xml                                             5670          
-./doc/simgrid/examples/simdag/sd_seq_access.c                                                               4153          
-./doc/simgrid/examples/simdag/sd_test_console.c                                                             6976          
-./doc/simgrid/examples/simdag/metaxml/sd_meta.c                                                             2207          
-./doc/simgrid/examples/simdag/2clusters.xml                                                                 14326         
-./doc/simgrid/examples/simdag/sd_test2.c                                                                    7538          
-./doc/simgrid/examples/simdag/platform_script.lua                                                           1864          
-./doc/simgrid/examples/simdag/simdag_trace.c                                                                4354          
-./doc/simgrid/examples/simdag/sd_test.c                                                                     6964          
-./doc/simgrid/examples/simdag/dot/dot_test2.c                                                               1622          
-./doc/simgrid/examples/simdag/dot/simulate_dot.c                                                            3590          
-./doc/simgrid/examples/simdag/dot/dot_test.c                                                                4002          
-./doc/simgrid/examples/platforms/g5k.xml                                                                    17028         
-./doc/simgrid/examples/platforms/One_cluster_no_backbone.xml                                                482           
-./doc/simgrid/examples/platforms/g5k_cabinets.xml                                                           22645         
-./doc/simgrid/examples/platforms/nancy.xml                                                                  4028          
-./doc/simgrid/examples/platforms/lcg_sept2004_grid.xml                                                      15970         
-./doc/simgrid/examples/platforms/Two_clusters.xml                                                           930           
-./doc/simgrid/examples/platforms/vivaldi.xml                                                                3274          
-./doc/simgrid/examples/platforms/gridpp_grid_2004.xml                                                       6096          
-./doc/simgrid/examples/platforms/griffon.xml                                                                1879          
-./doc/simgrid/examples/platforms/median_harvard.xml                                                         28125         
-./doc/simgrid/examples/platforms/prop.xml                                                                   1273          
-./doc/simgrid/examples/platforms/One_cluster.xml                                                            661           
-./doc/simgrid/examples/platforms/gdx.xml                                                                    2323          
-./doc/simgrid/examples/platforms/multicore_machine.xml                                                      222           
-./doc/simgrid/html/group__XBT__str.html                                                                     36192         
-./doc/simgrid/html/group__XBT__cfg__decl.html                                                               14505         
-./doc/simgrid/html/bug.html                                                                                 2130          
-./doc/simgrid/html/group__MSG__C.html                                                                       10658         
-./doc/simgrid/html/structs__xbt__strbuff__t.html                                                            2512          
-./doc/simgrid/html/MSG_ex_master_slave_lua_bypass.html                                                      4803          
-./doc/simgrid/html/simgrid_modules2.png                                                                     11932         
-./doc/simgrid/html/classsimgrid_1_1msg_1_1Msg.html                                                          1519          
-./doc/simgrid/html/group__SURF__actions.html                                                                13562         
-./doc/simgrid/html/publis_intra.html                                                                        435           
-./doc/simgrid/html/simgrid_logo_small.png                                                                   8326          
-./doc/simgrid/html/group__SURF__resources.html                                                              4203          
-./doc/simgrid/html/structsurf__cpu__model__extension__public.html                                           2751          
-./doc/simgrid/html/tabs.css                                                                                 1095          
-./doc/simgrid/html/group__XBT__set.html                                                                     6991          
-./doc/simgrid/html/group__XBT__set__curs.html                                                               9653          
-./doc/simgrid/html/structxbt__ex__t.html                                                                    10014         
-./doc/simgrid/html/pages.html                                                                               5794          
-./doc/simgrid/html/MSG_ex_master_slave_scrip_lua.html                                                       30160         
-./doc/simgrid/html/group__XBT__API.html                                                                     6276          
-./doc/simgrid/html/classsimgrid_1_1msg_1_1MsgException.html                                                 1519          
-./doc/simgrid/html/todo.html                                                                                3202          
-./doc/simgrid/html/nav_f.png                                                                                159           
-./doc/simgrid/html/group__XBT__queue.html                                                                   23050         
-./doc/simgrid/html/group__XBT__fifo__cons.html                                                              9876          
-./doc/simgrid/html/structsurf__model.html                                                                   17707         
-./doc/simgrid/html/MSG_ex_asynchronous_communications.html                                                  43212         
-./doc/simgrid/html/Paje_MSG_screenshot_thn.jpg                                                              30326         
-./doc/simgrid/html/structsurf__network__model__extension__public.html                                       2783          
-./doc/simgrid/html/structsurf__model__description.html                                                      2621          
-./doc/simgrid/html/group__m__host__management.html                                                          19042         
-./doc/simgrid/html/group__XBT__fifo__perl.html                                                              14045         
-./doc/simgrid/html/modules.html                                                                             12734         
-./doc/simgrid/html/annotated.html                                                                           7707          
-./doc/simgrid/html/group__XBT__fifo.html                                                                    6191          
-./doc/simgrid/html/group__XBT__parmap.html                                                                  3765          
-./doc/simgrid/html/tracing.html                                                                             58483         
-./doc/simgrid/html/structs__surf__metric__t.html                                                            2523          
-./doc/simgrid/html/classsimgrid_1_1msg_1_1Task.html                                                         1519          
-./doc/simgrid/html/group__XBT__swag.html                                                                    5923          
-./doc/simgrid/html/functions_vars.html                                                                      11436         
-./doc/simgrid/html/group__XBT__swag__type.html                                                              8194          
-./doc/simgrid/html/win_install_02.png                                                                       60084         
-./doc/simgrid/html/simgrid_modules.png                                                                      8309          
-./doc/simgrid/html/group__XBT__error.html                                                                   8348          
-./doc/simgrid/html/group__XBT__dynar__cons.html                                                             15743         
-./doc/simgrid/html/simgrid_logo.png                                                                         21536         
-./doc/simgrid/html/group__XBT__fifo__misc.html                                                              7717          
-./doc/simgrid/html/group__XBT__context.html                                                                 3460          
-./doc/simgrid/html/group__m__channel__management.html                                                       8963          
-./doc/simgrid/html/structm__task.html                                                                       4188          
-./doc/simgrid/html/group__XBT__swag__curs.html                                                              8561          
-./doc/simgrid/html/group__XBT__log.html                                                                     60965         
-./doc/simgrid/html/open.png                                                                                 118           
-./doc/simgrid/html/group__msg__simulation.html                                                              9008          
-./doc/simgrid/html/group__XBT__dynar__cursor.html                                                           11976         
-./doc/simgrid/html/group__XBT__log__cats.html                                                               5102          
-./doc/simgrid/html/win_install_03.png                                                                       55802         
-./doc/simgrid/html/poster_thumbnail.png                                                                     3249          
-./doc/simgrid/html/group__m__datatypes__management__details.html                                            7557          
-./doc/simgrid/html/group__XBT__set__basic.html                                                              24314         
-./doc/simgrid/html/win_install_01.png                                                                       61053         
-./doc/simgrid/html/closed.png                                                                               126           
-./doc/simgrid/html/group__XBT__adt.html                                                                     6958          
-./doc/simgrid/html/index.html                                                                               9659          
-./doc/simgrid/html/group__SD__link__management.html                                                         17867         
-./doc/simgrid/html/group__MSG__JAVA.html                                                                    5443          
-./doc/simgrid/html/group__SURF__simulation.html                                                             10385         
-./doc/simgrid/html/structm__host.html                                                                       4188          
-./doc/simgrid/html/group__XBT__dynar__array.html                                                            22436         
-./doc/simgrid/html/simgrid.css                                                                              386           
-./doc/simgrid/html/group__SD__task__dependency__management.html                                             15389         
-./doc/simgrid/html/group__XBT__grounding.html                                                               7225          
-./doc/simgrid/html/pls.html                                                                                 11863         
-./doc/simgrid/html/group__XBT__dynar__ctn.html                                                              12693         
-./doc/simgrid/html/functions.html                                                                           11564         
-./doc/simgrid/html/group__XBT__dynar__speed.html                                                            9616          
-./doc/simgrid/html/installSimgrid.html                                                                      24837         
-./doc/simgrid/html/triva-graph_configuration.png                                                            59769         
-./doc/simgrid/html/triva-graph_visualization.png                                                            55335         
-./doc/simgrid/html/MSG_ex_master_slave.html                                                                 51294         
-./doc/simgrid/html/doxygen.png                                                                              3942          
-./doc/simgrid/html/group__XBT__mallocator__cons.html                                                        10757         
-./doc/simgrid/html/group__API__index.html                                                           125324    
-./doc/simgrid/html/group__XBT__dict__cons.html                                                              9746          
-./doc/simgrid/html/group__XBT__swag__func.html                                                              19885         
-./doc/simgrid/html/group__SimGrid__API.html                                                                 4674          
-./doc/simgrid/html/group__XBT__dynar__misc.html                                                             9591          
-./doc/simgrid/html/structxbt__set__elm__.html                                                               5121          
-./doc/simgrid/html/group__XBT__cfg__get.html                                                                19320         
-./doc/simgrid/html/bindings.html                                                                            23685         
-./doc/simgrid/html/group__XBT__dict.html                                                                    6916          
-./doc/simgrid/html/use.html                                                                                 3904          
-./doc/simgrid/html/group__XBT__dict__basic.html                                                             20935         
-./doc/simgrid/html/group__XBT__graph.html                                                                   23682         
-./doc/simgrid/html/group__XBT__mallocator.html                                                              6444          
-./doc/simgrid/html/structsurf__workstation__model__extension__public.html                                   11076         
-./doc/simgrid/html/publis.html                                                                              435           
-./doc/simgrid/html/group__XBT__misc.html                                                                    4663          
-./doc/simgrid/html/simdag.html                                                                              226           
-./doc/simgrid/html/Paje_MSG_screenshot.jpg                                                          340759    
-./doc/simgrid/html/group__msg__gos__functions.html                                                          65293         
-./doc/simgrid/html/classsimgrid_1_1msg_1_1Host.html                                                         1519          
-./doc/simgrid/html/publis_extern.html                                                                       435           
-./doc/simgrid/html/group__MSG__LUA.html                                                                     5094          
-./doc/simgrid/html/group__XBT__dynar.html                                                                   14081         
-./doc/simgrid/html/structs__model__type.html                                                                2480          
-./doc/simgrid/html/group__XBT__synchro.html                                                                 19296         
-./doc/simgrid/html/bc_s.png                                                                                 677           
-./doc/simgrid/html/classes.html                                                                             6934          
-./doc/simgrid/html/group__XBT__fifo__direct.html                                                            29778         
-./doc/simgrid/html/group__XBT__cfg__use.html                                                                37757         
-./doc/simgrid/html/group__XBT__mallocator__objects.html                                                     9306          
-./doc/simgrid/html/classsimgrid_1_1msg_1_1Process.html                                                      1519          
-./doc/simgrid/html/group__XBT__dict__multi.html                                                             18525         
-./doc/simgrid/html/group__m__datatypes__management.html                                                     16459         
-./doc/simgrid/html/tab_b.png                                                                                178           
-./doc/simgrid/html/group__SD__simulation.html                                                               45009         
-./doc/simgrid/html/group__msg__easier__life.html                                                            50885         
-./doc/simgrid/html/group__m__task__management.html                                                          35307         
-./doc/simgrid/html/tab_a.png                                                                                140           
-./doc/simgrid/html/group__XBT__config.html                                                                  16354         
-./doc/simgrid/html/options.html                                                                             7629          
-./doc/simgrid/html/group__XBT__dict__nnul.html                                                              18891         
-./doc/simgrid/html/win_install_04.png                                                                       52033         
-./doc/simgrid/html/structsurf__action.html                                                                  8353          
-./doc/simgrid/html/group__XBT__ex.html                                                                      32537         
-./doc/simgrid/html/group__SURF__API.html                                                                    6659          
-./doc/simgrid/html/doxygen.css                                                                              12350         
-./doc/simgrid/html/group__XBT__set__cons.html                                                               7965          
-./doc/simgrid/html/group__SURF__build__api.html                                                             7821          
-./doc/simgrid/html/group__m__process__management.html                                                       47169         
-./doc/simgrid/html/group__XBT__dict__curs.html                                                              19747         
-./doc/simgrid/html/group__SD__datatypes__management.html                                                    20816         
-./doc/simgrid/html/group__SD__API.html                                                                      8379          
-./doc/simgrid/html/group__SMPI__API.html                                                                    4776          
-./doc/simgrid/html/group__XBT__dynar__perl.html                                                             12131         
-./doc/simgrid/html/group__XBT__cfg__register.html                                                           15874         
-./doc/simgrid/html/publis_core.html                                                                         435           
-./doc/simgrid/html/group__SD__workstation__management.html                                                  46397         
-./doc/simgrid/html/MSG_ex_master_slave_lua.html                                                             4794          
-./doc/simgrid/html/group__MSG__API.html                                                                     6026          
-./doc/simgrid/html/msg.html                                                                                 227           
-./doc/simgrid/html/group__SD__task__management.html                                                         60347         
-./doc/simgrid/html/group__XBT__syscall.html                                                                 10095         
-./doc/simgrid/html/group__XBT__heap.html                                                                    18482         
-./doc/simgrid/html/structsurf__action__state.html                                                           7301          
-./doc/simgrid/html/tab_s.png                                                                                189           
-./doc/simgrid/html/tab_h.png                                                                                192           
-./doc/simgrid/html/nav_h.png                                                                        97    
-./include/smpi/mpif.h                                                                                       4826          
-./include/smpi/smpif.h                                                                                      1139          
-./include/smpi/mpi.h                                                                                        510           
-./include/smpi/smpi_cocci.h                                                                                 3187          
-./include/smpi/smpi.h                                                                                       24101         
-./include/xbt/fifo.h                                                                                        3626          
-./include/xbt/dict.h                                                                                        7459          
-./include/xbt/str.h                                                                                         2111          
-./include/xbt/log.h                                                                                         25433         
-./include/xbt/misc.h                                                                                        8031          
-./include/xbt/synchro_core.h                                                                                4477          
-./include/xbt/mmalloc.h                                                                                     1976          
-./include/xbt/replay_trace_reader.h                                                                         917           
-./include/xbt/function_types.h                                                                              1111          
-./include/xbt/strbuff.h                                                                                     1281          
-./include/xbt/virtu.h                                                                                       684           
-./include/xbt/asserts.h                                                                                     1871          
-./include/xbt/ex.h                                                                                          23255         
-./include/xbt/graph.h                                                                                       5668          
-./include/xbt/graphxml.h                                                                                    5474          
-./include/xbt/queue.h                                                                                       2252          
-./include/xbt/matrix.h                                                                                      3027          
-./include/xbt/setset.h                                                                                      2422          
-./include/xbt/time.h                                                                                        743           
-./include/xbt/lib.h                                                                                         2014          
-./include/xbt/hash.h                                                                                        1064          
-./include/xbt/set.h                                                                                         4383          
-./include/xbt/config.h                                                                                      9224          
-./include/xbt/sysdep.h                                                                                      4941          
-./include/xbt/swag.h                                                                                        5352          
-./include/xbt/graphxml_parse.h                                                                              1926          
-./include/xbt/peer.h                                                                                        870           
-./include/xbt/module.h                                                                                      648           
-./include/xbt/cunit.h                                                                                       5523          
-./include/xbt/parmap.h                                                                                      1166          
-./include/xbt/mallocator.h                                                                                  2296          
-./include/xbt/dynar.h                                                                                       9553          
-./include/xbt/heap.h                                                                                        1444          
-./include/xbt.h                                                                                             876           
-./include/msg/datatypes.h                                                                                   4635          
-./include/msg/msg.h                                                                                         12038         
-./include/simgrid_config.h                                                                                  3641          
-./include/mc/modelchecker.h                                                                         96    
-./include/surf/simgrid_dtd.h                                                                                23583         
-./include/surf/surf_routing.h                                                                               1167          
-./include/surf/surfxml_parse.h                                                                              5343          
-./include/instr/instr.h                                                                                     5750          
-./include/simdag/simdag.h                                                                                   10325         
-./include/simdag/datatypes.h                                                                                3715          
-./include/simix/simix.h                                                                                     13003         
-./include/simix/datatypes.h                                                                                 3346          
-./include/simix/context.h                                                                                   4040          
-./lib/libsimgrid.so.3.6.2                                                                                   12710497  
-./bin/smpicc                                                                                       918    
-./bin/smpirun                                                                                              7292           
-./bin/smpif2c                                                                                              1990           
-./bin/simgrid_update_xml                                                                                   5018           
-./bin/graphicator                                                                                          66986          
-./bin/simgrid-colorizer                                                                                    2993           
-./bin/smpiff                                                                                       820    
-./bin/tesh                                                                                                 356434         
+./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx  71
+./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml  1262
+./doc/simgrid/examples/cxx/autoDestination/Main.cxx  148
+./doc/simgrid/examples/cxx/autoDestination/Slave.cxx  870
+./doc/simgrid/examples/cxx/autoDestination/BasicTask.cxx  65
+./doc/simgrid/examples/cxx/autoDestination/Master.cxx  1891
+./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml  2133932
+./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx  1137
+./doc/simgrid/explicitDestination/FinalizeTask.cxx 71
+./doc/simgrid/examples/cxx/basic/Main.cxx  148
+./doc/simgrid/examples/cxx/basic/Slave.cxx  693
+./doc/simgrid/examples/cxx/basic/BasicTask.cxx  65
+./doc/simgrid/examples/cxx/basic/basic_platform.xml  2133932  
+./doc/simgrid/examples/cxx/basic/Master.cxx  2148
+./doc/simgrid/examples/cxx/basic/basic_deployment.xml 1188
+./doc/simgrid/examples/cxx/basic/Forwarder.cxx  1244
+./doc/simgrid/examples/cxx/explicitDestination/FinalizeTask.cxx  71
+./doc/simgrid/examples/cxx/explicitDestination/Main.cxx  148
+./doc/simgrid/examples/cxx/explicitDestination/explicitDestination_platform.xml  2133932
+./doc/simgrid/examples/cxx/explicitDestination/Slave.cxx  913
+./doc/simgrid/examples/cxx/explicitDestination/BasicTask.cxx  65
+./doc/simgrid/examples/cxx/explicitDestination/explicitDestination_deployment.xml  1188
+./doc/simgrid/examples/cxx/explicitDestination/Master.cxx  1896
+./doc/simgrid/examples/cxx/explicitDestination/Forwarder.cxx  1181
+./doc/simgrid/examples/cxx/ping_pong/Main.cxx  149
+./doc/simgrid/examples/cxx/ping_pong/Sender.cxx 1073
+./doc/simgrid/examples/cxx/ping_pong/ping_pong_deployment.xml  275
+./doc/simgrid/examples/cxx/ping_pong/ping_pong_platform.xml  4718
+./doc/simgrid/examples/cxx/ping_pong/Receiver.cxx 957
+./doc/simgrid/examples/cxx/ping_pong/PingPongTask.cxx 71
+./doc/simgrid/examples/cxx/comm_time/FinalizeTask.cxx 71
+./doc/simgrid/examples/cxx/comm_time/Main.cxx  146
+./doc/simgrid/examples/cxx/comm_time/CommTimeTask.cxx 71
+./doc/simgrid/examples/cxx/comm_time/Slave.cxx  889
+./doc/simgrid/examples/cxx/comm_time/comm_time_platform.xml  2133932
+./doc/simgrid/examples/cxx/comm_time/Master.cxx  1730
+./doc/simgrid/examples/cxx/comm_time/comm_time_deployment.xml  1884
+./doc/simgrid/examples/cxx/suspend/Main.cxx  150
+./doc/simgrid/examples/cxx/suspend/suspend_platform.xml  2133932
+./doc/simgrid/examples/cxx/suspend/suspend_deployment.xml  187
+./doc/simgrid/examples/cxx/suspend/DreamMaster.cxx 826
+./doc/simgrid/examples/cxx/suspend/LazyGuy.cxx  429
+./doc/simgrid/examples/smpi/mc_bugged2.c  1387
+./doc/simgrid/examples/smpi/scatter.c  3496
+./doc/simgrid/examples/smpi/mc_bugged1.c  1411
+./doc/simgrid/examples/smpi/get_processor_name.c  649
+./doc/simgrid/examples/smpi/NAS/README  1857
+./doc/simgrid/examples/smpi/NAS/EP-sampling/README  347
+./doc/simgrid/examples/smpi/NAS/EP-sampling/randlc.c  3300
+./doc/simgrid/examples/smpi/NAS/EP-sampling/ep.c  13723
+./doc/simgrid/examples/smpi/NAS/EP-trace/README  347
+./doc/simgrid/examples/smpi/NAS/EP-trace/randlc.c  3300
+./doc/simgrid/examples/smpi/NAS/EP-trace/ep-trace.c  13850
+./doc/simgrid/examples/smpi/NAS/config/NAS.samples/README  394
+./doc/simgrid/examples/smpi/NAS/IS-trace/is-trace.c 38276
+./doc/simgrid/examples/smpi/NAS/DT-trace/README 999
+./doc/simgrid/examples/smpi/NAS/DT-trace/DGraph.c 5451
+./doc/simgrid/examples/smpi/NAS/DT-trace/dt.c  23031
+./doc/simgrid/examples/smpi/NAS/IS/is.c  38077
+./doc/simgrid/examples/smpi/NAS/MPI_dummy/README 2406
+./doc/simgrid/examples/smpi/NAS/MPI_dummy/mpi_dummy.c 5660
+./doc/simgrid/examples/smpi/NAS/MPI_dummy/wtime_sgi64.c  1700
+./doc/simgrid/examples/smpi/NAS/MPI_dummy/wtime.c 228
+./doc/simgrid/examples/smpi/NAS/common/randdp.c 1441
+./doc/simgrid/examples/smpi/NAS/common/c_timers.c 1159
+./doc/simgrid/examples/smpi/NAS/common/c_print_results.c  3086
+./doc/simgrid/examples/smpi/NAS/sys/README  1461
+./doc/simgrid/examples/smpi/NAS/sys/setparams.c 38805
+./doc/simgrid/examples/smpi/NAS/SP/README  926
+./doc/simgrid/examples/smpi/NAS/FT/README  276
+./doc/simgrid/examples/smpi/NAS/DT/README  999
+./doc/simgrid/examples/smpi/NAS/DT/DGraph.c  5451
+./doc/simgrid/examples/smpi/NAS/DT/dt.c  22620
+./doc/simgrid/examples/smpi/NAS/EP/README  347
+./doc/simgrid/examples/smpi/NAS/EP/randlc.c  3300
+./doc/simgrid/examples/smpi/NAS/EP/ep.c  13688
+./doc/simgrid/examples/smpi/NAS/DT-folding/README 999
+./doc/simgrid/examples/smpi/NAS/DT-folding/DGraph.c 5451
+./doc/simgrid/examples/smpi/NAS/DT-folding/dt.c 22704
+./doc/simgrid/examples/smpi/NAS/MG/README  5465
+./doc/simgrid/examples/smpi/bcast.c  983
+./doc/simgrid/examples/smpi/compute2.c  628
+./doc/simgrid/examples/smpi/sendrecv.c  1652
+./doc/simgrid/examples/smpi/allreduce.c  2135
+./doc/simgrid/examples/smpi/mvmul.c  7069
+./doc/simgrid/examples/smpi/alltoallv.c  4441
+./doc/simgrid/examples/smpi/smpi_traced.c  8529
+./doc/simgrid/examples/smpi/compute3.c  816
+./doc/simgrid/examples/smpi/reduce.c  3545
+./doc/simgrid/examples/smpi/bcbench.c  2466
+./doc/simgrid/examples/smpi/ttest01.c  1273
+./doc/simgrid/examples/smpi/compute.c  622
+./doc/simgrid/examples/smpi/barrier.c  766
+./doc/simgrid/examples/smpi/alltoall_basic.c  1453
+./doc/simgrid/examples/smpi/pingpong.c  2286
+./doc/simgrid/examples/smpi/alltoall2.c  2799
+./doc/simgrid/examples/smpi/split.c  705
+./doc/simgrid/examples/xbt/sem_basic.c  1970
+./doc/simgrid/examples/xbt/sem_sched.c  7207
+./doc/simgrid/examples/msg/small_platform.xml  4582
+./doc/simgrid/examples/msg/README  4805
+./doc/simgrid/examples/msg/properties/deployment_properties.xml  272
+./doc/simgrid/examples/msg/properties/msg_prop.c 3853
+./doc/simgrid/examples/msg/ns3/3links-p.xml  856
+./doc/simgrid/examples/msg/ns3/dogbone-d.xml  582
+./doc/simgrid/examples/msg/ns3/Two_clusters.xml 1817
+./doc/simgrid/examples/msg/ns3/3links-d.xml  927
+./doc/simgrid/examples/msg/ns3/3links-d-timer.xml 1280
+./doc/simgrid/examples/msg/ns3/ns3.c  5177
+./doc/simgrid/examples/msg/ns3/Two_clusters-d.xml 369
+./doc/simgrid/examples/msg/ns3/One_cluster-d.xml 367
+./doc/simgrid/examples/msg/ns3/dogbone-p.xml  1497
+./doc/simgrid/examples/msg/ns3/3hosts_2links_p.xml 566
+./doc/simgrid/examples/msg/ns3/3hosts_2links_d.xml 352
+./doc/simgrid/examples/msg/ns3/One_cluster.xml  658
+./doc/simgrid/examples/msg/migration/migration.c 2922
+./doc/simgrid/examples/msg/small_platform_with_failures.xml  4746
+./doc/simgrid/examples/msg/icomms/small_platform.xml 972
+./doc/simgrid/examples/msg/icomms/deployment_peer.xml 678
+./doc/simgrid/examples/msg/icomms/deployment_peer05.xml  891
+./doc/simgrid/examples/msg/icomms/deployment_peer02.xml  855
+./doc/simgrid/examples/msg/icomms/peer2.c  4276
+./doc/simgrid/examples/msg/icomms/deployment_peer03.xml  851
+./doc/simgrid/examples/msg/icomms/deployment_peer04.xml  852
+./doc/simgrid/examples/msg/icomms/peer.c  5102
+./doc/simgrid/examples/msg/icomms/deployment_peer01.xml  855
+./doc/simgrid/examples/msg/icomms/peer3.c  5258
+./doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml  654
+./doc/simgrid/examples/msg/parallel_task/test_ptask.c 5423
+./doc/simgrid/examples/msg/parallel_task/test_ptask_platform.xml  2380
+./doc/simgrid/examples/msg/parallel_task/parallel_task.c  2708
+./doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c  6217
+./doc/simgrid/examples/msg/trace/test9.xml  598
+./doc/simgrid/examples/msg/trace/test3.xml  372
+./doc/simgrid/examples/msg/trace/test_trace_integration.xml  206
+./doc/simgrid/examples/msg/trace/test2.xml  370
+./doc/simgrid/examples/msg/trace/test7.xml  501
+./doc/simgrid/examples/msg/trace/test11.xml  683
+./doc/simgrid/examples/msg/trace/test4.xml  371
+./doc/simgrid/examples/msg/trace/test10.xml  598
+./doc/simgrid/examples/msg/trace/test6.xml  372
+./doc/simgrid/examples/msg/trace/test8.xml  498
+./doc/simgrid/examples/msg/trace/test5.xml  371
+./doc/simgrid/examples/msg/trace/test_trace_integration.c  1960
+./doc/simgrid/examples/msg/trace/test1.xml  366
+./doc/simgrid/examples/msg/parallel_contexts/pcontexts_platform.xml  1002
+./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts2_4.xml 467
+./doc/simgrid/examples/msg/parallel_contexts/pcontexts2.c  2236
+./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts_2.xml 242
+./doc/simgrid/examples/msg/parallel_contexts/deployment_pcontexts_4.xml 353
+./doc/simgrid/examples/msg/parallel_contexts/pcontexts.c  1752
+./doc/simgrid/examples/msg/tracing/deployment.xml 800
+./doc/simgrid/examples/msg/tracing/ms.c  4374
+./doc/simgrid/examples/msg/tracing/platform.xml 3930
+./doc/simgrid/examples/msg/tracing/tasks.c  3594
+./doc/simgrid/examples/msg/tracing/procmig-deploy.xml 223
+./doc/simgrid/examples/msg/tracing/procmig.c  3282
+./doc/simgrid/examples/msg/tracing/categories.c 3358
+./doc/simgrid/examples/msg/sendrecv/README  689
+./doc/simgrid/examples/msg/sendrecv/deployment_sendrecv.xml  321
+./doc/simgrid/examples/msg/sendrecv/sendrecv.c  5098
+./doc/simgrid/examples/msg/sendrecv/platform_sendrecv.xml  528
+./doc/simgrid/examples/msg/gtnets/onelink-p.xml 439
+./doc/simgrid/examples/msg/gtnets/fullduplex-p.xml 575
+./doc/simgrid/examples/msg/gtnets/dogbone-d.xml 576
+./doc/simgrid/examples/msg/gtnets/waxman-d.xml  46642
+./doc/simgrid/examples/msg/gtnets/waxman-p.xml 4964600  
+./doc/simgrid/examples/msg/gtnets/fullduplex-d.xml 1029
+./doc/simgrid/examples/msg/gtnets/onelink-d.xml 356
+./doc/simgrid/examples/msg/gtnets/gtnets.c  6172
+./doc/simgrid/examples/msg/gtnets/dogbone-p.xml 1482
+./doc/simgrid/examples/msg/pmm/msg_pmm.c  9688
+./doc/simgrid/examples/msg/pmm/pmm_9_deploy.xml 786
+./doc/simgrid/examples/msg/mc/bugged1.c  1378
+./doc/simgrid/examples/msg/mc/deploy_bugged3.xml 377
+./doc/simgrid/examples/msg/mc/deploy_mutex.xml  925
+./doc/simgrid/examples/msg/mc/platform.xml  876
+./doc/simgrid/examples/msg/mc/deploy_bugged2.xml 377
+./doc/simgrid/examples/msg/mc/random_test.c  563
+./doc/simgrid/examples/msg/mc/deploy_bugged1.xml 459
+./doc/simgrid/examples/msg/mc/bugged3.c  1827
+./doc/simgrid/examples/msg/mc/deploy_random_test.xml 468
+./doc/simgrid/examples/msg/mc/bugged2.c  1957
+./doc/simgrid/examples/msg/mc/centralized_mutex.c 3375
+./doc/simgrid/examples/msg/token_ring/two_clusters.xml 1007
+./doc/simgrid/examples/msg/token_ring/ring_call.c 4205
+./doc/simgrid/examples/msg/token_ring/two_peers.xml 556
+./doc/simgrid/examples/msg/msg_platform.xml 2261806  
+./doc/simgrid/examples/msg/priority/deployment_priority.xml  406
+./doc/simgrid/examples/msg/priority/priority.c  2394
+./doc/simgrid/examples/msg/actions/actions.c  19339
+./doc/simgrid/examples/msg/actions/deployment.xml 249
+./doc/simgrid/examples/msg/actions/NAS_LU_S_4/platform_flat.xml  6805
+./doc/simgrid/examples/msg/actions/NAS_LU_S_4/platform.xml  387
+./doc/simgrid/examples/msg/actions/NAS_LU_S_4/deploy_MPI_4.xml  605
+./doc/simgrid/examples/msg/actions/sim.0.bordereau.lu.b.8/toto.xml  1066
+./doc/simgrid/examples/msg/actions/sim.0.bordereau.lu.b.8/titi.xml  1066
+./doc/simgrid/examples/msg/actions/deployment_split.xml  525
+./doc/simgrid/examples/msg/actions/homogeneous_3_hosts.xml  906
+./doc/simgrid/examples/msg/actions/bcast_deployment.xml  224
+./doc/simgrid/examples/msg/actions/actions_deployment_split.xml  501
+./doc/simgrid/examples/msg/masterslave/masterslave_bypass.c  9082
+./doc/simgrid/examples/msg/masterslave/deployment_masterslave_mailbox.xml 990
+./doc/simgrid/examples/msg/masterslave/masterslave_cluster.c  6773
+./doc/simgrid/examples/msg/masterslave/masterslave_console.c  3952
+./doc/simgrid/examples/msg/masterslave/platform_clusters.xml  930
+./doc/simgrid/examples/msg/masterslave/deployment_masterslave_mailbox_multicore.xml  1078
+./doc/simgrid/examples/msg/masterslave/masterslave_failure.c  7120
+./doc/simgrid/examples/msg/masterslave/deployment_masterslave_vivaldi.xml 4170
+./doc/simgrid/examples/msg/masterslave/deployment_masterslave_forwarder.xml 1382
+./doc/simgrid/examples/msg/masterslave/masterslave_forwarder.c  6438
+./doc/simgrid/examples/msg/masterslave/platform_script.lua  2535
+./doc/simgrid/examples/msg/masterslave/deployment_masterslave.xml  998
+./doc/simgrid/examples/msg/masterslave/jumbo_deployment.xml  6805
+./doc/simgrid/examples/msg/masterslave/jumbo_deployment_masterslave_mailbox.xml  878
+./doc/simgrid/examples/msg/masterslave/masterslave_mailbox.c  4118
+./doc/simgrid/examples/msg/suspend/suspend.c  2692
+./doc/simgrid/examples/msg/suspend/deployment_suspend.xml  183
+./doc/simgrid/examples/msg/small_platform_with_routers.xml  5295
+./doc/simgrid/examples/msg/chord/chord90.xml  13992
+./doc/simgrid/examples/msg/chord/chord.xml  2236
+./doc/simgrid/examples/msg/chord/chord10k.xml 1624671  
+./doc/simgrid/examples/msg/chord/chord.c  28995
+./doc/simgrid/examples/lua/multi_matrix/quicksort_platform.xml  4628
+./doc/simgrid/examples/lua/multi_matrix/mult_matrix.lua  227
+./doc/simgrid/examples/lua/multi_matrix/receiver.lua 1199
+./doc/simgrid/examples/lua/multi_matrix/quicksort_deployment.xml  524
+./doc/simgrid/examples/lua/multi_matrix/sender.lua 748
+./doc/simgrid/examples/lua/mult_matrix.lua  2196
+./doc/simgrid/examples/lua/README  1416
+./doc/simgrid/examples/lua/deploy.xml  879
+./doc/simgrid/examples/lua/splaySim/master.lua  1125
+./doc/simgrid/examples/lua/splaySim/slave.lua  729
+./doc/simgrid/examples/lua/splaySim/splay_platform.lua 1950
+./doc/simgrid/examples/lua/splaySim/splay_ctrl.lua 304
+./doc/simgrid/examples/lua/splaySim/splay_deploy_masterslave.lua  487
+./doc/simgrid/examples/lua/tracing/master.lua  1390
+./doc/simgrid/examples/lua/tracing/slave.lua  713
+./doc/simgrid/examples/lua/tracing/master_slave_trace.lua  491
+./doc/simgrid/examples/lua/SimSplay/sim_splay.lua 2298
+./doc/simgrid/examples/lua/SimSplay/splay_school.lua 402
+./doc/simgrid/examples/lua/SimSplay/chord.lua  1906
+./doc/simgrid/examples/lua/SimSplay/platform_script.lua  1706
+./doc/simgrid/examples/lua/console/master.lua  1125
+./doc/simgrid/examples/lua/console/deploy.lua  480
+./doc/simgrid/examples/lua/console/slave.lua  730
+./doc/simgrid/examples/lua/console/platform.lua 2424
+./doc/simgrid/examples/lua/console/master_slave_bypass.lua  158
+./doc/simgrid/examples/lua/masterslave/master.lua 1125
+./doc/simgrid/examples/lua/masterslave/slave.lua 730
+./doc/simgrid/examples/lua/masterslave/platform.lua 2424
+./doc/simgrid/examples/lua/masterslave/master_slave.lua  378
+./doc/simgrid/examples/simdag/properties/sd_prop.c 3012
+./doc/simgrid/examples/simdag/dax/Strassen.xml  9663
+./doc/simgrid/examples/simdag/dax/Montage_25.xml 23087
+./doc/simgrid/examples/simdag/dax/Sipht_30.xml 267014   
+./doc/simgrid/examples/simdag/dax/dax_test.c  4346
+./doc/simgrid/examples/simdag/dax/Montage_50.xml 48868
+./doc/simgrid/examples/simdag/dax/Inspiral_30.xml 28774
+./doc/simgrid/examples/simdag/dax/sagittaire.xml 289
+./doc/simgrid/examples/simdag/scheduling/minmin_test.c 11328
+./doc/simgrid/examples/simdag/scheduling/Montage_25.xml  23087
+./doc/simgrid/examples/simdag/scheduling/simulacrum_7_hosts.xml  5670
+./doc/simgrid/examples/simdag/sd_seq_access.c  4153
+./doc/simgrid/examples/simdag/sd_test_console.c 6976
+./doc/simgrid/examples/simdag/metaxml/sd_meta.c 2207
+./doc/simgrid/examples/simdag/2clusters.xml  14326
+./doc/simgrid/examples/simdag/sd_test2.c  7538
+./doc/simgrid/examples/simdag/platform_script.lua 1864
+./doc/simgrid/examples/simdag/simdag_trace.c  4354
+./doc/simgrid/examples/simdag/sd_test.c  6964
+./doc/simgrid/examples/simdag/dot/dot_test2.c  1622
+./doc/simgrid/examples/simdag/dot/simulate_dot.c 3590
+./doc/simgrid/examples/simdag/dot/dot_test.c  4002
+./doc/simgrid/examples/platforms/g5k.xml  17028
+./doc/simgrid/examples/platforms/One_cluster_no_backbone.xml  482
+./doc/simgrid/examples/platforms/g5k_cabinets.xml 22645
+./doc/simgrid/examples/platforms/nancy.xml  4028
+./doc/simgrid/examples/platforms/lcg_sept2004_grid.xml 15970
+./doc/simgrid/examples/platforms/Two_clusters.xml 930
+./doc/simgrid/examples/platforms/vivaldi.xml  3274
+./doc/simgrid/examples/platforms/gridpp_grid_2004.xml 6096
+./doc/simgrid/examples/platforms/griffon.xml  1879
+./doc/simgrid/examples/platforms/median_harvard.xml 28125
+./doc/simgrid/examples/platforms/prop.xml  1273
+./doc/simgrid/examples/platforms/One_cluster.xml 661
+./doc/simgrid/examples/platforms/gdx.xml  2323
+./doc/simgrid/examples/platforms/multicore_machine.xml 222
+./doc/simgrid/html/group__XBT__str.html  36192
+./doc/simgrid/html/group__XBT__cfg__decl.html  14505
+./doc/simgrid/html/bug.html 2130
+./doc/simgrid/html/group__MSG__C.html  10658
+./doc/simgrid/html/structs__xbt__strbuff__t.html 2512
+./doc/simgrid/html/MSG_ex_master_slave_lua_bypass.html 4803
+./doc/simgrid/html/simgrid_modules2.png  11932
+./doc/simgrid/html/classsimgrid_1_1msg_1_1Msg.html 1519
+./doc/simgrid/html/group__SURF__actions.html  13562
+./doc/simgrid/html/publis_intra.html  435
+./doc/simgrid/html/simgrid_logo_small.png  8326
+./doc/simgrid/html/group__SURF__resources.html  4203
+./doc/simgrid/html/structsurf__cpu__model__extension__public.html  2751
+./doc/simgrid/html/tabs.css 1095
+./doc/simgrid/html/group__XBT__set.html  6991
+./doc/simgrid/html/group__XBT__set__curs.html  9653
+./doc/simgrid/html/structxbt__ex__t.html  10014
+./doc/simgrid/html/pages.html 5794
+./doc/simgrid/html/MSG_ex_master_slave_scrip_lua.html 30160
+./doc/simgrid/html/group__XBT__API.html  6276
+./doc/simgrid/html/classsimgrid_1_1msg_1_1MsgException.html  1519
+./doc/simgrid/html/todo.html 3202
+./doc/simgrid/html/nav_f.png 159
+./doc/simgrid/html/group__XBT__queue.html  23050
+./doc/simgrid/html/group__XBT__fifo__cons.html  9876
+./doc/simgrid/html/structsurf__model.html  17707
+./doc/simgrid/html/MSG_ex_asynchronous_communications.html  43212
+./doc/simgrid/html/Paje_MSG_screenshot_thn.jpg  30326
+./doc/simgrid/html/structsurf__network__model__extension__public.html  2783
+./doc/simgrid/html/structsurf__model__description.html 2621
+./doc/simgrid/html/group__m__host__management.html 19042
+./doc/simgrid/html/group__XBT__fifo__perl.html  14045
+./doc/simgrid/html/modules.html  12734
+./doc/simgrid/html/annotated.html  7707
+./doc/simgrid/html/group__XBT__fifo.html  6191
+./doc/simgrid/html/group__XBT__parmap.html  3765
+./doc/simgrid/html/tracing.html  58483
+./doc/simgrid/html/structs__surf__metric__t.html 2523
+./doc/simgrid/html/classsimgrid_1_1msg_1_1Task.html 1519
+./doc/simgrid/html/group__XBT__swag.html  5923
+./doc/simgrid/html/functions_vars.html  11436
+./doc/simgrid/html/group__XBT__swag__type.html  8194
+./doc/simgrid/html/win_install_02.png  60084
+./doc/simgrid/html/simgrid_modules.png  8309
+./doc/simgrid/html/group__XBT__error.html  8348
+./doc/simgrid/html/group__XBT__dynar__cons.html 15743
+./doc/simgrid/html/simgrid_logo.png  21536
+./doc/simgrid/html/group__XBT__fifo__misc.html  7717
+./doc/simgrid/html/group__XBT__context.html  3460
+./doc/simgrid/html/group__m__channel__management.html 8963
+./doc/simgrid/html/structm__task.html  4188
+./doc/simgrid/html/group__XBT__swag__curs.html  8561
+./doc/simgrid/html/group__XBT__log.html  60965
+./doc/simgrid/html/open.png 118
+./doc/simgrid/html/group__msg__simulation.html  9008
+./doc/simgrid/html/group__XBT__dynar__cursor.html 11976
+./doc/simgrid/html/group__XBT__log__cats.html  5102
+./doc/simgrid/html/win_install_03.png  55802
+./doc/simgrid/html/poster_thumbnail.png  3249
+./doc/simgrid/html/group__m__datatypes__management__details.html  7557
+./doc/simgrid/html/group__XBT__set__basic.html  24314
+./doc/simgrid/html/win_install_01.png  61053
+./doc/simgrid/html/closed.png 126
+./doc/simgrid/html/group__XBT__adt.html  6958
+./doc/simgrid/html/index.html 9659
+./doc/simgrid/html/group__SD__link__management.html 17867
+./doc/simgrid/html/group__MSG__JAVA.html  5443
+./doc/simgrid/html/group__SURF__simulation.html 10385
+./doc/simgrid/html/structm__host.html  4188
+./doc/simgrid/html/group__XBT__dynar__array.html 22436
+./doc/simgrid/html/simgrid.css 386
+./doc/simgrid/html/group__SD__task__dependency__management.html  15389
+./doc/simgrid/html/group__XBT__grounding.html  7225
+./doc/simgrid/html/pls.html 11863
+./doc/simgrid/html/group__XBT__dynar__ctn.html  12693
+./doc/simgrid/html/functions.html  11564
+./doc/simgrid/html/group__XBT__dynar__speed.html 9616
+./doc/simgrid/html/installSimgrid.html  24837
+./doc/simgrid/html/triva-graph_configuration.png 59769
+./doc/simgrid/html/triva-graph_visualization.png 55335
+./doc/simgrid/html/MSG_ex_master_slave.html  51294
+./doc/simgrid/html/doxygen.png 3942
+./doc/simgrid/html/group__XBT__mallocator__cons.html 10757
+./doc/simgrid/html/group__API__index.html 125324   
+./doc/simgrid/html/group__XBT__dict__cons.html  9746
+./doc/simgrid/html/group__XBT__swag__func.html  19885
+./doc/simgrid/html/group__SimGrid__API.html  4674
+./doc/simgrid/html/group__XBT__dynar__misc.html 9591
+./doc/simgrid/html/structxbt__set__elm__.html  5121
+./doc/simgrid/html/group__XBT__cfg__get.html  19320
+./doc/simgrid/html/bindings.html  23685
+./doc/simgrid/html/group__XBT__dict.html  6916
+./doc/simgrid/html/use.html 3904
+./doc/simgrid/html/group__XBT__dict__basic.html 20935
+./doc/simgrid/html/group__XBT__graph.html  23682
+./doc/simgrid/html/group__XBT__mallocator.html  6444
+./doc/simgrid/html/structsurf__workstation__model__extension__public.html 11076
+./doc/simgrid/html/publis.html 435
+./doc/simgrid/html/group__XBT__misc.html  4663
+./doc/simgrid/html/simdag.html 226
+./doc/simgrid/html/Paje_MSG_screenshot.jpg 340759   
+./doc/simgrid/html/group__msg__gos__functions.html 65293
+./doc/simgrid/html/classsimgrid_1_1msg_1_1Host.html 1519
+./doc/simgrid/html/publis_extern.html  435
+./doc/simgrid/html/group__MSG__LUA.html  5094
+./doc/simgrid/html/group__XBT__dynar.html  14081
+./doc/simgrid/html/structs__model__type.html  2480
+./doc/simgrid/html/group__XBT__synchro.html  19296
+./doc/simgrid/html/bc_s.png 677
+./doc/simgrid/html/classes.html  6934
+./doc/simgrid/html/group__XBT__fifo__direct.html 29778
+./doc/simgrid/html/group__XBT__cfg__use.html  37757
+./doc/simgrid/html/group__XBT__mallocator__objects.html  9306
+./doc/simgrid/html/classsimgrid_1_1msg_1_1Process.html 1519
+./doc/simgrid/html/group__XBT__dict__multi.html 18525
+./doc/simgrid/html/group__m__datatypes__management.html  16459
+./doc/simgrid/html/tab_b.png 178
+./doc/simgrid/html/group__SD__simulation.html  45009
+./doc/simgrid/html/group__msg__easier__life.html 50885
+./doc/simgrid/html/group__m__task__management.html 35307
+./doc/simgrid/html/tab_a.png 140
+./doc/simgrid/html/group__XBT__config.html  16354
+./doc/simgrid/html/options.html  7629
+./doc/simgrid/html/group__XBT__dict__nnul.html  18891
+./doc/simgrid/html/win_install_04.png  52033
+./doc/simgrid/html/structsurf__action.html  8353
+./doc/simgrid/html/group__XBT__ex.html  32537
+./doc/simgrid/html/group__SURF__API.html  6659
+./doc/simgrid/html/doxygen.css 12350
+./doc/simgrid/html/group__XBT__set__cons.html  7965
+./doc/simgrid/html/group__SURF__build__api.html 7821
+./doc/simgrid/html/group__m__process__management.html 47169
+./doc/simgrid/html/group__XBT__dict__curs.html  19747
+./doc/simgrid/html/group__SD__datatypes__management.html  20816
+./doc/simgrid/html/group__SD__API.html  8379
+./doc/simgrid/html/group__SMPI__API.html  4776
+./doc/simgrid/html/group__XBT__dynar__perl.html 12131
+./doc/simgrid/html/group__XBT__cfg__register.html 15874
+./doc/simgrid/html/publis_core.html  435
+./doc/simgrid/html/group__SD__workstation__management.html  46397
+./doc/simgrid/html/MSG_ex_master_slave_lua.html 4794
+./doc/simgrid/html/group__MSG__API.html  6026
+./doc/simgrid/html/msg.html 227
+./doc/simgrid/html/group__SD__task__management.html 60347
+./doc/simgrid/html/group__XBT__syscall.html  10095
+./doc/simgrid/html/group__XBT__heap.html  18482
+./doc/simgrid/html/structsurf__action__state.html 7301
+./doc/simgrid/html/tab_s.png 189
+./doc/simgrid/html/tab_h.png 192
+./doc/simgrid/html/nav_h.png  97  
+./include/smpi/mpif.h  4826
+./include/smpi/smpif.h  1139
+./include/smpi/mpi.h  510
+./include/smpi/smpi_cocci.h 3187
+./include/smpi/smpi.h  24101
+./include/xbt/fifo.h  3626
+./include/xbt/dict.h  7459
+./include/xbt/str.h  2111
+./include/xbt/log.h  25433
+./include/xbt/misc.h  8031
+./include/xbt/synchro_core.h 4477
+./include/xbt/mmalloc.h 1976
+./include/xbt/replay_trace_reader.h  917
+./include/xbt/function_types.h  1111
+./include/xbt/strbuff.h  1281
+./include/xbt/virtu.h  684
+./include/xbt/asserts.h  1871
+./include/xbt/ex.h  23255
+./include/xbt/graph.h  5668
+./include/xbt/graphxml.h  5474
+./include/xbt/queue.h  2252
+./include/xbt/matrix.h  3027
+./include/xbt/setset.h  2422
+./include/xbt/time.h  743
+./include/xbt/lib.h  2014
+./include/xbt/hash.h  1064
+./include/xbt/set.h  4383
+./include/xbt/config.h  9224
+./include/xbt/sysdep.h  4941
+./include/xbt/swag.h  5352
+./include/xbt/graphxml_parse.h  1926
+./include/xbt/peer.h  870
+./include/xbt/module.h  648
+./include/xbt/cunit.h  5523
+./include/xbt/parmap.h  1166
+./include/xbt/mallocator.h  2296
+./include/xbt/dynar.h  9553
+./include/xbt/heap.h  1444
+./include/xbt.h  876
+./include/msg/datatypes.h 4635
+./include/msg/msg.h  12038
+./include/simgrid_config.h 3641
+./include/mc/modelchecker.h  96
+./include/surf/simgrid_dtd.h  23583
+./include/surf/surf_routing.h  1167
+./include/surf/surfxml_parse.h  5343
+./include/instr/instr.h  5750
+./include/simdag/simdag.h  10325
+./include/simdag/datatypes.h  3715
+./include/simix/simix.h  13003
+./include/simix/datatypes.h  3346
+./include/simix/context.h  4040
+./lib/libsimgrid.so.3.6.2  12710497
+./bin/smpicc  918
+./bin/smpirun  7292
+./bin/smpif2c  1990
+./bin/simgrid_update_xml  5018
+./bin/graphicator  66986
+./bin/simgrid-colorizer  2993
+./bin/smpiff  820
+./bin/tesh  356434
diff --git a/examples/platforms/content/win_storage_content.txt b/examples/platforms/content/win_storage_content.txt
new file mode 100644 (file)
index 0000000..cf109af
--- /dev/null
@@ -0,0 +1,36 @@
+.\Windows\avastSS.scr 41664\r
+.\Windows\bfsvc.exe 75264\r
+.\Windows\bootstat.dat 67584\r
+.\Windows\CoreSingleLanguage.xml 31497\r
+.\Windows\csup.txt 12\r
+.\Windows\dchcfg64.exe 335464\r
+.\Windows\dcmdev64.exe 93288\r
+.\Windows\DirectX.log 10486\r
+.\Windows\DPINST.LOG 18944\r
+.\Windows\DtcInstall.log 1955\r
+.\Windows\explorer.exe 2380944\r
+.\Windows\font1.sii 4907\r
+.\Windows\font2.sii 8698\r
+.\Windows\hapint.exe 382056\r
+.\Windows\HelpPane.exe 883712\r
+.\Windows\hh.exe 17408\r
+.\Windows\MEMORY.DMP 2384027342\r
+.\Windows\mib.bin 43131\r
+.\Windows\notepad.exe 243712\r
+.\Windows\PFRO.log 6770\r
+.\Windows\Professional.xml 31881\r
+.\Windows\regedit.exe 159232\r
+.\Windows\setupact.log 101663\r
+.\Windows\setuperr.log 0\r
+.\Windows\splwow64.exe 126464\r
+.\Windows\Starter.xml 31537\r
+.\Windows\system.ini 219\r
+.\Windows\twain_32.dll 50176\r
+.\Windows\vmgcoinstall.log 1585\r
+.\Windows\win.ini 92\r
+.\Windows\WindowsUpdate.log 1518934\r
+.\Windows\winhlp32.exe 10752\r
+.\Windows\WLXPGSS.SCR 322048\r
+.\Windows\WMSysPr9.prx 316640\r
+.\Windows\write.exe 10752\r
+.\Windows\_isusr32.dll 180320
\ No newline at end of file
index 69516b8..84310bd 100644 (file)
@@ -4,48 +4,47 @@
 <platform version="3">
 
 <config>
-       <prop id="path" value="../examples/platforms/"/>
+  <prop id="path" value="../examples/platforms/"/>
 </config>
 
-       <AS id="AS0" routing="Full">
-
-               <storage_type id="samsung" model="RAID5" content="content/storage_content.txt" size="500">
-                       <prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
-                       <prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
-                       <prop id="Bconnection" value="150000000" /> <!-- 150Mo/s -->
-               </storage_type>
-
-               <storage_type id="crucial" model="SSD" content="content/storage_content.txt" size="500">
-                       <prop id="Bwrite" value="30000000" />
-                       <prop id="Bread" value="100000000" />
-                       <prop id="Bconnection" value="150000000" />
-               </storage_type>
-
-               <storage_type id="wdigital" model="RAID0" content="content/storage_content.txt" size="500">
-                       <prop id="Bwrite" value="30000000" />
-                       <prop id="Bread" value="100000000" />
-                       <prop id="Bconnection" value="150000000" />
+  <AS id="AS0" routing="Full">
+
+   <storage_type id="single_HDD" model="linear_no_lat" 
+                 content="content/storage_content.txt" size="500GiB"
+                 content_type="txt_unix">
+                       <prop id="Bwrite" value="30MBps" />
+                       <prop id="Bread" value="100MBps" />
+                       <prop id="Bconnection" value="150MBps" />
+   </storage_type>
+
+   <storage_type id="single_SSD" model="linear_no_lat"
+                 content="content/storage_content.txt" size="500GiB">
+                       <prop id="Bwrite" value="30MBps" />
+                       <prop id="Bread" value="100MBps" />
+                       <prop id="Bconnection" value="150MBps" />
                </storage_type>
 
-               <storage id="Disk1" typeId="crucial"/>
-               <storage id="Disk2" typeId="samsung"/>
-               <storage id="Disk3" typeId="wdigital"/>
-               <storage id="Disk4" typeId="wdigital"/>
+               <storage id="Disk1" typeId="single_HDD"/>
+               <storage id="Disk2" typeId="single_SSD"/>
+               <storage id="Disk3" typeId="single_HDD"
+                         content="content/storage_content.txt" 
+                        content_type="txt_unix"/>
+               <storage id="Disk4" typeId="single_SSD"/>
 
                <host id="bob" power="1Gf">
-                       <mount id="Disk1" name="/home"/>                        
+                       <mount storageId="Disk1" name="/home"/>                 
                </host>         
                
                <host id="alice" power="1Gf">
-                       <mount id="Disk2" name="/home"/>
+                       <mount storageId="Disk2" name="/home"/>
                </host>
 
                <host id="carl" power="1Gf">            
-                       <mount id="Disk3" name="/home"/>                
+                       <mount storageId="Disk3" name="/home"/>         
                </host>
                
                <host id="denise" power="1Gf">
-                       <mount id="Disk4" name="/home"/>        
+                       <mount storageId="Disk4" name="/home"/> 
                </host>
 
                <link id="link1" bandwidth="125MBps" latency="50us" />
index d83759d..ca08d59 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 5e2fbee..7036db3 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 563f250..84ea68a 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index d8538c4..1f97463 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 452860b..b017adf 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 01dca86..85a2946 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index ec69031..d91a819 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 38c266a..2d50368 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 82027ad..45952fc 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 3b9da53..a3cd4ff 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index aba2c71..15779c9 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Master of a basic master/slave example in Java
  *
- * Copyright 2006-2012 The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 473c21a..8f6a102 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index 0799457..cc1e531 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2006-2012. The SimGrid Team. All rights reserved. 
+ * Copyright (c) 2006-2013. 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. 
index f27ba96..99ec01e 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DAX file.                                   */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
     XBT_ERROR("A problem occurred during DAX parsing (cycle or syntax). Do not continue this test");
     free(tracefilename);
     SD_exit();
-    return -1;
+    exit(255);
   }
 
   /* Display all the tasks */
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
     SD_task_destroy(task);
   }
   fclose(out);
-
+  xbt_dynar_free_container(&dax);
   /* exit */
   SD_exit();
   return 0;
index 05eb34f..e586334 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,6 +32,18 @@ int main(int argc, char **argv)
     XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
     exit(1);
   }
+
+  /* creation of the environment */
+  SD_create_environment(argv[1]);
+
+  /* load the DOT file */
+  dot = SD_dotload(argv[2]);
+  if(dot == NULL){
+    XBT_CRITICAL("No dot loaded. Do you have a cycle in your graph?");
+    SD_exit();
+    exit(2);
+  }
+
   char *tracefilename;
   if (argc == 3) {
     char *last = strrchr(argv[2], '.');
@@ -44,16 +56,6 @@ int main(int argc, char **argv)
     tracefilename = xbt_strdup(argv[3]);
   }
 
-  /* creation of the environment */
-  SD_create_environment(argv[1]);
-
-  /* load the DOT file */
-  dot = SD_dotload(argv[2]);
-  if(dot == NULL){
-    SD_exit();
-    xbt_die("No dot load may be you have a cycle in your graph");
-  }
-
   /* Display all the tasks */
   XBT_INFO
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
index c2457f2..ea5a4c7 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3643f2b..880fe56 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,6 +32,18 @@ int main(int argc, char **argv)
     XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
     exit(1);
   }
+
+  /* creation of the environment */
+  SD_create_environment(argv[1]);
+
+  /* load the DOT file  and schedule tasks */
+  dot = SD_dotload_with_sched(argv[2]);
+  if(!dot){
+    XBT_CRITICAL("The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose");
+    SD_exit();
+    exit(2);
+  }
+
   char *tracefilename;
   if (argc == 3) {
     char *last = strrchr(argv[2], '.');
@@ -44,16 +56,6 @@ int main(int argc, char **argv)
     tracefilename = xbt_strdup(argv[3]);
   }
 
-  /* creation of the environment */
-  SD_create_environment(argv[1]);
-
-  /* load the DOT file  and schedule tasks */
-  dot = SD_dotload_with_sched(argv[2]);
-  if(!dot){
-    SD_exit();
-    xbt_die("The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose");
-  }
-
   /* Display all the tasks */
   XBT_INFO
   ("------------------- Display all tasks of the loaded DAG ---------------------------");
@@ -106,6 +108,7 @@ int main(int argc, char **argv)
     SD_task_destroy(task);
   }
   fclose(out);
+  xbt_dynar_free_container(&dot);
 
   /* exit */
   SD_exit();
index 7bbed3d..d62188c 100644 (file)
@@ -233,7 +233,7 @@ $ cat ${srcdir:=.}/dag.trace
 
 $ rm -f dag.trace
 
-! expect signal SIGABRT
+! expect return 2
 $ $SG_TEST_EXENV ./simulate_dot --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_bad_schedule.dot
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task end is not correctly scheduled
@@ -242,7 +242,7 @@ $ $SG_TEST_EXENV ./simulate_dot --log=no_loc  "--log=sd_dotparse.thres:verbose"
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task 3 is not correctly scheduled
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, the task root is not correctly scheduled
 > [0.000000] [sd_dotparse/WARNING] The scheduling is ignored
-> [0.000000] [xbt/CRITICAL] The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose
+> [0.000000] [test/CRITICAL] The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose
 
 $ $SG_TEST_EXENV ./simulate_dot --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_good_schedule.dot
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
@@ -491,7 +491,7 @@ $ cat ${srcdir:=.}/dag_with_good_schedule.trace
 
 $ rm -f ${srcdir:=.}/dag_with_good_schedule.trace
 
-! expect signal SIGABRT
+! expect return 2
 $ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_cycle.dot
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
 > [0.000000] [sd_daxparse/WARNING] the task root is not marked
@@ -503,4 +503,4 @@ $ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:
 > [0.000000] [sd_daxparse/WARNING] the task 5 is in a cycle
 > [0.000000] [sd_daxparse/WARNING] the task 6 is in a cycle
 > [0.000000] [sd_dotparse/ERROR] The DOT described in dag_with_cycle.dot is not a DAG. It contains a cycle.
-> [0.000000] [xbt/CRITICAL] No dot load may be you have a cycle in your graph
+> [0.000000] [test/CRITICAL] No dot loaded. Do you have a cycle in your graph?
\ No newline at end of file
index 299c0b5..3991256 100644 (file)
@@ -4,7 +4,8 @@
  *  GOAL files as an input, thus the file name. But there is no actual link
  *  to the GOAL formalism beside of this.
  * 
- * Copyright (c) 2011. The SimGrid Team. All rights reserved.
+ * Copyright (c) 2011-2013. 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.
@@ -98,7 +99,7 @@ int main(int argc, char **argv) {
     done=SD_simulate(-1);
   } while(!xbt_dynar_is_empty(done));
   xbt_os_cputimer_stop(timer);
-  printf("exec_time:%lf\n", xbt_os_timer_elapsed(timer) );
+  printf("exec_time:%f\n", xbt_os_timer_elapsed(timer) );
 
   xbt_dynar_free(&done);
   xbt_dynar_free(&reclaimed);
diff --git a/examples/simdag/io/CMakeLists.txt b/examples/simdag/io/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6288f7f
--- /dev/null
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(sd_io sd_io.c)
+
+### Add definitions for compile
+if(NOT WIN32)
+  target_link_libraries(sd_io simgrid pthread m)
+else()
+  target_link_libraries(sd_io simgrid)
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/io.tesh
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/sd_io.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  PARENT_SCOPE
+  )
diff --git a/examples/simdag/io/io.tesh b/examples/simdag/io/io.tesh
new file mode 100644 (file)
index 0000000..201b147
--- /dev/null
@@ -0,0 +1,7 @@
+#! ./tesh
+
+$ ${bindir:=.}/io/sd_io ${srcdir:=.}/examples/platforms/storage.xml 
+> [0.000000] [sd_io/INFO] Workstation 'denise' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'alice' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'carl' mounts '/home'
+> [0.000000] [sd_io/INFO] Workstation 'bob' mounts '/home'
diff --git a/examples/simdag/io/sd_io.c b/examples/simdag/io/sd_io.c
new file mode 100644 (file)
index 0000000..5d30703
--- /dev/null
@@ -0,0 +1,43 @@
+/* Copyright (c) 2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "simdag/simdag.h"
+#include "xbt/ex.h"
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(sd_io,
+                             "Logging specific to this SimDag example");
+int main(int argc, char **argv)
+{
+  unsigned int ctr;
+  const SD_workstation_t *workstations;
+  int total_nworkstations;
+  xbt_dict_t current_storage_list;
+  char *mount_name;
+  char *storage_name;
+  xbt_dict_cursor_t cursor = NULL;
+
+  SD_init(&argc, argv);
+  /* Set the workstation model to default, as storage is not supported by the
+   * ptask_L07 model yet.
+   */
+  SD_config("workstation/model", "default");
+  SD_create_environment(argv[1]);
+  workstations = SD_workstation_get_list();
+  total_nworkstations = SD_workstation_get_number();
+
+  for (ctr=0; ctr<total_nworkstations;ctr++){
+    current_storage_list = SD_workstation_get_storage_list(workstations[ctr]);
+    xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name)
+      XBT_INFO("Workstation '%s' mounts '%s'",
+         SD_workstation_get_name(workstations[ctr]), mount_name);
+    xbt_dict_free(&current_storage_list);
+  }
+  SD_exit();
+  return 0;
+}
index a03e902..17947d7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 67c3951..88bfb7d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4131089..97947d0 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test to schedule a DAX file with the Min-Min algorithm.           */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 00d1aef..4e75195 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4a354ae..1364f6e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3ef49ee..0338b0a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 75ab65c..a35b80a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index becdeef..bd98080 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index acab4c8..3eff0d3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b8ccbfa..f262166 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0cdc430..737f84a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 669d3e3..154b3d5 100644 (file)
@@ -10,22 +10,29 @@ if(enable_smpi)
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
 
   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mc/")
 
 
   add_executable(bcbench bcbench.c)
   add_executable(mvmul mvmul.c)
   add_executable(smpi_traced tracing/smpi_traced.c)
   add_executable(smpi_traced_simple tracing/smpi_traced_simple.c)
-  add_executable(mc_bugged1 mc_bugged1.c)
-  add_executable(mc_bugged2 mc_bugged2.c)
   add_executable(smpi_replay replay/replay.c)
-
+  
+  if(HAVE_MC)
+    add_executable(mc/bugged1 mc/bugged1.c)
+    add_executable(mc/bugged2 mc/bugged2.c)
+    add_executable(mc/bugged1_liveness mc/bugged1_liveness.c)
+  
+    target_link_libraries(mc/bugged1 simgrid)
+    target_link_libraries(mc/bugged2 simgrid)
+    target_link_libraries(mc/bugged1_liveness simgrid)
+  endif()
+  
   target_link_libraries(bcbench simgrid)
   target_link_libraries(mvmul simgrid)
   target_link_libraries(smpi_traced simgrid)
   target_link_libraries(smpi_traced_simple simgrid)
-  target_link_libraries(mc_bugged1 simgrid)
-  target_link_libraries(mc_bugged2 simgrid)
   target_link_libraries(smpi_replay simgrid)
 
 endif()
@@ -43,18 +50,23 @@ set(xml_files
   )
 set(examples_src
   ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc_bugged2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/mc_bugged1.c
   ${CMAKE_CURRENT_SOURCE_DIR}/mvmul.c
   ${CMAKE_CURRENT_SOURCE_DIR}/bcbench.c
   ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.c
   ${CMAKE_CURRENT_SOURCE_DIR}/tracing/smpi_traced.c
   ${CMAKE_CURRENT_SOURCE_DIR}/tracing/smpi_traced_simple.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged1.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/bugged1_liveness.c
   PARENT_SCOPE
   )
 set(bin_files
   ${bin_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/promela_bugged1_liveness
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1_liveness
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged1
+  ${CMAKE_CURRENT_SOURCE_DIR}/mc/hostfile_bugged2
   PARENT_SCOPE
   )
 set(txt_files
index bf3c9bb..c83548e 100644 (file)
@@ -240,8 +240,8 @@ double two_dot_five(
   end_time = MPI_Wtime();
   time = end_time - start_time;
   double reduce_time = end_time_reduce - start_time_reduce;
-  printf("communication time: %le reduce time: %le seconds, "
-         "total time: %le seconds\n",communication_time,reduce_time,time);
+  printf("communication time: %e reduce time: %e seconds, "
+         "total time: %e seconds\n",communication_time,reduce_time,time);
   MPI_Barrier(my_world);
 
 #if CHECK_25D
index 0d0bab9..a53ac43 100644 (file)
@@ -152,8 +152,8 @@ inline double Summa(
 
   end_time = MPI_Wtime();
   time = end_time - start_time ;
-  printf("communication time: %le seconds, "
-         "computation time: %le seconds\n",
+  printf("communication time: %e seconds, "
+         "computation time: %e seconds\n",
          communication_time, computation_time);
 
 
index 5c524d8..2cc9b7c 100644 (file)
@@ -1 +1 @@
-../../../bin/smpirun --cfg=smpi/running_power:2.1175E9 -np 2 -platform ../../platforms/cluster.xml  -hostfile host ./MM_mpi
+../../../smpi_script/bin/smpirun --cfg=smpi/running_power:2.1175E9 -np 2 -platform ../../platforms/cluster.xml  -hostfile host ./MM_mpi
index 04b0c1b..940c1b9 100644 (file)
     fprintf(stdout,"CPU Time=%d\n",tm);
     fprintf(stdout,"N = 2^%d\n",m);
     fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Sum = %f %ld\n",sx,sy);
     fprintf(stdout,"Count:");
     for(i = 0; i < nq; i++) {
       fprintf(stdout,"%d\t %ld\n",i,q[i]);
             fprintf(stdout,"Class           = %s\n", _class);
     fprintf(stdout,"Size            = %s\n", size);
     fprintf(stdout,"Iteration       = %d\n", nit);
-    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Time in seconds = %f\n",(tm/1000));
     fprintf(stdout,"Total processes = %d\n",no_nodes);
-    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Mops/s total    = %f\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %f\n", Mops/no_nodes);
     fprintf(stdout,"Operation type  = Random number generated\n");
     if(verified) {
       fprintf(stdout,"Verification    = SUCCESSFUL\n");
     } else {
       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
     }
-             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+             fprintf(stdout,"Total time:     %f\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000));
          }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
index 4c5f5a7..86aba7a 100644 (file)
     fprintf(stdout,"CPU Time=%d\n",tm);
     fprintf(stdout,"N = 2^%d\n",m);
     fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Sum = %f %ld\n",sx,sy);
     fprintf(stdout,"Count:");
     for(i = 0; i < nq; i++) {
       fprintf(stdout,"%d\t %ld\n",i,q[i]);
             fprintf(stdout,"Class           = %s\n", _class);
     fprintf(stdout,"Size            = %s\n", size);
     fprintf(stdout,"Iteration       = %d\n", nit);
-    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Time in seconds = %f\n",(tm/1000));
     fprintf(stdout,"Total processes = %d\n",no_nodes);
-    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Mops/s total    = %f\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %f\n", Mops/no_nodes);
     fprintf(stdout,"Operation type  = Random number generated\n");
     if(verified) {
       fprintf(stdout,"Verification    = SUCCESSFUL\n");
     } else {
       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
     }
-             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+             fprintf(stdout,"Total time:     %f\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000));
          }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
index 9c18da4..961422a 100644 (file)
     fprintf(stdout,"CPU Time=%d\n",tm);
     fprintf(stdout,"N = 2^%d\n",m);
     fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
-    fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+    fprintf(stdout,"Sum = %f %ld\n",sx,sy);
     fprintf(stdout,"Count:");
     for(i = 0; i < nq; i++) {
       fprintf(stdout,"%d\t %ld\n",i,q[i]);
             fprintf(stdout,"Class           = %s\n", _class);
     fprintf(stdout,"Size            = %s\n", size);
     fprintf(stdout,"Iteration       = %d\n", nit);
-    fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+    fprintf(stdout,"Time in seconds = %f\n",(tm/1000));
     fprintf(stdout,"Total processes = %d\n",no_nodes);
-    fprintf(stdout,"Mops/s total    = %lf\n",Mops);
-    fprintf(stdout,"Mops/s/process  = %lf\n", Mops/no_nodes);
+    fprintf(stdout,"Mops/s total    = %f\n",Mops);
+    fprintf(stdout,"Mops/s/process  = %f\n", Mops/no_nodes);
     fprintf(stdout,"Operation type  = Random number generated\n");
     if(verified) {
       fprintf(stdout,"Verification    = SUCCESSFUL\n");
     } else {
       fprintf(stdout,"Verification    = UNSUCCESSFUL\n");
     }
-             fprintf(stdout,"Total time:     %lf\n",(timer_read(1,elapsed)/1000));
-             fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
-             fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+             fprintf(stdout,"Total time:     %f\n",(timer_read(1,elapsed)/1000));
+             fprintf(stdout,"Gaussian pairs: %f\n",(timer_read(2,elapsed)/1000));
+             fprintf(stdout,"Random numbers: %f\n",(timer_read(3,elapsed)/1000));
          }
 #ifdef USE_MPE
     MPE_Finish_log(argv[0]);
index 5cd2f64..3ae635e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
similarity index 91%
rename from examples/smpi/mc_bugged1.c
rename to examples/smpi/mc/bugged1.c
index 699d293..7047aff 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple bugged MPI_ISend and MPI_IRecv test */
 
-/* Copyright (c) 2009, 2011. The SimGrid Team.
+/* Copyright (c) 2009, 2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -40,9 +40,9 @@ int main(int argc, char **argv)
     }
 
     printf("recv_buff = %d\n", recv_buff);
-#ifdef HAVE_MC
-    MC_assert(recv_buff == size - 1);
-#endif
+    //#ifdef HAVE_MC
+    //MC_assert(recv_buff == size - 1);
+    //#endif
 
   }else{
     MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
diff --git a/examples/smpi/mc/bugged1_liveness.c b/examples/smpi/mc/bugged1_liveness.c
new file mode 100644 (file)
index 0000000..eab2b55
--- /dev/null
@@ -0,0 +1,107 @@
+/***************** Centralized Mutual Exclusion Algorithm *********************/
+/* This example implements a centralized mutual exclusion algorithm.          */
+/* Bug : CS requests of process 1 not satisfied                                      */
+/* LTL property checked : G(r->F(cs)); (r=request of CS, cs=CS ok)            */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <mpi.h>
+#include <simgrid/modelchecker.h>
+
+#define GRANT_TAG 0
+#define REQUEST_TAG 1
+#define RELEASE_TAG 2
+
+int r, cs;
+
+static int predR(){
+  return r;
+}
+
+static int predCS(){
+  return cs;
+}
+
+
+int main(int argc, char **argv){
+
+  int err, size, rank;
+  int recv_buff;
+  MPI_Status status;
+  int CS_used = 0;
+  xbt_dynar_t requests = xbt_dynar_new(sizeof(int), NULL);
+  
+  /* Initialize MPI */
+  err = MPI_Init(&argc, &argv);
+  if(err !=  MPI_SUCCESS){
+    printf("MPI initialization failed !\n");
+    exit(1);
+  }
+
+  MC_automaton_new_propositional_symbol("r", &predR);
+  MC_automaton_new_propositional_symbol("cs", &predCS);
+
+  MC_ignore(&(status.count), sizeof(status.count));
+
+  /* Get number of processes */
+  err = MPI_Comm_size(MPI_COMM_WORLD, &size);
+  /* Get id of this process */
+  err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+  if(rank == 0){ /* Coordinator */
+    while(1){
+      MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+      if(status.MPI_TAG == REQUEST_TAG){
+        if(CS_used){
+          printf("CS already used.\n");
+          xbt_dynar_push(requests, &recv_buff);
+        }else{
+          if(recv_buff != 1){
+            printf("CS idle. Grant immediatly.\n");
+            MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
+            CS_used = 1;
+          }
+        }
+      }else{
+        if(!xbt_dynar_is_empty(requests)){
+          printf("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
+          xbt_dynar_shift(requests, &recv_buff);
+          if(recv_buff != 1){
+            MPI_Send(&rank, 1, MPI_INT, recv_buff, GRANT_TAG, MPI_COMM_WORLD);
+            CS_used = 1;
+          }else{
+            xbt_dynar_push(requests, &recv_buff);
+            CS_used = 0;
+          }
+        }else{
+          printf("CS release. Resource now idle.\n");
+          CS_used = 0;
+        }
+      }
+    }
+  }else{ /* Client */
+    while(1){
+      printf("%d asks the request.\n", rank);
+      MPI_Send(&rank, 1, MPI_INT, 0, REQUEST_TAG, MPI_COMM_WORLD);
+      if(rank == 1){
+        r = 1;
+        cs = 0;
+      }
+      MPI_Recv(&recv_buff, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+      if(status.MPI_TAG == GRANT_TAG && rank == 1){
+        cs = 1;
+        r = 0;
+      }
+      printf("%d got the answer. Release it.\n", rank);
+      MPI_Send(&rank, 1, MPI_INT, 0, RELEASE_TAG, MPI_COMM_WORLD);
+      if(rank == 1){
+        r = 0;
+        cs = 0;
+      }
+    }
+  }
+
+  MPI_Finalize();
+
+  return 0;
+}
similarity index 96%
rename from examples/smpi/mc_bugged2.c
rename to examples/smpi/mc/bugged2.c
index 479b147..fdd691c 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple bugged MPI_ISend and MPI_IRecv test */
 
-/* Copyright (c) 2009, 2011. The SimGrid Team.
+/* Copyright (c) 2009, 2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/examples/smpi/mc/hostfile_bugged1 b/examples/smpi/mc/hostfile_bugged1
new file mode 100644 (file)
index 0000000..b6d1c07
--- /dev/null
@@ -0,0 +1,3 @@
+c-1.me
+c-2.me
+c-3.me
diff --git a/examples/smpi/mc/hostfile_bugged1_liveness b/examples/smpi/mc/hostfile_bugged1_liveness
new file mode 100644 (file)
index 0000000..b6d1c07
--- /dev/null
@@ -0,0 +1,3 @@
+c-1.me
+c-2.me
+c-3.me
diff --git a/examples/smpi/mc/hostfile_bugged2 b/examples/smpi/mc/hostfile_bugged2
new file mode 100644 (file)
index 0000000..7c988f8
--- /dev/null
@@ -0,0 +1,36 @@
+c-1.me
+c-2.me
+c-3.me
+c-4.me
+c-5.me
+c-6.me
+c-7.me
+c-8.me
+c-9.me
+c-10.me
+c-11.me
+c-12.me
+c-13.me
+c-14.me
+c-15.me
+c-16.me
+c-17.me
+c-18.me
+c-19.me
+c-20.me
+c-21.me
+c-22.me
+c-23.me
+c-24.me
+c-25.me
+c-26.me
+c-27.me
+c-28.me
+c-29.me
+c-30.me
+c-31.me
+c-32.me
+c-33.me
+c-34.me
+c-35.me
+c-36.me
diff --git a/examples/smpi/mc/promela_bugged1_liveness b/examples/smpi/mc/promela_bugged1_liveness
new file mode 100644 (file)
index 0000000..96b491d
--- /dev/null
@@ -0,0 +1,11 @@
+never { /* !G(r->Fcs) */
+T0_init :    /* init */
+       if
+       :: (1) -> goto T0_init
+       :: (!cs && r) -> goto accept_S2
+       fi;
+accept_S2 :    /* 1 */
+       if
+       :: (!cs) -> goto accept_S2
+       fi;
+}
index a328121..cacc0da 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 20092010. The SimGrid Team.
+/* Copyright (c) 2009-2010. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f0c0e58..d5d4024 100644 (file)
@@ -3,10 +3,10 @@
 2 init
 3 init
 
-0 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-1 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-2 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 0 0
-3 allGatherV 204020 275427 275427 275427 204020 0 275427 550854 826281 0 0
+0 allGatherV 275427 275427 275427 275427 204020 0 0
+1 allGatherV 275427 275427 275427 275427 204020 0 0
+2 allGatherV 275427 275427 275427 275427 204020 0 0
+3 allGatherV 204020 275427 275427 275427 204020 0 0
 
 0 finalize
 1 finalize
index cd4f95c..a96f7b7 100644 (file)
@@ -2,10 +2,9 @@
 1 init
 2 init
 
-0 allToAllV 100 1 40 30 1 20 150 1000 1 80 100 1 20 110
-1 allToAllV 1000 80 1 40 1 100 160 1000 40 1 30 10 70 140
-2 allToAllV 1000 100 30 1 1 120 150 1000 30 40 1 1 50 60
-
+0 allToAllV 100 1 40 30 1000 1 80 100
+1 allToAllV 1000 80 1 40 1000 40 1 30
+2 allToAllV 1000 100 30 1 1000 30 40 1
 
 0 finalize
 1 finalize
index f508f9d..4880da3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011, 2012. The SimGrid Team.
+/* Copyright (c) 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8bbb07c..94681e7 100644 (file)
@@ -6,8 +6,9 @@ p Test of trace replay with SMPI (one trace for all processes)
 
 < replay/actions_bcast.txt
 $ mkfile replay/one_trace
+! timeout 60
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -37,7 +38,7 @@ p The same with tracing activated
 < replay/actions_bcast.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc  --cfg=tracing:1 --cfg=tracing/smpi:1 --cfg=tracing/smpi/computing:1 --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc  --cfg=tracing:1 --cfg=tracing/smpi:1 --cfg=tracing/smpi/computing:1 --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -219,7 +220,12 @@ $ tail -n +3 ./simgrid.trace
 $ rm -f ./simgrid.trace
 
 p Another test of trace replay with SMPI (one trace per process)
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 2 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ${srcdir:=.}/replay/split_traces
+
+< replay/actions0.txt
+< replay/actions1.txt
+$ mkfile ./split_traces_tesh
+
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 2 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay ./split_traces_tesh
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -235,13 +241,14 @@ $ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_rep
 > [Tremblay:0:(0) 13.600235] [smpi_replay/VERBOSE] 0 send 1 1e6 0.164463
 > [Tremblay:0:(0) 13.600235] [smpi_replay/INFO] Simulation time 13.6002
 
+$ rm -f ./split_traces_tesh
 
 p Test of barrier replay with SMPI (one trace for all processes)
 
 < replay/actions_barrier.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -264,7 +271,7 @@ p Test of Isend replay with SMPI (one trace for all processes)
 < replay/actions_with_isend.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -291,7 +298,7 @@ p Test of Isend replay with SMPI (one trace for all processes)
 < replay/actions_allReduce.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -312,7 +319,7 @@ p Test of AllToAll replay with SMPI (one trace for all processes)
 < replay/actions_alltoall.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
@@ -330,25 +337,43 @@ p Test of AllToAllv replay with SMPI (one trace for all processes)
 < replay/actions_alltoallv.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '1'
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [Tremblay:0:(0) 0.003999] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1 20 150 1000 1 80 100 1 20 110 0.003999
-> [Jupiter:1:(0) 0.006934] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1 100 160 1000 40 1 30 10 70 140 0.006934
-> [Fafard:2:(0) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1 120 150 1000 30 40 1 1 50 60 0.006936
+> [Tremblay:0:(0) 0.003999] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1000 1 80 100 0.003999
+> [Jupiter:1:(0) 0.006934] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1000 40 1 30 0.006934
+> [Fafard:2:(0) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1000 30 40 1 0.006936
 > [Fafard:2:(0) 0.006936] [smpi_replay/INFO] Simulation time 0.00693554
 
 $ rm -f replay/one_trace
 
+p Test of AllGatherv replay with SMPI (one trace for all processes)
+
+< replay/actions_allgatherv.txt
+$ mkfile replay/one_trace
+
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '1'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [Tremblay:0:(0) 0.841244] [smpi_replay/VERBOSE] 0 allGatherV 275427 275427 275427 275427 204020 0 0 0.841244
+> [Fafard:2:(0) 1.239482] [smpi_replay/VERBOSE] 2 allGatherV 275427 275427 275427 275427 204020 0 0 1.239482
+> [Jupiter:1:(0) 1.239482] [smpi_replay/VERBOSE] 1 allGatherV 275427 275427 275427 275427 204020 0 0 1.239482
+> [Jupiter:1:(0) 1.239482] [smpi_replay/INFO] Simulation time 1.23948
+
+$ rm -f replay/one_trace
+
 p Test of waitall replay with SMPI (one trace for all processes)
 
 < replay/actions_waitall.txt
 $ mkfile replay/one_trace
 
-$ ../../bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
+$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:1 -np 3 -platform ${srcdir:=.}/replay/replay_platform.xml -hostfile ${srcdir:=.}/hostfile ./smpi_replay replay/one_trace
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
index 6c9e8fe..fdde9a5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7e02849..2e5c4c2 100644 (file)
@@ -3,7 +3,7 @@
 # Go for the first test
 
 p Test instrumentation of SMPI
-$ ../../bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced
+$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to '1'
@@ -15,7 +15,7 @@ $ ../../bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfi
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 
 p Another SMPI test
-$ ../../bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
+$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to '1'
@@ -27,14 +27,14 @@ $ ../../bin/smpirun -trace -trace-resource -trace-file smpi_traced.trace -hostfi
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 
 p Testing without trace parameters
-$ ../../bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
+$ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 
 p Testing grouped tracing
-$ ../../bin/smpirun -trace -trace-grouped -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
+$ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to '1'
@@ -45,7 +45,7 @@ $ ../../bin/smpirun -trace -trace-grouped -trace-file smpi_traced.trace -hostfil
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 
 p Testing generation of viva configuration files
-$ ../../bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=smpi/cpu_threshold:1 -np 3 ./smpi_traced_simple
+$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml --cfg=smpi/cpu_threshold:1 -np 3 ./smpi_traced_simple
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to '1'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_traced.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to '1'
@@ -61,7 +61,7 @@ $ ../../bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_traced.t
 > [0.013981] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration
 
 p Testing with parameters but without activating them with the safe switch (-trace)
-$ ../../bin/smpirun -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
+$ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_traced.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/tracing/platform.xml -np 3 ./smpi_traced_simple
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
index 7b36a83..ebf2ecb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007. The SimGrid Team.
+/* Copyright (c) 2007, 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 337d8c5..d69ff26 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008. The SimGrid Team.
+/* Copyright (c) 2007-2008, 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 29facc4..3979835 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4552f55..f0b1573 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2013. 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. */
@@ -102,20 +103,46 @@ typedef struct msg_vm {
 /* ******************************** File ************************************ */
 typedef struct simdata_file *simdata_file_t;
 
+typedef struct s_msg_file_info {
+  sg_storage_size_t size;
+  char* mount_point;
+  char* storageId;
+  char* storage_type;
+  char* content_type;
+} s_msg_file_info_t, *msg_file_info_t;
+
 typedef struct msg_file {
-  char *name;                   /**< @brief file name */
-  size_t size;
-  simdata_file_t simdata;                /**< @brief simulator data  */
-  void *data;                   /**< @brief user data */
+  char *fullname;               /**< @brief file full name (path+name)*/
+  simdata_file_t simdata;       /**< @brief simulator data  */
+  msg_file_info_t info;
 } s_msg_file_t;
 
 /** @brief File datatype.
-    @ingroup msg_file_management 
   You should consider this as an opaque object.
+ *  @ingroup msg_file_management
+ *
*  You should consider this as an opaque object.
  */
+
 typedef struct msg_file *msg_file_t;
 
+/* ******************************** Storage ************************************ */
+/* TODO: PV: to comment */
+
+extern int MSG_STORAGE_LEVEL;
+
+/** @brief Storage datatype.
+ *  @ingroup msg_storage_management
+ *
+ *  You should consider this as an opaque object.
+ */
+typedef xbt_dictelm_t msg_storage_t;
+typedef s_xbt_dictelm_t s_msg_storage_t;
+
+typedef struct msg_storage_priv  {
+  // TODO PV: fill it (or not) !
+  void * dummy;
+} s_msg_storage_priv_t, *msg_storage_priv_t;
+
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task *simdata_gpu_task_t;
 
index 877d3e4..fa2fc66 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2013. 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. */
@@ -12,6 +13,8 @@
 
 #include "simgrid/simix.h"
 
+#include "simgrid/platf.h"
+
 SG_BEGIN_DECL()
 
 /** @brief Return code of most MSG functions
@@ -78,15 +81,32 @@ XBT_PUBLIC(const char *) MSG_environment_as_get_model(msg_as_t as);
 XBT_PUBLIC(xbt_dynar_t) MSG_environment_as_get_hosts(msg_as_t as);
 
 /************************** File handling ***********************************/
-XBT_PUBLIC(size_t) MSG_file_read(void* ptr, size_t size, msg_file_t fd);
-XBT_PUBLIC(size_t) MSG_file_write(const void* ptr, size_t size, msg_file_t fd);
-XBT_PUBLIC(msg_file_t) MSG_file_open(const char* mount, const char* path);
+XBT_PUBLIC(sg_storage_size_t) MSG_file_read(msg_file_t fd, sg_storage_size_t size);
+XBT_PUBLIC(sg_storage_size_t) MSG_file_write(msg_file_t fd, sg_storage_size_t size);
+XBT_PUBLIC(msg_file_t) MSG_file_open(const char* mount, const char* path,
+                                     void* data);
+XBT_PUBLIC(void*) MSG_file_get_data(msg_file_t fd);
+XBT_PUBLIC(msg_error_t) MSG_file_set_data(msg_file_t fd, void * data);
 XBT_PUBLIC(int) MSG_file_close(msg_file_t fd);
-XBT_PUBLIC(size_t) MSG_file_get_size(msg_file_t fd);
-
+XBT_PUBLIC(sg_storage_size_t) MSG_file_get_size(msg_file_t fd);
+XBT_PUBLIC(void) MSG_file_dump(msg_file_t fd);
 XBT_PUBLIC(int) MSG_file_unlink(msg_file_t fd);
 XBT_PUBLIC(xbt_dict_t) MSG_file_ls(const char *mount, const char *path);
-
+XBT_PUBLIC(void) __MSG_file_get_info(msg_file_t fd);
+
+/************************** Storage handling ***********************************/
+XBT_PUBLIC(msg_host_t) MSG_get_storage_by_name(const char *name);
+XBT_PUBLIC(const char *) MSG_storage_get_name(msg_storage_t storage);
+XBT_PUBLIC(sg_storage_size_t) MSG_storage_get_free_size(const char* name);
+XBT_PUBLIC(sg_storage_size_t) MSG_storage_get_used_size(const char* name);
+XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name);
+XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
+XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn);
+XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar(void);
+XBT_PUBLIC(msg_error_t) MSG_storage_set_data(msg_storage_t host, void *data);
+XBT_PUBLIC(void *) MSG_storage_get_data(msg_storage_t storage);
+XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage);
+XBT_PUBLIC(sg_storage_size_t) MSG_storage_get_size(msg_storage_t storage);
 /************************** AS Router handling ************************************/
 XBT_PUBLIC(const char *) MSG_as_router_get_property_value(const char* asr, const char *name);
 XBT_PUBLIC(xbt_dict_t) MSG_as_router_get_properties(const char* asr);
@@ -100,10 +120,17 @@ XBT_PUBLIC(msg_host_t) MSG_host_self(void);
 XBT_PUBLIC(int) MSG_get_host_msgload(msg_host_t host);
 /* int MSG_get_msgload(void); This function lacks specification; discard it */
 XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
-XBT_PUBLIC(int) MSG_get_host_core(msg_host_t h);
+XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
+XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h);
 XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h);
 XBT_PUBLIC(void) __MSG_host_destroy(msg_host_priv_t host);
 
+XBT_PUBLIC(double) MSG_get_host_power_peak_at(msg_host_t h, int pstate_index);
+XBT_PUBLIC(double) MSG_get_host_current_power_peak(msg_host_t h);
+XBT_PUBLIC(int) MSG_get_host_nb_pstates(msg_host_t h);
+XBT_PUBLIC(void) MSG_set_host_power_peak_at(msg_host_t h, int pstate);
+XBT_PUBLIC(double) MSG_get_host_consumed_energy(msg_host_t h);
+
 /*property handlers*/
 XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(msg_host_t host);
 XBT_PUBLIC(const char *) MSG_host_get_property_value(msg_host_t host,
@@ -118,7 +145,8 @@ XBT_PUBLIC(void) MSG_create_environment(const char *file);
 XBT_PUBLIC(msg_host_t) MSG_get_host_by_name(const char *name);
 XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar(void);
 XBT_PUBLIC(int) MSG_get_host_number(void);
-
+XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_list(msg_host_t host);
+XBT_PUBLIC(xbt_dict_t) MSG_host_get_storage_content(msg_host_t host);
 /************************** Process handling *********************************/
 XBT_PUBLIC(msg_process_t) MSG_process_create(const char *name,
                                            xbt_main_func_t code,
index 40fa48b..f80d5ef 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006, 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -89,4 +89,12 @@ typedef enum {
 } e_SD_task_kind_t;
 
 
+/** @brief Storage datatype
+    @ingroup SD_datatypes_management
+
+ TODO PV: comment it !
+
+    @see SD_storage_management */
+typedef xbt_dictelm_t SD_storage_t;
+
 #endif
index 9afe61d..d78288f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -105,6 +105,8 @@ XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src,
 
 XBT_PUBLIC(SD_task_t) SD_workstation_get_current_task(SD_workstation_t
                                                       workstation);
+XBT_PUBLIC(xbt_dict_t)
+    SD_workstation_get_storage_list(SD_workstation_t workstation);
 /** @} */
 
 /************************** Task handling ************************************/
@@ -135,6 +137,7 @@ XBT_PUBLIC(void) SD_task_set_rate(SD_task_t task, double rate);
 XBT_PUBLIC(void) SD_task_watch(SD_task_t task, e_SD_task_state_t state);
 XBT_PUBLIC(void) SD_task_unwatch(SD_task_t task, e_SD_task_state_t state);
 XBT_PUBLIC(double) SD_task_get_amount(SD_task_t task);
+XBT_PUBLIC(void) SD_task_set_amount(SD_task_t task, double amount);
 XBT_PUBLIC(double) SD_task_get_alpha(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
@@ -175,7 +178,7 @@ XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name,
                                                            void *data,
                                                            double amount);
 
-XBT_PUBLIC(void) SD_task_distribute_comp_amdhal(SD_task_t task, int ws_count);
+XBT_PUBLIC(void) SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count);
 XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
                                    const SD_workstation_t * list);
 XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
@@ -225,6 +228,7 @@ XBT_PUBLIC(int) SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
  *  @{
  */
 XBT_PUBLIC(void) SD_init(int *argc, char **argv);
+XBT_PUBLIC(void) SD_config(const char *key, const char *value);
 XBT_PUBLIC(void) SD_application_reinit(void);
 XBT_PUBLIC(void) SD_create_environment(const char *platform_file);
 XBT_PUBLIC(xbt_dynar_t) SD_simulate(double how_long);
index 18535fd..fcc7da1 100644 (file)
@@ -1,6 +1,7 @@
 /* simgrid/modelchecker.h - Formal Verification made possible in SimGrid    */
 
-/* Copyright (c) 2008-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 #ifdef HAVE_MC
 
 extern int _sg_do_model_check; /* please don't use directly: we inline MC_is_active, but that's what you should use */
+extern int _sg_mc_visited;
 
 #define MC_is_active() _sg_do_model_check
+#define MC_visited_reduction() _sg_mc_visited
 
 XBT_PUBLIC(void) MC_assert(int);
-XBT_PUBLIC(int) MC_random(void);
+XBT_PUBLIC(int) MC_random(int min, int max);
 XBT_PUBLIC(void) MC_automaton_new_propositional_symbol(const char* id, void* fct);
 XBT_PUBLIC(void *) MC_snapshot(void);
 XBT_PUBLIC(int) MC_compare_snapshots(void *s1, void *s2);
+XBT_PUBLIC(void) MC_cut(void);
+XBT_PUBLIC(void) MC_ignore(void *addr, size_t size);
 
 #else
 
 #define MC_assert(a) xbt_assert(a)
 #define MC_is_active() 0
+#define MC_visited_reduction() 0
 
 #endif
 
index 2fa1d1f..b888225 100644 (file)
@@ -1,6 +1,7 @@
 /* platf.h - Public interface to the SimGrid platforms                      */
 
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2013. 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. */
@@ -88,6 +89,13 @@ static inline char* sg_host_name(sg_host_t host) {
   return host->key;
 }
 
+typedef xbt_dictelm_t sg_storage_t;
+static inline char* sg_storage_name(sg_storage_t storage) {
+  return storage->key;
+}
+/* Type for any integer storage size  */
+typedef uint64_t sg_storage_size_t;
+
 
 /*
  * Platform creation functions. Instead of passing 123 arguments to the creation functions
@@ -101,7 +109,8 @@ static inline char* sg_host_name(sg_host_t host) {
 
 typedef struct {
   const char* id;
-  double power_peak;
+  xbt_dynar_t power_peak;
+  int pstate;
   int core_amount;
   double power_scale;
   tmgr_trace_t power_trace;
@@ -231,6 +240,7 @@ typedef struct {
   const char* id;
   const char* type_id;
   const char* content;
+  const char* content_type;
   xbt_dict_t properties;
 } s_sg_platf_storage_cbarg_t, *sg_platf_storage_cbarg_t;
 
@@ -240,8 +250,9 @@ typedef struct {
   const char* id;
   const char* model;
   const char* content;
+  const char* content_type;
   xbt_dict_t properties;
-  unsigned long size; /* size in Gbytes */
+  sg_storage_size_t size;
 } s_sg_platf_storage_type_cbarg_t, *sg_platf_storage_type_cbarg_t;
 
 #define SG_PLATF_STORAGE_TYPE_INITIALIZER {NULL,NULL,NULL,NULL,NULL}
@@ -254,7 +265,7 @@ typedef struct {
 #define SG_PLATF_MSTORAGE_INITIALIZER {NULL,NULL}
 
 typedef struct {
-  const char* id;
+  const char* storageId;
   const char* name;
 } s_sg_platf_mount_cbarg_t, *sg_platf_mount_cbarg_t;
 
index 767fe6e..84a385b 100644 (file)
@@ -1,7 +1,8 @@
 
 /* platf_generator.h - Public interface to the SimGrid platforms generator  */
 
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 510bade..ecdd1d6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,6 +13,7 @@
 #include "xbt/function_types.h"
 #include "xbt/parmap.h"
 #include "xbt/swag.h"
+#include "simgrid/platf.h"
 
 SG_BEGIN_DECL()
 
@@ -68,8 +69,13 @@ typedef struct s_smx_cond *smx_cond_t;
 typedef struct s_smx_sem *smx_sem_t;
 
 /********************************** File *************************************/
+
 typedef struct s_smx_file *smx_file_t;
 
+/********************************** Storage *************************************/
+typedef xbt_dictelm_t smx_storage_t;
+typedef struct s_smx_storage_priv *smx_storage_priv_t;
+
 /********************************** Action *************************************/
 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
 
@@ -258,7 +264,7 @@ XBT_PUBLIC(void) SIMIX_host_self_set_data(void *data);
 XBT_PUBLIC(void*) SIMIX_host_self_get_data(void);
 XBT_PUBLIC(void*) SIMIX_host_get_data(smx_host_t host);
 XBT_PUBLIC(void) SIMIX_host_set_data(smx_host_t host, void *data);
-
+XBT_PUBLIC(xbt_dict_t) SIMIX_host_get_storage_list(smx_host_t host);
 /********************************* Process ************************************/
 XBT_PUBLIC(int) SIMIX_process_count(void);
 XBT_PUBLIC(smx_process_t) SIMIX_process_self(void);
@@ -281,6 +287,10 @@ XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_rdv_t rdv, int (*match_fun)(void*,
 XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_rdv_t rdv, int (*match_fun)(void*, void*), void* data);
 XBT_PUBLIC(void) SIMIX_comm_finish(smx_action_t action);
 
+/*********************************** File *************************************/
+XBT_PUBLIC(void*) SIMIX_file_get_data(smx_file_t fd);
+XBT_PUBLIC(void) SIMIX_file_set_data(smx_file_t fd, void *data);
+
 /******************************************************************************/
 /*                            SIMIX simcalls                                  */
 /******************************************************************************/
@@ -294,6 +304,7 @@ XBT_PUBLIC(smx_host_t) simcall_host_get_by_name(const char *name);
 XBT_PUBLIC(const char *) simcall_host_get_name(smx_host_t host);
 XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(smx_host_t host);
 XBT_PUBLIC(int) simcall_host_get_core(smx_host_t host);
+XBT_PUBLIC(xbt_swag_t) simcall_host_get_process_list(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_speed(smx_host_t host);
 XBT_PUBLIC(double) simcall_host_get_available_speed(smx_host_t host);
 /* Two possible states, 1 - CPU ON and 0 CPU OFF */
@@ -302,6 +313,12 @@ XBT_PUBLIC(void *) simcall_host_get_data(smx_host_t host);
 
 XBT_PUBLIC(void) simcall_host_set_data(smx_host_t host, void *data);
 
+XBT_PUBLIC(double) simcall_host_get_current_power_peak(smx_host_t host);
+XBT_PUBLIC(double) simcall_host_get_power_peak_at(smx_host_t host, int pstate_index);
+XBT_PUBLIC(int) simcall_host_get_nb_pstates(smx_host_t host);
+XBT_PUBLIC(void) simcall_host_set_power_peak_at(smx_host_t host, int pstate_index);
+XBT_PUBLIC(double) simcall_host_get_consumed_energy(smx_host_t host);
+
 XBT_PUBLIC(smx_action_t) simcall_host_execute(const char *name, smx_host_t host,
                                                 double computation_amount,
                                                 double priority);
@@ -318,7 +335,7 @@ XBT_PUBLIC(double) simcall_host_execution_get_remains(smx_action_t execution);
 XBT_PUBLIC(e_smx_state_t) simcall_host_execution_get_state(smx_action_t execution);
 XBT_PUBLIC(void) simcall_host_execution_set_priority(smx_action_t execution, double priority);
 XBT_PUBLIC(e_smx_state_t) simcall_host_execution_wait(smx_action_t execution);
-
+XBT_PUBLIC(xbt_dict_t) simcall_host_get_storage_list(smx_host_t host);
 
 /**************************** Process simcalls ********************************/
 /* Constructor and Destructor */
@@ -461,15 +478,28 @@ XBT_PUBLIC(void) simcall_sem_acquire_timeout(smx_sem_t sem,
                                              double max_duration);
 XBT_PUBLIC(int) simcall_sem_get_capacity(smx_sem_t sem);
 
-XBT_PUBLIC(size_t) simcall_file_read(void* ptr, size_t size, smx_file_t fd);
-XBT_PUBLIC(size_t) simcall_file_write(const void* ptr, size_t size,
-                                      smx_file_t fd);
+/*****************************   File   **********************************/
+XBT_PUBLIC(void *) simcall_file_get_data(smx_file_t fd);
+XBT_PUBLIC(void) simcall_file_set_data(smx_file_t fd, void *data);
+XBT_PUBLIC(sg_storage_size_t) simcall_file_read(smx_file_t fd, sg_storage_size_t size);
+XBT_PUBLIC(sg_storage_size_t) simcall_file_write(smx_file_t fd, sg_storage_size_t size);
 XBT_PUBLIC(smx_file_t) simcall_file_open(const char* storage, const char* path);
 XBT_PUBLIC(int) simcall_file_close(smx_file_t fd);
 XBT_PUBLIC(int) simcall_file_unlink(smx_file_t fd);
 XBT_PUBLIC(xbt_dict_t) simcall_file_ls(const char* mount, const char* path);
-XBT_PUBLIC(size_t) simcall_file_get_size(smx_file_t fd);
-
+XBT_PUBLIC(sg_storage_size_t) simcall_file_get_size(smx_file_t fd);
+XBT_PUBLIC(xbt_dynar_t) simcall_file_get_info(smx_file_t fd);
+
+/*****************************   Storage   **********************************/
+XBT_PUBLIC(sg_storage_size_t) simcall_storage_get_free_size (const char* name);
+XBT_PUBLIC(sg_storage_size_t) simcall_storage_get_used_size (const char* name);
+XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage);
+XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage);
+XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data);
+XBT_PUBLIC(xbt_dict_t) SIMIX_storage_get_content(smx_storage_t storage);
+XBT_PUBLIC(xbt_dict_t) simcall_storage_get_content(smx_storage_t storage);
+XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_host_t host);
+XBT_PUBLIC(sg_storage_size_t) SIMIX_storage_get_size(smx_storage_t storage);
 /************************** AS router   **********************************/
 XBT_PUBLIC(xbt_dict_t) SIMIX_asr_get_properties(const char *name);
 /************************** AS router simcalls ***************************/
@@ -478,7 +508,7 @@ XBT_PUBLIC(xbt_dict_t) simcall_asr_get_properties(const char *name);
 /************************** MC simcalls   **********************************/
 XBT_PUBLIC(void *) simcall_mc_snapshot(void);
 XBT_PUBLIC(int) simcall_mc_compare_snapshots(void *s1, void *s2);
-XBT_PUBLIC(int) simcall_mc_random(void);
+XBT_PUBLIC(int) simcall_mc_random(int min, int max);
 
 /************************** New API simcalls **********************************/
 /* TUTORIAL: New API                                                          */
index be5c24d..fb08c29 100644 (file)
@@ -1,6 +1,7 @@
 /* simgrid_config.h - Results of the configure made visible to user code    */
 
-/* Copyright (c) 2009-2012. Da SimGrid team. All rights reserved.           */
+/* Copyright (c) 2009-2013. 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. */
index 0e64fdb..d840c9a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
similarity index 57%
rename from include/smpi/mpif.h
rename to include/smpi/mpif.h.in
index 632e77d..c6a96a2 100644 (file)
@@ -1,5 +1,5 @@
 ! -*- fortran -*-
-! Copyright (c) 2010. The SimGrid Team.
+! Copyright (c) 2010, 2012-2013. The SimGrid Team.
 ! All rights reserved.
 
 ! This program is free software; you can redistribute it and/or modify it
@@ -18,7 +18,9 @@
       integer MPI_MAX_DATAREP_STRIN, MPI_MAX_INFO_KEY
       integer MPI_MAX_INFO_VAL, MPI_MAX_OBJECT_NAME, MPI_MAX_PORT_NAME
       integer MPI_ANY_SOURCE, MPI_PROC_NULL, MPI_ANY_TAG, MPI_UNDEFINED
-      integer MPI_TAG_UB, MPI_TAG_LB
+      integer MPI_IN_PLACE, MPI_BOTTOM, MPI_TAG_UB, MPI_TAG_LB
+      integer MPI_SOURCE, MPI_TAG, MPI_ERROR
+      integer MPI_VERSION, MPI_SUBVERSION
       parameter(MPI_MAX_PROCESSOR_NAME=100)
       parameter(MPI_MAX_ERROR_STRING=100)
       parameter(MPI_MAX_DATAREP_STRIN =100)
       parameter(MPI_MAX_INFO_VAL=100)
       parameter(MPI_MAX_OBJECT_NAME=100)
       parameter(MPI_MAX_PORT_NAME=100)
-      parameter(MPI_ANY_SOURCE=-1)
-      parameter(MPI_PROC_NULL=-2)
-      parameter(MPI_ANY_TAG=-1)
-      parameter(MPI_UNDEFINED=-1)
+      parameter(MPI_ANY_SOURCE=-555)
+      parameter(MPI_PROC_NULL=-666)
+      parameter(MPI_ANY_TAG=-444)
+      parameter(MPI_UNDEFINED=-333)
+      parameter(MPI_IN_PLACE=-222)
+      parameter(MPI_BOTTOM=-111)
+      parameter(MPI_SOURCE=1)
+      parameter(MPI_TAG=2)
+      parameter(MPI_ERROR=3)
       parameter(MPI_TAG_UB=0)
       parameter(MPI_TAG_LB=0)
+      parameter(MPI_VERSION=1)
+      parameter(MPI_SUBVERSION=1)
 
       integer MPI_SUCCESS, MPI_ERR_COMM, MPI_ERR_ARG, MPI_ERR_TYPE
       integer MPI_ERR_REQUEST, MPI_ERR_INTERN, MPI_ERR_COUNT
       integer MPI_ERR_RANK, MPI_ERR_OTHER, MPI_ERR_UNKNOWN
       integer MPI_ERR_TAG, MPI_ERR_TRUNCATE, MPI_ERR_GROUP, MPI_ERR_OP
+      integer MPI_LASTUSEDCODE, MPI_ERR_LASTCODE
       integer MPI_IDENT, MPI_SIMILAR, MPI_UNEQUAL, MPI_CONGRUENT
       integer MPI_WTIME_IS_GLOBAL
       parameter(MPI_SUCCESS=0)
       parameter(MPI_ERR_OP=11)
       parameter(MPI_ERR_OTHER=12)
       parameter(MPI_ERR_UNKNOWN=13)
+      parameter(MPI_LASTUSEDCODE=0)
+      parameter(MPI_ERR_LASTCODE=0)
       parameter(MPI_IDENT=0)
       parameter(MPI_SIMILAR=1)
       parameter(MPI_UNEQUAL=2)
       parameter(MPI_CONGRUENT=3)
       parameter(MPI_WTIME_IS_GLOBAL=1)
 
+      integer MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN
+      parameter(MPI_NULL_COPY_FN =0)
+      parameter(MPI_NULL_DELETE_FN =0)
+      integer MPI_COMM_NULL_COPY_FN, MPI_COMM_NULL_DELETE_FN
+      parameter(MPI_COMM_NULL_COPY_FN =0)
+      parameter(MPI_COMM_NULL_DELETE_FN =0)
+      integer MPI_COMM_NULL_DUP_FN, MPI_COMM_DUP_FN
+      parameter(MPI_COMM_NULL_DUP_FN =0)
+      parameter(MPI_COMM_DUP_FN =0)
+      integer MPI_APPNUM, MPI_HOST, MPI_IO
+      parameter(MPI_APPNUM=0)
+      parameter(MPI_HOST=0)
+      parameter(MPI_IO=0)
+      integer MPI_ROOT, MPI_INFO_NULL,MPI_COMM_TYPE_SHARED
+      parameter(MPI_ROOT=0)
+      parameter(MPI_INFO_NULL=-1)
+      parameter(MPI_COMM_TYPE_SHARED=1)
+
 ! These should be ordered as in smpi_f77.c
       integer MPI_COMM_NULL, MPI_COMM_WORLD, MPI_COMM_SELF
+      integer MPI_UNIVERSE_SIZE
       parameter(MPI_COMM_NULL=-1)
       parameter(MPI_COMM_SELF=-2)
       parameter(MPI_COMM_WORLD=0)
+      parameter(MPI_UNIVERSE_SIZE=0)
+
 
       integer MPI_GROUP_NULL, MPI_GROUP_EMPTY
       parameter(MPI_GROUP_NULL=-1)
       parameter(MPI_GROUP_EMPTY=-2)
 
+      integer MPI_ERRORS_RETURN, MPI_ERRORS_ARE_FATAL
+      integer MPI_ERRHANDLER_NULL
+      parameter(MPI_ERRORS_RETURN=0)
+      parameter(MPI_ERRORS_ARE_FATAL=1)
+      parameter(MPI_ERRHANDLER_NULL=2)
+
 ! This should be equal to the number of int fields in MPI_Status
       integer MPI_STATUS_SIZE, MPI_STATUSES_IGNORE
       parameter(MPI_STATUS_SIZE=4)
-      parameter(MPI_STATUSES_IGNORE=0)
+      parameter(MPI_STATUSES_IGNORE=-1)
 
-      integer MPI_STATUS_IGNORE(MPI_STATUS_SIZE)
-      common/smpi/ MPI_STATUS_IGNORE
+      integer MPI_STATUS_IGNORE
+      parameter(MPI_STATUS_IGNORE=-1)
 
       integer MPI_REQUEST_NULL
       parameter(MPI_REQUEST_NULL=-1)
 
+      integer MPI_INTEGER_KIND
+      parameter(MPI_INTEGER_KIND=4)
+
 ! These should be ordered as in smpi_f77.c
       integer MPI_DATATYPE_NULL, MPI_BYTE, MPI_CHARACTER, MPI_LOGICAL
       integer MPI_INTEGER, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4
       integer MPI_DOUBLE_PRECISION, MPI_COMPLEX, MPI_DOUBLE_COMPLEX
       integer MPI_2INTEGER, MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4
       integer MPI_LOGICAL8, MPI_2REAL, MPI_2DOUBLE_PRECISION
+      integer MPI_AINT, MPI_OFFSET, MPI_COUNT
+      integer MPI_REAL16, MPI_COMPLEX8,MPI_COMPLEX16,MPI_COMPLEX32
       parameter(MPI_DATATYPE_NULL=-1)
       parameter(MPI_BYTE=0)
       parameter(MPI_CHARACTER=1)
       parameter(MPI_LOGICAL8=18)
       parameter(MPI_2REAL=19)
       parameter(MPI_2DOUBLE_PRECISION=19)
+      parameter(MPI_AINT=20)
+      parameter(MPI_OFFSET=21)
+      parameter(MPI_COUNT=22)
+      parameter(MPI_REAL16=23)
+      parameter(MPI_COMPLEX8=24)
+      parameter(MPI_COMPLEX16=25)
+      parameter(MPI_COMPLEX32=26)
+
+
 
 ! These should be ordered as in smpi_f77.c
       integer MPI_OP_NULL,MPI_MAX, MPI_MIN, MPI_MAXLOC, MPI_MINLOC
       parameter(MPI_BXOR=11)
       
       INTEGER MPI_ADDRESS_KIND, MPI_OFFSET_KIND
-      PARAMETER (MPI_ADDRESS_KIND=8)
-      PARAMETER (MPI_OFFSET_KIND=8)
+      PARAMETER (MPI_ADDRESS_KIND=@MPI_ADDRESS_SIZE@)
+      PARAMETER (MPI_OFFSET_KIND=@MPI_ADDRESS_SIZE@)
       
       INTEGER MPI_MODE_NOPRECEDE
       PARAMETER (MPI_MODE_NOPRECEDE=8192)
 
+      integer MPI_COMBINER_NAMED, MPI_COMBINER_DUP
+      integer MPI_COMBINER_CONTIGUOUS, MPI_COMBINER_VECTOR
+      integer MPI_COMBINER_HVECTOR_INTEGER, MPI_COMBINER_HVECTOR
+      integer MPI_COMBINER_INDEXED, MPI_COMBINER_HINDEXED_INTEGER
+      integer MPI_COMBINER_HINDEXED, MPI_COMBINER_INDEXED_BLOCK
+      integer MPI_COMBINER_STRUCT_INTEGER, MPI_COMBINER_STRUCT
+      integer MPI_COMBINER_SUBARRAY, MPI_COMBINER_DARRAY
+      integer MPI_COMBINER_F90_REAL, MPI_COMBINER_F90_COMPLEX
+      integer MPI_COMBINER_F90_INTEGER, MPI_COMBINER_RESIZED
+      integer MPI_COMBINER_HINDEXED_BLOCK
+
+      parameter( MPI_COMBINER_NAMED=0)
+      parameter( MPI_COMBINER_DUP=1)
+      parameter( MPI_COMBINER_CONTIGUOUS=2)
+      parameter( MPI_COMBINER_VECTOR=3)
+      parameter( MPI_COMBINER_HVECTOR_INTEGER=4)
+      parameter( MPI_COMBINER_HVECTOR=5)
+      parameter( MPI_COMBINER_INDEXED=6)
+      parameter( MPI_COMBINER_HINDEXED_INTEGER=7)
+      parameter( MPI_COMBINER_HINDEXED=8)
+      parameter( MPI_COMBINER_INDEXED_BLOCK=9)
+      parameter( MPI_COMBINER_STRUCT_INTEGER=10)
+      parameter( MPI_COMBINER_STRUCT=11)
+      parameter( MPI_COMBINER_SUBARRAY=12)
+      parameter( MPI_COMBINER_DARRAY=13)
+      parameter( MPI_COMBINER_F90_REAL=14)
+      parameter( MPI_COMBINER_F90_COMPLEX=15)
+      parameter( MPI_COMBINER_F90_INTEGER=16)
+      parameter( MPI_COMBINER_RESIZED=17)
+      parameter( MPI_COMBINER_HINDEXED_BLOCK=18)
+
+      integer MPI_ORDER_C, MPI_ORDER_FORTRAN
+      parameter(MPI_ORDER_C=1)
+      parameter(MPI_ORDER_FORTRAN=0)
+
       external MPI_INIT, MPI_FINALIZE, MPI_ABORT
       external MPI_COMM_RANK, MPI_COMM_SIZE, MPI_COMM_DUP, MPI_COMM_SPLIT
       external MPI_SEND_INIT, MPI_ISEND, MPI_SEND
index 74030ae..710e5da 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -37,13 +37,17 @@ SG_BEGIN_DECL()
 #define MPI_MAX_INFO_VAL       100
 #define MPI_MAX_OBJECT_NAME    100
 #define MPI_MAX_PORT_NAME      100
+#define MPI_MAX_LIBRARY_VERSION_STRING 100
 #define SMPI_RAND_SEED 5
-#define MPI_ANY_SOURCE -1
-#define MPI_BOTTOM (void *)0
-#define MPI_PROC_NULL -2
-#define MPI_ANY_TAG -1
-#define MPI_UNDEFINED -3
-#define MPI_IN_PLACE (void *)-4
+#define MPI_ANY_SOURCE -555
+#define MPI_BOTTOM (void *)-111
+#define MPI_FORTRAN_BOTTOM -111
+#define MPI_PROC_NULL -666
+#define MPI_ANY_TAG -444
+#define MPI_UNDEFINED -333
+#define MPI_IN_PLACE (void *)-222
+#define MPI_FORTRAN_IN_PLACE -222
+
 // errorcodes
 #define MPI_SUCCESS       0
 #define MPI_ERR_COMM      1
@@ -55,11 +59,14 @@ SG_BEGIN_DECL()
 #define MPI_ERR_RANK      7
 #define MPI_ERR_TAG       8
 #define MPI_ERR_TRUNCATE  9
-#define MPI_ERR_GROUP    10
-#define MPI_ERR_OP       11
-#define MPI_ERR_OTHER    12
+#define MPI_ERR_GROUP     10
+#define MPI_ERR_OP        11
+#define MPI_ERR_OTHER     12
 #define MPI_ERR_IN_STATUS 13
 #define MPI_ERR_PENDING   14
+#define MPI_ERR_BUFFER    15
+#define MPI_ERR_NAME      16
+#define MPI_ERRCODES_IGNORE (int *)0
 #define MPI_IDENT     0
 #define MPI_SIMILAR   1
 #define MPI_UNEQUAL   2
@@ -70,6 +77,75 @@ SG_BEGIN_DECL()
 #define MPI_IO               0
 #define MPI_BSEND_OVERHEAD   0
 
+#define MPI_KEYVAL_INVALID 0
+#define MPI_NULL_COPY_FN NULL
+#define MPI_NULL_DELETE_FN NULL
+#define MPI_APPNUM 0
+#define MPI_LASTUSEDCODE MPI_SUCCESS
+#define MPI_ERR_LASTCODE MPI_SUCCESS
+
+#define MPI_CXX_BOOL MPI_DATATYPE_NULL
+#define MPI_CXX_FLOAT_COMPLEX MPI_DATATYPE_NULL
+#define MPI_CXX_DOUBLE_COMPLEX MPI_DATATYPE_NULL
+#define MPI_CXX_LONG_DOUBLE_COMPLEX MPI_DATATYPE_NULL
+
+#define MPI_REAL4 MPI_DATATYPE_NULL
+#define MPI_REAL8 MPI_DATATYPE_NULL
+#define MPI_REAL16 MPI_DATATYPE_NULL
+#define MPI_COMPLEX8 MPI_DATATYPE_NULL
+#define MPI_COMPLEX16 MPI_DATATYPE_NULL
+#define MPI_COMPLEX32 MPI_DATATYPE_NULL
+#define MPI_INTEGER1 MPI_DATATYPE_NULL
+#define MPI_INTEGER2 MPI_DATATYPE_NULL
+#define MPI_INTEGER4 MPI_DATATYPE_NULL
+#define MPI_INTEGER8 MPI_DATATYPE_NULL
+#define MPI_COMPLEX MPI_DATATYPE_NULL
+#define MPI_DOUBLE_COMPLEX MPI_DATATYPE_NULL
+
+#define MPI_DISTRIBUTE_BLOCK 0
+#define MPI_DISTRIBUTE_NONE 1
+#define MPI_DISTRIBUTE_CYCLIC 2
+#define MPI_DISTRIBUTE_DFLT_DARG 0
+#define MPI_ORDER_C 1
+#define MPI_ORDER_FORTRAN 0
+
+#define MPI_TYPECLASS_REAL 0
+#define MPI_TYPECLASS_INTEGER 1
+#define MPI_TYPECLASS_COMPLEX 2
+#define MPI_ROOT 0
+#define MPI_INFO_NULL -1
+#define MPI_COMM_TYPE_SHARED    1
+
+#define MPI_VERSION 1
+#define MPI_SUBVERSION 1
+#define MPI_UNWEIGHTED      (int *)0
+#define MPI_ARGV_NULL (char **)0
+#define MPI_ARGVS_NULL (char ***)0
+#define MPI_LOCK_EXCLUSIVE           1
+#define MPI_LOCK_SHARED              2
+
+typedef enum MPIR_Combiner_enum{
+  MPI_COMBINER_NAMED,
+  MPI_COMBINER_DUP,
+  MPI_COMBINER_CONTIGUOUS,
+  MPI_COMBINER_VECTOR,
+  MPI_COMBINER_HVECTOR_INTEGER,
+  MPI_COMBINER_HVECTOR,
+  MPI_COMBINER_INDEXED,
+  MPI_COMBINER_HINDEXED_INTEGER,
+  MPI_COMBINER_HINDEXED,
+  MPI_COMBINER_INDEXED_BLOCK,
+  MPI_COMBINER_STRUCT_INTEGER,
+  MPI_COMBINER_STRUCT,
+  MPI_COMBINER_SUBARRAY,
+  MPI_COMBINER_DARRAY,
+  MPI_COMBINER_F90_REAL,
+  MPI_COMBINER_F90_COMPLEX,
+  MPI_COMBINER_F90_INTEGER,
+  MPI_COMBINER_RESIZED,
+  MPI_COMBINER_HINDEXED_BLOCK
+}MPIR_Combiner_enum;
+
 typedef enum MPIR_Topo_type {
   MPI_GRAPH=1,
   MPI_CART=2,
@@ -89,10 +165,12 @@ typedef struct {
   int count;
 } MPI_Status;
 
-#define MPI_STATUS_IGNORE NULL
-#define MPI_STATUSES_IGNORE NULL
+#define MPI_STATUS_IGNORE ((MPI_Status*)NULL)
+#define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
+#define MPI_FORTRAN_STATUS_IGNORE -1
+#define MPI_FORTRAN_STATUSES_IGNORE -1
 
-#define MPI_DATATYPE_NULL NULL
+#define MPI_DATATYPE_NULL ((MPI_Datatype)NULL)
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_CHAR;
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_SHORT;
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_INT;
@@ -136,13 +214,16 @@ XBT_PUBLIC_DATA(MPI_Datatype) MPI_2INT;
 XBT_PUBLIC_DATA(MPI_Datatype) MPI_LONG_DOUBLE_INT;
 XBT_PUBLIC_DATA(MPI_Datatype) MPI_2FLOAT;
 XBT_PUBLIC_DATA(MPI_Datatype) MPI_2DOUBLE;
+//for now we only send int values at max
+#define MPI_Count int
+#define MPI_COUNT MPI_INT
 
 typedef void MPI_User_function(void *invec, void *inoutvec, int *len,
                                MPI_Datatype * datatype);
 struct s_smpi_mpi_op;
 typedef struct s_smpi_mpi_op *MPI_Op;
 
-#define MPI_OP_NULL NULL
+#define MPI_OP_NULL ((MPI_Op)NULL)
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MAX;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MIN;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MAXLOC;
@@ -159,24 +240,27 @@ XBT_PUBLIC_DATA( MPI_Op ) MPI_BXOR;
 struct s_smpi_mpi_group;
 typedef struct s_smpi_mpi_group *MPI_Group;
 
-#define MPI_GROUP_NULL NULL
+#define MPI_GROUP_NULL ((MPI_Group)NULL)
 
 XBT_PUBLIC_DATA( MPI_Group ) MPI_GROUP_EMPTY;
 
 struct s_smpi_mpi_communicator;
 typedef struct s_smpi_mpi_communicator *MPI_Comm;
 
-#define MPI_COMM_NULL NULL
+#define MPI_COMM_NULL ((MPI_Comm)NULL)
 XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
+XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
 #define MPI_COMM_SELF smpi_process_comm_self()
 
 struct s_smpi_mpi_request;
 typedef struct s_smpi_mpi_request *MPI_Request;
 
-#define MPI_REQUEST_NULL NULL
+#define MPI_REQUEST_NULL ((MPI_Request)NULL)
+#define MPI_FORTRAN_REQUEST_NULL -1
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Init, (int *argc, char ***argv));
 MPI_CALL(XBT_PUBLIC(int), MPI_Finalize, (void));
+MPI_CALL(XBT_PUBLIC(int), MPI_Finalized, (int* flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Init_thread,
                             (int *argc, char ***argv, int required,
                              int *provided));
@@ -186,12 +270,15 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Abort, (MPI_Comm comm, int errorcode));
 MPI_CALL(XBT_PUBLIC(double), MPI_Wtime, (void));
 MPI_CALL(XBT_PUBLIC(double), MPI_Wtick,(void));
 MPI_CALL(XBT_PUBLIC(int), MPI_Address, (void *location, MPI_Aint * address));
-
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_address, (void *location, MPI_Aint * address));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_free, (MPI_Datatype * datatype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_size, (MPI_Datatype datatype, int *size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_extent,
                             (MPI_Datatype datatype, MPI_Aint * lb,
                              MPI_Aint * extent));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_true_extent,
+                            (MPI_Datatype datatype, MPI_Aint * lb,
+                             MPI_Aint * extent));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_extent, (MPI_Datatype datatype, MPI_Aint * extent));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_lb, (MPI_Datatype datatype, MPI_Aint * disp));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_ub, (MPI_Datatype datatype, MPI_Aint * disp));
@@ -199,15 +286,33 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Type_commit, (MPI_Datatype* datatype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_hindexed,
                             (int count, int* blocklens, MPI_Aint* indices,
                             MPI_Datatype old_type, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hindexed,
+                            (int count, int* blocklens, MPI_Aint* indices,
+                            MPI_Datatype old_type, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hindexed_block,
+                            (int count, int blocklength, MPI_Aint* indices,
+                            MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_hvector,
                             (int count, int blocklen, MPI_Aint stride,
                              MPI_Datatype old_type, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hvector,
+                            (int count, int blocklen, MPI_Aint stride,
+                             MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_indexed,
                             (int count, int* blocklens, int* indices,
                              MPI_Datatype old_type, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_indexed,
+                            (int count, int* blocklens, int* indices,
+                             MPI_Datatype old_type, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_indexed_block,
+                            (int count, int blocklength, int* indices,
+                             MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_struct,
                             (int count, int* blocklens, MPI_Aint* indices,
                              MPI_Datatype* old_types, MPI_Datatype* newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_struct,
+                            (int count, int* blocklens, MPI_Aint* indices,
+                             MPI_Datatype* old_types, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC(int), MPI_Type_vector,
                             (int count, int blocklen, int stride,
                              MPI_Datatype old_type, MPI_Datatype* newtype));
@@ -265,7 +370,7 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Get_count,
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_group, (MPI_Comm comm, MPI_Group * group));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_compare,
                             (MPI_Comm comm1, MPI_Comm comm2, int *result));
-MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup, (MPI_Comm comm, MPI_Comm * newcomm));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create,
                             (MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_free, (MPI_Comm * comm));
@@ -380,6 +485,10 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_scatter,
                             (void *sendbuf, void *recvbuf,
                              int *recvcounts, MPI_Datatype datatype,
                              MPI_Op op, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_scatter_block,
+                            (void *sendbuf, void *recvbuf,
+                             int recvcount, MPI_Datatype datatype,
+                             MPI_Op op, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Alltoall,
                             (void *sendbuf, int sendcount,
                              MPI_Datatype sendtype, void *recvbuf,
@@ -397,7 +506,12 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Iprobe,
 MPI_CALL(XBT_PUBLIC(int), MPI_Probe,
                             (int source, int tag, MPI_Comm comm,
                              MPI_Status* status));
-
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_version,
+                             (int *version,int *subversion));
+MPI_CALL(XBT_PUBLIC(int), MPI_Get_library_version,
+                             (char *version,int *len));
+MPI_CALL(XBT_PUBLIC(int), MPI_Reduce_local,(void *inbuf, void *inoutbuf, int count,
+    MPI_Datatype datatype, MPI_Op op));
 
 //FIXME: these are not yet implemented
 
@@ -405,10 +519,30 @@ typedef void MPI_Handler_function(MPI_Comm*, int*, ...);
 typedef int MPI_Win;
 typedef int MPI_Info;
 typedef void* MPI_Errhandler;
+
 typedef int MPI_Copy_function(MPI_Comm oldcomm, int keyval, void* extra_state, void* attribute_val_in,
                               void* attribute_val_out, int* flag);
 typedef int MPI_Delete_function(MPI_Comm comm, int keyval, void* attribute_val, void* extra_state);
-
+typedef int MPI_Comm_copy_attr_function(MPI_Comm oldcomm, int keyval, void* extra_state, void* attribute_val_in,
+                              void* attribute_val_out, int* flag);
+typedef int MPI_Comm_delete_attr_function(MPI_Comm comm, int keyval, void* attribute_val, void* extra_state);
+typedef int MPI_Type_copy_attr_function(MPI_Datatype type, int keyval, void* extra_state, void* attribute_val_in,
+                              void* attribute_val_out, int* flag);
+typedef int MPI_Type_delete_attr_function(MPI_Datatype type, int keyval, void* attribute_val, void* extra_state);
+typedef void MPI_Comm_errhandler_function(MPI_Comm *, int *, ...);
+typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status); 
+typedef int MPI_Grequest_free_function(void *extra_state); 
+typedef int MPI_Grequest_cancel_function(void *extra_state, int complete); 
+#define MPI_DUP_FN MPI_Comm_dup
+#define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0)
+#define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0)
+#define MPI_COMM_DUP_FN  ((MPI_Comm_copy_attr_function *)MPI_DUP_FN)
+#define MPI_TYPE_NULL_COPY_FN ((MPI_Type_copy_attr_function*)0)
+#define MPI_TYPE_NULL_DELETE_FN ((MPI_Type_delete_attr_function*)0)
+#define MPI_TYPE_DUP_FN ((MPI_Type_copy_attr_function*)MPI_DUP_FN)
+
+typedef MPI_Comm_errhandler_function MPI_Comm_errhandler_fn;
+#define MPI_INFO_ENV 1
 XBT_PUBLIC_DATA(MPI_Datatype)  MPI_PACKED;
 XBT_PUBLIC_DATA(MPI_Errhandler*)  MPI_ERRORS_RETURN;
 XBT_PUBLIC_DATA(MPI_Errhandler*)  MPI_ERRORS_ARE_FATAL;
@@ -437,11 +571,30 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_free, (MPI_Errhandler* errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_get, (MPI_Comm comm, MPI_Errhandler* errhandler));
 MPI_CALL(XBT_PUBLIC(int), MPI_Error_string, (int errorcode, char* string, int* resultlen));
 MPI_CALL(XBT_PUBLIC(int), MPI_Errhandler_set, (MPI_Comm comm, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_errhandler, (MPI_Comm comm, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_errhandler, (MPI_Comm comm, MPI_Errhandler *errhandler));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_errhandler,( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_call_errhandler,(MPI_Comm comm,int errorcode));
+MPI_CALL(XBT_PUBLIC(int), MPI_Add_error_class,( int *errorclass));
+MPI_CALL(XBT_PUBLIC(int), MPI_Add_error_code,(  int errorclass, int *errorcode));
+MPI_CALL(XBT_PUBLIC(int), MPI_Add_error_string,( int errorcode, char *string));
 MPI_CALL(XBT_PUBLIC(int), MPI_Cancel, (MPI_Request* request));
 MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_attach, (void* buffer, int size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Buffer_detach, (void* buffer, int* size));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_test_inter, (MPI_Comm comm, int* flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_attr, (MPI_Comm comm, int comm_keyval, void *attribute_val));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_delete_attr, (MPI_Comm comm, int comm_keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_create_keyval,(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_free_keyval,(int* keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_attr, (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_attr, (MPI_Datatype type, int type_keyval, void *att));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_delete_attr, (MPI_Datatype type, int comm_keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_keyval,(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_free_keyval,(int* keyval));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_dup,(MPI_Datatype datatype,MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_set_name,(MPI_Datatype  datatype, char * name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_name,(MPI_Datatype  datatype, char * name, int* len));
 MPI_CALL(XBT_PUBLIC(int), MPI_Unpack, (void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Ssend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC(int), MPI_Ssend_init, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
@@ -471,10 +624,55 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Win_fence,( int assert,  MPI_Win win));
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_free,( MPI_Win* win));
 MPI_CALL(XBT_PUBLIC(int), MPI_Win_create,( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win));
 MPI_CALL(XBT_PUBLIC(int), MPI_Info_create,( MPI_Info *info));
-MPI_CALL(XBT_PUBLIC(int), MPI_Info_set,( MPI_Info *info, char *key, char *value));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_set,( MPI_Info info, char *key, char *value));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get,(MPI_Info info,char *key,int valuelen, char *value, int *flag));
 MPI_CALL(XBT_PUBLIC(int), MPI_Info_free,( MPI_Info *info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_delete,( MPI_Info info,  char *key));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_dup,(MPI_Info info, MPI_Info *newinfo));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nkeys,( MPI_Info info, int *nkeys));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_nthkey,( MPI_Info info, int n, char *key));
+MPI_CALL(XBT_PUBLIC(int), MPI_Info_get_valuelen,( MPI_Info info, char *key, int *valuelen, int *flag));
+
 MPI_CALL(XBT_PUBLIC(int), MPI_Get,( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
     MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_envelope,(MPI_Datatype datatype,int *num_integers,int *num_addresses,int *num_datatypes, int *combiner));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_get_contents,(MPI_Datatype datatype, int max_integers, int max_addresses,
+                            int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, 
+                            MPI_Datatype *array_of_datatypes));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_darray,(int size, int rank, int ndims, int* array_of_gsizes,
+                            int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+                            int order, MPI_Datatype oldtype, MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Pack_external_size, (char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size));
+MPI_CALL(XBT_PUBLIC(int), MPI_Pack_external, (char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position));
+MPI_CALL(XBT_PUBLIC(int), MPI_Unpack_external, ( char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_resized ,(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_subarray,(int ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype *newtype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Type_match_size,(int typeclass,int size,MPI_Datatype *datatype));
+MPI_CALL(XBT_PUBLIC(int), MPI_Alltoallw, ( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Exscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_name, (MPI_Comm comm, char* name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_set_info, (MPI_Comm comm, MPI_Info info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_info, (MPI_Comm comm, MPI_Info* info));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup, (MPI_Comm comm, MPI_Comm * newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_split_type,(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_connect,( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Request_get_status,( MPI_Request request, int *flag, MPI_Status *status));
+MPI_CALL(XBT_PUBLIC(int), MPI_Grequest_start,( MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC(int), MPI_Grequest_complete,( MPI_Request request));
+MPI_CALL(XBT_PUBLIC(int), MPI_Status_set_cancelled,(MPI_Status *status,int flag));
+MPI_CALL(XBT_PUBLIC(int), MPI_Status_set_elements,( MPI_Status *status, MPI_Datatype datatype, int count));
+MPI_CALL(XBT_PUBLIC(int), MPI_Unpublish_name,( char *service_name, MPI_Info info, char *port_name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Publish_name,( char *service_name, MPI_Info info, char *port_name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Lookup_name,( char *service_name, MPI_Info info, char *port_name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_join,( int fd, MPI_Comm *intercomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Open_port,( MPI_Info info, char *port_name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Close_port,( char *port_name));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_accept,( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_spawn,( char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_spawn_multiple,( int count, char **array_of_commands, char*** array_of_argv, int* array_of_maxprocs, MPI_Info* array_of_info, 
+                                                    int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes));
+MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_parent,( MPI_Comm *parent));
 
 //FIXME: End of all the not yet implemented stuff
 
@@ -516,14 +714,14 @@ XBT_PUBLIC(void*) smpi_shared_get_call(const char* func, const char* input);
 XBT_PUBLIC(void*) smpi_shared_set_call(const char* func, const char* input, void* data);
 #define SMPI_SHARED_CALL(func, input, ...) \
    (smpi_shared_known_call(#func, input) ? smpi_shared_get_call(#func, input) \
-                                         : smpi_shared_set_call(#func, input, func(__VA_ARGS__)))
+                                         : smpi_shared_set_call(#func, input, (func(__VA_ARGS__))))
 
 /* Fortran specific stuff */
+
 XBT_PUBLIC(int) __attribute__((weak)) smpi_simulated_main_(int argc, char** argv);
 XBT_PUBLIC(int) __attribute__((weak)) MAIN__(void);
 XBT_PUBLIC(int) smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]);
 XBT_PUBLIC(void) __attribute__((weak)) user_main_(void);
-
 XBT_PUBLIC(int) smpi_process_index(void);
 
 /* Trace replay specific stuff */
index f082355..534c443 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c407af8..37b80e8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -17,6 +17,7 @@
 
 XBT_PUBLIC_DATA(__thread int) smpi_current_rank;
 
+XBT_PUBLIC(void) smpi_process_init(int *argc, char ***argv);
 XBT_PUBLIC(int) smpi_process_argc(void);
 XBT_PUBLIC(int) smpi_process_getarg(integer* index, char* dst, ftnlen len);
 XBT_PUBLIC(int) smpi_global_size(void);
index d4a8e66..df32d1b 100644 (file)
@@ -176,6 +176,8 @@ typedef int AT_surfxml_process_kill___time;
 #define AU_surfxml_process_kill___time NULL
 typedef int AT_surfxml_cluster_bb___bw;
 #define AU_surfxml_cluster_bb___bw NULL
+typedef int AT_surfxml_host_pstate;
+#define AU_surfxml_host_pstate NULL
 typedef int AT_surfxml_argument_value;
 #define AU_surfxml_argument_value NULL
 typedef enum { AU_surfxml_link_state, A_surfxml_link_state_ON,A_surfxml_link_state_OFF } AT_surfxml_link_state;
@@ -251,24 +253,26 @@ typedef int AT_surfxml_link_state___file;
 #define AU_surfxml_link_state___file NULL
 typedef int AT_surfxml_random_radical;
 #define AU_surfxml_random_radical NULL
+typedef int AT_surfxml_mount_storageId;
+#define AU_surfxml_mount_storageId NULL
 typedef int AT_surfxml_bypassASroute_gw___src;
 #define AU_surfxml_bypassASroute_gw___src NULL
 typedef int AT_surfxml_trace___connect_trace;
 #define AU_surfxml_trace___connect_trace NULL
-typedef int AT_surfxml_mount_id;
-#define AU_surfxml_mount_id NULL
 typedef int AT_surfxml_cluster_power;
 #define AU_surfxml_cluster_power NULL
 typedef int AT_surfxml_process_function;
 #define AU_surfxml_process_function NULL
 typedef int AT_surfxml_peer_id;
 #define AU_surfxml_peer_id NULL
+typedef int AT_surfxml_cabinet_radical;
+#define AU_surfxml_cabinet_radical NULL
+typedef int AT_surfxml_storage_content___type;
+#define AU_surfxml_storage_content___type NULL
 typedef int AT_surfxml_cluster_router___id;
 #define AU_surfxml_cluster_router___id NULL
 typedef int AT_surfxml_cluster_loopback___lat;
 #define AU_surfxml_cluster_loopback___lat NULL
-typedef int AT_surfxml_cabinet_radical;
-#define AU_surfxml_cabinet_radical NULL
 typedef enum { AU_surfxml_cluster_sharing___policy, A_surfxml_cluster_sharing___policy_SHARED,A_surfxml_cluster_sharing___policy_FULLDUPLEX,A_surfxml_cluster_sharing___policy_FATPIPE } AT_surfxml_cluster_sharing___policy;
 typedef int AT_surfxml_bypassRoute_dst;
 #define AU_surfxml_bypassRoute_dst NULL
@@ -288,6 +292,8 @@ typedef int AT_surfxml_route_src;
 #define AU_surfxml_route_src NULL
 typedef int AT_surfxml_storage_id;
 #define AU_surfxml_storage_id NULL
+typedef int AT_surfxml_storage___type_content___type;
+#define AU_surfxml_storage___type_content___type NULL
 typedef int AT_surfxml_host_coordinates;
 #define AU_surfxml_host_coordinates NULL
 typedef int AT_surfxml_trace_id;
@@ -437,6 +443,9 @@ XBT_PUBLIC_DATA(short int) surfxml_process_kill___time_isset;
 XBT_PUBLIC_DATA(AT_surfxml_cluster_bb___bw) AX_surfxml_cluster_bb___bw;
 #define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw)
 XBT_PUBLIC_DATA(short int) surfxml_cluster_bb___bw_isset;
+XBT_PUBLIC_DATA(AT_surfxml_host_pstate) AX_surfxml_host_pstate;
+#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate)
+XBT_PUBLIC_DATA(short int) surfxml_host_pstate_isset;
 XBT_PUBLIC_DATA(AT_surfxml_argument_value) AX_surfxml_argument_value;
 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
 XBT_PUBLIC_DATA(short int) surfxml_argument_value_isset;
@@ -557,15 +566,15 @@ XBT_PUBLIC_DATA(short int) surfxml_link_state___file_isset;
 XBT_PUBLIC_DATA(AT_surfxml_random_radical) AX_surfxml_random_radical;
 #define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical)
 XBT_PUBLIC_DATA(short int) surfxml_random_radical_isset;
+XBT_PUBLIC_DATA(AT_surfxml_mount_storageId) AX_surfxml_mount_storageId;
+#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId)
+XBT_PUBLIC_DATA(short int) surfxml_mount_storageId_isset;
 XBT_PUBLIC_DATA(AT_surfxml_bypassASroute_gw___src) AX_surfxml_bypassASroute_gw___src;
 #define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src)
 XBT_PUBLIC_DATA(short int) surfxml_bypassASroute_gw___src_isset;
 XBT_PUBLIC_DATA(AT_surfxml_trace___connect_trace) AX_surfxml_trace___connect_trace;
 #define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace)
 XBT_PUBLIC_DATA(short int) surfxml_trace___connect_trace_isset;
-XBT_PUBLIC_DATA(AT_surfxml_mount_id) AX_surfxml_mount_id;
-#define A_surfxml_mount_id (surfxml_bufferstack + AX_surfxml_mount_id)
-XBT_PUBLIC_DATA(short int) surfxml_mount_id_isset;
 XBT_PUBLIC_DATA(AT_surfxml_cluster_power) AX_surfxml_cluster_power;
 #define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power)
 XBT_PUBLIC_DATA(short int) surfxml_cluster_power_isset;
@@ -575,15 +584,18 @@ XBT_PUBLIC_DATA(short int) surfxml_process_function_isset;
 XBT_PUBLIC_DATA(AT_surfxml_peer_id) AX_surfxml_peer_id;
 #define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id)
 XBT_PUBLIC_DATA(short int) surfxml_peer_id_isset;
+XBT_PUBLIC_DATA(AT_surfxml_cabinet_radical) AX_surfxml_cabinet_radical;
+#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical)
+XBT_PUBLIC_DATA(short int) surfxml_cabinet_radical_isset;
+XBT_PUBLIC_DATA(AT_surfxml_storage_content___type) AX_surfxml_storage_content___type;
+#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type)
+XBT_PUBLIC_DATA(short int) surfxml_storage_content___type_isset;
 XBT_PUBLIC_DATA(AT_surfxml_cluster_router___id) AX_surfxml_cluster_router___id;
 #define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id)
 XBT_PUBLIC_DATA(short int) surfxml_cluster_router___id_isset;
 XBT_PUBLIC_DATA(AT_surfxml_cluster_loopback___lat) AX_surfxml_cluster_loopback___lat;
 #define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat)
 XBT_PUBLIC_DATA(short int) surfxml_cluster_loopback___lat_isset;
-XBT_PUBLIC_DATA(AT_surfxml_cabinet_radical) AX_surfxml_cabinet_radical;
-#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical)
-XBT_PUBLIC_DATA(short int) surfxml_cabinet_radical_isset;
 XBT_PUBLIC_DATA(AT_surfxml_cluster_sharing___policy) AX_surfxml_cluster_sharing___policy;
 #define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy
 XBT_PUBLIC_DATA(short int) surfxml_cluster_sharing___policy_isset;
@@ -614,6 +626,9 @@ XBT_PUBLIC_DATA(short int) surfxml_route_src_isset;
 XBT_PUBLIC_DATA(AT_surfxml_storage_id) AX_surfxml_storage_id;
 #define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id)
 XBT_PUBLIC_DATA(short int) surfxml_storage_id_isset;
+XBT_PUBLIC_DATA(AT_surfxml_storage___type_content___type) AX_surfxml_storage___type_content___type;
+#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type)
+XBT_PUBLIC_DATA(short int) surfxml_storage___type_content___type_isset;
 XBT_PUBLIC_DATA(AT_surfxml_host_coordinates) AX_surfxml_host_coordinates;
 #define A_surfxml_host_coordinates (surfxml_bufferstack + AX_surfxml_host_coordinates)
 XBT_PUBLIC_DATA(short int) surfxml_host_coordinates_isset;
index 7f3ee88..3c2e36a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -18,9 +18,11 @@ XBT_PUBLIC(xbt_lib_t) host_lib;
 XBT_PUBLIC(int) ROUTING_HOST_LEVEL; //Routing level
 XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
 XBT_PUBLIC(int) SURF_WKS_LEVEL;    //Surf workstation level
-XBT_PUBLIC(int) SIMIX_HOST_LEVEL;  //Simix level
+XBT_PUBLIC(int) SIMIX_HOST_LEVEL;  //Simix host level
+XBT_PUBLIC(int) SIMIX_STORAGE_LEVEL;  //Simix storage level
 XBT_PUBLIC(int)  MSG_HOST_LEVEL;    //Msg level
-XBT_PUBLIC(int)  SD_HOST_LEVEL;    //Simdag level
+XBT_PUBLIC(int)  SD_HOST_LEVEL;    //Simdag host level
+XBT_PUBLIC(int)  SD_STORAGE_LEVEL;    //Simdag storage level
 XBT_PUBLIC(int)  COORD_HOST_LEVEL;  //Coordinates level
 XBT_PUBLIC(int) NS3_HOST_LEVEL;    //host node for ns3
 
@@ -38,7 +40,7 @@ XBT_PUBLIC(int) ROUTING_PROP_ASR_LEVEL; //Properties for AS and router
 XBT_PUBLIC(xbt_lib_t) storage_lib;
 XBT_PUBLIC(int) ROUTING_STORAGE_LEVEL;        //Routing storage level
 XBT_PUBLIC(int) ROUTING_STORAGE_HOST_LEVEL;
-XBT_PUBLIC(int) SURF_STORAGE_LEVEL;
+XBT_PUBLIC(int) SURF_STORAGE_LEVEL;  // Surf storage level
 
 XBT_PUBLIC(xbt_lib_t) storage_type_lib;
 XBT_PUBLIC(int) ROUTING_STORAGE_TYPE_LEVEL;   //Routing storage_type level
index ee4b4d9..b143fa8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@ XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) _XBT_GNUC_PRINTF(1,2);
 XBT_PUBLIC(double) surf_parse_get_double(const char *string);
 XBT_PUBLIC(int) surf_parse_get_int(const char *string);
 XBT_PUBLIC(double) surf_parse_get_time(const char *string);
+XBT_PUBLIC(double) surf_parse_get_size(const char *string);
 XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string);
 XBT_PUBLIC(double) surf_parse_get_power(const char *string);
 
index 1893481..96c204a 100644 (file)
@@ -1,6 +1,7 @@
 /* xbt.h - Public interface to the xbt (SimGrid's toolbox)                  */
 
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index dcb0e05..4d90d1d 100644 (file)
@@ -1,6 +1,6 @@
 /*  xbt/asserts.h -- assertion mecanism                                     */
 
-/* Copyright (c) 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2005-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index bc1b680..cc255f3 100644 (file)
@@ -2,7 +2,7 @@
 
 /* This is useful to build named structs, like option or property sets.     */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -204,7 +204,7 @@ XBT_PUBLIC(void) xbt_cfg_register(xbt_cfg_t * cfg,
                                   const char *name,
                                   const char *description,
                                   e_xbt_cfgelm_type_t type,
-                                  void *default_value, int min, int max,
+                                  int min, int max,
                                   xbt_cfg_cb_t cb_set, xbt_cfg_cb_t cb_rm);
 XBT_PUBLIC(void) xbt_cfg_unregister(xbt_cfg_t cfg, const char *name);
 XBT_PUBLIC(void) xbt_cfg_register_str(xbt_cfg_t * cfg, const char *entry);
index eca8b82..6440034 100644 (file)
@@ -1,6 +1,6 @@
 /* cunit - A little C Unit facility                                         */
 
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2005-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2a9bcba..4f2a88c 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt/dict.h -- api to a generic dictionary                                */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4cf11cc..f0c14cc 100644 (file)
@@ -1,6 +1,6 @@
 /* dynar - a generic dynamic array                                          */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b64b4d0..f80fe2d 100644 (file)
@@ -1,6 +1,6 @@
 /* ex - Exception Handling                                                  */
 
-/*  Copyright (c) 2005-2010 The SimGrid team                                */
+/*  Copyright (c) 2005-2013. The SimGrid Team.                              */
 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
 /*  Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/>         */
 /*  Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/>           */
@@ -140,7 +140,7 @@ __ex_mctx_struct} __ex_mctx_t;
  *
  * Any exception thrown directly from the TRIED_BLOCK block or from called
  * subroutines is caught. Cleanups which must be done after this block
- * (whenever an exception arised or not) should be placed into the optionnal
+ * (whenever an exception arose or not) should be placed into the optionnal
  * CLEANUP_BLOCK. The code dealing with the exceptions when they arise should
  * be placed into the (mandatory) CATCH_BLOCK.
  *
index aaf2a37..e1871ba 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fc1b458..42a8cf1 100644 (file)
@@ -1,6 +1,6 @@
 /* function_type.h - classical types for pointer to function                */
 
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 38a3512..c92df8c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8b39e7b..8f45895 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6cbc514..dcefb7c 100644 (file)
@@ -1,6 +1,6 @@
 /* hash.h - Various hashing functions.                                      */
 
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 269d73b..cc50c02 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index cdc9fc7..5139ff8 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt/lib.h - api to a generic library                                     */
 
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fe199ac..697cb50 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@ typedef enum {
 
 /*
  * define NLOG to disable at compilation time any logging request
- * define NDEBUG to disable at compilation time any logging request of priority below INFO
+ * define NDEBUG to disable at compilation time any logging request of priority below VERBOSE
  */
 
 
index cc4b78a..dcf75a5 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt/mallocator.h -- api to recycle allocated objects                     */
 
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 53d5062..5ce5bab 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_matrix_t management functions                                        */
 
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2010. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a3062a1..a6f65de 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt.h - Public interface to the xbt (simgrid's toolbox)                     */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  *     DLL space.
  */
 
-
 /* Build the DLL */
 #if defined(DLL_EXPORT)
-#  define XBT_PUBLIC(type)            __declspec(dllexport) type
+#  define XBT_PUBLIC(type)            extern __declspec(dllexport) type
 #  define XBT_EXPORT_NO_IMPORT(type)  __declspec(dllexport) type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
-#  define XBT_PUBLIC_DATA(type)        __declspec(dllexport) type
+#  define XBT_PUBLIC_DATA(type)       extern __declspec(dllexport) type
 
 /* Pack everything up statically */
 #elif defined(DLL_STATIC)
-#  define XBT_PUBLIC(type)           extern type
+#  define XBT_PUBLIC(type)            extern type
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
 #elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
-#  define XBT_PUBLIC(type)              __declspec(dllimport) type
-#  define XBT_EXPORT_NO_IMPORT(type)    type
-#  define XBT_IMPORT_NO_EXPORT(type)    __declspec(dllimport) type
-#  define XBT_PUBLIC_DATA(type)    __declspec(dllimport) type
+#  define XBT_PUBLIC(type)            extern __declspec(dllimport) type
+#  define XBT_EXPORT_NO_IMPORT(type)  type
+#  define XBT_IMPORT_NO_EXPORT(type)  __declspec(dllimport) type
+#  define XBT_PUBLIC_DATA(type)       extern __declspec(dllimport) type
 
 /* UNIX build */
 #else
index 5e254ea..9708a76 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
    This file was then part of the GNU C Library. */
 
-/* Copyright (c) 2010-2012. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,6 +19,7 @@
 #endif
 
 #include "xbt/dynar.h"
+#include "xbt/dict.h"
 
 /* Datatype representing a separate heap. The whole point of the mmalloc module
  * is to allow several such heaps in the process. It thus works by redefining
@@ -55,19 +56,14 @@ XBT_PUBLIC( xbt_mheap_t ) mmalloc_get_default_md(void);
 void mmalloc_set_current_heap(xbt_mheap_t new_heap);
 xbt_mheap_t mmalloc_get_current_heap(void);
 
-int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2);
+int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dict_t all_types, xbt_dict_t other_types);
 int mmalloc_linear_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2);
-void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2);
-void match_equals(xbt_dynar_t list);
-int compare_area(void *area1, void* area2, xbt_dynar_t previous);
+int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2);
+int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t all_types, xbt_dict_t other_types, char *type, int pointer_level);
 void reset_heap_information(void);
-
-void mmalloc_backtrace_block_display(void* heapinfo, int block);
-void mmalloc_backtrace_fragment_display(void* heapinfo, int block, int frag);
-void mmalloc_backtrace_display(void *addr);
-
-int is_free_area(void *area, xbt_mheap_t heap);
+int get_pointed_area_size(void *area, int heap);
 
 size_t mmalloc_get_bytes_used(xbt_mheap_t);
+ssize_t mmalloc_get_busy_size(xbt_mheap_t, void *ptr);
 
 #endif                          /* MMALLOC_H */
index 4c10969..29cad1b 100644 (file)
@@ -1,6 +1,6 @@
 /* module - modularize the code                                             */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3b9f9ed..624d278 100644 (file)
@@ -1,6 +1,6 @@
 /* A thread pool.                                          */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -52,6 +52,16 @@ XBT_PUBLIC(void) xbt_parmap_apply(xbt_parmap_t parmap,
                                   xbt_dynar_t data);
 XBT_PUBLIC(void*) xbt_parmap_next(xbt_parmap_t parmap);
 
+#ifdef HAVE_MC
+XBT_PUBLIC(xbt_parmap_t) xbt_parmap_mc_new(unsigned int num_workers,
+    e_xbt_parmap_mode_t mode);
+
+XBT_PUBLIC(int) xbt_parmap_mc_apply(xbt_parmap_t parmap, 
+                         int_f_pvoid_pvoid_t fun, 
+                         void *data,
+                         unsigned int length,
+                         void* ref_snapshot);
+#endif
 /** \} */
 
 SG_END_DECL()
index dbf8122..a0767c0 100644 (file)
@@ -1,6 +1,6 @@
 /* peer.h - peer (remote processes) management functions                    */
 
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3b83e7f..b23dd50 100644 (file)
@@ -1,7 +1,7 @@
 /* A (synchronized) message queue.                                          */
 /* Popping an empty queue is blocking, as well as pushing a full one        */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2f15374..069052d 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt/replay_reader.h -- Tools to parse a replay file                */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0505b10..6264d25 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt/set.h -- api to a generic dictionary                                 */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index cddd67d..dc164b7 100644 (file)
@@ -1,6 +1,6 @@
 /* str.h - XBT string related functions.                                    */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index d3f9636..3ed91f4 100644 (file)
@@ -1,6 +1,6 @@
 /* strbuff -- string buffers                                                */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 69004c3..2e3bed9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8eae773..3a3d3e2 100644 (file)
@@ -1,13 +1,13 @@
 /* xbt/synchro_core.h -- Synchronization tools                              */
 /* Usable in simulator, (or in real life when mixing with GRAS)             */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. 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. */
 
-/* splited away from synchro.h since we areused by dynar.h, and synchro.h uses dynar */
+/* splited away from synchro.h since we are used by dynar.h, and synchro.h uses dynar */
 
 
 #ifndef _XBT_THREAD_H
index 536c12d..8d3a61e 100644 (file)
@@ -2,7 +2,7 @@
 /*  no system header should be loaded out of this file so that we have only */
 /*  one file to check when porting to another OS                            */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a4c652f..cf25980 100644 (file)
@@ -1,6 +1,6 @@
 /* virtu - virtualization layer for XBT to choose between GRAS and MSG implementation */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7d7bd29..6283cfc 100644 (file)
@@ -1,6 +1,7 @@
 /* xbt/xbt_os_thread.h -- Thread portability layer                          */
 
-/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 90d0d28..c626424 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2012 Da SimGrid Team. All rights reserved.                 */
+/* Copyright (c) 2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 64b5ef5..3599905 100644 (file)
@@ -1,6 +1,6 @@
 /* Java Wrappers to the MSG API.                                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4d9a5d4..092bcfd 100644 (file)
@@ -1,6 +1,6 @@
 /* Java Wrappers to the MSG API.                                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 30f8b0e..3589783 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java host instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 00b21fc..139c286 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java As instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -14,7 +14,7 @@
 
 /* Functions related to the java host instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 669e91f..6a4a66e 100644 (file)
@@ -1,6 +1,7 @@
-/* Functions related to the java comm instances                                                                                                                                */
+/* Functions related to the java comm instances                             */
 
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.                   */
+/* Copyright (c) 2012-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 #include "jmsg_comm.h"
 #include "jxbt_utilities.h"
 #include "jmsg.h"
index ce86f9d..13b1b7e 100644 (file)
@@ -1,6 +1,7 @@
-/* Functions related to the java comm instances                                                                                                                                */
+/* Functions related to the java comm instances                             */
 
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.                   */
+/* Copyright (c) 2012-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 #ifndef MSG_JCOMM_H
 #define MSG_JCOMM_H
index d1e57c2..fb2557a 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to the java file API.                            */
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jstorage, job
   const char *path = (*env)->GetStringUTFChars(env, jpath, 0);
   msg_file_t file;
 
-  file = MSG_file_open(storage, path);
+  file = MSG_file_open(storage, path, NULL);
   jfile_bind(env, jfile, file);
 
   (*env)->ReleaseStringUTFChars(env, jstorage, storage);
@@ -38,17 +38,13 @@ Java_org_simgrid_msg_File_open(JNIEnv *env, jobject jfile, jobject jstorage, job
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_read(JNIEnv *env, jobject jfile, jlong jsize) {
   msg_file_t file = jfile_get_native(env, jfile);
-  size_t n;
-  n = MSG_file_read(NULL,(size_t)jsize, file);
-  return (jlong)n;
+  return (jlong)MSG_file_read(file, (sg_storage_size_t)jsize);
 }
 
 JNIEXPORT jlong JNICALL
 Java_org_simgrid_msg_File_write(JNIEnv *env, jobject jfile, jlong jsize) {
   msg_file_t file = jfile_get_native(env, jfile);
-  size_t n;
-  n = MSG_file_write(NULL, (size_t)jsize, file);
-  return (jlong)n;
+  return (jlong)MSG_file_write(file, (sg_storage_size_t)jsize);
 }
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfile) {
index 182bef1..f79ae22 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to the java file API.                            */
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b32b9b5..9a3a1ff 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java host instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -176,7 +176,7 @@ Java_org_simgrid_msg_Host_getSpeed(JNIEnv * env,
 }
 
 JNIEXPORT jdouble JNICALL
-Java_org_simgrid_msg_Host_getCore(JNIEnv * env,
+Java_org_simgrid_msg_Host_getCoreNumber(JNIEnv * env,
                                         jobject jhost) {
   msg_host_t host = jhost_get_native(env, jhost);
 
@@ -185,7 +185,7 @@ Java_org_simgrid_msg_Host_getCore(JNIEnv * env,
     return -1;
   }
 
-  return (jdouble) MSG_get_host_core(host);
+  return (jdouble) MSG_host_get_core_number(host);
 }
 
 JNIEXPORT jint JNICALL
index 401d53b..5eff534 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java host instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -136,10 +136,10 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed
     (JNIEnv *, jobject);
 /*
  * Class               org_simgrid_msg_Host
- * Method              getCore
+ * Method              getCoreNumber
  * Signature   ()D
  */
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCore
+JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber
     (JNIEnv *, jobject);
 /*
  * Class               org_simgrid_msg_Host
index 2f6216e..ec9c9d4 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -335,7 +335,7 @@ Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env,
 JNIEXPORT void JNICALL
 Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
  {
-  double time =  jmillis / 1000 + jnanos / 1000;
+  double time =  ((double)jmillis) / 1000 + ((double)jnanos) / 1000000000;
   msg_error_t rv;
   rv = MSG_process_sleep(time);
   if (rv != MSG_OK) {
index 1d268cd..b77e986 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -174,7 +174,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID
     (JNIEnv *, jclass, jint);
 /*
  * Class        org_simgrid_msg_Process
- * Method       waitFor
+ * Method       getProperty
  * Signature    (D)V
  */
 JNIEXPORT jobject JNICALL
index 6610b84..d8e2c47 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the RngStream Java port                         */
 
-/* Copyright (c) 2007-2012 The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index eb5e37e..e41be2a 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the RngStream Java port                         */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index cea6030..2fd40e4 100644 (file)
@@ -1,9 +1,10 @@
 /* Functions exporting the simgrid synchronization mechanisms to the Java world */
 
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.                   */
+/* Copyright (c) 2012-2013. 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.    */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "jmsg.h"
 #include "xbt/synchro_core.h"
index 1eb5a1d..e5e1c42 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3ad8167..01c30ce 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java task instances.                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8078984..197d86a 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java task instances.                            */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -177,7 +177,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
     (JNIEnv *, jobject, jdouble);
 /**
  * Class               org_simgrid_msg_Task
- * Method              setComputationAmount
+ * Method              setComputeDuration
  * Signature   (D)V
  */
 JNIEXPORT void JNICALL
index 0980d90..5c54c1f 100644 (file)
@@ -1,9 +1,10 @@
 /* Functions related to the MSG VM API. */
 
-/* Copyright (c) 2012. The SimGrid Team. */
+/* Copyright (c) 2012-2013. 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. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 #include "jmsg_vm.h"
 #include "jmsg_host.h"
 #include "jmsg_process.h"
index 49d54b2..6bf4284 100644 (file)
@@ -1,10 +1,10 @@
 /* Functions related to the MSG VM API. */
 
-/* Copyright (c) 2012. The SimGrid Team. */
+/* Copyright (c) 2012-2013. 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. */
-
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #ifndef MSG_VM_H
 #define MSG_VM_H
index 1bdfa67..d18072c 100644 (file)
@@ -1,6 +1,6 @@
 /* Java Wrappers to the TRACE API.                                           */
 
-/* Copyright (c) 2012  The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                      */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1daf370..0f270e0 100644 (file)
@@ -1,6 +1,6 @@
 /* Various JNI helper functions                                             */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8d5084c..79450a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Various JNI helper functions                                             */
 
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -87,9 +87,9 @@ void jxbt_throw_host_not_found(JNIEnv * env, const char *invalid_name);
 void jxbt_throw_process_not_found(JNIEnv * env, const char *invalid_name);
 /** Thrown when a transfer failure accure while Sending task */
 void jxbt_throw_transfer_failure(JNIEnv * env, char *detail);
-/** Thrown when a host failure accures while Sending task*/
+/** Thrown when a host failure occurs while Sending a task*/
 void jxbt_throw_host_failure(JNIEnv * env, char *details);
-/** Thrown when a time out accures While Sending task */
+/** Thrown when a timeout occurs while Sending a task */
 void jxbt_throw_time_out_failure(JNIEnv * env, char *details);
 /**Thrown when a task is canceled */
 void jxbt_throw_task_cancelled(JNIEnv * env, char *details);
index f895e1a..0ce5532 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Bindings to the MSG hosts
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 63e6d1e..a085ed0 100644 (file)
@@ -1,6 +1,7 @@
 package org.simgrid.msg;
 /**
-* Copyright 2012 The SimGrid team. All right reserved. 
+* Copyright (c) 2012-2013. 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 
index 426ea07..89c7b97 100644 (file)
@@ -1,6 +1,7 @@
 package org.simgrid.msg;
 /**
-* Copyright 2012 The SimGrid team. All right reserved. 
+* Copyright (c) 2012-2013. 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 
index 3b7f41f..fc48cba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Bindings to the MSG hosts
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
@@ -171,7 +171,7 @@ public class Host {
         * @return                      The speed of the processor of the host in flops.
         *
         */ 
-       public native double getCore();
+       public native double getCoreNumber();
 
        /**
         * Returns the value of a given host property. 
index 87e0661..cc328f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing host.
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 269eeb5..3bcc46c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing host.
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index d9333a2..ce2fd39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when there is a problem within the bindings (in JNI). 
  *
- * Copyright 2006-2012 The SimGrid Team            
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 5a08809..229566c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * JNI interface to C code for MSG.
  * 
- * Copyright 2006-2012 The SimGrid Team.           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index b41bd30..7baa8eb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is an abstract class grouping all MSG-related exceptions
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
@@ -12,14 +12,13 @@ package org.simgrid.msg;
 
 /**
  * This exception is an abstract class grouping all MSG-related exceptions
-  
-    \htmlonly <!-- 
-      DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
-      DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
-      DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
-      DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
-    --> \endhtmlonly 
-  
+ *
+ *  <!--
+ *    DOXYGEN_NAVBAR_CHILD "HostNotFoundException"=classsimgrid_1_1msg_1_1HostNotFoundException.html
+ *    DOXYGEN_NAVBAR_CHILD "JniException"=classsimgrid_1_1msg_1_1JniException.html
+ *    DOXYGEN_NAVBAR_CHILD "NativeException"=classsimgrid_1_1msg_1_1NativeException.html
+ *    DOXYGEN_NAVBAR_CHILD "ProcessNotFoundException"=classsimgrid_1_1msg_1_1ProcessNotFoundException.html
+ *  -->
  */
 public abstract class MsgException extends Exception {
   private static final long serialVersionUID = 1L;
index cb16ffb..1b76bb8 100644 (file)
@@ -1,5 +1,6 @@
 /* 
- * Copyright 2012 The SimGrid team. All right reserved. 
+ * Copyright (c) 2012-2013. 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 
index bdbdc5a..39beed7 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * This exception is raised when there is an error within the C world of SimGrid.
  *
- * Copyright 2006-2012 The SimGrid team
- * All right reserved. 
+ * Copyright (c) 2006-2013. 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 
index d7a5109..0077c04 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright 2006-2012 The SimGrid team
- * All right reserved. 
+ * Copyright (c) 2006-2013. 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 
index 5f7e327..144f7fb 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright 2006-2012 The SimGrid team
- * All right reserved. 
+ * Copyright (c) 2006-2013. 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 
index 284335c..19047e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing process.
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 58b9c9e..bc6c3f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * JNI interface to C RngStream code
  * 
- * Copyright 2006-2012 The SimGrid Team.           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index f1a276b..c49d9a1 100644 (file)
@@ -1,5 +1,6 @@
 /* 
- * Copyright 2012 The SimGrid team. All right reserved. 
+ * Copyright (c) 2012-2013. 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 
index 95ab081..319aee6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2012 The SimGrid Team.           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 4a7053d..a4fd085 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing host.
  *
- * Copyright 2006,2007,2010 The SimGrid Team           
+ * Copyright (c) 2006-2007, 2010, 2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index edd4091..b6b3c3b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing host.
  *
- * Copyright 2006,2007,2010 The SimGrid Team           
+ * Copyright (c) 2006-2007, 2010, 2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 419bf14..1d6fedd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This exception is raised when looking for a non-existing host.
  *
- * Copyright 2006-2012 The SimGrid Team           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 13fa595..5c9c8e3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * JNI interface to Cloud interface in Simgrid
  * 
- * Copyright 2006-2012 The SimGrid Team.           
+ * Copyright (c) 2006-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index 3ad5f92..4723c98 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * JNI interface to C code for the TRACES part of SimGrid.
  * 
- * Copyright 2012 The SimGrid Team.           
+ * Copyright (c) 2012-2013. The SimGrid Team.
  * All right reserved. 
  *
  * This program is free software; you can redistribute 
index a7670a0..a998d69 100644 (file)
@@ -1,6 +1,6 @@
 /* context_cojava - implementation of context switching for java coroutines */
 
-/* Copyright 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 695af57..6fe924e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 92005a4..6d4e75c 100644 (file)
@@ -1,6 +1,6 @@
 /* context_java - implementation of context switching for java threads */
 
-/* Copyright (c) 2009, 2010, 2012. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 789bf17..a65e41d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2012. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 41fc7e6..0a38965 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a862a2a..9e33f3c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 581b06d..477e3b9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -92,7 +92,8 @@ int console_add_host(lua_State *L) {
   // get power value
   lua_pushstring(L, "power");
   lua_gettable(L, -2);
-  host.power_peak = lua_tonumber(L, -1);
+  host.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push_as(host.power_peak, double, lua_tonumber(L, -1));
   lua_pop(L, 1);
 
   // get core
index 47dc17d..e9dc6b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6454ca3..4878208 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ce6d83c..3f1452f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 875fb31..7129539 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 62eee82..8e8e193 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index efd257a..444f15d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1633201..3ccfe8c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8c44001..db5f4e0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@ static int sd_register_platform(lua_State * L)
 }
 
 /**
- * Register applicaiton for MSG
+ * Register application for MSG
  */
 static int msg_register_application(lua_State * L)
 {
index 656541b..5c8e4d1 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2012. Da SimGrid Team. All rights reserved.           */
+/* Copyright (c) 2008-2013. 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. */
@@ -25,16 +26,6 @@ typedef struct s_mc_heap_ignore_region{
   size_t size;
 }s_mc_heap_ignore_region_t, *mc_heap_ignore_region_t;
 
-typedef struct s_mc_stack_ignore_variable{
-  char *var_name;
-  char *frame;
-}s_mc_stack_ignore_variable_t, *mc_stack_ignore_variable_t;
-
-typedef struct s_mc_data_bss_ignore_variable{
-  void *address;
-  size_t size;
-}s_mc_data_bss_ignore_variable_t, *mc_data_bss_ignore_variable_t;
-
 typedef struct s_stack_region{
   void *address;
   char *process_name;
@@ -43,20 +34,37 @@ typedef struct s_stack_region{
   int block;
 }s_stack_region_t, *stack_region_t;
 
-typedef struct s_heap_equality{
-  void *address1;
-  void *address2;
-}s_heap_equality_t, *heap_equality_t;
-
-void heap_equality_free_voidp(void *e);
-void stack_region_free_voidp(void *s);
-
 void heap_ignore_region_free(mc_heap_ignore_region_t r);
 void heap_ignore_region_free_voidp(void *r);
-void data_bss_ignore_variable_free(mc_data_bss_ignore_variable_t v);
-void data_bss_ignore_variable_free_voidp(void *v);
-void stack_ignore_variable_free(mc_stack_ignore_variable_t v);
-void stack_ignore_variable_free_voidp(void *v);
+
+/************ DWARF structures *************/
+
+typedef enum{
+  e_dw_base_type = 0,
+  e_dw_enumeration_type,
+  e_dw_enumerator,
+  e_dw_typedef,
+  e_dw_const_type,
+  e_dw_array_type,
+  e_dw_pointer_type,
+  e_dw_structure_type,
+  e_dw_union_type,
+  e_dw_subroutine_type,
+  e_dw_volatile_type
+}e_dw_type_type;
+
+typedef struct s_dw_type{
+  e_dw_type_type type;
+  void *id;
+  char *name;
+  int size;
+  char *dw_type_id;
+  xbt_dynar_t members; /* if DW_TAG_structure_type */
+  int is_pointer_type;
+  int offset;
+}s_dw_type_t, *dw_type_t;
+
+char* get_type_description(xbt_dict_t types, char *type_name);
 
 SG_END_DECL()
 #endif                          /* _MC_MC_H */
index 65c8212..0cf9f2d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2012. Da SimGrid Team. All rights reserved.           */
+/* Copyright (c) 2008-2013. 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. */
@@ -56,17 +57,14 @@ void MC_automaton_load(const char *file);
 /****************************** MC ignore **********************************/
 XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size);
 XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size);
-XBT_PUBLIC(void) MC_ignore_stack(const char *var_name, const char *frame);
-XBT_PUBLIC(void) MC_ignore_data_bss(void *address, size_t size);
+XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
+XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
 void MC_new_stack_area(void *stack, char *name, void *context, size_t size);
 
 /********************************* Memory *************************************/
 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
 XBT_PUBLIC(void) MC_memory_exit(void);
 
-/* Trigger for state equality detection (check potential cycle in application) */
-void MC_compare(void);
-
 SG_END_DECL()
 
 #endif                          /* _MC_MC_H */
index b110d76..7091f04 100644 (file)
@@ -1,6 +1,6 @@
 /* platf_interface.h - Internal interface to the SimGrid platforms          */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7bc098f..3d01e63 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2012-2013. 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/config.h"
 
 /*******************************************/
@@ -9,6 +15,8 @@ extern "C" {
 #endif
 
 XBT_PUBLIC_DATA(xbt_cfg_t) _sg_cfg_set;
+XBT_PUBLIC_DATA(int) _sg_cfg_init_status;
+XBT_PUBLIC_DATA(int) _sg_cfg_exit_asap;
 XBT_PUBLIC(int) sg_cfg_get_int(const char* name);
 XBT_PUBLIC(double) sg_cfg_get_double(const char* name);
 XBT_PUBLIC(char*) sg_cfg_get_string(const char* name);
index 04fc1da..0030870 100644 (file)
@@ -6,9 +6,9 @@
 /* from smpi_instr.c */
 void TRACE_smpi_alloc(void);
 void TRACE_smpi_release(void);
-void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation);
+void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, int size);
 void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation);
-void TRACE_smpi_send(int rank, int src, int dst);
+void TRACE_smpi_send(int rank, int src, int dst, int size);
 void TRACE_smpi_recv(int rank, int src, int dst);
 void TRACE_smpi_init(int rank);
 void TRACE_smpi_finalize(int rank);
index 5ef74f0..3dd00e0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -23,6 +23,7 @@
  */
 //FIXME:typedef struct surf_action *surf_action_t;
 //FIXME:typedef struct surf_file *surf_file_t;
+typedef struct surf_storage *surf_storage_t;
 typedef struct surf_stat *surf_stat_t;
 
 typedef struct lmm_element *lmm_element_t;
index 6049913..257cc47 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -46,6 +46,8 @@ int lmm_constraint_is_shared(lmm_constraint_t cnst);
 
 void lmm_constraint_free(lmm_system_t sys, lmm_constraint_t cnst);
 
+double lmm_constraint_get_usage(lmm_constraint_t cnst);
+
 XBT_PUBLIC(lmm_variable_t) lmm_variable_new(lmm_system_t sys, void *id,
                                             double weight_value,
                                             double bound,
index ec942d3..7705f0b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e1a727f..be43397 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -47,6 +47,7 @@ class Model;
 class CpuModel;
 class WorkstationModel;
 class NetworkCm02Model;
+class StorageModel;
 class Resource;
 class ResourceLmm;
 class WorkstationCLM03;
@@ -63,6 +64,7 @@ typedef struct Model Model;
 typedef struct CpuModel CpuModel;
 typedef struct WorkstationModel WorkstationModel;
 typedef struct NetworkCm02Model NetworkCm02Model;
+typedef struct StorageModel StorageModel;
 typedef struct Resource Resource;
 typedef struct ResourceLmm ResourceLmm;
 typedef struct WorkstationCLM03 WorkstationCLM03;
@@ -86,6 +88,7 @@ typedef Model *surf_model_t;
 typedef CpuModel *surf_cpu_model_t;
 typedef WorkstationModel *surf_workstation_model_t;
 typedef NetworkCm02Model *surf_network_model_t;
+typedef StorageModel *surf_storage_model_t;
 
 typedef xbt_dictelm_t surf_resource_t;
 typedef Resource *surf_cpp_resource_t;
@@ -196,6 +199,11 @@ typedef struct surf_cpu_model_extension_public {
   int (*get_core) (void *cpu);
   double (*get_speed) (void *cpu, double load);
   double (*get_available_speed) (void *cpu);
+  double (*get_current_power_peak) (void *cpu);
+  double (*get_power_peak_at) (void *cpu, int pstate_index);
+  int (*get_nb_pstates) (void *cpu);
+  void (*set_power_peak_at) (void *cpu, int pstate_index);
+  double (*get_consumed_energy) (void *cpu);
   void (*add_traces) (void);
 } s_surf_model_extension_cpu_t;
 
@@ -218,7 +226,7 @@ typedef struct surf_network_model_extension_public {
 } s_surf_model_extension_network_t;
 
 /* Storage model */
-//
+
 /** \ingroup SURF_models
  *  \brief Storage model extension public
  *
@@ -228,12 +236,13 @@ typedef struct surf_network_model_extension_public {
 typedef struct surf_storage_model_extension_public {
   surf_action_t(*open) (void *storage, const char* mount, const char* path);
   surf_action_t(*close) (void *storage, surf_file_t fd);
-  surf_action_t(*read) (void *storage, void* ptr, size_t size,
-                        surf_file_t fd);
-  surf_action_t(*write) (void *storage, const void* ptr, size_t size,
-                         surf_file_t fd);
+  surf_action_t(*read) (void *storage, surf_file_t fd, sg_storage_size_t size);
+  surf_action_t(*write) (void *storage, surf_file_t fd, sg_storage_size_t size);
   surf_action_t(*stat) (void *storage, surf_file_t fd);
   surf_action_t(*ls) (void *storage, const char *path);
+  xbt_dict_t(*get_properties) (const void *storage);
+  xbt_dict_t(*get_content) (void *storage);
+  sg_storage_size_t(*get_size) (void *storage);
 } s_surf_model_extension_storage_t;
 
      /** \ingroup SURF_models
@@ -246,9 +255,18 @@ typedef struct surf_workstation_model_extension_public {
                                       and create the corresponding action */
   surf_action_t(*sleep) (void *workstation, double duration);                              /**< Make a workstation sleep during a given duration */
   e_surf_resource_state_t(*get_state) (void *workstation);                                      /**< Return the CPU state of a workstation */
+
   int (*get_core) (void *workstation); 
   double (*get_speed) (void *workstation, double load);                                    /**< Return the speed of a workstation */
   double (*get_available_speed) (void *workstation);                                       /**< Return tha available speed of a workstation */
+
+  double (*get_current_power_peak) (void *workstation);                                          /**< Return the current CPU speed of a workstation */
+  double (*get_power_peak_at) (void *workstation, int pstate_index);                     /**< Return the speed of a workstation for a specific pstate,
+                                                                                                (where higher pstate values represent lower processor speeds) */
+  int (*get_nb_pstates) (void *workstation);                                             /**< Return the number of pstates defined for a workstation (default is 1) */
+  void (*set_power_peak_at) (void *workstation, int pstate_index);                       /**< Set the processor speed of a workstation to the speed associated with the pstate_index pstate */
+  double (*get_consumed_energy) (void *workstation);                                     /**< Return the total energy consumed by a workstation */
+
    surf_action_t(*communicate) (void *workstation_src,                                     /**< Execute a communication amount between two workstations */
                                 void *workstation_dst, double size,
                                 double max_rate);
@@ -265,19 +283,22 @@ typedef struct surf_workstation_model_extension_public {
   surf_action_t(*open) (void *workstation, const char* storage,
                         const char* path);
   surf_action_t(*close) (void *workstation, surf_file_t fd);
-  surf_action_t(*read) (void *workstation, void* ptr, size_t size,
-                        surf_file_t fd);
-  surf_action_t(*write) (void *workstation, const void* ptr, size_t size,
-                         surf_file_t fd);
+  surf_action_t(*read) (void *workstation, surf_file_t fd, sg_storage_size_t size);
+  surf_action_t(*write) (void *workstation, surf_file_t fd, sg_storage_size_t size);
   surf_action_t(*stat) (void *workstation, surf_file_t fd);
   int(*unlink) (void *workstation, surf_file_t fd);
   surf_action_t(*ls) (void *workstation, const char* mount, const char *path);
-  size_t (*get_size) (void *workstation, surf_file_t fd);
+  sg_storage_size_t (*get_size) (void *workstation, surf_file_t fd);
+  xbt_dynar_t (*get_info) (void *workstation, surf_file_t fd);
 
   int (*link_shared) (const void *link);
-   xbt_dict_t(*get_properties) (const void *resource);
+  xbt_dict_t(*get_properties) (const void *resource);
   void (*add_traces) (void);
 
+  sg_storage_size_t (*get_free_size) (void *workstation,const char* name);
+  sg_storage_size_t (*get_used_size) (void *workstation,const char* name);
+  xbt_dict_t (*get_storage_list) (void *workstation);
+
 } s_surf_model_extension_workstation_t;
 
 
@@ -287,8 +308,8 @@ static inline void *surf_cpu_resource_priv(const void *host) {
 static inline void *surf_workstation_resource_priv(const void *host){
   return (void*)xbt_lib_get_level((xbt_dictelm_t)host, SURF_WKS_LEVEL);
 }
-static inline void *surf_storage_resource_priv(const void *host){
-  return (void*)xbt_lib_get_level((xbt_dictelm_t)host, SURF_STORAGE_LEVEL);
+static inline void *surf_storage_resource_priv(const void *storage){
+  return (void*)xbt_lib_get_level((xbt_dictelm_t)storage, SURF_STORAGE_LEVEL);
 }
 
 static inline void *surf_cpu_resource_by_name(const char *name) {
@@ -331,16 +352,27 @@ surf_action_t surf_workstation_execute(surf_resource_t resource, double size);
 surf_action_t surf_workstation_sleep(surf_resource_t resource, double duration);
 surf_action_t surf_workstation_open(surf_resource_t workstation, const char* mount, const char* path);
 surf_action_t surf_workstation_close(surf_resource_t workstation, surf_file_t fd);
+surf_action_t surf_workstation_read(surf_resource_t resource, surf_file_t fd, sg_storage_size_t size);
+surf_action_t surf_workstation_write(surf_resource_t resource, surf_file_t fd, sg_storage_size_t size);
+xbt_dynar_t surf_workstation_get_info(surf_resource_t resource, surf_file_t fd);
+sg_storage_size_t surf_workstation_get_free_size(surf_resource_t resource, const char* name);
+sg_storage_size_t surf_workstation_get_used_size(surf_resource_t resource, const char* name);
 surf_action_t surf_cpu_execute(surf_resource_t cpu, double size);
 surf_action_t surf_cpu_sleep(surf_resource_t cpu, double duration);
+double surf_workstation_get_current_power_peak(surf_resource_t host);
+double surf_workstation_get_power_peak_at(surf_resource_t host, int pstate_index);
+int surf_workstation_get_nb_pstates(surf_resource_t host);
+void surf_workstation_set_power_peak_at(surf_resource_t host, int pstate_index);
+double surf_workstation_get_consumed_energy(surf_resource_t host);
+xbt_dict_t surf_workstation_get_storage_list(surf_resource_t workstation);
 int surf_workstation_unlink(surf_resource_t workstation, surf_file_t fd);
 surf_action_t surf_workstation_ls(surf_resource_t workstation, const char* mount, const char *path);
 size_t surf_workstation_get_size(surf_resource_t workstation, surf_file_t fd);
-surf_action_t surf_workstation_read(surf_resource_t resource, void *ptr, size_t size, surf_file_t fd);
-surf_action_t surf_workstation_write(surf_resource_t resource, const void *ptr, size_t size, surf_file_t fd);
 int surf_network_link_is_shared(surf_cpp_resource_t link);
 double surf_network_link_get_bandwidth(surf_cpp_resource_t link);
 double surf_network_link_get_latency(surf_cpp_resource_t link);
+xbt_dict_t surf_storage_get_content(surf_resource_t resource);
+sg_storage_size_t surf_storage_get_size(surf_resource_t resource);
 void *surf_action_get_data(surf_action_t action);
 void surf_action_set_data(surf_action_t action, void *data);
 void surf_action_unref(surf_action_t action);
@@ -550,6 +582,8 @@ XBT_PUBLIC(void) surf_storage_model_init_default(void);
  */
 XBT_PUBLIC_DATA(s_surf_model_description_t) surf_storage_model_description[];
 
+XBT_PUBLIC_DATA(surf_storage_model_t) surf_storage_model;
+
 /** \ingroup SURF_models
  *  \brief The workstation model
  *
@@ -604,6 +638,16 @@ XBT_PUBLIC_DATA(s_surf_model_description_t)
  */
 XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
 
+/** \ingroup SURF_simulation
+ *  \brief List of hosts that have juste restarted and whose autorestart process should be restarted.
+ */
+XBT_PUBLIC_DATA(xbt_dynar_t) host_that_restart;
+
+/** \ingroup SURF_simulation
+ *  \brief List of hosts for which one want to be notified if they ever restart.
+ */
+XBT_PUBLIC(xbt_dict_t) watched_hosts_lib;
+
 /*******************************************/
 /*** SURF Platform *************************/
 /*******************************************/
@@ -665,7 +709,6 @@ XBT_PUBLIC(double) surf_solve(double max_date);
  *
  *  Return the current time in millisecond.
  */
-
 XBT_PUBLIC(double) surf_get_clock(void);
 
 /** \ingroup SURF_simulation
@@ -699,8 +742,6 @@ XBT_PUBLIC(xbt_dict_t) get_as_router_properties(const char* name);
 int surf_get_nthreads(void);
 void surf_set_nthreads(int nthreads);
 
-void surf_watched_hosts(void);
-
 /*
  * Returns the initial path. On Windows the initial path is
  * the current directory for the current process in the other
index e9c78c0..fdc1eb6 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 /*FIXME:DELETEstatic XBT_INLINE
     surf_resource_t surf_resource_new(size_t childsize,
                                       surf_model_t model, const char *name,
-                                      xbt_dict_t props)
+                                      xbt_dict_t props, void_f_pvoid_t free_f)
 {
   surf_resource_t res = xbt_malloc0(childsize);
   res->model = model;
   res->name = xbt_strdup(name);
   res->properties = props;
+  res->free_f=free_f;
   return res;
 }
 
 static XBT_INLINE void surf_resource_free(void *r)
 {
   surf_resource_t resource = r;
+  if(resource->free_f)
+    resource->free_f(r);
   free(resource->name);
   xbt_dict_free(&resource->properties);
   free(resource);
index 1e2ecb1..4be9408 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@ static XBT_INLINE
 
   surf_resource_lmm_t res =
       (surf_resource_lmm_t) surf_resource_new(childsize, model, name,
-                                              props);
+                                              props, NULL);
 
   res->constraint = lmm_constraint_new(system, res, constraint_value);
   res->state_current = state_init;
index ab31a17..93b09e3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3782137..3343492 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a6d848d..42a0c4d 100644 (file)
@@ -1,7 +1,7 @@
 /*  xbt/xbt_portability.h -- all system dependency                          */
 /* Private portability layer                                                */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -20,10 +20,11 @@ XBT_PUBLIC(double) xbt_os_time(void);
 XBT_PUBLIC(void) xbt_os_sleep(double sec);
 
 typedef struct s_xbt_os_timer *xbt_os_timer_t;
+
 XBT_PUBLIC(xbt_os_timer_t) xbt_os_timer_new(void);
 XBT_PUBLIC(void) xbt_os_timer_free(xbt_os_timer_t timer);
 XBT_PUBLIC(double) xbt_os_timer_elapsed(xbt_os_timer_t timer);
-
+XBT_PUBLIC(size_t) xbt_os_timer_size(void);
 
 XBT_PUBLIC(void) xbt_os_walltimer_start(xbt_os_timer_t timer);
 XBT_PUBLIC(void) xbt_os_walltimer_resume(xbt_os_timer_t timer);
index 7d61fef..3ef4c71 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -20,6 +20,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 #define OPT_TRACING_SMPI_GROUP    "tracing/smpi/group"
 #define OPT_TRACING_SMPI_COMPUTING "tracing/smpi/computing"
 #define OPT_TRACING_SMPI_INTERNALS "tracing/smpi/internals"
+#define OPT_TRACING_DISPLAY_SIZES  "tracing/smpi/display_sizes"
 #define OPT_TRACING_CATEGORIZED   "tracing/categorized"
 #define OPT_TRACING_UNCATEGORIZED "tracing/uncategorized"
 #define OPT_TRACING_MSG_PROCESS   "tracing/msg/process"
@@ -51,6 +52,7 @@ static int trace_buffer;
 static int trace_onelink_only;
 static int trace_disable_destroy;
 static int trace_basic;
+static int trace_display_sizes = 0;
 static int trace_disable_link;
 static int trace_disable_power;
 
@@ -76,6 +78,7 @@ static void TRACE_getopts(void)
   trace_onelink_only = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_ONELINK_ONLY);
   trace_disable_destroy = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY);
   trace_basic = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_BASIC);
+  trace_display_sizes = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES);
   trace_disable_link = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_LINK);
   trace_disable_power = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_POWER);
 }
@@ -178,6 +181,7 @@ int TRACE_end()
     XBT_DEBUG("Tracing is off");
     XBT_DEBUG("Tracing system is shutdown");
   }
+  xbt_dynar_free(&TRACE_start_functions); /* useful when exiting early */
   xbt_dynar_free(&TRACE_end_functions);
   return retval;
 }
@@ -283,6 +287,11 @@ int TRACE_basic (void)
   return trace_basic && TRACE_is_enabled();
 }
 
+int TRACE_display_sizes (void)
+{
+   return trace_display_sizes && trace_smpi_enabled && TRACE_is_enabled();
+}
+
 char *TRACE_get_comment (void)
 {
   return xbt_cfg_get_string(_sg_cfg_set, OPT_TRACING_COMMENT);
@@ -311,159 +320,143 @@ char *TRACE_get_viva_cat_conf (void)
 void TRACE_global_init(int *argc, char **argv)
 {
   /* name of the tracefile */
-  char *default_tracing_filename = xbt_strdup("simgrid.trace");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_FILENAME,
                    "Trace file created by the instrumented SimGrid.",
-                   xbt_cfgelm_string, &default_tracing_filename, 1, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_string, 1, 1, NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_FILENAME, "simgrid.trace");
 
   /* tracing */
-  int default_tracing = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING,
                    "Enable Tracing.",
-                   xbt_cfgelm_int, &default_tracing, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING, 0);
 
   /* register platform in the trace */
-  int default_tracing_platform = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_PLATFORM,
                    "Register the platform in the trace as a hierarchy.",
-                   xbt_cfgelm_int, &default_tracing_platform, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_PLATFORM, 0);
 
   /* register platform in the trace */
-  int default_tracing_platform_topology = 1;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_TOPOLOGY,
                    "Register the platform topology in the trace as a graph.",
-                   xbt_cfgelm_int, &default_tracing_platform_topology, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_TOPOLOGY, 1);
 
   /* smpi */
-  int default_tracing_smpi = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI,
                    "Tracing of the SMPI interface.",
-                   xbt_cfgelm_int, &default_tracing_smpi, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI, 0);
 
   /* smpi grouped */
-  int default_tracing_smpi_grouped = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_GROUP,
                    "Group MPI processes by host.",
-                   xbt_cfgelm_int, &default_tracing_smpi_grouped, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_GROUP, 0);
 
   /* smpi computing */
-  int default_tracing_smpi_computing = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING,
                    "Generate states for timing out of SMPI parts of the application",
-                   xbt_cfgelm_int, &default_tracing_smpi_computing, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_COMPUTING, 0);
 
   /* smpi internals */
-  int default_tracing_smpi_internals = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS,
                    "View internal messages sent by Collective communications in SMPI",
-                   xbt_cfgelm_int, &default_tracing_smpi_internals, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_SMPI_INTERNALS, 0);
 
   /* tracing categorized resource utilization traces */
-  int default_tracing_categorized = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_CATEGORIZED,
                    "Tracing categorized resource utilization of hosts and links.",
-                   xbt_cfgelm_int, &default_tracing_categorized, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_CATEGORIZED, 0);
 
   /* tracing uncategorized resource utilization */
-  int default_tracing_uncategorized = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_UNCATEGORIZED,
                    "Tracing uncategorized resource utilization of hosts and links.",
-                   xbt_cfgelm_int, &default_tracing_uncategorized, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_UNCATEGORIZED, 0);
 
   /* msg process */
-  int default_tracing_msg_process = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_PROCESS,
                    "Tracing of MSG process behavior.",
-                   xbt_cfgelm_int, &default_tracing_msg_process, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_MSG_PROCESS, 0);
 
   /* msg process */
-  int default_tracing_msg_vm = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_MSG_VM,
                    "Tracing of MSG process behavior.",
-                   xbt_cfgelm_int, &default_tracing_msg_vm, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_MSG_VM, 0);
 
   /* disable tracing link */
-  int default_tracing_disable_link = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_LINK,
                    "Do not trace link bandwidth and latency.",
-                   xbt_cfgelm_int, &default_tracing_disable_link, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_LINK, 0);
 
   /* disable tracing link */
-  int default_tracing_disable_power = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_POWER,
                    "Do not trace host power.",
-                   xbt_cfgelm_int, &default_tracing_disable_power, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_POWER, 0);
 
 
   /* tracing buffer */
-  int default_buffer = 1;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BUFFER,
                    "Buffer trace events to put them in temporal order.",
-                   xbt_cfgelm_int, &default_buffer, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_BUFFER, 1);
 
   /* tracing one link only */
-  int default_onelink_only = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_ONELINK_ONLY,
                    "Use only routes with one link to trace platform.",
-                   xbt_cfgelm_int, &default_onelink_only, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_ONELINK_ONLY, 0);
 
   /* disable destroy */
-  int default_disable_destroy = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY,
                    "Disable platform containers destruction.",
-                   xbt_cfgelm_int, &default_disable_destroy, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY, 0);
 
   /* basic -- Avoid extended events (impoverished trace file) */
-  int default_basic = 0;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BASIC,
                    "Avoid extended events (impoverished trace file).",
-                   xbt_cfgelm_int, &default_basic, 0, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_BASIC, 0);
+
+  /* display_sizes -- Extended events with message size information */
+  xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES,
+                   "(smpi only for now) Extended events with message size information",
+                   xbt_cfgelm_int, 0, 1, NULL, NULL);
+  xbt_cfg_setdefault_int(_sg_cfg_set, OPT_TRACING_DISPLAY_SIZES, 0);
 
   /* comment */
-  char *default_tracing_comment = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT,
                    "Comment to be added on the top of the trace file.",
-                   xbt_cfgelm_string, &default_tracing_comment, 1, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_string, 1, 1, NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT, "");
 
   /* comment_file */
-  char *default_tracing_comment_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_COMMENT_FILE,
                    "The contents of the file are added to the top of the trace file as comment.",
-                   xbt_cfgelm_string, &default_tracing_comment_file, 1, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_string, 1, 1, NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_TRACING_COMMENT_FILE, "");
 
   /* Viva graph configuration for uncategorized tracing */
-  char *default_viva_uncat_conf_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_VIVA_UNCAT_CONF,
                    "Viva Graph configuration file for uncategorized resource utilization traces.",
-                   xbt_cfgelm_string, &default_viva_uncat_conf_file, 1, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_string, 1, 1, NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_VIVA_UNCAT_CONF, "");
 
   /* Viva graph configuration for uncategorized tracing */
-  char *default_viva_cat_conf_file = xbt_strdup ("");
   xbt_cfg_register(&_sg_cfg_set, OPT_VIVA_CAT_CONF,
                    "Viva Graph configuration file for categorized resource utilization traces.",
-                   xbt_cfgelm_string, &default_viva_cat_conf_file, 1, 1,
-                   NULL, NULL);
+                   xbt_cfgelm_string, 1, 1, NULL, NULL);
+  xbt_cfg_setdefault_string(_sg_cfg_set, OPT_VIVA_CAT_CONF, "");
 
   /* instrumentation can be considered configured now */
   trace_configured = 1;
@@ -553,6 +546,10 @@ void TRACE_help (int detailed)
       "  trace. Keep in mind that the trace might be incomplete, without all the\n"
       "  information that would be registered otherwise.",
       detailed);
+  print_line (OPT_TRACING_DISPLAY_SIZES, "Only works for SMPI now. Add message size information",
+      "Message size (in bytes) is added to links, and to states. For collectives, the displayed value \n"
+      "is the more relevant to the collective (total sent by the process, usually)",
+      detailed);
   print_line (OPT_TRACING_COMMENT, "Comment to be added on the top of the trace file.",
       "  Use this to add a comment line to the top of the trace file.",
       detailed);
index aec0980..170ebb1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7febbb3..327e57c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8db2fb8..e8716bf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_header, instr, "Paje tracing event sy
 
 extern FILE *tracing_file;
 
-static void TRACE_header_PajeDefineContainerType (int basic)
+static void TRACE_header_PajeDefineContainerType (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineContainerType %d\n", PAJE_DefineContainerType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -25,7 +25,7 @@ static void TRACE_header_PajeDefineContainerType (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineVariableType (int basic)
+static void TRACE_header_PajeDefineVariableType (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineVariableType %d\n", PAJE_DefineVariableType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -39,7 +39,7 @@ static void TRACE_header_PajeDefineVariableType (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineStateType (int basic)
+static void TRACE_header_PajeDefineStateType (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineStateType %d\n", PAJE_DefineStateType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -52,7 +52,7 @@ static void TRACE_header_PajeDefineStateType (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineEventType (int basic)
+static void TRACE_header_PajeDefineEventType (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineEventType %d\n", PAJE_DefineEventType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -65,7 +65,7 @@ static void TRACE_header_PajeDefineEventType (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineLinkType (int basic)
+static void TRACE_header_PajeDefineLinkType (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineLinkType %d\n", PAJE_DefineLinkType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -82,7 +82,7 @@ static void TRACE_header_PajeDefineLinkType (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineEntityValue (int basic)
+static void TRACE_header_PajeDefineEntityValue (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineEntityValue %d\n", PAJE_DefineEntityValue);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -96,7 +96,7 @@ static void TRACE_header_PajeDefineEntityValue (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeCreateContainer (int basic)
+static void TRACE_header_PajeCreateContainer (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeCreateContainer %d\n", PAJE_CreateContainer);
   fprintf(tracing_file, "%%       Time date\n");
@@ -107,7 +107,7 @@ static void TRACE_header_PajeCreateContainer (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDestroyContainer (int basic)
+static void TRACE_header_PajeDestroyContainer (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeDestroyContainer %d\n", PAJE_DestroyContainer);
   fprintf(tracing_file, "%%       Time date\n");
@@ -116,7 +116,7 @@ static void TRACE_header_PajeDestroyContainer (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeSetVariable (int basic)
+static void TRACE_header_PajeSetVariable (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeSetVariable %d\n", PAJE_SetVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -126,7 +126,7 @@ static void TRACE_header_PajeSetVariable (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeAddVariable (int basic)
+static void TRACE_header_PajeAddVariable (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeAddVariable %d\n", PAJE_AddVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -136,7 +136,7 @@ static void TRACE_header_PajeAddVariable (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeSubVariable (int basic)
+static void TRACE_header_PajeSubVariable (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeSubVariable %d\n", PAJE_SubVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -147,7 +147,7 @@ static void TRACE_header_PajeSubVariable (int basic)
 }
 
 
-static void TRACE_header_PajeSetState (int basic)
+static void TRACE_header_PajeSetState (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeSetState %d\n", PAJE_SetState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -157,17 +157,18 @@ static void TRACE_header_PajeSetState (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajePushState (int basic)
+static void TRACE_header_PajePushState (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajePushState %d\n", PAJE_PushState);
   fprintf(tracing_file, "%%       Time date\n");
   fprintf(tracing_file, "%%       Type string\n");
   fprintf(tracing_file, "%%       Container string\n");
   fprintf(tracing_file, "%%       Value string\n");
+  if (size) fprintf(tracing_file, "%%       Size int\n");
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajePopState (int basic)
+static void TRACE_header_PajePopState (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajePopState %d\n", PAJE_PopState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -176,7 +177,7 @@ static void TRACE_header_PajePopState (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeResetState (int basic)
+static void TRACE_header_PajeResetState (int basic, int size)
 {
   if (basic) return;
 
@@ -187,7 +188,7 @@ static void TRACE_header_PajeResetState (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeStartLink (int basic)
+static void TRACE_header_PajeStartLink (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeStartLink %d\n", PAJE_StartLink);
   fprintf(tracing_file, "%%       Time date\n");
@@ -200,10 +201,11 @@ static void TRACE_header_PajeStartLink (int basic)
     fprintf(tracing_file, "%%       StartContainer string\n");
   }
   fprintf(tracing_file, "%%       Key string\n");
+  if (size) fprintf(tracing_file, "%%       Size int\n");
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeEndLink (int basic)
+static void TRACE_header_PajeEndLink (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeEndLink %d\n", PAJE_EndLink);
   fprintf(tracing_file, "%%       Time date\n");
@@ -219,7 +221,7 @@ static void TRACE_header_PajeEndLink (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeNewEvent (int basic)
+static void TRACE_header_PajeNewEvent (int basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeNewEvent %d\n", PAJE_NewEvent);
   fprintf(tracing_file, "%%       Time date\n");
@@ -229,27 +231,27 @@ static void TRACE_header_PajeNewEvent (int basic)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-void TRACE_header(int basic)
+void TRACE_header(int basic, int size)
 {
   XBT_DEBUG ("Define paje header");
-  TRACE_header_PajeDefineContainerType (basic);
-  TRACE_header_PajeDefineVariableType (basic);
-  TRACE_header_PajeDefineStateType (basic);
-  TRACE_header_PajeDefineEventType (basic);
-  TRACE_header_PajeDefineLinkType (basic);
-  TRACE_header_PajeDefineEntityValue (basic);
-  TRACE_header_PajeCreateContainer (basic);
-  TRACE_header_PajeDestroyContainer (basic);
-  TRACE_header_PajeSetVariable (basic);
-  TRACE_header_PajeAddVariable (basic);
-  TRACE_header_PajeSubVariable (basic);
-  TRACE_header_PajeSetState (basic);
-  TRACE_header_PajePushState (basic);
-  TRACE_header_PajePopState (basic);
-  TRACE_header_PajeResetState (basic);
-  TRACE_header_PajeStartLink (basic);
-  TRACE_header_PajeEndLink (basic);
-  TRACE_header_PajeNewEvent (basic);
+  TRACE_header_PajeDefineContainerType (basic, size);
+  TRACE_header_PajeDefineVariableType (basic, size);
+  TRACE_header_PajeDefineStateType (basic, size);
+  TRACE_header_PajeDefineEventType (basic, size);
+  TRACE_header_PajeDefineLinkType (basic, size);
+  TRACE_header_PajeDefineEntityValue (basic, size);
+  TRACE_header_PajeCreateContainer (basic, size);
+  TRACE_header_PajeDestroyContainer (basic, size);
+  TRACE_header_PajeSetVariable (basic, size);
+  TRACE_header_PajeAddVariable (basic, size);
+  TRACE_header_PajeSubVariable (basic, size);
+  TRACE_header_PajeSetState (basic, size);
+  TRACE_header_PajePushState (basic, size);
+  TRACE_header_PajePopState (basic, size);
+  TRACE_header_PajeResetState (basic, size);
+  TRACE_header_PajeStartLink (basic, size);
+  TRACE_header_PajeEndLink (basic, size);
+  TRACE_header_PajeNewEvent (basic, size);
 }
 
 #endif
index e3d78b2..734496d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -95,6 +95,7 @@ typedef struct s_pushState {
   container_t container;
   type_t type;
   val_t value;
+  int size;
 }s_pushState_t;
 
 typedef struct s_popState *popState_t;
@@ -116,6 +117,7 @@ typedef struct s_startLink {
   container_t sourceContainer;
   char *value;
   char *key;
+  int size;
 }s_startLink_t;
 
 typedef struct s_endLink *endLink_t;
@@ -194,7 +196,7 @@ void TRACE_paje_start(void)
   dump_comment_file (TRACE_get_comment_file());
 
   /* output header */
-  TRACE_header(TRACE_basic());
+  TRACE_header(TRACE_basic(),TRACE_display_sizes());
 
   buffer = xbt_dynar_new (sizeof(paje_event_t), NULL);
 }
@@ -338,7 +340,7 @@ static void print_pajeCreateContainer(paje_event_t event)
         ((createContainer_t)event->data)->container->father->id,
         ((createContainer_t)event->data)->container->name);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s \"%s\"\n",
+    fprintf(tracing_file, "%d %f %s %s %s \"%s\"\n",
         (int)event->event_type,
         event->timestamp,
         ((createContainer_t)event->data)->container->id,
@@ -357,7 +359,7 @@ static void print_pajeDestroyContainer(paje_event_t event)
         ((destroyContainer_t)event->data)->container->type->id,
         ((destroyContainer_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((destroyContainer_t)event->data)->container->type->id,
@@ -375,7 +377,7 @@ static void print_pajeSetVariable(paje_event_t event)
         ((setVariable_t)event->data)->container->id,
         ((setVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((setVariable_t)event->data)->type->id,
@@ -394,7 +396,7 @@ static void print_pajeAddVariable(paje_event_t event)
         ((addVariable_t)event->data)->container->id,
         ((addVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((addVariable_t)event->data)->type->id,
@@ -413,7 +415,7 @@ static void print_pajeSubVariable(paje_event_t event)
         ((subVariable_t)event->data)->container->id,
         ((subVariable_t)event->data)->value);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %f\n",
+    fprintf(tracing_file, "%d %f %s %s %f\n",
         (int)event->event_type,
         event->timestamp,
         ((subVariable_t)event->data)->type->id,
@@ -432,7 +434,7 @@ static void print_pajeSetState(paje_event_t event)
         ((setState_t)event->data)->container->id,
         ((setState_t)event->data)->value->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((setState_t)event->data)->type->id,
@@ -444,19 +446,39 @@ static void print_pajeSetState(paje_event_t event)
 static void print_pajePushState(paje_event_t event)
 {
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
-  if (event->timestamp == 0){
-    fprintf(tracing_file, "%d 0 %s %s %s\n",
-        (int)event->event_type,
-        ((pushState_t)event->data)->type->id,
-        ((pushState_t)event->data)->container->id,
-        ((pushState_t)event->data)->value->id);
+  if (!TRACE_display_sizes()){
+    if (event->timestamp == 0){
+      fprintf(tracing_file, "%d 0 %s %s %s\n",
+          (int)event->event_type,
+          ((pushState_t)event->data)->type->id,
+          ((pushState_t)event->data)->container->id,
+          ((pushState_t)event->data)->value->id);
+    }else{
+      fprintf(tracing_file, "%d %f %s %s %s\n",
+          (int)event->event_type,
+          event->timestamp,
+          ((pushState_t)event->data)->type->id,
+          ((pushState_t)event->data)->container->id,
+          ((pushState_t)event->data)->value->id);
+    }
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s\n",
-        (int)event->event_type,
-        event->timestamp,
-        ((pushState_t)event->data)->type->id,
-        ((pushState_t)event->data)->container->id,
-        ((pushState_t)event->data)->value->id);
+    if (event->timestamp == 0){
+      fprintf(tracing_file, "%d 0 %s %s %s %d\n",
+          (int)event->event_type,
+          ((pushState_t)event->data)->type->id,
+          ((pushState_t)event->data)->container->id,
+          ((pushState_t)event->data)->value->id,
+          ((pushState_t)event->data)->size);
+    }else{
+      fprintf(tracing_file, "%d %f %s %s %s %d\n",
+          (int)event->event_type,
+          event->timestamp,
+          ((pushState_t)event->data)->type->id,
+          ((pushState_t)event->data)->container->id,
+          ((pushState_t)event->data)->value->id,
+          ((pushState_t)event->data)->size);
+    }
+
   }
 }
 
@@ -469,7 +491,7 @@ static void print_pajePopState(paje_event_t event)
         ((popState_t)event->data)->type->id,
         ((popState_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((popState_t)event->data)->type->id,
@@ -486,7 +508,7 @@ static void print_pajeResetState(paje_event_t event)
         ((resetState_t)event->data)->type->id,
         ((resetState_t)event->data)->container->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((resetState_t)event->data)->type->id,
@@ -496,24 +518,47 @@ static void print_pajeResetState(paje_event_t event)
 
 static void print_pajeStartLink(paje_event_t event)
 {
+  if (!TRACE_display_sizes()){
+    if (event->timestamp == 0){
+      fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
+          (int)event->event_type,
+          ((startLink_t)event->data)->type->id,
+          ((startLink_t)event->data)->container->id,
+          ((startLink_t)event->data)->value,
+          ((startLink_t)event->data)->sourceContainer->id,
+          ((startLink_t)event->data)->key);
+    }else {
+      fprintf(tracing_file, "%d %f %s %s %s %s %s\n",
+          (int)event->event_type,
+          event->timestamp,
+          ((startLink_t)event->data)->type->id,
+          ((startLink_t)event->data)->container->id,
+          ((startLink_t)event->data)->value,
+          ((startLink_t)event->data)->sourceContainer->id,
+          ((startLink_t)event->data)->key);
+    }
+  }else{
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
-  if (event->timestamp == 0){
-    fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
-        (int)event->event_type,
-        ((startLink_t)event->data)->type->id,
-        ((startLink_t)event->data)->container->id,
-        ((startLink_t)event->data)->value,
-        ((startLink_t)event->data)->sourceContainer->id,
-        ((startLink_t)event->data)->key);
-  }else {
-    fprintf(tracing_file, "%d %lf %s %s %s %s %s\n",
-        (int)event->event_type,
-        event->timestamp,
-        ((startLink_t)event->data)->type->id,
-        ((startLink_t)event->data)->container->id,
-        ((startLink_t)event->data)->value,
-        ((startLink_t)event->data)->sourceContainer->id,
-        ((startLink_t)event->data)->key);
+    if (event->timestamp == 0){
+      fprintf(tracing_file, "%d 0 %s %s %s %s %s %d\n",
+          (int)event->event_type,
+          ((startLink_t)event->data)->type->id,
+          ((startLink_t)event->data)->container->id,
+          ((startLink_t)event->data)->value,
+          ((startLink_t)event->data)->sourceContainer->id,
+          ((startLink_t)event->data)->key,
+          ((startLink_t)event->data)->size);
+    }else {
+      fprintf(tracing_file, "%d %f %s %s %s %s %s %d\n",
+          (int)event->event_type,
+          event->timestamp,
+          ((startLink_t)event->data)->type->id,
+          ((startLink_t)event->data)->container->id,
+          ((startLink_t)event->data)->value,
+          ((startLink_t)event->data)->sourceContainer->id,
+          ((startLink_t)event->data)->key,
+          ((startLink_t)event->data)->size);
+    }
   }
 }
 
@@ -529,7 +574,7 @@ static void print_pajeEndLink(paje_event_t event)
         ((endLink_t)event->data)->destContainer->id,
         ((endLink_t)event->data)->key);
   }else {
-    fprintf(tracing_file, "%d %lf %s %s %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((endLink_t)event->data)->type->id,
@@ -550,7 +595,7 @@ static void print_pajeNewEvent (paje_event_t event)
         ((newEvent_t)event->data)->container->id,
         ((newEvent_t)event->data)->value->id);
   }else{
-    fprintf(tracing_file, "%d %lf %s %s %s\n",
+    fprintf(tracing_file, "%d %f %s %s %s\n",
         (int)event->event_type,
         event->timestamp,
         ((newEvent_t)event->data)->type->id,
@@ -797,6 +842,25 @@ void new_pajePushState (double timestamp, container_t container, type_t type, va
   ((pushState_t)(event->data))->type = type;
   ((pushState_t)(event->data))->container = container;
   ((pushState_t)(event->data))->value = value;
+  ((pushState_t)(event->data))->size = -1;
+
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
+
+  insert_into_buffer (event);
+}
+
+void new_pajePushStateWithSize (double timestamp, container_t container, type_t type, val_t value, int size)
+{
+  paje_event_t event = xbt_new0(s_paje_event_t, 1);
+  event->event_type = PAJE_PushState;
+  event->timestamp = timestamp;
+  event->print = print_pajePushState;
+  event->free = free_paje_event;
+  event->data = xbt_new0(s_pushState_t, 1);
+  ((pushState_t)(event->data))->type = type;
+  ((pushState_t)(event->data))->container = container;
+  ((pushState_t)(event->data))->value = value;
+  ((pushState_t)(event->data))->size = size;
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
 
@@ -850,6 +914,26 @@ void new_pajeStartLink (double timestamp, container_t container, type_t type, co
   ((startLink_t)(event->data))->sourceContainer = sourceContainer;
   ((startLink_t)(event->data))->value = xbt_strdup(value);
   ((startLink_t)(event->data))->key = xbt_strdup(key);
+  ((startLink_t)(event->data))->size = -1;
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
+
+  insert_into_buffer (event);
+}
+
+void new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key, int size)
+{
+  paje_event_t event = xbt_new0(s_paje_event_t, 1);
+  event->event_type = PAJE_StartLink;
+  event->timestamp = timestamp;
+  event->print = print_pajeStartLink;
+  event->free = free_paje_event;
+  event->data = xbt_new0(s_startLink_t, 1);
+  ((startLink_t)(event->data))->type = type;
+  ((startLink_t)(event->data))->container = container;
+  ((startLink_t)(event->data))->sourceContainer = sourceContainer;
+  ((startLink_t)(event->data))->value = xbt_strdup(value);
+  ((startLink_t)(event->data))->key = xbt_strdup(key);
+  ((startLink_t)(event->data))->size = size;
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);
 
index 6773dd9..a2e5748 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index d853fba..d758703 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@ extern "C" {
 #endif
 
 /* instr_paje_header.c */
-void TRACE_header(int basic);
+void TRACE_header(int basic, int size);
 
 /* from paje.c */
 void TRACE_paje_start(void);
@@ -126,9 +126,11 @@ XBT_PUBLIC(void) new_pajeAddVariable (double timestamp, container_t container, t
 XBT_PUBLIC(void) new_pajeSubVariable (double timestamp, container_t container, type_t type, double value);
 XBT_PUBLIC(void) new_pajeSetState (double timestamp, container_t container, type_t type, val_t value);
 XBT_PUBLIC(void) new_pajePushState (double timestamp, container_t container, type_t type, val_t value);
+XBT_PUBLIC(void) new_pajePushStateWithSize (double timestamp, container_t container, type_t type, val_t value, int size);
 XBT_PUBLIC(void) new_pajePopState (double timestamp, container_t container, type_t type);
 XBT_PUBLIC(void) new_pajeResetState (double timestamp, container_t container, type_t type);
 XBT_PUBLIC(void) new_pajeStartLink (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key);
+XBT_PUBLIC(void) new_pajeStartLinkWithSize (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key, int size);
 XBT_PUBLIC(void) new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer, const char *value, const char *key);
 XBT_PUBLIC(void) new_pajeNewEvent (double timestamp, container_t container, type_t type, val_t value);
 
@@ -151,6 +153,7 @@ int TRACE_disable_power(void);
 int TRACE_onelink_only (void);
 int TRACE_disable_destroy (void);
 int TRACE_basic (void);
+int TRACE_display_sizes (void);
 char *TRACE_get_comment (void);
 char *TRACE_get_comment_file (void);
 char *TRACE_get_filename(void);
index d469737..d6b8891 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b46cc9d..2932fc6 100644 (file)
@@ -1,10 +1,8 @@
-/*
- * jedule_sd_binding.c
- *
- *  Created on: Dec 2, 2010
- *      Author: sascha
- */
+/* Copyright (c) 2010-2013. 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/asserts.h"
 #include "xbt/dynar.h"
@@ -28,7 +26,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, jedule,
 
 jedule_t jedule;
 
-void jedule_log_sd_event(SD_task_t task) {
+void jedule_log_sd_event(SD_task_t task)
+{
   xbt_dynar_t host_list;
   jed_event_t event;
   int i;
@@ -55,7 +54,8 @@ void jedule_log_sd_event(SD_task_t task) {
 }
 
 static void create_hierarchy(AS_t current_comp,
-    jed_simgrid_container_t current_container) {
+                             jed_simgrid_container_t current_container)
+{
   xbt_dict_cursor_t cursor = NULL;
   unsigned int dynar_cursor;
   char *key;
@@ -69,7 +69,7 @@ static void create_hierarchy(AS_t current_comp,
 
     hosts = xbt_dynar_new(sizeof(char*), NULL);
 
-    xbt_dynar_foreach(current_comp->index_network_elm, 
+    xbt_dynar_foreach(current_comp->index_network_elm,
           dynar_cursor, network_elem) {
       xbt_dynar_push_as(hosts, char*, network_elem->name);
     }
@@ -87,8 +87,8 @@ static void create_hierarchy(AS_t current_comp,
   }
 }
 
-void jedule_setup_platform() {
-
+void jedule_setup_platform()
+{
   AS_t root_comp;
   // e_surf_network_element_type_t type;
 
@@ -111,36 +111,40 @@ void jedule_setup_platform() {
 }
 
 
-void jedule_sd_cleanup() {
-
+void jedule_sd_cleanup()
+{
   jedule_cleanup_output();
 }
 
-void jedule_sd_init() {
-
+void jedule_sd_init()
+{
   jedule_init_output();
 }
 
 void jedule_sd_exit(void)
 {
-  jed_free_jedule(jedule);
-  jedule = NULL;
+  if (jedule) {
+    jed_free_jedule(jedule);
+    jedule = NULL;
+  }
 }
 
-void jedule_sd_dump() {
-  FILE *fh;
+void jedule_sd_dump()
+{
+  if (jedule) {
+    FILE *fh;
     char fname[1024];
 
     fname[0] = '\0';
     strcat(fname, xbt_binary_name);
     strcat(fname, ".jed\0");
-    
-  fh = fopen(fname, "w");
 
-  write_jedule_output(fh, jedule, jedule_event_list, NULL);
+    fh = fopen(fname, "w");
 
-  fclose(fh);
+    write_jedule_output(fh, jedule, jedule_event_list, NULL);
 
+    fclose(fh);
+  }
 }
 
 #endif
index 340b1b0..2b2fe9d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
@@ -24,23 +25,51 @@ void *start_data_libsimgrid, *start_bss_libsimgrid;
 void *start_data_binary, *start_bss_binary;
 void *start_text_binary;
 
-static mc_mem_region_t MC_region_new(int type, 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);
+/************************************  Free functions **************************************/
+/*****************************************************************************************/
 
-static void MC_snapshot_add_region(mc_snapshot_t snapshot, int type, void *start_addr, size_t size);
+static void MC_snapshot_stack_free(mc_snapshot_stack_t s){
+  if(s){
+    xbt_dynar_free(&(s->local_variables));
+    xbt_free(s);
+  }
+}
 
-static void add_value(xbt_dynar_t *list, const char *type, unsigned long int val);
-static xbt_dynar_t take_snapshot_stacks(mc_snapshot_t *s, void *heap);
-static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap);
-static void print_local_variables_values(xbt_dynar_t all_variables);
-static void *get_stack_pointer(void *stack_context, void *heap);
+static void MC_snapshot_stack_free_voidp(void *s){
+  MC_snapshot_stack_free((mc_snapshot_stack_t) * (void **) s);
+}
+
+static void local_variable_free(local_variable_t v){
+  xbt_free(v->frame);
+  xbt_free(v->name);
+  xbt_free(v->type);
+  xbt_free(v);
+}
 
-static void snapshot_stack_free(mc_snapshot_stack_t s);
-static xbt_dynar_t take_snapshot_ignore(void);
+static void local_variable_free_voidp(void *v){
+  local_variable_free((local_variable_t) * (void **) v);
+}
 
-static void get_hash_global(char *snapshot_hash, void *data1, void *data2);
-static void get_hash_local(char *snapshot_hash, xbt_dynar_t stacks);
+static void MC_region_destroy(mc_mem_region_t reg)
+{
+  xbt_free(reg->data);
+  xbt_free(reg);
+}
+
+void MC_free_snapshot(mc_snapshot_t snapshot){
+  unsigned int i;
+  for(i=0; i < NB_REGIONS; i++)
+    MC_region_destroy(snapshot->regions[i]);
+
+  xbt_free(snapshot->stack_sizes);
+  xbt_dynar_free(&(snapshot->stacks));
+  xbt_dynar_free(&(snapshot->to_ignore));
+  xbt_free(snapshot);
+}
+
+
+/*******************************  Snapshot regions ********************************/
+/*********************************************************************************/
 
 static mc_mem_region_t MC_region_new(int type, void *start_addr, size_t size)
 {
@@ -61,16 +90,9 @@ static void MC_region_restore(mc_mem_region_t reg)
     before copying the data */
  
   memcpy(reg->start_addr, reg->data, reg->size);
   return;
 }
 
-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, int type, void *start_addr, size_t size)
 {
   mc_mem_region_t new_reg = MC_region_new(type, start_addr, size);
@@ -78,7 +100,7 @@ static void MC_snapshot_add_region(mc_snapshot_t snapshot, int type, void *start
   return;
 } 
 
-static void get_memory_regions(mc_snapshot_t snapshot){
+static void MC_get_memory_regions(mc_snapshot_t snapshot){
 
   FILE *fp;
   char *line = NULL;
@@ -188,7 +210,7 @@ void MC_init_memory_map_info(){
  
   unsigned int i = 0;
   s_map_region_t reg;
-  memory_map_t maps = get_memory_map();
+  memory_map_t maps = MC_get_memory_map();
 
   while (i < maps->mapsize) {
     reg = maps->regions[i];
@@ -227,63 +249,11 @@ void MC_init_memory_map_info(){
     i++;
   }
    
-  free_memory_map(maps);
+  MC_free_memory_map(maps);
 
 }
 
-mc_snapshot_t MC_take_snapshot()
-{
-
-  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
-  
-  MC_SET_RAW_MEM;
-
-  mc_snapshot_t snapshot = xbt_new0(s_mc_snapshot_t, 1);
-  snapshot->nb_processes = xbt_swag_size(simix_global->process_list);
-
-  /* Save the std heap and the writable mapped pages of libsimgrid and binary */
-  get_memory_regions(snapshot);
-
-  snapshot->to_ignore = take_snapshot_ignore();
-
-  if(_sg_mc_visited > 0 || strcmp(_sg_mc_property_file,"")){
-    snapshot->stacks = take_snapshot_stacks(&snapshot, snapshot->regions[0]->data);
-    get_hash_global(snapshot->hash_global, snapshot->regions[1]->data, snapshot->regions[2]->data);
-    get_hash_local(snapshot->hash_local, snapshot->stacks);
-  }
-
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem)
-    MC_SET_RAW_MEM;
-
-  return snapshot;
-
-}
-
-void MC_restore_snapshot(mc_snapshot_t snapshot)
-{
-  unsigned int i;
-  for(i=0; i < NB_REGIONS; i++){
-    MC_region_restore(snapshot->regions[i]);
-  }
-
-}
-
-void MC_free_snapshot(mc_snapshot_t snapshot)
-{
-  unsigned int i;
-  for(i=0; i < NB_REGIONS; i++)
-    MC_region_destroy(snapshot->regions[i]);
-
-  xbt_free(snapshot->stack_sizes);
-  xbt_dynar_free(&(snapshot->stacks));
-  xbt_dynar_free(&(snapshot->to_ignore));
-  xbt_free(snapshot);
-}
-
-
-void get_libsimgrid_plt_section(){
+void MC_get_libsimgrid_plt_section(){
 
   FILE *fp;
   char *line = NULL;            /* Temporal storage for each line that is readed */
@@ -348,7 +318,7 @@ void get_libsimgrid_plt_section(){
 
 }
 
-void get_binary_plt_section(){
+void MC_get_binary_plt_section(){
 
   FILE *fp;
   char *line = NULL;            /* Temporal storage for each line that is readed */
@@ -411,56 +381,104 @@ void get_binary_plt_section(){
 
 }
 
-static void add_value(xbt_dynar_t *list, const char *type, unsigned long int val){
-  variable_value_t value = xbt_new0(s_variable_value_t, 1);
-  value->type = strdup(type);
-  if(strcmp(type, "value") == 0){
-    value->value.res = val;
-  }else{
-    value->value.address = (void *)val;
-  }
-  xbt_dynar_push(*list, &value);
-}
+/************************************* Take Snapshot ************************************/
+/****************************************************************************************/
 
-static xbt_dynar_t take_snapshot_stacks(mc_snapshot_t *snapshot, void *heap){
-
-  xbt_dynar_t res = xbt_dynar_new(sizeof(s_mc_snapshot_stack_t), snapshot_stack_free_voidp);
-
-  unsigned int cursor = 0;
-  stack_region_t current_stack;
+static void MC_get_hash_global(char *snapshot_hash, void *data1, void *data2){
   
-  xbt_dynar_foreach(stacks_areas, cursor, current_stack){
-    mc_snapshot_stack_t st = xbt_new(s_mc_snapshot_stack_t, 1);
-    st->local_variables = get_local_variables_values(current_stack->context, heap);
-    st->stack_pointer = get_stack_pointer(current_stack->context, heap);
-    xbt_dynar_push(res, &st);
-    (*snapshot)->stack_sizes = xbt_realloc((*snapshot)->stack_sizes, (cursor + 1) * sizeof(size_t));
-    (*snapshot)->stack_sizes[cursor] = current_stack->size - ((char *)st->stack_pointer - (char *)((char *)heap + ((char *)current_stack->address - (char *)std_heap)));
-  }
+  /* unsigned int cursor = 0; */
+  /* size_t offset;  */
+  /* global_variable_t current_var;  */
+  /* void *addr_pointed = NULL; */
+  /* void *res = NULL; */
 
-  return res;
+  /* xbt_strbuff_t clear = xbt_strbuff_new(); */
+  
+  /* xbt_dynar_foreach(mc_global_variables, cursor, current_var){ */
+  /*   if(current_var->address < start_data_libsimgrid){ /\* binary *\/ */
+  /*     offset = (char *)current_var->address - (char *)start_data_binary; */
+  /*     addr_pointed = *((void **)((char *)data2 + offset)); */
+  /*     if(((addr_pointed >= start_plt_binary && addr_pointed <= end_plt_binary)) || ((addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE ))) */
+  /*       continue; */
+  /*     res = xbt_malloc0(current_var->size + 1); */
+  /*     memset(res, 0, current_var->size + 1); */
+  /*     memcpy(res, (char*)data2 + offset, current_var->size); */
+  /*   }else{ /\* libsimgrid *\/ */
+  /*     offset = (char *)current_var->address - (char *)start_data_libsimgrid; */
+  /*     addr_pointed = *((void **)((char *)data1 + offset)); */
+  /*     if((addr_pointed >= start_plt_libsimgrid && addr_pointed <= end_plt_libsimgrid) || (addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE )) */
+  /*       continue; */
+  /*     res = xbt_malloc0(current_var->size + 1); */
+  /*     memset(res, 0, current_var->size + 1); */
+  /*     memcpy(res, (char*)data1 + offset, current_var->size); */
+  /*   } */
+  /*   if(res != NULL){ */
+  /*     xbt_strbuff_append(clear, (const char*)res); */
+  /*     xbt_free(res); */
+  /*     res = NULL; */
+  /*   } */
+  /* } */
+
+  /* xbt_sha(clear->data, snapshot_hash); */
+
+  /* xbt_strbuff_free(clear); */
 
 }
 
-static void *get_stack_pointer(void *stack_context, void *heap){
-
-  unw_cursor_t c;
-  int ret;
-  unw_word_t sp;
-
-  ret = unw_init_local(&c, (unw_context_t *)stack_context);
-  if(ret < 0){
-    XBT_INFO("unw_init_local failed");
-    xbt_abort();
-  }
-
-  unw_get_reg(&c, UNW_REG_SP, &sp);
-
-  return ((char *)heap + (size_t)(((char *)((long)sp) - (char*)std_heap)));
+static void MC_get_hash_local(char *snapshot_hash, xbt_dynar_t stacks){
+
+  /* xbt_dynar_t tokens = NULL, s_tokens = NULL; */
+  /* unsigned int cursor1 = 0, cursor2 = 0; */
+  /* mc_snapshot_stack_t current_stack; */
+  /* char *frame_name = NULL; */
+  /* void *addr; */
+
+  /* xbt_strbuff_t clear = xbt_strbuff_new(); */
+
+  /* while(cursor1 < xbt_dynar_length(stacks)){ */
+  /*   current_stack = xbt_dynar_get_as(stacks, cursor1, mc_snapshot_stack_t); */
+  /*   tokens = xbt_str_split(current_stack->local_variables->data, NULL); */
+  /*   cursor2 = 0; */
+  /*   while(cursor2 < xbt_dynar_length(tokens)){ */
+  /*     s_tokens = xbt_str_split(xbt_dynar_get_as(tokens, cursor2, char *), "="); */
+  /*     if(xbt_dynar_length(s_tokens) > 1){ */
+  /*       if(strcmp(xbt_dynar_get_as(s_tokens, 0, char *), "frame_name") == 0){ */
+  /*         xbt_free(frame_name); */
+  /*         frame_name = xbt_strdup(xbt_dynar_get_as(s_tokens, 1, char *)); */
+  /*         xbt_strbuff_append(clear, (const char*)xbt_dynar_get_as(tokens, cursor2, char *)); */
+  /*         cursor2++; */
+  /*         xbt_dynar_free(&s_tokens); */
+  /*         continue; */
+  /*       } */
+  /*       addr = (void *) strtoul(xbt_dynar_get_as(s_tokens, 1, char *), NULL, 16); */
+  /*       if(addr > std_heap && (char *)addr <= (char *)std_heap + STD_HEAP_SIZE){ */
+  /*         cursor2++; */
+  /*         xbt_dynar_free(&s_tokens); */
+  /*         continue; */
+  /*       } */
+  /*       if(is_stack_ignore_variable(frame_name, xbt_dynar_get_as(s_tokens, 0, char *))){ */
+  /*         cursor2++; */
+  /*         xbt_dynar_free(&s_tokens); */
+  /*         continue; */
+  /*       } */
+  /*       xbt_strbuff_append(clear, (const char *)xbt_dynar_get_as(tokens, cursor2, char *)); */
+  /*     } */
+  /*     xbt_dynar_free(&s_tokens); */
+  /*     cursor2++; */
+  /*   } */
+  /*   xbt_dynar_free(&tokens); */
+  /*   cursor1++; */
+  /* } */
+
+  /* xbt_free(frame_name); */
+
+  /* xbt_sha(clear->data, snapshot_hash); */
+
+  /* xbt_strbuff_free(clear); */
 
 }
 
-static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap){
+static xbt_dynar_t MC_get_local_variables_values(void *stack_context){
   
   unw_cursor_t c;
   int ret;
@@ -475,82 +493,73 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap)
 
   unw_word_t ip, sp, off;
   dw_frame_t frame;
-  xbt_dynar_t compose = xbt_dynar_new(sizeof(variable_value_t), variable_value_free_voidp);
 
-  xbt_strbuff_t variables = xbt_strbuff_new();
-  xbt_dict_cursor_t dict_cursor;
-  char *variable_name;
-  dw_local_variable_t current_variable;
-  unsigned int cursor = 0, cursor2 = 0;
+  unsigned int cursor = 0;
+  dw_variable_t current_variable;
   dw_location_entry_t entry = NULL;
   dw_location_t location_entry = NULL;
   unw_word_t res;
-  int frame_found = 0;
+  int frame_found = 0, region_type;
   void *frame_pointer_address = NULL;
-  long true_ip;
-  char *to_append;
+  long true_ip, value;
+  int stop = 0;
+
+  xbt_dynar_t variables = xbt_dynar_new(sizeof(local_variable_t), local_variable_free_voidp);
 
-  while(ret >= 0){
+  while(ret >= 0 && !stop){
 
     unw_get_reg(&c, UNW_REG_IP, &ip);
     unw_get_reg(&c, UNW_REG_SP, &sp);
 
     unw_get_proc_name(&c, frame_name, sizeof (frame_name), &off);
 
-    frame = xbt_dict_get_or_null(mc_local_variables, frame_name);
+    if(!strcmp(frame_name, "smx_ctx_sysv_wrapper")) /* Stop before context switch with maestro */
+      stop = 1;
+
+    if((long)ip > (long)start_text_libsimgrid)
+      frame = xbt_dict_get_or_null(mc_local_variables_libsimgrid, frame_name);
+    else
+      frame = xbt_dict_get_or_null(mc_local_variables_binary, frame_name);
 
     if(frame == NULL){
-      xbt_dynar_free(&compose);
-      xbt_dict_cursor_free(&dict_cursor);
-      return variables;
+      ret = unw_step(&c);
+      continue;
     }
-
-    to_append = bprintf("frame_name=%s\n", frame_name);
-    xbt_strbuff_append(variables, to_append);
-    xbt_free(to_append);
-    to_append = bprintf("ip=%lx\n", (unsigned long)ip);
-    xbt_strbuff_append(variables, to_append);
-    xbt_free(to_append);
     
     true_ip = (long)frame->low_pc + (long)off;
+    frame_pointer_address = NULL;
 
     /* Get frame pointer */
     switch(frame->frame_base->type){
     case e_dw_loclist:
-      while((cursor < xbt_dynar_length(frame->frame_base->location.loclist)) && frame_found == 0){
+      cursor = 0;
+      while(cursor < xbt_dynar_length(frame->frame_base->location.loclist) && !frame_found){
         entry = xbt_dynar_get_as(frame->frame_base->location.loclist, cursor, dw_location_entry_t);
         if((true_ip >= entry->lowpc) && (true_ip < entry->highpc)){
           frame_found = 1;
           switch(entry->location->type){
           case e_dw_compose:
-            xbt_dynar_reset(compose);
-            cursor2 = 0;
-            while(cursor2 < xbt_dynar_length(entry->location->location.compose)){
-              location_entry = xbt_dynar_get_as(entry->location->location.compose, cursor2, dw_location_t);
+            if(xbt_dynar_length(entry->location->location.compose) > 1){
+              frame_pointer_address = NULL; /* TODO : location list with optimizations enabled */
+            }else{
+              location_entry = xbt_dynar_get_as(entry->location->location.compose, 0, dw_location_t);
               switch(location_entry->type){
               case e_dw_register:
                 unw_get_reg(&c, location_entry->location.reg, &res);
-                add_value(&compose, "address", (long)res);
+                frame_pointer_address = (void*)(long)res;
                 break;
               case e_dw_bregister_op:
                 unw_get_reg(&c, location_entry->location.breg_op.reg, &res);
-                add_value(&compose, "address", (long)res + location_entry->location.breg_op.offset);
+                frame_pointer_address = (void*)((long)res + location_entry->location.breg_op.offset);
                 break;
               default:
-                xbt_dynar_reset(compose);
+                frame_pointer_address = NULL; /* FIXME : implement other cases (with optimizations enabled) */
                 break;
               }
-              cursor2++;
-            }
-
-            if(!xbt_dynar_is_empty(compose)){
-              frame_pointer_address = xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address ; 
-              xbt_dynar_reset(compose);
             }
             break;
-          default :
-            frame_pointer_address = NULL;
+          default:
+            frame_pointer_address = NULL; /* FIXME : implement other cases (with optimizations enabled) */
             break;
           }
         }
@@ -558,229 +567,119 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap)
       }
       break;
     default :
-      frame_pointer_address = NULL;
+      frame_pointer_address = NULL; /* FIXME : implement other cases (with optimizations enabled)*/
       break;
     }
 
     frame_found = 0;
     cursor = 0;
 
-    xbt_dict_foreach(frame->variables, dict_cursor, variable_name, current_variable){
-      if(current_variable->location != NULL){
-        switch(current_variable->location->type){
+    xbt_dynar_foreach(frame->variables, cursor, current_variable){
+      
+      if((long)ip > (long)start_text_libsimgrid)
+        region_type = 1;
+      else
+        region_type = 2;
+
+      local_variable_t new_var = xbt_new0(s_local_variable_t, 1);
+      new_var->frame = xbt_strdup(frame_name);
+      new_var->ip = (unsigned long)ip;
+      new_var->name = xbt_strdup(current_variable->name);
+      new_var->type = strdup(current_variable->type_origin);
+      new_var->region= region_type;
+      
+      if(current_variable->address.location != NULL){
+        switch(current_variable->address.location->type){
         case e_dw_compose:
-          xbt_dynar_reset(compose);
-          cursor = 0;
-          while(cursor < xbt_dynar_length(current_variable->location->location.compose)){
-            location_entry = xbt_dynar_get_as(current_variable->location->location.compose, cursor, dw_location_t);
+          if(xbt_dynar_length(current_variable->address.location->location.compose) > 1){
+            /* TODO : location list with optimizations enabled */
+          }else{
+            location_entry = xbt_dynar_get_as(current_variable->address.location->location.compose, 0, dw_location_t);
+            
             switch(location_entry->type){
             case e_dw_register:
               unw_get_reg(&c, location_entry->location.reg, &res);
-              add_value(&compose, "value", (long)res);
+              value = (long)res;
               break;
             case e_dw_bregister_op:
               unw_get_reg(&c, location_entry->location.breg_op.reg, &res);
-              add_value(&compose, "address", (long)res + location_entry->location.breg_op.offset);
+              value = (long)res + location_entry->location.breg_op.offset;
               break;
             case e_dw_fbregister_op:
               if(frame_pointer_address != NULL)
-                add_value(&compose, "address", (long)((char *)frame_pointer_address + location_entry->location.fbreg_op));
+                value = (long)((char *)frame_pointer_address + location_entry->location.fbreg_op);
+              else
+                value = 0;
               break;
             default:
-              xbt_dynar_reset(compose);
+              value = 0; /* FIXME : implement other cases (with optimizations enabled)*/
               break;
             }
-            cursor++;
-          }
-          
-          if(!xbt_dynar_is_empty(compose)){
-            if(strcmp(xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->type, "value") == 0){
-              to_append = bprintf("%s=%lx\n", current_variable->name, xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.res);
-              xbt_strbuff_append(variables, to_append);
-              xbt_free(to_append);
-            }else{
-              if((long)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address < 0 || *((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) == NULL){
-                to_append = bprintf("%s=NULL\n", current_variable->name);
-                xbt_strbuff_append(variables, to_append);
-                xbt_free(to_append);
-              }else if(((long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) > 0xffffffff) || ((long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1,variable_value_t)->value.address) < (long)start_text_binary)){
-                to_append = bprintf("%s=%u\n", current_variable->name, (unsigned int)(long)*((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address));
-                xbt_strbuff_append(variables, to_append);
-                xbt_free(to_append);
-              }else{ 
-                to_append = bprintf("%s=%p\n", current_variable->name, *((void**)xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address));
-                xbt_strbuff_append(variables, to_append);
-                xbt_free(to_append);
-              }
-            }
-            xbt_dynar_reset(compose);
-          }else{
-            to_append = bprintf("%s=undefined\n", current_variable->name);
-            xbt_strbuff_append(variables, to_append);
-            xbt_free(to_append);
+
+            if(value)
+              new_var->address = (void *)value;
+            else
+              new_var->address = NULL;
           }
           break;
         default :
           break;
         }
-      }else{
-        to_append = bprintf("%s=undefined\n", current_variable->name);
-        xbt_strbuff_append(variables, to_append);
-        xbt_free(to_append);
       }
-    }    
+
+      xbt_dynar_push(variables, &new_var);
+
+    }
+
     ret = unw_step(&c);
      
   }
 
-  xbt_dynar_free(&compose);
-  xbt_dict_cursor_free(&dict_cursor);
-
   return variables;
 
 }
 
-static void print_local_variables_values(xbt_dynar_t all_variables){
 
-  unsigned cursor = 0;
-  mc_snapshot_stack_t stack;
-
-  xbt_dynar_foreach(all_variables, cursor, stack){
-    XBT_INFO("%s", stack->local_variables->data);
-  }
-}
+static void *MC_get_stack_pointer(void *stack_context, void *heap){
 
+  unw_cursor_t c;
+  int ret;
+  unw_word_t sp;
 
-static void snapshot_stack_free(mc_snapshot_stack_t s){
-  if(s){
-    xbt_free(s->local_variables->data);
-    xbt_free(s->local_variables);
-    xbt_free(s);
+  ret = unw_init_local(&c, (unw_context_t *)stack_context);
+  if(ret < 0){
+    XBT_INFO("unw_init_local failed");
+    xbt_abort();
   }
-}
 
-void snapshot_stack_free_voidp(void *s){
-  snapshot_stack_free((mc_snapshot_stack_t) * (void **) s);
-}
-
-mc_snapshot_t SIMIX_pre_mc_snapshot(smx_simcall_t simcall){
-  return MC_take_snapshot();
-}
+  unw_get_reg(&c, UNW_REG_SP, &sp);
 
-void *MC_snapshot(void){
+  return ((char *)heap + (size_t)(((char *)((long)sp) - (char*)std_heap)));
 
-  return simcall_mc_snapshot();
-  
 }
 
-void variable_value_free(variable_value_t v){
-  if(v){
-    xbt_free(v->type);
-    xbt_free(v);
-  }
-}
+static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t *snapshot, void *heap){
 
-void variable_value_free_voidp(void* v){
-  variable_value_free((variable_value_t) * (void **)v);
-}
+  xbt_dynar_t res = xbt_dynar_new(sizeof(s_mc_snapshot_stack_t), MC_snapshot_stack_free_voidp);
 
-static void get_hash_global(char *snapshot_hash, void *data1, void *data2){
-  
   unsigned int cursor = 0;
-  size_t offset; 
-  global_variable_t current_var; 
-  void *addr_pointed = NULL;
-  void *res = NULL;
-
-  xbt_strbuff_t clear = xbt_strbuff_new();
+  stack_region_t current_stack;
   
-  xbt_dynar_foreach(mc_global_variables, cursor, current_var){
-    if(current_var->address < start_data_libsimgrid){ /* binary */
-      offset = (char *)current_var->address - (char *)start_data_binary;
-      addr_pointed = *((void **)((char *)data2 + offset));
-      if(((addr_pointed >= start_plt_binary && addr_pointed <= end_plt_binary)) || ((addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE )))
-        continue;
-      res = xbt_malloc0(current_var->size + 1);
-      memset(res, 0, current_var->size + 1);
-      memcpy(res, (char*)data2 + offset, current_var->size);
-    }else{ /* libsimgrid */
-      offset = (char *)current_var->address - (char *)start_data_libsimgrid;
-      addr_pointed = *((void **)((char *)data1 + offset));
-      if((addr_pointed >= start_plt_libsimgrid && addr_pointed <= end_plt_libsimgrid) || (addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE ))
-        continue;
-      res = xbt_malloc0(current_var->size + 1);
-      memset(res, 0, current_var->size + 1);
-      memcpy(res, (char*)data1 + offset, current_var->size);
-    }
-    if(res != NULL){
-      xbt_strbuff_append(clear, (const char*)res);
-      xbt_free(res);
-      res = NULL;
-    }
-  }
-
-  xbt_sha(clear->data, snapshot_hash);
-
-  xbt_strbuff_free(clear);
-
-}
-
-static void get_hash_local(char *snapshot_hash, xbt_dynar_t stacks){
-
-  xbt_dynar_t tokens = NULL, s_tokens = NULL;
-  unsigned int cursor1 = 0, cursor2 = 0;
-  mc_snapshot_stack_t current_stack;
-  char *frame_name = NULL;
-  void *addr;
-
-  xbt_strbuff_t clear = xbt_strbuff_new();
-
-  while(cursor1 < xbt_dynar_length(stacks)){
-    current_stack = xbt_dynar_get_as(stacks, cursor1, mc_snapshot_stack_t);
-    tokens = xbt_str_split(current_stack->local_variables->data, NULL);
-    cursor2 = 0;
-    while(cursor2 < xbt_dynar_length(tokens)){
-      s_tokens = xbt_str_split(xbt_dynar_get_as(tokens, cursor2, char *), "=");
-      if(xbt_dynar_length(s_tokens) > 1){
-        if(strcmp(xbt_dynar_get_as(s_tokens, 0, char *), "frame_name") == 0){
-          xbt_free(frame_name);
-          frame_name = xbt_strdup(xbt_dynar_get_as(s_tokens, 1, char *));
-          xbt_strbuff_append(clear, (const char*)xbt_dynar_get_as(tokens, cursor2, char *));
-          cursor2++;
-          xbt_dynar_free(&s_tokens);
-          continue;
-        }
-        addr = (void *) strtoul(xbt_dynar_get_as(s_tokens, 1, char *), NULL, 16);
-        if(addr > std_heap && (char *)addr <= (char *)std_heap + STD_HEAP_SIZE){
-          cursor2++;
-          xbt_dynar_free(&s_tokens);
-          continue;
-        }
-        if(is_stack_ignore_variable(frame_name, xbt_dynar_get_as(s_tokens, 0, char *))){
-          cursor2++;
-          xbt_dynar_free(&s_tokens);
-          continue;
-        }
-        xbt_strbuff_append(clear, (const char *)xbt_dynar_get_as(tokens, cursor2, char *));
-      }
-      xbt_dynar_free(&s_tokens);
-      cursor2++;
-    }
-    xbt_dynar_free(&tokens);
-    cursor1++;
+  xbt_dynar_foreach(stacks_areas, cursor, current_stack){
+    mc_snapshot_stack_t st = xbt_new(s_mc_snapshot_stack_t, 1);
+    st->local_variables = MC_get_local_variables_values(current_stack->context);
+    st->stack_pointer = MC_get_stack_pointer(current_stack->context, heap);
+    st->real_address = current_stack->address;
+    xbt_dynar_push(res, &st);
+    (*snapshot)->stack_sizes = xbt_realloc((*snapshot)->stack_sizes, (cursor + 1) * sizeof(size_t));
+    (*snapshot)->stack_sizes[cursor] = current_stack->size - ((char *)st->stack_pointer - (char *)((char *)heap + ((char *)current_stack->address - (char *)std_heap)));
   }
 
-  xbt_free(frame_name);
-
-  xbt_sha(clear->data, snapshot_hash);
-
-  xbt_strbuff_free(clear);
+  return res;
 
 }
 
-
-static xbt_dynar_t take_snapshot_ignore(){
+static xbt_dynar_t MC_take_snapshot_ignore(){
   
   if(mc_heap_comparison_ignore == NULL)
     return NULL;
@@ -803,3 +702,64 @@ static xbt_dynar_t take_snapshot_ignore(){
   return cpy;
 
 }
+
+static void MC_dump_checkpoint_ignore(mc_snapshot_t snapshot){
+  
+  unsigned int cursor = 0;
+  mc_checkpoint_ignore_region_t region;
+  size_t offset;
+  
+  xbt_dynar_foreach(mc_checkpoint_ignore, cursor, region){
+    if(region->addr > snapshot->regions[0]->start_addr && (char *)(region->addr) < (char *)snapshot->regions[0]->start_addr + STD_HEAP_SIZE){
+      offset = (char *)region->addr - (char *)snapshot->regions[0]->start_addr;
+      memset((char *)snapshot->regions[0]->data + offset, 0, region->size);
+    }else if(region->addr > snapshot->regions[2]->start_addr && (char *)(region->addr) < (char*)snapshot->regions[2]->start_addr + snapshot->regions[2]->size){
+      offset = (char *)region->addr - (char *)snapshot->regions[2]->start_addr;
+      memset((char *)snapshot->regions[2]->data + offset, 0, region->size);
+    }else if(region->addr > snapshot->regions[1]->start_addr && (char *)(region->addr) < (char*)snapshot->regions[1]->start_addr + snapshot->regions[1]->size){
+      offset = (char *)region->addr - (char *)snapshot->regions[1]->start_addr;
+      memset((char *)snapshot->regions[1]->data + offset, 0, region->size);
+    }
+  }
+
+}
+
+
+mc_snapshot_t MC_take_snapshot(int num_state){
+
+  mc_snapshot_t snapshot = xbt_new0(s_mc_snapshot_t, 1);
+  snapshot->nb_processes = xbt_swag_size(simix_global->process_list);
+
+  /* Save the std heap and the writable mapped pages of libsimgrid and binary */
+  MC_get_memory_regions(snapshot);
+
+  snapshot->to_ignore = MC_take_snapshot_ignore();
+
+  if(_sg_mc_visited > 0 || strcmp(_sg_mc_property_file,"")){
+    snapshot->stacks = MC_take_snapshot_stacks(&snapshot, snapshot->regions[0]->data);
+    //MC_get_hash_global(snapshot->hash_global, snapshot->regions[1]->data, snapshot->regions[2]->data);
+    //MC_get_hash_local(snapshot->hash_local, snapshot->stacks);
+  }
+
+  if(num_state > 0)
+    MC_dump_checkpoint_ignore(snapshot);
+
+  return snapshot;
+
+}
+
+void MC_restore_snapshot(mc_snapshot_t snapshot){
+  unsigned int i;
+  for(i=0; i < NB_REGIONS; i++){
+    MC_region_restore(snapshot->regions[i]);
+  }
+
+}
+
+mc_snapshot_t SIMIX_pre_mc_snapshot(smx_simcall_t simcall){
+  return MC_take_snapshot(1);
+}
+
+void *MC_snapshot(void){
+  return simcall_mc_snapshot();
+}
index b51f045..e7ece50 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2012-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2012-2013. 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. */
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, mc,
                                 "Logging specific to mc_compare");
 
-static int heap_region_compare(void *d1, void *d2, size_t size);
+typedef struct s_pointers_pair{
+  void *p1;
+  void *p2;
+}s_pointers_pair_t, *pointers_pair_t;
 
-static int is_heap_equality(xbt_dynar_t equals, void *a1, void *a2);
-static size_t heap_ignore_size(void *address);
+__thread xbt_dynar_t compared_pointers;
 
-static void stack_region_free(stack_region_t s);
-static void heap_equality_free(heap_equality_t e);
+/************************** Free functions ****************************/
+/********************************************************************/
 
-static int compare_local_variables(char *s1, char *s2);
-static int compare_global_variables(int region_type, void *d1, void *d2);
+static void stack_region_free(stack_region_t s){
+  if(s){
+    xbt_free(s->process_name);
+    xbt_free(s);
+  }
+}
+
+static void stack_region_free_voidp(void *s){
+  stack_region_free((stack_region_t) * (void **) s);
+}
+
+static void pointers_pair_free(pointers_pair_t p){
+  xbt_free(p);
+}
+
+static void pointers_pair_free_voidp(void *p){
+  pointers_pair_free((pointers_pair_t) * (void **)p);
+}
+
+/************************** Snapshot comparison *******************************/
+/******************************************************************************/
+
+static int already_compared_pointers(void *p1, void *p2){
+
+  if(xbt_dynar_is_empty(compared_pointers))
+    return -1;
 
-static size_t heap_ignore_size(void *address){
   unsigned int cursor = 0;
   int start = 0;
-  int end = xbt_dynar_length(mc_heap_comparison_ignore) - 1;
-  mc_heap_ignore_region_t region;
+  int end = xbt_dynar_length(compared_pointers) - 1;
+  pointers_pair_t pair;
 
   while(start <= end){
     cursor = (start + end) / 2;
-    region = (mc_heap_ignore_region_t)xbt_dynar_get_as(mc_heap_comparison_ignore, cursor, mc_heap_ignore_region_t);
-    if(region->address == address)
-      return region->size;
-    if(region->address < address)
+    pair = (pointers_pair_t)xbt_dynar_get_as(compared_pointers, cursor, pointers_pair_t);
+    if(pair->p1 == p1){
+      if(pair->p2 == p2)
+        return 0;
+      else if(pair->p2 < p2)
+        start = cursor + 1;
+      else
+        end = cursor - 1;
+    }else if(pair->p1 < p1){
       start = cursor + 1;
-    if(region->address > address)
-      end = cursor - 1;   
+    }else{
+      end = cursor - 1 ;
+    }
   }
 
-  return 0;
+  return -1;
+
 }
 
-static int compare_global_variables(int region_type, void *d1, void *d2){ /* region_type = 1 -> libsimgrid, region_type = 2 -> binary */
+static void add_compared_pointers(void *p1, void *p2){
+
+  pointers_pair_t new_pair = xbt_new0(s_pointers_pair_t, 1);
+  new_pair->p1 = p1;
+  new_pair->p2 = p2;
+  
+  if(xbt_dynar_is_empty(compared_pointers)){
+    xbt_dynar_push(compared_pointers, &new_pair);
+    return;
+  }
 
   unsigned int cursor = 0;
-  size_t offset; 
-  int i = 0;
-  global_variable_t current_var; 
-  int pointer_align; 
-  void *addr_pointed1 = NULL, *addr_pointed2 = NULL;
-  int res_compare = 0;
-  void *plt_start, *plt_end;
+  int start = 0;
+  int end = xbt_dynar_length(compared_pointers) - 1;
+  pointers_pair_t pair = NULL;
 
-  if(region_type == 2){
-    plt_start = start_plt_binary;
-    plt_end = end_plt_binary;
-  }else{
-    plt_start = start_plt_libsimgrid;
-    plt_end = end_plt_libsimgrid;
+  while(start <= end){
+    cursor = (start + end) / 2;
+    pair = (pointers_pair_t)xbt_dynar_get_as(compared_pointers, cursor, pointers_pair_t);
+    if(pair->p1 == p1){
+      if(pair->p2 == p2){
+        pointers_pair_free(new_pair);
+        return;
+      }else if(pair->p2 < p2)
+        start = cursor + 1;
+      else
+        end = cursor - 1;
+    }else if(pair->p1 < p1){
+      start = cursor + 1;
+    }else{
+      end = cursor - 1 ;
+    }
   }
 
-  xbt_dynar_foreach(mc_global_variables, cursor, current_var){
-    if(current_var->address < start_data_libsimgrid){ /* binary global variable */
-      if(region_type == 1)
-        continue;
-      offset = (char *)current_var->address - (char *)start_data_binary;
-    }else{ /* libsimgrid global variable */
-      if(region_type == 2)
-        break;
-      offset = (char *)current_var->address - (char *)start_data_libsimgrid;
-    }
-    i = 0;
-    while(i < current_var->size){
-      if(memcmp((char *)d1 + offset + i, (char *)d2 + offset + i, 1) != 0){ 
-        pointer_align = (i / sizeof(void*)) * sizeof(void*); 
-        addr_pointed1 = *((void **)((char *)d1 + offset + pointer_align));
-        addr_pointed2 = *((void **)((char *)d2 + offset + pointer_align));
-        if((addr_pointed1 > plt_start && addr_pointed1 < plt_end) || (addr_pointed2 > plt_start && addr_pointed2 < plt_end)){
-          i = pointer_align + sizeof(void*);
-          continue;
-        }else if((addr_pointed1 > std_heap) && ((char *)addr_pointed1 < (char *)std_heap + STD_HEAP_SIZE) 
-                && (addr_pointed2 > std_heap) && ((char *)addr_pointed2 < (char *)std_heap + STD_HEAP_SIZE)){
-          res_compare = compare_area(addr_pointed1, addr_pointed2, NULL);
-          if(res_compare == 1){
-            #ifdef MC_VERBOSE
-              if(region_type == 2)
-                XBT_VERB("Different global variable in binary : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-              else
-                XBT_VERB("Different global variable in libsimgrid : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-            #endif
-            #ifdef MC_DEBUG
-              if(region_type == 2)
-                XBT_DEBUG("Different global variable in binary : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-              else
-                XBT_DEBUG("Different global variable in libsimgrid : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-            #endif
-            return 1;
-          }
-          i = pointer_align + sizeof(void*);
-          continue;
-        }else{
-          #ifdef MC_VERBOSE
-            if(region_type == 2)
-              XBT_VERB("Different global variable in binary : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-            else
-              XBT_VERB("Different global variable in libsimgrid : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-          #endif
-          #ifdef MC_DEBUG
-            if(region_type == 2)
-              XBT_DEBUG("Different global variable in binary : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-            else
-              XBT_DEBUG("Different global variable in libsimgrid : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
-          #endif
-          return 1;
-        }              
-      }
-      i++;
-    }
+  if(pair->p1 == p1){
+    if(pair->p2 < p2)
+      xbt_dynar_insert_at(compared_pointers, cursor + 1, &new_pair);
+    else
+      xbt_dynar_insert_at(compared_pointers, cursor, &new_pair); 
+  }else{
+    if(pair->p1 < p1)
+      xbt_dynar_insert_at(compared_pointers, cursor + 1, &new_pair);
+    else
+      xbt_dynar_insert_at(compared_pointers, cursor, &new_pair);   
   }
 
-  return 0;
 }
 
-static int heap_region_compare(void *d1, void *d2, size_t size){
-  
-  size_t i = 0;
-  
-  for(i=0; i<size; i++){
-    if(memcmp(((char *)d1) + i, ((char *)d2) + i, 1) != 0){
-      if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose)){
-        XBT_VERB("Different byte (offset=%zu) (%p - %p) in heap region", i, (char *)d1 + i, (char *)d2 + i);
+static int compare_areas_with_type(void *area1, void *area2, xbt_dict_t types, xbt_dict_t other_types, char *type_id, int region_size, int region_type, void *start_data, int pointer_level){
+
+  dw_type_t type = xbt_dict_get_or_null(types, type_id);;
+  unsigned int cursor = 0;
+  dw_type_t member, subtype, subsubtype;
+  int elm_size, i, res, switch_types = 0;
+  void *addr_pointed1, *addr_pointed2;
+
+  switch(type->type){
+  case e_dw_base_type:
+  case e_dw_enumeration_type:
+  case e_dw_union_type:
+    return (memcmp(area1, area2, type->size) != 0);
+    break;
+  case e_dw_typedef:
+  case e_dw_volatile_type:
+    return compare_areas_with_type(area1, area2, types, other_types, type->dw_type_id, region_size, region_type, start_data, pointer_level);
+    break;
+  case e_dw_const_type: /* Const variable cannot be modified */
+    return -1;
+    break;
+  case e_dw_array_type:
+    subtype = xbt_dict_get_or_null(types, type->dw_type_id);
+    switch(subtype->type){
+    case e_dw_base_type:
+    case e_dw_enumeration_type:
+    case e_dw_pointer_type:
+    case e_dw_structure_type:
+    case e_dw_union_type:
+      if(subtype->size == 0){ /*declaration of the type, need the complete description */
+        subtype = xbt_dict_get_or_null(types, get_type_description(types, subtype->name));
+        if(subtype == NULL){
+          subtype = xbt_dict_get_or_null(other_types, get_type_description(other_types, subtype->name));
+          switch_types = 1;
+        }
       }
-      return 1;
+      elm_size = subtype->size;
+      break;
+    case e_dw_typedef:
+    case e_dw_volatile_type:
+      subsubtype = xbt_dict_get_or_null(types, subtype->dw_type_id);
+      if(subsubtype->size == 0){ /*declaration of the type, need the complete description */
+        subsubtype = xbt_dict_get_or_null(types, get_type_description(types, subsubtype->name));
+        if(subsubtype == NULL){
+          subsubtype = xbt_dict_get_or_null(other_types, get_type_description(other_types, subsubtype->name));
+          switch_types = 1;
+        }
+      }
+      elm_size = subsubtype->size;
+      break;
+    default : 
+      return 0;
+      break;
+    }
+    for(i=0; i<type->size; i++){
+      if(switch_types)
+        res = compare_areas_with_type((char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), other_types, types, type->dw_type_id, region_size, region_type, start_data, pointer_level);
+      else
+        res = compare_areas_with_type((char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), types, other_types, type->dw_type_id, region_size, region_type, start_data, pointer_level);
+      if(res == 1)
+        return res;
+    }
+    break;
+  case e_dw_pointer_type: 
+    if(type->dw_type_id && ((dw_type_t)xbt_dict_get_or_null(types, type->dw_type_id))->type == e_dw_subroutine_type){
+      addr_pointed1 = *((void **)(area1)); 
+      addr_pointed2 = *((void **)(area2));
+      return (addr_pointed1 != addr_pointed2);
+    }else{
+      addr_pointed1 = *((void **)(area1)); 
+      addr_pointed2 = *((void **)(area2));
+      
+      if(addr_pointed1 == NULL && addr_pointed2 == NULL)
+        return 0;
+      if(already_compared_pointers(addr_pointed1, addr_pointed2) != -1)
+        return 0;
+      add_compared_pointers(addr_pointed1, addr_pointed2);
+
+      pointer_level++;
+      
+      if(addr_pointed1 > std_heap && (char *)addr_pointed1 < (char*) std_heap + STD_HEAP_SIZE && addr_pointed2 > std_heap && (char *)addr_pointed2 < (char*) std_heap + STD_HEAP_SIZE){
+        return compare_heap_area(addr_pointed1, addr_pointed2, NULL, types, other_types, type->dw_type_id, pointer_level); 
+      }else if(addr_pointed1 > start_data && (char*)addr_pointed1 <= (char *)start_data + region_size && addr_pointed2 > start_data && (char*)addr_pointed2 <= (char *)start_data + region_size){
+        if(type->dw_type_id == NULL)
+          return  (addr_pointed1 != addr_pointed2);
+        else
+          return  compare_areas_with_type(addr_pointed1, addr_pointed2, types, other_types, type->dw_type_id, region_size, region_type, start_data, pointer_level); 
+      }else{
+        return (addr_pointed1 != addr_pointed2);
+      }
+    }
+    break;
+  case e_dw_structure_type:
+    xbt_dynar_foreach(type->members, cursor, member){
+      res = compare_areas_with_type((char *)area1 + member->offset, (char *)area2 + member->offset, types, other_types, member->dw_type_id, region_size, region_type, start_data, pointer_level);
+      if(res == 1)
+        return res;
     }
+    break;
+  case e_dw_subroutine_type:
+    return -1;
+    break;
+  default:
+    XBT_VERB("Unknown case : %d", type->type);
+    break;
   }
   
   return 0;
 }
 
-static void stack_region_free(stack_region_t s){
-  if(s){
-    xbt_free(s->process_name);
-    xbt_free(s);
+static int compare_global_variables(int region_type, mc_mem_region_t r1, mc_mem_region_t r2){
+
+  if(!compared_pointers){
+    compared_pointers = xbt_dynar_new(sizeof(pointers_pair_t), pointers_pair_free_voidp);
+    MC_ignore_global_variable("compared_pointers");
+  }else{
+    xbt_dynar_reset(compared_pointers);
   }
-}
 
-void stack_region_free_voidp(void *s){
-  stack_region_free((stack_region_t) * (void **) s);
-}
+  xbt_dynar_t variables;
+  xbt_dict_t types, other_types;
+  int res;
+  unsigned int cursor = 0;
+  dw_variable_t current_var;
+  size_t offset;
+  void *start_data;
 
-static void heap_equality_free(heap_equality_t e){
-  xbt_free(e);
-}
+  if(region_type == 2){
+    variables = mc_global_variables_binary;
+    types = mc_variables_type_binary;
+    other_types = mc_variables_type_libsimgrid;
+    start_data = start_data_binary;
+  }else{
+    variables = mc_global_variables_libsimgrid;
+    types = mc_variables_type_libsimgrid;
+    other_types = mc_variables_type_binary;
+    start_data = start_data_libsimgrid;
+  }
 
-void heap_equality_free_voidp(void *e){
-  heap_equality_free((heap_equality_t) * (void **) e);
-}
+  xbt_dynar_foreach(variables, cursor, current_var){
 
-int SIMIX_pre_mc_compare_snapshots(smx_simcall_t simcall,
-                                   mc_snapshot_t s1, mc_snapshot_t s2){
-  return snapshot_compare(s1, s2);
-}
+    if(region_type == 2)
+      offset = (char *)current_var->address.address - (char *)start_data_binary;
+    else
+      offset = (char *)current_var->address.address - (char *)start_data_libsimgrid;
 
-int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
+    res = compare_areas_with_type((char *)r1->data + offset, (char *)r2->data + offset, types, other_types, current_var->type_origin, r1->size, region_type, start_data, 0);
+    if(res == 1){
+      XBT_VERB("Global variable %s (%p - %p) is different between snapshots", current_var->name, (char *)r1->data + offset, (char *)r2->data + offset);
+      xbt_dynar_free(&compared_pointers);
+      compared_pointers = NULL;
+      return 1;
+    }
 
-  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
-  
-  MC_SET_RAW_MEM;
-     
-  int errors = 0;
+  }
 
-  xbt_os_timer_t global_timer = xbt_os_timer_new();
-  xbt_os_timer_t timer = xbt_os_timer_new();
+  xbt_dynar_free(&compared_pointers);
+  compared_pointers = NULL;
 
-  xbt_os_walltimer_start(global_timer);
+  return 0;
 
-  #ifdef MC_DEBUG
-    xbt_os_walltimer_start(timer);
-  #endif
+}
 
-  /* Compare number of processes */
-  if(s1->nb_processes != s2->nb_processes){
-    #ifdef MC_DEBUG
-      xbt_os_walltimer_stop(timer);
-      mc_comp_times->nb_processes_comparison_time =  xbt_os_timer_elapsed(timer);
-      XBT_DEBUG("Different number of processes : %d - %d", s1->nb_processes, s2->nb_processes);
-      errors++;
-    #else
-      #ifdef MC_VERBOSE
-        XBT_VERB("Different number of processes : %d - %d", s1->nb_processes, s2->nb_processes);
-      #endif
+static int compare_local_variables(mc_snapshot_stack_t stack1, mc_snapshot_stack_t stack2, void *heap1, void *heap2){
 
-      xbt_os_timer_free(timer);
-      xbt_os_walltimer_stop(global_timer);
-      mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
-      xbt_os_timer_free(global_timer);
+  if(!compared_pointers){
+    compared_pointers = xbt_dynar_new(sizeof(pointers_pair_t), pointers_pair_free_voidp);
+    MC_ignore_global_variable("compared_pointers");
+  }else{
+    xbt_dynar_reset(compared_pointers);
+  }
+
+  if(xbt_dynar_length(stack1->local_variables) != xbt_dynar_length(stack2->local_variables)){
+    XBT_VERB("Different number of local variables");
+    xbt_dynar_free(&compared_pointers);
+    compared_pointers = NULL;
+    return 1;
+  }else{
+    unsigned int cursor = 0;
+    local_variable_t current_var1, current_var2;
+    int offset1, offset2, res;
+    while(cursor < xbt_dynar_length(stack1->local_variables)){
+      current_var1 = (local_variable_t)xbt_dynar_get_as(stack1->local_variables, cursor, local_variable_t);
+      current_var2 = (local_variable_t)xbt_dynar_get_as(stack2->local_variables, cursor, local_variable_t);
+      if(strcmp(current_var1->name, current_var2->name) != 0 || strcmp(current_var1->frame, current_var2->frame) != 0 || current_var1->ip != current_var2->ip){
+        xbt_dynar_free(&compared_pointers);
+        XBT_VERB("Different name of variable (%s - %s) or frame (%s - %s) or ip (%lu - %lu)", current_var1->name, current_var2->name, current_var1->frame, current_var2->frame, current_var1->ip, current_var2->ip);
+        return 1;
+      }
+      offset1 = (char *)current_var1->address - (char *)std_heap;
+      offset2 = (char *)current_var2->address - (char *)std_heap;
+      if(current_var1->region == 1)
+        res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, mc_variables_type_libsimgrid, mc_variables_type_binary, current_var1->type, 0, 1, start_data_libsimgrid, 0);
+      else
+        res = compare_areas_with_type( (char *)heap1 + offset1, (char *)heap2 + offset2, mc_variables_type_binary, mc_variables_type_libsimgrid, current_var1->type, 0, 2, start_data_binary, 0);
+      if(res == 1){
+        XBT_VERB("Local variable %s (%p - %p) in frame %s  is different between snapshots", current_var1->name,(char *)heap1 + offset1, (char *)heap2 + offset2, current_var1->frame);
+        xbt_dynar_free(&compared_pointers);
+        compared_pointers = NULL;
+        return res;
+      }
+      cursor++;
+    }
+    xbt_dynar_free(&compared_pointers);
+    compared_pointers = NULL;
+    return 0;
+  }
+}
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
+int snapshot_compare(void *state1, void *state2){
 
+  mc_snapshot_t s1, s2;
+  int num1, num2;
+  
+  if(_sg_mc_property_file && _sg_mc_property_file[0] != '\0'){ /* Liveness MC */
+    s1 = ((mc_visited_pair_t)state1)->graph_state->system_state;
+    s2 = ((mc_visited_pair_t)state2)->graph_state->system_state;
+    num1 = ((mc_visited_pair_t)state1)->num;
+    num2 =  ((mc_visited_pair_t)state2)->num;
+    /* Firstly compare automaton state */
+    /*if(xbt_automaton_state_compare(((mc_pair_t)state1)->automaton_state, ((mc_pair_t)state2)->automaton_state) != 0)
       return 1;
-    #endif
+    if(xbt_automaton_propositional_symbols_compare_value(((mc_pair_t)state1)->atomic_propositions, ((mc_pair_t)state2)->atomic_propositions) != 0)
+    return 1;*/
+  }else{ /* Safety MC */
+    s1 = ((mc_visited_state_t)state1)->system_state;
+    s2 = ((mc_visited_state_t)state2)->system_state;
+    num1 = ((mc_visited_state_t)state1)->num;
+    num2 = ((mc_visited_state_t)state2)->num;
   }
 
-  #ifdef MC_DEBUG
-    xbt_os_walltimer_start(timer);
-  #endif
-
-  /* Compare number of bytes used in each heap */
-  if(s1->heap_bytes_used != s2->heap_bytes_used){
-    #ifdef MC_DEBUG
-      xbt_os_walltimer_stop(timer);
-      mc_comp_times->bytes_used_comparison_time = xbt_os_timer_elapsed(timer);
-      XBT_DEBUG("Different number of bytes used in each heap : %zu - %zu", s1->heap_bytes_used, s2->heap_bytes_used);
-      errors++;
-    #else
-      #ifdef MC_VERBOSE
-        XBT_VERB("Different number of bytes used in each heap : %zu - %zu", s1->heap_bytes_used, s2->heap_bytes_used);
-      #endif
+  int errors = 0;
+  int res_init;
 
-      xbt_os_timer_free(timer);
-      xbt_os_walltimer_stop(global_timer);
-      mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
-      xbt_os_timer_free(global_timer);
+  xbt_os_timer_t global_timer = xbt_os_timer_new();
+  xbt_os_timer_t timer = xbt_os_timer_new();
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
+  xbt_os_walltimer_start(global_timer);
 
-      return 1;
-    #endif
-  }else{
-    #ifdef MC_DEBUG
-      xbt_os_walltimer_stop(timer);
-    #endif
-  }
-  
   #ifdef MC_DEBUG
     xbt_os_walltimer_start(timer);
   #endif
-  
+
   /* Compare size of stacks */
   int i = 0;
   size_t size_used1, size_used2;
@@ -252,22 +378,20 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
         xbt_os_walltimer_stop(timer);
         mc_comp_times->stacks_sizes_comparison_time = xbt_os_timer_elapsed(timer);
       }
-      XBT_DEBUG("Different size used in stacks : %zu - %zu", size_used1, size_used2);
+      XBT_DEBUG("(%d - %d) Different size used in stacks : %zu - %zu", num1, num2, size_used1, size_used2);
       errors++;
       is_diff = 1;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different size used in stacks : %zu - %zu", size_used1, size_used2);
+      XBT_VERB("(%d - %d) Different size used in stacks : %zu - %zu", num1, num2, size_used1, size_used2);
       #endif
 
+      xbt_os_walltimer_stop(timer);
       xbt_os_timer_free(timer);
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
-
       return 1;
     #endif  
     }
@@ -293,13 +417,11 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
           XBT_VERB("Different hash of global variables : %s - %s", s1->hash_global, s2->hash_global); 
         #endif
 
+        xbt_os_walltimer_stop(timer);
         xbt_os_timer_free(timer);
         xbt_os_walltimer_stop(global_timer);
         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
         xbt_os_timer_free(global_timer);
-    
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
 
         return 1;
       #endif
@@ -323,14 +445,12 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
           XBT_VERB("Different hash of local variables : %s - %s", s1->hash_local, s2->hash_local); 
         #endif
 
+        xbt_os_walltimer_stop(timer);
         xbt_os_timer_free(timer);
         xbt_os_walltimer_stop(global_timer);
         mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
         xbt_os_timer_free(global_timer);
-        
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
-        
+
         return 1;
       #endif
     }
@@ -341,29 +461,91 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
   #endif
 
   /* Init heap information used in heap comparison algorithm */
-  init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore);
+  res_init = init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore);
+  if(res_init == -1){
+     #ifdef MC_DEBUG
+    XBT_DEBUG("(%d - %d) Different heap information", num1, num2); 
+        errors++; 
+      #else
+        #ifdef MC_VERBOSE
+        XBT_VERB("(%d - %d) Different heap information", num1, num2); 
+        #endif
+
+        xbt_os_walltimer_stop(global_timer);
+        mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+        xbt_os_timer_free(global_timer);
+
+        return 1;
+      #endif
+  }
+
+  #ifdef MC_DEBUG
+    xbt_os_walltimer_start(timer);
+  #endif
+
+  /* Stacks comparison */
+  unsigned int  cursor = 0;
+  int diff_local = 0;
+  is_diff = 0;
+  mc_snapshot_stack_t stack1, stack2;
+    
+  while(cursor < xbt_dynar_length(s1->stacks)){
+    stack1 = (mc_snapshot_stack_t)xbt_dynar_get_as(s1->stacks, cursor, mc_snapshot_stack_t);
+    stack2 = (mc_snapshot_stack_t)xbt_dynar_get_as(s2->stacks, cursor, mc_snapshot_stack_t);
+    diff_local = compare_local_variables(stack1, stack2, s1->regions[0]->data, s2->regions[0]->data);
+    if(diff_local > 0){
+      #ifdef MC_DEBUG
+        if(is_diff == 0){
+          xbt_os_walltimer_stop(timer);
+          mc_comp_times->stacks_comparison_time = xbt_os_timer_elapsed(timer);
+        }
+        XBT_DEBUG("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1);
+        errors++;
+        is_diff = 1;
+      #else
+        
+        #ifdef MC_VERBOSE
+        XBT_VERB("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1);
+        #endif
+          
+        reset_heap_information();
+        xbt_os_walltimer_stop(timer);
+        xbt_os_timer_free(timer);
+        xbt_os_walltimer_stop(global_timer);
+        mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+        xbt_os_timer_free(global_timer);
+        return 1;
+      #endif
+    }
+    cursor++;
+  }
+
+  #ifdef MC_DEBUG
+    if(is_diff == 0)
+      xbt_os_walltimer_stop(timer);
+    xbt_os_walltimer_start(timer);
+  #endif
 
   /* Compare binary global variables */
-  is_diff = compare_global_variables(2, s1->regions[2]->data, s2->regions[2]->data);
+  is_diff = compare_global_variables(2, s1->regions[2], s2->regions[2]);
   if(is_diff != 0){
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
       mc_comp_times->binary_global_variables_comparison_time = xbt_os_timer_elapsed(timer);
-      XBT_DEBUG("Different global variables in binary"); 
-      errors++; 
+      XBT_DEBUG("(%d - %d) Different global variables in binary", num1, num2);
+      errors++;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different global variables in binary"); 
+      XBT_VERB("(%d - %d) Different global variables in binary", num1, num2);
       #endif
 
       reset_heap_information();
+      xbt_os_walltimer_stop(timer);
       xbt_os_timer_free(timer);
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
-    
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
 
       return 1;
     #endif
@@ -376,102 +558,54 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
   #endif
 
   /* Compare libsimgrid global variables */
-  is_diff = compare_global_variables(1, s1->regions[1]->data, s2->regions[1]->data);
+  is_diff = compare_global_variables(1, s1->regions[1], s2->regions[1]);
   if(is_diff != 0){
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
-      mc_comp_times->libsimgrid_global_variables_comparison_time = xbt_os_timer_elapsed(timer); 
-      XBT_DEBUG("Different global variables in libsimgrid"); 
-      errors++; 
+      mc_comp_times->libsimgrid_global_variables_comparison_time = xbt_os_timer_elapsed(timer);
+      XBT_DEBUG("(%d - %d) Different global variables in libsimgrid", num1, num2);
+      errors++;
     #else
       #ifdef MC_VERBOSE
-        XBT_VERB("Different global variables in libsimgrid"); 
+      XBT_VERB("(%d - %d) Different global variables in libsimgrid", num1, num2);
       #endif
         
       reset_heap_information();
+      xbt_os_walltimer_stop(timer);
       xbt_os_timer_free(timer);
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
-    
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
 
       return 1;
     #endif
-  }  
-
-  #ifdef MC_DEBUG
-    if(is_diff == 0)
-      xbt_os_walltimer_stop(timer);
-    xbt_os_walltimer_start(timer);
-  #endif
-
-  /* Stacks comparison */
-  unsigned int  cursor = 0;
-  int diff_local = 0;
-  is_diff = 0;
-    
-  while(cursor < xbt_dynar_length(s1->stacks)){
-    diff_local = compare_local_variables(((mc_snapshot_stack_t)xbt_dynar_get_as(s1->stacks, cursor, mc_snapshot_stack_t))->local_variables->data, ((mc_snapshot_stack_t)xbt_dynar_get_as(s2->stacks, cursor, mc_snapshot_stack_t))->local_variables->data);
-    if(diff_local > 0){
-      #ifdef MC_DEBUG
-        if(is_diff == 0){
-          xbt_os_walltimer_stop(timer);
-          mc_comp_times->stacks_comparison_time = xbt_os_timer_elapsed(timer); 
-        }
-        XBT_DEBUG("Different local variables between stacks %d", cursor + 1);
-        errors++;
-        is_diff = 1;
-      #else
-        
-        #ifdef MC_VERBOSE
-          XBT_VERB("Different local variables between stacks %d", cursor + 1);
-        #endif
-          
-        reset_heap_information();
-        xbt_os_timer_free(timer);
-        xbt_os_walltimer_stop(global_timer);
-        mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
-        xbt_os_timer_free(global_timer);
-        
-        if(!raw_mem)
-          MC_UNSET_RAW_MEM;
-        
-        return 1;
-      #endif
-    }
-    cursor++;
   }
-    
+
   #ifdef MC_DEBUG
     xbt_os_walltimer_start(timer);
   #endif
 
   /* Compare heap */
-  if(mmalloc_compare_heap((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data)){
+    if(mmalloc_compare_heap((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, mc_variables_type_libsimgrid, mc_variables_type_binary) > 0){
 
     #ifdef MC_DEBUG
       xbt_os_walltimer_stop(timer);
       mc_comp_times->heap_comparison_time = xbt_os_timer_elapsed(timer); 
-      XBT_DEBUG("Different heap (mmalloc_compare)");
+      XBT_DEBUG("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
       errors++;
     #else
-
-      xbt_os_timer_free(timer);
  
       #ifdef MC_VERBOSE
-        XBT_VERB("Different heap (mmalloc_compare)");
+      XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
       #endif
        
       reset_heap_information();
+      xbt_os_walltimer_stop(timer);
+      xbt_os_timer_free(timer);
       xbt_os_walltimer_stop(global_timer);
       mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
       xbt_os_timer_free(global_timer);
 
-      if(!raw_mem)
-        MC_UNSET_RAW_MEM;
-
       return 1;
     #endif
   }else{
@@ -481,7 +615,8 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
   }
 
   reset_heap_information();
-   
+  
+  xbt_os_walltimer_stop(timer);
   xbt_os_timer_free(timer);
 
   #ifdef MC_VERBOSE
@@ -495,169 +630,12 @@ int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
     print_comparison_times();
   #endif
 
-  if(!raw_mem)
-    MC_UNSET_RAW_MEM;
-
   return errors > 0;
   
 }
 
-int is_stack_ignore_variable(char *frame, char *var_name){
-
-  unsigned int cursor = 0;
-  int start = 0;
-  int end = xbt_dynar_length(mc_stack_comparison_ignore) - 1;
-  mc_stack_ignore_variable_t current_var;
-
-  while(start <= end){
-    cursor = (start + end) / 2;
-    current_var = (mc_stack_ignore_variable_t)xbt_dynar_get_as(mc_stack_comparison_ignore, cursor, mc_stack_ignore_variable_t);
-    if(strcmp(current_var->frame, frame) == 0 || strcmp(current_var->frame, "*") == 0){
-      if(strcmp(current_var->var_name, var_name) == 0)
-        return 1;
-      if(strcmp(current_var->var_name, var_name) < 0)
-        start = cursor + 1;
-      if(strcmp(current_var->var_name, var_name) > 0)
-        end = cursor - 1;
-    }else if(strcmp(current_var->frame, frame) < 0){
-      start = cursor + 1;
-    }else if(strcmp(current_var->frame, frame) > 0){
-      end = cursor - 1; 
-    }
-  }
-
-  return 0;
-}
-
-static int compare_local_variables(char *s1, char *s2){
-  
-  xbt_dynar_t tokens1 = xbt_str_split(s1, NULL);
-  xbt_dynar_t tokens2 = xbt_str_split(s2, NULL);
-
-  xbt_dynar_t s_tokens1, s_tokens2;
-  unsigned int cursor = 0;
-  void *addr1, *addr2;
-  char *frame_name1 = NULL, *frame_name2 = NULL;
-  int res_compare = 0;
-
-  #if defined MC_VERBOSE || defined MC_DEBUG
-    char *var_name;
-  #endif
-
-  while(cursor < xbt_dynar_length(tokens1)){
-    s_tokens1 = xbt_str_split(xbt_dynar_get_as(tokens1, cursor, char *), "=");
-    s_tokens2 = xbt_str_split(xbt_dynar_get_as(tokens2, cursor, char *), "=");
-    if(xbt_dynar_length(s_tokens1) > 1 && xbt_dynar_length(s_tokens2) > 1){
-      #if defined MC_VERBOSE || defined MC_DEBUG
-        var_name = xbt_dynar_get_as(s_tokens1, 0, char *);
-      #endif
-      if((strcmp(xbt_dynar_get_as(s_tokens1, 0, char *), "frame_name") == 0) && (strcmp(xbt_dynar_get_as(s_tokens2, 0, char *), "frame_name") == 0)){
-        xbt_free(frame_name1);
-        xbt_free(frame_name2);
-        frame_name1 = strdup(xbt_dynar_get_as(s_tokens1, 1, char *));
-        frame_name2 = strdup(xbt_dynar_get_as(s_tokens2, 1, char *));
-      }
-      addr1 = (void *) strtoul(xbt_dynar_get_as(s_tokens1, 1, char *), NULL, 16);
-      addr2 = (void *) strtoul(xbt_dynar_get_as(s_tokens2, 1, char *), NULL, 16);
-      if(addr1 > std_heap && (char *)addr1 <= (char *)std_heap + STD_HEAP_SIZE && addr2 > std_heap && (char *)addr2 <= (char *)std_heap + STD_HEAP_SIZE){
-        res_compare = compare_area(addr1, addr2, NULL);
-        if(res_compare == 1){
-          if(is_stack_ignore_variable(frame_name1, xbt_dynar_get_as(s_tokens1, 0, char *)) && is_stack_ignore_variable(frame_name2, xbt_dynar_get_as(s_tokens2, 0, char *))){
-            xbt_dynar_free(&s_tokens1);
-            xbt_dynar_free(&s_tokens2);
-            cursor++;
-            continue;
-          }else {
-            #ifdef MC_VERBOSE
-              XBT_VERB("Different local variable : %s at addresses %p - %p in frame %s", var_name, addr1, addr2, frame_name1);
-            #endif
-            #ifdef MC_DEBUG
-              XBT_DEBUG("Different local variable : %s at addresses %p - %p", var_name, addr1, addr2);
-            #endif
-            xbt_dynar_free(&s_tokens1);
-            xbt_dynar_free(&s_tokens2);
-            xbt_dynar_free(&tokens1);
-            xbt_dynar_free(&tokens2);
-            xbt_free(frame_name1);
-            xbt_free(frame_name2);
-            return 1;
-          }
-        }
-      }else{
-        if(strcmp(xbt_dynar_get_as(s_tokens1, 1, char *), xbt_dynar_get_as(s_tokens2, 1, char *)) != 0){
-          if(is_stack_ignore_variable(frame_name1, xbt_dynar_get_as(s_tokens1, 0, char *)) && is_stack_ignore_variable(frame_name2, xbt_dynar_get_as(s_tokens2, 0, char *))){
-            xbt_dynar_free(&s_tokens1);
-            xbt_dynar_free(&s_tokens2);
-            cursor++;
-            continue;
-          }else {
-            #ifdef MC_VERBOSE
-              XBT_VERB("Different local variable : %s (%s - %s) in frame %s", var_name, xbt_dynar_get_as(s_tokens1, 1, char *), xbt_dynar_get_as(s_tokens2, 1, char *), frame_name1);
-            #endif
-            #ifdef MC_DEBUG
-              XBT_DEBUG("Different local variable : %s (%s - %s)", var_name, xbt_dynar_get_as(s_tokens1, 1, char *), xbt_dynar_get_as(s_tokens2, 1, char *));
-            #endif
-
-            xbt_dynar_free(&s_tokens1);
-            xbt_dynar_free(&s_tokens2);
-            xbt_dynar_free(&tokens1);
-            xbt_dynar_free(&tokens2);
-            xbt_free(frame_name1);
-            xbt_free(frame_name2);
-            return 1;
-          }
-        }
-      }
-    }
-    xbt_dynar_free(&s_tokens1);
-    xbt_dynar_free(&s_tokens2);
-         
-    cursor++;
-  }
-
-  xbt_free(frame_name1);
-  xbt_free(frame_name2);
-  xbt_dynar_free(&tokens1);
-  xbt_dynar_free(&tokens2);
-  return 0;
-  
-}
-
-static int is_heap_equality(xbt_dynar_t equals, void *a1, void *a2){
-
-  unsigned int cursor = 0;
-  int start = 0;
-  int end = xbt_dynar_length(equals) - 1;
-  heap_equality_t current_equality;
-
-  while(start <= end){
-    cursor = (start + end) / 2;
-    current_equality = (heap_equality_t)xbt_dynar_get_as(equals, cursor, heap_equality_t);
-    if(current_equality->address1 == a1){
-      if(current_equality->address2 == a2)
-        return 1;
-      if(current_equality->address2 < a2)
-        start = cursor + 1;
-      if(current_equality->address2 > a2)
-        end = cursor - 1;
-    }
-    if(current_equality->address1 < a1)
-      start = cursor + 1;
-    if(current_equality->address1 > a1)
-      end = cursor - 1; 
-  }
-
-  return 0;
-
-}
-
-int MC_compare_snapshots(void *s1, void *s2){
-  
-  MC_ignore_stack("self", "simcall_BODY_mc_snapshot");
-  return simcall_mc_compare_snapshots(s1, s2);
-
-}
+/***************************** Statistics *****************************/
+/*******************************************************************/
 
 void print_comparison_times(){
   XBT_DEBUG("*** Comparison times ***");
@@ -669,3 +647,18 @@ void print_comparison_times(){
   XBT_DEBUG("- Heap : %f", mc_comp_times->heap_comparison_time);
   XBT_DEBUG("- Stacks : %f", mc_comp_times->stacks_comparison_time);
 }
+
+/**************************** MC snapshot compare simcall **************************/
+/***********************************************************************************/
+
+int SIMIX_pre_mc_compare_snapshots(smx_simcall_t simcall,
+                                   mc_snapshot_t s1, mc_snapshot_t s2){
+  return snapshot_compare(s1, s2);
+}
+
+int MC_compare_snapshots(void *s1, void *s2){
+  
+  MC_ignore_local_variable("self", "simcall_BODY_mc_snapshot");
+  return simcall_mc_compare_snapshots(s1, s2);
+
+}
index 08990a5..ebda309 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013. Da SimGrid Team. All rights reserved.           */
+/* Copyright (c) 2008-2013. 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. */
@@ -8,9 +9,13 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dpor, mc,
                                 "Logging specific to MC DPOR exploration");
 
+/********** Global variables **********/
+
 xbt_dynar_t visited_states;
 xbt_dict_t first_enabled_state;
 
+/********** Static functions ***********/
+
 static void visited_state_free(mc_visited_state_t state){
   if(state){
     MC_free_snapshot(state->system_state);
@@ -28,15 +33,67 @@ static mc_visited_state_t visited_state_new(){
   new_state = xbt_new0(s_mc_visited_state_t, 1);
   new_state->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
   new_state->nb_processes = xbt_swag_size(simix_global->process_list);
-  new_state->system_state = MC_take_snapshot();
+  new_state->system_state = MC_take_snapshot(mc_stats->expanded_states);
   new_state->num = mc_stats->expanded_states;
+  new_state->other_num = -1;
 
   return new_state;
   
 }
 
-/* Dichotomic search in visited_states dynar. 
- * States are ordered by the number of processes then the number of bytes used in std_heap */
+static int get_search_interval(xbt_dynar_t all_states, mc_visited_state_t state, int *min, int *max){
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  int cursor = 0, previous_cursor, next_cursor;
+  mc_visited_state_t state_test;
+  int start = 0;
+  int end = xbt_dynar_length(all_states) - 1;
+  
+  while(start <= end){
+    cursor = (start + end) / 2;
+    state_test = (mc_visited_state_t)xbt_dynar_get_as(all_states, cursor, mc_visited_state_t);
+    if(state_test->nb_processes < state->nb_processes){
+      start = cursor + 1;
+    }else if(state_test->nb_processes > state->nb_processes){
+      end = cursor - 1;
+    }else{
+      if(state_test->heap_bytes_used < state->heap_bytes_used){
+        start = cursor +1;
+      }else if(state_test->heap_bytes_used > state->heap_bytes_used){
+        end = cursor - 1;
+      }else{
+        *min = *max = cursor;
+        previous_cursor = cursor - 1;
+        while(previous_cursor >= 0){
+          state_test = (mc_visited_state_t)xbt_dynar_get_as(all_states, previous_cursor, mc_visited_state_t);
+          if(state_test->nb_processes != state->nb_processes || state_test->heap_bytes_used != state->heap_bytes_used)
+            break;
+          *min = previous_cursor;
+          previous_cursor--;
+        }
+        next_cursor = cursor + 1;
+        while(next_cursor < xbt_dynar_length(all_states)){
+          state_test = (mc_visited_state_t)xbt_dynar_get_as(all_states, next_cursor, mc_visited_state_t);
+          if(state_test->nb_processes != state->nb_processes || state_test->heap_bytes_used != state->heap_bytes_used)
+            break;
+          *max = next_cursor;
+          next_cursor++;
+        }
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return -1;
+      }
+     }
+  }
+
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
+
+  return cursor;
+}
 
 static int is_visited_state(){
 
@@ -46,124 +103,93 @@ static int is_visited_state(){
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
   MC_SET_RAW_MEM;
+
   mc_visited_state_t new_state = visited_state_new();
-  MC_UNSET_RAW_MEM;
   
   if(xbt_dynar_is_empty(visited_states)){
 
-    MC_SET_RAW_MEM;
     xbt_dynar_push(visited_states, &new_state); 
-    MC_UNSET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
 
     return -1;
 
   }else{
 
-    MC_SET_RAW_MEM;
-    
-    size_t current_bytes_used = new_state->heap_bytes_used;
-    int current_nb_processes = new_state->nb_processes;
-
-    unsigned int cursor = 0;
-    int previous_cursor = 0, next_cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(visited_states) - 1;
-
-    mc_visited_state_t state_test = NULL;
-    size_t bytes_used_test;
-    int nb_processes_test;
-    int same_processes_and_bytes_not_found = 1;
-
-    while(start <= end && same_processes_and_bytes_not_found){
-      cursor = (start + end) / 2;
-      state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, cursor, mc_visited_state_t);
-      bytes_used_test = state_test->heap_bytes_used;
-      nb_processes_test = state_test->nb_processes;
-      if(nb_processes_test < current_nb_processes){
-        start = cursor + 1;
-      }else if(nb_processes_test > current_nb_processes){
-        end = cursor - 1;
-      }else if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        if(bytes_used_test == current_bytes_used){
-          same_processes_and_bytes_not_found = 0;
-          if(snapshot_compare(new_state->system_state, state_test->system_state) == 0){
+    int min = -1, max = -1, index;
+    //int res;
+    mc_visited_state_t state_test;
+    int cursor;
+
+    index = get_search_interval(visited_states, new_state, &min, &max);
+
+    if(min != -1 && max != -1){
+      /*res = xbt_parmap_mc_apply(parmap, snapshot_compare, xbt_dynar_get_ptr(visited_states, min), (max-min)+1, new_state);
+      if(res != -1){
+        state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, (min+res)-1, mc_visited_state_t);
+        if(state_test->other_num == -1)
+          new_state->other_num = state_test->num;
+        else
+          new_state->other_num = state_test->other_num;
+        if(dot_output == NULL)
+          XBT_DEBUG("State %d already visited ! (equal to state %d)", new_state->num, state_test->num);
+        else
+          XBT_DEBUG("State %d already visited ! (equal to state %d (state %d in dot_output))", new_state->num, state_test->num, new_state->other_num);
+        xbt_dynar_remove_at(visited_states, (min + res) - 1, NULL);
+        xbt_dynar_insert_at(visited_states, (min+res) - 1, &new_state);
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return new_state->other_num;
+        }*/
+      cursor = min;
+      while(cursor <= max){
+        state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, cursor, mc_visited_state_t);
+        if(snapshot_compare(state_test, new_state) == 0){
+          if(state_test->other_num == -1)
+            new_state->other_num = state_test->num;
+          else
+            new_state->other_num = state_test->other_num;
+          if(dot_output == NULL)
             XBT_DEBUG("State %d already visited ! (equal to state %d)", new_state->num, state_test->num);
-            if(raw_mem_set)
-              MC_SET_RAW_MEM;
-            else
-              MC_UNSET_RAW_MEM;
-            return state_test->num;
-          }else{
-            /* Search another state with same number of bytes used in std_heap */
-            previous_cursor = cursor - 1;
-            while(previous_cursor >= 0){
-              state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, previous_cursor, mc_visited_state_t);
-              bytes_used_test = state_test->system_state->heap_bytes_used;
-              if(bytes_used_test != current_bytes_used)
-                break;
-              if(snapshot_compare(new_state->system_state, state_test->system_state) == 0){
-                XBT_DEBUG("State %d already visited ! (equal to state %d)", new_state->num, state_test->num);
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
-                  MC_UNSET_RAW_MEM;
-                return state_test->num;
-              }
-              previous_cursor--;
-            }
-            next_cursor = cursor + 1;
-            while(next_cursor < xbt_dynar_length(visited_states)){
-              state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, next_cursor, mc_visited_state_t);
-              bytes_used_test = state_test->system_state->heap_bytes_used;
-              if(bytes_used_test != current_bytes_used)
-                break;
-              if(snapshot_compare(new_state->system_state, state_test->system_state) == 0){
-                XBT_DEBUG("State %d already visited ! (equal to state %d)", new_state->num, state_test->num);
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
-                  MC_UNSET_RAW_MEM;
-                return state_test->num;
-              }
-              next_cursor++;
-            }
-          }   
+          else
+            XBT_DEBUG("State %d already visited ! (equal to state %d (state %d in dot_output))", new_state->num, state_test->num, new_state->other_num);
+          xbt_dynar_remove_at(visited_states, cursor, NULL);
+          xbt_dynar_insert_at(visited_states, cursor, &new_state);
+          if(!raw_mem_set)
+            MC_UNSET_RAW_MEM;
+          return new_state->other_num;
         }
+        cursor++;
+      }
+      xbt_dynar_insert_at(visited_states, min, &new_state);
+    }else{
+      state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, index, mc_visited_state_t);
+      if(state_test->nb_processes < new_state->nb_processes){
+        xbt_dynar_insert_at(visited_states, index+1, &new_state);
+      }else{
+        if(state_test->heap_bytes_used < new_state->heap_bytes_used)
+          xbt_dynar_insert_at(visited_states, index + 1, &new_state);
+        else
+          xbt_dynar_insert_at(visited_states, index, &new_state);
       }
     }
 
-    state_test = (mc_visited_state_t)xbt_dynar_get_as(visited_states, cursor, mc_visited_state_t);
-    bytes_used_test = state_test->heap_bytes_used;
-
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(visited_states, cursor + 1, &new_state);
-    else
-      xbt_dynar_insert_at(visited_states, cursor, &new_state);
-
     if(xbt_dynar_length(visited_states) > _sg_mc_visited){
-      int min = mc_stats->expanded_states;
+      int min2 = mc_stats->expanded_states;
       unsigned int cursor2 = 0;
-      unsigned int index = 0;
+      unsigned int index2 = 0;
       xbt_dynar_foreach(visited_states, cursor2, state_test){
-        if(state_test->num < min){
-          index = cursor2;
-          min = state_test->num;
+        if(state_test->num < min2){
+          index2 = cursor2;
+          min2 = state_test->num;
         }
       }
-      xbt_dynar_remove_at(visited_states, index, NULL);
+      xbt_dynar_remove_at(visited_states, index2, NULL);
     }
-    
-    MC_UNSET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
     
     return -1;
     
@@ -185,7 +211,8 @@ void MC_dpor_init()
   MC_SET_RAW_MEM;
 
   initial_state = MC_state_new();
-  visited_states = xbt_dynar_new(sizeof(mc_visited_state_t), visited_state_free_voidp);
+  if(_sg_mc_visited > 0)
+    visited_states = xbt_dynar_new(sizeof(mc_visited_state_t), visited_state_free_voidp);
 
   first_enabled_state = xbt_dict_new_homogeneous(&xbt_free_f);
 
@@ -197,6 +224,9 @@ void MC_dpor_init()
   /* Wait for requests (schedules processes) */
   MC_wait_for_requests();
 
+  MC_ignore_heap(simix_global->process_to_run->data, 0);
+  MC_ignore_heap(simix_global->process_that_ran->data, 0);
+
   MC_SET_RAW_MEM;
  
   /* Get an enabled process and insert it in the interleave set of the initial state */
@@ -246,9 +276,10 @@ void MC_dpor(void)
   mc_state_t state = NULL, prev_state = NULL, next_state = NULL, restore_state=NULL;
   smx_process_t process = NULL;
   xbt_fifo_item_t item = NULL;
+  mc_state_t state_test = NULL;
   int pos;
-  int visited_state;
-  int enabled = 0, max_depth_reached = 0;
+  int visited_state = -1;
+  int enabled = 0;
 
   while (xbt_fifo_size(mc_stack_safety) > 0) {
 
@@ -257,17 +288,17 @@ void MC_dpor(void)
       xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_safety));
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth=%d (state=%p, num %d)(%u interleave)",
+    XBT_DEBUG("Exploration depth=%d (state=%p, num %d)(%u interleave, user_max_depth %d, first_enabled_state size : %d)",
               xbt_fifo_size(mc_stack_safety), state, state->num,
-              MC_state_interleave_size(state));
-
+              MC_state_interleave_size(state), user_max_depth_reached, xbt_dict_size(first_enabled_state));
+      
     /* Update statistics */
     mc_stats->visited_states++;
 
     /* If there are processes to interleave and the maximum depth has not been reached
        then perform one step of the exploration algorithm */
-    if (xbt_fifo_size(mc_stack_safety) <= _sg_mc_max_depth &&
-        (req = MC_state_get_request(state, &value))) {
+    if (xbt_fifo_size(mc_stack_safety) <= _sg_mc_max_depth && !user_max_depth_reached &&
+        (req = MC_state_get_request(state, &value)) && visited_state == -1) {
 
       /* Debug information */
       if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
@@ -275,7 +306,7 @@ void MC_dpor(void)
         XBT_DEBUG("Execute: %s", req_str);
         xbt_free(req_str);
       }
-        
+      
       MC_SET_RAW_MEM;
       if(dot_output != NULL)
         req_str = MC_request_get_dot_output(req, value);
@@ -313,7 +344,7 @@ void MC_dpor(void)
         }
 
         if(_sg_mc_checkpoint && ((xbt_fifo_size(mc_stack_safety) + 1) % _sg_mc_checkpoint == 0)){
-          next_state->system_state = MC_take_snapshot();
+          next_state->system_state = MC_take_snapshot(next_state->num);
         }
 
         if(dot_output != NULL)
@@ -350,9 +381,14 @@ void MC_dpor(void)
       /* The interleave set is empty or the maximum depth is reached, let's back-track */
     } else {
 
-      if(xbt_fifo_size(mc_stack_safety) > _sg_mc_max_depth){  
+      if((xbt_fifo_size(mc_stack_safety) > _sg_mc_max_depth) || user_max_depth_reached || visited_state != -1){  
 
-        XBT_WARN("/!\\ Max depth reached ! /!\\ ");
+        if(user_max_depth_reached && visited_state == -1)
+          XBT_DEBUG("User max depth reached !");
+        else if(visited_state == -1)
+          XBT_WARN("/!\\ Max depth reached ! /!\\ ");
+
+        visited_state = -1;
 
         /* Interleave enabled processes in the state in which they have been enabled for the first time */
         xbt_swag_foreach(process, simix_global->process_list){
@@ -360,46 +396,31 @@ void MC_dpor(void)
             char *key = bprintf("%lu", process->pid);
             enabled = (int)strtoul(xbt_dict_get_or_null(first_enabled_state, key), 0, 10);
             xbt_free(key);
-            mc_state_t state_test = NULL;
-            xbt_fifo_item_t item = NULL;
             int cursor = xbt_fifo_size(mc_stack_safety);
             xbt_fifo_foreach(mc_stack_safety, item, state_test, mc_state_t){
               if(cursor-- == enabled){ 
-                if(!MC_state_process_is_done(state_test, process)){ 
+                if(!MC_state_process_is_done(state_test, process) && state_test->num != state->num){ 
+                  XBT_DEBUG("Interleave process %lu in state %d", process->pid, state_test->num);
                   MC_state_interleave_process(state_test, process);
                   break;
                 }
               }
-            } 
+            }
           }
         }
 
-        if(MC_state_interleave_size(state) > 0){
-          max_depth_reached = 1;
-        }else{
-          /* Trash the current state, no longer needed */
-          MC_SET_RAW_MEM;
-          xbt_fifo_shift(mc_stack_safety);
-          MC_state_delete(state);
-          MC_UNSET_RAW_MEM;
-
-          max_depth_reached = 0;
-        }
-        
-
       }else{
 
-        XBT_DEBUG("There are no more processes to interleave.");
+        XBT_DEBUG("There are no more processes to interleave. (depth %d)", xbt_fifo_size(mc_stack_safety) + 1);
 
-        /* Trash the current state, no longer needed */
-        MC_SET_RAW_MEM;
-        xbt_fifo_shift(mc_stack_safety);
-        MC_state_delete(state);
-        XBT_DEBUG("Delete state %d at depth %d", state->num, xbt_fifo_size(mc_stack_safety) + 1);
-        MC_UNSET_RAW_MEM;
-        
-        max_depth_reached = 0;
       }
+
+      /* Trash the current state, no longer needed */
+      MC_SET_RAW_MEM;
+      xbt_fifo_shift(mc_stack_safety);
+      MC_state_delete(state);
+      XBT_DEBUG("Delete state %d at depth %d", state->num, xbt_fifo_size(mc_stack_safety) + 1);
+      MC_UNSET_RAW_MEM;        
       
       /* Check for deadlocks */
       if(MC_deadlock_check()){
@@ -417,10 +438,6 @@ void MC_dpor(void)
       
       while ((state = xbt_fifo_shift(mc_stack_safety)) != NULL) {
         if(mc_reduce_kind != e_mc_reduce_none){
-          if((xbt_fifo_size(mc_stack_safety) == _sg_mc_max_depth) && max_depth_reached){
-            req = MC_state_get_request(state, &value);
-            MC_state_set_executed_request(state, req, value);
-          }
           req = MC_state_get_internal_request(state);
           xbt_fifo_foreach(mc_stack_safety, item, prev_state, mc_state_t) {
             if(MC_request_depend(req, MC_state_get_internal_request(prev_state))){
@@ -486,7 +503,7 @@ void MC_dpor(void)
             MC_UNSET_RAW_MEM;
             MC_replay(mc_stack_safety, -1);
           }
-          XBT_DEBUG("Back-tracking to state %d at depth %d", state->num, xbt_fifo_size(mc_stack_safety));
+          XBT_DEBUG("Back-tracking to state %d at depth %d done", state->num, xbt_fifo_size(mc_stack_safety));
           break;
         } else {
           XBT_DEBUG("Delete state %d at depth %d", state->num, xbt_fifo_size(mc_stack_safety) + 1); 
index 7469068..4ae023d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
@@ -32,9 +33,10 @@ int _sg_mc_max_depth=1000;
 int _sg_mc_visited=0;
 char *_sg_mc_dot_output_file = NULL;
 
-extern int _sg_init_status;
+int user_max_depth_reached = 0;
+
 void _mc_cfg_cb_reduce(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a reduction strategy after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   char *val= xbt_cfg_get_string(_sg_cfg_set, name);
@@ -48,70 +50,72 @@ void _mc_cfg_cb_reduce(const char *name, int pos) {
 }
 
 void _mc_cfg_cb_checkpoint(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a checkpointing value after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
-  _sg_mc_checkpoint = xbt_cfg_get_boolean(_sg_cfg_set, name);
+  _sg_mc_checkpoint = xbt_cfg_get_int(_sg_cfg_set, name);
 }
 void _mc_cfg_cb_property(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a property after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_property_file= xbt_cfg_get_string(_sg_cfg_set, name);
 }
 
 void _mc_cfg_cb_timeout(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a value to enable/disable timeout for wait requests after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_timeout= xbt_cfg_get_boolean(_sg_cfg_set, name);
 }
 
 void _mc_cfg_cb_max_depth(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a max depth value after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_max_depth= xbt_cfg_get_int(_sg_cfg_set, name);
 }
 
 void _mc_cfg_cb_visited(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a number of stored visited states after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_visited= xbt_cfg_get_int(_sg_cfg_set, name);
 }
 
 void _mc_cfg_cb_dot_output(const char *name, int pos) {
-  if (_sg_init_status && !_sg_do_model_check) {
+  if (_sg_cfg_init_status && !_sg_do_model_check) {
     xbt_die("You are specifying a file name for a dot output of graph state after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
   }
   _sg_mc_dot_output_file= xbt_cfg_get_string(_sg_cfg_set, name);
 }
 
 /* MC global data structures */
-
 mc_state_t mc_current_state = NULL;
 char mc_replay_mode = FALSE;
 double *mc_time = NULL;
-mc_comparison_times_t mc_comp_times = NULL;
-double mc_snapshot_comparison_time;
+__thread mc_comparison_times_t mc_comp_times = NULL;
+__thread double mc_snapshot_comparison_time;
 mc_stats_t mc_stats = NULL;
 
 /* Safety */
-
 xbt_fifo_t mc_stack_safety = NULL;
 mc_global_t initial_state_safety = NULL;
 
 /* Liveness */
-
 xbt_fifo_t mc_stack_liveness = NULL;
 mc_global_t initial_state_liveness = NULL;
 int compare;
 
-/* Local */
-xbt_dict_t mc_local_variables = NULL;
-/* Global */
-xbt_dynar_t mc_global_variables = NULL;
+xbt_automaton_t _mc_property_automaton = NULL;
+
+/* Variables */
+xbt_dict_t mc_local_variables_libsimgrid = NULL;
+xbt_dict_t mc_local_variables_binary = NULL;
+xbt_dynar_t mc_global_variables_libsimgrid = NULL;
+xbt_dynar_t mc_global_variables_binary = NULL;
+xbt_dict_t mc_variables_type_libsimgrid = NULL;
+xbt_dict_t mc_variables_type_binary = NULL;
 
 /* Ignore mechanism */
 xbt_dynar_t mc_stack_comparison_ignore;
@@ -119,767 +123,1186 @@ xbt_dynar_t mc_data_bss_comparison_ignore;
 extern xbt_dynar_t mc_heap_comparison_ignore;
 extern xbt_dynar_t stacks_areas;
 
+/* Dot output */
 FILE *dot_output = NULL;
 const char* colors[13];
 
-xbt_automaton_t _mc_property_automaton = NULL;
-
-/* Static functions */
 
-static void MC_assert_pair(int prop);
-static dw_location_t get_location(xbt_dict_t location_list, char *expr);
-static dw_frame_t get_frame_by_offset(xbt_dict_t all_variables, unsigned long int offset);
-static size_t data_bss_ignore_size(void *address);
-static void MC_get_global_variables(char *elf_file);
+/*******************************  DWARF Information *******************************/
+/**********************************************************************************/
 
-void MC_do_the_modelcheck_for_real() {
+/************************** Free functions *************************/
 
-  MC_SET_RAW_MEM;
-  mc_comp_times = xbt_new0(s_mc_comparison_times_t, 1);
-  MC_UNSET_RAW_MEM;
+static void dw_location_free(dw_location_t l){
+  if(l){
+    if(l->type == e_dw_loclist)
+      xbt_dynar_free(&(l->location.loclist));
+    else if(l->type == e_dw_compose)
+      xbt_dynar_free(&(l->location.compose));
+    else if(l->type == e_dw_arithmetic)
+      xbt_free(l->location.arithmetic);
   
-  if (!_sg_mc_property_file || _sg_mc_property_file[0]=='\0') {
-    if (mc_reduce_kind==e_mc_reduce_unset)
-      mc_reduce_kind=e_mc_reduce_dpor;
+    xbt_free(l);
+  }
+}
 
-    XBT_INFO("Check a safety property");
-    MC_modelcheck_safety();
+static void dw_location_entry_free(dw_location_entry_t e){
+  dw_location_free(e->location);
+  xbt_free(e);
+}
 
-  } else  {
+static void dw_type_free(dw_type_t t){
+  xbt_free(t->name);
+  xbt_free(t->dw_type_id);
+  xbt_dynar_free(&(t->members));
+  xbt_free(t);
+}
 
-    if (mc_reduce_kind==e_mc_reduce_unset)
-      mc_reduce_kind=e_mc_reduce_none;
+static void dw_type_free_voidp(void *t){
+  dw_type_free((dw_type_t) * (void **) t);
+}
 
-    XBT_INFO("Check the liveness property %s",_sg_mc_property_file);
-    MC_automaton_load(_sg_mc_property_file);
-    MC_modelcheck_liveness();
+static void dw_variable_free(dw_variable_t v){
+  if(v){
+    xbt_free(v->name);
+    xbt_free(v->type_origin);
+    if(!v->global)
+      dw_location_free(v->address.location);
+    xbt_free(v);
   }
 }
 
-
-void MC_compare(void){
-  compare = 1;
+static void dw_variable_free_voidp(void *t){
+  dw_variable_free((dw_variable_t) * (void **) t);
 }
 
-void MC_init(){
-
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-  
-  compare = 0;
-
-  /* Initialize the data structures that must be persistent across every
-     iteration of the model-checker (in RAW memory) */
+/*************************************************************************/
 
-  MC_SET_RAW_MEM;
+static dw_location_t MC_dwarf_get_location(xbt_dict_t location_list, char *expr){
 
-  MC_init_memory_map_info();
-  
-  mc_local_variables = xbt_dict_new_homogeneous(NULL);
+  dw_location_t loc = xbt_new0(s_dw_location_t, 1);
 
-  /* Get local variables in binary for state equality detection */
-  xbt_dict_t binary_location_list = MC_get_location_list(xbt_binary_name);
-  MC_get_local_variables(xbt_binary_name, binary_location_list, &mc_local_variables);
+  if(location_list != NULL){
+    
+    char *key = bprintf("%d", (int)strtoul(expr, NULL, 16));
+    loc->type = e_dw_loclist;
+    loc->location.loclist =  (xbt_dynar_t)xbt_dict_get_or_null(location_list, key);
+    if(loc->location.loclist == NULL)
+      XBT_INFO("Key not found in loclist");
+    xbt_free(key);
+    return loc;
 
-  /* Get local variables in libsimgrid for state equality detection */
-  xbt_dict_t libsimgrid_location_list = MC_get_location_list(libsimgrid_path);
-  MC_get_local_variables(libsimgrid_path, libsimgrid_location_list, &mc_local_variables);
+  }else{
 
-  xbt_dict_free(&libsimgrid_location_list);
-  xbt_dict_free(&binary_location_list);
-  
-  /* Get .plt section (start and end addresses) for data libsimgrid and data program comparison */
-  get_libsimgrid_plt_section();
-  get_binary_plt_section();
+    int cursor = 0;
+    char *tok = NULL, *tok2 = NULL; 
+    
+    xbt_dynar_t tokens1 = xbt_str_split(expr, ";");
+    xbt_dynar_t tokens2;
 
-  /* Get global variables */
-  MC_get_global_variables(xbt_binary_name);
-  MC_get_global_variables(libsimgrid_path);
+    loc->type = e_dw_compose;
+    loc->location.compose = xbt_dynar_new(sizeof(dw_location_t), NULL);
 
-  MC_UNSET_RAW_MEM;
+    while(cursor < xbt_dynar_length(tokens1)){
 
-   /* Ignore some variables from xbt/ex.h used by exception e for stacks comparison */
-  MC_ignore_stack("e", "*");
-  MC_ignore_stack("__ex_cleanup", "*");
-  MC_ignore_stack("__ex_mctx_en", "*");
-  MC_ignore_stack("__ex_mctx_me", "*");
-  MC_ignore_stack("__xbt_ex_ctx_ptr", "*");
-  MC_ignore_stack("_log_ev", "*");
-  MC_ignore_stack("_throw_ctx", "*");
-  MC_ignore_stack("ctx", "*");
-
-  MC_ignore_stack("next_context", "smx_ctx_sysv_suspend_serial");
-  MC_ignore_stack("i", "smx_ctx_sysv_suspend_serial");
+      tok = xbt_dynar_get_as(tokens1, cursor, char*);
+      tokens2 = xbt_str_split(tok, " ");
+      tok2 = xbt_dynar_get_as(tokens2, 0, char*);
+      
+      if(strncmp(tok2, "DW_OP_reg", 9) == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_register;
+        new_element->location.reg = atoi(strtok(tok2, "DW_OP_reg"));
+        xbt_dynar_push(loc->location.compose, &new_element);     
+      }else if(strcmp(tok2, "DW_OP_fbreg:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_fbregister_op;
+        new_element->location.fbreg_op = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strncmp(tok2, "DW_OP_breg", 10) == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_bregister_op;
+        new_element->location.breg_op.reg = atoi(strtok(tok2, "DW_OP_breg"));
+        new_element->location.breg_op.offset = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strncmp(tok2, "DW_OP_lit", 9) == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_lit;
+        new_element->location.lit = atoi(strtok(tok2, "DW_OP_lit"));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok2, "DW_OP_piece:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_piece;
+        new_element->location.piece = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok2, "DW_OP_plus_uconst:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_plus_uconst;
+        new_element->location.plus_uconst = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char *));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok, "DW_OP_abs") == 0 || 
+               strcmp(tok, "DW_OP_and") == 0 ||
+               strcmp(tok, "DW_OP_div") == 0 ||
+               strcmp(tok, "DW_OP_minus") == 0 ||
+               strcmp(tok, "DW_OP_mod") == 0 ||
+               strcmp(tok, "DW_OP_mul") == 0 ||
+               strcmp(tok, "DW_OP_neg") == 0 ||
+               strcmp(tok, "DW_OP_not") == 0 ||
+               strcmp(tok, "DW_OP_or") == 0 ||
+               strcmp(tok, "DW_OP_plus") == 0){               
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_arithmetic;
+        new_element->location.arithmetic = strdup(strtok(tok2, "DW_OP_"));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok, "DW_OP_stack_value") == 0){
+      }else if(strcmp(tok2, "DW_OP_deref_size:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_deref;
+        new_element->location.deref_size = (unsigned int short) atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok, "DW_OP_deref") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_deref;
+        new_element->location.deref_size = sizeof(void *);
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok2, "DW_OP_constu:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_uconstant;
+        new_element->location.uconstant.bytes = 1;
+        new_element->location.uconstant.value = (unsigned long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok2, "DW_OP_consts:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_sconstant;
+        new_element->location.sconstant.bytes = 1;
+        new_element->location.sconstant.value = (long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok2, "DW_OP_const1u:") == 0 ||
+               strcmp(tok2, "DW_OP_const2u:") == 0 ||
+               strcmp(tok2, "DW_OP_const4u:") == 0 ||
+               strcmp(tok2, "DW_OP_const8u:") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_uconstant;
+        new_element->location.uconstant.bytes = tok2[11] - '0';
+        new_element->location.uconstant.value = (unsigned long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else if(strcmp(tok, "DW_OP_const1s") == 0 ||
+               strcmp(tok, "DW_OP_const2s") == 0 ||
+               strcmp(tok, "DW_OP_const4s") == 0 ||
+               strcmp(tok, "DW_OP_const8s") == 0){
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_sconstant;
+        new_element->location.sconstant.bytes = tok2[11] - '0';
+        new_element->location.sconstant.value = (long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }else{
+        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
+        new_element->type = e_dw_unsupported;
+        xbt_dynar_push(loc->location.compose, &new_element);
+      }
 
-  /* Ignore local variable about time used for tracing */
-  MC_ignore_stack("start_time", "*"); 
+      cursor++;
+      xbt_dynar_free(&tokens2);
 
-  MC_ignore_data_bss(&mc_comp_times, sizeof(mc_comp_times));
-  MC_ignore_data_bss(&mc_snapshot_comparison_time, sizeof(mc_snapshot_comparison_time)); 
-  MC_ignore_data_bss(&mc_time, sizeof(mc_time));
+    }
+    
+    xbt_dynar_free(&tokens1);
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+    return loc;
+    
+  }
 
 }
 
-void MC_init_dot_output(){ /* FIXME : more colors */
+static xbt_dict_t MC_dwarf_get_location_list(const char *elf_file){
 
-  colors[0] = "blue";
-  colors[1] = "red";
-  colors[2] = "green3";
-  colors[3] = "goldenrod";
-  colors[4] = "brown";
-  colors[5] = "purple";
-  colors[6] = "magenta";
-  colors[7] = "turquoise4";
-  colors[8] = "gray25";
-  colors[9] = "forestgreen";
-  colors[10] = "hotpink";
-  colors[11] = "lightblue";
-  colors[12] = "tan";
+  char *command = bprintf("objdump -Wo %s", elf_file);
 
-  dot_output = fopen(_sg_mc_dot_output_file, "w");
-  
-  if(dot_output == NULL){
-    perror("Error open dot output file");
+  FILE *fp = popen(command, "r");
+
+  if(fp == NULL){
+    perror("popen for objdump failed");
     xbt_abort();
   }
 
-  fprintf(dot_output, "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
+  int debug = 0; /*Detect if the program has been compiled with -g */
 
-}
+  xbt_dict_t location_list = xbt_dict_new_homogeneous(NULL);
+  char *line = NULL, *loc_expr = NULL;
+  ssize_t read;
+  size_t n = 0;
+  int cursor_remove;
+  xbt_dynar_t split = NULL;
 
-void MC_modelcheck_safety(void)
-{
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+  while ((read = xbt_getline(&line, &n, fp)) != -1) {
 
-  /* Check if MC is already initialized */
-  if (initial_state_safety)
-    return;
+    /* Wipeout the new line character */
+    line[read - 1] = '\0';
 
-  mc_time = xbt_new0(double, simix_process_maxpid);
+    xbt_str_trim(line, NULL);
+    
+    if(n == 0)
+      continue;
 
-  /* mc_time refers to clock for each process -> ignore it for heap comparison */  
-  MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
+    if(strlen(line) == 0)
+      continue;
 
-  /* Initialize the data structures that must be persistent across every
-     iteration of the model-checker (in RAW memory) */
-  
-  MC_SET_RAW_MEM;
+    if(debug == 0){
 
-  /* Initialize statistics */
-  mc_stats = xbt_new0(s_mc_stats_t, 1);
-  mc_stats->state_size = 1;
+      if(strncmp(line, elf_file, strlen(elf_file)) == 0)
+        continue;
+      
+      if(strncmp(line, "Contents", 8) == 0)
+        continue;
 
-  /* Create exploration stack */
-  mc_stack_safety = xbt_fifo_new();
+      if(strncmp(line, "Offset", 6) == 0){
+        debug = 1;
+        continue;
+      }
+    }
 
-  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0'))
-    MC_init_dot_output();
+    if(debug == 0){
+      XBT_INFO("Your program must be compiled with -g");
+      xbt_abort();
+    }
 
-  MC_UNSET_RAW_MEM;
+    xbt_dynar_t loclist = xbt_dynar_new(sizeof(dw_location_entry_t), NULL);
 
-  if(_sg_mc_visited > 0){
-    MC_init();
-  }else{
-    MC_SET_RAW_MEM;
-    MC_init_memory_map_info();
-    get_libsimgrid_plt_section();
-    get_binary_plt_section();
-    MC_UNSET_RAW_MEM;
-  }
-
-  MC_dpor_init();
-
-  MC_SET_RAW_MEM;
-  /* Save the initial state */
-  initial_state_safety = xbt_new0(s_mc_global_t, 1);
-  initial_state_safety->snapshot = MC_take_snapshot();
-  MC_UNSET_RAW_MEM;
+    xbt_str_strip_spaces(line);
+    split = xbt_str_split(line, " ");
 
-  MC_dpor();
+    while(read != -1 && strcmp("<End", (char *)xbt_dynar_get_as(split, 1, char *)) != 0){
+      
+      dw_location_entry_t new_entry = xbt_new0(s_dw_location_entry_t, 1);
+      new_entry->lowpc = strtoul((char *)xbt_dynar_get_as(split, 1, char *), NULL, 16);
+      new_entry->highpc = strtoul((char *)xbt_dynar_get_as(split, 2, char *), NULL, 16);
+      
+      cursor_remove =0;
+      while(cursor_remove < 3){
+        xbt_dynar_remove_at(split, 0, NULL);
+        cursor_remove++;
+      }
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+      loc_expr = xbt_str_join(split, " ");
+      xbt_str_ltrim(loc_expr, "(");
+      xbt_str_rtrim(loc_expr, ")");
+      new_entry->location = MC_dwarf_get_location(NULL, loc_expr);
 
-  MC_exit();
-}
+      xbt_dynar_push(loclist, &new_entry);
 
-void MC_modelcheck_liveness(){
+      xbt_dynar_free(&split);
+      free(loc_expr);
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+      read = xbt_getline(&line, &n, fp);
+      if(read != -1){
+        line[read - 1] = '\0';
+        xbt_str_strip_spaces(line);
+        split = xbt_str_split(line, " ");
+      }
 
-  MC_init();
+    }
 
-  mc_time = xbt_new0(double, simix_process_maxpid);
 
-  /* mc_time refers to clock for each process -> ignore it for heap comparison */  
-  MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
-  MC_SET_RAW_MEM;
-  /* Initialize statistics */
-  mc_stats = xbt_new0(s_mc_stats_t, 1);
-  mc_stats->state_size = 1;
+    char *key = bprintf("%d", (int)strtoul((char *)xbt_dynar_get_as(split, 0, char *), NULL, 16));
+    xbt_dict_set(location_list, key, loclist, NULL);
+    xbt_free(key);
+    
+    xbt_dynar_free(&split);
 
-  /* Create exploration stack */
-  mc_stack_liveness = xbt_fifo_new();
+  }
 
-  /* Create the initial state */
-  initial_state_liveness = xbt_new0(s_mc_global_t, 1);
+  xbt_free(line);
+  xbt_free(command);
+  pclose(fp);
 
-  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0'))
-    MC_init_dot_output();
-  
-  MC_UNSET_RAW_MEM;
+  return location_list;
+}
 
-  MC_ddfs_init();
+static dw_frame_t MC_dwarf_get_frame_by_offset(xbt_dict_t all_variables, unsigned long int offset){
 
-  /* We're done */
-  MC_print_statistics(mc_stats);
-  xbt_free(mc_time);
+  xbt_dict_cursor_t cursor = NULL;
+  char *name;
+  dw_frame_t res;
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  xbt_dict_foreach(all_variables, cursor, name, res) {
+    if(offset >= res->start && offset < res->end){
+      xbt_dict_cursor_free(&cursor);
+      return res;
+    }
+  }
 
+  xbt_dict_cursor_free(&cursor);
+  return NULL;
+  
 }
 
+static dw_variable_t MC_dwarf_get_variable_by_name(dw_frame_t frame, char *var){
 
-void MC_exit(void)
-{
-  xbt_free(mc_time);
-  MC_memory_exit();
-  xbt_abort();
-}
+  unsigned int cursor = 0;
+  dw_variable_t current_var;
 
-int SIMIX_pre_mc_random(smx_simcall_t simcall){
+  xbt_dynar_foreach(frame->variables, cursor, current_var){
+    if(strcmp(var, current_var->name) == 0)
+      return current_var;
+  }
 
-  return simcall->mc_value;
+  return NULL;
 }
 
+static int MC_dwarf_get_variable_index(xbt_dynar_t variables, char* var, void *address){
 
-int MC_random(void)
-{
-  /*FIXME: return mc_current_state->executed_transition->random.value;*/
-  return simcall_mc_random();
-}
-
-/**
- * \brief Schedules all the process that are ready to run
- */
-void MC_wait_for_requests(void)
-{
-  smx_process_t process;
-  smx_simcall_t req;
-  unsigned int iter;
+  if(xbt_dynar_is_empty(variables))
+    return 0;
 
-  while (!xbt_dynar_is_empty(simix_global->process_to_run)) {
-    SIMIX_process_runall();
-    xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
-      req = &process->simcall;
-      if (req->call != SIMCALL_NONE && !MC_request_is_visible(req))
-        SIMIX_simcall_pre(req, 0);
-    }
-  }
-}
+  unsigned int cursor = 0;
+  int start = 0;
+  int end = xbt_dynar_length(variables) - 1;
+  dw_variable_t var_test = NULL;
 
-int MC_deadlock_check()
-{
-  int deadlock = FALSE;
-  smx_process_t process;
-  if(xbt_swag_size(simix_global->process_list)){
-    deadlock = TRUE;
-    xbt_swag_foreach(process, simix_global->process_list){
-      if(process->simcall.call != SIMCALL_NONE
-         && MC_request_is_enabled(&process->simcall)){
-        deadlock = FALSE;
-        break;
+  while(start <= end){
+    cursor = (start + end) / 2;
+    var_test = (dw_variable_t)xbt_dynar_get_as(variables, cursor, dw_variable_t);
+    if(strcmp(var_test->name, var) < 0){
+      start = cursor + 1;
+    }else if(strcmp(var_test->name, var) > 0){
+      end = cursor - 1;
+    }else{
+      if(address){ /* global variable */
+        if(var_test->address.address == address)
+          return -1;
+        if(var_test->address.address > address)
+          end = cursor - 1;
+        else
+          start = cursor + 1;
+      }else{ /* local variable */
+        return -1;
       }
     }
   }
-  return deadlock;
-}
-
-/**
- * \brief Re-executes from the state at position start all the transitions indicated by
- *        a given model-checker stack.
- * \param stack The stack with the transitions to execute.
- * \param start Start index to begin the re-execution.
- */
-void MC_replay(xbt_fifo_t stack, int start)
-{
-  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
 
-  int value, i = 1, count = 1;
-  char *req_str;
-  smx_simcall_t req = NULL, saved_req = NULL;
-  xbt_fifo_item_t item, start_item;
-  mc_state_t state;
-  smx_process_t process = NULL;
+  if(strcmp(var_test->name, var) == 0){
+    if(address && var_test->address.address < address)
+      return cursor+1;
+    else
+      return cursor;
+  }else if(strcmp(var_test->name, var) < 0)
+    return cursor+1;
+  else
+    return cursor;
 
-  XBT_DEBUG("**** Begin Replay ****");
+}
 
-  if(start == -1){
-    /* Restore the initial state */
-    MC_restore_snapshot(initial_state_safety->snapshot);
-    /* At the moment of taking the snapshot the raw heap was set, so restoring
-     * it will set it back again, we have to unset it to continue  */
-    MC_UNSET_RAW_MEM;
-  }
 
-  start_item = xbt_fifo_get_last_item(stack);
-  if(start != -1){
-    while (i != start){
-      start_item = xbt_fifo_get_prev_item(start_item);
-      i++;
-    }
-  }
+static void MC_dwarf_get_variables(const char *elf_file, xbt_dict_t location_list, xbt_dict_t *local_variables, xbt_dynar_t *global_variables, xbt_dict_t *types){
 
-  MC_SET_RAW_MEM;
-  xbt_dict_reset(first_enabled_state);
-  xbt_swag_foreach(process, simix_global->process_list){
-    if(MC_process_is_enabled(process)){
-      char *key = bprintf("%lu", process->pid);
-      char *data = bprintf("%d", count);
-      xbt_dict_set(first_enabled_state, key, data, NULL);
-      xbt_free(key);
-    }
-  }
-  MC_UNSET_RAW_MEM;
+  char *command = bprintf("objdump -Wi %s", elf_file);
   
+  FILE *fp = popen(command, "r");
 
-  /* Traverse the stack from the state at position start and re-execute the transitions */
-  for (item = start_item;
-       item != xbt_fifo_get_first_item(stack);
-       item = xbt_fifo_get_prev_item(item)) {
+  if(fp == NULL)
+    perror("popen for objdump failed");
 
-    state = (mc_state_t) xbt_fifo_get_item_content(item);
-    saved_req = MC_state_get_executed_request(state, &value);
-   
-    MC_SET_RAW_MEM;
-    char *key = bprintf("%lu", saved_req->issuer->pid);
-    xbt_dict_remove(first_enabled_state, key); 
-    xbt_free(key);
-    MC_UNSET_RAW_MEM;
-   
-    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->simcall;
+  char *line = NULL, *origin, *abstract_origin, *current_frame = NULL, 
+    *subprogram_name = NULL, *subprogram_start = NULL, *subprogram_end = NULL,
+    *node_type = NULL, *location_type = NULL, *variable_name = NULL, 
+    *loc_expr = NULL, *name = NULL, *end =NULL, *type_origin = NULL, *global_address = NULL, 
+    *parent_value = NULL;
 
-      /* Debug information */
-      if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
-        req_str = MC_request_to_string(req, value);
-        XBT_DEBUG("Replay: %s (%p)", req_str, state);
-        xbt_free(req_str);
-      }
-    }
-    
-    SIMIX_simcall_pre(req, value);
-    MC_wait_for_requests();
+  ssize_t read =0;
+  size_t n = 0;
+  int global_variable = 0, parent = 0, new_frame = 0, new_variable = 1, size = 0, 
+    is_pointer = 0, struct_decl = 0, member_end = 0,
+    enumeration_size = 0, subrange = 0, union_decl = 0, offset = 0, index = 0;
+  
+  xbt_dynar_t split = NULL, split2 = NULL;
 
-    count++;
+  xbt_dict_t variables_origin = xbt_dict_new_homogeneous(xbt_free);
+  xbt_dict_t subprograms_origin = xbt_dict_new_homogeneous(xbt_free);
 
-    MC_SET_RAW_MEM;
-    /* Insert in dict all enabled processes */
-    xbt_swag_foreach(process, simix_global->process_list){
-      if(MC_process_is_enabled(process) /*&& !MC_state_process_is_done(state, process)*/){
-        char *key = bprintf("%lu", process->pid);
-        if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){
-          char *data = bprintf("%d", count);
-          xbt_dict_set(first_enabled_state, key, data, NULL);
-        }
-        xbt_free(key);
-      }
-    }
-    MC_UNSET_RAW_MEM;
-         
-    /* Update statistics */
-    mc_stats->visited_states++;
-    mc_stats->executed_transitions++;
+  dw_frame_t variable_frame, subroutine_frame = NULL;
 
-  }
+  e_dw_type_type type_type = -1;
 
-  XBT_DEBUG("**** End Replay ****");
+  read = xbt_getline(&line, &n, fp);
 
-  if(raw_mem)
-    MC_SET_RAW_MEM;
-  else
-    MC_UNSET_RAW_MEM;
-  
+  while (read != -1) {
 
-}
+    /* Wipeout the new line character */
+    line[read - 1] = '\0';
+  
+    if(n == 0 || strlen(line) == 0){
+      read = xbt_getline(&line, &n, fp);
+      continue;
+    }
 
-void MC_replay_liveness(xbt_fifo_t stack, int all_stack)
-{
+    xbt_str_ltrim(line, NULL);
+    xbt_str_strip_spaces(line);
+    
+    if(line[0] != '<'){
+      read = xbt_getline(&line, &n, fp);
+      continue;
+    }
+    
+    xbt_dynar_free(&split);
+    split = xbt_str_split(line, " ");
 
-  initial_state_liveness->raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+    /* Get node type */
+    node_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
 
-  int value;
-  char *req_str;
-  smx_simcall_t req = NULL, saved_req = NULL;
-  xbt_fifo_item_t item;
-  mc_state_t state;
-  mc_pair_t pair;
-  int depth = 1;
+    if(strcmp(node_type, "(DW_TAG_subprogram)") == 0){ /* New frame */
 
-  XBT_DEBUG("**** Begin Replay ****");
+      dw_frame_t frame = NULL;
 
-  /* Restore the initial state */
-  MC_restore_snapshot(initial_state_liveness->snapshot);
+      strtok(xbt_dynar_get_as(split, 0, char *), "<");
+      subprogram_start = xbt_strdup(strtok(NULL, "<"));
+      xbt_str_rtrim(subprogram_start, ">:");
 
-  /* At the moment of taking the snapshot the raw heap was set, so restoring
-   * it will set it back again, we have to unset it to continue  */
-  if(!initial_state_liveness->raw_mem_set)
-    MC_UNSET_RAW_MEM;
+      read = xbt_getline(&line, &n, fp);
+   
+      while(read != -1){
 
-  if(all_stack){
+        /* Wipeout the new line character */
+        line[read - 1] = '\0';
 
-    item = xbt_fifo_get_last_item(stack);
+        if(n == 0 || strlen(line) == 0){
+          read = xbt_getline(&line, &n, fp);
+          continue;
+        }
+        
+        xbt_dynar_free(&split);
+        xbt_str_rtrim(line, NULL);
+        xbt_str_strip_spaces(line);
+        split = xbt_str_split(line, " ");
+          
+        node_type = xbt_dynar_get_as(split, 1, char *);
 
-    while(depth <= xbt_fifo_size(stack)){
+        if(strncmp(node_type, "DW_AT_", 6) != 0)
+          break;
 
-      pair = (mc_pair_t) xbt_fifo_get_item_content(item);
-      state = (mc_state_t) pair->graph_state;
+        if(strcmp(node_type, "DW_AT_sibling") == 0){
 
-      if(pair->requests > 0){
-   
-        saved_req = MC_state_get_executed_request(state, &value);
-        //XBT_DEBUG("SavedReq->call %u", saved_req->call);
-      
-        if(saved_req != NULL){
-          /* 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->simcall;
-          //XBT_DEBUG("Req->call %u", req->call);
-  
-          /* Debug information */
-          if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
-            req_str = MC_request_to_string(req, value);
-            XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
-            xbt_free(req_str);
-          }
-  
-        }
-        SIMIX_simcall_pre(req, value);
-        MC_wait_for_requests();
-      }
+          subprogram_end = xbt_strdup(xbt_dynar_get_as(split, 3, char*));
+          xbt_str_ltrim(subprogram_end, "<0x");
+          xbt_str_rtrim(subprogram_end, ">");
+          
+        }else if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){ /* Frame already in dict */
+          
+          new_frame = 0;
+          abstract_origin = xbt_strdup(xbt_dynar_get_as(split, 2, char*));
+          xbt_str_ltrim(abstract_origin, "<0x");
+          xbt_str_rtrim(abstract_origin, ">");
+          subprogram_name = (char *)xbt_dict_get_or_null(subprograms_origin, abstract_origin);
+          frame = xbt_dict_get_or_null(*local_variables, subprogram_name); 
+          xbt_free(abstract_origin);
 
-      depth++;
-    
-      /* Update statistics */
-      mc_stats->visited_pairs++;
-      mc_stats->executed_transitions++;
+        }else if(strcmp(node_type, "DW_AT_name") == 0){
 
-      item = xbt_fifo_get_prev_item(item);
-    }
+          new_frame = 1;
+          xbt_free(current_frame);
+          frame = xbt_new0(s_dw_frame_t, 1);
+          frame->name = strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *)); 
+          frame->variables = xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
+          frame->frame_base = xbt_new0(s_dw_location_t, 1); 
+          current_frame = strdup(frame->name);
 
-  }else{
+          xbt_dict_set(subprograms_origin, subprogram_start, xbt_strdup(frame->name), NULL);
+        
+        }else if(strcmp(node_type, "DW_AT_frame_base") == 0){
 
-    /* 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)) {
+          location_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
 
-      pair = (mc_pair_t) xbt_fifo_get_item_content(item);
-      state = (mc_state_t) pair->graph_state;
+          if(strcmp(location_type, "list)") == 0){ /* Search location in location list */
+
+            frame->frame_base = MC_dwarf_get_location(location_list, xbt_dynar_get_as(split, 3, char *));
+             
+          }else{
+                
+            xbt_str_strip_spaces(line);
+            split2 = xbt_str_split(line, "(");
+            xbt_dynar_remove_at(split2, 0, NULL);
+            loc_expr = xbt_str_join(split2, " ");
+            xbt_str_rtrim(loc_expr, ")");
+            frame->frame_base = MC_dwarf_get_location(NULL, loc_expr);
+            xbt_dynar_free(&split2);
+            xbt_free(loc_expr);
 
-      if(pair->requests > 0){
-   
-        saved_req = MC_state_get_executed_request(state, &value);
-        //XBT_DEBUG("SavedReq->call %u", saved_req->call);
-      
-        if(saved_req != NULL){
-          /* 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->simcall;
-          //XBT_DEBUG("Req->call %u", req->call);
-  
-          /* Debug information */
-          if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
-            req_str = MC_request_to_string(req, value);
-            XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
-            xbt_free(req_str);
           }
-  
-        }
  
-        SIMIX_simcall_pre(req, value);
-        MC_wait_for_requests();
-      }
+        }else if(strcmp(node_type, "DW_AT_low_pc") == 0){
+          
+          if(frame != NULL)
+            frame->low_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
 
-      depth++;
-    
-      /* Update statistics */
-      mc_stats->visited_pairs++;
-      mc_stats->executed_transitions++;
-    }
-  }  
+        }else if(strcmp(node_type, "DW_AT_high_pc") == 0){
 
-  XBT_DEBUG("**** End Replay ****");
+          if(frame != NULL)
+            frame->high_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
 
-  if(initial_state_liveness->raw_mem_set)
-    MC_SET_RAW_MEM;
-  else
-    MC_UNSET_RAW_MEM;
-  
-}
+        }else if(strcmp(node_type, "DW_AT_MIPS_linkage_name:") == 0){
 
-/**
- * \brief Dumps the contents of a model-checker's stack and shows the actual
- *        execution trace
- * \param stack The stack to dump
- */
-void MC_dump_stack_safety(xbt_fifo_t stack)
-{
-  
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+          xbt_free(frame->name);
+          xbt_free(current_frame);
+          frame->name = strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));   
+          current_frame = strdup(frame->name);
+          xbt_dict_set(subprograms_origin, subprogram_start, xbt_strdup(frame->name), NULL);
 
-  MC_show_stack_safety(stack);
+        }
 
-  if(!_sg_mc_checkpoint){
+        read = xbt_getline(&line, &n, fp);
 
-    mc_state_t state;
+      }
+      if(new_frame == 1){
+        frame->start = strtoul(subprogram_start, NULL, 16);
+        if(subprogram_end != NULL)
+          frame->end = strtoul(subprogram_end, NULL, 16);
+        xbt_dict_set(*local_variables, frame->name, frame, NULL);
+      }
 
-    MC_SET_RAW_MEM;
-    while ((state = (mc_state_t) xbt_fifo_pop(stack)) != NULL)
-      MC_state_delete(state);
-    MC_UNSET_RAW_MEM;
+      xbt_free(subprogram_start);
+      xbt_free(subprogram_end);
+      subprogram_end = NULL;
+        
 
-  }
+    }else if(strcmp(node_type, "(DW_TAG_variable)") == 0){ /* New variable */
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
-  else
-    MC_UNSET_RAW_MEM;
-  
-}
+      dw_variable_t var = NULL;
+      
+      parent_value = strdup(xbt_dynar_get_as(split, 0, char *));
+      parent_value = strtok(parent_value,"<");
+      xbt_str_rtrim(parent_value, ">");
+      parent = atoi(parent_value);
+      xbt_free(parent_value);
+
+      if(parent == 1)
+        global_variable = 1;
+    
+      strtok(xbt_dynar_get_as(split, 0, char *), "<");
+      origin = xbt_strdup(strtok(NULL, "<"));
+      xbt_str_rtrim(origin, ">:");
+      
+      read = xbt_getline(&line, &n, fp);
+      
+      while(read != -1){
 
+        /* Wipeout the new line character */
+        line[read - 1] = '\0'; 
 
-void MC_show_stack_safety(xbt_fifo_t stack)
-{
+        if(n == 0 || strlen(line) == 0){
+          read = xbt_getline(&line, &n, fp);
+          continue;
+        }
+    
+        xbt_dynar_free(&split);
+        xbt_str_rtrim(line, NULL);
+        xbt_str_strip_spaces(line);
+        split = xbt_str_split(line, " ");
+  
+        node_type = xbt_dynar_get_as(split, 1, char *);
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+        if(strncmp(node_type, "DW_AT_", 6) != 0)
+          break;
 
-  MC_SET_RAW_MEM;
+        if(strcmp(node_type, "DW_AT_name") == 0){
 
-  int value;
-  mc_state_t state;
-  xbt_fifo_item_t item;
-  smx_simcall_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)) {
-    req = MC_state_get_executed_request(state, &value);
-    if(req){
-      req_str = MC_request_to_string(req, value);
-      XBT_INFO("%s", req_str);
-      xbt_free(req_str);
-    }
-  }
+          var = xbt_new0(s_dw_variable_t, 1);
+          var->name = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));
+          xbt_dict_set(variables_origin, origin, xbt_strdup(var->name), NULL);
+         
+        }else if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){
 
-  if(!raw_mem_set)
-    MC_UNSET_RAW_MEM;
-}
+          new_variable = 0;
 
-void MC_show_deadlock(smx_simcall_t req)
-{
-  /*char *req_str = NULL;*/
-  XBT_INFO("**************************");
-  XBT_INFO("*** DEAD-LOCK DETECTED ***");
-  XBT_INFO("**************************");
-  XBT_INFO("Locked request:");
-  /*req_str = MC_request_to_string(req);
-    XBT_INFO("%s", req_str);
-    xbt_free(req_str);*/
-  XBT_INFO("Counter-example execution trace:");
-  MC_dump_stack_safety(mc_stack_safety);
-  MC_print_statistics(mc_stats);
-}
+          abstract_origin = xbt_dynar_get_as(split, 2, char *);
+          xbt_str_ltrim(abstract_origin, "<0x");
+          xbt_str_rtrim(abstract_origin, ">");
+          
+          variable_name = (char *)xbt_dict_get_or_null(variables_origin, abstract_origin);
+          variable_frame = MC_dwarf_get_frame_by_offset(*local_variables, strtoul(abstract_origin, NULL, 16));
+          var = MC_dwarf_get_variable_by_name(variable_frame, variable_name); 
 
+        }else if(strcmp(node_type, "DW_AT_location") == 0){
 
-void MC_show_stack_liveness(xbt_fifo_t stack){
-  int value;
-  mc_pair_t pair;
-  xbt_fifo_item_t item;
-  smx_simcall_t req;
-  char *req_str = NULL;
-  
-  for (item = xbt_fifo_get_last_item(stack);
-       (item ? (pair = (mc_pair_t) (xbt_fifo_get_item_content(item)))
-        : (NULL)); item = xbt_fifo_get_prev_item(item)) {
-    req = MC_state_get_executed_request(pair->graph_state, &value);
-    if(req){
-      if(pair->requests>0){
-        req_str = MC_request_to_string(req, value);
-        XBT_INFO("%s", req_str);
-        xbt_free(req_str);
-      }else{
-        XBT_INFO("End of system requests but evolution in Büchi automaton");
+          if(var != NULL){
+
+            if(!global_variable){
+
+              location_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
+
+              if(strcmp(location_type, "list)") == 0){ /* Search location in location list */
+                var->address.location = MC_dwarf_get_location(location_list, xbt_dynar_get_as(split, 3, char *));
+              }else{
+                xbt_str_strip_spaces(line);
+                split2 = xbt_str_split(line, "(");
+                xbt_dynar_remove_at(split2, 0, NULL);
+                loc_expr = xbt_str_join(split2, " ");
+                xbt_str_rtrim(loc_expr, ")");
+                if(strncmp("DW_OP_addr", loc_expr, 10) == 0){
+                  global_variable = 1;
+                  xbt_dynar_free(&split2);
+                  split2 = xbt_str_split(loc_expr, " ");
+                  if(strcmp(elf_file, xbt_binary_name) != 0)
+                    var->address.address = (char *)start_text_libsimgrid + (long)((void *)strtoul(xbt_dynar_get_as(split2, xbt_dynar_length(split2) - 1, char*), NULL, 16));
+                  else
+                    var->address.address = (void *)strtoul(xbt_dynar_get_as(split2, xbt_dynar_length(split2) - 1, char*), NULL, 16);
+                }else{
+                  var->address.location = MC_dwarf_get_location(NULL, loc_expr);
+                }
+                xbt_dynar_free(&split2);
+                xbt_free(loc_expr);
+              }
+            }else{
+              global_address = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));
+              xbt_str_rtrim(global_address, ")");
+              if(strcmp(elf_file, xbt_binary_name) != 0)
+                var->address.address = (char *)start_text_libsimgrid + (long)((void *)strtoul(global_address, NULL, 16));
+              else
+                var->address.address = (void *)strtoul(global_address, NULL, 16);
+              xbt_free(global_address);
+              global_address = NULL;
+            }
+
+          }
+                   
+        }else if(strcmp(node_type, "DW_AT_type") == 0){
+          
+          type_origin = xbt_strdup(xbt_dynar_get_as(split, 3, char *));
+          xbt_str_ltrim(type_origin, "<0x");
+          xbt_str_rtrim(type_origin, ">");
+        
+        }else if(strcmp(node_type, "DW_AT_declaration") == 0){
+
+          new_variable = 0;
+          if(new_variable){
+            dw_variable_free(var);
+            var = NULL;
+          }
+        
+        }else if(strcmp(node_type, "DW_AT_artificial") == 0){
+          
+          new_variable = 0;
+          if(new_variable){
+            dw_variable_free(var);
+            var = NULL;
+          }
+        
+        }
+
+        read = xbt_getline(&line, &n, fp);
       }
-    }
-  }
-}
 
-void MC_dump_stack_liveness(xbt_fifo_t stack){
+      if(new_variable == 1){
+        
+        if(!global_variable){
+          variable_frame = xbt_dict_get_or_null(*local_variables, current_frame);
+          var->type_origin = strdup(type_origin);
+          var->global = 0;
+          index = MC_dwarf_get_variable_index(variable_frame->variables, var->name, NULL);
+          if(index != -1)
+            xbt_dynar_insert_at(variable_frame->variables, index, &var);
+        }else{
+          var->type_origin = strdup(type_origin);
+          var->global = 1;
+          index = MC_dwarf_get_variable_index(*global_variables, var->name, var->address.address);
+          if(index != -1)
+            xbt_dynar_insert_at(*global_variables, index, &var); 
+        }
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+         xbt_free(type_origin);
+         type_origin = NULL;
+      }
 
-  mc_pair_t pair;
+      global_variable = 0;
+      new_variable = 1;
 
-  MC_SET_RAW_MEM;
-  while ((pair = (mc_pair_t) xbt_fifo_pop(stack)) != NULL)
-    MC_pair_delete(pair);
-  MC_UNSET_RAW_MEM;
+    }else if(strcmp(node_type, "(DW_TAG_inlined_subroutine)") == 0){
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+      read = xbt_getline(&line, &n, fp);
 
-}
+      while(read != -1){
 
+        /* Wipeout the new line character */
+        line[read - 1] = '\0'; 
 
-void MC_print_statistics(mc_stats_t stats)
-{
-  if(stats->expanded_pairs == 0){
-    XBT_INFO("Expanded states = %lu", stats->expanded_states);
-    XBT_INFO("Visited states = %lu", stats->visited_states);
-  }else{
-    XBT_INFO("Expanded pairs = %lu", stats->expanded_pairs);
-    XBT_INFO("Visited pairs = %lu", stats->visited_pairs);
-  }
-  XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
-  MC_SET_RAW_MEM;
-  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0')){
-    fprintf(dot_output, "}\n");
-    fclose(dot_output);
-  }
-  MC_UNSET_RAW_MEM;
-}
+        if(n == 0 || strlen(line) == 0){
+          read = xbt_getline(&line, &n, fp);
+          continue;
+        }
 
-void MC_assert(int prop)
-{
-  if (MC_is_active() && !prop){
-    XBT_INFO("**************************");
-    XBT_INFO("*** PROPERTY NOT VALID ***");
-    XBT_INFO("**************************");
-    XBT_INFO("Counter-example execution trace:");
-    MC_dump_stack_safety(mc_stack_safety);
-    MC_print_statistics(mc_stats);
-    xbt_abort();
-  }
-}
+        xbt_dynar_free(&split);
+        xbt_str_rtrim(line, NULL);
+        xbt_str_strip_spaces(line);
+        split = xbt_str_split(line, " ");
+        
+        if(strncmp(xbt_dynar_get_as(split, 1, char *), "DW_AT_", 6) != 0)
+          break;
+          
+        node_type = xbt_dynar_get_as(split, 1, char *);
 
-static void MC_assert_pair(int prop){
-  if (MC_is_active() && !prop) {
-    XBT_INFO("**************************");
-    XBT_INFO("*** PROPERTY NOT VALID ***");
-    XBT_INFO("**************************");
-    //XBT_INFO("Counter-example execution trace:");
-    MC_show_stack_liveness(mc_stack_liveness);
-    //MC_dump_snapshot_stack(mc_snapshot_stack);
-    MC_print_statistics(mc_stats);
-    xbt_abort();
-  }
-}
+        if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){
 
-void MC_process_clock_add(smx_process_t process, double amount)
-{
-  mc_time[process->pid] += amount;
-}
+          origin = xbt_dynar_get_as(split, 2, char *);
+          xbt_str_ltrim(origin, "<0x");
+          xbt_str_rtrim(origin, ">");
+          
+          subprogram_name = (char *)xbt_dict_get_or_null(subprograms_origin, origin);
+          subroutine_frame = xbt_dict_get_or_null(*local_variables, subprogram_name);
+        
+        }else if(strcmp(node_type, "DW_AT_low_pc") == 0){
 
-double MC_process_clock_get(smx_process_t process)
-{
-  if(mc_time){
-    if(process != NULL)
-      return mc_time[process->pid];
-    else 
-      return -1;
-  }else{
-    return 0;
-  }
-}
+          subroutine_frame->low_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
 
-void MC_automaton_load(const char *file){
+        }else if(strcmp(node_type, "DW_AT_high_pc") == 0){
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+          subroutine_frame->high_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
+        }
 
-  MC_SET_RAW_MEM;
+        read = xbt_getline(&line, &n, fp);
+      
+      }
 
-  if (_mc_property_automaton == NULL)
-    _mc_property_automaton = xbt_automaton_new();
-  
-  xbt_automaton_load(_mc_property_automaton,file);
+    }else if(strcmp(node_type, "(DW_TAG_base_type)") == 0 
+             || strcmp(node_type, "(DW_TAG_enumeration_type)") == 0
+             || strcmp(node_type, "(DW_TAG_enumerator)") == 0
+             || strcmp(node_type, "(DW_TAG_typedef)") == 0
+             || strcmp(node_type, "(DW_TAG_const_type)") == 0
+             || strcmp(node_type, "(DW_TAG_subroutine_type)") == 0
+             || strcmp(node_type, "(DW_TAG_volatile_type)") == 0
+             || (is_pointer = !strcmp(node_type, "(DW_TAG_pointer_type)"))){
+
+      if(strcmp(node_type, "(DW_TAG_base_type)") == 0)
+        type_type = e_dw_base_type;
+      else if(strcmp(node_type, "(DW_TAG_enumeration_type)") == 0)
+        type_type = e_dw_enumeration_type;
+      else if(strcmp(node_type, "(DW_TAG_enumerator)") == 0)
+        type_type = e_dw_enumerator;
+      else if(strcmp(node_type, "(DW_TAG_typedef)") == 0)
+        type_type = e_dw_typedef;
+      else if(strcmp(node_type, "(DW_TAG_const_type)") == 0)
+        type_type = e_dw_const_type;
+      else if(strcmp(node_type, "(DW_TAG_pointer_type)") == 0)
+        type_type = e_dw_pointer_type;
+      else if(strcmp(node_type, "(DW_TAG_subroutine_type)") == 0)
+        type_type = e_dw_subroutine_type;
+      else if(strcmp(node_type, "(DW_TAG_volatile_type)") == 0)
+        type_type = e_dw_volatile_type;
 
-  MC_UNSET_RAW_MEM;
+      strtok(xbt_dynar_get_as(split, 0, char *), "<");
+      origin = strdup(strtok(NULL, "<"));
+      xbt_str_rtrim(origin, ">:");
+      
+      read = xbt_getline(&line, &n, fp);
+      
+      while(read != -1){
+        
+         /* Wipeout the new line character */
+        line[read - 1] = '\0'; 
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+        if(n == 0 || strlen(line) == 0){
+          read = xbt_getline(&line, &n, fp);
+          continue;
+        }
 
-}
+        xbt_dynar_free(&split);
+        xbt_str_rtrim(line, NULL);
+        xbt_str_strip_spaces(line);
+        split = xbt_str_split(line, " ");
+        
+        if(strncmp(xbt_dynar_get_as(split, 1, char *), "DW_AT_", 6) != 0)
+          break;
 
-void MC_automaton_new_propositional_symbol(const char* id, void* fct) {
+        node_type = xbt_dynar_get_as(split, 1, char *);
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+        if(strcmp(node_type, "DW_AT_byte_size") == 0){
+          size = strtol(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL, 10);
+          if(type_type == e_dw_enumeration_type)
+            enumeration_size = size;
+        }else if(strcmp(node_type, "DW_AT_name") == 0){
+          end = xbt_str_join(split, " ");
+          xbt_dynar_free(&split);
+          split = xbt_str_split(end, "):");
+          xbt_str_ltrim(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL);
+          name = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*));
+        }else if(strcmp(node_type, "DW_AT_type") == 0){
+          type_origin = xbt_strdup(xbt_dynar_get_as(split, 3, char *));
+          xbt_str_ltrim(type_origin, "<0x");
+          xbt_str_rtrim(type_origin, ">");
+        }
+        
+        read = xbt_getline(&line, &n, fp);
+      }
 
-  MC_SET_RAW_MEM;
+      dw_type_t type = xbt_new0(s_dw_type_t, 1);
+      type->type = type_type;
+      if(name)
+        type->name = xbt_strdup(name);
+      else
+        type->name = xbt_strdup("undefined");
+      type->is_pointer_type = is_pointer;
+      type->id = (void *)strtoul(origin, NULL, 16);
+      if(type_origin)
+        type->dw_type_id = xbt_strdup(type_origin);
+      if(type_type == e_dw_enumerator)
+        type->size = enumeration_size;
+      else
+        type->size = size;
+      type->members = NULL;
 
-  if (_mc_property_automaton == NULL)
-    _mc_property_automaton = xbt_automaton_new();
+      xbt_dict_set(*types, origin, type, NULL); 
 
-  xbt_automaton_propositional_symbol_new(_mc_property_automaton,id,fct);
+      xbt_free(name);
+      name = NULL;
+      xbt_free(type_origin);
+      type_origin = NULL;
+      xbt_free(end);
+      end = NULL;
 
-  MC_UNSET_RAW_MEM;
+      is_pointer = 0;
+      size = 0;
+      xbt_free(origin);
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
-  
-}
+    }else if(strcmp(node_type, "(DW_TAG_structure_type)") == 0 || strcmp(node_type, "(DW_TAG_union_type)") == 0){
+      
+      if(strcmp(node_type, "(DW_TAG_structure_type)") == 0)
+        struct_decl = 1;
+      else
+        union_decl = 1;
 
-/************ MC_ignore ***********/ 
+      strtok(xbt_dynar_get_as(split, 0, char *), "<");
+      origin = strdup(strtok(NULL, "<"));
+      xbt_str_rtrim(origin, ">:");
+      
+      read = xbt_getline(&line, &n, fp);
 
-void heap_ignore_region_free(mc_heap_ignore_region_t r){
-  xbt_free(r);
-}
+      dw_type_t type = NULL;
 
-void heap_ignore_region_free_voidp(void *r){
-  heap_ignore_region_free((mc_heap_ignore_region_t) * (void **) r);
-}
+      while(read != -1){
+      
+        while(read != -1){
+        
+          /* Wipeout the new line character */
+          line[read - 1] = '\0'; 
 
-void MC_ignore_heap(void *address, size_t size){
+          if(n == 0 || strlen(line) == 0){
+            read = xbt_getline(&line, &n, fp);
+            continue;
+          }
 
-  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+          xbt_dynar_free(&split);
+          xbt_str_rtrim(line, NULL);
+          xbt_str_strip_spaces(line);
+          split = xbt_str_split(line, " ");
+        
+          node_type = xbt_dynar_get_as(split, 1, char *);
 
-  MC_SET_RAW_MEM;
+          if(strncmp(node_type, "DW_AT_", 6) != 0){
+            member_end = 1;
+            break;
+          }
 
-  mc_heap_ignore_region_t region = NULL;
-  region = xbt_new0(s_mc_heap_ignore_region_t, 1);
-  region->address = address;
-  region->size = size;
-  
-  region->block = ((char*)address - (char*)((xbt_mheap_t)std_heap)->heapbase) / BLOCKSIZE + 1;
-  
-  if(((xbt_mheap_t)std_heap)->heapinfo[region->block].type == 0){
-    region->fragment = -1;
-    ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_block.ignore++;
-  }else{
-    region->fragment = ((uintptr_t) (ADDR2UINT (address) % (BLOCKSIZE))) >> ((xbt_mheap_t)std_heap)->heapinfo[region->block].type;
-    ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_frag.ignore[region->fragment]++;
-  }
-  
-  if(mc_heap_comparison_ignore == NULL){
-    mc_heap_comparison_ignore = xbt_dynar_new(sizeof(mc_heap_ignore_region_t), heap_ignore_region_free_voidp);
-    xbt_dynar_push(mc_heap_comparison_ignore, &region);
-    if(!raw_mem_set)
-      MC_UNSET_RAW_MEM;
-    return;
-  }
+          if(strcmp(node_type, "DW_AT_byte_size") == 0){
+            size = strtol(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL, 10);
+          }else if(strcmp(node_type, "DW_AT_name") == 0){
+            xbt_free(end);
+            end = xbt_str_join(split, " ");
+            xbt_dynar_free(&split);
+            split = xbt_str_split(end, "):");
+            xbt_str_ltrim(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL);
+            name = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*));
+          }else if(strcmp(node_type, "DW_AT_type") == 0){
+            type_origin = xbt_strdup(xbt_dynar_get_as(split, 3, char *));
+            xbt_str_ltrim(type_origin, "<0x");
+            xbt_str_rtrim(type_origin, ">");
+          }else if(strcmp(node_type, "DW_AT_data_member_location:") == 0){
+            xbt_free(end);
+            end = xbt_str_join(split, " ");
+            xbt_dynar_free(&split);
+            split = xbt_str_split(end, "DW_OP_plus_uconst:");
+            xbt_str_ltrim(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *), NULL);
+            xbt_str_rtrim(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *), ")");
+            offset = strtol(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL, 10);
+          }
 
-  unsigned int cursor = 0;
-  mc_heap_ignore_region_t current_region = NULL;
-  int start = 0;
+          read = xbt_getline(&line, &n, fp);
+          
+        }
+
+        if(member_end && type){         
+          member_end = 0;
+          
+          dw_type_t member_type = xbt_new0(s_dw_type_t, 1);
+          member_type->name = xbt_strdup(name);
+          member_type->size = size;
+          member_type->is_pointer_type = is_pointer;
+          member_type->id = (void *)strtoul(origin, NULL, 16);
+          member_type->offset = offset;
+          if(type_origin)
+            member_type->dw_type_id = xbt_strdup(type_origin);
+
+          xbt_dynar_push(type->members, &member_type);
+
+          xbt_free(name);
+          name = NULL;
+          xbt_free(end);
+          end = NULL;
+          xbt_free(type_origin);
+          type_origin = NULL;
+          size = 0;
+          offset = 0;
+
+          xbt_free(origin);
+          origin = NULL;
+          strtok(xbt_dynar_get_as(split, 0, char *), "<");
+          origin = strdup(strtok(NULL, "<"));
+          xbt_str_rtrim(origin, ">:");
+
+        }
+
+        if(struct_decl || union_decl){
+          type = xbt_new0(s_dw_type_t, 1);
+          if(struct_decl)
+            type->type = e_dw_structure_type;
+          else
+            type->type = e_dw_union_type;
+          type->name = xbt_strdup(name);
+          type->size = size;
+          type->is_pointer_type = is_pointer;
+          type->id = (void *)strtoul(origin, NULL, 16);
+          if(type_origin)
+            type->dw_type_id = xbt_strdup(type_origin);
+          type->members = xbt_dynar_new(sizeof(dw_type_t), dw_type_free_voidp);
+          
+          xbt_dict_set(*types, origin, type, NULL); 
+          
+          xbt_free(name);
+          name = NULL;
+          xbt_free(end);
+          end = NULL;
+          xbt_free(type_origin);
+          type_origin = NULL;
+          size = 0;
+          struct_decl = 0;
+          union_decl = 0;
+
+        }
+
+        if(strcmp(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *), "(DW_TAG_member)") != 0)
+          break;  
+
+        read = xbt_getline(&line, &n, fp);
+    
+      }
+
+      xbt_free(origin);
+      origin = NULL;
+
+    }else if(strcmp(node_type, "(DW_TAG_array_type)") == 0){
+      
+      strtok(xbt_dynar_get_as(split, 0, char *), "<");
+      origin = strdup(strtok(NULL, "<"));
+      xbt_str_rtrim(origin, ">:");
+      
+      read = xbt_getline(&line, &n, fp);
+
+      dw_type_t type = NULL;
+
+      while(read != -1){
+      
+        while(read != -1){
+        
+          /* Wipeout the new line character */
+          line[read - 1] = '\0'; 
+
+          if(n == 0 || strlen(line) == 0){
+            read = xbt_getline(&line, &n, fp);
+            continue;
+          }
+
+          xbt_dynar_free(&split);
+          xbt_str_rtrim(line, NULL);
+          xbt_str_strip_spaces(line);
+          split = xbt_str_split(line, " ");
+        
+          node_type = xbt_dynar_get_as(split, 1, char *);
+
+          if(strncmp(node_type, "DW_AT_", 6) != 0)
+            break;
+
+          if(strcmp(node_type, "DW_AT_upper_bound") == 0){
+            size = strtol(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL, 10);
+          }else if(strcmp(node_type, "DW_AT_name") == 0){
+            end = xbt_str_join(split, " ");
+            xbt_dynar_free(&split);
+            split = xbt_str_split(end, "):");
+            xbt_str_ltrim(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*), NULL);
+            name = xbt_strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char*));
+          }else if(strcmp(node_type, "DW_AT_type") == 0){
+            type_origin = xbt_strdup(xbt_dynar_get_as(split, 3, char *));
+            xbt_str_ltrim(type_origin, "<0x");
+            xbt_str_rtrim(type_origin, ">");
+          }
+
+          read = xbt_getline(&line, &n, fp);
+          
+        }
+
+        if(strcmp(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *), "(DW_TAG_subrange_type)") == 0){
+          subrange = 1;         
+        }
+
+        if(subrange && type){         
+          type->size = size;
+      
+          xbt_free(name);
+          name = NULL;
+          xbt_free(end);
+          end = NULL;
+          xbt_free(type_origin);
+          type_origin = NULL;
+          size = 0;
+
+          xbt_free(origin);
+          origin = NULL;
+          strtok(xbt_dynar_get_as(split, 0, char *), "<");
+          origin = strdup(strtok(NULL, "<"));
+          xbt_str_rtrim(origin, ">:");
+
+        }else {
+          
+          type = xbt_new0(s_dw_type_t, 1);
+          type->type = e_dw_array_type;
+          type->name = xbt_strdup(name);
+          type->is_pointer_type = is_pointer;
+          type->id = (void *)strtoul(origin, NULL, 16);
+          if(type_origin)
+            type->dw_type_id = xbt_strdup(type_origin);
+          type->members = NULL;
+          
+          xbt_dict_set(*types, origin, type, NULL); 
+          
+          xbt_free(name);
+          name = NULL;
+          xbt_free(end);
+          end = NULL;
+          xbt_free(type_origin);
+          type_origin = NULL;
+          size = 0;
+        }
+
+        if(strcmp(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *), "(DW_TAG_subrange_type)") != 0)
+          break;  
+
+        read = xbt_getline(&line, &n, fp);
+    
+      }
+
+      xbt_free(origin);
+      origin = NULL;
+
+    }else{
+
+      read = xbt_getline(&line, &n, fp);
+
+    }
+
+  }
+  
+  xbt_dynar_free(&split);
+  xbt_dict_free(&variables_origin);
+  xbt_dict_free(&subprograms_origin);
+  xbt_free(line);
+  xbt_free(command);
+  pclose(fp);
+  
+}
+
+
+/*******************************  Ignore mechanism *******************************/
+/*********************************************************************************/
+
+xbt_dynar_t mc_checkpoint_ignore;
+
+typedef struct s_mc_stack_ignore_variable{
+  char *var_name;
+  char *frame;
+}s_mc_stack_ignore_variable_t, *mc_stack_ignore_variable_t;
+
+typedef struct s_mc_data_bss_ignore_variable{
+  char *name;
+}s_mc_data_bss_ignore_variable_t, *mc_data_bss_ignore_variable_t;
+
+/**************************** Free functions ******************************/
+
+static void stack_ignore_variable_free(mc_stack_ignore_variable_t v){
+  xbt_free(v->var_name);
+  xbt_free(v->frame);
+  xbt_free(v);
+}
+
+static void stack_ignore_variable_free_voidp(void *v){
+  stack_ignore_variable_free((mc_stack_ignore_variable_t) * (void **) v);
+}
+
+void heap_ignore_region_free(mc_heap_ignore_region_t r){
+  xbt_free(r);
+}
+
+void heap_ignore_region_free_voidp(void *r){
+  heap_ignore_region_free((mc_heap_ignore_region_t) * (void **) r);
+}
+
+static void data_bss_ignore_variable_free(mc_data_bss_ignore_variable_t v){
+  xbt_free(v->name);
+  xbt_free(v);
+}
+
+static void data_bss_ignore_variable_free_voidp(void *v){
+  data_bss_ignore_variable_free((mc_data_bss_ignore_variable_t) * (void **) v);
+}
+
+static void checkpoint_ignore_region_free(mc_checkpoint_ignore_region_t r){
+  xbt_free(r);
+}
+
+static void checkpoint_ignore_region_free_voidp(void *r){
+  checkpoint_ignore_region_free((mc_checkpoint_ignore_region_t) * (void **) r);
+}
+
+/***********************************************************************/
+
+void MC_ignore_heap(void *address, size_t size){
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  mc_heap_ignore_region_t region = NULL;
+  region = xbt_new0(s_mc_heap_ignore_region_t, 1);
+  region->address = address;
+  region->size = size;
+  
+  region->block = ((char*)address - (char*)((xbt_mheap_t)std_heap)->heapbase) / BLOCKSIZE + 1;
+  
+  if(((xbt_mheap_t)std_heap)->heapinfo[region->block].type == 0){
+    region->fragment = -1;
+    ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_block.ignore++;
+  }else{
+    region->fragment = ((uintptr_t) (ADDR2UINT (address) % (BLOCKSIZE))) >> ((xbt_mheap_t)std_heap)->heapinfo[region->block].type;
+    ((xbt_mheap_t)std_heap)->heapinfo[region->block].busy_frag.ignore[region->fragment]++;
+  }
+  
+  if(mc_heap_comparison_ignore == NULL){
+    mc_heap_comparison_ignore = xbt_dynar_new(sizeof(mc_heap_ignore_region_t), heap_ignore_region_free_voidp);
+    xbt_dynar_push(mc_heap_comparison_ignore, &region);
+    if(!raw_mem_set)
+      MC_UNSET_RAW_MEM;
+    return;
+  }
+
+  unsigned int cursor = 0;
+  mc_heap_ignore_region_t current_region = NULL;
+  int start = 0;
   int end = xbt_dynar_length(mc_heap_comparison_ignore) - 1;
   
   while(start <= end){
@@ -890,11 +1313,11 @@ void MC_ignore_heap(void *address, size_t size){
       if(!raw_mem_set)
         MC_UNSET_RAW_MEM;
       return;
-    }
-    if(current_region->address < address)
+    }else if(current_region->address < address){
       start = cursor + 1;
-    if(current_region->address > address)
-      end = cursor - 1;   
+    }else{
+      end = cursor - 1;
+    }   
   }
 
   if(current_region->address < address)
@@ -902,10 +1325,8 @@ void MC_ignore_heap(void *address, size_t size){
   else
     xbt_dynar_insert_at(mc_heap_comparison_ignore, cursor, &region);
 
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
 void MC_remove_ignore_heap(void *address, size_t size){
@@ -926,15 +1347,15 @@ void MC_remove_ignore_heap(void *address, size_t size){
     if(region->address == address){
       ignore_found = 1;
       break;
-    }
-    if(region->address < address)
+    }else if(region->address < address){
       start = cursor + 1;
-    if(region->address > address){
+    }else{
       if((char * )region->address <= ((char *)address + size)){
         ignore_found = 1;
         break;
-      }else
+      }else{
         end = cursor - 1;   
+      }
     }
   }
   
@@ -943,207 +1364,209 @@ void MC_remove_ignore_heap(void *address, size_t size){
     MC_remove_ignore_heap(address, size);
   }
 
-  MC_UNSET_RAW_MEM;
-  
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
-
-}
-
-void data_bss_ignore_variable_free(mc_data_bss_ignore_variable_t v){
-  xbt_free(v);
-}
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 
-void data_bss_ignore_variable_free_voidp(void *v){
-  data_bss_ignore_variable_free((mc_data_bss_ignore_variable_t) * (void **) v);
 }
 
-void MC_ignore_data_bss(void *address, size_t size){
+void MC_ignore_global_variable(const char *name){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
   MC_SET_RAW_MEM;
-  
-  if(mc_data_bss_comparison_ignore == NULL)
-    mc_data_bss_comparison_ignore = xbt_dynar_new(sizeof(mc_data_bss_ignore_variable_t), data_bss_ignore_variable_free_voidp);
-
-  mc_data_bss_ignore_variable_t var = NULL;
-  var = xbt_new0(s_mc_data_bss_ignore_variable_t, 1);
-  var->address = address;
-  var->size = size;
 
-  if(xbt_dynar_is_empty(mc_data_bss_comparison_ignore)){
+  if(mc_global_variables_libsimgrid){
 
-    xbt_dynar_insert_at(mc_data_bss_comparison_ignore, 0, &var);
-
-  }else{
-    
     unsigned int cursor = 0;
+    dw_variable_t current_var;
     int start = 0;
-    int end = xbt_dynar_length(mc_data_bss_comparison_ignore) - 1;
-    mc_data_bss_ignore_variable_t current_var = NULL;
+    int end = xbt_dynar_length(mc_global_variables_libsimgrid) - 1;
 
     while(start <= end){
-      cursor = (start + end) / 2;
-      current_var = (mc_data_bss_ignore_variable_t)xbt_dynar_get_as(mc_data_bss_comparison_ignore, cursor, mc_data_bss_ignore_variable_t);
-      if(current_var->address == address){
-        data_bss_ignore_variable_free(var);
-        MC_UNSET_RAW_MEM;
-        if(raw_mem_set)
-          MC_SET_RAW_MEM;
-        return;
-      }
-      if(current_var->address < address)
+      cursor = (start + end) /2;
+      current_var = (dw_variable_t)xbt_dynar_get_as(mc_global_variables_libsimgrid, cursor, dw_variable_t);
+      if(strcmp(current_var->name, name) == 0){
+        xbt_dynar_remove_at(mc_global_variables_libsimgrid, cursor, NULL);
+        start = 0;
+        end = xbt_dynar_length(mc_global_variables_libsimgrid) - 1;
+      }else if(strcmp(current_var->name, name) < 0){
         start = cursor + 1;
-      if(current_var->address > address)
+      }else{
         end = cursor - 1;
+      } 
     }
+   
+  }else{
 
-    if(current_var->address < address)
-      xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor + 1, &var);
-    else
-      xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor, &var);
-
-  }
-
-  /* Remove variable from mc_global_variables */
+    if(mc_data_bss_comparison_ignore == NULL)
+      mc_data_bss_comparison_ignore = xbt_dynar_new(sizeof(mc_data_bss_ignore_variable_t), data_bss_ignore_variable_free_voidp);
 
-  if(mc_global_variables != NULL){
+    mc_data_bss_ignore_variable_t var = NULL;
+    var = xbt_new0(s_mc_data_bss_ignore_variable_t, 1);
+    var->name = strdup(name);
 
-    unsigned int cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(mc_global_variables) - 1;
-    global_variable_t current_var;
-    int var_found;
+    if(xbt_dynar_is_empty(mc_data_bss_comparison_ignore)){
 
-    while(start <= end){
-      cursor = (start + end) / 2;
-      current_var = (global_variable_t)xbt_dynar_get_as(mc_global_variables, cursor, global_variable_t);
-      if(current_var->address == var->address){
-        var_found = 1;
-        break;
-      }
-      if(current_var->address < address)
-        start = cursor + 1;
-      if(current_var->address > address)
-        end = cursor - 1;
-    }
+      xbt_dynar_insert_at(mc_data_bss_comparison_ignore, 0, &var);
 
-    if(var_found)
-      xbt_dynar_remove_at(mc_global_variables, cursor, NULL);
+    }else{
     
-  }
-
-  MC_UNSET_RAW_MEM;
-
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
-}
-
-static size_t data_bss_ignore_size(void *address){
-  unsigned int cursor = 0;
-  int start = 0;
-  int end = xbt_dynar_length(mc_data_bss_comparison_ignore) - 1;
-  mc_data_bss_ignore_variable_t var;
+      unsigned int cursor = 0;
+      int start = 0;
+      int end = xbt_dynar_length(mc_data_bss_comparison_ignore) - 1;
+      mc_data_bss_ignore_variable_t current_var = NULL;
+
+      while(start <= end){
+        cursor = (start + end) / 2;
+        current_var = (mc_data_bss_ignore_variable_t)xbt_dynar_get_as(mc_data_bss_comparison_ignore, cursor, mc_data_bss_ignore_variable_t);
+        if(strcmp(current_var->name, name) == 0){
+          data_bss_ignore_variable_free(var);
+          if(!raw_mem_set)
+            MC_UNSET_RAW_MEM;
+          return;
+        }else if(strcmp(current_var->name, name) < 0){
+          start = cursor + 1;
+        }else{
+          end = cursor - 1;
+        }
+      }
 
-  while(start <= end){
-    cursor = (start + end) / 2;
-    var = (mc_data_bss_ignore_variable_t)xbt_dynar_get_as(mc_data_bss_comparison_ignore, cursor, mc_data_bss_ignore_variable_t);
-    if(var->address == address)
-      return var->size;
-    if(var->address < address){
-      if((void *)((char *)var->address + var->size) > address)
-        return (char *)var->address + var->size - (char*)address;
+      if(strcmp(current_var->name, name) < 0)
+        xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor + 1, &var);
       else
-        start = cursor + 1;
+        xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor, &var);
+
     }
-    if(var->address > address)
-      end = cursor - 1;   
   }
 
-  return 0;
-}
-
-void stack_ignore_variable_free(mc_stack_ignore_variable_t v){
-  xbt_free(v->var_name);
-  xbt_free(v->frame);
-  xbt_free(v);
-}
-
-void stack_ignore_variable_free_voidp(void *v){
-  stack_ignore_variable_free((mc_stack_ignore_variable_t) * (void **) v);
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
-void MC_ignore_stack(const char *var_name, const char *frame_name){
+void MC_ignore_local_variable(const char *var_name, const char *frame_name){
   
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
   MC_SET_RAW_MEM;
 
-  if(mc_stack_comparison_ignore == NULL)
-    mc_stack_comparison_ignore = xbt_dynar_new(sizeof(mc_stack_ignore_variable_t), stack_ignore_variable_free_voidp);
-  
-  mc_stack_ignore_variable_t var = NULL;
-  var = xbt_new0(s_mc_stack_ignore_variable_t, 1);
-  var->var_name = strdup(var_name);
-  var->frame = strdup(frame_name);
-  
-  if(xbt_dynar_is_empty(mc_stack_comparison_ignore)){
-
-    xbt_dynar_insert_at(mc_stack_comparison_ignore, 0, &var);
-
-  }else{
-    
+  if(mc_local_variables_libsimgrid){
     unsigned int cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(mc_stack_comparison_ignore) - 1;
-    mc_stack_ignore_variable_t current_var = NULL;
-
-    while(start <= end){
-      cursor = (start + end) / 2;
-      current_var = (mc_stack_ignore_variable_t)xbt_dynar_get_as(mc_stack_comparison_ignore, cursor, mc_stack_ignore_variable_t);
-      if(strcmp(current_var->frame, frame_name) == 0){
-        if(strcmp(current_var->var_name, var_name) == 0){
-          stack_ignore_variable_free(var);
-          MC_UNSET_RAW_MEM;
-          if(raw_mem_set)
-            MC_SET_RAW_MEM;
-          return;
+    dw_variable_t current_var;
+    int start, end;
+    if(strcmp(frame_name, "*") == 0){ /* Remove variable in all frames */
+      xbt_dict_cursor_t dict_cursor;
+      char *current_frame_name;
+      dw_frame_t frame;
+      xbt_dict_foreach(mc_local_variables_libsimgrid, dict_cursor, current_frame_name, frame){
+        start = 0;
+        end = xbt_dynar_length(frame->variables) - 1;
+        while(start <= end){
+          cursor = (start + end) / 2;
+          current_var = (dw_variable_t)xbt_dynar_get_as(frame->variables, cursor, dw_variable_t); 
+          if(strcmp(current_var->name, var_name) == 0){
+            xbt_dynar_remove_at(frame->variables, cursor, NULL);
+            start = 0;
+            end = xbt_dynar_length(frame->variables) - 1;
+          }else if(strcmp(current_var->name, var_name) < 0){
+            start = cursor + 1;
+          }else{
+            end = cursor - 1;
+          } 
+        }
+      }
+       xbt_dict_foreach(mc_local_variables_binary, dict_cursor, current_frame_name, frame){
+        start = 0;
+        end = xbt_dynar_length(frame->variables) - 1;
+        while(start <= end){
+          cursor = (start + end) / 2;
+          current_var = (dw_variable_t)xbt_dynar_get_as(frame->variables, cursor, dw_variable_t); 
+          if(strcmp(current_var->name, var_name) == 0){
+            xbt_dynar_remove_at(frame->variables, cursor, NULL);
+            start = 0;
+            end = xbt_dynar_length(frame->variables) - 1;
+          }else if(strcmp(current_var->name, var_name) < 0){
+            start = cursor + 1;
+          }else{
+            end = cursor - 1;
+          } 
         }
-        if(strcmp(current_var->var_name, var_name) < 0)
+      }
+    }else{
+      xbt_dynar_t variables_list = ((dw_frame_t)xbt_dict_get_or_null(mc_local_variables_libsimgrid, frame_name))->variables;
+      start = 0;
+      end = xbt_dynar_length(variables_list) - 1;
+      while(start <= end){
+        cursor = (start + end) / 2;
+        current_var = (dw_variable_t)xbt_dynar_get_as(variables_list, cursor, dw_variable_t);
+        if(strcmp(current_var->name, var_name) == 0){
+          xbt_dynar_remove_at(variables_list, cursor, NULL);
+          start = 0;
+          end = xbt_dynar_length(variables_list) - 1;
+        }else if(strcmp(current_var->name, var_name) < 0){
           start = cursor + 1;
-        if(strcmp(current_var->var_name, var_name) > 0)
+        }else{
           end = cursor - 1;
+        } 
       }
-      if(strcmp(current_var->frame, frame_name) < 0)
-        start = cursor + 1;
-      if(strcmp(current_var->frame, frame_name) > 0)
-        end = cursor - 1;
-    }
-
-    if(strcmp(current_var->frame, frame_name) < 0)
-      xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor + 1, &var);
-    else
-      xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor, &var);
-
-  }
-
- /* Remove variable from mc_local_variables */
+    } 
+  }else{
 
-  if(mc_local_variables != NULL){
+    if(mc_stack_comparison_ignore == NULL)
+      mc_stack_comparison_ignore = xbt_dynar_new(sizeof(mc_stack_ignore_variable_t), stack_ignore_variable_free_voidp);
+  
+    mc_stack_ignore_variable_t var = NULL;
+    var = xbt_new0(s_mc_stack_ignore_variable_t, 1);
+    var->var_name = strdup(var_name);
+    var->frame = strdup(frame_name);
+  
+    if(xbt_dynar_is_empty(mc_stack_comparison_ignore)){
 
-    if(strcmp(frame_name, "*") != 0){
-      dw_frame_t frame = xbt_dict_get_or_null(mc_local_variables, frame_name);
-      if(frame != NULL)
-        xbt_dict_remove(frame->variables, var_name);
-    }
+      xbt_dynar_insert_at(mc_stack_comparison_ignore, 0, &var);
 
+    }else{
+    
+      unsigned int cursor = 0;
+      int start = 0;
+      int end = xbt_dynar_length(mc_stack_comparison_ignore) - 1;
+      mc_stack_ignore_variable_t current_var = NULL;
+
+      while(start <= end){
+        cursor = (start + end) / 2;
+        current_var = (mc_stack_ignore_variable_t)xbt_dynar_get_as(mc_stack_comparison_ignore, cursor, mc_stack_ignore_variable_t);
+        if(strcmp(current_var->frame, frame_name) == 0){
+          if(strcmp(current_var->var_name, var_name) == 0){
+            stack_ignore_variable_free(var);
+            if(!raw_mem_set)
+              MC_UNSET_RAW_MEM;
+            return;
+          }else if(strcmp(current_var->var_name, var_name) < 0){
+            start = cursor + 1;
+          }else{
+            end = cursor - 1;
+          }
+        }else if(strcmp(current_var->frame, frame_name) < 0){
+          start = cursor + 1;
+        }else{
+          end = cursor - 1;
+        }
+      }
+
+      if(strcmp(current_var->frame, frame_name) == 0){
+        if(strcmp(current_var->var_name, var_name) < 0){
+          xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor + 1, &var);
+        }else{
+          xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor, &var);
+        }
+      }else if(strcmp(current_var->frame, frame_name) < 0){
+        xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor + 1, &var);
+      }else{
+        xbt_dynar_insert_at(mc_stack_comparison_ignore, cursor, &var);
+      }
+    }
   }
 
-  MC_UNSET_RAW_MEM;
-  
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 
 }
 
@@ -1152,6 +1575,7 @@ void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
   MC_SET_RAW_MEM;
+
   if(stacks_areas == NULL)
     stacks_areas = xbt_dynar_new(sizeof(stack_region_t), NULL);
   
@@ -1163,864 +1587,829 @@ void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
   region->size = size;
   region->block = ((char*)stack - (char*)((xbt_mheap_t)std_heap)->heapbase) / BLOCKSIZE + 1;
   xbt_dynar_push(stacks_areas, &region);
-  
-  MC_UNSET_RAW_MEM;
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
-/************ DWARF ***********/
+void MC_ignore(void *addr, size_t size){
 
-xbt_dict_t MC_get_location_list(const char *elf_file){
+  int raw_mem_set= (mmalloc_get_current_heap() == raw_heap);
 
-  char *command = bprintf("objdump -Wo %s", elf_file);
+  MC_SET_RAW_MEM;
 
-  FILE *fp = popen(command, "r");
+  if(mc_checkpoint_ignore == NULL)
+    mc_checkpoint_ignore = xbt_dynar_new(sizeof(mc_checkpoint_ignore_region_t), checkpoint_ignore_region_free_voidp);
 
-  if(fp == NULL){
-    perror("popen for objdump failed");
-    xbt_abort();
-  }
+  mc_checkpoint_ignore_region_t region = xbt_new0(s_mc_checkpoint_ignore_region_t, 1);
+  region->addr = addr;
+  region->size = size;
 
-  int debug = 0; /*Detect if the program has been compiled with -g */
+  if(xbt_dynar_is_empty(mc_checkpoint_ignore)){
+    xbt_dynar_push(mc_checkpoint_ignore, &region);
+  }else{
+     
+    unsigned int cursor = 0;
+    int start = 0;
+    int end = xbt_dynar_length(mc_checkpoint_ignore) -1;
+    mc_checkpoint_ignore_region_t current_region = NULL;
 
-  xbt_dict_t location_list = xbt_dict_new_homogeneous(NULL);
-  char *line = NULL, *loc_expr = NULL;
-  ssize_t read;
-  size_t n = 0;
-  int cursor_remove;
-  xbt_dynar_t split = NULL;
+    while(start <= end){
+      cursor = (start + end) / 2;
+      current_region = (mc_checkpoint_ignore_region_t)xbt_dynar_get_as(mc_checkpoint_ignore, cursor, mc_checkpoint_ignore_region_t);
+      if(current_region->addr == addr){
+        if(current_region->size == size){
+          checkpoint_ignore_region_free(region);
+          if(!raw_mem_set)
+            MC_UNSET_RAW_MEM;
+          return;
+        }else if(current_region->size < size){
+          start = cursor + 1;
+        }else{
+          end = cursor - 1;
+        }
+      }else if(current_region->addr < addr){
+          start = cursor + 1;
+      }else{
+        end = cursor - 1;
+      }
+    }
 
-  while ((read = xbt_getline(&line, &n, fp)) != -1) {
+     if(current_region->addr == addr){
+       if(current_region->size < size){
+        xbt_dynar_insert_at(mc_checkpoint_ignore, cursor + 1, &region);
+      }else{
+        xbt_dynar_insert_at(mc_checkpoint_ignore, cursor, &region);
+      }
+    }else if(current_region->addr < addr){
+       xbt_dynar_insert_at(mc_checkpoint_ignore, cursor + 1, &region);
+    }else{
+       xbt_dynar_insert_at(mc_checkpoint_ignore, cursor, &region);
+    }
+  }
 
-    /* Wipeout the new line character */
-    line[read - 1] = '\0';
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
+}
 
-    xbt_str_trim(line, NULL);
-    
-    if(n == 0)
-      continue;
+/*******************************  Initialisation of MC *******************************/
+/*********************************************************************************/
 
-    if(strlen(line) == 0)
-      continue;
+static void MC_dump_ignored_local_variables(void){
 
-    if(debug == 0){
+  if(mc_stack_comparison_ignore == NULL || xbt_dynar_is_empty(mc_stack_comparison_ignore))
+    return;
 
-      if(strncmp(line, elf_file, strlen(elf_file)) == 0)
-        continue;
-      
-      if(strncmp(line, "Contents", 8) == 0)
-        continue;
+  unsigned int cursor = 0;
+  mc_stack_ignore_variable_t current_var;
 
-      if(strncmp(line, "Offset", 6) == 0){
-        debug = 1;
-        continue;
-      }
-    }
+  xbt_dynar_foreach(mc_stack_comparison_ignore, cursor, current_var){
+    MC_ignore_local_variable(current_var->var_name, current_var->frame);
+  }
 
-    if(debug == 0){
-      XBT_INFO("Your program must be compiled with -g");
-      xbt_abort();
-    }
+  xbt_dynar_free(&mc_stack_comparison_ignore);
+  mc_stack_comparison_ignore = NULL;
+}
 
-    xbt_dynar_t loclist = xbt_dynar_new(sizeof(dw_location_entry_t), NULL);
+static void MC_dump_ignored_global_variables(void){
 
-    xbt_str_strip_spaces(line);
-    split = xbt_str_split(line, " ");
+  if(mc_data_bss_comparison_ignore == NULL || xbt_dynar_is_empty(mc_data_bss_comparison_ignore))
+    return;
 
-    while(read != -1 && strcmp("<End", (char *)xbt_dynar_get_as(split, 1, char *)) != 0){
-      
-      dw_location_entry_t new_entry = xbt_new0(s_dw_location_entry_t, 1);
-      new_entry->lowpc = strtoul((char *)xbt_dynar_get_as(split, 1, char *), NULL, 16);
-      new_entry->highpc = strtoul((char *)xbt_dynar_get_as(split, 2, char *), NULL, 16);
-      
-      cursor_remove =0;
-      while(cursor_remove < 3){
-        xbt_dynar_remove_at(split, 0, NULL);
-        cursor_remove++;
-      }
+  unsigned int cursor = 0;
+  mc_data_bss_ignore_variable_t current_var;
 
-      loc_expr = xbt_str_join(split, " ");
-      xbt_str_ltrim(loc_expr, "(");
-      xbt_str_rtrim(loc_expr, ")");
-      new_entry->location = get_location(NULL, loc_expr);
+  xbt_dynar_foreach(mc_data_bss_comparison_ignore, cursor, current_var){
+    MC_ignore_global_variable(current_var->name);
+  } 
 
-      xbt_dynar_push(loclist, &new_entry);
+  xbt_dynar_free(&mc_data_bss_comparison_ignore);
+  mc_data_bss_comparison_ignore = NULL;
 
-      xbt_dynar_free(&split);
-      free(loc_expr);
+}
 
-      read = xbt_getline(&line, &n, fp);
-      if(read != -1){
-        line[read - 1] = '\0';
-        xbt_str_strip_spaces(line);
-        split = xbt_str_split(line, " ");
-      }
+void MC_init(){
 
-    }
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+  
+  compare = 0;
 
+  /* Initialize the data structures that must be persistent across every
+     iteration of the model-checker (in RAW memory) */
 
-    char *key = bprintf("%d", (int)strtoul((char *)xbt_dynar_get_as(split, 0, char *), NULL, 16));
-    xbt_dict_set(location_list, key, loclist, NULL);
-    xbt_free(key);
-    
-    xbt_dynar_free(&split);
+  MC_SET_RAW_MEM;
 
-  }
+  MC_init_memory_map_info();
+  
+  mc_local_variables_libsimgrid = xbt_dict_new_homogeneous(NULL);
+  mc_local_variables_binary = xbt_dict_new_homogeneous(NULL);
+  mc_global_variables_libsimgrid = xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
+  mc_global_variables_binary = xbt_dynar_new(sizeof(dw_variable_t), dw_variable_free_voidp);
+  mc_variables_type_libsimgrid = xbt_dict_new_homogeneous(NULL);
+  mc_variables_type_binary = xbt_dict_new_homogeneous(NULL);
 
-  xbt_free(line);
-  xbt_free(command);
-  pclose(fp);
+  XBT_INFO("Get debug information ...");
 
-  return location_list;
-}
+  /* Get local variables in binary for state equality detection */
+  xbt_dict_t binary_location_list = MC_dwarf_get_location_list(xbt_binary_name);
+  MC_dwarf_get_variables(xbt_binary_name, binary_location_list, &mc_local_variables_binary, &mc_global_variables_binary, &mc_variables_type_binary);
 
-static dw_frame_t get_frame_by_offset(xbt_dict_t all_variables, unsigned long int offset){
+  /* Get local variables in libsimgrid for state equality detection */
+  xbt_dict_t libsimgrid_location_list = MC_dwarf_get_location_list(libsimgrid_path);
+  MC_dwarf_get_variables(libsimgrid_path, libsimgrid_location_list, &mc_local_variables_libsimgrid, &mc_global_variables_libsimgrid, &mc_variables_type_libsimgrid);
 
-  xbt_dict_cursor_t cursor = NULL;
-  char *name;
-  dw_frame_t res;
+  xbt_dict_free(&libsimgrid_location_list);
+  xbt_dict_free(&binary_location_list);
 
-  xbt_dict_foreach(all_variables, cursor, name, res) {
-    if(offset >= res->start && offset < res->end){
-      xbt_dict_cursor_free(&cursor);
-      return res;
-    }
-  }
+  XBT_INFO("Get debug information done !");
 
-  xbt_dict_cursor_free(&cursor);
-  return NULL;
+  /* Remove variables ignored before getting list of variables */
+  MC_dump_ignored_local_variables();
+  MC_dump_ignored_global_variables();
   
-}
+  /* Get .plt section (start and end addresses) for data libsimgrid and data program comparison */
+  MC_get_libsimgrid_plt_section();
+  MC_get_binary_plt_section();
 
-void MC_get_local_variables(const char *elf_file, xbt_dict_t location_list, xbt_dict_t *all_variables){
+   /* Init parmap */
+  parmap = xbt_parmap_mc_new(xbt_os_get_numcores(), XBT_PARMAP_DEFAULT);
 
-  char *command = bprintf("objdump -Wi %s", elf_file);
+  MC_UNSET_RAW_MEM;
+
+   /* Ignore some variables from xbt/ex.h used by exception e for stacks comparison */
+  MC_ignore_local_variable("e", "*");
+  MC_ignore_local_variable("__ex_cleanup", "*");
+  MC_ignore_local_variable("__ex_mctx_en", "*");
+  MC_ignore_local_variable("__ex_mctx_me", "*");
+  MC_ignore_local_variable("__xbt_ex_ctx_ptr", "*");
+  MC_ignore_local_variable("_log_ev", "*");
+  MC_ignore_local_variable("_throw_ctx", "*");
+  MC_ignore_local_variable("ctx", "*");
+
+  MC_ignore_local_variable("next_context", "smx_ctx_sysv_suspend_serial");
+  MC_ignore_local_variable("i", "smx_ctx_sysv_suspend_serial");
+
+  /* Ignore local variable about time used for tracing */
+  MC_ignore_local_variable("start_time", "*"); 
+
+  MC_ignore_global_variable("mc_comp_times");
+  MC_ignore_global_variable("mc_snapshot_comparison_time"); 
+  MC_ignore_global_variable("mc_time");
+  MC_ignore_global_variable("smpi_current_rank");
+  MC_ignore_global_variable("counter"); /* Static variable used for tracing */
+  MC_ignore_global_variable("maestro_stack_start");
+  MC_ignore_global_variable("maestro_stack_end");
+
+  MC_ignore_heap(&(simix_global->process_to_run), sizeof(simix_global->process_to_run));
+  MC_ignore_heap(&(simix_global->process_that_ran), sizeof(simix_global->process_that_ran));
+  MC_ignore_heap(simix_global->process_to_run, sizeof(*(simix_global->process_to_run)));
+  MC_ignore_heap(simix_global->process_that_ran, sizeof(*(simix_global->process_that_ran)));
   
-  FILE *fp = popen(command, "r");
+  smx_process_t process;
+  xbt_swag_foreach(process, simix_global->process_list){
+    MC_ignore_heap(&(process->process_hookup), sizeof(process->process_hookup));
+  }
 
-  if(fp == NULL)
-    perror("popen for objdump failed");
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
 
-  char *line = NULL, *origin, *abstract_origin, *current_frame = NULL;
-  ssize_t read =0;
-  size_t n = 0;
-  int valid_variable = 1;
-  char *node_type = NULL, *location_type = NULL, *variable_name = NULL, *loc_expr = NULL;
-  xbt_dynar_t split = NULL, split2 = NULL;
+}
 
-  xbt_dict_t variables_origin = xbt_dict_new_homogeneous(NULL);
-  xbt_dict_t subprograms_origin = xbt_dict_new_homogeneous(NULL);
-  char *subprogram_name = NULL, *subprogram_start = NULL, *subprogram_end = NULL;
-  int new_frame = 0, new_variable = 0;
-  dw_frame_t variable_frame, subroutine_frame = NULL;
+static void MC_init_dot_output(){ /* FIXME : more colors */
 
-  read = xbt_getline(&line, &n, fp);
+  colors[0] = "blue";
+  colors[1] = "red";
+  colors[2] = "green3";
+  colors[3] = "goldenrod";
+  colors[4] = "brown";
+  colors[5] = "purple";
+  colors[6] = "magenta";
+  colors[7] = "turquoise4";
+  colors[8] = "gray25";
+  colors[9] = "forestgreen";
+  colors[10] = "hotpink";
+  colors[11] = "lightblue";
+  colors[12] = "tan";
 
-  while (read != -1) {
+  dot_output = fopen(_sg_mc_dot_output_file, "w");
+  
+  if(dot_output == NULL){
+    perror("Error open dot output file");
+    xbt_abort();
+  }
 
-    if(n == 0){
-      read = xbt_getline(&line, &n, fp);
-      continue;
-    }
-    /* Wipeout the new line character */
-    line[read - 1] = '\0';
-   
-    if(strlen(line) == 0){
-      read = xbt_getline(&line, &n, fp);
-      continue;
-    }
+  fprintf(dot_output, "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
 
-    xbt_str_ltrim(line, NULL);
-    xbt_str_strip_spaces(line);
-    
-    if(line[0] != '<'){
-      read = xbt_getline(&line, &n, fp);
-      continue;
-    }
-    
-    xbt_dynar_free(&split);
-    split = xbt_str_split(line, " ");
+}
 
-    /* Get node type */
-    node_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
+/*******************************  Core of MC *******************************/
+/**************************************************************************/
 
-    if(strcmp(node_type, "(DW_TAG_subprogram)") == 0){ /* New frame */
+void MC_do_the_modelcheck_for_real() {
 
-      dw_frame_t frame = NULL;
+  MC_SET_RAW_MEM;
+  mc_comp_times = xbt_new0(s_mc_comparison_times_t, 1);
+  MC_UNSET_RAW_MEM;
+  
+  if (!_sg_mc_property_file || _sg_mc_property_file[0]=='\0') {
+    if (mc_reduce_kind==e_mc_reduce_unset)
+      mc_reduce_kind=e_mc_reduce_dpor;
 
-      strtok(xbt_dynar_get_as(split, 0, char *), "<");
-      subprogram_start = strdup(strtok(NULL, "<"));
-      xbt_str_rtrim(subprogram_start, ">:");
+    XBT_INFO("Check a safety property");
+    MC_modelcheck_safety();
 
-      read = xbt_getline(&line, &n, fp);
-   
-      while(read != -1){
+  } else  {
 
-        if(n == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
-        }
+    if (mc_reduce_kind==e_mc_reduce_unset)
+      mc_reduce_kind=e_mc_reduce_none;
 
-        /* Wipeout the new line character */
-        line[read - 1] = '\0';
-        
-        if(strlen(line) == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
-        }
-      
-        xbt_dynar_free(&split);
-        xbt_str_rtrim(line, NULL);
-        xbt_str_strip_spaces(line);
-        split = xbt_str_split(line, " ");
-          
-        node_type = xbt_dynar_get_as(split, 1, char *);
+    XBT_INFO("Check the liveness property %s",_sg_mc_property_file);
+    MC_automaton_load(_sg_mc_property_file);
+    MC_modelcheck_liveness();
+  }
+}
 
-        if(strncmp(node_type, "DW_AT_", 6) != 0)
-          break;
+void MC_modelcheck_safety(void)
+{
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-        if(strcmp(node_type, "DW_AT_sibling") == 0){
+  /* Check if MC is already initialized */
+  if (initial_state_safety)
+    return;
 
-          subprogram_end = strdup(xbt_dynar_get_as(split, 3, char*));
-          xbt_str_ltrim(subprogram_end, "<0x");
-          xbt_str_rtrim(subprogram_end, ">");
-          
-        }else if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){ /* Frame already in dict */
-          
-          new_frame = 0;
-          abstract_origin = strdup(xbt_dynar_get_as(split, 2, char*));
-          xbt_str_ltrim(abstract_origin, "<0x");
-          xbt_str_rtrim(abstract_origin, ">");
-          subprogram_name = (char *)xbt_dict_get_or_null(subprograms_origin, abstract_origin);
-          frame = xbt_dict_get_or_null(*all_variables, subprogram_name); 
-          xbt_free(abstract_origin);
+  mc_time = xbt_new0(double, simix_process_maxpid);
 
-        }else if(strcmp(node_type, "DW_AT_name") == 0){
+  /* mc_time refers to clock for each process -> ignore it for heap comparison */  
+  MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
 
-          new_frame = 1;
-          xbt_free(current_frame);
-          frame = xbt_new0(s_dw_frame_t, 1);
-          frame->name = strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *)); 
-          frame->variables = xbt_dict_new_homogeneous(NULL);
-          frame->frame_base = xbt_new0(s_dw_location_t, 1); 
-          current_frame = strdup(frame->name);
+  /* Initialize the data structures that must be persistent across every
+     iteration of the model-checker (in RAW memory) */
+  
+  MC_SET_RAW_MEM;
 
-          xbt_dict_set(subprograms_origin, subprogram_start, frame->name, NULL);
-        
-        }else if(strcmp(node_type, "DW_AT_frame_base") == 0){
+  /* Initialize statistics */
+  mc_stats = xbt_new0(s_mc_stats_t, 1);
+  mc_stats->state_size = 1;
 
-          location_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
+  /* Create exploration stack */
+  mc_stack_safety = xbt_fifo_new();
 
-          if(strcmp(location_type, "list)") == 0){ /* Search location in location list */
+  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0'))
+    MC_init_dot_output();
 
-            frame->frame_base = get_location(location_list, xbt_dynar_get_as(split, 3, char *));
-             
-          }else{
-                
-            xbt_str_strip_spaces(line);
-            split2 = xbt_str_split(line, "(");
-            xbt_dynar_remove_at(split2, 0, NULL);
-            loc_expr = xbt_str_join(split2, " ");
-            xbt_str_rtrim(loc_expr, ")");
-            frame->frame_base = get_location(NULL, loc_expr);
-            xbt_dynar_free(&split2);
-            xbt_free(loc_expr);
+  MC_UNSET_RAW_MEM;
 
-          }
-        }else if(strcmp(node_type, "DW_AT_low_pc") == 0){
-          
-          if(frame != NULL)
-            frame->low_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
+  if(_sg_mc_visited > 0){
+    MC_init();
+  }else{
+    MC_SET_RAW_MEM;
+    MC_init_memory_map_info();
+    MC_get_libsimgrid_plt_section();
+    MC_get_binary_plt_section();
+    MC_UNSET_RAW_MEM;
+  }
 
-        }else if(strcmp(node_type, "DW_AT_high_pc") == 0){
+  MC_dpor_init();
 
-          if(frame != NULL)
-            frame->high_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
+  MC_SET_RAW_MEM;
+  /* Save the initial state */
+  initial_state_safety = xbt_new0(s_mc_global_t, 1);
+  initial_state_safety->snapshot = MC_take_snapshot(0);
+  MC_UNSET_RAW_MEM;
 
-        }else if(strcmp(node_type, "DW_AT_MIPS_linkage_name:") == 0){
+  MC_dpor();
 
-          xbt_free(frame->name);
-          xbt_free(current_frame);
-          frame->name = strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));   
-          current_frame = strdup(frame->name);
-          xbt_dict_set(subprograms_origin, subprogram_start, frame->name, NULL);
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
 
-        }
+  xbt_abort();
+  //MC_exit();
+}
 
-        read = xbt_getline(&line, &n, fp);
+void MC_modelcheck_liveness(){
 
-      }
-      if(new_frame == 1){
-        frame->start = strtoul(subprogram_start, NULL, 16);
-        if(subprogram_end != NULL)
-          frame->end = strtoul(subprogram_end, NULL, 16);
-        xbt_dict_set(*all_variables, frame->name, frame, NULL);
-      }
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-      xbt_free(subprogram_start);
-      xbt_free(subprogram_end);
-      subprogram_end = NULL;
-        
+  MC_init();
 
-    }else if(strcmp(node_type, "(DW_TAG_variable)") == 0){ /* New variable */
+  mc_time = xbt_new0(double, simix_process_maxpid);
 
-      dw_local_variable_t var = NULL;
-      
-      strtok(xbt_dynar_get_as(split, 0, char *), "<");
-      origin = strdup(strtok(NULL, "<"));
-      xbt_str_rtrim(origin, ">:");
-      
-      read = xbt_getline(&line, &n, fp);
-      
-      while(read != -1){
+  /* mc_time refers to clock for each process -> ignore it for heap comparison */  
+  MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
+  MC_SET_RAW_MEM;
+  /* Initialize statistics */
+  mc_stats = xbt_new0(s_mc_stats_t, 1);
+  mc_stats->state_size = 1;
 
-        if(n == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
-        }
+  /* Create exploration stack */
+  mc_stack_liveness = xbt_fifo_new();
 
-        /* Wipeout the new line character */
-        line[read - 1] = '\0'; 
+  /* Create the initial state */
+  initial_state_liveness = xbt_new0(s_mc_global_t, 1);
 
-        if(strlen(line) == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
-        }
-       
-        xbt_dynar_free(&split);
-        xbt_str_rtrim(line, NULL);
-        xbt_str_strip_spaces(line);
-        split = xbt_str_split(line, " ");
+  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0'))
+    MC_init_dot_output();
   
-        node_type = xbt_dynar_get_as(split, 1, char *);
-
-        if(strncmp(node_type, "DW_AT_", 6) != 0)
-          break;
-
-        if(strcmp(node_type, "DW_AT_name") == 0){
-
-          new_variable = 1;
-          var = xbt_new0(s_dw_local_variable_t, 1);
-          var->name = strdup(xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *));
+  MC_UNSET_RAW_MEM;
 
-          xbt_dict_set(variables_origin, origin, var->name, NULL);
-         
-        }else if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){
+  MC_ddfs_init();
 
-          new_variable = 0;
-          abstract_origin = xbt_dynar_get_as(split, 2, char *);
-          xbt_str_ltrim(abstract_origin, "<0x");
-          xbt_str_rtrim(abstract_origin, ">");
-          
-          variable_name = (char *)xbt_dict_get_or_null(variables_origin, abstract_origin);
-          variable_frame = get_frame_by_offset(*all_variables, strtoul(abstract_origin, NULL, 16));
-          var = xbt_dict_get_or_null(variable_frame->variables, variable_name);   
+  /* We're done */
+  MC_print_statistics(mc_stats);
+  xbt_free(mc_time);
 
-        }else if(strcmp(node_type, "DW_AT_location") == 0){
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
 
-          if(valid_variable == 1 && var != NULL){
+}
 
-            var->location = xbt_new0(s_dw_location_t, 1);
 
-            location_type = xbt_dynar_get_as(split, xbt_dynar_length(split) - 1, char *);
+void MC_exit(void)
+{
+  xbt_free(mc_time);
+  MC_memory_exit();
+  //xbt_abort();
+}
 
-            if(strcmp(location_type, "list)") == 0){ /* Search location in location list */
+int SIMIX_pre_mc_random(smx_simcall_t simcall, int min, int max){
 
-              var->location = get_location(location_list, xbt_dynar_get_as(split, 3, char *));
-             
-            }else{
-                
-              xbt_str_strip_spaces(line);
-              split2 = xbt_str_split(line, "(");
-              xbt_dynar_remove_at(split2, 0, NULL);
-              loc_expr = xbt_str_join(split2, " ");
-              xbt_str_rtrim(loc_expr, ")");
-              var->location = get_location(NULL, loc_expr);
-              xbt_dynar_free(&split2);
-              xbt_free(loc_expr);
+  return simcall->mc_value;
+}
 
-            }
 
-          }
-           
-        }else if(strcmp(node_type, "DW_AT_external") == 0){
+int MC_random(int min, int max)
+{
+  /*FIXME: return mc_current_state->executed_transition->random.value;*/
+  return simcall_mc_random(min, max);
+}
 
-          valid_variable = 0;
-        
-        }
+/**
+ * \brief Schedules all the process that are ready to run
+ */
+void MC_wait_for_requests(void)
+{
+  smx_process_t process;
+  smx_simcall_t req;
+  unsigned int iter;
 
-        read = xbt_getline(&line, &n, fp);
-      }
+  while (!xbt_dynar_is_empty(simix_global->process_to_run)) {
+    SIMIX_process_runall();
+    xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
+      req = &process->simcall;
+      if (req->call != SIMCALL_NONE && !MC_request_is_visible(req))
+        SIMIX_simcall_pre(req, 0);
+    }
+  }
+}
 
-      if(new_variable == 1 && valid_variable == 1){
-        
-        variable_frame = xbt_dict_get_or_null(*all_variables, current_frame);
-        xbt_dict_set(variable_frame->variables, var->name, var, NULL);
+int MC_deadlock_check()
+{
+  int deadlock = FALSE;
+  smx_process_t process;
+  if(xbt_swag_size(simix_global->process_list)){
+    deadlock = TRUE;
+    xbt_swag_foreach(process, simix_global->process_list){
+      if(process->simcall.call != SIMCALL_NONE
+         && MC_request_is_enabled(&process->simcall)){
+        deadlock = FALSE;
+        break;
       }
+    }
+  }
+  return deadlock;
+}
 
-      valid_variable = 1;
-      new_variable = 0;
-
-    }else if(strcmp(node_type, "(DW_TAG_inlined_subroutine)") == 0){
+/**
+ * \brief Re-executes from the state at position start all the transitions indicated by
+ *        a given model-checker stack.
+ * \param stack The stack with the transitions to execute.
+ * \param start Start index to begin the re-execution.
+ */
+void MC_replay(xbt_fifo_t stack, int start)
+{
+  int raw_mem = (mmalloc_get_current_heap() == raw_heap);
 
-      strtok(xbt_dynar_get_as(split, 0, char *), "<");
-      origin = strdup(strtok(NULL, "<"));
-      xbt_str_rtrim(origin, ">:");
+  int value, i = 1, count = 1;
+  char *req_str;
+  smx_simcall_t req = NULL, saved_req = NULL;
+  xbt_fifo_item_t item, start_item;
+  mc_state_t state;
+  smx_process_t process = NULL;
 
-      read = xbt_getline(&line, &n, fp);
+  XBT_DEBUG("**** Begin Replay ****");
 
-      while(read != -1){
+  if(start == -1){
+    /* Restore the initial state */
+    MC_restore_snapshot(initial_state_safety->snapshot);
+    /* At the moment of taking the snapshot the raw heap was set, so restoring
+     * it will set it back again, we have to unset it to continue  */
+    MC_UNSET_RAW_MEM;
+  }
 
-        /* Wipeout the new line character */
-        line[read - 1] = '\0'; 
+  start_item = xbt_fifo_get_last_item(stack);
+  if(start != -1){
+    while (i != start){
+      start_item = xbt_fifo_get_prev_item(start_item);
+      i++;
+    }
+  }
 
-        if(n == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
-        }
+  MC_SET_RAW_MEM;
+  xbt_dict_reset(first_enabled_state);
+  xbt_swag_foreach(process, simix_global->process_list){
+    if(MC_process_is_enabled(process)){
+      char *key = bprintf("%lu", process->pid);
+      char *data = bprintf("%d", count);
+      xbt_dict_set(first_enabled_state, key, data, NULL);
+      xbt_free(key);
+    }
+  }
+  MC_UNSET_RAW_MEM;
+  
 
-        if(strlen(line) == 0){
-          read = xbt_getline(&line, &n, fp);
-          continue;
+  /* Traverse the stack from the state at position start and re-execute the transitions */
+  for (item = start_item;
+       item != xbt_fifo_get_first_item(stack);
+       item = xbt_fifo_get_prev_item(item)) {
+
+    state = (mc_state_t) xbt_fifo_get_item_content(item);
+    saved_req = MC_state_get_executed_request(state, &value);
+   
+    MC_SET_RAW_MEM;
+    char *key = bprintf("%lu", saved_req->issuer->pid);
+    xbt_dict_remove(first_enabled_state, key); 
+    xbt_free(key);
+    MC_UNSET_RAW_MEM;
+   
+    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->simcall;
+
+      /* Debug information */
+      if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+        req_str = MC_request_to_string(req, value);
+        XBT_DEBUG("Replay: %s (%p)", req_str, state);
+        xbt_free(req_str);
+      }
+    }
+    
+    SIMIX_simcall_pre(req, value);
+    MC_wait_for_requests();
+
+    count++;
+
+    MC_SET_RAW_MEM;
+    /* Insert in dict all enabled processes */
+    xbt_swag_foreach(process, simix_global->process_list){
+      if(MC_process_is_enabled(process) /*&& !MC_state_process_is_done(state, process)*/){
+        char *key = bprintf("%lu", process->pid);
+        if(xbt_dict_get_or_null(first_enabled_state, key) == NULL){
+          char *data = bprintf("%d", count);
+          xbt_dict_set(first_enabled_state, key, data, NULL);
         }
+        xbt_free(key);
+      }
+    }
+    MC_UNSET_RAW_MEM;
+         
+    /* Update statistics */
+    mc_stats->visited_states++;
+    mc_stats->executed_transitions++;
 
-        xbt_dynar_free(&split);
-        xbt_str_rtrim(line, NULL);
-        xbt_str_strip_spaces(line);
-        split = xbt_str_split(line, " ");
-        
-        if(strncmp(xbt_dynar_get_as(split, 1, char *), "DW_AT_", 6) != 0)
-          break;
-          
-        node_type = xbt_dynar_get_as(split, 1, char *);
+  }
 
-        if(strcmp(node_type, "DW_AT_abstract_origin:") == 0){
+  XBT_DEBUG("**** End Replay ****");
 
-          origin = xbt_dynar_get_as(split, 2, char *);
-          xbt_str_ltrim(origin, "<0x");
-          xbt_str_rtrim(origin, ">");
-          
-          subprogram_name = (char *)xbt_dict_get_or_null(subprograms_origin, origin);
-          subroutine_frame = xbt_dict_get_or_null(*all_variables, subprogram_name);
-        
-        }else if(strcmp(node_type, "DW_AT_low_pc") == 0){
+  if(raw_mem)
+    MC_SET_RAW_MEM;
+  else
+    MC_UNSET_RAW_MEM;
+  
 
-          subroutine_frame->low_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
+}
 
-        }else if(strcmp(node_type, "DW_AT_high_pc") == 0){
+void MC_replay_liveness(xbt_fifo_t stack, int all_stack)
+{
 
-          subroutine_frame->high_pc = (void *)strtoul(xbt_dynar_get_as(split, 3, char *), NULL, 16);
-        }
+  initial_state_liveness->raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-        read = xbt_getline(&line, &n, fp);
-      
-      }
+  int value;
+  char *req_str;
+  smx_simcall_t req = NULL, saved_req = NULL;
+  xbt_fifo_item_t item;
+  mc_state_t state;
+  mc_pair_t pair;
+  int depth = 1;
 
-    }else{
+  XBT_DEBUG("**** Begin Replay ****");
 
-      read = xbt_getline(&line, &n, fp);
+  /* Restore the initial state */
+  MC_restore_snapshot(initial_state_liveness->snapshot);
 
-    }
+  /* At the moment of taking the snapshot the raw heap was set, so restoring
+   * it will set it back again, we have to unset it to continue  */
+  if(!initial_state_liveness->raw_mem_set)
+    MC_UNSET_RAW_MEM;
 
-  }
-  
-  xbt_dynar_free(&split);
-  xbt_free(line);
-  xbt_free(command);
-  pclose(fp);
-  
-}
+  if(all_stack){
 
-static dw_location_t get_location(xbt_dict_t location_list, char *expr){
+    item = xbt_fifo_get_last_item(stack);
 
-  dw_location_t loc = xbt_new0(s_dw_location_t, 1);
+    while(depth <= xbt_fifo_size(stack)){
 
-  if(location_list != NULL){
-    
-    char *key = bprintf("%d", (int)strtoul(expr, NULL, 16));
-    loc->type = e_dw_loclist;
-    loc->location.loclist =  (xbt_dynar_t)xbt_dict_get_or_null(location_list, key);
-    if(loc->location.loclist == NULL)
-      XBT_INFO("Key not found in loclist");
-    xbt_free(key);
-    return loc;
+      pair = (mc_pair_t) xbt_fifo_get_item_content(item);
+      state = (mc_state_t) pair->graph_state;
 
-  }else{
+      if(pair->requests > 0){
+   
+        saved_req = MC_state_get_executed_request(state, &value);
+        //XBT_DEBUG("SavedReq->call %u", saved_req->call);
+      
+        if(saved_req != NULL){
+          /* 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->simcall;
+          //XBT_DEBUG("Req->call %u", req->call);
+  
+          /* Debug information */
+          if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+            req_str = MC_request_to_string(req, value);
+            XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
+            xbt_free(req_str);
+          }
+  
+        }
+        SIMIX_simcall_pre(req, value);
+        MC_wait_for_requests();
+      }
 
-    int cursor = 0;
-    char *tok = NULL, *tok2 = NULL; 
+      depth++;
     
-    xbt_dynar_t tokens1 = xbt_str_split(expr, ";");
-    xbt_dynar_t tokens2;
+      /* Update statistics */
+      mc_stats->visited_pairs++;
+      mc_stats->executed_transitions++;
 
-    loc->type = e_dw_compose;
-    loc->location.compose = xbt_dynar_new(sizeof(dw_location_t), NULL);
+      item = xbt_fifo_get_prev_item(item);
+    }
 
-    while(cursor < xbt_dynar_length(tokens1)){
+  }else{
 
-      tok = xbt_dynar_get_as(tokens1, cursor, char*);
-      tokens2 = xbt_str_split(tok, " ");
-      tok2 = xbt_dynar_get_as(tokens2, 0, char*);
+    /* 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)) {
+
+      pair = (mc_pair_t) xbt_fifo_get_item_content(item);
+      state = (mc_state_t) pair->graph_state;
+
+      if(pair->requests > 0){
+   
+        saved_req = MC_state_get_executed_request(state, &value);
+        //XBT_DEBUG("SavedReq->call %u", saved_req->call);
       
-      if(strncmp(tok2, "DW_OP_reg", 9) == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_register;
-        new_element->location.reg = atoi(strtok(tok2, "DW_OP_reg"));
-        xbt_dynar_push(loc->location.compose, &new_element);     
-      }else if(strcmp(tok2, "DW_OP_fbreg:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_fbregister_op;
-        new_element->location.fbreg_op = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strncmp(tok2, "DW_OP_breg", 10) == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_bregister_op;
-        new_element->location.breg_op.reg = atoi(strtok(tok2, "DW_OP_breg"));
-        new_element->location.breg_op.offset = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strncmp(tok2, "DW_OP_lit", 9) == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_lit;
-        new_element->location.lit = atoi(strtok(tok2, "DW_OP_lit"));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok2, "DW_OP_piece:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_piece;
-        new_element->location.piece = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
-        /*if(strlen(xbt_dynar_get_as(tokens2, 1, char*)) > 1)
-          new_element->location.piece = atoi(xbt_dynar_get_as(tokens2, 1, char*));
-        else
-        new_element->location.piece = xbt_dynar_get_as(tokens2, 1, char*)[0] - '0';*/
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok2, "DW_OP_plus_uconst:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_plus_uconst;
-        new_element->location.plus_uconst = atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char *));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok, "DW_OP_abs") == 0 || 
-               strcmp(tok, "DW_OP_and") == 0 ||
-               strcmp(tok, "DW_OP_div") == 0 ||
-               strcmp(tok, "DW_OP_minus") == 0 ||
-               strcmp(tok, "DW_OP_mod") == 0 ||
-               strcmp(tok, "DW_OP_mul") == 0 ||
-               strcmp(tok, "DW_OP_neg") == 0 ||
-               strcmp(tok, "DW_OP_not") == 0 ||
-               strcmp(tok, "DW_OP_or") == 0 ||
-               strcmp(tok, "DW_OP_plus") == 0){               
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_arithmetic;
-        new_element->location.arithmetic = strdup(strtok(tok2, "DW_OP_"));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok, "DW_OP_stack_value") == 0){
-      }else if(strcmp(tok2, "DW_OP_deref_size:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_deref;
-        new_element->location.deref_size = (unsigned int short) atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*));
-        /*if(strlen(xbt_dynar_get_as(tokens, ++cursor, char*)) > 1)
-          new_element->location.deref_size = atoi(xbt_dynar_get_as(tokens, cursor, char*));
-        else
-        new_element->location.deref_size = xbt_dynar_get_as(tokens, cursor, char*)[0] - '0';*/
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok, "DW_OP_deref") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_deref;
-        new_element->location.deref_size = sizeof(void *);
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok2, "DW_OP_constu:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_uconstant;
-        new_element->location.uconstant.bytes = 1;
-        new_element->location.uconstant.value = (unsigned long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
-        /*if(strlen(xbt_dynar_get_as(tokens, ++cursor, char*)) > 1)
-          new_element->location.uconstant.value = (unsigned long int)(atoi(xbt_dynar_get_as(tokens, cursor, char*)));
-        else
-        new_element->location.uconstant.value = (unsigned long int)(xbt_dynar_get_as(tokens, cursor, char*)[0] - '0');*/
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok2, "DW_OP_consts:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_sconstant;
-        new_element->location.sconstant.bytes = 1;
-        new_element->location.sconstant.value = (long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok2, "DW_OP_const1u:") == 0 ||
-               strcmp(tok2, "DW_OP_const2u:") == 0 ||
-               strcmp(tok2, "DW_OP_const4u:") == 0 ||
-               strcmp(tok2, "DW_OP_const8u:") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_uconstant;
-        new_element->location.uconstant.bytes = tok2[11] - '0';
-        new_element->location.uconstant.value = (unsigned long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
-        /*if(strlen(xbt_dynar_get_as(tokens, ++cursor, char*)) > 1)
-          new_element->location.constant.value = atoi(xbt_dynar_get_as(tokens, cursor, char*));
-        else
-        new_element->location.constant.value = xbt_dynar_get_as(tokens, cursor, char*)[0] - '0';*/
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else if(strcmp(tok, "DW_OP_const1s") == 0 ||
-               strcmp(tok, "DW_OP_const2s") == 0 ||
-               strcmp(tok, "DW_OP_const4s") == 0 ||
-               strcmp(tok, "DW_OP_const8s") == 0){
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_sconstant;
-        new_element->location.sconstant.bytes = tok2[11] - '0';
-        new_element->location.sconstant.value = (long int)(atoi(xbt_dynar_get_as(tokens2, xbt_dynar_length(tokens2) - 1, char*)));
-        xbt_dynar_push(loc->location.compose, &new_element);
-      }else{
-        dw_location_t new_element = xbt_new0(s_dw_location_t, 1);
-        new_element->type = e_dw_unsupported;
-        xbt_dynar_push(loc->location.compose, &new_element);
+        if(saved_req != NULL){
+          /* 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->simcall;
+          //XBT_DEBUG("Req->call %u", req->call);
+  
+          /* Debug information */
+          if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+            req_str = MC_request_to_string(req, value);
+            XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
+            xbt_free(req_str);
+          }
+  
+        }
+        SIMIX_simcall_pre(req, value);
+        MC_wait_for_requests();
       }
 
-      cursor++;
-      xbt_dynar_free(&tokens2);
-
-    }
+      depth++;
     
-    xbt_dynar_free(&tokens1);
+      /* Update statistics */
+      mc_stats->visited_pairs++;
+      mc_stats->executed_transitions++;
+    }
+  }  
+
+  XBT_DEBUG("**** End Replay ****");
+
+  if(initial_state_liveness->raw_mem_set)
+    MC_SET_RAW_MEM;
+  else
+    MC_UNSET_RAW_MEM;
+  
+}
+
+/**
+ * \brief Dumps the contents of a model-checker's stack and shows the actual
+ *        execution trace
+ * \param stack The stack to dump
+ */
+void MC_dump_stack_safety(xbt_fifo_t stack)
+{
+  
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_show_stack_safety(stack);
+
+  if(!_sg_mc_checkpoint){
+
+    mc_state_t state;
+
+    MC_SET_RAW_MEM;
+    while ((state = (mc_state_t) xbt_fifo_pop(stack)) != NULL)
+      MC_state_delete(state);
+    MC_UNSET_RAW_MEM;
 
-    return loc;
-    
   }
 
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
+  else
+    MC_UNSET_RAW_MEM;
+  
 }
 
 
-void print_local_variables(xbt_dict_t list){
+void MC_show_stack_safety(xbt_fifo_t stack)
+{
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  int value;
+  mc_state_t state;
+  xbt_fifo_item_t item;
+  smx_simcall_t req;
+  char *req_str = NULL;
   
-  dw_location_entry_t entry;
-  dw_location_t location_entry;
-  unsigned int cursor3 = 0, cursor4 = 0;
-  xbt_dict_cursor_t cursor = 0, cursor2 = 0;
-
-  char *frame_name, *variable_name;
-  dw_frame_t current_frame;
-  dw_local_variable_t current_variable;
-
-  xbt_dict_foreach(list, cursor, frame_name, current_frame){ 
-    fprintf(stderr, "Frame name : %s\n", current_frame->name);
-    fprintf(stderr, "Location type : %d\n", current_frame->frame_base->type);
-    xbt_dict_foreach((xbt_dict_t)current_frame->variables, cursor2, variable_name, current_variable){
-      fprintf(stderr, "Name : %s\n", current_variable->name);
-      if(current_variable->location == NULL)
-        continue;
-      fprintf(stderr, "Location type : %d\n", current_variable->location->type);
-      switch(current_variable->location->type){
-      case e_dw_loclist :
-        xbt_dynar_foreach(current_variable->location->location.loclist, cursor3, entry){
-          fprintf(stderr, "Lowpc : %lx, Highpc : %lx,", entry->lowpc, entry->highpc);
-          switch(entry->location->type){
-          case e_dw_register :
-            fprintf(stderr, " Location : in register %d\n", entry->location->location.reg);
-            break;
-          case e_dw_bregister_op:
-            fprintf(stderr, " Location : Add %d to the value in register %d\n", entry->location->location.breg_op.offset, entry->location->location.breg_op.reg);
-            break;
-          case e_dw_lit:
-            fprintf(stderr, "Value already kwnown : %d\n", entry->location->location.lit);
-            break;
-          case e_dw_fbregister_op:
-            fprintf(stderr, " Location : %d bytes from logical frame pointer\n", entry->location->location.fbreg_op);
-            break;
-          case e_dw_compose:
-            fprintf(stderr, " Location :\n");
-            xbt_dynar_foreach(entry->location->location.compose, cursor4, location_entry){
-              switch(location_entry->type){
-              case e_dw_register :
-                fprintf(stderr, " %d) in register %d\n", cursor4 + 1, location_entry->location.reg);
-                break;
-              case e_dw_bregister_op:
-                fprintf(stderr, " %d) add %d to the value in register %d\n", cursor4 + 1, location_entry->location.breg_op.offset, location_entry->location.breg_op.reg);
-                break;
-              case e_dw_lit:
-                fprintf(stderr, "%d) Value already kwnown : %d\n", cursor4 + 1, location_entry->location.lit);
-                break;
-              case e_dw_fbregister_op:
-                fprintf(stderr, " %d) %d bytes from logical frame pointer\n", cursor4 + 1, location_entry->location.fbreg_op);
-                break;
-              case e_dw_deref:
-                fprintf(stderr, " %d) Pop the stack entry and treats it as an address (size of data %d)\n", cursor4 + 1, location_entry->location.deref_size);
-                break;
-              case e_dw_arithmetic :
-                fprintf(stderr, "%d) arithmetic operation : %s\n", cursor4 + 1, location_entry->location.arithmetic);
-                break;
-              case e_dw_piece:
-                fprintf(stderr, "%d) The %d byte(s) previous value\n", cursor4 + 1, location_entry->location.piece);
-                break;
-              case e_dw_uconstant :
-                fprintf(stderr, "%d) Unsigned constant %lu\n", cursor4 + 1, location_entry->location.uconstant.value);
-                break;
-              case e_dw_sconstant :
-                fprintf(stderr, "%d) Signed constant %lu\n", cursor4 + 1, location_entry->location.sconstant.value);
-                break;
-              default :
-                fprintf(stderr, "%d) Location type not supported\n", cursor4 + 1);
-                break;
-              }
-            }
-            break;
-          default:
-            fprintf(stderr, "Location type not supported\n");
-            break;
-          }
-        }
-        break;
-      case e_dw_compose:
-        cursor4 = 0;
-        fprintf(stderr, "Location :\n");
-        xbt_dynar_foreach(current_variable->location->location.compose, cursor4, location_entry){
-          switch(location_entry->type){
-          case e_dw_register :
-            fprintf(stderr, " %d) in register %d\n", cursor4 + 1, location_entry->location.reg);
-            break;
-          case e_dw_bregister_op:
-            fprintf(stderr, " %d) add %d to the value in register %d\n", cursor4 + 1, location_entry->location.breg_op.offset, location_entry->location.breg_op.reg);
-            break;
-          case e_dw_lit:
-            fprintf(stderr, "%d) Value already kwnown : %d\n", cursor4 + 1, location_entry->location.lit);
-            break;
-          case e_dw_fbregister_op:
-            fprintf(stderr, " %d) %d bytes from logical frame pointer\n", cursor4 + 1, location_entry->location.fbreg_op);
-            break;
-          case e_dw_deref:
-            fprintf(stderr, " %d) Pop the stack entry and treats it as an address (size of data %d)\n", cursor4 + 1, location_entry->location.deref_size);
-            break;
-          case e_dw_arithmetic :
-            fprintf(stderr, "%d) arithmetic operation : %s\n", cursor4 + 1, location_entry->location.arithmetic);
-            break;
-          case e_dw_piece:
-            fprintf(stderr, "%d) The %d byte(s) previous value\n", cursor4 + 1, location_entry->location.piece);
-            break;
-          case e_dw_uconstant :
-            fprintf(stderr, "%d) Unsigned constant %lu\n", cursor4 + 1, location_entry->location.uconstant.value);
-            break;
-          case e_dw_sconstant :
-            fprintf(stderr, "%d) Signed constant %lu\n", cursor4 + 1, location_entry->location.sconstant.value);
-            break;
-          default :
-            fprintf(stderr, "%d) Location type not supported\n", cursor4 + 1);
-            break;
-          }
-        }
-        break;
-      default :
-        fprintf(stderr, "Location type not supported\n");
-        break;
-      }
+  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)) {
+    req = MC_state_get_executed_request(state, &value);
+    if(req){
+      req_str = MC_request_to_string(req, value);
+      XBT_INFO("%s", req_str);
+      xbt_free(req_str);
     }
   }
 
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
-static void MC_get_global_variables(char *elf_file){
-
-  FILE *fp;
-
-  char *command = bprintf("objdump -t -j .data -j .bss %s", elf_file);
+void MC_show_deadlock(smx_simcall_t req)
+{
+  /*char *req_str = NULL;*/
+  XBT_INFO("**************************");
+  XBT_INFO("*** DEAD-LOCK DETECTED ***");
+  XBT_INFO("**************************");
+  XBT_INFO("Locked request:");
+  /*req_str = MC_request_to_string(req);
+    XBT_INFO("%s", req_str);
+    xbt_free(req_str);*/
+  XBT_INFO("Counter-example execution trace:");
+  MC_dump_stack_safety(mc_stack_safety);
+  MC_print_statistics(mc_stats);
+}
 
-  fp = popen(command, "r");
 
-  if(fp == NULL){
-    perror("popen failed");
-    xbt_abort();
+void MC_show_stack_liveness(xbt_fifo_t stack){
+  int value;
+  mc_pair_t pair;
+  xbt_fifo_item_t item;
+  smx_simcall_t req;
+  char *req_str = NULL;
+  
+  for (item = xbt_fifo_get_last_item(stack);
+       (item ? (pair = (mc_pair_t) (xbt_fifo_get_item_content(item)))
+        : (NULL)); item = xbt_fifo_get_prev_item(item)) {
+    req = MC_state_get_executed_request(pair->graph_state, &value);
+    if(req){
+      if(pair->requests>0){
+        req_str = MC_request_to_string(req, value);
+        XBT_INFO("%s", req_str);
+        xbt_free(req_str);
+      }else{
+        XBT_INFO("End of system requests but evolution in Büchi automaton");
+      }
+    }
   }
+}
 
-  if(mc_global_variables == NULL)
-    mc_global_variables = xbt_dynar_new(sizeof(global_variable_t), global_variable_free_voidp);
+void MC_dump_stack_liveness(xbt_fifo_t stack){
 
-  char *line = NULL;
-  ssize_t read;
-  size_t n = 0;
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-  xbt_dynar_t line_tokens = NULL;
-  unsigned long offset;
+  mc_pair_t pair;
 
-  int type = strcmp(elf_file, xbt_binary_name); /* 0 = binary, other = libsimgrid */
+  MC_SET_RAW_MEM;
+  while ((pair = (mc_pair_t) xbt_fifo_pop(stack)) != NULL)
+    MC_pair_delete(pair);
+  MC_UNSET_RAW_MEM;
 
-  while ((read = xbt_getline(&line, &n, fp)) != -1){
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
 
-    if(n == 0)
-      continue;
+}
 
-     /* Wipeout the new line character */
-    line[read - 1] = '\0';
 
-    xbt_str_strip_spaces(line);
-    xbt_str_ltrim(line, NULL);
+void MC_print_statistics(mc_stats_t stats)
+{
+  if(stats->expanded_pairs == 0){
+    XBT_INFO("Expanded states = %lu", stats->expanded_states);
+    XBT_INFO("Visited states = %lu", stats->visited_states);
+  }else{
+    XBT_INFO("Expanded pairs = %lu", stats->expanded_pairs);
+    XBT_INFO("Visited pairs = %lu", stats->visited_pairs);
+  }
+  XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
+  MC_SET_RAW_MEM;
+  if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0')){
+    fprintf(dot_output, "}\n");
+    fclose(dot_output);
+  }
+  MC_UNSET_RAW_MEM;
+}
 
-    line_tokens = xbt_str_split(line, NULL);
+void MC_assert(int prop)
+{
+  if (MC_is_active() && !prop){
+    XBT_INFO("**************************");
+    XBT_INFO("*** PROPERTY NOT VALID ***");
+    XBT_INFO("**************************");
+    XBT_INFO("Counter-example execution trace:");
+    MC_dump_stack_safety(mc_stack_safety);
+    MC_print_statistics(mc_stats);
+    xbt_abort();
+  }
+}
 
-    if(xbt_dynar_length(line_tokens) <= 4 || strcmp(xbt_dynar_get_as(line_tokens, 0, char *), "SYMBOL") == 0)
-      continue;
+void MC_cut(void){
+  user_max_depth_reached = 1;
+}
 
-    if((strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "__gcov", 6) == 0)
-       || (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "gcov", 4) == 0)
-       || (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".data") == 0)
-       || (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".bss") == 0)
-       || (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "stderr", 6) == 0)
-       || ((size_t)strtoul(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 2, char*), NULL, 16) == 0))
-      continue;
+void MC_process_clock_add(smx_process_t process, double amount)
+{
+  mc_time[process->pid] += amount;
+}
 
-    global_variable_t var = xbt_new0(s_global_variable_t, 1);
+double MC_process_clock_get(smx_process_t process)
+{
+  if(mc_time){
+    if(process != NULL)
+      return mc_time[process->pid];
+    else 
+      return -1;
+  }else{
+    return 0;
+  }
+}
 
-    if(type == 0){
-      var->address = (void *)strtoul(xbt_dynar_get_as(line_tokens, 0, char*), NULL, 16);
-    }else{
-      offset = strtoul(xbt_dynar_get_as(line_tokens, 0, char*), NULL, 16);
-      var->address = (char *)start_text_libsimgrid+offset;
-    }
+void MC_automaton_load(const char *file){
 
-    var->size = (size_t)strtoul(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 2, char*), NULL, 16);
-    var->name = strdup(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*));
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-    if(data_bss_ignore_size(var->address) > 0){
-      global_variable_free(var);
-    }else{
-      if(xbt_dynar_is_empty(mc_global_variables)){
-        xbt_dynar_push(mc_global_variables, &var);
-      }else{
-        unsigned int cursor = 0;
-        int start = 0;
-        int end = xbt_dynar_length(mc_global_variables) - 1;
-        global_variable_t current_var = NULL;
-      
-        while(start <= end){
-          cursor = (start + end) / 2;
-          current_var = (global_variable_t)xbt_dynar_get_as(mc_global_variables, cursor, global_variable_t);
-          if(current_var->address == var->address)
-            break;
-          if(current_var->address < var->address)
-            start = cursor + 1;
-          if(current_var->address > var->address)
-            end = cursor - 1;
-        }
-        if(current_var->address < var->address)
-          xbt_dynar_insert_at(mc_global_variables, cursor + 1, &var);
-        else
-          xbt_dynar_insert_at(mc_global_variables, cursor, &var);
-      }
-    }
+  MC_SET_RAW_MEM;
 
-    xbt_dynar_free(&line_tokens);
+  if (_mc_property_automaton == NULL)
+    _mc_property_automaton = xbt_automaton_new();
+  
+  xbt_automaton_load(_mc_property_automaton,file);
 
-  }
+  MC_UNSET_RAW_MEM;
 
-  xbt_free(command);
-  xbt_free(line);
-  pclose(fp);
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
 
 }
 
-void global_variable_free(global_variable_t v){
-  xbt_free(v->name);
-  xbt_free(v);
-}
+void MC_automaton_new_propositional_symbol(const char* id, void* fct) {
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  MC_SET_RAW_MEM;
+
+  if (_mc_property_automaton == NULL)
+    _mc_property_automaton = xbt_automaton_new();
+
+  xbt_automaton_propositional_symbol_new(_mc_property_automaton,id,fct);
 
-void global_variable_free_voidp(void *v){
-  global_variable_free((global_variable_t) * (void **) v);
+  MC_UNSET_RAW_MEM;
+
+  if(raw_mem_set)
+    MC_SET_RAW_MEM;
+  
 }
+
+
+
index 561d365..f01b3c8 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2011-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2011-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -15,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc,
 xbt_dynar_t acceptance_pairs;
 xbt_dynar_t visited_pairs;
 xbt_dynar_t successors;
-
+xbt_parmap_t parmap;
 
 /********* Static functions *********/
 
@@ -35,417 +36,294 @@ static xbt_dynar_t get_atomic_propositions_values(){
   return values;
 }
 
-static int is_reached_acceptance_pair(mc_pair_t pair){
+static int get_search_interval(xbt_dynar_t all_pairs, mc_visited_pair_t pair, int *min, int *max){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-  if(xbt_dynar_is_empty(acceptance_pairs)){
-
-    MC_SET_RAW_MEM;
-    if(pair->graph_state->system_state == NULL){
-      pair->graph_state->system_state = MC_take_snapshot();
-      pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
-    }
-    xbt_dynar_push(acceptance_pairs, &pair); 
-    MC_UNSET_RAW_MEM;
-
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
-
-    return -1;
-
-  }else{
-
-    MC_SET_RAW_MEM;
-
-    if(pair->graph_state->system_state == NULL){
-      pair->graph_state->system_state = MC_take_snapshot();
-      pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
-    }
 
-    size_t current_bytes_used = pair->heap_bytes_used;
-    int current_nb_processes = pair->nb_processes;
+  MC_SET_RAW_MEM;
 
-    unsigned int cursor = 0;
-    int previous_cursor = 0, next_cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(acceptance_pairs) - 1;
-
-    mc_pair_t pair_test = NULL;
-    size_t bytes_used_test;
-    int nb_processes_test;
-    int same_processes_and_bytes_not_found = 1;
-
-    while(start <= end && same_processes_and_bytes_not_found){
-      cursor = (start + end) / 2;
-      pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_pair_t);
-      bytes_used_test = pair_test->heap_bytes_used;
-      nb_processes_test = pair_test->nb_processes;
-      if(nb_processes_test < current_nb_processes)
-        start = cursor + 1;
-      else if(nb_processes_test > current_nb_processes)
-        end = cursor - 1; 
-      else if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        else if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        else if(bytes_used_test == current_bytes_used){
-          same_processes_and_bytes_not_found = 0;
-          if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-            if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-              if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
-                  MC_UNSET_RAW_MEM;
-                return pair_test->num;
-              }
-            }
-          }
-          /* Search another pair with same number of bytes used in std_heap */
-          previous_cursor = cursor - 1;
-          while(previous_cursor >= 0){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, previous_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){  
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair_test->num;
-                }
-              }
-            }
-            previous_cursor--;
-          }
-          next_cursor = cursor + 1;
-          while(next_cursor < xbt_dynar_length(acceptance_pairs)){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, next_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return pair_test->num;
-                }
-              }
-            }
-            next_cursor++;
-          }
+  int cursor = 0, previous_cursor, next_cursor;
+  mc_visited_pair_t pair_test;
+  int start = 0;
+  int end = xbt_dynar_length(all_pairs) - 1;
+  
+  while(start <= end){
+    cursor = (start + end) / 2;
+    pair_test = (mc_visited_pair_t)xbt_dynar_get_as(all_pairs, cursor, mc_visited_pair_t);
+    if(pair_test->nb_processes < pair->nb_processes){
+      start = cursor + 1;
+    }else if(pair_test->nb_processes > pair->nb_processes){
+      end = cursor - 1;
+    }else{
+      if(pair_test->heap_bytes_used < pair->heap_bytes_used){
+        start = cursor +1;
+      }else if(pair_test->heap_bytes_used > pair->heap_bytes_used){
+        end = cursor - 1;
+      }else{
+        *min = *max = cursor;
+        previous_cursor = cursor - 1;
+        while(previous_cursor >= 0){
+          pair_test = (mc_visited_pair_t)xbt_dynar_get_as(all_pairs, previous_cursor, mc_visited_pair_t);
+          if(pair_test->nb_processes != pair->nb_processes || pair_test->heap_bytes_used != pair->heap_bytes_used)
+            break;
+          *min = previous_cursor;
+          previous_cursor--;
+        }
+        next_cursor = cursor + 1;
+        while(next_cursor < xbt_dynar_length(all_pairs)){
+          pair_test = (mc_visited_pair_t)xbt_dynar_get_as(all_pairs, next_cursor, mc_visited_pair_t);
+          if(pair_test->nb_processes != pair->nb_processes || pair_test->heap_bytes_used != pair->heap_bytes_used)
+            break;
+          *max = next_cursor;
+          next_cursor++;
         }
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return -1;
       }
-    }
-
-    pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_pair_t);
-    bytes_used_test = pair_test->heap_bytes_used;
+     }
+  }
 
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);
-       
-    
+  if(!raw_mem_set)
     MC_UNSET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
-    
-    return -1;
-    
-  }
+  return cursor;
 }
 
-
-static void set_acceptance_pair_reached(mc_pair_t pair){
+static mc_visited_pair_t is_reached_acceptance_pair(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions){
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
+  MC_SET_RAW_MEM;
+  
+  mc_visited_pair_t pair = NULL;
+  pair = MC_visited_pair_new(pair_num, automaton_state, atomic_propositions);
+  pair->acceptance_pair = 1;
+  
   if(xbt_dynar_is_empty(acceptance_pairs)){
 
-     MC_SET_RAW_MEM;
-     if(pair->graph_state->system_state == NULL){
-       pair->graph_state->system_state = MC_take_snapshot();
-       pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
-     }
-     xbt_dynar_push(acceptance_pairs, &pair); 
-     MC_UNSET_RAW_MEM;
+    xbt_dynar_push(acceptance_pairs, &pair); 
 
   }else{
 
-    MC_SET_RAW_MEM;
+    int min = -1, max = -1, index;
+    //int res;
+    mc_visited_pair_t pair_test;
+    int cursor;
 
-    if(pair->graph_state->system_state == NULL){
-      pair->graph_state->system_state = MC_take_snapshot();
-      pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
-    }
-    
-    size_t current_bytes_used = pair->heap_bytes_used;
-    int current_nb_processes = pair->nb_processes;
+    index = get_search_interval(acceptance_pairs, pair, &min, &max);
 
-    unsigned int cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(acceptance_pairs) - 1;
-
-    mc_pair_t pair_test = NULL;
-    size_t bytes_used_test = 0;
-    int nb_processes_test;
-
-    while(start <= end){
-      cursor = (start + end) / 2;
-      pair_test = (mc_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_pair_t);
-      bytes_used_test = pair_test->heap_bytes_used;
-      nb_processes_test = pair_test->nb_processes;
-      if(nb_processes_test < current_nb_processes)
-        start = cursor + 1;
-      if(nb_processes_test > current_nb_processes)
-        end = cursor - 1; 
-      if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        if(bytes_used_test == current_bytes_used)
-          break;
+    if(min != -1 && max != -1){ // Acceptance pair with same number of processes and same heap bytes used exists
+      /*res = xbt_parmap_mc_apply(parmap, snapshot_compare, xbt_dynar_get_ptr(acceptance_pairs, min), (max-min)+1, pair);
+      if(res != -1){
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return ((mc_pair_t)xbt_dynar_get_as(acceptance_pairs, (min+res)-1, mc_pair_t))->num;
+        }*/
+      cursor = min;
+      while(cursor <= max){
+        pair_test = (mc_visited_pair_t)xbt_dynar_get_as(acceptance_pairs, cursor, mc_visited_pair_t);
+        if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
+          if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
+            if(snapshot_compare(pair_test, pair) == 0){
+              XBT_INFO("Pair %d already reached (equal to pair %d) !", pair->num, pair_test->num);
+              
+              xbt_fifo_shift(mc_stack_liveness);
+              if(dot_output != NULL)
+                fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_state_liveness->prev_pair, pair_test->num, initial_state_liveness->prev_req);
+
+              if(!raw_mem_set)
+                MC_UNSET_RAW_MEM;
+
+              return NULL;
+            }
+          }
+        }
+        cursor++;
+      }
+      xbt_dynar_insert_at(acceptance_pairs, min, &pair);
+    }else{
+      pair_test = (mc_visited_pair_t)xbt_dynar_get_as(acceptance_pairs, index, mc_visited_pair_t);
+      if(pair_test->nb_processes < pair->nb_processes){
+        xbt_dynar_insert_at(acceptance_pairs, index+1, &pair);
+      }else{
+        if(pair_test->heap_bytes_used < pair->heap_bytes_used)
+          xbt_dynar_insert_at(acceptance_pairs, index + 1, &pair);
+        else
+          xbt_dynar_insert_at(acceptance_pairs, index, &pair);
       }
     }
-
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(acceptance_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(acceptance_pairs, cursor, &pair);
-    
-    MC_UNSET_RAW_MEM;
     
   }
 
-  if(raw_mem_set)
-    MC_SET_RAW_MEM;
-    
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
+
+  return pair;
 }
 
-static void remove_acceptance_pair(mc_pair_t pair){
+static void remove_acceptance_pair(int pair_num){
+
+  int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+  fprintf(stderr, "Search acceptance pair %d\n", pair_num);
+
+  MC_SET_RAW_MEM;
 
   unsigned int cursor = 0;
-  mc_pair_t pair_test;
-  int pair_found = 0;
+  mc_visited_pair_t pair_test = NULL;
 
   xbt_dynar_foreach(acceptance_pairs, cursor, pair_test){
-    if(pair_test->num == pair->num){
-      pair_found = 1;
+    if(pair_test->num == pair_num){
       break;
     }
   }
 
-  if(pair_found)
-    xbt_dynar_remove_at(acceptance_pairs, cursor, NULL);
+  xbt_dynar_remove_at(acceptance_pairs, cursor, &pair_test);
   
-  pair->acceptance_removed = 1;
+  pair_test->acceptance_removed = 1;
 
-  if(pair->stack_removed && pair->acceptance_removed){
-    if(_sg_mc_visited == 0){
-      MC_pair_delete(pair);
-    }else if(pair->visited_removed){
-      MC_pair_delete(pair);
-    }
+  if(_sg_mc_visited == 0){
+    MC_visited_pair_delete(pair_test);
+  }else if(pair_test->visited_removed == 1){
+    MC_visited_pair_delete(pair_test);
   }
 
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
 }
 
-static int is_visited_pair(mc_pair_t pair){
+static int is_visited_pair(mc_visited_pair_t pair, int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions){
 
   if(_sg_mc_visited == 0)
     return -1;
 
   int raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
 
-  if(xbt_dynar_is_empty(visited_pairs)){
-
-    MC_SET_RAW_MEM;
-    if(pair->graph_state->system_state == NULL)
-      pair->graph_state->system_state = MC_take_snapshot();
-    xbt_dynar_push(visited_pairs, &pair); 
-    MC_UNSET_RAW_MEM;
+  MC_SET_RAW_MEM;
 
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
-
-    return -1;
+  mc_visited_pair_t new_pair = NULL;
 
+  if(pair == NULL){
+    new_pair = MC_visited_pair_new(pair_num, automaton_state, atomic_propositions);
   }else{
+    new_pair = pair;
+  }
 
-    MC_SET_RAW_MEM;
+  if(xbt_dynar_is_empty(visited_pairs)){
 
-    if(pair->graph_state->system_state == NULL)
-      pair->graph_state->system_state = MC_take_snapshot();
-    
-    size_t current_bytes_used = pair->heap_bytes_used;
-    int current_nb_processes = pair->nb_processes;
+    xbt_dynar_push(visited_pairs, &new_pair); 
 
-    unsigned int cursor = 0;
-    int previous_cursor = 0, next_cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(visited_pairs) - 1;
-
-    mc_pair_t pair_test = NULL;
-    size_t bytes_used_test;
-    int nb_processes_test;
-    int same_processes_and_bytes_not_found = 1;
-    int result;
-
-    while(start <= end && same_processes_and_bytes_not_found){
-      cursor = (start + end) / 2;
-      pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, cursor, mc_pair_t);
-      bytes_used_test = pair_test->heap_bytes_used;
-      nb_processes_test = pair_test->nb_processes;
-      if(nb_processes_test < current_nb_processes)
-        start = cursor + 1;
-      else if(nb_processes_test > current_nb_processes)
-        end = cursor - 1; 
-      else if(nb_processes_test == current_nb_processes){
-        if(bytes_used_test < current_bytes_used)
-          start = cursor + 1;
-        else if(bytes_used_test > current_bytes_used)
-          end = cursor - 1;
-        else if(bytes_used_test == current_bytes_used){
-          same_processes_and_bytes_not_found = 0;
-          if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-            if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-              if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
+  }else{
+
+    int min = -1, max = -1, index;
+    //int res;
+    mc_visited_pair_t pair_test;
+    int cursor;
+
+    index = get_search_interval(visited_pairs, new_pair, &min, &max);
+
+    if(min != -1 && max != -1){ // Visited pair with same number of processes and same heap bytes used exists
+      /*res = xbt_parmap_mc_apply(parmap, snapshot_compare, xbt_dynar_get_ptr(visited_pairs, min), (max-min)+1, pair);
+      if(res != -1){
+        pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, (min+res)-1, mc_pair_t);
+        if(pair_test->other_num == -1)
+          pair->other_num = pair_test->num;
+        else
+          pair->other_num = pair_test->other_num;
+        if(dot_output == NULL)
+          XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", pair->num, pair_test->num);
+        else
+          XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", pair->num, pair_test->num, pair->other_num);
+        xbt_dynar_remove_at(visited_pairs, (min + res) - 1, NULL);
+        xbt_dynar_insert_at(visited_pairs, (min+res) - 1, &pair);
+        pair_test->visited_removed = 1;
+        if(pair_test->stack_removed && pair_test->visited_removed){
+          if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
+            if(pair_test->acceptance_removed){
+              MC_pair_delete(pair_test);
+            }
+          }else{
+            MC_pair_delete(pair_test);
+          }
+        }
+        if(!raw_mem_set)
+          MC_UNSET_RAW_MEM;
+        return pair->other_num;
+        }*/
+      cursor = min;
+      while(cursor <= max){
+        pair_test = (mc_visited_pair_t)xbt_dynar_get_as(visited_pairs, cursor, mc_visited_pair_t);
+        //if(pair_test->acceptance_pair == 0){ /* Acceptance pair have been already checked before */
+          if(xbt_automaton_state_compare(pair_test->automaton_state, new_pair->automaton_state) == 0){
+            if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, new_pair->atomic_propositions) == 0){
+              if(snapshot_compare(pair_test, new_pair) == 0){
+                if(pair_test->other_num == -1)
+                  new_pair->other_num = pair_test->num;
+                else
+                  new_pair->other_num = pair_test->other_num;
+                if(dot_output == NULL)
+                  XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", new_pair->num, pair_test->num);
+                else
+                  XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", new_pair->num, pair_test->num, pair->other_num);
                 xbt_dynar_remove_at(visited_pairs, cursor, NULL);
-                xbt_dynar_insert_at(visited_pairs, cursor, &pair);
+                xbt_dynar_insert_at(visited_pairs, cursor, &new_pair);
                 pair_test->visited_removed = 1;
-                result = pair_test->num;
-                if(pair_test->stack_removed && pair_test->visited_removed){
-                  if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                    if(pair_test->acceptance_removed){ 
-                      MC_pair_delete(pair_test);
-                    }
-                  }else{
-                    MC_pair_delete(pair_test);
-                  }     
+                if(pair_test->acceptance_pair){
+                  if(pair_test->acceptance_removed == 1)
+                    MC_visited_pair_delete(pair_test);
+                }else{
+                  MC_visited_pair_delete(pair_test);
                 }
-                if(raw_mem_set)
-                  MC_SET_RAW_MEM;
-                else
+                if(!raw_mem_set)
                   MC_UNSET_RAW_MEM;
-                return result;
+                return new_pair->other_num;
               }
             }
-          }
-          /* Search another pair with same number of bytes used in std_heap */
-          previous_cursor = cursor - 1;
-          while(previous_cursor >= 0){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, previous_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){  
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  xbt_dynar_remove_at(visited_pairs, previous_cursor, NULL);
-                  xbt_dynar_insert_at(visited_pairs, previous_cursor, &pair);
-                  pair_test->visited_removed = 1;
-                  result = pair_test->num;
-                  if(pair_test->stack_removed && pair_test->visited_removed){
-                    if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                      if(pair_test->acceptance_removed){ 
-                        MC_pair_delete(pair_test);
-                      }
-                    }else{
-                      MC_pair_delete(pair_test);
-                    }     
-                  }
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return result;
-                }
-              }
-            }
-            previous_cursor--;
-          }
-          next_cursor = cursor + 1;
-          while(next_cursor < xbt_dynar_length(visited_pairs)){
-            pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, next_cursor, mc_pair_t);
-            bytes_used_test = pair_test->heap_bytes_used;
-            if(bytes_used_test != current_bytes_used)
-              break;
-            if(xbt_automaton_state_compare(pair_test->automaton_state, pair->automaton_state) == 0){
-              if(xbt_automaton_propositional_symbols_compare_value(pair_test->atomic_propositions, pair->atomic_propositions) == 0){
-                if(snapshot_compare(pair->graph_state->system_state, pair_test->graph_state->system_state) == 0){
-                  xbt_dynar_remove_at(visited_pairs, next_cursor, NULL);
-                  xbt_dynar_insert_at(visited_pairs, next_cursor, &pair);
-                  pair_test->visited_removed = 1;
-                  result = pair_test->num;
-                  if(pair_test->stack_removed && pair_test->visited_removed){
-                    if((pair_test->automaton_state->type == 1) || (pair_test->automaton_state->type == 2)){
-                      if(pair_test->acceptance_removed){ 
-                        MC_pair_delete(pair_test);
-                      }
-                    }else{
-                      MC_pair_delete(pair_test);
-                    }     
-                  }
-                  if(raw_mem_set)
-                    MC_SET_RAW_MEM;
-                  else
-                    MC_UNSET_RAW_MEM;
-                  return result;
-                }
-              }
-            }
-            next_cursor++;
-          }
+            //}
         }
+        cursor++;
+      }
+      xbt_dynar_insert_at(visited_pairs, min, &new_pair);
+    }else{
+      pair_test = (mc_visited_pair_t)xbt_dynar_get_as(visited_pairs, index, mc_visited_pair_t);
+      if(pair_test->nb_processes < new_pair->nb_processes){
+        xbt_dynar_insert_at(visited_pairs, index+1, &new_pair);
+      }else{
+        if(pair_test->heap_bytes_used < new_pair->heap_bytes_used)
+          xbt_dynar_insert_at(visited_pairs, index + 1, &new_pair);
+        else
+          xbt_dynar_insert_at(visited_pairs, index, &new_pair);
       }
     }
 
-    pair_test = (mc_pair_t)xbt_dynar_get_as(visited_pairs, cursor, mc_pair_t);
-    bytes_used_test = pair_test->heap_bytes_used;
-
-    if(bytes_used_test < current_bytes_used)
-      xbt_dynar_insert_at(visited_pairs, cursor + 1, &pair);
-    else
-      xbt_dynar_insert_at(visited_pairs, cursor, &pair);
-
     if(xbt_dynar_length(visited_pairs) > _sg_mc_visited){
-      int min = mc_stats->expanded_states;
+      int min2 = mc_stats->expanded_pairs;
       unsigned int cursor2 = 0;
-      unsigned int index = 0;
+      unsigned int index2 = 0;
       xbt_dynar_foreach(visited_pairs, cursor2, pair_test){
-        if(pair_test->num < min){
-          index = cursor2;
-          min = pair_test->num;
+        if(pair_test->num < min2){
+          index2 = cursor2;
+          min2 = pair_test->num;
         }
       }
-      xbt_dynar_remove_at(visited_pairs, index, &pair_test);
+      xbt_dynar_remove_at(visited_pairs, index2, &pair_test);
       pair_test->visited_removed = 1;
-      if(pair_test->stack_removed && pair_test->acceptance_removed && pair_test->visited_removed)
-        MC_pair_delete(pair_test);
-      
+      if(pair_test->acceptance_pair){
+        if(pair_test->acceptance_removed)
+          MC_visited_pair_delete(pair_test);
+      }else{
+        MC_visited_pair_delete(pair_test);
+      }
     }
 
-    MC_UNSET_RAW_MEM;
-
-    if(raw_mem_set)
-      MC_SET_RAW_MEM;
-    
-    return -1;
-    
   }
+
+  if(!raw_mem_set)
+    MC_UNSET_RAW_MEM;
+  
+  return -1;
 }
 
 static int MC_automaton_evaluate_label(xbt_automaton_exp_label_t l, xbt_dynar_t atomic_propositions_values){
@@ -499,13 +377,16 @@ void MC_ddfs_init(void){
 
   MC_wait_for_requests();
 
+  MC_ignore_heap(simix_global->process_to_run->data, 0);
+  MC_ignore_heap(simix_global->process_that_ran->data, 0);
+
   MC_SET_RAW_MEM;
 
-  acceptance_pairs = xbt_dynar_new(sizeof(mc_pair_t), NULL); 
-  visited_pairs = xbt_dynar_new(sizeof(mc_pair_t), NULL); 
+  acceptance_pairs = xbt_dynar_new(sizeof(mc_visited_pair_t), NULL); 
+  visited_pairs = xbt_dynar_new(sizeof(mc_visited_pair_t), NULL); 
   successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
 
-  initial_state_liveness->snapshot = MC_take_snapshot();
+  initial_state_liveness->snapshot = MC_take_snapshot(0);
   initial_state_liveness->prev_pair = 0;
 
   MC_UNSET_RAW_MEM; 
@@ -542,40 +423,7 @@ void MC_ddfs_init(void){
       if(cursor != 0){
         MC_restore_snapshot(initial_state_liveness->snapshot);
         MC_UNSET_RAW_MEM;
-      }
-      
-
-    }else if(automaton_state->type == 2){ /* Acceptance automaton state */
-      
-      MC_SET_RAW_MEM;
-
-      initial_pair = MC_pair_new();
-      initial_pair->automaton_state = automaton_state;
-      initial_pair->graph_state = MC_state_new();
-      initial_pair->atomic_propositions = get_atomic_propositions_values();
-        
-      /* Get enabled process and insert it in the interleave set of the graph_state */
-      xbt_swag_foreach(process, simix_global->process_list){
-        if(MC_process_is_enabled(process)){
-          MC_state_interleave_process(initial_pair->graph_state, process);
-        }
-      }
-
-      initial_pair->requests = MC_state_interleave_size(initial_pair->graph_state);
-      initial_pair->search_cycle = 1;
-        
-      xbt_fifo_unshift(mc_stack_liveness, initial_pair);
-        
-      MC_UNSET_RAW_MEM;
-
-      set_acceptance_pair_reached(initial_pair);
-  
-      MC_ddfs();
-
-      if(cursor != 0){
-        MC_restore_snapshot(initial_state_liveness->snapshot);
-        MC_UNSET_RAW_MEM;
-      }
+      } 
     }
   }
 
@@ -602,7 +450,7 @@ void MC_ddfs(){
   /* Update current state in buchi automaton */
   _mc_property_automaton->current_state = current_pair->automaton_state;
 
-  XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness), current_pair->search_cycle);
+  XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size %d, pair_num %d)", xbt_fifo_size(mc_stack_liveness), current_pair->search_cycle, MC_state_interleave_size(current_pair->graph_state), current_pair->num);
  
   mc_stats->visited_pairs++;
 
@@ -613,11 +461,11 @@ void MC_ddfs(){
   xbt_automaton_transition_t transition_succ;
   unsigned int cursor = 0;
   int res;
-  int reached_num, visited_num;
-  int new_pair = 0;
+  int visited_num;
 
   mc_pair_t next_pair = NULL;
   xbt_dynar_t prop_values = NULL;
+  mc_visited_pair_t reached_pair = NULL;
   
   if(xbt_fifo_size(mc_stack_liveness) < _sg_mc_max_depth){
 
@@ -626,16 +474,7 @@ void MC_ddfs(){
       if(current_pair->search_cycle){
 
         if((current_pair->automaton_state->type == 1) || (current_pair->automaton_state->type == 2)){ 
-          
-          if((reached_num = is_reached_acceptance_pair(current_pair)) != -1){
-        
-            XBT_INFO("Pair %d already reached (equal to pair %d) !", current_pair->num, reached_num);
-            
-            MC_SET_RAW_MEM;
-            xbt_fifo_shift(mc_stack_liveness);
-            if(dot_output != NULL)
-              fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_state_liveness->prev_pair, reached_num, initial_state_liveness->prev_req);
-            MC_UNSET_RAW_MEM;
+          if((reached_pair = is_reached_acceptance_pair(current_pair->num, current_pair->automaton_state, current_pair->atomic_propositions)) == NULL){
 
             XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
             XBT_INFO("|             ACCEPTANCE CYCLE            |");
@@ -650,16 +489,13 @@ void MC_ddfs(){
         }
       }
 
-      if((visited_num = is_visited_pair(current_pair)) != -1){
-
-        XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", current_pair->num, visited_num);
+      if((visited_num = is_visited_pair(reached_pair, current_pair->num, current_pair->automaton_state, current_pair->atomic_propositions)) != -1){
 
         MC_SET_RAW_MEM;
         if(dot_output != NULL)
           fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_state_liveness->prev_pair, visited_num, initial_state_liveness->prev_req);
         MC_UNSET_RAW_MEM;
-        
-      
+              
       }else{  
 
         while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
@@ -701,6 +537,8 @@ void MC_ddfs(){
           MC_SET_RAW_MEM;
           prop_values = get_atomic_propositions_values();
           MC_UNSET_RAW_MEM;
+
+          int new_pair = 0;
          
           /* Evaluate enabled transition according to atomic propositions values */
           cursor= 0;
@@ -711,7 +549,7 @@ void MC_ddfs(){
             if(res == 1){ // enabled transition in automaton
 
               if(new_pair)
-               MC_replay_liveness(mc_stack_liveness, 1); 
+                MC_replay_liveness(mc_stack_liveness, 1); 
 
               MC_SET_RAW_MEM;
 
@@ -801,127 +639,6 @@ void MC_ddfs(){
 
       }
  
-    }else{
-
-      mc_stats->executed_transitions++;
-      
-      XBT_DEBUG("No request to execute in this state, search evolution in Büchi Automaton.");
-
-      if(current_pair->search_cycle){
-
-        if((current_pair->automaton_state->type == 1) || (current_pair->automaton_state->type == 2)){ 
-          
-          if((reached_num = is_reached_acceptance_pair(current_pair)) != -1){
-        
-            XBT_INFO("Pair %d already reached (equal to pair %d) !", current_pair->num, reached_num);
-            
-            MC_SET_RAW_MEM;
-            xbt_fifo_shift(mc_stack_liveness);
-            MC_UNSET_RAW_MEM;
-
-            XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
-            XBT_INFO("|             ACCEPTANCE CYCLE            |");
-            XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
-            XBT_INFO("Counter-example that violates formula :");
-            MC_show_stack_liveness(mc_stack_liveness);
-            MC_dump_stack_liveness(mc_stack_liveness);
-            MC_print_statistics(mc_stats);
-            xbt_abort();
-
-          }
-        }
-      }
-
-      if((visited_num = is_visited_pair(current_pair)) != -1){
-
-        XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", current_pair->num, visited_num);
-      
-      }else{            
-        
-        MC_SET_RAW_MEM;
-        prop_values = get_atomic_propositions_values();
-        MC_UNSET_RAW_MEM;
-
-        /* Evaluate enabled transition according to atomic propositions values */
-        cursor= 0;
-        xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
-
-          res = MC_automaton_evaluate_label(transition_succ->label, prop_values);
-
-          if(res == 1){ // enabled transition in automaton
-
-            if(new_pair)
-              MC_replay_liveness(mc_stack_liveness, 1);
-
-            MC_SET_RAW_MEM;
-
-            next_pair = MC_pair_new();
-            next_pair->graph_state = MC_state_new();
-            next_pair->automaton_state = transition_succ->dst;
-            next_pair->atomic_propositions = get_atomic_propositions_values();
-            next_pair->requests = MC_state_interleave_size(next_pair->graph_state);
-              
-            if(next_pair->automaton_state->type == 1 || next_pair->automaton_state->type == 2 || current_pair->search_cycle)
-              next_pair->search_cycle = 1;
-            
-            xbt_fifo_unshift(mc_stack_liveness, next_pair);
-
-            if(mc_stats->expanded_pairs%1000 == 0)
-              XBT_INFO("Expanded pairs : %lu", mc_stats->expanded_pairs);
-
-            if(dot_output != NULL)
-              fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", current_pair->num, next_pair->num, "");
-
-            MC_UNSET_RAW_MEM;
-
-            new_pair = 1;
-
-            MC_ddfs();
-
-          }
-
-        }
-
-        /* Then, evaluate true transitions (always true, whatever atomic propositions values) */
-        cursor = 0;   
-        xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
-      
-          res = MC_automaton_evaluate_label(transition_succ->label, prop_values);
-  
-          if(res == 2){ // true transition in automaton
-
-            if(new_pair)
-              MC_replay_liveness(mc_stack_liveness, 1);
-
-            MC_SET_RAW_MEM;
-            
-            next_pair = MC_pair_new();
-            next_pair->graph_state = MC_state_new();
-            next_pair->automaton_state = transition_succ->dst;
-            next_pair->atomic_propositions = get_atomic_propositions_values();
-            next_pair->requests = MC_state_interleave_size(next_pair->graph_state);
-            
-            if(next_pair->automaton_state->type == 1 || next_pair->automaton_state->type == 2 || current_pair->search_cycle)
-              next_pair->search_cycle = 1;
-
-            xbt_fifo_unshift(mc_stack_liveness, next_pair);
-
-            if(mc_stats->expanded_pairs%1000 == 0)
-              XBT_INFO("Expanded pairs : %lu", mc_stats->expanded_pairs);
-            
-            if(dot_output != NULL)
-              fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", current_pair->num, next_pair->num, "");
-
-            MC_UNSET_RAW_MEM;
-
-            new_pair = 1;
-
-            MC_ddfs();
-
-          }
-
-        }
-      }
     }
     
   }else{
@@ -945,15 +662,11 @@ void MC_ddfs(){
   MC_SET_RAW_MEM;
   xbt_dynar_free(&prop_values);
   current_pair = xbt_fifo_shift(mc_stack_liveness);
-  current_pair->stack_removed = 1;
-  if(current_pair->search_cycle){
-    remove_acceptance_pair(current_pair);
-  }else{
-    if(_sg_mc_visited == 0)
-      MC_pair_delete(current_pair);
-    else if(current_pair->visited_removed)
-      MC_pair_delete(current_pair);
+  if(xbt_fifo_size(mc_stack_liveness) != _sg_mc_max_depth -1 && current_pair->requests > 0 && current_pair->search_cycle){
+    remove_acceptance_pair(current_pair->num);
   }
+  MC_pair_delete(current_pair);
+
   MC_UNSET_RAW_MEM;
 
 }
index 82b4b51..b10c810 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
index 6f6506e..1056f44 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2013. 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. */
@@ -8,19 +9,48 @@
 mc_pair_t MC_pair_new(){
   mc_pair_t p = NULL;
   p = xbt_new0(s_mc_pair_t, 1);
-  p->nb_processes = xbt_swag_size(simix_global->process_list);
   p->num = ++mc_stats->expanded_pairs;
   p->search_cycle = 0;
   return p;
 }
 
+mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions){
+  mc_visited_pair_t pair = NULL;
+  pair = xbt_new0(s_mc_visited_pair_t, 1);
+  pair->graph_state = MC_state_new();
+  pair->graph_state->system_state = MC_take_snapshot(pair_num);
+  pair->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
+  pair->nb_processes = xbt_swag_size(simix_global->process_list);
+  pair->automaton_state = automaton_state;
+  pair->num = pair_num;
+  pair->other_num = -1;
+  pair->acceptance_removed = 0;
+  pair->visited_removed = 0;
+  pair->acceptance_pair = 0;
+  pair->atomic_propositions = xbt_dynar_new(sizeof(int), NULL);
+  unsigned int cursor = 0;
+  int value;
+  xbt_dynar_foreach(atomic_propositions, cursor, value)
+    xbt_dynar_push_as(pair->atomic_propositions, int, value);
+  return pair;
+}
+
+void MC_visited_pair_delete(mc_visited_pair_t p){
+  p->automaton_state = NULL;
+  MC_state_delete(p->graph_state);
+  xbt_dynar_free(&(p->atomic_propositions));
+  xbt_free(p);
+  p = NULL;
+}
+
 void MC_pair_delete(mc_pair_t p){
   p->automaton_state = NULL;
   MC_state_delete(p->graph_state);
-  p->stack_removed = 0;
-  p->visited_removed = 0;
-  p->acceptance_removed = 0;
   xbt_dynar_free(&(p->atomic_propositions));
   xbt_free(p);
   p = NULL;
 }
+
+void mc_pair_free_voidp(void *p){
+  MC_pair_delete((mc_pair_t) * (void **)p);
+}
index a348722..9e1db34 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2007-2013. 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. */
@@ -23,6 +24,7 @@
 #include "msg/msg.h"
 #include "msg/datatypes.h"
 #include "xbt/strbuff.h"
+#include "xbt/parmap.h"
 
 /****************************** Snapshots ***********************************/
 
@@ -46,8 +48,9 @@ typedef struct s_mc_snapshot{
 } s_mc_snapshot_t, *mc_snapshot_t;
 
 typedef struct s_mc_snapshot_stack{
-  xbt_strbuff_t local_variables;
+  xbt_dynar_t local_variables;
   void *stack_pointer;
+  void *real_address;
 }s_mc_snapshot_stack_t, *mc_snapshot_stack_t;
 
 typedef struct s_mc_global_t{
@@ -57,18 +60,26 @@ typedef struct s_mc_global_t{
   char *prev_req;
 }s_mc_global_t, *mc_global_t;
 
+typedef struct s_mc_checkpoint_ignore_region{
+  void *addr;
+  size_t size;
+}s_mc_checkpoint_ignore_region_t, *mc_checkpoint_ignore_region_t;
+
 mc_snapshot_t SIMIX_pre_mc_snapshot(smx_simcall_t simcall);
-mc_snapshot_t MC_take_snapshot(void);
+mc_snapshot_t MC_take_snapshot(int num_state);
 void MC_restore_snapshot(mc_snapshot_t);
 void MC_free_snapshot(mc_snapshot_t);
-void snapshot_stack_free_voidp(void *s);
-int is_stack_ignore_variable(char *frame, char *var_name);
+
+extern xbt_dynar_t mc_checkpoint_ignore;
 
 /********************************* MC Global **********************************/
 
 extern double *mc_time;
 extern FILE *dot_output;
 extern const char* colors[13];
+extern xbt_parmap_t parmap;
+
+extern int user_max_depth_reached;
 
 int MC_deadlock_check(void);
 void MC_replay(xbt_fifo_t stack, int start);
@@ -78,8 +89,7 @@ void MC_show_deadlock(smx_simcall_t req);
 void MC_show_stack_safety(xbt_fifo_t stack);
 void MC_dump_stack_safety(xbt_fifo_t stack);
 void MC_init(void);
-void MC_init_dot_output(void);
-int SIMIX_pre_mc_random(smx_simcall_t simcall);
+int SIMIX_pre_mc_random(smx_simcall_t simcall, int min, int max);
 
 
 /********************************* Requests ***********************************/
@@ -188,7 +198,7 @@ typedef struct s_map_region {
   void *start_addr;             /* Start address of the map */
   void *end_addr;               /* End address of the map */
   int prot;                     /* Memory protection */
-  int flags;                    /* Aditional memory flags */
+  int flags;                    /* Additional memory flags */
   void *offset;                 /* Offset in the file/whatever */
   char dev_major;               /* Major of the device */
   char dev_minor;               /* Minor of the device */
@@ -206,16 +216,17 @@ typedef struct s_memory_map {
 
 
 void MC_init_memory_map_info(void);
-memory_map_t get_memory_map(void);
-void free_memory_map(memory_map_t map);
-void get_libsimgrid_plt_section(void);
-void get_binary_plt_section(void);
+memory_map_t MC_get_memory_map(void);
+void MC_free_memory_map(memory_map_t map);
+void MC_get_libsimgrid_plt_section(void);
+void MC_get_binary_plt_section(void);
 
 extern void *start_data_libsimgrid;
 extern void *start_data_binary;
 extern void *start_bss_binary;
 extern char *libsimgrid_path;
 extern void *start_text_libsimgrid;
+extern void *start_text_binary;
 extern void *start_bss_libsimgrid;
 extern void *start_plt_libsimgrid;
 extern void *end_plt_libsimgrid;
@@ -241,10 +252,10 @@ typedef struct s_mc_comparison_times{
   double hash_local_variables_comparison_time;
 }s_mc_comparison_times_t, *mc_comparison_times_t;
 
-extern mc_comparison_times_t mc_comp_times;
-extern double mc_snapshot_comparison_time;
+extern __thread mc_comparison_times_t mc_comp_times;
+extern __thread double mc_snapshot_comparison_time;
 
-int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2);
+int snapshot_compare(void *state1, void *state2);
 int SIMIX_pre_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2);
 void print_comparison_times(void);
 
@@ -273,6 +284,7 @@ typedef struct s_mc_visited_state{
   size_t heap_bytes_used;
   int nb_processes;
   int num;
+  int other_num; // dot_output for
 }s_mc_visited_state_t, *mc_visited_state_t;
 
 
@@ -292,15 +304,26 @@ typedef struct s_mc_pair{
   xbt_automaton_state_t automaton_state;
   xbt_dynar_t atomic_propositions;
   int requests;
+}s_mc_pair_t, *mc_pair_t;
+
+typedef struct s_mc_visited_pair{
+  int num;
+  int other_num; /* Dot output for */
+  int acceptance_pair;
+  mc_state_t graph_state; /* System state included */
+  xbt_automaton_state_t automaton_state;
+  xbt_dynar_t atomic_propositions;
   size_t heap_bytes_used;
   int nb_processes;
-  int stack_removed;
-  int visited_removed;
   int acceptance_removed;
-}s_mc_pair_t, *mc_pair_t;
+  int visited_removed;
+}s_mc_visited_pair_t, *mc_visited_pair_t;
 
 mc_pair_t MC_pair_new(void);
 void MC_pair_delete(mc_pair_t);
+void mc_pair_free_voidp(void *p);
+mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions);
+void MC_visited_pair_delete(mc_visited_pair_t p);
 
 void MC_ddfs_init(void);
 void MC_ddfs(void);
@@ -308,7 +331,14 @@ void MC_show_stack_liveness(xbt_fifo_t stack);
 void MC_dump_stack_liveness(xbt_fifo_t stack);
 
 
-/********************************** Local variables with DWARF **********************************/
+/********************************** Variables with DWARF **********************************/
+
+extern xbt_dict_t mc_local_variables_libsimgrid;
+extern xbt_dict_t mc_local_variables_binary;
+extern xbt_dynar_t mc_global_variables_libsimgrid;
+extern xbt_dynar_t mc_global_variables_binary;
+extern xbt_dict_t mc_variables_type_libsimgrid;
+extern xbt_dict_t mc_variables_type_binary;
 
 typedef enum {
   e_dw_loclist,
@@ -372,53 +402,36 @@ typedef struct s_dw_location_entry{
   dw_location_t location;
 }s_dw_location_entry_t, *dw_location_entry_t;
 
-typedef struct s_dw_local_variable{
+typedef struct s_dw_variable{
+  int global;
   char *name;
-  dw_location_t location;
-}s_dw_local_variable_t, *dw_local_variable_t;
+  char *type_origin;
+  union{
+    dw_location_t location;
+    void *address;
+  }address;
+}s_dw_variable_t, *dw_variable_t;
 
 typedef struct s_dw_frame{
   char *name;
   void *low_pc;
   void *high_pc;
   dw_location_t frame_base;
-  xbt_dict_t variables;
+  xbt_dynar_t variables; /* Cannot use dict, there may be several variables with the same name (in different lexical blocks)*/
   unsigned long int start;
   unsigned long int end;
 }s_dw_frame_t, *dw_frame_t;
 
-/* FIXME : implement free functions for each structure */
-
-extern xbt_dict_t mc_local_variables;
-
-typedef struct s_variable_value{
-  char *type;
-  
-  union{
-    void *address;
-    long int res;
-  }value;
-}s_variable_value_t, *variable_value_t;
-
-void variable_value_free_voidp(void* v);
-void variable_value_free(variable_value_t v);
-
-void MC_get_local_variables(const char *elf_file, xbt_dict_t location_list, xbt_dict_t *variables);
-void print_local_variables(xbt_dict_t list);
-xbt_dict_t MC_get_location_list(const char *elf_file);
+/********************************** Miscellaneous **********************************/
 
-
-/********************************** Global variables with objdump **********************************/
-
-typedef struct s_global_variable{
+typedef struct s_local_variable{
+  char *frame;
+  unsigned long ip;
   char *name;
-  size_t size;
+  char *type;
   void *address;
-}s_global_variable_t, *global_variable_t;
-
-void global_variable_free(global_variable_t v);
-void global_variable_free_voidp(void *v);
-
-extern xbt_dynar_t mc_global_variables;
+  int region;
+}s_local_variable_t, *local_variable_t;
 
 #endif
+
index 9ce5f61..5b7ce40 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
@@ -32,15 +33,15 @@ int MC_request_depend(smx_simcall_t r1, smx_simcall_t r2) {
     if(rdv != simcall_comm_wait__get__comm(r2)->comm.rdv_cpy && simcall_comm_wait__get__timeout(r2) <= 0)
       return FALSE;
 
-    if((r1->issuer != simcall_comm_wait__get__comm(r2)->comm.src_proc) && (r1->issuer != simcall_comm_wait__get__comm(r2)->comm.dst_proc))
+    if((r1->issuer != simcall_comm_wait__get__comm(r2)->comm.src_proc) && (r1->issuer != simcall_comm_wait__get__comm(r2)->comm.dst_proc) && simcall_comm_wait__get__timeout(r2) <= 0)
       return FALSE;
 
     if((r1->call == SIMCALL_COMM_ISEND) && (simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_SEND) 
-       && (simcall_comm_wait__get__comm(r2)->comm.src_buff != simcall_comm_isend__get__src_buff(r1)))
+       && (simcall_comm_wait__get__comm(r2)->comm.src_buff != simcall_comm_isend__get__src_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return FALSE;
 
     if((r1->call == SIMCALL_COMM_IRECV) && (simcall_comm_wait__get__comm(r2)->comm.type == SIMIX_COMM_RECEIVE) 
-       && (simcall_comm_wait__get__comm(r2)->comm.dst_buff != simcall_comm_irecv__get__dst_buff(r1)))
+       && (simcall_comm_wait__get__comm(r2)->comm.dst_buff != simcall_comm_irecv__get__dst_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return FALSE;
   }
 
@@ -52,15 +53,15 @@ int MC_request_depend(smx_simcall_t r1, smx_simcall_t r2) {
     if(rdv != simcall_comm_wait__get__comm(r1)->comm.rdv_cpy && simcall_comm_wait__get__timeout(r1) <= 0)
       return FALSE;
 
-    if((r2->issuer != simcall_comm_wait__get__comm(r1)->comm.src_proc) && (r2->issuer != simcall_comm_wait__get__comm(r1)->comm.dst_proc))
+    if((r2->issuer != simcall_comm_wait__get__comm(r1)->comm.src_proc) && (r2->issuer != simcall_comm_wait__get__comm(r1)->comm.dst_proc) && simcall_comm_wait__get__timeout(r1) <= 0)
         return FALSE;  
 
     if((r2->call == SIMCALL_COMM_ISEND) && (simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_SEND) 
-       && (simcall_comm_wait__get__comm(r1)->comm.src_buff != simcall_comm_isend__get__src_buff(r2)))
+       && (simcall_comm_wait__get__comm(r1)->comm.src_buff != simcall_comm_isend__get__src_buff(r2)) && simcall_comm_wait__get__timeout(r1) <= 0)
       return FALSE;
 
     if((r2->call == SIMCALL_COMM_IRECV) && (simcall_comm_wait__get__comm(r1)->comm.type == SIMIX_COMM_RECEIVE) 
-       && (simcall_comm_wait__get__comm(r1)->comm.dst_buff != simcall_comm_irecv__get__dst_buff(r2)))
+       && (simcall_comm_wait__get__comm(r1)->comm.dst_buff != simcall_comm_irecv__get__dst_buff(r2)) && simcall_comm_wait__get__timeout(r1) <= 0)
       return FALSE;
   }
 
@@ -274,9 +275,9 @@ char *MC_request_to_string(smx_simcall_t req, int value)
   }
 
   if(args != NULL){
-    str = bprintf("[(%lu)%s (%s)] %s (%s)", req->issuer->pid , MSG_host_get_name(req->issuer->smx_host), req->issuer->name, type, args);
+    str = bprintf("[(%lu)%s (%s)] %s(%s) (%d)", req->issuer->pid , MSG_host_get_name(req->issuer->smx_host), req->issuer->name, type, args, req->call);
   }else{
-    str = bprintf("[(%lu)%s (%s)] %s ", req->issuer->pid , MSG_host_get_name(req->issuer->smx_host), req->issuer->name, type);
+    str = bprintf("[(%lu)%s (%s)] %s (%d) ", req->issuer->pid , MSG_host_get_name(req->issuer->smx_host), req->issuer->name, type, req->call);
   }
 
   xbt_free(args);
@@ -461,17 +462,10 @@ char *MC_request_get_dot_output(smx_simcall_t req, int value){
     break;
 
   case SIMCALL_MC_RANDOM:
-    if(value == 0){
-      if(req->issuer->smx_host)
-        label = bprintf("[(%lu)%s] MC_RANDOM (0)", req->issuer->pid, MSG_host_get_name(req->issuer->smx_host));
-      else
-        label = bprintf("[(%lu)] MC_RANDOM (0)", req->issuer->pid);
-    }else{
-      if(req->issuer->smx_host)
-        label = bprintf("[(%lu)%s] MC_RANDOM (1)", req->issuer->pid, MSG_host_get_name(req->issuer->smx_host));
-      else
-        label = bprintf("[(%lu)] MC_RANDOM (1)", req->issuer->pid);
-    }
+    if(req->issuer->smx_host)
+      label = bprintf("[(%lu)%s] MC_RANDOM (%d)", req->issuer->pid, MSG_host_get_name(req->issuer->smx_host), value);
+    else
+      label = bprintf("[(%lu)] MC_RANDOM (%d)", req->issuer->pid, value);
     break;
 
   case SIMCALL_MC_SNAPSHOT:
index 59cca4e..f0c240d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
@@ -109,12 +110,11 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int valu
 
     case SIMCALL_MC_RANDOM:
       state->internal_req = *req;
-      simcall_mc_random__set__result(&state->internal_req, value);
-      if(value == 0){
+      if(value != simcall_mc_random__get__max(req)){
         xbt_swag_foreach(process, simix_global->process_list){
           procstate = &state->proc_status[process->pid];
           if(process->pid == req->issuer->pid){
-            procstate->state = MC_MORE_INTERLEAVE;  
+            procstate->state = MC_MORE_INTERLEAVE;
             break;
           }        
         }
@@ -200,8 +200,10 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value)
           case SIMCALL_MC_RANDOM:
             if(procstate->state == MC_INTERLEAVE)
               *value = 0;
-            else
-              *value = 1;
+            else{
+              if(state->req_num < simcall_mc_random__get__max(&process->simcall))
+                *value = state->req_num + 1;
+            }
             procstate->state = MC_DONE;
             return &process->simcall;
             break;
index 04538dd..d893439 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013. 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. */
@@ -9,7 +10,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory_map, mc,
                                 "Logging specific to algorithms for memory_map");
 
-memory_map_t get_memory_map(void)
+memory_map_t MC_get_memory_map(void)
 {
   FILE *fp;                     /* File pointer to process's proc maps file */
   char *line = NULL;            /* Temporal storage for each line that is readed */
@@ -155,7 +156,7 @@ memory_map_t get_memory_map(void)
   return ret;
 }
 
-void free_memory_map(memory_map_t map){
+void MC_free_memory_map(memory_map_t map){
 
   int i;
   for(i=0; i< map->mapsize; i++){
index 7c6239a..bb79416 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. 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 "msg_private.h"
-#include "mc/mc.h"
 
 #include "msg/datatypes.h"
 #include "simix/smx_process_private.h"
@@ -33,9 +32,6 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, m
   if (TRACE_msg_process_is_enabled()){
     static long long int counter = 0;
 
-    if(MC_is_active())
-      MC_ignore_data_bss(&counter, sizeof(counter));
-
     char key[INSTR_DEFAULT_STR_SIZE];
     snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
 
index 52acde4..c8e3288 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -39,10 +39,8 @@ void TRACE_msg_task_create(msg_task_t task)
   task->counter = counter++;
   task->category = NULL;
   
-  if(MC_is_active()){
-    MC_ignore_data_bss(&counter, sizeof(counter));
+  if(MC_is_active())
     MC_ignore_heap(&(task->counter), sizeof(task->counter));
-  }
 
   XBT_DEBUG("CREATE %p, %lld", task, task->counter);
 }
index 7b7e3e4..c72cbfc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012. The SimGrid Team.
+/* Copyright (c) 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 885661e..9b5fe16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 791429c..c72f553 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 77c8761..279f4ad 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -47,6 +47,13 @@ void MSG_post_create_environment(void) {
     if(data[SIMIX_HOST_LEVEL])
       __MSG_host_create(xbt_dict_cursor_get_elm(cursor));
   }
+
+  /* Initialize MSG storages */
+  xbt_lib_foreach(storage_lib, cursor, name, data) {
+    if(data[SIMIX_STORAGE_LEVEL])
+      __MSG_storage_create(xbt_dict_cursor_get_elm(cursor));
+  }
+
 }
 
 msg_as_t MSG_environment_get_routing_root() {
index 3a3ad8c..d98766c 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004-2012. The SimGrid Team.  All rights reserved.         */
+/* Copyright (c) 2004-2013. 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. */
@@ -71,8 +72,9 @@ void MSG_init_nocheck(int *argc, char **argv) {
 
   XBT_DEBUG("ADD MSG LEVELS");
   MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_destroy);
+  MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy);
 
-  atexit(MSG_exit);
+  if(sg_cfg_get_boolean("clean_atexit")) atexit(MSG_exit);
 }
 
 #ifdef MSG_USE_DEPRECATED
@@ -134,7 +136,7 @@ msg_error_t MSG_main(void)
  * Do --help on any simgrid binary to see the list of currently existing configuration variables, and see Section @ref options.
  *
  * Example:
- * MSG_config("workstation/model","KCCFLN05");
+ * MSG_config("workstation/model","ptask_L07");
  */
 void MSG_config(const char *key, const char *value){
   xbt_assert(msg_global,"ERROR: Please call MSG_init() before using MSG_config()");
index 2b28c97..3bdc8d8 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2013. 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. */
@@ -98,6 +99,9 @@ msg_error_t MSG_parallel_task_execute(msg_task_t task)
     case cancel_error:
       status = MSG_TASK_CANCELED;
       break;
+    case host_error:
+      status = MSG_HOST_FAILURE;
+      break;
     default:
       RETHROW;
     }
index 6f01ec9..4dbe948 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,7 +13,7 @@
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
 /** @addtogroup m_host_management
- *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Hosts" --> \endhtmlonly
  * (#msg_host_t) and the functions for managing it.
  *  
  *  A <em>location</em> (or <em>host</em>) is any possible place where
@@ -204,15 +204,32 @@ double MSG_get_host_speed(msg_host_t h)
 
 
 /** \ingroup m_host_management
- * \brief Return the number of core.
+ * \brief Return the number of cores.
+ *
+ * \param host a host
+ * \return the number of cores
  */
-int MSG_get_host_core(msg_host_t h)
+int MSG_host_get_core_number(msg_host_t host)
 {
-  xbt_assert((h != NULL), "Invalid parameters");
+  xbt_assert((host != NULL), "Invalid parameters");
 
-  return (simcall_host_get_core(h));
+  return (simcall_host_get_core(host));
 }
 
+/** \ingroup m_host_management
+ * \brief Return the list of processes attached to an host.
+ *
+ * \param host a host
+ * \return a swag with the attached processes
+ */
+xbt_swag_t MSG_host_get_process_list(msg_host_t host)
+{
+  xbt_assert((host != NULL), "Invalid parameters");
+
+  return (simcall_host_get_process_list(host));
+}
+
+
 /** \ingroup m_host_management
  * \brief Returns the value of a given host property
  *
@@ -263,3 +280,95 @@ int MSG_host_is_avail(msg_host_t host)
   xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
   return (simcall_host_get_state(host));
 }
+
+/** \ingroup m_host_management
+ * \brief Return the speed of the processor (in flop/s) at a given pstate
+ *
+ * \param  host host to test
+ * \param pstate_index pstate to test
+ * \return Returns the processor speed associated with pstate_index
+ */
+double MSG_get_host_power_peak_at(msg_host_t host, int pstate_index) {
+         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+         return (simcall_host_get_power_peak_at(host, pstate_index));
+}
+
+/** \ingroup m_host_management
+ * \brief Return the current speed of the processor (in flop/s)
+ *
+ * \param  host host to test
+ * \return Returns the current processor speed
+ */
+double MSG_get_host_current_power_peak(msg_host_t host) {
+         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+         return simcall_host_get_current_power_peak(host);
+}
+
+/** \ingroup m_host_management
+ * \brief Return the number of pstates defined for a host
+ *
+ * \param  host host to test
+ */
+int MSG_get_host_nb_pstates(msg_host_t host) {
+
+         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+         return (simcall_host_get_nb_pstates(host));
+}
+
+/** \ingroup m_host_management
+ * \brief Sets the speed of the processor (in flop/s) at a given pstate
+ *
+ * \param  host host to test
+ * \param pstate_index pstate to switch to
+ */
+void MSG_set_host_power_peak_at(msg_host_t host, int pstate_index) {
+         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+
+         simcall_host_set_power_peak_at(host, pstate_index);
+}
+
+/** \ingroup m_host_management
+ * \brief Return the total energy consumed by a host (in Joules)
+ *
+ * \param  host host to test
+ * \return Returns the consumed energy
+ */
+double MSG_get_host_consumed_energy(msg_host_t host) {
+         xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+         return simcall_host_get_consumed_energy(host);
+}
+
+/** \ingroup m_host_management
+ * \brief Return the list of mount point names on an host.
+ * \param host a host
+ * \return a dict containing all mount point on the host (mount_name => msg_storage_t)
+ */
+xbt_dict_t MSG_host_get_storage_list(msg_host_t host)
+{
+  xbt_assert((host != NULL), "Invalid parameters");
+  return (simcall_host_get_storage_list(host));
+}
+
+/** \ingroup msg_host_management
+ * \brief Return the content of mounted storages on an host.
+ * \param host a host
+ * \return a dict containing content (as a dict) of all storages mounted on the host
+ */
+xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
+{
+  xbt_assert((host != NULL), "Invalid parameters");
+  xbt_dict_t contents = xbt_dict_new_homogeneous(NULL);
+  msg_storage_t storage;
+  char* storage_name;
+  char* mount_name;
+  xbt_dict_cursor_t cursor = NULL;
+
+  xbt_dict_t storage_list = simcall_host_get_storage_list(host);
+
+  xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
+       storage = (msg_storage_t)xbt_lib_get_elm_or_null(storage_lib,storage_name);
+       xbt_dict_t content = simcall_storage_get_content(storage);
+       xbt_dict_set(contents,mount_name, content,NULL);
+  }
+  return contents;
+}
index 798e7e2..dc6cae3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004 - 2013. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                       */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include "msg_private.h"
 #include "xbt/log.h"
+#include <inttypes.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg,
                                 "Logging specific to MSG (io)");
 
 /** @addtogroup msg_file_management
- *     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Files" --> \endhtmlonly
  * (#msg_file_t) and the functions for managing it.
  *
  *  \see #msg_file_t
  */
 
 /********************************* File **************************************/
+void __MSG_file_get_info(msg_file_t fd){
+  xbt_dynar_t info = simcall_file_get_info(fd->simdata->smx_file);
+  sg_storage_size_t *psize;
+
+  fd->info->content_type = xbt_dynar_pop_as(info, char *);
+  fd->info->storage_type = xbt_dynar_pop_as(info, char *);
+  fd->info->storageId = xbt_dynar_pop_as(info, char *);
+  fd->info->mount_point = xbt_dynar_pop_as(info, char *);
+  psize = xbt_dynar_pop_as(info, sg_storage_size_t*);
+  fd->info->size = *psize;
+  xbt_free(psize);
+  xbt_dynar_free_container(&info);
+}
+
+/** \ingroup msg_file_management
+ *
+ * \brief Set the user data of a #msg_file_t.
+ *
+ * This functions checks whether some data has already been associated to \a file
+   or not and attach \a data to \a file if it is possible.
+ */
+msg_error_t MSG_file_set_data(msg_file_t fd, void *data)
+{
+  SIMIX_file_set_data(fd->simdata->smx_file,data);
+
+  return MSG_OK;
+}
+
+/** \ingroup msg_file_management
+ *
+ * \brief Return the user data of a #msg_file_t.
+ *
+ * This functions checks whether \a file is a valid pointer or not and return
+   the user data associated to \a file if it is possible.
+ */
+void *MSG_file_get_data(msg_file_t fd)
+{
+  return SIMIX_file_get_data(fd->simdata->smx_file);
+}
+
+/** \ingroup msg_file_management
+ * \brief Display information related to a file descriptor
+ *
+ * \param fd is a the file descriptor
+ */
+
+void MSG_file_dump (msg_file_t fd){
+//   THROW_UNIMPLEMENTED;
+  /* Update the cached information first */
+  __MSG_file_get_info(fd);
+  XBT_INFO("File Descriptor information:\n"
+           "\t\tFull name: '%s'\n"
+           "\t\tSize: %" PRIu64 "\n"
+           "\t\tMount point: '%s'\n"
+           "\t\tStorage Id: '%s'\n"
+           "\t\tStorage Type: '%s'\n"
+           "\t\tContent Type: '%s'",
+           fd->fullname, fd->info->size, fd->info->mount_point,
+           fd->info->storageId, fd->info->storage_type,
+           fd->info->content_type);
+}
 
 /** \ingroup msg_file_management
- * \brief Read elements of a file
+ * \brief Read a file
  *
- * \param ptr buffer to where the data is copied
  * \param size of the file to read
  * \param fd is a the file descriptor
- * \return the number of items successfully read
+ * \return the number of bytes successfully read
  */
-size_t MSG_file_read(void* ptr, size_t size, msg_file_t fd)
+sg_storage_size_t MSG_file_read(msg_file_t fd, sg_storage_size_t size)
 {
-  return simcall_file_read(ptr, size, fd->simdata->smx_file);
+  return simcall_file_read(fd->simdata->smx_file, size);
 }
 
 /** \ingroup msg_file_management
- * \brief Write elements into a file
+ * \brief Write into a file
  *
- * \param ptr buffer from where the data is copied
  * \param size of the file to write
  * \param fd is a the file descriptor
- * \return the number of items successfully write
+ * \return the number of bytes successfully write
  */
-size_t MSG_file_write(const void* ptr, size_t size, msg_file_t fd)
+sg_storage_size_t MSG_file_write(msg_file_t fd, sg_storage_size_t size)
 {
-  return simcall_file_write(ptr, size, fd->simdata->smx_file);
+  return simcall_file_write(fd->simdata->smx_file, size);
 }
 
 /** \ingroup msg_file_management
  * \brief Opens the file whose name is the string pointed to by path
  *
  * \param mount is the mount point where find the file is located
- * \param path is the file location on the storage
+ * \param fullname is the file location on the storage
+ * \param data user data to attach to the file
  *
  * \return An #msg_file_t associated to the file
  */
-msg_file_t MSG_file_open(const char* mount, const char* path)
+msg_file_t MSG_file_open(const char* mount, const char* fullname, void* data)
 {
   msg_file_t file = xbt_new(s_msg_file_t,1);
-  file->name = xbt_strdup(path);
+  file->fullname = xbt_strdup(fullname);
   file->simdata = xbt_new0(s_simdata_file_t,1);
-  file->simdata->smx_file = simcall_file_open(mount, path);
+  file->info = xbt_new0(s_msg_file_info_t,1);
+  file->simdata->smx_file = simcall_file_open(mount, fullname);
+  SIMIX_file_set_data(file->simdata->smx_file, data);
   return file;
 }
 
@@ -71,8 +134,9 @@ msg_file_t MSG_file_open(const char* mount, const char* path)
 int MSG_file_close(msg_file_t fd)
 {
   int res = simcall_file_close(fd->simdata->smx_file);
-  free(fd->name);
+  free(fd->fullname);
   xbt_free(fd->simdata);
+  xbt_free(fd->info);
   xbt_free(fd);
   return res;
 }
@@ -85,17 +149,21 @@ int MSG_file_close(msg_file_t fd)
  */
 int MSG_file_unlink(msg_file_t fd)
 {
-  return simcall_file_unlink(fd->simdata->smx_file);
+  int res = simcall_file_unlink(fd->simdata->smx_file);
+  free(fd->fullname);
+  xbt_free(fd->simdata);
+  xbt_free(fd->info);
+  xbt_free(fd);
+  return res;
 }
 
 /** \ingroup msg_file_management
  * \brief Return the size of a file
  *
  * \param fd is the file descriptor (#msg_file_t)
- * \return the size of the file (as a size_t)
+ * \return the size of the file (as a sg_storage_size_t)
  */
-
-size_t MSG_file_get_size(msg_file_t fd){
+sg_storage_size_t MSG_file_get_size(msg_file_t fd){
   return simcall_file_get_size(fd->simdata->smx_file);
 }
 
@@ -122,3 +190,153 @@ xbt_dict_t MSG_file_ls(const char *mount, const char *path)
 
   return simcall_file_ls(mount, path);
 }
+
+/********************************* Storage **************************************/
+
+/** @addtogroup msg_storage_management
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Storages" --> \endhtmlonly
+ * (#msg_storage_t) and the functions for managing it.
+ *
+ */
+
+
+/* TODO: PV: to comment */
+msg_storage_t __MSG_storage_create(smx_storage_t storage)
+{
+  const char *name = SIMIX_storage_get_name(storage);
+  msg_storage_priv_t storage_private = xbt_new0(s_msg_storage_priv_t, 1);
+  xbt_lib_set(storage_lib,name,MSG_STORAGE_LEVEL,storage_private);
+  return xbt_lib_get_elm_or_null(storage_lib, name);
+}
+
+/*
+ * \brief Destroys a storage (internal call only)
+ */
+void __MSG_storage_destroy(msg_storage_priv_t storage) {
+
+  free(storage);
+}
+
+/** \ingroup msg_storage_management
+ *
+ * \brief Returns the name of the #msg_storage_t.
+ *
+ * This functions checks whether a storage is a valid pointer or not and return its name.
+ */
+const char *MSG_storage_get_name(msg_storage_t storage) {
+  xbt_assert((storage != NULL), "Invalid parameters");
+  return SIMIX_storage_get_name(storage);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns the free space size of a storage element
+ * \param name the name of a storage
+ * \return the free space size of the storage element (as a sg_storage_size_t)
+ */
+sg_storage_size_t MSG_storage_get_free_size(const char* name){
+  return simcall_storage_get_free_size(name);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns the used space size of a storage element
+ * \param name the name of a storage
+ * \return the used space size of the storage element (as a sg_storage_size_t)
+ */
+sg_storage_size_t MSG_storage_get_used_size(const char* name){
+  return simcall_storage_get_used_size(name);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns a xbt_dict_t consisting of the list of properties assigned to this storage
+ * \param storage a storage
+ * \return a dict containing the properties
+ */
+xbt_dict_t MSG_storage_get_properties(msg_storage_t storage)
+{
+  xbt_assert((storage != NULL), "Invalid parameters (storage is NULL)");
+  return (simcall_storage_get_properties(storage));
+}
+
+/** \ingroup msg_storage_management
+ * \brief Change the value of a given storage property
+ *
+ * \param storage a storage
+ * \param name a property name
+ * \param value what to change the property to
+ * \param free_ctn the freeing function to use to kill the value on need
+ */
+void MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn) {
+  xbt_dict_set(MSG_storage_get_properties(storage), name, value,free_ctn);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Finds a msg_storage_t using its name.
+ * \param name the name of a storage
+ * \return the corresponding storage
+ */
+msg_storage_t MSG_storage_get_by_name(const char *name)
+{
+  return (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib,name);
+}
+
+/** \ingroup msg_storage_management
+ * \brief Returns a dynar containing all the storage elements declared at a given point of time
+ *
+ */
+xbt_dynar_t MSG_storages_as_dynar(void) {
+
+  xbt_lib_cursor_t cursor;
+  char *key;
+  void **data;
+  xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),NULL);
+
+  xbt_lib_foreach(storage_lib, cursor, key, data) {
+    if(routing_get_network_element_type(key) == MSG_STORAGE_LEVEL) {
+      xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor);
+      xbt_dynar_push(res, &elm);
+    }
+  }
+
+  return res;
+}
+
+/** \ingroup msg_storage_management
+ *
+ * \brief Set the user data of a #msg_storage_t.
+ * This functions checks whether some data has already been associated to \a storage
+   or not and attach \a data to \a storage if it is possible.
+ */
+msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data)
+{
+  SIMIX_storage_set_data(storage,data);
+
+  return MSG_OK;
+}
+
+/** \ingroup msg_host_management
+ *
+ * \brief Returns the user data of a #msg_storage_t.
+ *
+ * This functions checks whether \a storage is a valid pointer or not and returns
+   the user data associated to \a storage if it is possible.
+ */
+void *MSG_storage_get_data(msg_storage_t storage)
+{
+  return SIMIX_storage_get_data(storage);
+}
+
+/** \ingroup msg_storage_management
+ *
+ * \brief Returns the content (file list) of a #msg_storage_t.
+ * \param storage a storage
+ * \return The content of this storage element as a dict (full path file => size)
+ */
+xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
+{
+  return SIMIX_storage_get_content(storage);
+}
+
+sg_storage_size_t MSG_storage_get_size(msg_storage_t storage)
+{
+  return SIMIX_storage_get_size(storage);
+}
index f2eb97f..83840e5 100644 (file)
@@ -1,6 +1,6 @@
 /* Mailboxes in MSG */
 
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -240,7 +240,8 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task,
 
   /* Try to send it by calling SIMIX network layer */
   TRY {
-      smx_action_t comm = simcall_comm_isend(mailbox, t_simdata->message_size,
+    smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simix call  */
+    comm = simcall_comm_isend(mailbox, t_simdata->message_size,
                                   t_simdata->rate, task, sizeof(void *),
                                   NULL, NULL, task, 0);
 #ifdef HAVE_TRACING
index f587002..71c4c30 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b760f44..96dda60 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                                  */
 
 /* This program is free software; you can redistribute it and/or modify it
index 02af63d..f3e1b89 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -45,6 +45,11 @@ typedef struct simdata_file {
   smx_file_t smx_file;
 } s_simdata_file_t;
 
+/********************************* Storage **************************************/
+typedef struct simdata_storage {
+  smx_storage_t smx_storage;
+} s_simdata_storage_t;
+
 /*************** Begin GPU ***************/
 typedef struct simdata_gpu_task {
   double computation_amount;    /* Computation size */
@@ -136,7 +141,9 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 #endif
 
 msg_host_t __MSG_host_create(smx_host_t workstation);
+msg_storage_t __MSG_storage_create(smx_storage_t storage);
 void __MSG_host_destroy(msg_host_priv_t host);
+void __MSG_storage_destroy(msg_storage_priv_t host);
 
 void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc);
 void MSG_process_create_from_SIMIX(smx_process_t *process, const char *name,
index be51825..2cefbc7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg,
                                 "Logging specific to MSG (process)");
 
 /** @addtogroup m_process_management
- *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Processes" --> \endhtmlonly
+ * \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Processes" --> \endhtmlonly
  *
  *  We need to simulate many independent scheduling decisions, so
  *  the concept of <em>process</em> is at the heart of the
@@ -46,12 +46,12 @@ void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc)
   TRACE_msg_process_end(smx_proc);
 #endif
   // free the data if a function was provided
-  if (msg_proc->data && msg_global->process_data_cleanup) {
+  if (msg_proc && msg_proc->data && msg_global->process_data_cleanup) {
     msg_global->process_data_cleanup(msg_proc->data);
   }
 
   // remove the process from its virtual machine
-  if (msg_proc->vm) {
+  if (msg_proc && msg_proc->vm) {
     int pos = xbt_dynar_search(msg_proc->vm->processes,&smx_proc);
     xbt_dynar_remove_at(msg_proc->vm->processes,pos, NULL);
   }
index f06e6bb..963fa9c 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013 Da SimGrid Team. All rights reserved.                 */
+/* Copyright (c) 2013. 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. */
index a32e0d8..f104387 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1143525..d5bff35 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2012. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2012-2013. 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. */
index ef7b715..fdb6f48 100644 (file)
@@ -1,7 +1,7 @@
 /* portable -- header loading to write portable code                         */
 /* loads much more stuff than sysdep.h since the latter is in public interface*/
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e48de28..20cc654 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -69,6 +69,13 @@ static inline SD_workstation_priv_t SD_workstation_priv(SD_workstation_t host){
   return xbt_lib_get_level(host, SD_HOST_LEVEL);
 }
 
+/* Storage */
+typedef s_xbt_dictelm_t s_SD_storage_t;
+typedef struct SD_storage {
+  void *data;                   /* user data */
+} s_SD_storage_priv_t, *SD_storage_priv_t;
+
+
 /* Task */
 typedef struct SD_task {
   s_xbt_swag_hookup_t state_hookup;
@@ -199,6 +206,11 @@ static XBT_INLINE int __SD_task_is_running(SD_task_t task)
 {
   return task->state_set == sd_global->running_task_set;
 }
+
+/********** Storage **********/
+SD_storage_t __SD_storage_create(void *surf_storage, void *data);
+void __SD_storage_destroy(void *storage);
+
 /********** Tracing **********/
 /* declaration of instrumentation functions from sd_task_instr.c */
 void TRACE_sd_task_create(SD_task_t task);
index 1ef9172..287cb9c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7842834..f635a0f 100644 (file)
@@ -117,8 +117,6 @@ xbt_dynar_t SD_dotload_with_sched(const char *filename) {
   }else{
     XBT_WARN("The scheduling is ignored");
   }
-  SD_task_t task;
-  unsigned int count;
   xbt_dynar_t computer = NULL;
   xbt_dict_cursor_t dict_cursor;
   char *computer_name;
@@ -126,9 +124,7 @@ xbt_dynar_t SD_dotload_with_sched(const char *filename) {
     xbt_dynar_free(&computer);
   }
   xbt_dict_free(&computers);
-  xbt_dynar_foreach(result,count,task){
-     SD_task_destroy(task);
-  }
+  xbt_dynar_free(&result);
   return NULL;
 }
 
index e520864..5927386 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -95,8 +95,27 @@ void SD_init(int *argc, char **argv)
   XBT_DEBUG("ADD SD LEVELS");
   SD_HOST_LEVEL = xbt_lib_add_level(host_lib,__SD_workstation_destroy);
   SD_LINK_LEVEL = xbt_lib_add_level(link_lib,__SD_link_destroy);
+  SD_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,__SD_storage_destroy);
+
+  if (_sg_cfg_exit_asap) {
+    SD_exit();
+    exit(0);
+  }
 }
 
+/** \brief set a configuration variable
+ *
+ * Do --help on any simgrid binary to see the list of currently existing configuration variables, and see Section @ref options.
+ *
+ * Example:
+ * SD_config("workstation/model","default");
+ */
+void SD_config(const char *key, const char *value){
+  xbt_assert(sd_global,"ERROR: Please call SD_init() before using SD_config()");
+  xbt_cfg_set_as_string(_sg_cfg_set, key, value);
+}
+
+
 /**
  * \brief Reinits the application part of the simulation (experimental feature)
  *
@@ -191,10 +210,11 @@ void SD_create_environment(const char *platform_file)
   char *name = NULL;
   void **surf_workstation = NULL;
   void **surf_link = NULL;
+  void **surf_storage = NULL;
 
   parse_platform_file(platform_file);
 
-  /* now let's create the SD wrappers for workstations and links */
+  /* now let's create the SD wrappers for workstations, storages and links */
   xbt_lib_foreach(host_lib, cursor, name, surf_workstation){
     if(surf_workstation[SURF_WKS_LEVEL])
       __SD_workstation_create(surf_workstation[SURF_WKS_LEVEL], NULL);
@@ -205,6 +225,12 @@ void SD_create_environment(const char *platform_file)
     __SD_link_create(surf_link[SURF_LINK_LEVEL], NULL);
   }
 
+  xbt_lib_foreach(storage_lib, cursor, name, surf_storage) {
+  if(surf_storage[SURF_STORAGE_LEVEL])
+    __SD_storage_create(surf_storage[SURF_STORAGE_LEVEL], NULL);
+  }
+
+
   XBT_DEBUG("Workstation number: %d, link number: %d",
          SD_workstation_get_number(), SD_link_get_number());
 #ifdef HAVE_JEDULE
index 65d1507..f5e993d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2011. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6465616..ea42489 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006 - 2013. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -172,8 +172,8 @@ return res;
  * mandatory power.
  *
  * A parallel computation can be scheduled on any number of host.
- * The underlying speedup model is Amdahl's law. 
- * To be auto-scheduled, \see SD_task_distribute_comp_amdhal has to be called 
+ * The underlying speedup model is Amdahl's law.
+ * To be auto-scheduled, \see SD_task_distribute_comp_amdahl has to be called
  * first.
  * \param name the name of the task (can be \c NULL)
  * \param data the user data you want to associate with the task (can be \c NULL)
@@ -474,7 +474,27 @@ double SD_task_get_amount(SD_task_t task)
 }
 
 /**
- * \brief Returns the alpha parameter of a SD_TASK_COMP_PAR_AMDAH task
+ * \brief Sets the total amount of work of a task
+ * For sequential typed tasks (COMP_SEQ and COMM_E2E), it also sets the
+ * appropriate values in the computation_amount and communication_amount arrays
+ * respectively. Nothing more than modifying task->amount is done for paralle
+ * typed tasks (COMP_PAR_AMDAHL and COMM_PAR_MXN_1D_BLOCK) as the distribution
+ * of the amount of work is done at scheduling time.
+ *
+ * \param task a task
+ * \param amount the new amount of work to execute
+ */
+void SD_task_set_amount(SD_task_t task, double amount)
+{
+  task->amount = amount;
+  if (task->kind == SD_TASK_COMP_SEQ)
+    task->computation_amount[0] = amount;
+  if (task->kind == SD_TASK_COMM_E2E)
+    task->communication_amount[2] = amount;
+}
+
+/**
+ * \brief Returns the alpha parameter of a SD_TASK_COMP_PAR_AMDAHL task
  *
  * \param task a parallel task assuming Amdahl's law as speedup model
  * \return the alpha parameter (serial part of a task in percent) for this task
@@ -1405,7 +1425,7 @@ double SD_task_get_finish_time(SD_task_t task)
 /** @brief Blah
  *
  */
-void SD_task_distribute_comp_amdhal(SD_task_t task, int ws_count)
+void SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count)
 {
   int i;
   xbt_assert(task->kind == SD_TASK_COMP_PAR_AMDAHL,
@@ -1457,7 +1477,7 @@ void SD_task_schedulev(SD_task_t task, int count,
               SD_task_get_name(task));
   switch (task->kind) {
   case SD_TASK_COMP_PAR_AMDAHL:
-    SD_task_distribute_comp_amdhal(task, count);
+    SD_task_distribute_comp_amdahl(task, count);
   case SD_TASK_COMM_E2E:
   case SD_TASK_COMP_SEQ:
     xbt_assert(task->workstation_nb == count,
@@ -1534,7 +1554,7 @@ void SD_task_schedulev(SD_task_t task, int count,
    * located (and start them if runnable) */
   if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
     XBT_VERB("Schedule computation task %s on %d workstations. %.f flops"
-             " will be distributed following Amdahl'Law",
+             " will be distributed following Amdahl'Law",
           SD_task_get_name(task), task->workstation_nb,
           task->computation_amount[0]);
     xbt_dynar_foreach(task->tasks_before, cpt, dep) {
index d73d59e..f868b59 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2011. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -35,6 +35,32 @@ SD_workstation_t __SD_workstation_create(void *surf_workstation,
   return xbt_lib_get_elm_or_null(host_lib,name);
 }
 
+/* Creates a storage and registers it in SD.
+ */
+SD_storage_t __SD_storage_create(void *surf_storage, void *data)
+{
+
+  SD_storage_priv_t storage;
+  const char *name;
+
+  storage = xbt_new(s_SD_storage_priv_t, 1);
+  storage->data = data;     /* user data */
+
+  name = surf_resource_name(surf_storage);
+  xbt_lib_set(storage_lib,name, SD_STORAGE_LEVEL, storage);
+  return xbt_lib_get_elm_or_null(storage_lib, name);
+}
+
+/* Destroys a storage.
+ */
+void __SD_storage_destroy(void *storage)
+{
+  SD_storage_priv_t s;
+
+  s = (SD_storage_priv_t) storage;
+  xbt_free(s);
+}
+
 /**
  * \brief Returns a workstation given its name
  *
@@ -273,7 +299,7 @@ double SD_workstation_get_available_power(SD_workstation_t workstation)
  *
  * \param workstation a workstation
  * \param computation_amount the computation amount you want to evaluate (in flops)
- * \return an approximative astimated computation time for the given computation amount on this workstation (in seconds)
+ * \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
  */
 double SD_workstation_get_computation_time(SD_workstation_t workstation,
                                            double computation_amount)
@@ -333,8 +359,7 @@ double SD_route_get_current_bandwidth(SD_workstation_t src,
 
   links = SD_route_get_list(src, dst);
   nb_links = SD_route_get_size(src, dst);
-  bandwidth = min_bandwidth = -1.0;
-
+  min_bandwidth = -1.0;
 
   for (i = 0; i < nb_links; i++) {
     bandwidth = SD_link_get_current_bandwidth(links[i]);
@@ -352,7 +377,7 @@ double SD_route_get_current_bandwidth(SD_workstation_t src,
  * \param src the first workstation
  * \param dst the second workstation
  * \param communication_amount the communication amount you want to evaluate (in bytes)
- * \return an approximative astimated computation time for the given communication amount
+ * \return an approximative estimated computation time for the given communication amount
  * between the workstations (in seconds)
  */
 double SD_route_get_communication_time(SD_workstation_t src,
@@ -445,6 +470,16 @@ void SD_workstation_set_access_mode(SD_workstation_t workstation,
   }
 }
 
+/**
+ * \brief Return the list of mounted storages on a workstation.
+ *
+ * \param workstation a workstation
+ * \return a dynar containing all mounted storages on the workstation
+ */
+xbt_dict_t SD_workstation_get_storage_list(SD_workstation_t workstation){
+  return surf_workstation_get_storage_list(workstation);
+}
+
 /* Returns whether a task can start now on a workstation*/
 /*
   int __SD_workstation_can_start(SD_workstation_t workstation, SD_task_t task) {
index 56c1120..e2a11b9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,7 +11,7 @@
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
 #include "xbt/str.h"
-#include "xbt/lib.h" 
+#include "xbt/lib.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 #include "surf/maxmin.h"
@@ -27,10 +27,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
 
 xbt_cfg_t _sg_cfg_set = NULL;
 
-int _sg_init_status = 0;      /* 0: beginning of time (config cannot be changed yet);
-                                  1: initialized: cfg_set created (config can now be changed);
-                                  2: configured: command line parsed and config part of platform file was integrated also, platform construction ongoing or done.
-                                     (Config cannot be changed anymore!) */
+/* 0: beginning of time (config cannot be changed yet);
+ * 1: initialized: cfg_set created (config can now be changed);
+ * 2: configured: command line parsed and config part of platform file was
+ *    integrated also, platform construction ongoing or done.
+ *    (Config cannot be changed anymore!)
+ */
+int _sg_cfg_init_status = 0;
+
+/* instruct the upper layer (simix or simdag) to exit as soon as possible
+ */
+int _sg_cfg_exit_asap = 0;
+
+#define sg_cfg_exit_early() do { _sg_cfg_exit_asap = 1; return; } while (0)
 
 /* Parse the command line, looking for options */
 static void sg_config_cmd_line(int *argc, char **argv)
@@ -93,10 +102,8 @@ static void sg_config_cmd_line(int *argc, char **argv)
     argv[j] = NULL;
     *argc = j;
   }
-  if (shall_exit) {
-    _sg_init_status=1; // get everything cleanly cleaned on exit
-    exit(0);
-  }
+  if (shall_exit)
+    sg_cfg_exit_early();
 }
 
 /* callback of the workstation/model variable */
@@ -104,14 +111,14 @@ static void _sg_cfg_cb__workstation_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     model_help("workstation", surf_workstation_model_description);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* Make sure that the model exists */
@@ -123,14 +130,14 @@ static void _sg_cfg_cb__cpu_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     model_help("CPU", surf_cpu_model_description);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* New Module missing */
@@ -142,14 +149,14 @@ static void _sg_cfg_cb__optimization_mode(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     model_help("optimization", surf_optimization_mode_description);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* New Module missing */
@@ -161,14 +168,14 @@ static void _sg_cfg_cb__storage_mode(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     model_help("storage", surf_storage_model_description);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* New Module missing */
@@ -180,21 +187,20 @@ static void _sg_cfg_cb__network_model(const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     model_help("network", surf_network_model_description);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* New Module missing */
   find_model_description(surf_network_model_description, val);
 }
 
-
 /* callbacks of the network models values */
 static void _sg_cfg_cb__tcp_gamma(const char *name, int pos)
 {
@@ -229,19 +235,19 @@ static void _sg_cfg_cb__weight_S(const char *name, int pos)
 #ifdef HAVE_SMPI
 /* callback of the mpi collectives */
 static void _sg_cfg_cb__coll(const char *category,
-                            s_mpi_coll_description_t * table,
-                            const char *name, int pos)
+                             s_mpi_coll_description_t * table,
+                             const char *name, int pos)
 {
   char *val;
 
-  xbt_assert(_sg_init_status == 1,
+  xbt_assert(_sg_cfg_init_status < 2,
               "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sg_cfg_set, name);
 
   if (!strcmp(val, "help")) {
     coll_help(category, table);
-    exit(0);
+    sg_cfg_exit_early();
   }
 
   /* New Module missing */
@@ -262,19 +268,19 @@ static void _sg_cfg_cb__coll_allreduce(const char *name, int pos)
 }
 static void _sg_cfg_cb__coll_alltoall(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos);  
+  _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos);
 }
 static void _sg_cfg_cb__coll_alltoallv(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos);  
+  _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos);
 }
 static void _sg_cfg_cb__coll_bcast(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos);  
+  _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos);
 }
 static void _sg_cfg_cb__coll_reduce(const char *name, int pos)
 {
-  _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);  
+  _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);
 }
 static void _sg_cfg_cb__coll_reduce_scatter(const char *name, int pos){
   _sg_cfg_cb__coll("reduce_scatter", mpi_coll_reduce_scatter_description, name, pos);
@@ -318,8 +324,15 @@ static void _sg_cfg_cb_verbose_exit(const char *name, int pos)
   _sg_do_verbose_exit = xbt_cfg_get_boolean(_sg_cfg_set, name);
 }
 
+extern int _sg_do_clean_atexit;
 
-static void _sg_cfg_cb_context_factory(const char *name, int pos) {
+static void _sg_cfg_cb_clean_atexit(const char *name, int pos)
+{
+  _sg_do_clean_atexit = xbt_cfg_get_boolean(_sg_cfg_set, name);
+}
+
+static void _sg_cfg_cb_context_factory(const char *name, int pos)
+{
   smx_context_factory_name = xbt_cfg_get_string(_sg_cfg_set, name);
 }
 
@@ -353,12 +366,12 @@ static void _sg_cfg_cb_contexts_parallel_mode(const char *name, int pos)
   }
   else {
     xbt_die("Command line setting of the parallel synchronization mode should "
-        "be one of \"posix\", \"futex\" or \"busy_wait\"");
+            "be one of \"posix\", \"futex\" or \"busy_wait\"");
   }
 }
 
 static void _sg_cfg_cb__surf_network_coordinates(const char *name,
-                                                   int pos)
+                                                 int pos)
 {
   int val = xbt_cfg_get_boolean(_sg_cfg_set, name);
   if (val) {
@@ -392,14 +405,12 @@ static void _sg_cfg_cb__gtnets_jitter_seed(const char *name, int pos)
 /* create the config set, register what should be and parse the command line*/
 void sg_config_init(int *argc, char **argv)
 {
-  char *description = xbt_malloc(1024), *p = description;
-  char *default_value;
-  double double_default_value;
-  int default_value_int;
+  char *description = xbt_malloc(1024);
+  char *p;
   int i;
 
   /* Create the configuration support */
-  if (_sg_init_status == 0) { /* Only create stuff if not already inited */
+  if (_sg_cfg_init_status == 0) { /* Only create stuff if not already inited */
     sprintf(description,
             "The model to use for the CPU. Possible values: ");
     p = description;
@@ -409,22 +420,19 @@ void sg_config_init(int *argc, char **argv)
                    surf_cpu_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("Cas01");
-    xbt_cfg_register(&_sg_cfg_set, "cpu/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
+    xbt_cfg_register(&_sg_cfg_set, "cpu/model", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/model", "Cas01");
 
-    sprintf(description,
-            "The optimization modes to use for the CPU. Possible values: ");
-    p = description;
     while (*(++p) != '\0');
     for (i = 0; surf_optimization_mode_description[i].name; i++)
       p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
                    surf_optimization_mode_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each optimization mode)");
-    default_value = xbt_strdup("Lazy");
-    xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/optim", "Lazy");
 
     sprintf(description,
             "The model to use for the storage. Possible values: ");
@@ -435,10 +443,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_storage_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
-    xbt_cfg_register(&_sg_cfg_set, "storage/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
-                     NULL);
+    xbt_cfg_register(&_sg_cfg_set, "storage/model", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__storage_mode, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "storage/model", "default");
 
     sprintf(description,
             "The model to use for the network. Possible values: ");
@@ -449,10 +456,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_network_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("LV08");
-    xbt_cfg_register(&_sg_cfg_set, "network/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__network_model,
-                     NULL);
+    xbt_cfg_register(&_sg_cfg_set, "network/model", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__network_model, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "network/model", "LV08");
 
     sprintf(description,
             "The optimization modes to use for the network. Possible values: ");
@@ -463,9 +469,9 @@ void sg_config_init(int *argc, char **argv)
                    surf_optimization_mode_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each optimization mode)");
-    default_value = xbt_strdup("Lazy");
-    xbt_cfg_register(&_sg_cfg_set, "network/optim", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_register(&_sg_cfg_set, "network/optim", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "network/optim", "Lazy");
 
     sprintf(description,
             "The model to use for the workstation. Possible values: ");
@@ -476,238 +482,217 @@ void sg_config_init(int *argc, char **argv)
                    surf_workstation_model_description[i].name);
     sprintf(p,
             ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
-    xbt_cfg_register(&_sg_cfg_set, "workstation/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1,
-                     &_sg_cfg_cb__workstation_model, NULL);
-
-    xbt_free(description);
+    xbt_cfg_register(&_sg_cfg_set, "workstation/model", description,
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__workstation_model, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "workstation/model", "default");
 
     xbt_cfg_register(&_sg_cfg_set, "network/TCP_gamma",
                      "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; Use the last given value, which is the max window size)",
-                     xbt_cfgelm_double, NULL, 1, 1,
-                     _sg_cfg_cb__tcp_gamma, NULL);
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__tcp_gamma, NULL);
     xbt_cfg_setdefault_double(_sg_cfg_set, "network/TCP_gamma", 4194304.0);
 
     xbt_cfg_register(&_sg_cfg_set, "maxmin/precision",
                      "Numerical precision used when updating simulation models (epsilon in double comparisons)",
-                     xbt_cfgelm_double, NULL, 1, 1, _sg_cfg_cb__maxmin_precision, NULL);
-    xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001); 
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__maxmin_precision, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001);
 
     /* The parameters of network models */
 
     xbt_cfg_register(&_sg_cfg_set, "network/sender_gap",
                      "Minimum gap between two overlapping sends",
-                     xbt_cfgelm_double, NULL, 1, 1, /* default is set in network.c */
-                     _sg_cfg_cb__sender_gap, NULL);
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__sender_gap, NULL);
+    /* default for "network/sender_gap" is set in network.c */
 
-    double_default_value = 1.0; // FIXME use setdefault everywhere here!
     xbt_cfg_register(&_sg_cfg_set, "network/latency_factor",
                      "Correction factor to apply to the provided latency (default value set by network model)",
-                     xbt_cfgelm_double, &double_default_value, 1, 1,
-                     _sg_cfg_cb__latency_factor, NULL);
-    double_default_value = 1.0;
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__latency_factor, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
+
     xbt_cfg_register(&_sg_cfg_set, "network/bandwidth_factor",
                      "Correction factor to apply to the provided bandwidth (default value set by network model)",
-                     xbt_cfgelm_double, &double_default_value, 1, 1,
-                     _sg_cfg_cb__bandwidth_factor, NULL);
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__bandwidth_factor, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor", 1.0);
 
     xbt_cfg_register(&_sg_cfg_set, "network/weight_S",
                      "Correction factor to apply to the weight of competing streams (default value set by network model)",
-                     xbt_cfgelm_double, NULL, 1, 1, /* default is set in network.c */
-                     _sg_cfg_cb__weight_S, NULL);
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__weight_S, NULL);
+    /* default for "network/weight_S" is set in network.c */
 
     /* Inclusion path */
     xbt_cfg_register(&_sg_cfg_set, "path",
                      "Lookup path for inclusions in platform and deployment XML files",
-                     xbt_cfgelm_string, NULL, 0, 0,
-                     _sg_cfg_cb__surf_path, NULL);
+                     xbt_cfgelm_string, 0, 0, _sg_cfg_cb__surf_path, NULL);
 
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "cpu/maxmin_selective_update",
                      "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
-                     NULL, NULL);
-    default_value = xbt_strdup("off");
+                     xbt_cfgelm_boolean, 0, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "cpu/maxmin_selective_update", "no");
+
     xbt_cfg_register(&_sg_cfg_set, "network/maxmin_selective_update",
                      "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
-                     NULL, NULL);
+                     xbt_cfgelm_boolean, 0, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/maxmin_selective_update", "no");
 
 #ifdef HAVE_MC
     /* do model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check",
                      "Verify the system through model-checking instead of simulating it (EXPERIMENTAL)",
-                     xbt_cfgelm_boolean, NULL, 0, 1,
-                     _sg_cfg_cb_model_check, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check", default_value);
+                     xbt_cfgelm_boolean, 0, 1, _sg_cfg_cb_model_check, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check", "no");
 
     /* do stateful model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check/checkpoint",
-                     "Specify the amount of steps between checkpoints during stateful model-checking (default: off => stateless verification). "
+                     "Specify the amount of steps between checkpoints during stateful model-checking (default: 0 => stateless verification). "
                      "If value=on, one checkpoint is saved for each step => faster verification, but huge memory consumption; higher values are good compromises between speed and memory consumption.",
-                     xbt_cfgelm_boolean, NULL, 0, 1,
-                     _mc_cfg_cb_checkpoint, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/checkpoint", default_value);
-    
+                     xbt_cfgelm_int, 0, 1, _mc_cfg_cb_checkpoint, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/checkpoint", 0);
+
     /* do liveness model-checking */
     xbt_cfg_register(&_sg_cfg_set, "model-check/property",
                      "Specify the name of the file containing the property. It must be the result of the ltl2ba program.",
-                     xbt_cfgelm_string, NULL, 0, 1,
-                     _mc_cfg_cb_property, NULL);
+                     xbt_cfgelm_string, 0, 1, _mc_cfg_cb_property, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/property", "");
 
     /* Specify the kind of model-checking reduction */
     xbt_cfg_register(&_sg_cfg_set, "model-check/reduction",
                      "Specify the kind of exploration reduction (either none or DPOR)",
-                     xbt_cfgelm_string, NULL, 0, 1,
-                     _mc_cfg_cb_reduce, NULL);
+                     xbt_cfgelm_string, 0, 1, _mc_cfg_cb_reduce, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/reduction", "dpor");
 
     /* Enable/disable timeout for wait requests with model-checking */
-    default_value = xbt_strdup("off");
     xbt_cfg_register(&_sg_cfg_set, "model-check/timeout",
                      "Enable/Disable timeout for wait requests",
-                     xbt_cfgelm_boolean, NULL, 0, 1,
-                     _mc_cfg_cb_timeout, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/timeout", default_value);
+                     xbt_cfgelm_boolean, 0, 1, _mc_cfg_cb_timeout, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/timeout", "no");
 
     /* Set max depth exploration */
     xbt_cfg_register(&_sg_cfg_set, "model-check/max_depth",
                      "Specify the max depth of exploration (default : 1000)",
-                     xbt_cfgelm_int, NULL, 0, 1,
-                     _mc_cfg_cb_max_depth, NULL);
+                     xbt_cfgelm_int, 0, 1, _mc_cfg_cb_max_depth, NULL);
     xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/max_depth", 1000);
 
     /* Set number of visited state stored for state comparison reduction*/
     xbt_cfg_register(&_sg_cfg_set, "model-check/visited",
                      "Specify the number of visited state stored for state comparison reduction. If value=5, the last 5 visited states are stored",
-                     xbt_cfgelm_int, NULL, 0, 1,
-                     _mc_cfg_cb_visited, NULL);
+                     xbt_cfgelm_int, 0, 1, _mc_cfg_cb_visited, NULL);
     xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/visited", 0);
 
     /* Set file name for dot output of graph state */
     xbt_cfg_register(&_sg_cfg_set, "model-check/dot_output",
                      "Specify the name of dot file corresponding to graph state",
-                     xbt_cfgelm_string, NULL, 0, 1,
-                     _mc_cfg_cb_dot_output, NULL);
+                     xbt_cfgelm_string, 0, 1, _mc_cfg_cb_dot_output, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/dot_output", "");
 #endif
 
     /* do verbose-exit */
-    default_value = xbt_strdup("on");
     xbt_cfg_register(&_sg_cfg_set, "verbose-exit",
                      "Activate the \"do nothing\" mode in Ctrl-C",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
-                     _sg_cfg_cb_verbose_exit, NULL);
-    
-    
+                     xbt_cfgelm_boolean, 0, 1, _sg_cfg_cb_verbose_exit, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "verbose-exit", "yes");
+
     /* context factory */
-    default_value = xbt_strdup("ucontext");
-    xbt_cfg_register(&_sg_cfg_set, "contexts/factory",
-                     "Context factory to use in SIMIX (ucontext, thread or raw)",
-                     xbt_cfgelm_string, &default_value, 1, 1, _sg_cfg_cb_context_factory, NULL);
+    sprintf(description,
+            "Context factory to use in SIMIX. Possible values: thread");
+    const char *dflt_ctx_fact = "thread";
+#ifdef CONTEXT_UCONTEXT
+    strcat(description, ", ucontext");
+    dflt_ctx_fact = "ucontext";
+#endif
+#ifdef HAVE_RAWCTX
+    strcat(description, ", raw");
+    dflt_ctx_fact = "raw";
+#endif
+    strcat(description, ".");
+    xbt_cfg_register(&_sg_cfg_set, "contexts/factory", description,
+                     xbt_cfgelm_string, 1, 1, _sg_cfg_cb_context_factory, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", dflt_ctx_fact);
 
     /* stack size of contexts in Ko */
-    default_value_int = 128;
     xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size",
-                     "Stack size of contexts in Kib (ucontext or raw only)",
-                     xbt_cfgelm_int, &default_value_int, 1, 1,
-                     _sg_cfg_cb_context_stack_size, NULL);
+                     "Stack size of contexts in Kib",
+                     xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_stack_size, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/stack_size", 128);
 
     /* number of parallel threads for user processes */
-    default_value_int = 1;
     xbt_cfg_register(&_sg_cfg_set, "contexts/nthreads",
                      "Number of parallel threads used to execute user contexts",
-                     xbt_cfgelm_int, &default_value_int, 1, 1,
-                     _sg_cfg_cb_contexts_nthreads, NULL);
+                     xbt_cfgelm_int, 1, 1, _sg_cfg_cb_contexts_nthreads, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/nthreads", 1);
 
     /* minimal number of user contexts to be run in parallel */
-    default_value_int = 2;
     xbt_cfg_register(&_sg_cfg_set, "contexts/parallel_threshold",
-        "Minimal number of user contexts to be run in parallel (raw contexts only)",
-        xbt_cfgelm_int, &default_value_int, 1, 1,
-        _sg_cfg_cb_contexts_parallel_threshold, NULL);
+                     "Minimal number of user contexts to be run in parallel (raw contexts only)",
+                     xbt_cfgelm_int, 1, 1, _sg_cfg_cb_contexts_parallel_threshold, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/parallel_threshold", 2);
 
     /* synchronization mode for parallel user contexts */
+    xbt_cfg_register(&_sg_cfg_set, "contexts/synchro",
+                     "Synchronization mode to use when running contexts in parallel (either futex, posix or busy_wait)",
+                     xbt_cfgelm_string, 1, 1, _sg_cfg_cb_contexts_parallel_mode, NULL);
 #ifdef HAVE_FUTEX_H
-    default_value = xbt_strdup("futex");
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "futex");
 #else //No futex on mac and posix is unimplememted yet
-    default_value = xbt_strdup("busy_wait");
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "busy_wait");
 #endif
-    xbt_cfg_register(&_sg_cfg_set, "contexts/synchro",
-        "Synchronization mode to use when running contexts in parallel (either futex, posix or busy_wait)",
-        xbt_cfgelm_string, &default_value, 1, 1,
-        _sg_cfg_cb_contexts_parallel_mode, NULL);
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "network/coordinates",
                      "\"yes\" or \"no\", specifying whether we use a coordinate-based routing (as Vivaldi)",
-                     xbt_cfgelm_boolean, &default_value, 1, 1,
-                     _sg_cfg_cb__surf_network_coordinates, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/coordinates", default_value);
+                     xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb__surf_network_coordinates, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/coordinates", "no");
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "network/crosstraffic",
                      "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)",
-                     xbt_cfgelm_boolean, &default_value, 0, 1,
-                     _sg_cfg_cb__surf_network_crosstraffic, NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", default_value);
+                     xbt_cfgelm_boolean, 0, 1, _sg_cfg_cb__surf_network_crosstraffic, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "no");
 
 #ifdef HAVE_GTNETS
     xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter",
                      "Double value to oscillate the link latency, uniformly in random interval [-latency*gtnets_jitter,latency*gtnets_jitter)",
-                     xbt_cfgelm_double, NULL, 1, 1,
-                     _sg_cfg_cb__gtnets_jitter, NULL);
+                     xbt_cfgelm_double, 1, 1, _sg_cfg_cb__gtnets_jitter, NULL);
     xbt_cfg_setdefault_double(_sg_cfg_set, "gtnets/jitter", 0.0);
 
-    default_value_int = 10;
     xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter_seed",
                      "Use a positive seed to reproduce jitted results, value must be in [1,1e8], default is 10",
-                     xbt_cfgelm_int, &default_value_int, 0, 1,
-                     _sg_cfg_cb__gtnets_jitter_seed, NULL);
+                     xbt_cfgelm_int, 0, 1, _sg_cfg_cb__gtnets_jitter_seed, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "gtnets/jitter_seed", 10);
 #endif
 #ifdef HAVE_NS3
     xbt_cfg_register(&_sg_cfg_set, "ns3/TcpModel",
                      "The ns3 tcp model can be : NewReno or Reno or Tahoe",
-                     xbt_cfgelm_string, NULL, 1, 1,
-                     NULL, NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "ns3/TcpModel", "default");
 #endif
 
 #ifdef HAVE_SMPI
-    double default_reference_speed = 20000.0;
     xbt_cfg_register(&_sg_cfg_set, "smpi/running_power",
                      "Power of the host running the simulation (in flop/s). Used to bench the operations.",
-                     xbt_cfgelm_double, &default_reference_speed, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_double, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/running_power", 20000.0);
 
-    default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "smpi/display_timing",
                      "Boolean indicating whether we should display the timing after simulation.",
-                     xbt_cfgelm_boolean, &default_value, 1, 1, NULL,
-                     NULL);
-    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", default_value);
+                     xbt_cfgelm_boolean, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", "no");
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/use_shared_malloc",
+                     "Boolean indicating whether we should use shared memory when using SMPI_SHARED_MALLOC. Allows user to disable it for debug purposes.",
+                     xbt_cfgelm_boolean, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/use_shared_malloc", "yes");
 
-    double default_threshold = 1e-6;
     xbt_cfg_register(&_sg_cfg_set, "smpi/cpu_threshold",
                      "Minimal computation time (in seconds) not discarded.",
-                     xbt_cfgelm_double, &default_threshold, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_double, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/cpu_threshold", 1e-6);
 
-    int default_small_messages_threshold = 0;
     xbt_cfg_register(&_sg_cfg_set, "smpi/async_small_thres",
                      "Maximal size of messages that are to be sent asynchronously, without waiting for the receiver",
-                     xbt_cfgelm_int, &default_small_messages_threshold, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_int, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thres", 0);
 
-    int default_send_is_detached_threshold = 65536;
     xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
                      "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
-                     xbt_cfgelm_int, &default_send_is_detached_threshold, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_int, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
 
     //For smpi/bw_factor and smpi/lat_factor
     //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
@@ -716,102 +701,89 @@ void sg_config_init(int *argc, char **argv)
     //  or with tag config put line <prop id="smpi/bw_factor" value="threshold0:value0;threshold1:value1;...;thresholdN:valueN"></prop>
     xbt_cfg_register(&_sg_cfg_set, "smpi/bw_factor",
                      "Bandwidth factors for smpi.",
-                     xbt_cfgelm_string, NULL, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/bw_factor", "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;1426:0.608902;732:0.341987;257:0.338112;0:0.812084");
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/lat_factor",
                      "Latency factors for smpi.",
-                     xbt_cfgelm_string, NULL, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/lat_factor", "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;1426:1.61075;732:1.9503;257:1.95341;0:2.01467");
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/os",
                      "Small messages timings (MPI_Send minimum time for small messages)",
-                     xbt_cfgelm_string, NULL, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/os", "1:0:0:0:0");
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/ois",
                      "Small messages timings (MPI_Isend minimum time for small messages)",
-                     xbt_cfgelm_string, NULL, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/ois", "1:0:0:0:0");
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/or",
                      "Small messages timings (MPI_Recv minimum time for small messages)",
-                     xbt_cfgelm_string, NULL, 1, 1, NULL,
-                     NULL);
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0");
-    double default_iprobe_time = 1e-4;
     xbt_cfg_register(&_sg_cfg_set, "smpi/iprobe",
                      "Minimum time to inject inside a call to MPI_Iprobe",
-                     xbt_cfgelm_double, &default_iprobe_time, 1, 1, NULL,
-                     NULL);
-    default_value = xbt_strdup("default");
+                     xbt_cfgelm_double, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/iprobe", 1e-4);
     xbt_cfg_register(&_sg_cfg_set, "smpi/coll_selector",
-                    "Which collective selector to use",
-                    xbt_cfgelm_string, &default_value, 1, 1, NULL,
-                    NULL);
-                    
-               xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
-                    "Which collective to use for gather",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_gather,
-                    NULL);
-                    
+                     "Which collective selector to use",
+                     xbt_cfgelm_string, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/coll_selector", "default");
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
+                     "Which collective to use for gather",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_gather, NULL);
+
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgather",
-                    "Which collective to use for allgather",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgather,
-                    NULL);
+                     "Which collective to use for allgather",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_allgather, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/barrier",
-                    "Which collective to use for barrier",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_barrier,
-                    NULL);
+                     "Which collective to use for barrier",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_barrier, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/reduce_scatter",
-                    "Which collective to use for reduce_scatter",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce_scatter,
-                    NULL);
+                     "Which collective to use for reduce_scatter",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_reduce_scatter, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/scatter",
-                    "Which collective to use for scatter",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_scatter,
-                    NULL);
+                     "Which collective to use for scatter",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_scatter, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgatherv",
-                    "Which collective to use for allgatherv",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgatherv,
-                    NULL);
+                     "Which collective to use for allgatherv",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_allgatherv, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/allreduce",
-                    "Which collective to use for allreduce",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allreduce,
-                    NULL);
+                     "Which collective to use for allreduce",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_allreduce, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoall",
-                    "Which collective to use for alltoall",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoall,
-                    NULL);
+                     "Which collective to use for alltoall",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_alltoall, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoallv",
-                    "Which collective to use for alltoallv",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoallv,
-                    NULL);
+                     "Which collective to use for alltoallv",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_alltoallv, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/bcast",
-                    "Which collective to use for bcast",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_bcast,
-                    NULL);
+                     "Which collective to use for bcast",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_bcast, NULL);
 
     xbt_cfg_register(&_sg_cfg_set, "smpi/reduce",
-                    "Which collective to use for reduce",
-                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce,
-                    NULL);
+                     "Which collective to use for reduce",
+                     xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__coll_reduce, NULL);
 #endif // HAVE_SMPI
 
+    xbt_cfg_register(&_sg_cfg_set, "clean_atexit",
+                     "\"yes\" or \"no\". \"yes\" enables all the cleanups of SimGrid (XBT,SIMIX,MSG) to be registered with atexit. \"no\" may be useful if your code segfaults when calling the exit function.",
+                     xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_clean_atexit, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "clean_atexit", "yes");
+
     if (!surf_path) {
-      /* retrieves the current directory of the        current process */
+      /* retrieves the current directory of the current process */
       const char *initial_path = __surf_get_initial_path();
       xbt_assert((initial_path),
                   "__surf_get_initial_path() failed! Can't resolves current Windows directory");
@@ -820,7 +792,7 @@ void sg_config_init(int *argc, char **argv)
       xbt_cfg_setdefault_string(_sg_cfg_set, "path", initial_path);
     }
 
-    _sg_init_status = 1;
+    _sg_cfg_init_status = 1;
 
     sg_config_cmd_line(argc, argv);
 
@@ -829,21 +801,23 @@ void sg_config_init(int *argc, char **argv)
   } else {
     XBT_WARN("Call to sg_config_init() after initialization ignored");
   }
+
+  xbt_free(description);
 }
 
 void sg_config_finalize(void)
 {
-  if (!_sg_init_status)
+  if (!_sg_cfg_init_status)
     return;                     /* Not initialized yet. Nothing to do */
 
   xbt_cfg_free(&_sg_cfg_set);
-  _sg_init_status = 0;
+  _sg_cfg_init_status = 0;
 }
 
 /* Pick the right models for CPU, net and workstation, and call their model_init_preparse */
 void surf_config_models_setup()
 {
-  char *workstation_model_name;
+  const char *workstation_model_name;
   int workstation_id = -1;
   char *network_model_name = NULL;
   char *cpu_model_name = NULL;
@@ -861,15 +835,12 @@ void surf_config_models_setup()
    * the right net/cpu models.
    */
 
-  if((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
-    !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
-    xbt_cfg_is_default_value(_sg_cfg_set, "workstation/model"))
-  {
-      const char *val = "compound";
-      XBT_INFO
-          ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
-      xbt_cfg_set_string(_sg_cfg_set, "workstation/model", val);
-      workstation_model_name = (char *) "compound";
+  if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
+       !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
+      xbt_cfg_is_default_value(_sg_cfg_set, "workstation/model")) {
+    XBT_INFO("Switching workstation model to compound since you changed the network and/or cpu model(s)");
+    workstation_model_name = "compound";
+    xbt_cfg_set_string(_sg_cfg_set, "workstation/model", workstation_model_name);
   }
 
   XBT_DEBUG("Workstation model: %s", workstation_model_name);
@@ -907,25 +878,30 @@ void surf_config_models_setup()
 
 int sg_cfg_get_int(const char* name)
 {
-       return xbt_cfg_get_int(_sg_cfg_set,name);
+  return xbt_cfg_get_int(_sg_cfg_set,name);
 }
+
 double sg_cfg_get_double(const char* name)
 {
-       return xbt_cfg_get_double(_sg_cfg_set,name);
+  return xbt_cfg_get_double(_sg_cfg_set,name);
 }
+
 char* sg_cfg_get_string(const char* name)
 {
-       return xbt_cfg_get_string(_sg_cfg_set,name);
+  return xbt_cfg_get_string(_sg_cfg_set,name);
 }
+
 int sg_cfg_get_boolean(const char* name)
 {
-       return xbt_cfg_get_boolean(_sg_cfg_set,name);
+  return xbt_cfg_get_boolean(_sg_cfg_set,name);
 }
+
 void sg_cfg_get_peer(const char *name, char **peer, int *port)
 {
-       xbt_cfg_get_peer(_sg_cfg_set,name, peer, port);
+  xbt_cfg_get_peer(_sg_cfg_set,name, peer, port);
 }
+
 xbt_dynar_t sg_cfg_get_dynar(const char* name)
 {
-       return xbt_cfg_get_dynar(_sg_cfg_set,name);
+  return xbt_cfg_get_dynar(_sg_cfg_set,name);
 }
index 4ad29b0..a7b145f 100644 (file)
@@ -12,7 +12,7 @@ Shiny side: glance at interface
 
 It uses a new simix context factory: state_machine. Each user process
 is a state machine. There is no system mystery such as pthread or
-ucontextes to save its stack. As a result, there is no stack. Each
+ucontexts to save its stack. As a result, there is no stack. Each
 user process only have a user-provided structure describing its state,
 and only compute its next state based on that. Your main() can be as
 simple as:
@@ -35,7 +35,7 @@ simple as:
              the structure describing a process.
 
 This way of organizing the code saves a *huge amount* of memory
-(regular contextes have 128kb stacks per user process, threads are
+(regular contexts have 128kb stacks per user process, threads are
 even more expensive) and greatly speeds things up (there is absolutely
 no nothing to ask to the system, and everything can be done in user
 space).
index 64891fd..e638bb7 100644 (file)
@@ -1,6 +1,6 @@
 /* a fast and simple context switching library                              */
 
-/* Copyright (c) 2009 - 2011. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -48,41 +48,32 @@ void SIMIX_context_mod_init(void)
     }
     else { /* use the factory specified by --cfg=contexts/factory:value */
 
-    if (smx_context_factory_name == NULL) {
-        /* use the default factory */
-  #ifdef HAVE_RAWCTX
-      SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
-  #elif CONTEXT_UCONTEXT
-    SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
-  #else
-    SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-  #endif
-    }
-    else if (!strcmp(smx_context_factory_name, "ucontext")) {
-        /* use ucontext */
+
+      if (!strcmp(smx_context_factory_name, "thread")) {
+        /* use os threads (either pthreads or windows ones) */
+        SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
+      }
 #ifdef CONTEXT_UCONTEXT
+      else if (!strcmp(smx_context_factory_name, "ucontext")) {
+        /* use ucontext */
         SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
-#else
-        xbt_die("The context factory 'ucontext' unavailable on your system");
-#endif
-      }
-      else if (!strcmp(smx_context_factory_name, "thread")) {
-  /* use os threads (either pthreads or windows ones) */
-        SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
       }
+#endif
+#ifdef HAVE_RAWCTX
       else if (!strcmp(smx_context_factory_name, "raw")) {
-  /* use raw contexts */
-  SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
+        /* use raw contexts */
+        SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
       }
+#endif
       else {
         XBT_ERROR("Invalid context factory specified. Valid factories on this machine:");
 #ifdef HAVE_RAWCTX
         XBT_ERROR("  raw: high performance context factory implemented specifically for SimGrid");
 #else
-        XBT_ERROR("  (raw contextes are disabled at compilation time on this machine -- check configure logs for details)");
+        XBT_ERROR("  (raw contexts are disabled at compilation time on this machine -- check configure logs for details)");
 #endif
 #ifdef CONTEXT_UCONTEXT
-        XBT_ERROR("  ucontext: classical system V contextes (implemented with makecontext, swapcontext and friends)");
+        XBT_ERROR("  ucontext: classical system V contexts (implemented with makecontext, swapcontext and friends)");
 #else
         XBT_ERROR("  (ucontext is disabled at compilation time on this machine -- check configure logs for details)");
 #endif
@@ -94,7 +85,7 @@ void SIMIX_context_mod_init(void)
 }
 
 /**
- * This function is call by SIMIX_clean() to finalize the context module.
+ * This function is called by SIMIX_clean() to finalize the context module.
  */
 void SIMIX_context_mod_exit(void)
 {
@@ -229,4 +220,3 @@ XBT_INLINE void SIMIX_context_set_current(smx_context_t context)
     smx_current_context_serial = context;
   }
 }
-
index 73bf557..7d386c9 100644 (file)
@@ -1,6 +1,6 @@
 /* context_base - Code factorization across context switching implementations */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 59533e9..829f47e 100644 (file)
@@ -1,6 +1,6 @@
-/* context_raw - fast context switching inspired from System V ucontextes   */
+/* context_raw - fast context switching inspired from System V ucontexts   */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -44,7 +44,86 @@ extern raw_stack_t raw_makecontext(char* malloced_stack, int stack_size,
                                    rawctx_entry_point_t entry_point, void* arg);
 extern void raw_swapcontext(raw_stack_t* old, raw_stack_t new);
 
-#ifdef PROCESSOR_i686
+#if PROCESSOR_x86_64
+__asm__ (
+#if defined(APPLE)
+   ".text\n"
+   ".globl _raw_makecontext\n"
+   "_raw_makecontext:\n"
+#elif defined(_WIN32)
+   ".text\n"
+   ".globl raw_makecontext\n"
+   "raw_makecontext:\n"
+#else
+   ".text\n"
+   ".globl raw_makecontext\n"
+   ".type raw_makecontext,@function\n"
+   "raw_makecontext:\n"/* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
+#endif
+   "   mov %rdi,%rax\n"      /* stack */
+   "   add %rsi,%rax\n"      /* size  */
+   "   movq $0,   -8(%rax)\n" /* @return for func */
+   "   mov %rdx,-16(%rax)\n" /* func */
+   "   mov %rcx,-24(%rax)\n" /* arg/rdi */
+   "   movq $0,  -32(%rax)\n" /* rsi */
+   "   movq $0,  -40(%rax)\n" /* rdx */
+   "   movq $0,  -48(%rax)\n" /* rcx */
+   "   movq $0,  -56(%rax)\n" /* r8  */
+   "   movq $0,  -64(%rax)\n" /* r9  */
+   "   movq $0,  -72(%rax)\n" /* rbp */
+   "   movq $0,  -80(%rax)\n" /* rbx */
+   "   movq $0,  -88(%rax)\n" /* r12 */
+   "   movq $0,  -96(%rax)\n" /* r13 */
+   "   movq $0, -104(%rax)\n" /* r14 */
+   "   movq $0, -112(%rax)\n" /* r15 */
+   "   sub $112,%rax\n"
+   "   ret\n"
+);
+
+__asm__ (
+#if defined(APPLE)
+   ".text\n"
+   ".globl _raw_swapcontext\n"
+   "_raw_swapcontext:\n"
+#elif defined(_WIN32)
+   ".text\n"
+   ".globl raw_swapcontext\n"
+   "raw_swapcontext:\n"
+#else
+   ".text\n"
+   ".globl raw_swapcontext\n"
+   ".type raw_swapcontext,@function\n"
+   "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
+#endif
+   "   push %rdi\n"
+   "   push %rsi\n"
+   "   push %rdx\n"
+   "   push %rcx\n"
+   "   push %r8\n"
+   "   push %r9\n"
+   "   push %rbp\n"
+   "   push %rbx\n"
+   "   push %r12\n"
+   "   push %r13\n"
+   "   push %r14\n"
+   "   push %r15\n"
+   "   mov %rsp,(%rdi)\n" /* old */
+   "   mov %rsi,%rsp\n" /* new */
+   "   pop %r15\n"
+   "   pop %r14\n"
+   "   pop %r13\n"
+   "   pop %r12\n"
+   "   pop %rbx\n"
+   "   pop %rbp\n"
+   "   pop %r9\n"
+   "   pop %r8\n"
+   "   pop %rcx\n"
+   "   pop %rdx\n"
+   "   pop %rsi\n"
+   "   pop %rdi\n"
+   "   ret\n"
+);
+#elif PROCESSOR_i686
 __asm__ (
 #if defined(APPLE) || defined(_WIN32)
    ".text\n"
@@ -96,86 +175,8 @@ __asm__ (
    "   popl %ebp\n"
    "   retl\n"
 );
-#elif PROCESSOR_x86_64
-__asm__ (
-#if defined(APPLE)
-   ".text\n"
-   ".globl _raw_makecontext\n"
-   "_raw_makecontext:\n"
-#elif defined(_WIN32)
-   ".text\n"
-   ".globl raw_makecontext\n"
-   "raw_makecontext:\n"
 #else
-   ".text\n"
-   ".globl raw_makecontext\n"
-   ".type raw_makecontext,@function\n"
-   "raw_makecontext:\n"/* Calling convention sets the arguments in rdi, rsi, rdx and rcx, respectively */
-#endif
-   "   movq %rdi,%rax\n"      /* stack */
-   "   addq %rsi,%rax\n"      /* size  */
-   "   movq $0,   -8(%rax)\n" /* @return for func */
-   "   movq %rdx,-16(%rax)\n" /* func */
-   "   movq %rcx,-24(%rax)\n" /* arg/rdi */
-   "   movq $0,  -32(%rax)\n" /* rsi */
-   "   movq $0,  -40(%rax)\n" /* rdx */
-   "   movq $0,  -48(%rax)\n" /* rcx */
-   "   movq $0,  -56(%rax)\n" /* r8  */
-   "   movq $0,  -64(%rax)\n" /* r9  */
-   "   movq $0,  -72(%rax)\n" /* rbp */
-   "   movq $0,  -80(%rax)\n" /* rbx */
-   "   movq $0,  -88(%rax)\n" /* r12 */
-   "   movq $0,  -96(%rax)\n" /* r13 */
-   "   movq $0, -104(%rax)\n" /* r14 */
-   "   movq $0, -112(%rax)\n" /* r15 */
-   "   subq $112,%rax\n"
-   "   retq\n"
-);
 
-__asm__ (
-#if defined(APPLE)
-   ".text\n"
-   ".globl _raw_swapcontext\n"
-   "_raw_swapcontext:\n"
-#elif defined(_WIN32)
-   ".text\n"
-   ".globl raw_swapcontext\n"
-   "raw_swapcontext:\n"
-#else
-   ".text\n"
-   ".globl raw_swapcontext\n"
-   ".type raw_swapcontext,@function\n"
-   "raw_swapcontext:\n" /* Calling convention sets the arguments in rdi and rsi, respectively */
-#endif
-   "   pushq %rdi\n"
-   "   pushq %rsi\n"
-   "   pushq %rdx\n"
-   "   pushq %rcx\n"
-   "   pushq %r8\n"
-   "   pushq %r9\n"
-   "   pushq %rbp\n"
-   "   pushq %rbx\n"
-   "   pushq %r12\n"
-   "   pushq %r13\n"
-   "   pushq %r14\n"
-   "   pushq %r15\n"
-   "   movq %rsp,(%rdi)\n" /* old */
-   "   movq %rsi,%rsp\n" /* new */
-   "   popq %r15\n"
-   "   popq %r14\n"
-   "   popq %r13\n"
-   "   popq %r12\n"
-   "   popq %rbx\n"
-   "   popq %rbp\n"
-   "   popq %r9\n"
-   "   popq %r8\n"
-   "   popq %rcx\n"
-   "   popq %rdx\n"
-   "   popq %rsi\n"
-   "   popq %rdi\n"
-   "   retq\n"
-);
-#else
 
 /* If you implement raw contexts for other processors, don't forget to
    update the definition of HAVE_RAWCTX in buildtools/Cmake/CompleteInFiles.cmake */
@@ -275,8 +276,8 @@ void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory)
 static int smx_ctx_raw_factory_finalize(smx_context_factory_t *factory)
 {
 #ifdef TIME_BENCH_PER_SR
-  XBT_CRITICAL("Total wasted time in %u SR: %lf", sr_count, time_wasted_sr);
-  XBT_CRITICAL("Total wasted time in %u SSR: %lf", ssr_count, time_wasted_ssr);
+  XBT_CRITICAL("Total wasted time in %u SR: %f", sr_count, time_wasted_sr);
+  XBT_CRITICAL("Total wasted time in %u SSR: %f", ssr_count, time_wasted_ssr);
 #endif
 
 #ifdef CONTEXT_THREADS
@@ -462,7 +463,7 @@ static void smx_ctx_raw_runall_serial(xbt_dynar_t processes)
     tmax = time_thread_ssr[t];
 
   for(cursor=0; cursor <= t; cursor++){
-    XBT_VERB("Time SSR thread %u = %lf (max %lf)", cursor, time_thread_ssr[cursor], tmax);
+    XBT_VERB("Time SSR thread %u = %f (max %f)", cursor, time_thread_ssr[cursor], tmax);
     time_wasted_ssr += tmax - time_thread_ssr[cursor];
   }
 }
@@ -480,7 +481,7 @@ void smx_ctx_raw_new_sr(void)
   }
 
   for(i=0; i < NUM_THREADS; i++){
-    XBT_VERB("Time SR thread %u = %lf (max %lf)", i, time_thread_sr[i], tmax);
+    XBT_VERB("Time SR thread %u = %f (max %f)", i, time_thread_sr[i], tmax);
     time_wasted_sr += tmax - time_thread_sr[i];
   }
 
@@ -571,7 +572,7 @@ static void smx_ctx_raw_runall_parallel(void)
   xbt_parmap_apply(raw_parmap, (void_f_pvoid_t) smx_ctx_raw_resume_parallel,
       simix_global->process_to_run);
 #else
-  xbt_die("You asked for a parallel execution, but you don't have any threads.")
+  xbt_die("You asked for a parallel execution, but you don't have any threads.");
 #endif
 }
 
index 6a19200..3af7b3c 100644 (file)
@@ -1,6 +1,6 @@
-/* context_sysv - context switching with ucontextes from System V           */
+/* context_sysv - context switching with ucontexts from System V           */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
  /* This program is free software; you can redistribute it and/or modify it
index 79652a5..e254af4 100644 (file)
@@ -1,6 +1,6 @@
 /* context_thread - implementation of context switching with native threads */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5b34af3..3b53ec8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index dd4709a..b8655fa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -38,19 +38,28 @@ void SIMIX_create_environment(const char *file)
   start = xbt_os_time();
   parse_platform_file(file);
   end = xbt_os_time();
-  XBT_DEBUG("PARSE TIME: %lg", (end - start));
+  XBT_DEBUG("PARSE TIME: %g", (end - start));
 
 }
 
 void SIMIX_post_create_environment(void) {
 
   void **workstation = NULL;
+  void **storage = NULL;
   xbt_lib_cursor_t cursor = NULL;
   char *name = NULL;
 
+  /* Create host at SIMIX level */
   xbt_lib_foreach(host_lib, cursor, name, workstation) {
     if(workstation[SURF_WKS_LEVEL])
       SIMIX_host_create(name, workstation[SURF_WKS_LEVEL], NULL);
   }
+
+  /* Create storage at SIMIX level */
+  xbt_lib_foreach(storage_lib, cursor, name, storage) {
+    if(storage[SURF_STORAGE_LEVEL])
+      SIMIX_storage_create(name, storage[SURF_STORAGE_LEVEL], NULL);
+  }
+
   surf_presolve();
 }
index 1754afc..4a6c7ac 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2013. 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. */
@@ -10,6 +11,7 @@
 #include "xbt/str.h"
 #include "xbt/ex.h"             /* ex_backtrace_display */
 #include "mc/mc.h"
+#include "simgrid/sg_config.h"
 
 XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
@@ -107,8 +109,13 @@ void SIMIX_global_init(int *argc, char **argv)
   }
 
   SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
+  SIMIX_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, SIMIX_storage_destroy);
 
-  atexit(SIMIX_clean);
+  if (sg_cfg_get_boolean("clean_atexit"))
+    atexit(SIMIX_clean);
+
+  if (_sg_cfg_exit_asap)
+    exit(0);
 }
 
 /**
@@ -157,7 +164,7 @@ static void SIMIX_clean(void)
 
 #ifdef TIME_BENCH_AMDAHL
   xbt_os_cputimer_stop(simix_global->timer_seq);
-  XBT_INFO("Amdhal timing informations. Sequential time: %lf; Parallel time: %lf",
+  XBT_INFO("Amdahl timing informations. Sequential time: %f; Parallel time: %f",
            xbt_os_timer_elapsed(simix_global->timer_seq),
            xbt_os_timer_elapsed(simix_global->timer_par));
   xbt_os_timer_free(simix_global->timer_seq);
@@ -328,6 +335,16 @@ void SIMIX_run(void)
         SIMIX_simcall_post((smx_action_t) surf_action_get_data(action));
     }
 
+    /* Autorestart all process */
+    if(host_that_restart) {
+      char *hostname = NULL;
+      xbt_dynar_foreach(host_that_restart,iter,hostname) {
+        XBT_INFO("Restart processes on host: %s",hostname);
+        SIMIX_host_autorestart(SIMIX_host_get_by_name(hostname));
+      }
+      xbt_dynar_reset(host_that_restart);
+    }
+
     /* Clean processes to destroy */
     SIMIX_process_empty_trash();
 
@@ -339,7 +356,7 @@ void SIMIX_run(void)
     TRACE_end();
 #endif
 
-    XBT_WARN("Oops ! Deadlock or code not perfectly clean.");
+    XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean.");
     SIMIX_display_process_status();
     xbt_abort();
   }
index 436bc8a..df02f0f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -34,8 +34,8 @@ smx_host_t SIMIX_host_create(const char *name,
 
   /* Update global variables */
   xbt_lib_set(host_lib,name,SIMIX_HOST_LEVEL,smx_host);
-  
-  return xbt_lib_get_elm_or_null(host_lib, name);
+
+  return xbt_lib_get_or_null(host_lib, name, SIMIX_HOST_LEVEL);
 }
 
 /**
@@ -155,6 +155,16 @@ int SIMIX_host_get_core(smx_host_t host){
   return surf_workstation_get_core(host);
 }
 
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_process_list(host);
+}
+
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
+  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+  smx_host_priv_t host_priv = SIMIX_host_priv(host);
+
+  return host_priv->process_list;
+}
 
 
 double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
@@ -166,6 +176,50 @@ double SIMIX_host_get_available_speed(smx_host_t host){
   return surf_workstation_get_available_speed(host);
 }
 
+double SIMIX_pre_host_get_current_power_peak(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_current_power_peak(host);
+}
+double SIMIX_host_get_current_power_peak(smx_host_t host) {
+         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+         return surf_workstation_get_current_power_peak(host);
+}
+
+double SIMIX_pre_host_get_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index){
+  return SIMIX_host_get_power_peak_at(host, pstate_index);
+}
+double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index) {
+         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+         return surf_workstation_get_power_peak_at(host, pstate_index);
+}
+
+int SIMIX_pre_host_get_nb_pstates(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_nb_pstates(host);
+}
+int SIMIX_host_get_nb_pstates(smx_host_t host) {
+         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+         return surf_workstation_get_nb_pstates(host);
+}
+
+
+void SIMIX_pre_host_set_power_peak_at(smx_simcall_t simcall, smx_host_t host, int pstate_index){
+  SIMIX_host_set_power_peak_at(host, pstate_index);
+}
+void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index) {
+         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+         surf_workstation_set_power_peak_at(host, pstate_index);
+}
+
+double SIMIX_pre_host_get_consumed_energy(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_consumed_energy(host);
+}
+double SIMIX_host_get_consumed_energy(smx_host_t host) {
+         xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+         return surf_workstation_get_consumed_energy(host);
+}
+
 int SIMIX_pre_host_get_state(smx_simcall_t simcall, smx_host_t host){
   return SIMIX_host_get_state(host);
 }
@@ -198,10 +252,14 @@ void* SIMIX_host_get_data(smx_host_t host){
 
   return SIMIX_host_priv(host)->data;
 }
-void _SIMIX_host_free_process_arg(void *);
-void _SIMIX_host_free_process_arg(void *data)
+
+static void _SIMIX_host_free_process_arg(void *data)
 {
   smx_process_arg_t arg = *(void**)data;
+  int i;
+  for (i = 0; i < arg->argc; i++)
+    xbt_free(arg->argv[i]);
+  xbt_free(arg->argv);
   xbt_free(arg->name);
   xbt_free(arg);
 }
@@ -247,7 +305,7 @@ void SIMIX_host_add_auto_restart_process(smx_host_t host,
   if( SIMIX_host_get_state(host) == SURF_RESOURCE_OFF
       && !xbt_dict_get_or_null(watched_hosts_lib,sg_host_name(host))){
     xbt_dict_set(watched_hosts_lib,sg_host_name(host),host,NULL);
-    XBT_DEBUG("Have push host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_name(host));
+    XBT_DEBUG("Have pushed host %s to watched_hosts_lib because state == SURF_RESOURCE_OFF",sg_host_name(host));
   }
   xbt_dynar_push_as(SIMIX_host_priv(host)->auto_restart_processes,smx_process_arg_t,arg);
 }
@@ -258,7 +316,11 @@ void SIMIX_host_restart_processes(smx_host_t host)
 {
   unsigned int cpt;
   smx_process_arg_t arg;
-  xbt_dynar_foreach(SIMIX_host_priv(host)->auto_restart_processes,cpt,arg) {
+  xbt_dynar_t process_list = SIMIX_host_priv(host)->auto_restart_processes;
+  if (!process_list)
+    return;
+
+  xbt_dynar_foreach (process_list, cpt, arg) {
 
     smx_process_t process;
 
@@ -274,22 +336,26 @@ void SIMIX_host_restart_processes(smx_host_t host)
                                             arg->argv,
                                             arg->properties,
                                             arg->auto_restart);
-    }
-    else {
+    } else {
       simcall_process_create(&process,
-                                            arg->argv[0],
-                                            arg->code,
-                                            NULL,
-                                            arg->hostname,
-                                            arg->kill_time,
-                                            arg->argc,
-                                            arg->argv,
-                                            arg->properties,
-                                            arg->auto_restart);
+                             arg->argv[0],
+                             arg->code,
+                             NULL,
+                             arg->hostname,
+                             arg->kill_time,
+                             arg->argc,
+                             arg->argv,
+                             arg->properties,
+                             arg->auto_restart);
 
     }
+    /* arg->argv is used by the process created above.  Hide it to
+     * _SIMIX_host_free_process_arg() which is called by xbt_dynar_reset()
+     * below. */
+    arg->argc = 0;
+    arg->argv = NULL;
   }
-  xbt_dynar_reset(SIMIX_host_priv(host)->auto_restart_processes);
+  xbt_dynar_reset(process_list);
 }
 
 void SIMIX_host_autorestart(smx_host_t host)
@@ -486,7 +552,7 @@ void SIMIX_execution_finish(smx_action_t action)
       case SIMIX_FAILED:
         XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", sg_host_name(simcall->issuer->smx_host));
         simcall->issuer->context->iwannadie = 1;
-        //SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
+        SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
         break;
 
       case SIMIX_CANCELED:
@@ -557,3 +623,11 @@ void SIMIX_set_category(smx_action_t action, const char *category)
 }
 #endif
 
+xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t simcall, smx_host_t host){
+  return SIMIX_host_get_storage_list(host);
+}
+xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host){
+  xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+
+  return surf_workstation_get_storage_list(host);
+}
index 8dfd9e4..d89e927 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -41,9 +41,15 @@ void SIMIX_host_restart_processes(smx_host_t host);
 void SIMIX_host_autorestart(smx_host_t host);
 xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
 int SIMIX_host_get_core(smx_host_t host);
+xbt_swag_t SIMIX_host_get_process_list(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);
+double SIMIX_host_get_current_power_peak(smx_host_t host);
+double SIMIX_host_get_power_peak_at(smx_host_t host, int pstate_index);
+int SIMIX_host_get_nb_pstates(smx_host_t host);
+double SIMIX_host_get_consumed_energy(smx_host_t host);
+void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index);
 smx_action_t SIMIX_host_execute(const char *name,
     smx_host_t host, double computation_amount, double priority);
 smx_action_t SIMIX_host_parallel_execute(const char *name,
@@ -56,6 +62,7 @@ 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_simcall_t simcall, smx_action_t action);
+xbt_dict_t SIMIX_host_get_storage_list(smx_host_t host);
 
 // pre prototypes
 smx_host_t SIMIX_pre_host_get_by_name(smx_simcall_t, const char*);
@@ -63,9 +70,15 @@ const char* SIMIX_pre_host_self_get_name(smx_simcall_t);
 const char* SIMIX_pre_host_get_name(smx_simcall_t, smx_host_t);
 xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_core(smx_simcall_t, smx_host_t);
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t, smx_host_t host);
 double SIMIX_pre_host_get_speed(smx_simcall_t, smx_host_t);
 double SIMIX_pre_host_get_available_speed(smx_simcall_t, smx_host_t);
 int SIMIX_pre_host_get_state(smx_simcall_t, smx_host_t);
+double SIMIX_pre_host_get_current_power_peak(smx_simcall_t, smx_host_t);
+double SIMIX_pre_host_get_power_peak_at(smx_simcall_t, smx_host_t host, int pstate_index);
+int SIMIX_pre_host_get_nb_pstates(smx_simcall_t, smx_host_t host);
+void SIMIX_pre_host_set_power_peak_at(smx_simcall_t, smx_host_t host, int pstate_index);
+double SIMIX_pre_host_get_consumed_energy(smx_simcall_t, smx_host_t);
 void* SIMIX_pre_host_self_get_data(smx_simcall_t);
 void* SIMIX_pre_host_get_data(smx_simcall_t, smx_host_t);
 void SIMIX_pre_host_set_data(smx_simcall_t, smx_host_t, void*);
@@ -82,7 +95,7 @@ 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);
-
+xbt_dict_t SIMIX_pre_host_get_storage_list(smx_simcall_t, smx_host_t);
 #ifdef HAVE_TRACING
 void SIMIX_pre_set_category(smx_simcall_t simcall, smx_action_t action,
                            const char *category);
index 971ccf6..f177592 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. 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 "smx_private.h"
-#include "surf/storage_private.h"
+//#include "surf/storage_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
@@ -15,17 +15,70 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_io, simix,
                                 "Logging specific to SIMIX (io)");
 
 
+/**
+ * \brief Internal function to create a SIMIX storage.
+ * \param name name of the storage to create
+ * \param storage the SURF storage to encapsulate
+ * \param data some user data (may be NULL)
+ */
+smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data)
+{
+  smx_storage_priv_t smx_storage = xbt_new0(s_smx_storage_priv_t, 1);
+
+  smx_storage->data = data;
+
+  /* Update global variables */
+  xbt_lib_set(storage_lib,name,SIMIX_STORAGE_LEVEL,smx_storage);
+
+  return xbt_lib_get_or_null(storage_lib, name, SIMIX_STORAGE_LEVEL);
+}
+
+/**
+ * \brief Internal function to destroy a SIMIX storage.
+ *
+ * \param s the host to destroy (a smx_storage_t)
+ */
+void SIMIX_storage_destroy(void *s)
+{
+  smx_storage_priv_t storage = (smx_storage_priv_t) s;
+
+  xbt_assert((storage != NULL), "Invalid parameters");
+  if (storage->data)
+    free(storage->data);
+
+  /* Clean storage structure */
+  free(storage);
+}
+
+void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd){
+  return SIMIX_file_get_data(fd);
+}
+
+void* SIMIX_file_get_data(smx_file_t fd){
+  xbt_assert((fd != NULL), "Invalid parameters (simix file is NULL)");
+
+  return fd->data;
+}
+
+void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data) {
+  SIMIX_file_set_data(fd, data);
+}
+
+void SIMIX_file_set_data(smx_file_t fd, void *data){
+  xbt_assert((fd != NULL), "Invalid parameter");
+
+  fd->data = data;
+}
+
 //SIMIX FILE READ
-void SIMIX_pre_file_read(smx_simcall_t simcall, void *ptr, size_t size,
-                       smx_file_t fd)
+void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_storage_size_t size)
 {
-  smx_action_t action = SIMIX_file_read(simcall->issuer, ptr, size, fd);
+  smx_action_t action = SIMIX_file_read(simcall->issuer, fd, size);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
 }
 
-smx_action_t SIMIX_file_read(smx_process_t process, void* ptr, size_t size,
-                             smx_file_t fd)
+smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_storage_size_t size)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -44,7 +97,7 @@ smx_action_t SIMIX_file_read(smx_process_t process, void* ptr, size_t size,
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_read(host, ptr, size, fd->surf_file);
+  action->io.surf_io = surf_workstation_read(host, fd->surf_file, size);
 
   surf_action_set_data(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -53,16 +106,14 @@ smx_action_t SIMIX_file_read(smx_process_t process, void* ptr, size_t size,
 }
 
 //SIMIX FILE WRITE
-void SIMIX_pre_file_write(smx_simcall_t simcall, const void *ptr, size_t size,
-                         smx_file_t fd)
+void SIMIX_pre_file_write(smx_simcall_t simcall, smx_file_t fd, sg_storage_size_t size)
 {
-  smx_action_t action = SIMIX_file_write(simcall->issuer, ptr, size, fd);
+  smx_action_t action = SIMIX_file_write(simcall->issuer, fd,  size);
   xbt_fifo_push(action->simcalls, simcall);
   simcall->issuer->waiting_action = action;
 }
 
-smx_action_t SIMIX_file_write(smx_process_t process, const void* ptr,
-                              size_t size, smx_file_t fd)
+smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_storage_size_t size)
 {
   smx_action_t action;
   smx_host_t host = process->smx_host;
@@ -81,7 +132,7 @@ smx_action_t SIMIX_file_write(smx_process_t process, const void* ptr,
 #endif
 
   action->io.host = host;
-  action->io.surf_io = surf_workstation_write(host, ptr, size, fd->surf_file);
+  action->io.surf_io = surf_workstation_write(host, fd->surf_file, size);
 
   surf_action_set_data(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -178,7 +229,7 @@ int SIMIX_file_unlink(smx_process_t process, smx_file_t fd)
   }
 
   if (surf_workstation_unlink(host, fd->surf_file)){
-    fd->surf_file = NULL;
+    xbt_free(fd);
     return 1;
   } else
     return 0;
@@ -217,17 +268,100 @@ smx_action_t SIMIX_file_ls(smx_process_t process, const char* mount, const char
   return action;
 }
 
-size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd)
+sg_storage_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd)
 {
   return SIMIX_file_get_size(simcall->issuer, fd);
 }
 
-size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd)
+sg_storage_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd)
 {
   smx_host_t host = process->smx_host;
   return  surf_workstation_get_size(host, fd->surf_file);
 }
 
+xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd)
+{
+  return SIMIX_file_get_info(simcall->issuer, fd);
+}
+
+xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd)
+{
+  smx_host_t host = process->smx_host;
+  return  surf_workstation_get_info(host, fd->surf_file);
+}
+
+sg_storage_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name)
+{
+  return SIMIX_storage_get_free_size(simcall->issuer, name);
+}
+
+sg_storage_size_t SIMIX_storage_get_free_size(smx_process_t process, const char* name)
+{
+  smx_host_t host = process->smx_host;
+  return  surf_workstation_get_free_size(host, name);
+}
+
+sg_storage_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall, const char* name)
+{
+  return SIMIX_storage_get_used_size(simcall->issuer, name);
+}
+
+sg_storage_size_t SIMIX_storage_get_used_size(smx_process_t process, const char* name)
+{
+  smx_host_t host = process->smx_host;
+  return  surf_workstation_get_used_size(host, name);
+}
+
+xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t simcall, smx_storage_t storage){
+  return SIMIX_storage_get_properties(storage);
+}
+xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
+  return surf_resource_get_properties(surf_workstation_resource_priv(storage));
+}
+
+const char* SIMIX_pre_storage_get_name(smx_simcall_t simcall, smx_storage_t storage){
+   return SIMIX_storage_get_name(storage);
+}
+
+const char* SIMIX_storage_get_name(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters");
+  return sg_storage_name(storage);
+}
+
+void SIMIX_pre_storage_set_data(smx_simcall_t simcall, smx_storage_t storage, void *data) {
+  SIMIX_storage_set_data(storage, data);
+}
+void SIMIX_storage_set_data(smx_storage_t storage, void *data){
+  xbt_assert((storage != NULL), "Invalid parameters");
+  xbt_assert((SIMIX_storage_priv(storage)->data == NULL), "Data already set");
+
+  SIMIX_storage_priv(storage)->data = data;
+}
+
+void* SIMIX_pre_storage_get_data(smx_simcall_t simcall,smx_storage_t storage){
+  return SIMIX_storage_get_data(storage);
+}
+
+void* SIMIX_storage_get_data(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
+
+  return SIMIX_storage_priv(storage)->data;
+}
+
+xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage){
+  return SIMIX_storage_get_content(storage);
+}
+
+xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
+  return surf_storage_get_content(storage);
+}
+
+sg_storage_size_t SIMIX_storage_get_size(smx_storage_t storage){
+  xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)");
+  return surf_storage_get_size(storage);
+}
 
 void SIMIX_post_io(smx_action_t action)
 {
index c4f1d65..a3fea00 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include "simgrid/simix.h"
 #include "smx_smurf_private.h"
 
-void SIMIX_pre_file_read(smx_simcall_t simcall, void *ptr, size_t size,
-                        smx_file_t fd);
-void SIMIX_pre_file_write(smx_simcall_t simcall, const void *ptr, size_t size,
-                         smx_file_t fd);
+/** @brief Storage datatype */
+typedef struct s_smx_storage_priv {
+  void *data;              /**< @brief user data */
+} s_smx_storage_priv_t;
+
+
+static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){
+  return xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL);
+}
+
+smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
+void SIMIX_storage_destroy(void *s);
+void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd);
+void SIMIX_pre_file_set_data(smx_simcall_t simcall, smx_file_t fd, void *data);
+void SIMIX_pre_file_read(smx_simcall_t simcall, smx_file_t fd, sg_storage_size_t size);
+void SIMIX_pre_file_write(smx_simcall_t simcall,smx_file_t fd, sg_storage_size_t size);
 void SIMIX_pre_file_open(smx_simcall_t simcall, const char* mount,
                         const char* path);
 void SIMIX_pre_file_close(smx_simcall_t simcall, smx_file_t fd);
 int SIMIX_pre_file_unlink(smx_simcall_t simcall, smx_file_t fd);
 void SIMIX_pre_file_ls(smx_simcall_t simcall,
                        const char* mount, const char* path);
-size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
+sg_storage_size_t SIMIX_pre_file_get_size(smx_simcall_t simcall, smx_file_t fd);
+xbt_dynar_t SIMIX_pre_file_get_info(smx_simcall_t simcall, smx_file_t fd);
 
-smx_action_t SIMIX_file_read(smx_process_t process, void* ptr, size_t size,
-                             smx_file_t fd);
-smx_action_t SIMIX_file_write(smx_process_t process, const void* ptr,
-                              size_t size, smx_file_t fd);
+void* SIMIX_file_get_data(smx_file_t fd);
+void SIMIX_file_set_data(smx_file_t fd, void *data);
+smx_action_t SIMIX_file_read(smx_process_t process, smx_file_t fd, sg_storage_size_t size);
+smx_action_t SIMIX_file_write(smx_process_t process, smx_file_t fd, sg_storage_size_t size);
 smx_action_t SIMIX_file_open(smx_process_t process, const char* storage,
                              const char* path);
 smx_action_t SIMIX_file_close(smx_process_t process, smx_file_t fd);
 int SIMIX_file_unlink(smx_process_t process, smx_file_t fd);
 smx_action_t SIMIX_file_ls(smx_process_t process, const char *mount,
                            const char *path);
-size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
+sg_storage_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
+xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd);
+
+sg_storage_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall,const char* name);
+sg_storage_size_t SIMIX_storage_get_free_size(smx_process_t process,const char* name);
+
+sg_storage_size_t SIMIX_pre_storage_get_used_size(smx_simcall_t simcall,const char* name);
+sg_storage_size_t SIMIX_storage_get_used_size(smx_process_t process,const char* name);
+
+xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
+xbt_dict_t SIMIX_pre_storage_get_properties(smx_simcall_t, smx_storage_t);
+
+void SIMIX_pre_storage_set_data(smx_simcall_t, smx_storage_t, void*);
+void* SIMIX_pre_storage_get_data(smx_simcall_t, smx_storage_t);
+
+xbt_dict_t SIMIX_pre_storage_get_content(smx_simcall_t simcall, smx_storage_t storage);
+xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
+
+const char* SIMIX_pre_storage_get_name(smx_simcall_t simcall, smx_storage_t storage);
 
 void SIMIX_post_io(smx_action_t action);
 void SIMIX_io_destroy(smx_action_t action);
index 2868ad6..5e849a6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@ void SIMIX_network_init(void)
 {
   rdv_points = xbt_dict_new_homogeneous(SIMIX_rdv_free);
   if(MC_is_active())
-    MC_ignore_data_bss(&smx_total_comms, sizeof(smx_total_comms));
+    MC_ignore_global_variable("smx_total_comms");
 }
 
 void SIMIX_network_exit(void)
@@ -695,7 +695,6 @@ smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src,
 
 void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout)
 {
-  int idx = simcall->mc_value;
   /* the simcall may be a wait, a send or a recv */
   surf_action_t sleep;
 
@@ -706,6 +705,7 @@ void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double time
   simcall->issuer->waiting_action = action;
 
   if (MC_is_active()) {
+    int idx = simcall->mc_value;
     if (idx == 0) {
       action->state = SIMIX_DONE;
     } else {
@@ -764,12 +764,12 @@ void SIMIX_pre_comm_test(smx_simcall_t simcall, smx_action_t action)
 
 void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions)
 {
-  int idx = simcall->mc_value;
   unsigned int cursor;
   smx_action_t action;
   simcall_comm_testany__set__result(simcall, -1);
 
   if (MC_is_active()){
+    int idx = simcall->mc_value;
     if(idx == -1){
       SIMIX_simcall_answer(simcall);
     }else{
@@ -795,11 +795,11 @@ void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions)
 
 void SIMIX_pre_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions)
 {
-  int idx = simcall->mc_value;
   smx_action_t action;
   unsigned int cursor = 0;
 
   if (MC_is_active()){
+    int idx = simcall->mc_value;
     action = xbt_dynar_get_as(actions, idx, smx_action_t);
     xbt_fifo_push(action->simcalls, simcall);
     simcall_comm_waitany__set__result(simcall, idx);
index af4a73f..72bcffa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f9a1146..01c3b5a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 72ab3e0..61ac1ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1130ff9..d8c2519 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -73,6 +73,7 @@ extern xbt_dict_t watched_hosts_lib;
 /* ******************************** File ************************************ */
 typedef struct s_smx_file {
   surf_file_t surf_file;
+  void* data;                   /**< @brief user data */
 } s_smx_file_t;
 
 /*********************************** Time ************************************/
index da07fba..29e3217 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -122,8 +122,8 @@ void SIMIX_process_empty_trash(void)
 
     xbt_dynar_free(&process->on_exit);
 
-    free(process->name);
-    free(process);
+    xbt_free(process->name);
+    xbt_free(process);
   }
 }
 
@@ -239,8 +239,12 @@ void SIMIX_process_create(smx_process_t *process,
   XBT_DEBUG("Start process %s on host '%s'", name, hostname);
 
   if (!SIMIX_host_get_state(host)) {
+    int i;
     XBT_WARN("Cannot launch process '%s' on failed host '%s'", name,
           hostname);
+    for (i = 0; i < argc; i++)
+      xbt_free(argv[i]);
+    xbt_free(argv);
   }
   else {
     *process = xbt_new0(s_smx_process_t, 1);
index 53614ee..aedee85 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 104a78e..bb33f4d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -277,11 +277,17 @@ ACTION(SIMCALL_HOST_GET_BY_NAME, host_get_by_name, WITH_ANSWER, TDSPEC(result, s
 ACTION(SIMCALL_HOST_GET_NAME, host_get_name, WITH_ANSWER, TSTRING(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_PROPERTIES, host_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_CORE, host_get_core, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_GET_PROCESS_LIST, host_get_process_list, WITH_ANSWER, TDSPEC(result, xbt_swag_t), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_SPEED, host_get_speed, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_AVAILABLE_SPEED, host_get_available_speed, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_STATE, host_get_state, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_GET_DATA, host_get_data, WITH_ANSWER, TDPTR(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_SET_DATA, host_set_data, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t), TDPTR(data)) sep \
+ACTION(SIMCALL_HOST_GET_CURRENT_POWER_PEAK, host_get_current_power_peak, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_GET_POWER_PEAK_AT, host_get_power_peak_at, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t), TINT(pstate_index)) sep \
+ACTION(SIMCALL_HOST_GET_NB_PSTATES, host_get_nb_pstates, WITH_ANSWER, TINT(result), TDSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_SET_POWER_PEAK_AT, host_set_power_peak_at, WITH_ANSWER, TVOID(result), TDSPEC(host, smx_host_t), TINT(pstate_index)) sep \
+ACTION(SIMCALL_HOST_GET_CONSUMED_ENERGY, host_get_consumed_energy, WITH_ANSWER, TDOUBLE(result), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_HOST_EXECUTE, host_execute, WITH_ANSWER, TDSPEC(result, smx_action_t), TSTRING(name), TDSPEC(host, smx_host_t), TDOUBLE(computation_amount), TDOUBLE(priority)) sep \
 ACTION(SIMCALL_HOST_PARALLEL_EXECUTE, host_parallel_execute, WITH_ANSWER, TDSPEC(result, smx_action_t), TSTRING(name), TINT(host_nb), TDSPEC(host_list, smx_host_t*), TDSPEC(computation_amount, double*), TDSPEC(communication_amount, double*), TDOUBLE(amount), TDOUBLE(rate)) sep \
 ACTION(SIMCALL_HOST_EXECUTION_DESTROY, host_execution_destroy, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t)) sep \
@@ -290,6 +296,7 @@ ACTION(SIMCALL_HOST_EXECUTION_GET_REMAINS, host_execution_get_remains, WITH_ANSW
 ACTION(SIMCALL_HOST_EXECUTION_GET_STATE, host_execution_get_state, WITH_ANSWER, TINT(result), TDSPEC(execution, smx_action_t)) sep \
 ACTION(SIMCALL_HOST_EXECUTION_SET_PRIORITY, host_execution_set_priority, WITH_ANSWER, TVOID(result), TDSPEC(execution, smx_action_t), TDOUBLE(priority)) sep \
 ACTION(SIMCALL_HOST_EXECUTION_WAIT, host_execution_wait, WITHOUT_ANSWER, TINT(result), TDSPEC(execution, smx_action_t)) sep \
+ACTION(SIMCALL_HOST_GET_STORAGE_LIST, host_get_storage_list, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(host, smx_host_t)) sep \
 ACTION(SIMCALL_PROCESS_CREATE, process_create, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t*), TSTRING(name), TFSPEC(code, xbt_main_func_t), TDPTR(data), TSTRING(hostname), TDOUBLE(kill_time), TINT(argc), TDSPEC(argv, char**), TDSPEC(properties, xbt_dict_t), TINT(auto_restart)) sep \
 ACTION(SIMCALL_PROCESS_KILL, process_kill, WITH_ANSWER, TVOID(result), TDSPEC(process, smx_process_t)) sep \
 ACTION(SIMCALL_PROCESS_KILLALL, process_killall, WITH_ANSWER, TVOID(result), TINT(reset_pid)) sep \
@@ -354,14 +361,21 @@ ACTION(SIMCALL_SEM_WOULD_BLOCK, sem_would_block, WITH_ANSWER, TINT(result), TDSP
 ACTION(SIMCALL_SEM_ACQUIRE, sem_acquire, WITHOUT_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t)) sep \
 ACTION(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem_acquire_timeout, WITHOUT_ANSWER, TVOID(result), TDSPEC(sem, smx_sem_t), TDOUBLE(timeout)) sep \
 ACTION(SIMCALL_SEM_GET_CAPACITY, sem_get_capacity, WITH_ANSWER, TINT(result), TDSPEC(sem, smx_sem_t)) sep \
-ACTION(SIMCALL_FILE_READ, file_read, WITHOUT_ANSWER, TSIZE(result), TDPTR(ptr), TSIZE(size), TDSPEC(fd, smx_file_t)) sep \
-ACTION(SIMCALL_FILE_WRITE, file_write, WITHOUT_ANSWER, TSIZE(result), TCPTR(ptr), TSIZE(size), TDSPEC(fd, smx_file_t)) sep \
+ACTION(SIMCALL_FILE_GET_DATA, file_get_data, WITH_ANSWER, TDPTR(result), TDSPEC(fd, smx_file_t)) sep \
+ACTION(SIMCALL_FILE_SET_DATA, file_set_data, WITH_ANSWER, TVOID(result), TDSPEC(fd, smx_file_t), TDPTR(data)) sep \
+ACTION(SIMCALL_FILE_READ, file_read, WITHOUT_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t),  TSIZE(size)) sep \
+ACTION(SIMCALL_FILE_WRITE, file_write, WITHOUT_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t), TSIZE(size)) sep \
 ACTION(SIMCALL_FILE_OPEN, file_open, WITHOUT_ANSWER, TDSPEC(result, smx_file_t), TSTRING(mount), TSTRING(path)) sep \
 ACTION(SIMCALL_FILE_CLOSE, file_close, WITHOUT_ANSWER, TINT(result), TDSPEC(fd, smx_file_t)) sep \
 ACTION(SIMCALL_FILE_UNLINK, file_unlink, WITH_ANSWER, TINT(result), TDSPEC(fd, smx_file_t)) sep \
 ACTION(SIMCALL_FILE_LS, file_ls, WITHOUT_ANSWER, TDSPEC(result, xbt_dict_t), TSTRING(mount), TSTRING(path)) sep \
 ACTION(SIMCALL_FILE_GET_SIZE, file_get_size, WITH_ANSWER, TSIZE(result), TDSPEC(fd, smx_file_t)) sep \
-ACTION(SIMCALL_ASR_GET_PROPERTIES, asr_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TSTRING(name)) sep 
+ACTION(SIMCALL_FILE_GET_INFO, file_get_info, WITH_ANSWER, TDSPEC(result, xbt_dynar_t), TDSPEC(fd, smx_file_t)) sep \
+ACTION(SIMCALL_STORAGE_GET_FREE_SIZE, storage_get_free_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
+ACTION(SIMCALL_STORAGE_GET_USED_SIZE, storage_get_used_size, WITH_ANSWER, TSIZE(result), TSTRING(name)) sep \
+ACTION(SIMCALL_STORAGE_GET_PROPERTIES, storage_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(storage, smx_storage_t)) sep \
+ACTION(SIMCALL_STORAGE_GET_CONTENT, storage_get_content, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TDSPEC(storage, smx_storage_t)) sep \
+ACTION(SIMCALL_ASR_GET_PROPERTIES, asr_get_properties, WITH_ANSWER, TDSPEC(result, xbt_dict_t), TSTRING(name)) sep
 
 /* SIMCALL_COMM_IS_LATENCY_BOUNDED and SIMCALL_SET_CATEGORY make things complicated
  * because they are not always present */
@@ -383,7 +397,7 @@ ACTION(SIMCALL_SET_CATEGORY, set_category, WITH_ANSWER, TVOID(result), TDSPEC(ac
 #define SIMCALL_LIST4(ACTION, sep) \
 ACTION(SIMCALL_MC_SNAPSHOT, mc_snapshot, WITH_ANSWER, TDPTR(result)) sep \
 ACTION(SIMCALL_MC_COMPARE_SNAPSHOTS, mc_compare_snapshots, WITH_ANSWER, TINT(result), TDPTR(s1), TDPTR(s2)) sep \
-ACTION(SIMCALL_MC_RANDOM, mc_random, WITH_ANSWER, TINT(result)) sep
+ACTION(SIMCALL_MC_RANDOM, mc_random, WITH_ANSWER, TINT(result), TINT(min), TINT(max)) sep
 #else
 #define SIMCALL_LIST4(ACTION, sep)
 #endif
index 27b3726..90e0da2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -466,7 +466,7 @@ void SIMIX_sem_release(smx_sem_t sem)
 }
 
 /** @brief Returns true if acquiring this semaphore would block */
-XBT_INLINE int SIMIX_sem_would_block(smx_sem_t sem)
+int SIMIX_sem_would_block(smx_sem_t sem)
 {
   XBT_IN("(%p)",sem);
   XBT_OUT();
index d42275c..a4453a8 100644 (file)
@@ -1,6 +1,7 @@
 /* smx_user.c - public interface to simix                                   */
 
-/* Copyright (c) 2010-2012. Da SimGrid team. All rights reserved.          */
+/* Copyright (c) 2010-2013. 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. */
@@ -94,6 +95,17 @@ int simcall_host_get_core(smx_host_t host)
   return simcall_BODY_host_get_core(host);
 }
 
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the list of processes attached to the host.
+ *
+ * \param host A SIMIX host
+ * \return the swag of attached processes
+ */
+xbt_swag_t simcall_host_get_process_list(smx_host_t host)
+{
+  return simcall_BODY_host_get_process_list(host);
+}
 
 
 /**
@@ -145,6 +157,69 @@ void simcall_host_set_data(smx_host_t host, void *data)
   simcall_host_set_data(host, data);
 }
 
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the power peak of a host.
+ *
+ * \param host A SIMIX host
+ * \return the current power peak value (double)
+ */
+double simcall_host_get_current_power_peak(smx_host_t host)
+{
+  return simcall_BODY_host_get_current_power_peak(host);
+}
+
+/**
+ * \ingroup simix_host_management
+ * \brief Returns one power peak (in flops/s) of a host at a given pstate
+ *
+ * \param host A SIMIX host
+ * \param pstate_index pstate to test
+ * \return the current power peak value (double) for pstate_index
+ */
+double simcall_host_get_power_peak_at(smx_host_t host, int pstate_index)
+{
+  return simcall_BODY_host_get_power_peak_at(host, pstate_index);
+}
+
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the number of power states for a host.
+ *
+ * \param host A SIMIX host
+ * \return the number of power states
+ */
+int simcall_host_get_nb_pstates(smx_host_t host)
+{
+  return simcall_BODY_host_get_nb_pstates(host);
+}
+
+/**
+ * \ingroup simix_host_management
+ * \brief Sets a new power peak for a host.
+ *
+ * \param host A SIMIX host
+ * \param pstate_index The pstate to which the CPU power will be set
+ * \return void
+ */
+void simcall_host_set_power_peak_at(smx_host_t host, int pstate_index)
+{
+       simcall_BODY_host_set_power_peak_at(host, pstate_index);
+}
+
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the total energy consumed by the host (in Joules)
+ *
+ * \param host A SIMIX host
+ * \return the energy consumed by the host (double)
+ */
+double simcall_host_get_consumed_energy(smx_host_t host)
+{
+  return simcall_BODY_host_get_consumed_energy(host);
+}
+
+
 /**
  * \ingroup simix_host_management
  * \brief Creates an action that executes some computation of an host.
@@ -158,7 +233,6 @@ void simcall_host_set_data(smx_host_t host, void *data)
  * \param priority computation priority
  * \return A new SIMIX execution action
  */
-
 smx_action_t simcall_host_execute(const char *name, smx_host_t host,
                                     double computation_amount,
                                     double priority)
@@ -686,9 +760,11 @@ void simcall_comm_send(smx_rdv_t rdv, double task_size, double rate,
 
   if (MC_is_active()) {
     /* the model-checker wants two separate simcalls */
-    smx_action_t comm = simcall_comm_isend(rdv, task_size, rate,
+    smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
+    comm = simcall_comm_isend(rdv, task_size, rate,
         src_buff, src_buff_size, match_fun, NULL, data, 0);
     simcall_comm_wait(comm, timeout);
+    comm = NULL;
   }
   else {
     simcall_BODY_comm_send(rdv, task_size, rate, src_buff, src_buff_size,
@@ -727,9 +803,11 @@ void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
 
   if (MC_is_active()) {
     /* the model-checker wants two separate simcalls */
-    smx_action_t comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
+    smx_action_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
+    comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
         match_fun, data);
     simcall_comm_wait(comm, timeout);
+    comm = NULL;
   }
   else {
     simcall_BODY_comm_recv(rdv, dst_buff, dst_buff_size,
@@ -1103,21 +1181,44 @@ int simcall_sem_get_capacity(smx_sem_t sem)
 
 /**
  * \ingroup simix_file_management
+ * \brief Returns the user data associated to a file.
  *
+ * \param fd A simix file
+ * \return the user data of this file
  */
-size_t simcall_file_read(void* ptr, size_t size, smx_file_t fd)
+void* simcall_file_get_data(smx_file_t fd)
 {
-  return simcall_BODY_file_read(ptr, size, fd);
+  return simcall_BODY_file_get_data(fd);
+}
+
+/**
+ * \ingroup simix_file_management
+ * \brief Sets the user data associated to a file.
+ *
+ * \param fd A SIMIX file
+ * \param data The user data to set
+ */
+void simcall_file_set_data(smx_file_t fd, void *data)
+{
+  simcall_file_set_data(fd, data);
+}
+
+/**
+ * \ingroup simix_file_management
+ *
+ */
+sg_storage_size_t simcall_file_read(smx_file_t fd, sg_storage_size_t size)
+{
+  return simcall_BODY_file_read(fd, size);
 }
 
 /**
  * \ingroup simix_file_management
  *
  */
-size_t simcall_file_write(const void* ptr, size_t size,
-                          smx_file_t fd)
+sg_storage_size_t simcall_file_write(smx_file_t fd, sg_storage_size_t size)
 {
-  return simcall_BODY_file_write(ptr, size, fd);
+  return simcall_BODY_file_write(fd, size);
 }
 
 /**
@@ -1159,10 +1260,74 @@ xbt_dict_t simcall_file_ls(const char* mount, const char* path)
  * \ingroup simix_file_management
  *
  */
-size_t simcall_file_get_size (smx_file_t fd){
+sg_storage_size_t simcall_file_get_size (smx_file_t fd){
   return simcall_BODY_file_get_size(fd);
 }
 
+/**
+ * \ingroup simix_file_management
+ *
+ */
+xbt_dynar_t simcall_file_get_info(smx_file_t fd)
+{
+  return simcall_BODY_file_get_info(fd);
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the free space size on a given storage element.
+ * \param storage name
+ * \return Return the free space size on a given storage element (as sg_storage_size_t)
+ */
+sg_storage_size_t simcall_storage_get_free_size (const char* name){
+  return simcall_BODY_storage_get_free_size(name);
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the used space size on a given storage element.
+ * \param storage name
+ * \return Return the used space size on a given storage element (as sg_storage_size_t)
+ */
+sg_storage_size_t simcall_storage_get_used_size (const char* name){
+  return simcall_BODY_storage_get_used_size(name);
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the list of storages mounted on an host.
+ * \param host A SIMIX host
+ * \return a dict containing all storages mounted on the host
+ */
+xbt_dict_t simcall_host_get_storage_list(smx_host_t host)
+{
+  return simcall_BODY_host_get_storage_list(host);
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns a dict of the properties assigned to a storage element.
+ *
+ * \param storage A storage element
+ * \return The properties of this storage element
+ */
+xbt_dict_t simcall_storage_get_properties(smx_storage_t storage)
+{
+  return simcall_BODY_storage_get_properties(storage);
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns a dict containing the content of a storage element.
+ *
+ * \param storage A storage element
+ * \return The content of this storage element as a dict (full path file => size)
+ */
+xbt_dict_t simcall_storage_get_content(smx_storage_t storage)
+{
+  return simcall_BODY_storage_get_content(storage);
+}
+
 #ifdef HAVE_MC
 
 void *simcall_mc_snapshot(void)
@@ -1174,9 +1339,9 @@ int simcall_mc_compare_snapshots(void *s1, void *s2){
   return simcall_BODY_mc_compare_snapshots(s1, s2);
 }
 
-int simcall_mc_random(void)
+int simcall_mc_random(int min, int max)
 {
-  return simcall_BODY_mc_random();
+  return simcall_BODY_mc_random(min, max);
 }
 
 
diff --git a/src/smpi/colls/COPYRIGHTS b/src/smpi/colls/COPYRIGHTS
deleted file mode 100644 (file)
index 6fe2029..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-Copyright(c) 2006, Ahmad Faraj & Xin Yuan, All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-*Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimer in the documentation
-    and / or other materials provided with the distribution.
-    * Neither the name of the Florida State University nor the names of its
-    contributors may be used to endorse or promote products derived from this
-    software without specific prior written permission.THIS SOFTWARE IS PROVIDED
-    BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
-    WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-    PURPOSE ARE DISCLAIMED.
-    IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
-    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-    OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO,
-                             PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-                             LOSS OF USE, DATA, OR PROFITS;
-                             OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON
-    ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-    (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-    ***************************************************************************
-    *Any results obtained from executing this software require the *
-    *acknowledgment and citation of the software and its owners. *
-    *The full citation is given below:****A.Faraj, X.Yuan, and D.Lowenthal."STAR-MPI: Self Tuned Adaptive *
-  *     Routines for MPI Collective Operations." The 20 th ACM International * *Conference on Supercomputing(ICS), Queensland, Australia * *June 28 - July 1, 2006. * ***************************************************************************
index 4e3a9c7..602d540 100644 (file)
@@ -110,7 +110,7 @@ smpi_coll_tuned_allgather_2dmesh(void *send_buff, int send_count, MPI_Datatype
   int i, src, dst, rank, num_procs;
   int X, Y, send_offset, recv_offset;
   int my_row_base, my_col_base, src_row_base, block_size, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index dfd2ace..5a22437 100644 (file)
@@ -97,7 +97,7 @@ int smpi_coll_tuned_allgather_3dmesh(void *send_buff, int send_count,
   int i, src, dst, rank, num_procs, block_size, my_z_base;
   int my_z, X, Y, Z, send_offset, recv_offset;
   int two_dsize, my_row_base, my_col_base, src_row_base, src_z_base, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index f9a1e07..5783741 100644 (file)
@@ -8,7 +8,7 @@ int smpi_coll_tuned_allgather_GB(void *send_buff, int send_count,
 {
   int num_procs;
   num_procs = smpi_comm_size(comm);
-  smpi_mpi_gather(send_buff, send_count, send_type, recv_buff, recv_count, recv_type,
+  mpi_coll_gather_fun(send_buff, send_count, send_type, recv_buff, recv_count, recv_type,
              0, comm);
   mpi_coll_bcast_fun(recv_buff, (recv_count * num_procs), recv_type, 0, comm);
 
index d0c6ef0..0873395 100644 (file)
@@ -10,7 +10,7 @@ smpi_coll_tuned_allgather_NTSLR_NB(void *sbuf, int scount, MPI_Datatype stype,
   MPI_Status status, status2;
   int i, to, from, rank, size;
   int send_offset, recv_offset;
-  int tag = 500;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
index bcaabfd..28ab0b3 100644 (file)
@@ -10,7 +10,7 @@ smpi_coll_tuned_allgather_NTSLR(void *sbuf, int scount, MPI_Datatype stype,
   MPI_Status status;
   int i, to, from, rank, size;
   int send_offset, recv_offset;
-  int tag = 500;
+  int tag = COLL_TAG_ALLGATHER;
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
index a6b515a..b511fb9 100644 (file)
@@ -14,7 +14,7 @@ int smpi_coll_tuned_allgather_SMP_NTS(void *sbuf, int scount,
   MPI_Aint rextent, sextent;
   rextent = smpi_datatype_get_extent(rtype);
   sextent = smpi_datatype_get_extent(stype);
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Request request;
   MPI_Request rrequest_array[128];
 
index 681690a..2b49321 100644 (file)
@@ -72,7 +72,7 @@ int smpi_coll_tuned_allgather_bruck(void *send_buff, int send_count,
 
   // local int variables
   int src, dst, rank, num_procs, count, remainder;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   int pof2 = 1;
 
   // local string variables
index 6455db1..04c7faf 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_allgather_loosely_lr(void *sbuf, int scount,
                                          MPI_Comm comm)
 {
   int comm_size, rank;
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   int i, j, send_offset, recv_offset;
   int intra_rank, inter_rank, inter_comm_size, intra_comm_size;
   int inter_dst, inter_src;
diff --git a/src/smpi/colls/allgather-lr.c b/src/smpi/colls/allgather-lr.c
deleted file mode 100644 (file)
index 7656069..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "colls_private.h"
-
-// Allgather-Non-Topoloty-Scecific-Logical-Ring algorithm
-int
-smpi_coll_tuned_allgather_lr(void *sbuf, int scount, MPI_Datatype stype,
-                             void *rbuf, int rcount, MPI_Datatype rtype,
-                             MPI_Comm comm)
-{
-  MPI_Aint rextent, sextent;
-  MPI_Status status;
-  int i, to, from, rank, size;
-  int send_offset, recv_offset;
-  int tag = 500;
-
-  rank = smpi_comm_rank(comm);
-  size = smpi_comm_size(comm);
-  rextent = smpi_datatype_get_extent(rtype);
-  sextent = smpi_datatype_get_extent(stype);
-
-  // irregular case use default MPI fucntions
-  if (scount * sextent != rcount * rextent) {
-    XBT_WARN("MPI_allgather_lr use default MPI_allgather.");     
-    smpi_mpi_allgather(sbuf, scount, stype, rbuf, rcount, rtype, comm);
-    return MPI_SUCCESS;
-  }
-
-  // topo non-specific
-  to = (rank + 1) % size;
-  from = (rank + size - 1) % size;
-
-  //copy a single segment from sbuf to rbuf
-  send_offset = rank * scount * sextent;
-  smpi_mpi_sendrecv(sbuf, scount, stype, rank, tag,
-               (char *) rbuf + send_offset, rcount, rtype, rank, tag,
-               comm, &status);
-
-  //start sending logical ring message
-  int increment = scount * sextent;
-  for (i = 0; i < size - 1; i++) {
-    send_offset = ((rank - i + size) % size) * increment;
-    recv_offset = ((rank - i - 1 + size) % size) * increment;
-    smpi_mpi_sendrecv((char *) rbuf + send_offset, scount, stype, to, tag + i,
-                 (char *) rbuf + recv_offset, rcount, rtype, from, tag + i,
-                 comm, &status);
-  }
-
-  return MPI_SUCCESS;
-}
index 238163e..d416a66 100644 (file)
@@ -57,7 +57,6 @@
  */
  
  #include "colls_private.h"
- #define MCA_COLL_BASE_TAG_ALLGATHER 555
 int 
 smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
                                                  MPI_Datatype sdtype,
@@ -134,9 +133,9 @@ smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
    tmpsend = (char*)rbuf + rank * rcount * rext;
    /* Sendreceive */
    smpi_mpi_sendrecv(tmpsend, rcount, rdtype, neighbor[0],
-                                  MCA_COLL_BASE_TAG_ALLGATHER,
+                                  COLL_TAG_ALLGATHER,
                                   tmprecv, rcount, rdtype, neighbor[0],
-                                  MCA_COLL_BASE_TAG_ALLGATHER,
+                                  COLL_TAG_ALLGATHER,
                                   comm, MPI_STATUS_IGNORE);
 
    /* Determine initial sending location */
@@ -157,10 +156,10 @@ smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
       /* Sendreceive */
       smpi_mpi_sendrecv(tmpsend, 2 * rcount, rdtype, 
                                      neighbor[i_parity], 
-                                     MCA_COLL_BASE_TAG_ALLGATHER,
+                                     COLL_TAG_ALLGATHER,
                                      tmprecv, 2 * rcount, rdtype,
                                      neighbor[i_parity],
-                                     MCA_COLL_BASE_TAG_ALLGATHER,
+                                     COLL_TAG_ALLGATHER,
                                      comm, MPI_STATUS_IGNORE);
 
       send_data_from = recv_data_from[i_parity];
index 0dc4aec..6075723 100644 (file)
@@ -67,7 +67,7 @@ smpi_coll_tuned_allgather_pair(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
 
   char *send_ptr = (char *) send_buff;
index 520819a..26467de 100644 (file)
@@ -14,7 +14,7 @@ smpi_coll_tuned_allgather_rdb(void *sbuf, int send_count,
   int i, j, k, dst, rank, num_procs, send_offset, recv_offset, tree_root;
   int dst_tree_root, rank_tree_root, last_recv_count = 0, num_procs_completed;
   int offset, tmp_mask;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   int mask = 1;
   int success = 0;
   int curr_count = recv_count;
index c3db821..aceb283 100644 (file)
@@ -15,7 +15,7 @@ smpi_coll_tuned_allgather_rhv(void *sbuf, int send_count,
   int i, dst, send_base_offset, recv_base_offset, send_chunk, recv_chunk,
       send_offset, recv_offset;
   int rank, num_procs;
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   int mask;
   int curr_count;
 
index 6108ae5..4634ddc 100644 (file)
@@ -66,7 +66,7 @@ smpi_coll_tuned_allgather_ring(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
 
   char *sendptr = (char *) send_buff;
index 21cab26..1438870 100644 (file)
@@ -14,7 +14,7 @@ int smpi_coll_tuned_allgather_smp_simple(void *send_buf, int scount,
   MPI_Aint rextent, sextent;
   rextent = smpi_datatype_get_extent(rtype);
   sextent = smpi_datatype_get_extent(stype);
-  int tag = 50;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
   int i, send_offset, recv_offset;
   int intra_rank, inter_rank;
index 822ab53..c7dfbc9 100644 (file)
@@ -70,7 +70,7 @@ smpi_coll_tuned_allgather_spreading_simple(void *send_buff, int send_count,
   MPI_Request *reqs, *req_ptr;
   MPI_Aint extent;
   int i, src, dst, rank, num_procs, num_reqs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHER;
   MPI_Status status;
   char *recv_ptr = (char *) recv_buff;
 
index 3a65b30..8391807 100644 (file)
@@ -1,7 +1,6 @@
         /* Short or medium size message and power-of-two no. of processes. Use
          * recursive doubling algorithm */   
 #include "colls_private.h"
-#define MPIR_ALLGATHERV_TAG 222
 int smpi_coll_tuned_allgatherv_mpich_rdb ( 
     void *sendbuf,
     int sendcount,
@@ -94,10 +93,10 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
 
                     smpi_mpi_sendrecv(((char *)tmp_buf + send_offset * recvtype_extent),
                                                  curr_cnt, recvtype, dst,
-                                                 MPIR_ALLGATHERV_TAG,  
+                                                 COLL_TAG_ALLGATHERV,
                                                  ((char *)tmp_buf + recv_offset * recvtype_extent),
                                                  total_count - recv_offset, recvtype, dst,
-                                                 MPIR_ALLGATHERV_TAG,
+                                                 COLL_TAG_ALLGATHERV,
                                                  comm, &status);
                         /* for convenience, recv is posted for a bigger amount
                            than will be sent */
@@ -159,7 +158,7 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
                             smpi_mpi_send(((char *)tmp_buf + offset),
                                                      last_recv_cnt,
                                                      recvtype, dst,
-                                                     MPIR_ALLGATHERV_TAG, comm);
+                                                     COLL_TAG_ALLGATHERV, comm);
                             /* last_recv_cnt was set in the previous
                                receive. that's the amount of data to be
                                sent now. */
@@ -176,7 +175,7 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
 
                             smpi_mpi_recv(((char *)tmp_buf + offset * recvtype_extent),
                                                      total_count - offset, recvtype,
-                                                     dst, MPIR_ALLGATHERV_TAG,
+                                                     dst, COLL_TAG_ALLGATHERV,
                                                      comm, &status);
                                 /* for convenience, recv is posted for a
                                    bigger amount than will be sent */
@@ -207,5 +206,6 @@ int smpi_coll_tuned_allgatherv_mpich_rdb (
                 position += recvcounts[j];
             }
         }
-return MPI_SUCCESS;
+  free(tmp_buf);
+  return MPI_SUCCESS;
 }
diff --git a/src/smpi/colls/allgatherv-mpich-ring.c b/src/smpi/colls/allgatherv-mpich-ring.c
new file mode 100644 (file)
index 0000000..83a07f8
--- /dev/null
@@ -0,0 +1,121 @@
+#include "colls_private.h"
+
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*****************************************************************************
+ * Function: allgather_mpich_ring
+ * return: int
+ * inputs:
+ *   send_buff: send input buffer
+ *   send_count: number of elements to send
+ *   send_type: data type of elements being sent
+ *   recv_buff: receive output buffer
+ *   recv_count: number of elements to received
+ *   recv_type: data type of elements being received
+ *   comm: communication
+ ****************************************************************************/
+int
+smpi_coll_tuned_allgatherv_mpich_ring(void *sendbuf, int sendcount,
+    MPI_Datatype send_type, void *recvbuf,
+    int *recvcounts, int *displs, MPI_Datatype recvtype,
+    MPI_Comm comm)
+{
+
+  char * sbuf = NULL, * rbuf = NULL;
+  int soffset, roffset;
+  int torecv=0, tosend=0, min, rank, comm_size;
+  int sendnow, recvnow;
+  int sidx, ridx;
+  MPI_Status status;
+  MPI_Aint recvtype_extent;
+  int right, left, total_count, i;
+  rank= smpi_comm_rank(comm);
+  comm_size=smpi_comm_size(comm);
+
+  recvtype_extent= smpi_datatype_get_extent( recvtype);
+  total_count = 0;
+  for (i=0; i<comm_size; i++)
+    total_count += recvcounts[i];
+
+  if (sendbuf != MPI_IN_PLACE) {
+      /* First, load the "local" version in the recvbuf. */
+      smpi_datatype_copy(sendbuf, sendcount, send_type,
+          ((char *)recvbuf + displs[rank]*recvtype_extent),
+          recvcounts[rank], recvtype);
+  }
+
+  left  = (comm_size + rank - 1) % comm_size;
+  right = (rank + 1) % comm_size;
+
+  torecv = total_count - recvcounts[rank];
+  tosend = total_count - recvcounts[right];
+
+  min = recvcounts[0];
+  for (i = 1; i < comm_size; i++)
+    if (min > recvcounts[i])
+      min = recvcounts[i];
+  if (min * recvtype_extent < 32768*8)
+    min = 32768*8 / recvtype_extent;
+  /* Handle the case where the datatype extent is larger than
+   * the pipeline size. */
+  if (!min)
+    min = 1;
+
+  sidx = rank;
+  ridx = left;
+  soffset = 0;
+  roffset = 0;
+  while (tosend || torecv) { /* While we have data to send or receive */
+      sendnow = ((recvcounts[sidx] - soffset) > min) ? min : (recvcounts[sidx] - soffset);
+      recvnow = ((recvcounts[ridx] - roffset) > min) ? min : (recvcounts[ridx] - roffset);
+      sbuf = (char *)recvbuf + ((displs[sidx] + soffset) * recvtype_extent);
+      rbuf = (char *)recvbuf + ((displs[ridx] + roffset) * recvtype_extent);
+
+      /* Protect against wrap-around of indices */
+      if (!tosend)
+        sendnow = 0;
+      if (!torecv)
+        recvnow = 0;
+
+      /* Communicate */
+      if (!sendnow && !recvnow) {
+          /* Don't do anything. This case is possible if two
+           * consecutive processes contribute 0 bytes each. */
+      }
+      else if (!sendnow) { /* If there's no data to send, just do a recv call */
+          smpi_mpi_recv(rbuf, recvnow, recvtype, left, COLL_TAG_ALLGATHERV, comm, &status);
+
+          torecv -= recvnow;
+      }
+      else if (!recvnow) { /* If there's no data to receive, just do a send call */
+          smpi_mpi_send(sbuf, sendnow, recvtype, right, COLL_TAG_ALLGATHERV, comm);
+
+          tosend -= sendnow;
+      }
+      else { /* There's data to be sent and received */
+          smpi_mpi_sendrecv(sbuf, sendnow, recvtype, right, COLL_TAG_ALLGATHERV,
+              rbuf, recvnow, recvtype, left, COLL_TAG_ALLGATHERV,
+              comm, &status);
+          tosend -= sendnow;
+          torecv -= recvnow;
+      }
+
+      soffset += sendnow;
+      roffset += recvnow;
+      if (soffset == recvcounts[sidx]) {
+          soffset = 0;
+          sidx = (sidx + comm_size - 1) % comm_size;
+      }
+      if (roffset == recvcounts[ridx]) {
+          roffset = 0;
+          ridx = (ridx + comm_size - 1) % comm_size;
+      }
+  }
+
+  return MPI_SUCCESS;
+}
index 420f430..bffcbac 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 #include "colls_private.h"
-#define  MCA_COLL_BASE_TAG_ALLGATHERV 444
 /*
  * ompi_coll_tuned_allgatherv_intra_bruck
  *
@@ -159,9 +158,9 @@ int smpi_coll_tuned_allgatherv_ompi_bruck(void *sbuf, int scount,
 
       /* Sendreceive */
       smpi_mpi_sendrecv(rbuf, 1, new_sdtype, sendto,
-                                     MCA_COLL_BASE_TAG_ALLGATHERV,
+                                     COLL_TAG_ALLGATHERV,
                                      rbuf, 1, new_rdtype, recvfrom,
-                                     MCA_COLL_BASE_TAG_ALLGATHERV,
+                                     COLL_TAG_ALLGATHERV,
                                      comm, MPI_STATUS_IGNORE);
       smpi_datatype_free(&new_sdtype);
       smpi_datatype_free(&new_rdtype);
index f80e681..3692a38 100644 (file)
@@ -59,7 +59,6 @@
  */
  
  #include "colls_private.h"
- #define  MCA_COLL_BASE_TAG_ALLGATHERV 444
  
 int 
 smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
@@ -142,9 +141,9 @@ smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
     tmprecv = (char*)rbuf + rdispls[neighbor[0]] * rext;
     tmpsend = (char*)rbuf + rdispls[rank] * rext;
     smpi_mpi_sendrecv(tmpsend, rcounts[rank], rdtype, 
-                                   neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+                                   neighbor[0], COLL_TAG_ALLGATHERV,
                                    tmprecv, rcounts[neighbor[0]], rdtype, 
-                                   neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+                                   neighbor[0], COLL_TAG_ALLGATHERV,
                                    comm, MPI_STATUS_IGNORE);
 
 
@@ -194,9 +193,9 @@ smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
       
         /* Sendreceive */
         smpi_mpi_sendrecv(tmpsend, 1, new_sdtype, neighbor[i_parity],
-                                       MCA_COLL_BASE_TAG_ALLGATHERV,
+                                       COLL_TAG_ALLGATHERV,
                                        tmprecv, 1, new_rdtype, neighbor[i_parity],
-                                       MCA_COLL_BASE_TAG_ALLGATHERV,
+                                       COLL_TAG_ALLGATHERV,
                                        comm, MPI_STATUS_IGNORE);
 
         send_data_from = recv_data_from[i_parity];
index d60e77a..c73366e 100644 (file)
@@ -67,7 +67,7 @@ smpi_coll_tuned_allgatherv_pair(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHERV;
   MPI_Status status;
 
   char *send_ptr = (char *) send_buff;
index 4c1e14f..fc7598c 100644 (file)
@@ -66,7 +66,7 @@ smpi_coll_tuned_allgatherv_ring(void *send_buff, int send_count,
 
   MPI_Aint extent;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLGATHERV;
   MPI_Status status;
 
   char *sendptr = (char *) send_buff;
diff --git a/src/smpi/colls/allreduce-NTS.c b/src/smpi/colls/allreduce-NTS.c
deleted file mode 100644 (file)
index a8cf48d..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "colls_private.h"
-/* IMPLEMENTED BY PITCH PATARASUK 
-   Non-topoloty-specific all-reduce operation designed bandwidth optimally */
-
-/* ** NOTE **
-   Use -DMPICH2_REDUCTION if this code does not compile.
-   MPICH1 code also work on MPICH2 on our cluster and the performance are similar.
-   This code assume commutative and associative reduce operator (MPI_SUM, MPI_MAX, etc).
-*/
-
-//#include <star-reduction.c>
-
-int
-smpi_coll_tuned_allreduce_NTS(void *sbuf, void *rbuf, int rcount,
-                              MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
-{
-  int tag = 5000;
-  MPI_Status status;
-  int rank, i, size, count;
-  int send_offset, recv_offset;
-  int remainder, remainder_flag, remainder_offset;
-
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
-
-  /* make it compatible with all data type */
-  MPI_Aint extent;
-  extent = smpi_datatype_get_extent(dtype);
-
-  /* when communication size is smaller than number of process (not support) */
-  if (rcount < size) {
-    return mpi_coll_allreduce_fun(sbuf, rbuf, rcount, dtype, op, comm);
-  }
-
-  /* when communication size is not divisible by number of process: 
-     call the native implementation for the remain chunk at the end of the operation */
-  if (rcount % size != 0) {
-    remainder = rcount % size;
-    remainder_flag = 1;
-    remainder_offset = (rcount / size) * size * extent;
-  } else {
-    remainder = remainder_flag = remainder_offset = 0;
-  }
-
-  /* size of each point-to-point communication is equal to the size of the whole message
-     divided by number of processes
-   */
-  count = rcount / size;
-
-  /* our ALL-REDUCE implementation
-     1. copy (partial of)send_buf to recv_buf
-     2. use logical ring reduce-scatter
-     3. use logical ring all-gather 
-   */
-
-  // copy partial data
-  send_offset = ((rank - 1 + size) % size) * count * extent;
-  recv_offset = ((rank - 1 + size) % size) * count * extent;
-  smpi_mpi_sendrecv((char *) sbuf + send_offset, count, dtype, rank, tag - 1,
-               (char *) rbuf + recv_offset, count, dtype, rank, tag - 1, comm,
-               &status);
-
-  // reduce-scatter
-  for (i = 0; i < (size - 1); i++) {
-    send_offset = ((rank - 1 - i + size) % size) * count * extent;
-    recv_offset = ((rank - 2 - i + size) % size) * count * extent;
-    smpi_mpi_sendrecv((char *) rbuf + send_offset, count, dtype, ((rank + 1) % size),
-                 tag + i, (char *) rbuf + recv_offset, count, dtype,
-                 ((rank + size - 1) % size), tag + i, comm, &status);
-
-    // compute result to rbuf+recv_offset
-    smpi_op_apply(op, (char *)sbuf + recv_offset, (char *)rbuf + recv_offset, &count, &dtype);
-  }
-
-  // all-gather
-  for (i = 0; i < (size - 1); i++) {
-    send_offset = ((rank - i + size) % size) * count * extent;
-    recv_offset = ((rank - 1 - i + size) % size) * count * extent;
-    smpi_mpi_sendrecv((char *) rbuf + send_offset, count, dtype, ((rank + 1) % size),
-                 tag + i, (char *) rbuf + recv_offset, count, dtype,
-                 ((rank + size - 1) % size), tag + i, comm, &status);
-  }
-
-  /* when communication size is not divisible by number of process: 
-     call the native implementation for the remain chunk at the end of the operation */
-  if (remainder_flag) {
-    XBT_WARN("MPI_allreduce_NTS use default MPI_allreduce.");
-    smpi_mpi_allreduce((char *) sbuf + remainder_offset,
-                         (char *) rbuf + remainder_offset, remainder, dtype, op,
-                         comm);
-    return MPI_SUCCESS;    
-  }
-
-  return MPI_SUCCESS;
-}
index 81cb392..664c707 100644 (file)
@@ -17,14 +17,14 @@ int
 smpi_coll_tuned_allreduce_lr(void *sbuf, void *rbuf, int rcount,
                              MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_ALLREDUCE;
   MPI_Status status;
   int rank, i, size, count;
   int send_offset, recv_offset;
   int remainder, remainder_flag, remainder_offset;
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* make it compatible with all data type */
   MPI_Aint extent;
index 9d5ee9c..6024607 100644 (file)
@@ -4,7 +4,7 @@ int smpi_coll_tuned_allreduce_rab_rdb(void *sbuff, void *rbuff, int count,
                                       MPI_Datatype dtype, MPI_Op op,
                                       MPI_Comm comm)
 {
-  int nprocs, rank, tag = 543;
+  int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst, i,
       send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
   MPI_Aint extent;
diff --git a/src/smpi/colls/allreduce-rab-reduce-scatter.c b/src/smpi/colls/allreduce-rab-reduce-scatter.c
deleted file mode 100644 (file)
index 5650ef2..0000000
+++ /dev/null
@@ -1,521 +0,0 @@
-#include "colls_private.h"
-#ifndef REDUCE_STUFF
-#define REDUCE_STUFF
-/*****************************************************************************
-
-Copyright (c) 2006, Ahmad Faraj & Xin Yuan,
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-  * Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimer in the documentation
-    and/or other materials provided with the distribution.
-
-  * Neither the name of the Florida State University nor the names of its
-    contributors may be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-  *************************************************************************
-  *     Any results obtained from executing this software require the     *
-  *     acknowledgment and citation of the software and its owners.       *
-  *     The full citation is given below:                                 *
-  *                                                                       *
-  *     A. Faraj and X. Yuan. "Automatic Generation and Tuning of MPI     *
-  *     Collective Communication Routines." The 19th ACM International    *
-  *     Conference on Supercomputing (ICS), Cambridge, Massachusetts,     *
-  *     June 20-22, 2005.                                                 *
-  *************************************************************************
-
-*****************************************************************************/
-
-extern MPI_User_function *MPIR_Op_table[];
-
-
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*  $Id: mpich-stuff.h,v 1.1 2005/08/22 19:50:21 faraj Exp $
- *
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#ifndef _MPICH_STUFF_H
-#define _MPICH_STUFF_H
-
-/*TOpaqOverview.tex
-  MPI Opaque Objects:
-
-  MPI Opaque objects such as 'MPI_Comm' or 'MPI_Datatype' are specified by 
-  integers (in the MPICH2 implementation); the MPI standard calls these
-  handles.  
-  Out of range values are invalid; the value 0 is reserved.
-  For most (with the possible exception of 
-  'MPI_Request' for performance reasons) MPI Opaque objects, the integer
-  encodes both the kind of object (allowing runtime tests to detect a datatype
-  passed where a communicator is expected) and important properties of the 
-  object.  Even the 'MPI_xxx_NULL' values should be encoded so that 
-  different null handles can be distinguished.  The details of the encoding
-  of the handles is covered in more detail in the MPICH2 Design Document.
-  For the most part, the ADI uses pointers to the underlying structures
-  rather than the handles themselves.  However, each structure contains an 
-  'handle' field that is the corresponding integer handle for the MPI object.
-
-  MPID objects (objects used within the implementation of MPI) are not opaque.
-
-  T*/
-
-/* Known MPI object types.  These are used for both the error handlers 
-   and for the handles.  This is a 4 bit value.  0 is reserved for so 
-   that all-zero handles can be flagged as an error. */
-/*E
-  MPID_Object_kind - Object kind (communicator, window, or file)
-
-  Notes:
-  This enum is used by keyvals and errhandlers to indicate the type of
-  object for which MPI opaque types the data is valid.  These are defined
-  as bits to allow future expansion to the case where an object is value for
-  multiple types (for example, we may want a universal error handler for 
-  errors return).  This is also used to indicate the type of MPI object a 
-  MPI handle represents.  It is an enum because only this applies only the
-  the MPI objects.
-
-  Module:
-  Attribute-DS
-  E*/
-typedef enum MPID_Object_kind {
-  MPID_COMM = 0x1,
-  MPID_GROUP = 0x2,
-  MPID_DATATYPE = 0x3,
-  MPID_FILE = 0x4,
-  MPID_ERRHANDLER = 0x5,
-  MPID_OP = 0x6,
-  MPID_INFO = 0x7,
-  MPID_WIN = 0x8,
-  MPID_KEYVAL = 0x9,
-  MPID_ATTR = 0xa,
-  MPID_REQUEST = 0xb
-} MPID_Object_kind;
-/* The above objects should correspond to MPI objects only. */
-#define HANDLE_MPI_KIND_SHIFT 26
-#define HANDLE_GET_MPI_KIND(a) ( ((a)&0x3c000000) >> HANDLE_MPI_KIND_SHIFT )
-
-/* Handle types.  These are really 2 bits */
-#define HANDLE_KIND_INVALID  0x0
-#define HANDLE_KIND_BUILTIN  0x1
-#define HANDLE_KIND_DIRECT   0x2
-#define HANDLE_KIND_INDIRECT 0x3
-/* Mask assumes that ints are at least 4 bytes */
-#define HANDLE_KIND_MASK 0xc0000000
-#define HANDLE_KIND_SHIFT 30
-#define HANDLE_GET_KIND(a) (((a)&HANDLE_KIND_MASK)>>HANDLE_KIND_SHIFT)
-#define HANDLE_SET_KIND(a,kind) ((a)|((kind)<<HANDLE_KIND_SHIFT))
-
-/* For indirect, the remainder of the handle has a block and index */
-#define HANDLE_INDIRECT_SHIFT 16
-#define HANDLE_BLOCK(a) (((a)& 0x03FF0000) >> HANDLE_INDIRECT_SHIFT)
-#define HANDLE_BLOCK_INDEX(a) ((a) & 0x0000FFFF)
-
-/* Handle block is between 1 and 1024 *elements* */
-#define HANDLE_BLOCK_SIZE 256
-/* Index size is bewtween 1 and 65536 *elements* */
-#define HANDLE_BLOCK_INDEX_SIZE 1024
-
-/* For direct, the remainder of the handle is the index into a predefined 
-   block */
-#define HANDLE_MASK 0x03FFFFFF
-#define HANDLE_INDEX(a) ((a)& HANDLE_MASK)
-
-/* ALL objects have the handle as the first value. */
-/* Inactive (unused and stored on the appropriate avail list) objects 
-   have MPIU_Handle_common as the head */
-typedef struct MPIU_Handle_common {
-  int handle;
-  volatile int ref_count;       /* This field is used to indicate that the
-                                   object is not in use (see, e.g., 
-                                   MPID_Comm_valid_ptr) */
-  void *next;                   /* Free handles use this field to point to the next
-                                   free object */
-} MPIU_Handle_common;
-
-/* All *active* (in use) objects have the handle as the first value; objects
-   with referene counts have the reference count as the second value.
-   See MPIU_Object_add_ref and MPIU_Object_release_ref. */
-typedef struct MPIU_Handle_head {
-  int handle;
-  volatile int ref_count;
-} MPIU_Handle_head;
-
-/* This type contains all of the data, except for the direct array,
-   used by the object allocators. */
-typedef struct MPIU_Object_alloc_t {
-  MPIU_Handle_common *avail;    /* Next available object */
-  int initialized;              /* */
-  void *(*indirect)[];          /* Pointer to indirect object blocks */
-  int indirect_size;            /* Number of allocated indirect blocks */
-  MPID_Object_kind kind;        /* Kind of object this is for */
-  int size;                     /* Size of an individual object */
-  void *direct;                 /* Pointer to direct block, used 
-                                   for allocation */
-  int direct_size;              /* Size of direct block */
-} MPIU_Object_alloc_t;
-extern void *MPIU_Handle_obj_alloc(MPIU_Object_alloc_t *);
-extern void MPIU_Handle_obj_alloc_start(MPIU_Object_alloc_t *);
-extern void MPIU_Handle_obj_alloc_complete(MPIU_Object_alloc_t *, int init);
-extern void MPIU_Handle_obj_free(MPIU_Object_alloc_t *, void *);
-void *MPIU_Handle_get_ptr_indirect(int, MPIU_Object_alloc_t *);
-extern void *MPIU_Handle_direct_init(void *direct, int direct_size,
-                                     int obj_size, int handle_type);
-#endif
-#define MPID_Getb_ptr(kind,a,bmsk,ptr)                                  \
-{                                                                       \
-   switch (HANDLE_GET_KIND(a)) {                                        \
-      case HANDLE_KIND_BUILTIN:                                         \
-          ptr=MPID_##kind##_builtin+((a)&(bmsk));                       \
-          break;                                                        \
-      case HANDLE_KIND_DIRECT:                                          \
-          ptr=MPID_##kind##_direct+HANDLE_INDEX(a);                     \
-          break;                                                        \
-      case HANDLE_KIND_INDIRECT:                                        \
-          ptr=((MPID_##kind*)                                           \
-               MPIU_Handle_get_ptr_indirect(a,&MPID_##kind##_mem));     \
-          break;                                                        \
-      case HANDLE_KIND_INVALID:                                         \
-      default:                                                         \
-          ptr=0;                                                       \
-          break;                                                       \
-    }                                                                   \
-}
-
-
-
-#define MPID_Op_get_ptr(a,ptr)         MPID_Getb_ptr(Op,a,0x000000ff,ptr)
-typedef enum MPID_Lang_t { MPID_LANG_C
-#ifdef HAVE_FORTRAN_BINDING
-      , MPID_LANG_FORTRAN, MPID_LANG_FORTRAN90
-#endif
-#ifdef HAVE_CXX_BINDING
-      , MPID_LANG_CXX
-#endif
-} MPID_Lang_t;
-/* Reduction and accumulate operations */
-/*E
-  MPID_Op_kind - Enumerates types of MPI_Op types
-
-  Notes:
-  These are needed for implementing 'MPI_Accumulate', since only predefined
-  operations are allowed for that operation.  
-
-  A gap in the enum values was made allow additional predefined operations
-  to be inserted.  This might include future additions to MPI or experimental
-  extensions (such as a Read-Modify-Write operation).
-
-  Module:
-  Collective-DS
-  E*/
-typedef enum MPID_Op_kind { MPID_OP_MAX = 1, MPID_OP_MIN = 2,
-  MPID_OP_SUM = 3, MPID_OP_PROD = 4,
-  MPID_OP_LAND = 5, MPID_OP_BAND = 6, MPID_OP_LOR = 7, MPID_OP_BOR = 8,
-  MPID_OP_LXOR = 9, MPID_OP_BXOR = 10, MPID_OP_MAXLOC = 11,
-  MPID_OP_MINLOC = 12, MPID_OP_REPLACE = 13,
-  MPID_OP_USER_NONCOMMUTE = 32, MPID_OP_USER = 33
-} MPID_Op_kind;
-
-/*S
-  MPID_User_function - Definition of a user function for MPI_Op types.
-
-  Notes:
-  This includes a 'const' to make clear which is the 'in' argument and 
-  which the 'inout' argument, and to indicate that the 'count' and 'datatype'
-  arguments are unchanged (they are addresses in an attempt to allow 
-  interoperation with Fortran).  It includes 'restrict' to emphasize that 
-  no overlapping operations are allowed.
-
-  We need to include a Fortran version, since those arguments will
-  have type 'MPI_Fint *' instead.  We also need to add a test to the
-  test suite for this case; in fact, we need tests for each of the handle
-  types to ensure that the transfered handle works correctly.
-
-  This is part of the collective module because user-defined operations
-  are valid only for the collective computation routines and not for 
-  RMA accumulate.
-
-  Yes, the 'restrict' is in the correct location.  C compilers that 
-  support 'restrict' should be able to generate code that is as good as a
-  Fortran compiler would for these functions.
-
-  We should note on the manual pages for user-defined operations that
-  'restrict' should be used when available, and that a cast may be 
-  required when passing such a function to 'MPI_Op_create'.
-
-  Question:
-  Should each of these function types have an associated typedef?
-
-  Should there be a C++ function here?
-
-  Module:
-  Collective-DS
-  S*/
-typedef union MPID_User_function {
-  void (*c_function) (const void *, void *, const int *, const MPI_Datatype *);
-  void (*f77_function) (const void *, void *,
-                        const MPI_Fint *, const MPI_Fint *);
-} MPID_User_function;
-/* FIXME: Should there be "restrict" in the definitions above, e.g., 
-   (*c_function)( const void restrict * , void restrict *, ... )? */
-
-/*S
-  MPID_Op - MPI_Op structure
-
-  Notes:
-  All of the predefined functions are commutative.  Only user functions may 
-  be noncummutative, so there are two separate op types for commutative and
-  non-commutative user-defined operations.
-
-  Operations do not require reference counts because there are no nonblocking
-  operations that accept user-defined operations.  Thus, there is no way that
-  a valid program can free an 'MPI_Op' while it is in use.
-
-  Module:
-  Collective-DS
-  S*/
-typedef struct MPID_Op {
-  int handle;                   /* value of MPI_Op for this structure */
-  volatile int ref_count;
-  MPID_Op_kind kind;
-  MPID_Lang_t language;
-  MPID_User_function function;
-} MPID_Op;
-#define MPID_OP_N_BUILTIN 14
-extern MPID_Op MPID_Op_builtin[MPID_OP_N_BUILTIN];
-extern MPID_Op MPID_Op_direct[];
-extern MPIU_Object_alloc_t MPID_Op_mem;
-
-/*****************************************************************************
-
-* Function: get_op_func
-
-* return: Pointer to MPI_User_function
-
-* inputs:
-   op: operator (max, min, etc)
-
-   * Descrp: Function returns the function associated with current operator
-   * op.
-
-   * Auther: AHMAD FARAJ
-
-****************************************************************************/
-MPI_User_function *get_op_func(MPI_Op op)
-{
-
-  if (HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN)
-    return MPIR_Op_table[op % 16 - 1];
-  return NULL;
-}
-
-#endif
-
-
-int smpi_coll_tuned_allreduce_rab_reduce_scatter(void *sbuff, void *rbuff,
-                                                 int count, MPI_Datatype dtype,
-                                                 MPI_Op op, MPI_Comm comm)
-{
-  int nprocs, rank, type_size, tag = 543;
-  int mask, dst, pof2, newrank, rem, newdst, i,
-      send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
-  MPI_Aint lb, extent;
-  MPI_Status status;
-  void *tmp_buf = NULL;
-  MPI_User_function *func = get_op_func(op);
-  nprocs = smpi_comm_size(comm);
-  rank = smpi_comm_rank(comm);
-
-  extent = smpi_datatype_get_extent(dtype);
-  tmp_buf = (void *) xbt_malloc(count * extent);
-
-  MPIR_Localcopy(sbuff, count, dtype, rbuff, count, dtype);
-
-  type_size = smpi_datatype_size(dtype);
-
-  // find nearest power-of-two less than or equal to comm_size
-  pof2 = 1;
-  while (pof2 <= nprocs)
-    pof2 <<= 1;
-  pof2 >>= 1;
-
-  rem = nprocs - pof2;
-
-  // In the non-power-of-two case, all even-numbered
-  // processes of rank < 2*rem send their data to
-  // (rank+1). These even-numbered processes no longer
-  // participate in the algorithm until the very end. The
-  // remaining processes form a nice power-of-two. 
-
-  if (rank < 2 * rem) {
-    // even       
-    if (rank % 2 == 0) {
-
-      MPIC_Send(rbuff, count, dtype, rank + 1, tag, comm);
-
-      // temporarily set the rank to -1 so that this
-      // process does not pariticipate in recursive
-      // doubling
-      newrank = -1;
-    } else                      // odd
-    {
-      MPIC_Recv(tmp_buf, count, dtype, rank - 1, tag, comm, &status);
-      // do the reduction on received data. since the
-      // ordering is right, it doesn't matter whether
-      // the operation is commutative or not.
-      (*func) (tmp_buf, rbuff, &count, &dtype);
-
-      // change the rank 
-      newrank = rank / 2;
-    }
-  }
-
-  else                          // rank >= 2 * rem 
-    newrank = rank - rem;
-
-  // If op is user-defined or count is less than pof2, use
-  // recursive doubling algorithm. Otherwise do a reduce-scatter
-  // followed by allgather. (If op is user-defined,
-  // derived datatypes are allowed and the user could pass basic
-  // datatypes on one process and derived on another as long as
-  // the type maps are the same. Breaking up derived
-  // datatypes to do the reduce-scatter is tricky, therefore
-  // using recursive doubling in that case.) 
-
-  if (newrank != -1) {
-    // do a reduce-scatter followed by allgather. for the
-    // reduce-scatter, calculate the count that each process receives
-    // and the displacement within the buffer 
-
-    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
-    disps = (int *) xbt_malloc(pof2 * sizeof(int));
-
-    for (i = 0; i < (pof2 - 1); i++)
-      cnts[i] = count / pof2;
-    cnts[pof2 - 1] = count - (count / pof2) * (pof2 - 1);
-
-    disps[0] = 0;
-    for (i = 1; i < pof2; i++)
-      disps[i] = disps[i - 1] + cnts[i - 1];
-
-    mask = 0x1;
-    send_idx = recv_idx = 0;
-    last_idx = pof2;
-    while (mask < pof2) {
-      newdst = newrank ^ mask;
-      // find real rank of dest 
-      dst = (newdst < rem) ? newdst * 2 + 1 : newdst + rem;
-
-      send_cnt = recv_cnt = 0;
-      if (newrank < newdst) {
-        send_idx = recv_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < last_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < send_idx; i++)
-          recv_cnt += cnts[i];
-      } else {
-        recv_idx = send_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < recv_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < last_idx; i++)
-          recv_cnt += cnts[i];
-      }
-
-      // Send data from recvbuf. Recv into tmp_buf 
-      MPIC_Sendrecv((char *) rbuff + disps[send_idx] * extent, send_cnt,
-                    dtype, dst, tag,
-                    (char *) tmp_buf + disps[recv_idx] * extent, recv_cnt,
-                    dtype, dst, tag, comm, &status);
-
-      // tmp_buf contains data received in this step.
-      // recvbuf contains data accumulated so far 
-
-      // This algorithm is used only for predefined ops
-      // and predefined ops are always commutative.
-      (*func) ((char *) tmp_buf + disps[recv_idx] * extent,
-               (char *) rbuff + disps[recv_idx] * extent, &recv_cnt, &dtype);
-
-      // update send_idx for next iteration 
-      send_idx = recv_idx;
-      mask <<= 1;
-
-      // update last_idx, but not in last iteration because the value
-      // is needed in the allgather step below. 
-      if (mask < pof2)
-        last_idx = recv_idx + pof2 / mask;
-    }
-
-    // now do the allgather 
-
-    mask >>= 1;
-    while (mask > 0) {
-      newdst = newrank ^ mask;
-      // find real rank of dest
-      dst = (newdst < rem) ? newdst * 2 + 1 : newdst + rem;
-
-      send_cnt = recv_cnt = 0;
-      if (newrank < newdst) {
-        // update last_idx except on first iteration 
-        if (mask != pof2 / 2)
-          last_idx = last_idx + pof2 / (mask * 2);
-
-        recv_idx = send_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < recv_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < last_idx; i++)
-          recv_cnt += cnts[i];
-      } else {
-        recv_idx = send_idx - pof2 / (mask * 2);
-        for (i = send_idx; i < last_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < send_idx; i++)
-          recv_cnt += cnts[i];
-      }
-
-      MPIC_Sendrecv((char *) rbuff + disps[send_idx] * extent, send_cnt,
-                    dtype, dst, tag,
-                    (char *) rbuff + disps[recv_idx] * extent, recv_cnt,
-                    dtype, dst, tag, comm, &status);
-
-      if (newrank > newdst)
-        send_idx = recv_idx;
-
-      mask >>= 1;
-    }
-
-    free(cnts);
-    free(disps);
-
-  }
-  // In the non-power-of-two case, all odd-numbered processes of
-  // rank < 2 * rem send the result to (rank-1), the ranks who didn't
-  // participate above.
-
-  if (rank < 2 * rem) {
-    if (rank % 2)               // odd 
-      MPIC_Send(rbuff, count, dtype, rank - 1, tag, comm);
-    else                        // even 
-      MPIC_Recv(rbuff, count, dtype, rank + 1, tag, comm, &status);
-  }
-
-  free(tmp_buf);
-  return MPI_SUCCESS;
-}
diff --git a/src/smpi/colls/allreduce-rab-rsag.c b/src/smpi/colls/allreduce-rab-rsag.c
deleted file mode 100644 (file)
index 34e23d6..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-#include "colls_private.h"
-//#include <star-reduction.c>
-
-int smpi_coll_tuned_allreduce_rab_rsag(void *sbuff, void *rbuff, int count,
-                                       MPI_Datatype dtype, MPI_Op op,
-                                       MPI_Comm comm)
-{
-  int nprocs, rank, tag = 543;
-  int mask, dst, pof2, newrank, rem, newdst, i,
-      send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
-  MPI_Aint extent;
-  MPI_Status status;
-  void *tmp_buf = NULL;
-  nprocs = smpi_comm_size(comm);
-  rank = smpi_comm_rank(comm);
-
-  extent = smpi_datatype_get_extent(dtype);
-  tmp_buf = (void *) xbt_malloc(count * extent);
-
-  smpi_mpi_sendrecv(sbuff, count, dtype, rank, tag, rbuff, count, dtype, rank, tag,
-               comm, &status);
-
-  // find nearest power-of-two less than or equal to comm_size
-  pof2 = 1;
-  while (pof2 <= nprocs)
-    pof2 <<= 1;
-  pof2 >>= 1;
-
-  rem = nprocs - pof2;
-
-  // In the non-power-of-two case, all even-numbered
-  // processes of rank < 2*rem send their data to
-  // (rank+1). These even-numbered processes no longer
-  // participate in the algorithm until the very end. The
-  // remaining processes form a nice power-of-two. 
-
-  if (rank < 2 * rem) {
-    // even       
-    if (rank % 2 == 0) {
-
-      smpi_mpi_send(rbuff, count, dtype, rank + 1, tag, comm);
-
-      // temporarily set the rank to -1 so that this
-      // process does not pariticipate in recursive
-      // doubling
-      newrank = -1;
-    } else                      // odd
-    {
-      smpi_mpi_recv(tmp_buf, count, dtype, rank - 1, tag, comm, &status);
-      // do the reduction on received data. since the
-      // ordering is right, it doesn't matter whether
-      // the operation is commutative or not.
-      smpi_op_apply(op, tmp_buf, rbuff, &count, &dtype);
-
-      // change the rank 
-      newrank = rank / 2;
-    }
-  }
-
-  else                          // rank >= 2 * rem 
-    newrank = rank - rem;
-
-  // If op is user-defined or count is less than pof2, use
-  // recursive doubling algorithm. Otherwise do a reduce-scatter
-  // followed by allgather. (If op is user-defined,
-  // derived datatypes are allowed and the user could pass basic
-  // datatypes on one process and derived on another as long as
-  // the type maps are the same. Breaking up derived
-  // datatypes to do the reduce-scatter is tricky, therefore
-  // using recursive doubling in that case.) 
-
-  if (newrank != -1) {
-    // do a reduce-scatter followed by allgather. for the
-    // reduce-scatter, calculate the count that each process receives
-    // and the displacement within the buffer 
-
-    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
-    disps = (int *) xbt_malloc(pof2 * sizeof(int));
-
-    for (i = 0; i < (pof2 - 1); i++)
-      cnts[i] = count / pof2;
-    cnts[pof2 - 1] = count - (count / pof2) * (pof2 - 1);
-
-    disps[0] = 0;
-    for (i = 1; i < pof2; i++)
-      disps[i] = disps[i - 1] + cnts[i - 1];
-
-    mask = 0x1;
-    send_idx = recv_idx = 0;
-    last_idx = pof2;
-    while (mask < pof2) {
-      newdst = newrank ^ mask;
-      // find real rank of dest 
-      dst = (newdst < rem) ? newdst * 2 + 1 : newdst + rem;
-
-      send_cnt = recv_cnt = 0;
-      if (newrank < newdst) {
-        send_idx = recv_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < last_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < send_idx; i++)
-          recv_cnt += cnts[i];
-      } else {
-        recv_idx = send_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < recv_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < last_idx; i++)
-          recv_cnt += cnts[i];
-      }
-
-      // Send data from recvbuf. Recv into tmp_buf 
-      smpi_mpi_sendrecv((char *) rbuff + disps[send_idx] * extent, send_cnt,
-                   dtype, dst, tag,
-                   (char *) tmp_buf + disps[recv_idx] * extent, recv_cnt,
-                   dtype, dst, tag, comm, &status);
-
-      // tmp_buf contains data received in this step.
-      // recvbuf contains data accumulated so far 
-
-      // This algorithm is used only for predefined ops
-      // and predefined ops are always commutative.
-      smpi_op_apply(op, (char *) tmp_buf + disps[recv_idx] * extent,
-                     (char *) rbuff + disps[recv_idx] * extent,
-                     &recv_cnt, &dtype);
-
-      // update send_idx for next iteration 
-      send_idx = recv_idx;
-      mask <<= 1;
-
-      // update last_idx, but not in last iteration because the value
-      // is needed in the allgather step below. 
-      if (mask < pof2)
-        last_idx = recv_idx + pof2 / mask;
-    }
-
-    // now do the allgather 
-
-    mask >>= 1;
-    while (mask > 0) {
-      newdst = newrank ^ mask;
-      // find real rank of dest
-      dst = (newdst < rem) ? newdst * 2 + 1 : newdst + rem;
-
-      send_cnt = recv_cnt = 0;
-      if (newrank < newdst) {
-        // update last_idx except on first iteration 
-        if (mask != pof2 / 2)
-          last_idx = last_idx + pof2 / (mask * 2);
-
-        recv_idx = send_idx + pof2 / (mask * 2);
-        for (i = send_idx; i < recv_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < last_idx; i++)
-          recv_cnt += cnts[i];
-      } else {
-        recv_idx = send_idx - pof2 / (mask * 2);
-        for (i = send_idx; i < last_idx; i++)
-          send_cnt += cnts[i];
-        for (i = recv_idx; i < send_idx; i++)
-          recv_cnt += cnts[i];
-      }
-
-      smpi_mpi_sendrecv((char *) rbuff + disps[send_idx] * extent, send_cnt,
-                   dtype, dst, tag,
-                   (char *) rbuff + disps[recv_idx] * extent, recv_cnt,
-                   dtype, dst, tag, comm, &status);
-
-      if (newrank > newdst)
-        send_idx = recv_idx;
-
-      mask >>= 1;
-    }
-
-    free(cnts);
-    free(disps);
-
-  }
-  // In the non-power-of-two case, all odd-numbered processes of
-  // rank < 2 * rem send the result to (rank-1), the ranks who didn't
-  // participate above.
-
-  if (rank < 2 * rem) {
-    if (rank % 2)               // odd 
-      smpi_mpi_send(rbuff, count, dtype, rank - 1, tag, comm);
-    else                        // even 
-      smpi_mpi_recv(rbuff, count, dtype, rank + 1, tag, comm, &status);
-  }
-
-  free(tmp_buf);
-  return MPI_SUCCESS;
-}
index ae72f74..66862da 100644 (file)
@@ -8,7 +8,7 @@ int smpi_coll_tuned_allreduce_rab1(void *sbuff, void *rbuff,
 {
   MPI_Status status;
   MPI_Aint extent;
-  int tag = 4321, rank, nprocs, send_size, newcnt, share;
+  int tag = COLL_TAG_ALLREDUCE, rank, nprocs, send_size, newcnt, share;
   int pof2 = 1, mask, send_idx, recv_idx, dst, send_cnt, recv_cnt;
 
   void *recv, *tmp_buf;
index 44717ad..23e7e30 100644 (file)
@@ -4,7 +4,7 @@
 int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
                                   MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
-  int nprocs, rank, tag = 543;
+  int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst;
   MPI_Aint extent, lb;
   MPI_Status status;
index 69c552d..ca9b8fc 100644 (file)
@@ -4,7 +4,7 @@ int smpi_coll_tuned_allreduce_redbcast(void *buf, void *buf2, int count,
                                        MPI_Datatype datatype, MPI_Op op,
                                        MPI_Comm comm)
 {
-  smpi_mpi_reduce(buf, buf2, count, datatype, op, 0, comm);
-  smpi_mpi_bcast(buf2, count, datatype, 0, comm);
+  mpi_coll_reduce_fun(buf, buf2, count, datatype, op, 0, comm);
+  mpi_coll_bcast_fun(buf2, count, datatype, 0, comm);
   return MPI_SUCCESS;
 }
index 93d72bb..68c99f5 100644 (file)
@@ -43,7 +43,7 @@ int smpi_coll_tuned_allreduce_smp_binomial_pipeline(void *send_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index ed9b68c..77a5abc 100644 (file)
@@ -32,7 +32,7 @@ int smpi_coll_tuned_allreduce_smp_binomial(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   int num_core = NUM_CORE;
   MPI_Status status;
index d208584..b6def2e 100644 (file)
@@ -31,7 +31,7 @@ int smpi_coll_tuned_allreduce_smp_rdb(void *send_buf, void *recv_buf, int count,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index fd49327..ce90781 100644 (file)
@@ -20,7 +20,7 @@ int smpi_coll_tuned_allreduce_smp_rsag_lr(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index c98b78d..cec7521 100644 (file)
@@ -23,7 +23,7 @@ int smpi_coll_tuned_allreduce_smp_rsag_rab(void *sbuf, void *rbuf, int count,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index 24ccaa0..573f5c6 100644 (file)
@@ -19,7 +19,7 @@ int smpi_coll_tuned_allreduce_smp_rsag(void *send_buf, void *recv_buf,
 {
   int comm_size, rank;
   void *tmp_buf;
-  int tag = 50;
+  int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
   int num_core = NUM_CORE;
index 61ea21e..08f4db2 100644 (file)
@@ -60,7 +60,7 @@ int smpi_coll_tuned_alltoall_2dmesh(void *send_buff, int send_count,
   int i, j, src, dst, rank, num_procs, count, num_reqs;
   int X, Y, send_offset, recv_offset;
   int my_row_base, my_col_base, src_row_base, block_size;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index ca10de7..c226927 100644 (file)
@@ -50,7 +50,7 @@ int smpi_coll_tuned_alltoall_3dmesh(void *send_buff, int send_count,
   MPI_Status status, *statuses;
   int i, j, src, dst, rank, num_procs, num_reqs, X, Y, Z, block_size, count;
   int my_z, two_dsize, my_row_base, my_col_base, my_z_base, src_row_base;
-  int src_z_base, send_offset, recv_offset, tag = 1;
+  int src_z_base, send_offset, recv_offset, tag = COLL_TAG_ALLTOALL;
 
   char *tmp_buff1, *tmp_buff2;
 
index d38b3e5..9e3117c 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_bruck(void *send_buff, int send_count,
 
   int *blocks_length, *disps;
   int i, src, dst, rank, num_procs, count, remainder, block, position;
-  int pack_size, tag = 1, pof2 = 1;
+  int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
 
 
   char *tmp_buff;
index 96cf68d..65ae5f8 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoall_pair_light_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_partner;
-  int tag = 1;     /*, failure = 0; */
+  int tag = COLL_TAG_ALLTOALL;     /*, failure = 0; */
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index f12c3f9..20dd573 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_pair_mpi_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 101;
+  int tag = COLL_TAG_ALLTOALL;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
@@ -44,7 +44,7 @@ smpi_coll_tuned_alltoall_pair_mpi_barrier(void *send_buff, int send_count,
 
   for (i = 0; i < num_procs; i++) {
     src = dst = rank ^ i;
-    smpi_mpi_barrier(comm);
+    mpi_coll_barrier_fun(comm);
     smpi_mpi_sendrecv(send_ptr + dst * send_chunk, send_count, send_type, dst,
                  tag, recv_ptr + src * recv_chunk, recv_count, recv_type,
                  src, tag, comm, &s);
index 19e693d..209fa81 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoall_pair_one_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
@@ -43,7 +43,7 @@ smpi_coll_tuned_alltoall_pair_one_barrier(void *send_buff, int send_count,
   send_chunk *= send_count;
   recv_chunk *= recv_count;
 
-  smpi_mpi_barrier(comm);
+  mpi_coll_barrier_fun(comm);
   for (i = 0; i < num_procs; i++) {
     src = dst = rank ^ i;
     smpi_mpi_sendrecv(send_ptr + dst * send_chunk, send_count, send_type, dst,
index 24ef5f7..66c4767 100644 (file)
@@ -68,7 +68,7 @@ int smpi_coll_tuned_alltoall_pair(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index 45b529f..9c0b9cc 100644 (file)
@@ -33,7 +33,7 @@ int smpi_coll_tuned_alltoall_rdb(void *send_buff, int send_count,
   int dst_tree_root, rank_tree_root, send_offset, recv_offset;
   int rank, num_procs, j, k, dst, curr_size, max_size;
   int last_recv_count = 0, tmp_mask, tree_root, num_procs_completed;
-  int tag = 1, mask = 1, i = 0;
+  int tag = COLL_TAG_ALLTOALL, mask = 1, i = 0;
 
   char *tmp_buff;
   char *send_ptr = (char *) send_buff;
index d45912b..df280bb 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoall_ring_light_barrier(void *send_buff, int send_count,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_dst, next_src;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index e3a3f2d..469127a 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoall_ring_mpi_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
@@ -46,7 +46,7 @@ smpi_coll_tuned_alltoall_ring_mpi_barrier(void *send_buff, int send_count,
     src = (rank - i + num_procs) % num_procs;
     dst = (rank + i) % num_procs;
 
-    smpi_mpi_barrier(comm);
+    mpi_coll_barrier_fun(comm);
     smpi_mpi_sendrecv(send_ptr + dst * send_chunk, send_count, send_type, dst,
                  tag, recv_ptr + src * recv_chunk, recv_count, recv_type,
                  src, tag, comm, &s);
index 97b912b..677008c 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoall_ring_one_barrier(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
@@ -41,7 +41,7 @@ smpi_coll_tuned_alltoall_ring_one_barrier(void *send_buff, int send_count,
   send_chunk *= send_count;
   recv_chunk *= recv_count;
 
-  smpi_mpi_barrier(comm);
+  mpi_coll_barrier_fun(comm);
   for (i = 0; i < num_procs; i++) {
     src = (rank - i + num_procs) % num_procs;
     dst = (rank + i) % num_procs;
index 622fd9d..16ba29c 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoall_ring(void *send_buff, int send_count,
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 11;
+  int tag = COLL_TAG_ALLTOALL;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
diff --git a/src/smpi/colls/alltoall-simple.c b/src/smpi/colls/alltoall-simple.c
deleted file mode 100644 (file)
index fa50a8c..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#include "colls_private.h"
-
-/*****************************************************************************
-
- * Function: alltoall_spreading_simple
-
- * Return: int
-
- *  Inputs:
-    send_buff: send input buffer
-    send_count: number of elements to send
-    send_type: data type of elements being sent
-    recv_buff: receive output buffer
-    recv_count: number of elements to received
-    recv_type: data type of elements being received
-    comm: communicator
-
- * Descrp: Let i -> j denote the communication from node i to node j. The
-          order of communications for node i is i -> i + 1, i -> i + 2, ...,
-          i -> (i + p -1) % P.
- * Auther: Ahmad Faraj
-
- ****************************************************************************/
-int smpi_coll_tuned_alltoall_simple(void *send_buff, int send_count,
-                                    MPI_Datatype send_type,
-                                    void *recv_buff, int recv_count,
-                                    MPI_Datatype recv_type, MPI_Comm comm)
-{
-  int i, rank, size, nreqs, src, dst, tag = 101;
-  char *psnd;
-  char *prcv;
-  MPI_Aint sndinc;
-  MPI_Aint rcvinc;
-  MPI_Request *req;
-  MPI_Request *preq;
-  MPI_Request *qreq;
-  MPI_Status s, *statuses;
-
-
-  size = smpi_comm_size(comm);
-  rank = smpi_comm_rank(comm);
-  sndinc = smpi_datatype_get_extent(send_type);
-  rcvinc = smpi_datatype_get_extent(recv_type);
-  sndinc *= send_count;
-  rcvinc *= recv_count;
-
-  /* Allocate arrays of requests. */
-
-  nreqs = 2 * (size - 1);
-  if (nreqs > 0) {
-    req = (MPI_Request *) xbt_malloc(nreqs * sizeof(MPI_Request));
-    statuses = (MPI_Status *) xbt_malloc(nreqs * sizeof(MPI_Status));
-  } else {
-    req = NULL;
-    statuses = NULL;
-  }
-
-  /* simple optimization */
-
-  psnd = ((char *) send_buff) + (rank * sndinc);
-  prcv = ((char *) recv_buff) + (rank * rcvinc);
-  smpi_mpi_sendrecv(psnd, send_count, send_type, rank, tag,
-               prcv, recv_count, recv_type, rank, tag, comm, &s);
-
-
-  /* Initiate all send/recv to/from others. */
-
-  preq = req;
-  qreq = req + size - 1;
-  prcv = (char *) recv_buff;
-  psnd = (char *) send_buff;
-  for (i = 0; i < size; i++) {
-    src = dst = (rank + i) % size;
-    if (src == rank)
-      continue;
-    if (dst == rank)
-      continue;
-    *(preq++) = smpi_mpi_recv_init(prcv + (src * rcvinc), recv_count, recv_type, src,
-                  tag, comm);
-    *(qreq++) = smpi_mpi_send_init(psnd + (dst * sndinc), send_count, send_type, dst,
-                  tag, comm);
-  }
-
-  /* Start all the requests. */
-
-  smpi_mpi_startall(nreqs, req);
-
-  /* Wait for them all. */
-
-  smpi_mpi_waitall(nreqs, req, statuses);
-
-
-  /* All done */
-
-  if (req)
-    xbt_free((char *) req);
-  if (statuses)
-    xbt_free(statuses);
-  return MPI_SUCCESS;
-}
index 0296798..656b373 100644 (file)
@@ -12,7 +12,7 @@ int smpi_coll_tuned_alltoallv_bruck(void *sendbuf, int *sendcounts, int *senddis
                                    int *recvcounts, int *recvdisps, MPI_Datatype recvtype,
                                    MPI_Comm comm)
 {
-  int system_tag = 777;
+  int system_tag = COLL_TAG_ALLTOALLV;
   int i, rank, size, err, count;
   MPI_Aint lb;
   MPI_Aint sendext = 0;
@@ -28,43 +28,59 @@ int smpi_coll_tuned_alltoallv_bruck(void *sendbuf, int *sendcounts, int *senddis
   err = smpi_datatype_extent(recvtype, &lb, &recvext);
   /* Local copy from self */
   err =
-      smpi_datatype_copy((char *)sendbuf + senddisps[rank] * sendext, 
-                         sendcounts[rank], sendtype, 
+      smpi_datatype_copy((char *)sendbuf + senddisps[rank] * sendext,
+                         sendcounts[rank], sendtype,
                          (char *)recvbuf + recvdisps[rank] * recvext,
                          recvcounts[rank], recvtype);
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
-    requests = xbt_new(MPI_Request, 2 * (size - 1));
-    count = 0;
-    /* Create all receives that will be posted first */
-    for (i = 0; i < size; ++i) {
-      if (i == rank) {
-        XBT_DEBUG("<%d> skip request creation [src = %d, recvcount = %d]",
-               rank, i, recvcounts[i]);
-        continue;
-      }
-      requests[count] =
-          smpi_irecv_init((char *)recvbuf + recvdisps[i] * recvext, recvcounts[i],
-                          recvtype, i, system_tag, comm);
-      count++;
-    }
-    /* Now create all sends  */
-    for (i = 0; i < size; ++i) {
-      if (i == rank) {
-        XBT_DEBUG("<%d> skip request creation [dst = %d, sendcount = %d]",
-               rank, i, sendcounts[i]);
-        continue;
-      }
-      requests[count] =
-          smpi_isend_init((char *)sendbuf + senddisps[i] * sendext, sendcounts[i],
-                          sendtype, i, system_tag, comm);
-      count++;
-    }
-    /* Wait for them all. */
-    smpi_mpi_startall(count, requests);
-    XBT_DEBUG("<%d> wait for %d requests", rank, count);
-    smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
-    xbt_free(requests);
+
+      int bblock = 4;//MPIR_PARAM_ALLTOALL_THROTTLE
+      //if (bblock == 0) bblock = comm_size;
+
+
+     // requests = xbt_new(MPI_Request, 2 * (bblock - 1));
+      int ii, ss, dst;
+      /* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
+      for (ii=0; ii<size; ii+=bblock) {
+          requests = xbt_new(MPI_Request, 2 * (bblock ));
+
+          ss = size-ii < bblock ? size-ii : bblock;
+          count = 0;
+
+          /* do the communication -- post ss sends and receives: */
+          for ( i=0; i<ss; i++ ) {
+            dst = (rank+i+ii) % size;
+              if (dst == rank) {
+                XBT_DEBUG("<%d> skip request creation [src = %d, recvcount = %d]",
+                       rank, i, recvcounts[dst]);
+                continue;
+              }
+
+              requests[count]=smpi_mpi_irecv((char *)recvbuf + recvdisps[dst] * recvext, recvcounts[dst],
+                                  recvtype, dst, system_tag, comm );
+              count++;
+            }
+            /* Now create all sends  */
+          for ( i=0; i<ss; i++ ) {
+              dst = (rank-i-ii+size) % size;
+              if (dst == rank) {
+                XBT_DEBUG("<%d> skip request creation [dst = %d, sendcount = %d]",
+                       rank, i, sendcounts[dst]);
+                continue;
+              }
+              requests[count]=smpi_mpi_isend((char *)sendbuf + senddisps[dst] * sendext, sendcounts[dst],
+                                  sendtype, dst, system_tag, comm);
+              count++;
+            }
+            /* Wait for them all. */
+            //smpi_mpi_startall(count, requests);
+            XBT_DEBUG("<%d> wait for %d requests", rank, count);
+            smpi_mpi_waitall(count, requests, MPI_STATUSES_IGNORE);
+            xbt_free(requests);
+
+          }
+
   }
   return MPI_SUCCESS;
 }
diff --git a/src/smpi/colls/alltoallv-ompi-basic-linear.c b/src/smpi/colls/alltoallv-ompi-basic-linear.c
new file mode 100644 (file)
index 0000000..fe035ae
--- /dev/null
@@ -0,0 +1,100 @@
+
+#include "colls_private.h"
+/*  
+ * Linear functions are copied from the basic coll module.  For
+ * some small number of nodes and/or small data sizes they are just as
+ * fast as tuned/tree based segmenting operations and as such may be
+ * selected by the decision functions.  These are copied into this module
+ * due to the way we select modules in V1. i.e. in V2 we will handle this
+ * differently and so will not have to duplicate code.  
+ * GEF Oct05 after asking Jeff.  
+ */
+int
+smpi_coll_tuned_alltoallv_ompi_basic_linear(void *sbuf, int *scounts, int *sdisps,
+                                            MPI_Datatype sdtype,
+                                            void *rbuf, int *rcounts, int *rdisps,
+                                            MPI_Datatype rdtype,
+                                            MPI_Comm comm)
+{
+    int i, size, rank;
+    char *psnd, *prcv;
+    int nreqs;
+    ptrdiff_t sext, rext;
+    MPI_Request *preq;
+    size = smpi_comm_size(comm);
+    rank = smpi_comm_rank(comm);
+    MPI_Request *ireqs= xbt_malloc(sizeof(MPI_Request) * size * 2);
+    XBT_DEBUG(
+                 "coll:tuned:alltoallv_intra_basic_linear rank %d", rank);
+
+    sext=smpi_datatype_get_extent(sdtype);
+    rext=smpi_datatype_get_extent(rdtype);
+
+    /* Simple optimization - handle send to self first */
+    psnd = ((char *) sbuf) + (sdisps[rank] * sext);
+    prcv = ((char *) rbuf) + (rdisps[rank] * rext);
+    if (0 != scounts[rank]) {
+        smpi_datatype_copy(psnd, scounts[rank], sdtype,
+                              prcv, rcounts[rank], rdtype);
+    }
+
+    /* If only one process, we're done. */
+    if (1 == size) {
+        return MPI_SUCCESS;
+    }
+
+    /* Now, initiate all send/recv to/from others. */
+    nreqs = 0;
+    preq = ireqs;
+
+    /* Post all receives first */
+    for (i = 0; i < size; ++i) {
+        if (i == rank || 0 == rcounts[i]) {
+            continue;
+        }
+
+        prcv = ((char *) rbuf) + (rdisps[i] * rext);
+
+        *preq = smpi_irecv_init(prcv, rcounts[i], rdtype,
+                                      i, COLL_TAG_ALLTOALLV, comm
+                                      );
+        preq++;
+        ++nreqs;
+        
+    }
+
+    /* Now post all sends */
+    for (i = 0; i < size; ++i) {
+        if (i == rank || 0 == scounts[i]) {
+            continue;
+        }
+
+        psnd = ((char *) sbuf) + (sdisps[i] * sext);
+        *preq=smpi_isend_init(psnd, scounts[i], sdtype,
+                                      i, COLL_TAG_ALLTOALLV, comm
+                                      );
+        preq++;
+        ++nreqs;
+    }
+
+    /* Start your engines.  This will never return an error. */
+    smpi_mpi_startall(nreqs, ireqs);
+
+    /* Wait for them all.  If there's an error, note that we don't care
+     * what the error was -- just that there *was* an error.  The PML
+     * will finish all requests, even if one or more of them fail.
+     * i.e., by the end of this call, all the requests are free-able.
+     * So free them anyway -- even if there was an error, and return the
+     * error after we free everything. */
+    smpi_mpi_waitall(nreqs, ireqs,
+                                MPI_STATUSES_IGNORE);
+
+    /* Free the requests. */
+    for (i = 0; i < nreqs; ++i) {
+      if(ireqs[i]!=MPI_REQUEST_NULL)smpi_mpi_request_free(&ireqs[i]);
+    }
+    free(ireqs);
+
+    return MPI_SUCCESS;
+}
+
index 45a864b..60e2647 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoallv_pair_light_barrier(void *send_buff, int *send_counts,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_partner;
-  int tag = 1;     /*, failure = 0; */
+  int tag = COLL_TAG_ALLTOALLV;     /*, failure = 0; */
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index 9944493..62b0d71 100644 (file)
@@ -30,7 +30,7 @@ smpi_coll_tuned_alltoallv_pair_mpi_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 101;
+  int tag = COLL_TAG_ALLTOALLV;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index ab1f48e..7bea7e7 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_pair_one_barrier(void *send_buff, int *send_counts, in
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 50839df..6692eeb 100644 (file)
@@ -30,7 +30,7 @@ int smpi_coll_tuned_alltoallv_pair(void *send_buff, int *send_counts, int *send_
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
index 7a42ab9..d9653e3 100644 (file)
@@ -31,7 +31,7 @@ smpi_coll_tuned_alltoallv_ring_light_barrier(void *send_buff, int *send_counts,
   MPI_Aint send_chunk, recv_chunk;
   MPI_Status s;
   int i, src, dst, rank, num_procs, next_dst, next_src;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char send_sync = 'a', recv_sync = 'b';
   char *send_ptr = (char *) send_buff;
index 273f15c..36af835 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_ring_mpi_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index 8e2d0cd..7f5e795 100644 (file)
@@ -28,7 +28,7 @@ smpi_coll_tuned_alltoallv_ring_one_barrier(void *send_buff, int *send_counts, in
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index dcd4b35..dcbb9f4 100644 (file)
@@ -29,7 +29,7 @@ smpi_coll_tuned_alltoallv_ring(void *send_buff, int *send_counts, int *send_disp
   MPI_Status s;
   MPI_Aint send_chunk, recv_chunk;
   int i, src, dst, rank, num_procs;
-  int tag = 11;
+  int tag = COLL_TAG_ALLTOALLV;
 
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
index ad5b748..8a210fe 100644 (file)
@@ -21,7 +21,6 @@
 #include "coll_tuned_topo.h"
 
 
-#define MCA_COLL_BASE_TAG_BARRIER 100
 /*
  * Barrier is ment to be a synchronous operation, as some BTLs can mark 
  * a request done before its passed to the NIC and progress might not be made 
@@ -52,44 +51,44 @@ int smpi_coll_tuned_barrier_ompi_doublering(MPI_Comm comm
     size = smpi_comm_size(comm);
 
     XBT_DEBUG("ompi_coll_tuned_barrier_ompi_doublering rank %d", rank);
-  
-    left = ((rank-1)%size);
+
+    left = ((rank-1+size)%size);
     right = ((rank+1)%size);
 
     if (rank > 0) { /* receive message from the left */
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* Send message to the right */
     smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right, 
-                            MCA_COLL_BASE_TAG_BARRIER, 
+                            COLL_TAG_BARRIER,
                              comm);
 
     /* root needs to receive from the last node */
     if (rank == 0) {
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* Allow nodes to exit */
     if (rank > 0) { /* post Receive from left */
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
     /* send message to the right one */
     smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right, 
-                            MCA_COLL_BASE_TAG_BARRIER, 
+                            COLL_TAG_BARRIER,
                              comm);
  
     /* rank 0 post receive from the last node */
     if (rank == 0) {
         smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left, 
-                                MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                COLL_TAG_BARRIER, comm,
                                 MPI_STATUS_IGNORE);
     }
 
@@ -124,16 +123,16 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
             /* send message to lower ranked node */
             remote = rank - adjsize;
             smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   comm, MPI_STATUS_IGNORE);
 
         } else if (rank < (size - adjsize)) {
 
             /* receive message from high level rank */
             smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, rank+adjsize,
-                                    MCA_COLL_BASE_TAG_BARRIER, comm, 
+                                    COLL_TAG_BARRIER, comm,
                                     MPI_STATUS_IGNORE);
 
         }
@@ -149,9 +148,9 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
 
             /* post receive from the remote node */
             smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   NULL, 0, MPI_BYTE, remote,
-                                                  MCA_COLL_BASE_TAG_BARRIER,
+                                                  COLL_TAG_BARRIER,
                                                   comm, MPI_STATUS_IGNORE);
         }
     }
@@ -162,7 +161,7 @@ int smpi_coll_tuned_barrier_ompi_recursivedoubling(MPI_Comm comm
             /* send enter message to higher ranked node */
             remote = rank + adjsize;
             smpi_mpi_send((void*)NULL, 0, MPI_BYTE, remote, 
-                                    MCA_COLL_BASE_TAG_BARRIER, 
+                                    COLL_TAG_BARRIER,
                                      comm);
 
         }
@@ -195,9 +194,9 @@ int smpi_coll_tuned_barrier_ompi_bruck(MPI_Comm comm
 
         /* send message to lower ranked node */
         smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, to, 
-                                              MCA_COLL_BASE_TAG_BARRIER,
+                                              COLL_TAG_BARRIER,
                                               NULL, 0, MPI_BYTE, from, 
-                                              MCA_COLL_BASE_TAG_BARRIER,
+                                              COLL_TAG_BARRIER,
                                               comm, MPI_STATUS_IGNORE);
     }
 
@@ -221,9 +220,9 @@ int smpi_coll_tuned_barrier_ompi_two_procs(MPI_Comm comm
     remote = (remote + 1) & 0x1;
 
     smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote, 
-                                          MCA_COLL_BASE_TAG_BARRIER, 
+                                          COLL_TAG_BARRIER,
                                           NULL, 0, MPI_BYTE, remote, 
-                                          MCA_COLL_BASE_TAG_BARRIER,
+                                          COLL_TAG_BARRIER,
                                           comm, MPI_STATUS_IGNORE);
     return (MPI_SUCCESS);
 }
@@ -253,11 +252,11 @@ int smpi_coll_tuned_barrier_ompi_basic_linear(MPI_Comm comm)
 
     if (rank > 0) {
         smpi_mpi_send (NULL, 0, MPI_BYTE, 0, 
-                                 MCA_COLL_BASE_TAG_BARRIER,
+                                 COLL_TAG_BARRIER,
                                   comm);
 
         smpi_mpi_recv (NULL, 0, MPI_BYTE, 0, 
-                                 MCA_COLL_BASE_TAG_BARRIER,
+                                 COLL_TAG_BARRIER,
                                  comm, MPI_STATUS_IGNORE);
     }
 
@@ -269,14 +268,14 @@ int smpi_coll_tuned_barrier_ompi_basic_linear(MPI_Comm comm)
         requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) );
         for (i = 1; i < size; ++i) {
             requests[i] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE,
-                                     MCA_COLL_BASE_TAG_BARRIER, comm
+                                     COLL_TAG_BARRIER, comm
                                      );
         }
         smpi_mpi_waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
 
         for (i = 1; i < size; ++i) {
             requests[i] = smpi_mpi_isend(NULL, 0, MPI_BYTE, i,
-                                     MCA_COLL_BASE_TAG_BARRIER, 
+                                     COLL_TAG_BARRIER,
                                       comm
                                      );
         }
@@ -314,11 +313,11 @@ int smpi_coll_tuned_barrier_ompi_tree(MPI_Comm comm)
         if (!(partner & (jump-1)) && partner < size) {
             if (partner > rank) {
                 smpi_mpi_recv (NULL, 0, MPI_BYTE, partner, 
-                                         MCA_COLL_BASE_TAG_BARRIER, comm,
+                                         COLL_TAG_BARRIER, comm,
                                          MPI_STATUS_IGNORE);
             } else if (partner < rank) {
                 smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
-                                         MCA_COLL_BASE_TAG_BARRIER, 
+                                         COLL_TAG_BARRIER,
                                           comm);
             }
         }
@@ -330,11 +329,11 @@ int smpi_coll_tuned_barrier_ompi_tree(MPI_Comm comm)
         if (!(partner & (jump-1)) && partner < size) {
             if (partner > rank) {
                 smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
-                                         MCA_COLL_BASE_TAG_BARRIER,
+                                         COLL_TAG_BARRIER,
                                           comm);
             } else if (partner < rank) {
                 smpi_mpi_recv (NULL, 0, MPI_BYTE, partner, 
-                                         MCA_COLL_BASE_TAG_BARRIER, comm,
+                                         COLL_TAG_BARRIER, comm,
                                          MPI_STATUS_IGNORE);
             }
         }
index 93ace1d..1af70f6 100644 (file)
@@ -5,7 +5,7 @@ int bcast_NTSB_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSB(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   int rank, size;
   int i;
@@ -18,8 +18,8 @@ int smpi_coll_tuned_bcast_NTSB(void *buf, int count, MPI_Datatype datatype,
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(datatype);
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* source node and destination nodes (same through out the functions) */
   int from = (rank - 1) / 2;
index 89f8f5c..70edbef 100644 (file)
@@ -8,7 +8,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSL_Isend(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
@@ -20,8 +20,8 @@ int smpi_coll_tuned_bcast_NTSL_Isend(void *buf, int count, MPI_Datatype datatype
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(datatype);
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* source node and destination nodes (same through out the functions) */
   int to = (rank + 1) % size;
index 090edc7..23a51bc 100644 (file)
@@ -8,7 +8,7 @@ static int bcast_NTSL_segment_size_in_byte = 8192;
 int smpi_coll_tuned_bcast_NTSL(void *buf, int count, MPI_Datatype datatype,
                                int root, MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
@@ -20,8 +20,8 @@ int smpi_coll_tuned_bcast_NTSL(void *buf, int count, MPI_Datatype datatype,
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(datatype);
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* source node and destination nodes (same through out the functions) */
   int to = (rank + 1) % size;
index ec717e2..1645e71 100644 (file)
@@ -9,7 +9,7 @@ int smpi_coll_tuned_bcast_SMP_binary(void *buf, int count,
                                      MPI_Datatype datatype, int root,
                                      MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *request_array;
index 9919302..c2b24a4 100644 (file)
@@ -11,7 +11,7 @@ int smpi_coll_tuned_bcast_SMP_binomial(void *buf, int count,
   int size;
   int rank;
   MPI_Status status;
-  int tag = 50;
+  int tag = COLL_TAG_BCAST;
 
   size = smpi_comm_size(comm);
   rank = smpi_comm_rank(comm);
index 673f6cf..b999b39 100644 (file)
@@ -9,7 +9,7 @@ int smpi_coll_tuned_bcast_SMP_linear(void *buf, int count,
                                      MPI_Datatype datatype, int root,
                                      MPI_Comm comm)
 {
-  int tag = 5000;
+  int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *request_array;
diff --git a/src/smpi/colls/bcast-arrival-nb.c b/src/smpi/colls/bcast-arrival-nb.c
deleted file mode 100644 (file)
index 9ff27b4..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-#include "colls_private.h"
-
-static int bcast_NTSL_segment_size_in_byte = 8192;
-
-#define HEADER_SIZE 1024
-#define MAX_NODE 1024
-
-/* Non-topology-specific pipelined linear-bcast function */
-int smpi_coll_tuned_bcast_arrival_nb(void *buf, int count,
-                                     MPI_Datatype datatype, int root,
-                                     MPI_Comm comm)
-{
-  int tag = 50;
-  MPI_Status status;
-  MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
-
-  MPI_Status temp_status_array[MAX_NODE];
-
-  int rank, size;
-  int i, j;
-
-  int sent_count;
-  int header_index;
-  int flag_array[MAX_NODE];
-  int already_sent[MAX_NODE];
-
-  int header_buf[HEADER_SIZE];
-  char temp_buf[MAX_NODE];
-
-  MPI_Aint extent;
-  extent = smpi_datatype_get_extent(datatype);
-
-  /* destination */
-  int to;
-
-
-
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
-
-
-  /* segment is segment size in number of elements (not bytes) */
-  int segment = bcast_NTSL_segment_size_in_byte / extent;
-
-  /* pipeline length */
-  int pipe_length = count / segment;
-
-  /* use for buffer offset for sending and receiving data = segment size in byte */
-  int increment = segment * extent;
-
-  /* if the input size is not divisible by segment size => 
-     the small remainder will be done with native implementation */
-  int remainder = count % segment;
-
-  /* if root is not zero send to rank zero first
-     this can be modified to make it faster by using logical src, dst.
-   */
-  if (root != 0) {
-    if (rank == root) {
-      smpi_mpi_send(buf, count, datatype, 0, tag, comm);
-    } else if (rank == 0) {
-      smpi_mpi_recv(buf, count, datatype, root, tag, comm, &status);
-    }
-  }
-
-  /* value == 0 means root has not send data (or header) to the node yet */
-  for (i = 0; i < MAX_NODE; i++) {
-    already_sent[i] = 0;
-  }
-  //  printf("YYY\n");
-
-  /* when a message is smaller than a block size => no pipeline */
-  if (count <= segment) {
-    if (rank == 0) {
-      sent_count = 0;
-
-      while (sent_count < (size - 1)) {
-
-        //      for (j=0;j<1000;j++) {
-        for (i = 1; i < size; i++) {
-          if (already_sent[i] == 0)
-            smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
-                       MPI_STATUSES_IGNORE);
-        }
-        //}
-
-        header_index = 0;
-        /* recv 1-byte message */
-        for (i = 1; i < size; i++) {
-
-          /* message arrive */
-          if ((flag_array[i] == 1) && (already_sent[i] == 0)) {
-            smpi_mpi_recv(temp_buf, 1, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
-            header_buf[header_index] = i;
-            header_index++;
-            sent_count++;
-
-            /* will send in the next step */
-            already_sent[i] = 1;
-          }
-        }
-
-        /* send header followed by data */
-        if (header_index != 0) {
-          header_buf[header_index] = -1;
-          to = header_buf[0];
-          smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, to, tag, comm);
-          smpi_mpi_send(buf, count, datatype, to, tag, comm);
-        }
-
-        /* randomly MPI_Send to one */
-        else {
-          /* search for the first node that never received data before */
-          for (i = 1; i < size; i++) {
-            if (already_sent[i] == 0) {
-              header_buf[0] = i;
-              header_buf[1] = -1;
-              smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, i, tag, comm);
-              smpi_mpi_send(buf, count, datatype, i, tag, comm);
-              already_sent[i] = 1;
-              sent_count++;
-              break;
-            }
-          }
-        }
-
-
-      }                         /* while loop */
-    }
-
-    /* non-root */
-    else {
-
-      /* send 1-byte message to root */
-      smpi_mpi_send(temp_buf, 1, MPI_CHAR, 0, tag, comm);
-
-      /* wait for header and data, forward when required */
-      smpi_mpi_recv(header_buf, HEADER_SIZE, MPI_INT, MPI_ANY_SOURCE, tag, comm,
-               &status);
-      smpi_mpi_recv(buf, count, datatype, MPI_ANY_SOURCE, tag, comm, &status);
-
-      /* search for where it is */
-      int myordering = 0;
-      while (rank != header_buf[myordering]) {
-        myordering++;
-      }
-
-      /* send header followed by data */
-      if (header_buf[myordering + 1] != -1) {
-        smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, header_buf[myordering + 1],
-                 tag, comm);
-        smpi_mpi_send(buf, count, datatype, header_buf[myordering + 1], tag, comm);
-      }
-    }
-  }
-  /* pipeline bcast */
-  else {
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-
-    if (rank == 0) {
-      sent_count = 0;
-      int iteration = 0;
-
-      int will_send[1000];
-      for (i = 0; i < 1000; i++)
-        will_send[i] = 0;
-      while (sent_count < (size - 1)) {
-        iteration++;
-        //start = MPI_Wtime();
-
-        int k;
-        for (k = 0; k < 3; k++) {
-          for (i = 1; i < size; i++) {
-            if ((already_sent[i] == 0) && (will_send[i] == 0)) {
-              smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
-                         &temp_status_array[i]);
-              if (flag_array[i] == 1) {
-                will_send[i] = 1;
-                smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD,
-                         &status);
-                i = 1;
-              }
-            }
-          }
-        }
-
-        //total = MPI_Wtime() - start;
-        //total *= 1000;
-        //printf("Iprobe time = %.2f\n",total);
-        header_index = 0;
-
-        //start = MPI_Wtime();
-        /* recv 1-byte message */
-        for (i = 1; i < size; i++) {
-          /* message arrive */
-          if ((will_send[i] == 1) && (already_sent[i] == 0)) {
-            header_buf[header_index] = i;
-            header_index++;
-            sent_count++;
-
-            /* will send in the next step */
-            already_sent[i] = 1;
-          }
-        }
-        //printf("sent_count = %d\n",sent_count);
-
-
-        //total = MPI_Wtime() - start;
-        //total *= 1000;
-        //printf("Recv 1-byte time = %.2f\n",total);
-
-        /*      
-           if (header_index != 0) {
-           printf("header index = %d node = ",header_index);
-           for (i=0;i<header_index;i++) {
-           printf("%d ",header_buf[i]);
-           }
-           printf("\n");
-           }
-         */
-
-        /* send header followed by data */
-        if (header_index != 0) {
-          header_buf[header_index] = -1;
-          to = header_buf[0];
-
-          //start = MPI_Wtime();
-
-          /* send header */
-          smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, to, tag, comm);
-
-          //total = MPI_Wtime() - start;
-          //total *= 1000;
-          //printf("\tSend header to %d time = %.2f\n",to,total);
-
-          //start = MPI_Wtime();
-
-          /* send data - non-pipeline case */
-
-          if (0 == 1) {
-            //if (header_index == 1) {
-            smpi_mpi_send(buf, count, datatype, to, tag, comm);
-          }
-
-
-          /* send data - pipeline */
-          else {
-            for (i = 0; i < pipe_length; i++) {
-              smpi_mpi_send((char *)buf + (i * increment), segment, datatype, to, tag, comm);
-            }
-            //smpi_mpi_waitall((pipe_length), send_request_array, send_status_array);
-          }
-          //total = MPI_Wtime() - start;
-          //total *= 1000;
-          //printf("\tSend data to %d time = %.2f\n",to,total);
-
-        }
-
-
-
-        /* randomly MPI_Send to one node */
-        else {
-          /* search for the first node that never received data before */
-          for (i = 1; i < size; i++) {
-            if (already_sent[i] == 0) {
-              header_buf[0] = i;
-              header_buf[1] = -1;
-              to = i;
-
-              //start = MPI_Wtime();
-              smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, to, tag, comm);
-
-              /* still need to chop data so that we can use the same non-root code */
-              for (j = 0; j < pipe_length; j++) {
-                smpi_mpi_send((char *)buf + (j * increment), segment, datatype, to, tag,
-                         comm);
-              }
-
-              //smpi_mpi_send(buf,count,datatype,to,tag,comm);
-              //smpi_mpi_wait(&request,MPI_STATUS_IGNORE);
-
-              //total = MPI_Wtime() - start;
-              //total *= 1000;
-              //printf("SEND TO SINGLE node %d time = %.2f\n",i,total);
-
-
-              already_sent[i] = 1;
-              sent_count++;
-              break;
-            }
-          }
-        }
-
-      }                         /* while loop */
-
-      //total = MPI_Wtime() - start2;
-      //total *= 1000;
-      //printf("Node zero iter = %d time = %.2f\n",iteration,total);
-
-      /* probe before exit in case there are messages to recv */
-      for (i = 1; i < size; i++) {
-        smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
-                   &temp_status_array[i]);
-        if (flag_array[i] == 1)
-          smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
-      }
-    }
-
-    /* rank 0 */
-    /* none root */
-    else {
-
-      /* if root already send a message to this node, don't send one-byte message */
-      smpi_mpi_iprobe(0, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[0], &status);
-
-      /* send 1-byte message to root */
-      if (flag_array[0] == 0)
-        smpi_mpi_send(temp_buf, 1, MPI_CHAR, 0, tag, comm);
-
-      /* wait for header forward when required */
-      request = smpi_mpi_irecv(header_buf, HEADER_SIZE, MPI_INT, MPI_ANY_SOURCE, tag, comm);
-      smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
-
-      /* search for where it is */
-      int myordering = 0;
-      while (rank != header_buf[myordering]) {
-        myordering++;
-      }
-
-      /* send header when required */
-      if (header_buf[myordering + 1] != -1) {
-        smpi_mpi_send(header_buf, HEADER_SIZE, MPI_INT, header_buf[myordering + 1],
-                 tag, comm);
-      }
-
-      /* receive data */
-
-      if (0 == -1) {
-        //if (header_buf[1] == -1) {
-        request = smpi_mpi_irecv(buf, count, datatype, 0, tag, comm);
-        smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
-        //printf("\t\tnode %d ordering = %d receive data from root\n",rank,myordering);
-      } else {
-        for (i = 0; i < pipe_length; i++) {
-          recv_request_array[i] = smpi_mpi_irecv((char *)buf + (i * increment), segment, datatype, MPI_ANY_SOURCE,
-                    tag, comm);
-        }
-      }
-
-      /* send data */
-      if (header_buf[myordering + 1] != -1) {
-        for (i = 0; i < pipe_length; i++) {
-          smpi_mpi_wait(&recv_request_array[i], MPI_STATUS_IGNORE);
-          send_request_array[i] = smpi_mpi_isend((char *)buf + (i * increment), segment, datatype,
-                    header_buf[myordering + 1], tag, comm);
-        }
-        smpi_mpi_waitall((pipe_length), send_request_array, send_status_array);
-      }
-
-    }
-
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
-  }                             /* end pipeline */
-
-  /* when count is not divisible by block size, use default BCAST for the remainder */
-  if ((remainder != 0) && (count > segment)) {
-    XBT_WARN("MPI_bcast_arrival_nb use default MPI_bcast.");     
-    smpi_mpi_bcast((char *)buf + (pipe_length * increment), remainder, datatype, root, comm);
-  }
-
-  return MPI_SUCCESS;
-}
index 0a12246..06693db 100644 (file)
@@ -27,7 +27,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware_wait(void *buf, int count,
 
   int rank, size;
   int i, j, k;
-  int tag = 50;
+  int tag = -COLL_TAG_BCAST;
   int will_send[BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE];
 
   int sent_count;
@@ -49,8 +49,8 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware_wait(void *buf, int count,
 
 
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
 
   /* segment is segment size in number of elements (not bytes) */
@@ -114,11 +114,11 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware_wait(void *buf, int count,
       for (k = 0; k < 3; k++) {
         for (i = 1; i < size; i++) {
           if ((already_sent[i] == 0) && (will_send[i] == 0)) {
-            smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+            smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                        &temp_status_array[i]);
             if (flag_array[i] == 1) {
               will_send[i] = 1;
-              smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD,
+              smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
                        &status);
               i = 0;
             }
index f4a482c..39498ea 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
                                                 MPI_Datatype datatype, int root,
                                                 MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = -COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
@@ -27,7 +27,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
   int header_index;
   int flag_array[MAX_NODE];
   int already_sent[MAX_NODE];
-
+  int to_clean[MAX_NODE];
   int header_buf[HEADER_SIZE];
   char temp_buf[MAX_NODE];
 
@@ -39,8 +39,8 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
 
 
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
 
   /* segment is segment size in number of elements (not bytes) */
@@ -70,6 +70,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
   /* value == 0 means root has not send data (or header) to the node yet */
   for (i = 0; i < MAX_NODE; i++) {
     already_sent[i] = 0;
+    to_clean[i] = 0;
   }
 
   /* when a message is smaller than a block size => no pipeline */
@@ -79,7 +80,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
 
       while (sent_count < (size - 1)) {
         for (i = 1; i < size; i++) {
-          smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+          smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                      MPI_STATUSES_IGNORE);
         }
 
@@ -89,7 +90,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
 
           /* message arrive */
           if ((flag_array[i] == 1) && (already_sent[i] == 0)) {
-            smpi_mpi_recv(temp_buf, 1, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
+            smpi_mpi_recv(temp_buf, 1, MPI_CHAR, i, tag, comm, &status);
             header_buf[header_index] = i;
             header_index++;
             sent_count++;
@@ -171,7 +172,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
         //iteration++;
         //start = MPI_Wtime();
         for (i = 1; i < size; i++) {
-          smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+          smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                      &temp_status_array[i]);
         }
         //total = MPI_Wtime() - start;
@@ -184,7 +185,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
         for (i = 1; i < size; i++) {
           /* message arrive */
           if ((flag_array[i] == 1) && (already_sent[i] == 0)) {
-            smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD,
+            smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
                      &status);
             header_buf[header_index] = i;
             header_index++;
@@ -274,6 +275,7 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
 
 
               already_sent[i] = 1;
+              to_clean[i]=1;
               sent_count++;
               break;
             }
@@ -282,6 +284,9 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
 
       }                         /* while loop */
 
+      for(i=0; i<size; i++)
+        if(to_clean[i]!=0)smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
+                     &status);
       //total = MPI_Wtime() - start2;
       //total *= 1000;
       //printf("Node zero iter = %d time = %.2f\n",iteration,total);
@@ -331,8 +336,10 @@ int smpi_coll_tuned_bcast_arrival_pattern_aware(void *buf, int count,
                     header_buf[myordering + 1], tag, comm);
         }
         smpi_mpi_waitall((pipe_length), send_request_array, send_status_array);
-      }
-
+      }else{
+          smpi_mpi_waitall(pipe_length, recv_request_array, recv_status_array);
+          }
+    
     }
 
     free(send_request_array);
index 6ad805d..609490d 100644 (file)
@@ -13,7 +13,7 @@ int smpi_coll_tuned_bcast_arrival_scatter(void *buf, int count,
                                           MPI_Datatype datatype, int root,
                                           MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = -COLL_TAG_BCAST;//in order to use ANY_TAG, make this one positive
   int header_tag = 10;
   MPI_Status status;
 
@@ -47,8 +47,8 @@ int smpi_coll_tuned_bcast_arrival_scatter(void *buf, int count,
   /* source and destination */
   int to, from;
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* message too small */
   if (count < size) {
@@ -90,11 +90,11 @@ int smpi_coll_tuned_bcast_arrival_scatter(void *buf, int count,
       for (k = 0; k < 3; k++) {
         for (i = 1; i < size; i++) {
           if ((already_sent[i] == 0) && (will_send[i] == 0)) {
-            smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+            smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                        &temp_status_array[i]);
             if (flag_array[i] == 1) {
               will_send[i] = 1;
-              smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD,
+              smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
                        &status);
               i = 0;
             }
index e840c02..0b37d39 100644 (file)
@@ -68,7 +68,7 @@ smpi_coll_tuned_bcast_binomial_tree(void *buff, int count,
                                     MPI_Comm comm)
 {
   int src, dst, rank, num_procs, mask, relative_rank;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index 9033bf5..434b684 100644 (file)
@@ -8,7 +8,7 @@ smpi_coll_tuned_bcast_flattree_pipeline(void *buff, int count,
                                         MPI_Comm comm)
 {
   int i, j, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(data_type);
index 626c203..4cf3308 100644 (file)
@@ -8,7 +8,7 @@ smpi_coll_tuned_bcast_flattree(void *buff, int count, MPI_Datatype data_type,
   MPI_Request *reqs;
 
   int i, rank, num_procs;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index 63c2067..7085562 100644 (file)
@@ -96,7 +96,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             for( i = 0; i < tree->tree_nextsize; i++ ) { 
                 send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
                                          tree->tree_next[i], 
-                                         777, comm);
+                                         COLL_TAG_BCAST, comm);
            } 
 
             /* complete the sends before starting the next sends */
@@ -124,7 +124,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
          */
         req_index = 0;
         recv_reqs[req_index]=smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
-                           tree->tree_prev, 777,
+                           tree->tree_prev, COLL_TAG_BCAST,
                            comm);
         
         for( segindex = 1; segindex < num_segments; segindex++ ) {
@@ -134,7 +134,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             /* post new irecv */
             recv_reqs[req_index]= smpi_mpi_irecv( tmpbuf + realsegsize, count_by_segment,
                                 datatype, tree->tree_prev, 
-                                777, 
+                                COLL_TAG_BCAST,
                                 comm);
             
             /* wait for and forward the previous segment to children */
@@ -144,7 +144,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             for( i = 0; i < tree->tree_nextsize; i++ ) { 
                 send_reqs[i]=smpi_mpi_isend(tmpbuf, count_by_segment, datatype,
                                          tree->tree_next[i], 
-                                         777, comm );
+                                         COLL_TAG_BCAST, comm );
             } 
             
             /* complete the sends before starting the next iteration */
@@ -161,7 +161,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
         for( i = 0; i < tree->tree_nextsize; i++ ) {
             send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
                                      tree->tree_next[i], 
-                                     777, comm);
+                                     COLL_TAG_BCAST, comm);
         }
         
         smpi_mpi_waitall( tree->tree_nextsize, send_reqs, 
@@ -180,7 +180,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
         */
         req_index = 0;
         recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
-                                 tree->tree_prev, 777,
+                                 tree->tree_prev, COLL_TAG_BCAST,
                                  comm);
 
         for( segindex = 1; segindex < num_segments; segindex++ ) {
@@ -188,7 +188,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
             tmpbuf += realsegsize;
             /* post receive for the next segment */
             recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype, 
-                                     tree->tree_prev, 777, 
+                                     tree->tree_prev, COLL_TAG_BCAST,
                                      comm);
             /* wait on the previous segment */
             smpi_mpi_wait( &recv_reqs[req_index ^ 0x1], 
@@ -199,6 +199,7 @@ int smpi_coll_tuned_bcast_ompi_pipeline( void* buffer,
     }
 
     if( NULL != send_reqs ) free(send_reqs);
+    xbt_free(tree);
 
     return (MPI_SUCCESS);
 }
index f1201d1..a0f1876 100644 (file)
@@ -171,7 +171,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
                     sendcount[i] = counts[i] - segindex*segcount[i];
                 /* send data */
                 smpi_mpi_send(tmpbuf[i], sendcount[i], datatype,
-                                  tree->tree_next[i], 777, comm);
+                                  tree->tree_next[i], COLL_TAG_BCAST, comm);
                 /* update tmp buffer */
                 tmpbuf[i] += realsegsize[i];
             }
@@ -193,7 +193,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
          */
         sendcount[lr] = segcount[lr];
         base_req=smpi_mpi_irecv(tmpbuf[lr], sendcount[lr], datatype,
-                           tree->tree_prev, 777,
+                           tree->tree_prev, COLL_TAG_BCAST,
                            comm);
 
         for( segindex = 1; segindex < num_segments[lr]; segindex++ ) {
@@ -202,14 +202,14 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
                 sendcount[lr] = counts[lr] - segindex*segcount[lr];
             /* post new irecv */
             new_req = smpi_mpi_irecv( tmpbuf[lr] + realsegsize[lr], sendcount[lr],
-                                datatype, tree->tree_prev, 777, 
+                                datatype, tree->tree_prev, COLL_TAG_BCAST,
                                 comm);
 
             /* wait for and forward current segment */
             smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
             for( i = 0; i < tree->tree_nextsize; i++ ) {  /* send data to children (segcount[lr]) */
                 smpi_mpi_send( tmpbuf[lr], segcount[lr], datatype,
-                                   tree->tree_next[i], 777,
+                                   tree->tree_next[i], COLL_TAG_BCAST,
                                    comm);
             } /* end of for each child */
 
@@ -223,7 +223,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
         smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
         for( i = 0; i < tree->tree_nextsize; i++ ) {  /* send data to children */
             smpi_mpi_send(tmpbuf[lr], sendcount[lr], datatype,
-                              tree->tree_next[i], 777, comm);
+                              tree->tree_next[i], COLL_TAG_BCAST, comm);
         } /* end of for each child */
     } 
   
@@ -236,7 +236,7 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
             if (segindex == (num_segments[lr] - 1)) sendcount[lr] = counts[lr] - segindex*segcount[lr];
             /* receive segments */
             smpi_mpi_recv(tmpbuf[lr], sendcount[lr], datatype,
-                              tree->tree_prev, 777,
+                              tree->tree_prev, COLL_TAG_BCAST,
                               comm, MPI_STATUS_IGNORE);
             /* update the initial pointer to the buffer */
             tmpbuf[lr] += realsegsize[lr];
@@ -265,32 +265,33 @@ smpi_coll_tuned_bcast_ompi_split_bintree ( void* buffer,
     if ( (size%2) != 0 && rank != root) { 
 
         smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
-                                        pair, 777,
+                                        pair, COLL_TAG_BCAST,
                                         tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
-                                        pair, 777,
+                                        pair, COLL_TAG_BCAST,
                                         comm, MPI_STATUS_IGNORE);
     } else if ( (size%2) == 0 ) {
         /* root sends right buffer to the last node */
         if( rank == root ) {
             smpi_mpi_send(tmpbuf[1], counts[1], datatype,
-                              (root+size-1)%size, 777, comm);
+                              (root+size-1)%size, COLL_TAG_BCAST, comm);
 
         } 
         /* last node receives right buffer from the root */
         else if (rank == (root+size-1)%size) {
             smpi_mpi_recv(tmpbuf[1], counts[1], datatype,
-                              root, 777,
+                              root, COLL_TAG_BCAST,
                               comm, MPI_STATUS_IGNORE);
         } 
         /* everyone else exchanges buffers */
         else {
             smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
-                                            pair, 777,
+                                            pair, COLL_TAG_BCAST,
                                             tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
-                                            pair, 777,
+                                            pair, COLL_TAG_BCAST,
                                             comm, MPI_STATUS_IGNORE); 
         }
     }
+    xbt_free(tree);
     return (MPI_SUCCESS);
   
 
index ebd5539..bf7a05a 100644 (file)
@@ -71,7 +71,7 @@ smpi_coll_tuned_bcast_scatter_LR_allgather(void *buff, int count,
   int i, src, dst, rank, num_procs;
   int mask, relative_rank, curr_size, recv_size, send_size, nbytes;
   int scatter_size, left, right, next_src, *recv_counts, *disps;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index ab458e4..43cf25d 100644 (file)
@@ -73,7 +73,7 @@ smpi_coll_tuned_bcast_scatter_rdb_allgather(void *buff, int count, MPI_Datatype
   int mask, relative_rank, curr_size, recv_size = 0, send_size, nbytes;
   int scatter_size, tree_root, relative_dst, dst_tree_root;
   int my_tree_root, offset, tmp_mask, num_procs_completed;
-  int tag = 1;
+  int tag = COLL_TAG_BCAST;
 
   rank = smpi_comm_rank(comm);
   num_procs = smpi_comm_size(comm);
index ce7cec7..2fc8df4 100644 (file)
@@ -421,7 +421,7 @@ ompi_coll_tuned_topo_build_in_order_bmtree( MPI_Comm comm,
 
     vrank = (rank - root + size) % size;
 
-    bmtree = (ompi_coll_tree_t*)malloc(sizeof(ompi_coll_tree_t));
+    bmtree = (ompi_coll_tree_t*)xbt_malloc(sizeof(ompi_coll_tree_t));
     if (!bmtree) {
         XBT_DEBUG("coll:tuned:topo:build_bmtree PANIC out of memory");
         return NULL;
index 3de3681..b70a313 100644 (file)
@@ -33,7 +33,8 @@ COLL_APPLY(action, COLL_GATHER_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_GATHER_SIG, ompi_basic_linear) COLL_sep \
 COLL_APPLY(action, COLL_GATHER_SIG, ompi_binomial) COLL_sep \
 COLL_APPLY(action, COLL_GATHER_SIG, ompi_linear_sync) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mpich) \
+COLL_APPLY(action, COLL_GATHER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_GATHER_SIG, automatic)
 
 
 
@@ -53,7 +54,6 @@ COLL_APPLY(action, COLL_ALLGATHER_SIG, 3dmesh) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, bruck) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, GB) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, loosely_lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, lr) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR_NB) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, pair) COLL_sep \
@@ -65,7 +65,8 @@ COLL_APPLY(action, COLL_ALLGATHER_SIG, smp_simple) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, spreading_simple) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi_neighborexchange) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mpich) 
+COLL_APPLY(action, COLL_ALLGATHER_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHER_SIG, automatic)
 
 
 COLL_ALLGATHERS(COLL_PROTO, COLL_NOsep)
@@ -86,7 +87,9 @@ COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_neighborexchange) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_bruck) COLL_sep \
 COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_rdb)
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_rdb) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_ring) COLL_sep \
+COLL_APPLY(action, COLL_ALLGATHERV_SIG, automatic)
 
 COLL_ALLGATHERVS(COLL_PROTO, COLL_NOsep)
 
@@ -99,12 +102,9 @@ COLL_ALLGATHERVS(COLL_PROTO, COLL_NOsep)
 
 #define COLL_ALLREDUCES(action, COLL_sep) \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, NTS) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab1) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab2) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_rdb) COLL_sep \
-COLL_NOTHING(COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_reduce_scatter) COLL_sep) \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_rsag) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, rdb) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial_pipeline) COLL_sep \
@@ -115,7 +115,8 @@ COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_rab) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, redbcast) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi_ring_segmented) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mpich)
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLREDUCE_SIG, automatic)
 
 COLL_ALLREDUCES(COLL_PROTO, COLL_NOsep)
 
@@ -126,7 +127,7 @@ COLL_ALLREDUCES(COLL_PROTO, COLL_NOsep)
 #define COLL_ALLTOALL_SIG alltoall, int, \
                         (void *send_buff, int send_count, MPI_Datatype send_type, \
                          void *recv_buff, int recv_count, MPI_Datatype recv_type, \
-                          MPI_Comm com)
+                          MPI_Comm comm)
 
 #define COLL_ALLTOALLS(action, COLL_sep) \
 COLL_APPLY(action, COLL_ALLTOALL_SIG, 2dmesh) COLL_sep \
@@ -141,9 +142,9 @@ COLL_APPLY(action, COLL_ALLTOALL_SIG, ring) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_light_barrier) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_mpi_barrier) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, simple) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALL_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mpich)
+COLL_APPLY(action, COLL_ALLTOALL_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALL_SIG, automatic)
 
 COLL_ALLTOALLS(COLL_PROTO, COLL_NOsep)
 
@@ -153,7 +154,7 @@ COLL_ALLTOALLS(COLL_PROTO, COLL_NOsep)
 #define COLL_ALLTOALLV_SIG alltoallv, int, \
                         (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \
                          void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \
-                          MPI_Comm com)
+                          MPI_Comm comm)
 
 #define COLL_ALLTOALLVS(action, COLL_sep) \
 COLL_APPLY(action, COLL_ALLTOALLV_SIG, bruck) COLL_sep \
@@ -166,7 +167,9 @@ COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_light_barrier) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_mpi_barrier) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_one_barrier) COLL_sep \
 COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, mpich)
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi_basic_linear) COLL_sep \
+COLL_APPLY(action, COLL_ALLTOALLV_SIG, automatic)
 
 COLL_ALLTOALLVS(COLL_PROTO, COLL_NOsep)
 
@@ -178,7 +181,6 @@ COLL_ALLTOALLVS(COLL_PROTO, COLL_NOsep)
                       int root, MPI_Comm comm)
 
 #define COLL_BCASTS(action, COLL_sep) \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_nb) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware_wait) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, arrival_scatter) COLL_sep \
@@ -196,7 +198,8 @@ COLL_APPLY(action, COLL_BCAST_SIG, SMP_linear) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, ompi_split_bintree) COLL_sep \
 COLL_APPLY(action, COLL_BCAST_SIG, ompi_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mpich)
+COLL_APPLY(action, COLL_BCAST_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_BCAST_SIG, automatic)
 
 COLL_BCASTS(COLL_PROTO, COLL_NOsep)
 
@@ -221,7 +224,8 @@ COLL_APPLY(action, COLL_REDUCE_SIG, ompi_basic_linear) COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SIG, ompi_in_order_binary) COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binary) COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mpich)
+COLL_APPLY(action, COLL_REDUCE_SIG, mpich) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SIG, automatic)
 
 COLL_REDUCES(COLL_PROTO, COLL_NOsep)
 
@@ -239,7 +243,9 @@ COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_ring)  COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich) COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_pair) COLL_sep \
 COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_rdb) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_noncomm) 
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_noncomm) COLL_sep \
+COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, automatic)
+
 
 
 COLL_REDUCE_SCATTERS(COLL_PROTO, COLL_NOsep)
@@ -257,7 +263,8 @@ COLL_REDUCE_SCATTERS(COLL_PROTO, COLL_NOsep)
 COLL_APPLY(action, COLL_SCATTER_SIG, ompi) COLL_sep \
 COLL_APPLY(action, COLL_SCATTER_SIG, ompi_basic_linear) COLL_sep \
 COLL_APPLY(action, COLL_SCATTER_SIG, ompi_binomial)  COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mpich) 
+COLL_APPLY(action, COLL_SCATTER_SIG, mpich)   COLL_sep \
+COLL_APPLY(action, COLL_SCATTER_SIG, automatic)
 
 COLL_SCATTERS(COLL_PROTO, COLL_NOsep)
 
@@ -275,7 +282,8 @@ COLL_APPLY(action, COLL_BARRIER_SIG, ompi_tree)  COLL_sep \
 COLL_APPLY(action, COLL_BARRIER_SIG, ompi_bruck)  COLL_sep \
 COLL_APPLY(action, COLL_BARRIER_SIG, ompi_recursivedoubling) COLL_sep \
 COLL_APPLY(action, COLL_BARRIER_SIG, ompi_doublering) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mpich)  
+COLL_APPLY(action, COLL_BARRIER_SIG, mpich)   COLL_sep \
+COLL_APPLY(action, COLL_BARRIER_SIG, automatic)
 
 COLL_BARRIERS(COLL_PROTO, COLL_NOsep)
 
index 22e6e63..df34f27 100644 (file)
@@ -19,7 +19,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_GATHER 333
 /* Todo: gather_intra_generic, gather_intra_binary, gather_intra_chain,
  * gather_intra_pipeline, segmentation? */
 int
@@ -136,8 +135,8 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
                         "smpi_coll_tuned_gather_ompi_binomial rank %d recv %d mycount = %d",
                         rank, bmtree->tree_next[i], mycount);
 
-           smpi_mpi_recv(ptmp + total_recv*rextent, rcount*size-total_recv, rdtype,
-                                   bmtree->tree_next[i], MCA_COLL_BASE_TAG_GATHER,
+           smpi_mpi_recv(ptmp + total_recv*rextent, mycount, rdtype,
+                                   bmtree->tree_next[i], COLL_TAG_GATHER,
                                    comm, &status);
 
            total_recv += mycount;
@@ -152,7 +151,7 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
 
        smpi_mpi_send(ptmp, total_recv, sdtype,
                                bmtree->tree_prev,
-                               MCA_COLL_BASE_TAG_GATHER,
+                               COLL_TAG_GATHER,
                                 comm);
   }
     if (rank == root) {
@@ -173,6 +172,7 @@ smpi_coll_tuned_gather_ompi_binomial(void *sbuf, int scount,
        /* other non-leaf nodes */
        free(tempbuf);
     }
+    xbt_free(bmtree);
     return MPI_SUCCESS;
 
  err_hndl:
@@ -243,16 +243,16 @@ smpi_coll_tuned_gather_ompi_linear_sync(void *sbuf, int scount,
                                       first_segment_count );
 
         smpi_mpi_recv(sbuf, 0, MPI_BYTE, root, 
-                                MCA_COLL_BASE_TAG_GATHER,
+                                COLL_TAG_GATHER,
                                 comm, MPI_STATUS_IGNORE);
 
         smpi_mpi_send(sbuf, first_segment_count, sdtype, root,
-                                MCA_COLL_BASE_TAG_GATHER,
+                                COLL_TAG_GATHER,
                                  comm);
 
         smpi_mpi_send((char*)sbuf + extent * first_segment_count, 
                                 (scount - first_segment_count), sdtype, 
-                                root, MCA_COLL_BASE_TAG_GATHER,
+                                root, COLL_TAG_GATHER,
                                  comm);
     }
 
@@ -288,18 +288,18 @@ smpi_coll_tuned_gather_ompi_linear_sync(void *sbuf, int scount,
             /* irecv for the first segment from i */
             ptmp = (char*)rbuf + i * rcount * extent;
             first_segment_req = smpi_mpi_irecv(ptmp, first_segment_count, rdtype, i,
-                                     MCA_COLL_BASE_TAG_GATHER, comm
+                                     COLL_TAG_GATHER, comm
                                      );
             
             /* send sync message */
             smpi_mpi_send(rbuf, 0, MPI_BYTE, i,
-                                    MCA_COLL_BASE_TAG_GATHER,
+                                    COLL_TAG_GATHER,
                                      comm);
 
             /* irecv for the second segment */
             ptmp = (char*)rbuf + (i * rcount + first_segment_count) * extent;
             reqs[i]=smpi_mpi_irecv(ptmp, (rcount - first_segment_count), 
-                                     rdtype, i, MCA_COLL_BASE_TAG_GATHER, comm
+                                     rdtype, i, COLL_TAG_GATHER, comm
                                      );
 
             /* wait on the first segment to complete */
@@ -376,7 +376,7 @@ smpi_coll_tuned_gather_ompi_basic_linear(void *sbuf, int scount,
 
     if (rank != root) {
         smpi_mpi_send(sbuf, scount, sdtype, root,
-                                 MCA_COLL_BASE_TAG_GATHER,
+                                 COLL_TAG_GATHER,
                                   comm);
         return MPI_SUCCESS;
     }
@@ -395,7 +395,7 @@ smpi_coll_tuned_gather_ompi_basic_linear(void *sbuf, int scount,
             }
         } else {
             smpi_mpi_recv(ptmp, rcount, rdtype, i,
-                                    MCA_COLL_BASE_TAG_GATHER,
+                                    COLL_TAG_GATHER,
                                     comm, MPI_STATUS_IGNORE);
             err = MPI_SUCCESS;
         }
index 5a3b887..f02a7ff 100644 (file)
@@ -10,7 +10,7 @@ int smpi_coll_tuned_reduce_NTSL(void *buf, void *rbuf, int count,
                                 MPI_Datatype datatype, MPI_Op op, int root,
                                 MPI_Comm comm)
 {
-  int tag = 50;
+  int tag = COLL_TAG_REDUCE;
   MPI_Status status;
   MPI_Request *send_request_array;
   MPI_Request *recv_request_array;
@@ -21,8 +21,8 @@ int smpi_coll_tuned_reduce_NTSL(void *buf, void *rbuf, int count,
   MPI_Aint extent;
   extent = smpi_datatype_get_extent(datatype);
 
-  rank = smpi_comm_rank(MPI_COMM_WORLD);
-  size = smpi_comm_size(MPI_COMM_WORLD);
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
 
   /* source node and destination nodes (same through out the functions) */
   int to = (rank - 1 + size) % size;
index 1e25250..6fe89cc 100644 (file)
@@ -18,10 +18,8 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
                                                  MPI_Op op, int root,
                                                  MPI_Comm comm)
 {
-  int rank;
-  rank = smpi_comm_rank(comm);
-
-  int tag = 50;
+  int rank = smpi_comm_rank(comm);
+  int tag = -COLL_TAG_REDUCE;
   MPI_Status status;
   MPI_Request request;
   MPI_Request *send_request_array;
@@ -31,7 +29,7 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
 
   MPI_Status temp_status_array[MAX_NODE];
 
-  int size;
+  int size = smpi_comm_size(comm);
   int i;
 
   int sent_count;
@@ -48,10 +46,6 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
   /* source and destination */
   int to, from;
 
-  size=smpi_comm_size(comm);
-  rank=smpi_comm_rank(comm);
-
-
   /* segment is segment size in number of elements (not bytes) */
   int segment = reduce_arrival_pattern_aware_segment_size_in_byte / extent;
 
@@ -89,7 +83,7 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
 
         for (i = 1; i < size; i++) {
           if (already_received[i] == 0) {
-            smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+            smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                              MPI_STATUSES_IGNORE);
             simcall_process_sleep(0.0001);
             }
@@ -103,7 +97,7 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
 
           /* 1-byte message arrive */
           if ((flag_array[i] == 1) && (already_received[i] == 0)) {
-            smpi_mpi_recv(temp_buf, 1, MPI_CHAR, i, tag, MPI_COMM_WORLD, &status);
+            smpi_mpi_recv(temp_buf, 1, MPI_CHAR, i, tag, comm, &status);
             header_buf[header_index] = i;
             header_index++;
             sent_count++;
@@ -214,11 +208,11 @@ int smpi_coll_tuned_reduce_arrival_pattern_aware(void *buf, void *rbuf,
             //if (i == rank)
             //continue;
             if ((already_received[i] == 0) && (will_send[i] == 0)) {
-                smpi_mpi_iprobe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &flag_array[i],
+                smpi_mpi_iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
                          &temp_status_array[i]);
               if (flag_array[i] == 1) {
                 will_send[i] = 1;
-                smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, MPI_COMM_WORLD,
+                smpi_mpi_recv(&temp_buf[i], 1, MPI_CHAR, i, tag, comm,
                          &status);
                 //printf("recv from %d\n",i);
                 i = 1;
index 63de8fe..c3b4067 100644 (file)
@@ -10,10 +10,10 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
   int comm_size, rank;
   int mask, relrank, source;
   int dst;
-  int tag = 4321;
+  int tag = COLL_TAG_REDUCE;
   MPI_Aint extent;
   void *tmp_buf;
-
+  MPI_Aint true_lb, true_extent;
   if (count == 0)
     return 0;
   rank = smpi_comm_rank(comm);
@@ -22,29 +22,65 @@ int smpi_coll_tuned_reduce_binomial(void *sendbuf, void *recvbuf, int count,
   extent = smpi_datatype_get_extent(datatype);
 
   tmp_buf = (void *) xbt_malloc(count * extent);
-
-  smpi_mpi_sendrecv(sendbuf, count, datatype, rank, tag,
-               recvbuf, count, datatype, rank, tag, comm, &status);
+  int is_commutative = smpi_op_is_commute(op);
   mask = 1;
-  relrank = (rank - root + comm_size) % comm_size;
+  
+  int lroot;
+  if (is_commutative) 
+        lroot   = root;
+  else
+        lroot   = 0;
+  relrank = (rank - lroot + comm_size) % comm_size;
+
+  smpi_datatype_extent(datatype, &true_lb, &true_extent);
+
+  /* adjust for potential negative lower bound in datatype */
+  tmp_buf = (void *)((char*)tmp_buf - true_lb);
+    
+  /* If I'm not the root, then my recvbuf may not be valid, therefore
+     I have to allocate a temporary one */
+  if (rank != root) {
+      recvbuf = (void *) malloc(count*(max(extent,true_extent)));
+      recvbuf = (void *)((char*)recvbuf - true_lb);
+  }
+   if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
+      smpi_datatype_copy(sendbuf, count, datatype, recvbuf,count, datatype);
+  }
 
   while (mask < comm_size) {
     /* Receive */
     if ((mask & relrank) == 0) {
       source = (relrank | mask);
       if (source < comm_size) {
-        source = (source + root) % comm_size;
+        source = (source + lroot) % comm_size;
         smpi_mpi_recv(tmp_buf, count, datatype, source, tag, comm, &status);
-        smpi_op_apply(op, tmp_buf, recvbuf, &count, &datatype);
+        
+        if (is_commutative) {
+          smpi_op_apply(op, tmp_buf, recvbuf, &count, &datatype);
+        } else {
+          smpi_op_apply(op, recvbuf, tmp_buf, &count, &datatype);
+          smpi_datatype_copy(tmp_buf, count, datatype,recvbuf, count, datatype);
+        }
       }
     } else {
-      dst = ((relrank & (~mask)) + root) % comm_size;
+      dst = ((relrank & (~mask)) + lroot) % comm_size;
       smpi_mpi_send(recvbuf, count, datatype, dst, tag, comm);
       break;
     }
     mask <<= 1;
   }
 
+  if (!is_commutative && (root != 0)){
+    if (rank == 0){
+      smpi_mpi_send(recvbuf, count, datatype, root,tag, comm);
+    }else if (rank == root){
+      smpi_mpi_recv(recvbuf, count, datatype, 0, tag, comm, &status);
+    }
+  }
+
+  if (rank != root) {
+        xbt_free(recvbuf);
+  }
   free(tmp_buf);
 
   return 0;
index f304e78..9241be1 100644 (file)
@@ -6,7 +6,7 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count,
                                  MPI_Datatype dtype, MPI_Op op,
                                  int root, MPI_Comm comm)
 {
-  int i, tag = 4321;
+  int i, tag = COLL_TAG_REDUCE;
   int size;
   int rank;
   MPI_Aint extent;
index c5d767c..0b71d60 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_REDUCE 555
 
 
 
@@ -92,8 +91,8 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
            sendbuf to the accumbuf, in order to simplfy the loops */
         if (!smpi_op_is_commute(op)) {
             smpi_datatype_copy(
-                                                (char*)accumbuf, original_count, datatype,
-                                                (char*)sendtmpbuf, original_count, datatype);
+                                                (char*)sendtmpbuf, original_count, datatype,
+                                                (char*)accumbuf, original_count, datatype);
         }
         /* Allocate two buffers for incoming segments */
         real_segment_size = true_extent + (count_by_segment - 1) * extent;
@@ -151,7 +150,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
 
                     reqs[inbi]=smpi_mpi_irecv(local_recvbuf, recvcount, datatype,
                                              tree->tree_next[i], 
-                                             MCA_COLL_BASE_TAG_REDUCE, comm
+                                             COLL_TAG_REDUCE, comm
                                              );
                 }
                 /* wait for previous req to complete, if any.
@@ -195,7 +194,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                         /* send combined/accumulated data to parent */
                         smpi_mpi_send( accumulator, prevcount, 
                                                   datatype, tree->tree_prev, 
-                                                  MCA_COLL_BASE_TAG_REDUCE,
+                                                  COLL_TAG_REDUCE,
                                                   comm);
                     }
 
@@ -242,7 +241,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                          segindex * segment_increment,
                                          count_by_segment, datatype,
                                          tree->tree_prev, 
-                                         MCA_COLL_BASE_TAG_REDUCE,
+                                         COLL_TAG_REDUCE,
                                          comm) ;
                 segindex++;
                 original_count -= count_by_segment;
@@ -270,7 +269,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                           segindex * segment_increment,
                                           count_by_segment, datatype,
                                           tree->tree_prev, 
-                                          MCA_COLL_BASE_TAG_REDUCE,
+                                          COLL_TAG_REDUCE,
                                           comm);
                 original_count -= count_by_segment;
             }
@@ -288,7 +287,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                           segindex * segment_increment, 
                                           count_by_segment, datatype, 
                                           tree->tree_prev, 
-                                          MCA_COLL_BASE_TAG_REDUCE, 
+                                          COLL_TAG_REDUCE,
                                           comm );
                 creq = (creq + 1) % max_outstanding_reqs;
                 segindex++;
@@ -303,6 +302,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
             free(sreq);
         }
     }
+    free(tree);
     return MPI_SUCCESS;
 
  error_hndl:  /* error handler */
@@ -521,8 +521,8 @@ int smpi_coll_tuned_reduce_ompi_in_order_binary( void *sendbuf, void *recvbuf,
                 return MPI_ERR_INTERN;
             }
             smpi_datatype_copy (
-                                                (char*)tmpbuf, count, datatype,
-                                                (char*)recvbuf, count, datatype);
+                                                (char*)recvbuf, count, datatype,
+                                                (char*)tmpbuf, count, datatype);
             use_this_sendbuf = tmpbuf;
         } else if (io_root == rank) {
             tmpbuf = (char *) malloc(text + (count - 1) * ext);
@@ -545,7 +545,7 @@ int smpi_coll_tuned_reduce_ompi_in_order_binary( void *sendbuf, void *recvbuf,
         if (root == rank) {
             /* Receive result from rank io_root to recvbuf */
             smpi_mpi_recv(recvbuf, count, datatype, io_root,
-                                    MCA_COLL_BASE_TAG_REDUCE, comm,
+                                    COLL_TAG_REDUCE, comm,
                                     MPI_STATUS_IGNORE);
             if (MPI_IN_PLACE == sendbuf) {
                 free(use_this_sendbuf);
@@ -554,7 +554,7 @@ int smpi_coll_tuned_reduce_ompi_in_order_binary( void *sendbuf, void *recvbuf,
         } else if (io_root == rank) {
             /* Send result from use_this_recvbuf to root */
             smpi_mpi_send(use_this_recvbuf, count, datatype, root,
-                                    MCA_COLL_BASE_TAG_REDUCE, 
+                                    COLL_TAG_REDUCE,
                                     comm);
             free(use_this_recvbuf);
         }
@@ -610,7 +610,7 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
 
     if (rank != root) {
         smpi_mpi_send(sbuf, count, dtype, root,
-                                MCA_COLL_BASE_TAG_REDUCE,
+                                COLL_TAG_REDUCE,
                                 comm);
         return -1;
     }
@@ -639,11 +639,10 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
     /* Initialize the receive buffer. */
 
     if (rank == (size - 1)) {
-        smpi_datatype_copy((char*)rbuf, count, dtype,
-                                                  (char*)sbuf, count, dtype);
+        smpi_datatype_copy((char*)sbuf, count, dtype,(char*)rbuf, count, dtype);
     } else {
         smpi_mpi_recv(rbuf, count, dtype, size - 1,
-                                MCA_COLL_BASE_TAG_REDUCE, comm,
+                                COLL_TAG_REDUCE, comm,
                                 MPI_STATUS_IGNORE);
     }
 
@@ -654,7 +653,7 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
             inbuf = (char*)sbuf;
         } else {
             smpi_mpi_recv(pml_buffer, count, dtype, i,
-                                    MCA_COLL_BASE_TAG_REDUCE, comm,
+                                    COLL_TAG_REDUCE, comm,
                                     MPI_STATUS_IGNORE);
             inbuf = pml_buffer;
         }
@@ -664,8 +663,8 @@ smpi_coll_tuned_reduce_ompi_basic_linear(void *sbuf, void *rbuf, int count,
     }
 
     if (NULL != inplace_temp) {
-        smpi_datatype_copy((char*)sbuf, count, dtype,
-                                                  inplace_temp,count , dtype);
+        smpi_datatype_copy(inplace_temp, count, dtype,(char*)sbuf
+                                                  ,count , dtype);
         free(inplace_temp);
     }
     if (NULL != free_buffer) {
index 2c61d48..19c6794 100644 (file)
@@ -15,7 +15,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf,
   int recv_idx, last_idx = 0, newdst;
   int dst, send_cnt, recv_cnt, newroot, newdst_tree_root;
   int newroot_tree_root, new_count;
-  int tag = 4321;
+  int tag = COLL_TAG_REDUCE;
   void *send_ptr, *recv_ptr, *tmp_buf;
 
   cnts = NULL;
@@ -387,6 +387,8 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf,
       }
     }
   }
+  if (tmp_buf)
+    free(tmp_buf);
   if (cnts)
     free(cnts);
   if (disps)
index dbde2e6..76cbf0f 100644 (file)
@@ -1,5 +1,4 @@
 #include "colls_private.h"
-#define MPIR_REDUCE_SCATTER_TAG 222
 
 static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 {
@@ -46,6 +45,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_pair(void *sendbuf, void *recvbuf, int
     }
     
     if (total_count == 0) {
+        xbt_free(disps);
         return MPI_ERR_COUNT;
     }
 
@@ -70,16 +70,16 @@ int smpi_coll_tuned_reduce_scatter_mpich_pair(void *sendbuf, void *recvbuf, int
             if (sendbuf != MPI_IN_PLACE) 
                 smpi_mpi_sendrecv(((char *)sendbuf+disps[dst]*extent), 
                                              recvcounts[dst], datatype, dst,
-                                             MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+                                             COLL_TAG_SCATTER, tmp_recvbuf,
                                              recvcounts[rank], datatype, src,
-                                             MPIR_REDUCE_SCATTER_TAG, comm,
+                                             COLL_TAG_SCATTER, comm,
                                              MPI_STATUS_IGNORE);
             else
                 smpi_mpi_sendrecv(((char *)recvbuf+disps[dst]*extent), 
                                              recvcounts[dst], datatype, dst,
-                                             MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+                                             COLL_TAG_SCATTER, tmp_recvbuf,
                                              recvcounts[rank], datatype, src,
-                                             MPIR_REDUCE_SCATTER_TAG, comm,
+                                             COLL_TAG_SCATTER, comm,
                                              MPI_STATUS_IGNORE);
             
             if (is_commutative || (src < rank)) {
@@ -135,7 +135,10 @@ int smpi_coll_tuned_reduce_scatter_mpich_pair(void *sendbuf, void *recvbuf, int
             if (mpi_errno) return(mpi_errno);
         }
     
-return MPI_SUCCESS;
+        xbt_free(disps);
+        xbt_free(tmp_recvbuf);
+
+        return MPI_SUCCESS;
 }
     
 
@@ -179,6 +182,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
 
     tmp_buf0=( void *)xbt_malloc( true_extent * total_count);
     tmp_buf1=( void *)xbt_malloc( true_extent * total_count);
+    void *tmp_buf0_save=tmp_buf0;
+    void *tmp_buf1_save=tmp_buf1;
+
     /* adjust for potential negative lower bound in datatype */
     tmp_buf0 = (void *)((char*)tmp_buf0 - true_lb);
     tmp_buf1 = (void *)((char*)tmp_buf1 - true_lb);
@@ -212,9 +218,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
         }
 
         smpi_mpi_sendrecv(outgoing_data + send_offset*true_extent,
-                                     size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+                                     size, datatype, peer, COLL_TAG_SCATTER,
                                      incoming_data + recv_offset*true_extent,
-                                     size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+                                     size, datatype, peer, COLL_TAG_SCATTER,
                                      comm, MPI_STATUS_IGNORE);
         /* always perform the reduction at recv_offset, the data at send_offset
            is now our peer's responsibility */
@@ -246,6 +252,8 @@ int smpi_coll_tuned_reduce_scatter_mpich_noncomm(void *sendbuf, void *recvbuf, i
     result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = smpi_datatype_copy(result_ptr, size, datatype,
                                recvbuf, size, datatype);
+    xbt_free(tmp_buf0_save);
+    xbt_free(tmp_buf1_save);
     if (mpi_errno) return(mpi_errno);
     return MPI_SUCCESS;
 }
@@ -264,7 +272,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
     int mask, dst_tree_root, my_tree_root, j, k;
     int received;
     MPI_Datatype sendtype, recvtype;
-    int nprocs_completed, tmp_mask, tree_root, is_commutative;
+    int nprocs_completed, tmp_mask, tree_root, is_commutative=0;
     comm_size = smpi_comm_size(comm);
     rank = smpi_comm_rank(comm);
 
@@ -367,9 +375,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                        tmp_results. accumulation is done later below.   */ 
 
                     smpi_mpi_sendrecv(tmp_results, 1, sendtype, dst,
-                                                 MPIR_REDUCE_SCATTER_TAG, 
+                                                 COLL_TAG_SCATTER,
                                                  tmp_recvbuf, 1, recvtype, dst,
-                                                 MPIR_REDUCE_SCATTER_TAG, comm,
+                                                 COLL_TAG_SCATTER, comm,
                                                  MPI_STATUS_IGNORE);
                     received = 1;
                 }
@@ -411,7 +419,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                             && (dst >= tree_root + nprocs_completed)) {
                             /* send the current result */
                             smpi_mpi_send(tmp_recvbuf, 1, recvtype,
-                                                     dst, MPIR_REDUCE_SCATTER_TAG,
+                                                     dst, COLL_TAG_SCATTER,
                                                      comm);
                         }
                         /* recv only if this proc. doesn't have data and sender
@@ -420,7 +428,7 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                                  (dst < tree_root + nprocs_completed) &&
                                  (rank >= tree_root + nprocs_completed)) {
                             smpi_mpi_recv(tmp_recvbuf, 1, recvtype, dst,
-                                                     MPIR_REDUCE_SCATTER_TAG,
+                                                     COLL_TAG_SCATTER,
                                                      comm, MPI_STATUS_IGNORE); 
                             received = 1;
                         }
@@ -466,8 +474,8 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                     }
                 }
 
-                //smpi_datatype_free(&sendtype);
-                //smpi_datatype_free(&recvtype);
+                smpi_datatype_free(&sendtype);
+                smpi_datatype_free(&recvtype);
 
                 mask <<= 1;
                 i++;
@@ -479,6 +487,9 @@ int smpi_coll_tuned_reduce_scatter_mpich_rdb(void *sendbuf, void *recvbuf, int r
                                        recvcounts[rank], datatype);
             if (mpi_errno) return(mpi_errno);
 
+    xbt_free(disps);
+    xbt_free(tmp_recvbuf);
+    xbt_free(tmp_results);
     return MPI_SUCCESS;
         }
 
index e10be98..bb01dee 100644 (file)
@@ -22,7 +22,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_REDUCE_SCATTER 222
 /*
  * Recursive-halving function is (*mostly*) copied from the BASIC coll module.
  * I have removed the part which handles "large" message sizes 
@@ -116,13 +115,13 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
     if (rank < 2 * remain) {
         if ((rank & 1) == 0) {
             smpi_mpi_send(result_buf, count, dtype, rank + 1, 
-                                    MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                    COLL_TAG_REDUCE_SCATTER,
                                     comm);
             /* we don't participate from here on out */
             tmp_rank = -1;
         } else {
             smpi_mpi_recv(recv_buf, count, dtype, rank - 1,
-                                    MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                    COLL_TAG_REDUCE_SCATTER,
                                     comm, MPI_STATUS_IGNORE);
          
             /* integrate their results into our temp results */
@@ -211,7 +210,7 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
             if (send_count > 0 && recv_count != 0) {
                 request=smpi_mpi_irecv(recv_buf + (ptrdiff_t)tmp_disps[recv_index] * extent,
                                          recv_count, dtype, peer,
-                                         MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                         COLL_TAG_REDUCE_SCATTER,
                                          comm);
                 if (MPI_SUCCESS != err) {
                     xbt_free(tmp_rcounts);
@@ -222,7 +221,7 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
             if (recv_count > 0 && send_count != 0) {
                 smpi_mpi_send(result_buf + (ptrdiff_t)tmp_disps[send_index] * extent,
                                         send_count, dtype, peer, 
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm);
                 if (MPI_SUCCESS != err) {
                     xbt_free(tmp_rcounts);
@@ -271,14 +270,14 @@ smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving(void *sbuf,
         if ((rank & 1) == 0) {
             if (rcounts[rank]) {
                 smpi_mpi_recv(rbuf, rcounts[rank], dtype, rank + 1,
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm, MPI_STATUS_IGNORE);
             }
         } else {
             if (rcounts[rank - 1]) {
                 smpi_mpi_send(result_buf + disps[rank - 1] * extent,
                                         rcounts[rank - 1], dtype, rank - 1,
-                                        MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                        COLL_TAG_REDUCE_SCATTER,
                                         comm);
             }
         }            
@@ -452,11 +451,11 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
     inbi = 0;
     /* Initialize first receive from the neighbor on the left */
     reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
-                             MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm
+                             COLL_TAG_REDUCE_SCATTER, comm
                              );
     tmpsend = accumbuf + (ptrdiff_t)displs[recv_from] * extent;
     smpi_mpi_send(tmpsend, rcounts[recv_from], dtype, send_to,
-                            MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                            COLL_TAG_REDUCE_SCATTER,
                              comm);
 
     for (k = 2; k < size; k++) {
@@ -466,7 +465,7 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
 
         /* Post irecv for the current block */
         reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
-                                 MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm 
+                                 COLL_TAG_REDUCE_SCATTER, comm
                                  );
       
         /* Wait on previous block to arrive */
@@ -480,7 +479,7 @@ smpi_coll_tuned_reduce_scatter_ompi_ring(void *sbuf, void *rbuf, int *rcounts,
       
         /* send previous block to send_to */
         smpi_mpi_send(tmprecv, rcounts[prevblock], dtype, send_to,
-                                MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+                                COLL_TAG_REDUCE_SCATTER,
                                  comm);
     }
 
index 205d602..c65b6f9 100644 (file)
@@ -20,7 +20,6 @@
 #include "colls_private.h"
 #include "coll_tuned_topo.h"
 
-#define MCA_COLL_BASE_TAG_SCATTER 111
 
 int
 smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
@@ -101,7 +100,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
        }
        total_send = scount;
     } else if (!(vrank % 2)) {
-       /* non-root, non-leaf nodes, allocte temp buffer for recv
+       /* non-root, non-leaf nodes, allocate temp buffer for recv
         * the most we need is rcount*size/2 */
        tempbuf = (char *) malloc(rtrue_extent + (rcount*size - 1) * rextent);
        if (NULL == tempbuf) {
@@ -123,7 +122,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
        if (rank != root) {
            /* recv from parent on non-root */
            smpi_mpi_recv(ptmp, rcount*size, rdtype, bmtree->tree_prev,
-                                   MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+                                   COLL_TAG_SCATTER, comm, &status);
            /* local copy to rbuf */
            err = smpi_datatype_copy(ptmp, scount, sdtype,
                                  rbuf, rcount, rdtype);
@@ -140,7 +139,7 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
 
            smpi_mpi_send(ptmp + total_send*sextent, mycount, sdtype,
                                    bmtree->tree_next[i],
-                                   MCA_COLL_BASE_TAG_SCATTER,
+                                   COLL_TAG_SCATTER,
                                     comm);
 
            total_send += mycount;
@@ -151,8 +150,10 @@ smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
     } else {
        /* recv from parent on leaf nodes */
        smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev,
-                               MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+                               COLL_TAG_SCATTER, comm, &status);
     }
+    //!FIXME : store the tree, as done in ompi, instead of calculating it each time ?
+    xbt_free(bmtree);
 
     return MPI_SUCCESS;
 
@@ -207,7 +208,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount,
 
     if (rank != root) {
         smpi_mpi_recv(rbuf, rcount, rdtype, root,
-                                MCA_COLL_BASE_TAG_SCATTER,
+                                COLL_TAG_SCATTER,
                                 comm, MPI_STATUS_IGNORE);
         return MPI_SUCCESS;
     }
@@ -232,7 +233,7 @@ smpi_coll_tuned_scatter_ompi_basic_linear(void *sbuf, int scount,
             }
         } else {
             smpi_mpi_send(ptmp, scount, sdtype, i,
-                                    MCA_COLL_BASE_TAG_SCATTER,
+                                    COLL_TAG_SCATTER,
                                      comm);
         }
         if (MPI_SUCCESS != err) {
diff --git a/src/smpi/colls/smpi_automatic_selector.c b/src/smpi/colls/smpi_automatic_selector.c
new file mode 100644 (file)
index 0000000..a94bd31
--- /dev/null
@@ -0,0 +1,70 @@
+#include "colls_private.h"
+#include <limits.h>
+#include "mc/mc_private.h"
+
+//attempt to do a quick autotuning version of the collective,
+
+#ifdef HAVE_TRACING
+#define TRACE_AUTO_COLL(cat) if (TRACE_is_enabled()){\
+        type_t type = PJ_type_get_or_null (#cat, PJ_type_get_root());\
+         if (!type){\
+             type=PJ_type_event_new(#cat, PJ_type_get_root());\
+         }\
+         char* cont_name=malloc(25*sizeof(char*));\
+         sprintf(cont_name, "rank-%d", smpi_process_index());\
+         val_t value = PJ_value_get_or_new(mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\
+         new_pajeNewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\
+      }
+#else
+#define TRACE_AUTO_COLL(cat)
+#endif
+
+
+#define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)\
+    ret smpi_coll_tuned_ ## cat ## _ ## automatic(COLL_UNPAREN args)\
+{\
+  double time1, time2, time_min=INT_MAX;\
+  int min_coll=-1, global_coll=-1;\
+  int i;\
+  double buf_in, buf_out, max_min=INT_MAX;\
+  for (i = 0; mpi_coll_##cat##_description[i].name; i++){\
+      if(!strcmp(mpi_coll_##cat##_description[i].name, "automatic"))continue;\
+      if(!strcmp(mpi_coll_##cat##_description[i].name, "default"))continue;\
+      smpi_mpi_barrier(comm);\
+      TRACE_AUTO_COLL(cat)\
+      time1 = SIMIX_get_clock();\
+      ((int (*) args)\
+          mpi_coll_##cat##_description[i].coll) args2 ;\
+      time2 = SIMIX_get_clock();\
+      buf_out=time2-time1;\
+      smpi_mpi_reduce((void*)&buf_out,(void*)&buf_in, 1, MPI_DOUBLE, MPI_MAX, 0,comm );\
+      if(time2-time1<time_min){\
+          min_coll=i;\
+          time_min=time2-time1;\
+      }\
+      if(smpi_comm_rank(comm)==0){\
+          if(buf_in<max_min){\
+              max_min=buf_in;\
+              global_coll=i;\
+          }\
+      }\
+  }\
+  if(smpi_comm_rank(comm)==0){\
+      XBT_WARN("For rank 0, the quickest was %s : %f , but global was %s : %f at max",mpi_coll_##cat##_description[min_coll].name, time_min,mpi_coll_##cat##_description[global_coll].name, max_min);\
+  }else\
+  XBT_WARN("The quickest %s was %s on rank %d and took %f",#cat,mpi_coll_##cat##_description[min_coll].name, smpi_comm_rank(comm), time_min);\
+  return (min_coll!=-1)?MPI_SUCCESS:MPI_ERR_INTERN;\
+}\
+
+
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLGATHERV_SIG, (send_buff, send_count, send_type, recv_buff, recv_count, recv_disps, recv_type, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLREDUCE_SIG, (sbuf, rbuf, rcount, dtype, op, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_GATHER_SIG, (send_buff, send_count, send_type, recv_buff, recv_count, recv_type, root, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLGATHER_SIG, (send_buff,send_count,send_type,recv_buff,recv_count,recv_type,comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLTOALL_SIG,(send_buff, send_count, send_type, recv_buff, recv_count, recv_type,comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_ALLTOALLV_SIG, (send_buff, send_counts, send_disps, send_type, recv_buff, recv_counts, recv_disps, recv_type, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_BCAST_SIG , (buf, count, datatype, root, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_REDUCE_SIG,(buf,rbuf, count, datatype, op, root, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_REDUCE_SCATTER_SIG ,(sbuf,rbuf, rcounts,dtype,op,comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_SCATTER_SIG ,(sendbuf, sendcount, sendtype,recvbuf, recvcount, recvtype,root, comm));
+COLL_APPLY(AUTOMATIC_COLL_BENCH, COLL_BARRIER_SIG,(comm));
index c81e2f2..5ecdb86 100644 (file)
@@ -1,6 +1,6 @@
 /* selector for collective algorithms based on mpich decision logic */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -74,7 +74,7 @@ int smpi_coll_tuned_allreduce_mpich(void *sbuf, void *rbuf, int count,
 
     if (block_dsize > large_message && count >= pof2 && smpi_op_is_commute(op)) {
       //for long messages
-       return (smpi_coll_tuned_allreduce_rab_rsag (sbuf, rbuf, 
+       return (smpi_coll_tuned_allreduce_rab_rdb (sbuf, rbuf, 
                                                                    count, dtype,
                                                                    op, comm));
     }else {
@@ -167,7 +167,7 @@ int smpi_coll_tuned_alltoall_mpich( void *sbuf, int scount,
                                                     comm);
 
     } else if (block_dsize < medium_size) {
-        return smpi_coll_tuned_alltoall_simple(sbuf, scount, sdtype, 
+        return smpi_coll_tuned_alltoall_basic_linear(sbuf, scount, sdtype, 
                                                            rbuf, rcount, rdtype, 
                                                            comm);
     }else if (communicator_size%2){
@@ -176,7 +176,7 @@ int smpi_coll_tuned_alltoall_mpich( void *sbuf, int scount,
                                                            comm);
     }
 
-    return smpi_coll_tuned_alltoall_pair (sbuf, scount, sdtype, 
+    return smpi_coll_tuned_alltoall_ring (sbuf, scount, sdtype,
                                                     rbuf, rcount, rdtype,
                                                     comm);
 }
@@ -426,6 +426,8 @@ int smpi_coll_tuned_reduce_scatter_mpich( void *sbuf, void *rbuf,
     int comm_size, i;
     size_t total_message_size;
 
+    if(sbuf==rbuf)sbuf=MPI_IN_PLACE; //restore MPI_IN_PLACE as these algorithms handle it
+
     XBT_DEBUG("smpi_coll_tuned_reduce_scatter_mpich");
     
     comm_size = smpi_comm_size(comm);
@@ -595,15 +597,18 @@ int smpi_coll_tuned_allgatherv_mpich(void *sbuf, int scount,
                                                MPI_Comm  comm
                                                )
 {
-    int communicator_size, pow2_size;
-    size_t dsize, total_dsize;
+    int communicator_size, pow2_size,i;
+    size_t total_dsize;
 
     communicator_size = smpi_comm_size(comm);
 
     /* Determine complete data size */
-    dsize=smpi_datatype_size(sdtype);
-    total_dsize = dsize * scount * communicator_size;   
-   
+    total_dsize = 0;
+    for (i=0; i<communicator_size; i++)
+        total_dsize += rcounts[i];
+    if (total_dsize == 0)
+      return MPI_SUCCESS;
+    
     for (pow2_size  = 1; pow2_size < communicator_size; pow2_size <<=1); 
 
     if ((pow2_size == communicator_size) && (total_dsize < 524288)) {
@@ -615,7 +620,7 @@ int smpi_coll_tuned_allgatherv_mpich(void *sbuf, int scount,
                                                      rbuf, rcounts, rdispls, rdtype,
                                                      comm);
     } 
-    return smpi_coll_tuned_allgatherv_ring(sbuf, scount, sdtype, 
+    return smpi_coll_tuned_allgatherv_mpich_ring(sbuf, scount, sdtype,
                                                 rbuf, rcounts, rdispls, rdtype,
                                                 comm);
 }
@@ -684,8 +689,17 @@ int smpi_coll_tuned_scatter_mpich(void *sbuf, int scount,
                                             int root, MPI_Comm  comm
                                             )
 {
-        return smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype, 
+  if(smpi_comm_rank(comm)!=root){
+      sbuf=xbt_malloc(rcount*smpi_datatype_get_extent(rdtype));
+      scount=rcount;
+      sdtype=rdtype;
+  }
+  int ret= smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
                                                        rbuf, rcount, rdtype, 
                                                        root, comm);
+  if(smpi_comm_rank(comm)!=root){
+      xbt_free(sbuf);
+  }
+  return ret;
 }
 
index 939b643..49a12c3 100644 (file)
@@ -1,6 +1,6 @@
 /* selector for collective algorithms based on openmpi's default coll_tuned_decision_fixed selector */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -76,12 +76,12 @@ int smpi_coll_tuned_alltoall_ompi( void *sbuf, int scount,
                                                     comm);
 
     } else if (block_dsize < 3000) {
-        return smpi_coll_tuned_alltoall_simple(sbuf, scount, sdtype, 
+        return smpi_coll_tuned_alltoall_basic_linear(sbuf, scount, sdtype, 
                                                            rbuf, rcount, rdtype, 
                                                            comm);
     }
 
-    return smpi_coll_tuned_alltoall_pair (sbuf, scount, sdtype, 
+    return smpi_coll_tuned_alltoall_ring (sbuf, scount, sdtype, 
                                                     rbuf, rcount, rdtype,
                                                     comm);
 }
@@ -94,7 +94,7 @@ int smpi_coll_tuned_alltoallv_ompi(void *sbuf, int *scounts, int *sdisps,
                                               )
 {
     /* For starters, just keep the original algorithm. */
-    return smpi_coll_tuned_alltoallv_pair(sbuf, scounts, sdisps, sdtype, 
+    return smpi_coll_tuned_alltoallv_ompi_basic_linear(sbuf, scounts, sdisps, sdtype, 
                                                         rbuf, rcounts, rdisps,rdtype,
                                                         comm);
 }
@@ -596,9 +596,18 @@ int smpi_coll_tuned_scatter_ompi(void *sbuf, int scount,
 
     if ((communicator_size > small_comm_size) &&
         (block_size < small_block_size)) {
-        return smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype, 
-                                                       rbuf, rcount, rdtype, 
-                                                       root, comm);
+        if(rank!=root){
+            sbuf=xbt_malloc(rcount*smpi_datatype_get_extent(rdtype));
+            scount=rcount;
+            sdtype=rdtype;
+        }
+        int ret=smpi_coll_tuned_scatter_ompi_binomial (sbuf, scount, sdtype,
+            rbuf, rcount, rdtype,
+            root, comm);
+        if(rank!=root){
+            xbt_free(sbuf);
+        }
+        return ret;
     }
     return smpi_coll_tuned_scatter_ompi_basic_linear (sbuf, scount, sdtype, 
                                                        rbuf, rcount, rdtype, 
index 2aa3d53..4bb6e41 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. 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 "mc/mc.h"
 #include <ctype.h>
 #include <wchar.h>
 
@@ -38,6 +37,7 @@ static const char *smpi_colors[] ={
     "reduce",        "0 1 0",
     "reducescatter", "0.52 1 0.52",
     "scan",          "1 0.58 0.23",
+    "exscan",          "1 0.54 0.25",
     "scatterv",      "0.52 0 0.52",
     "scatter",       "1 0.74 0.54",
     "computing",     "0 1 1",
@@ -87,9 +87,6 @@ static char *TRACE_smpi_put_key(int src, int dst, char *key, int n)
   }
   //generate the key
   static unsigned long long counter = 0;
-  
-  if(MC_is_active())
-    MC_ignore_data_bss(&counter, sizeof(counter));
 
   snprintf(key, n, "%d_%d_%llu", src, dst, counter++);
 
@@ -180,7 +177,7 @@ void TRACE_smpi_finalize(int rank)
   PJ_container_free (container);
 }
 
-void TRACE_smpi_collective_in(int rank, int root, const char *operation)
+void TRACE_smpi_collective_in(int rank, int root, const char *operation, int size)
 {
   if (!TRACE_smpi_is_enabled()) return;
 
@@ -190,7 +187,7 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation)
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   val_t value = PJ_value_get_or_new (operation, color, type);
-  new_pajePushState (SIMIX_get_clock(), container, type, value);
+  new_pajePushStateWithSize (SIMIX_get_clock(), container, type, value, size);
 }
 
 void TRACE_smpi_collective_out(int rank, int root, const char *operation)
@@ -244,7 +241,7 @@ void TRACE_smpi_computing_out(int rank)
   new_pajePopState (SIMIX_get_clock(), container, type);
 }
 
-void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
+void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, int size)
 {
   if (!TRACE_smpi_is_enabled()) return;
 
@@ -255,7 +252,7 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   val_t value = PJ_value_get_or_new (operation, color, type);
-  new_pajePushState (SIMIX_get_clock(), container, type, value);
+  new_pajePushStateWithSize (SIMIX_get_clock(), container, type, value, size);
 }
 
 void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
@@ -270,12 +267,11 @@ void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
   new_pajePopState (SIMIX_get_clock(), container, type);
 }
 
-void TRACE_smpi_send(int rank, int src, int dst)
+void TRACE_smpi_send(int rank, int src, int dst, int size)
 {
   if (!TRACE_smpi_is_enabled()) return;
 
-  char key[INSTR_DEFAULT_STR_SIZE];
-  bzero (key, INSTR_DEFAULT_STR_SIZE);
+  char key[INSTR_DEFAULT_STR_SIZE] = {0};
   TRACE_smpi_put_key(src, dst, key, INSTR_DEFAULT_STR_SIZE);
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -283,15 +279,14 @@ void TRACE_smpi_send(int rank, int src, int dst)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
 
-  new_pajeStartLink (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+  new_pajeStartLinkWithSize (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
 }
 
 void TRACE_smpi_recv(int rank, int src, int dst)
 {
   if (!TRACE_smpi_is_enabled()) return;
 
-  char key[INSTR_DEFAULT_STR_SIZE];
-  bzero (key, INSTR_DEFAULT_STR_SIZE);
+  char key[INSTR_DEFAULT_STR_SIZE] = {0};
   TRACE_smpi_get_key(src, dst, key, INSTR_DEFAULT_STR_SIZE);
 
   char str[INSTR_DEFAULT_STR_SIZE];
index 156337f..3d5ded9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@ typedef struct s_smpi_process_data *smpi_process_data_t;
 #define RECV_DELETE    0x10
 #define ISEND          0x20
 #define SSEND          0x40
+#define PREPARED       0x80
 // this struct is here to handle the problem of non-contignous data
 // for each such structure these function should be implemented (vector
 // index hvector hindex struct)
@@ -47,6 +48,20 @@ typedef struct s_smpi_mpi_datatype{
   int in_use;
 } s_smpi_mpi_datatype_t;
 
+
+#define COLL_TAG_REDUCE -112
+#define COLL_TAG_SCATTER -223
+#define COLL_TAG_SCATTERV -334
+#define COLL_TAG_GATHER -445
+#define COLL_TAG_ALLGATHER -556
+#define COLL_TAG_ALLGATHERV -667
+#define COLL_TAG_BARRIER -778
+#define COLL_TAG_REDUCE_SCATTER -889
+#define COLL_TAG_ALLTOALLV -1000
+#define COLL_TAG_ALLTOALL -1112
+#define COLL_TAG_GATHERV -2223
+#define COLL_TAG_BCAST -3334
+#define COLL_TAG_ALLREDUCE -4445
 //*****************************************************************************************
 
 typedef struct s_smpi_mpi_request {
@@ -79,9 +94,12 @@ typedef struct s_smpi_mpi_request {
 #endif
 } s_smpi_mpi_request_t;
 
-void smpi_process_init(int *argc, char ***argv);
 void smpi_process_destroy(void);
 void smpi_process_finalize(void);
+int smpi_process_finalized(void);
+int smpi_process_initialized(void);
+void smpi_process_mark_as_initialized(void);
+
 
 smpi_process_data_t smpi_process_data(void);
 smpi_process_data_t smpi_process_remote_data(int index);
@@ -141,6 +159,7 @@ void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
                    MPI_Datatype * datatype);
 
 MPI_Group smpi_group_new(int size);
+MPI_Group smpi_group_copy(MPI_Group origin);
 void smpi_group_destroy(MPI_Group group);
 void smpi_group_set_mapping(MPI_Group group, int index, int rank);
 int smpi_group_index(MPI_Group group, int rank);
@@ -157,6 +176,8 @@ int smpi_comm_size(MPI_Comm comm);
 void smpi_comm_get_name(MPI_Comm comm, char* name, int* len);
 int smpi_comm_rank(MPI_Comm comm);
 MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key);
+void smpi_comm_use(MPI_Comm comm);
+void smpi_comm_unuse(MPI_Comm comm);
 
 MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
                                int dst, int tag, MPI_Comm comm);
@@ -237,6 +258,8 @@ void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count,
                         MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
 void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
                    MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
+void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count,
+                   MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
 
 void nary_tree_bcast(void *buf, int count, MPI_Datatype datatype, int root,
                      MPI_Comm comm, int arity);
@@ -367,11 +390,164 @@ void mpi_sendrecv_(void* sendbuf, int* sendcount, int* sendtype, int* dst,
                 int* recvtype, int* src, int* recvtag,
                 int* comm, MPI_Status* status, int* ierr);
 
+void mpi_finalized_ (int * flag, int* ierr);
+void mpi_init_thread_ (int *required, int *provided, int* ierr);
+void mpi_query_thread_ (int *provided, int* ierr);
+void mpi_is_thread_main_ (int *flag, int* ierr);
+void mpi_address_ (void *location, MPI_Aint * address, int* ierr);
+void mpi_get_address_ (void *location, MPI_Aint * address, int* ierr);
+void mpi_type_dup_ (int*  datatype, int* newdatatype, int* ierr);
+void mpi_type_set_name_ (int*  datatype, char * name, int* ierr);
+void mpi_type_get_name_ (int*  datatype, char * name, int* len, int* ierr);
+void mpi_type_get_attr_ (int* type, int* type_keyval, void *attribute_val, int* flag, int* ierr);
+void mpi_type_set_attr_ (int* type, int* type_keyval, void *attribute_val, int* ierr);
+void mpi_type_delete_attr_ (int* type, int* type_keyval, int* ierr);
+void mpi_type_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr);
+void mpi_type_free_keyval_ (int* keyval, int* ierr) ;
+void mpi_pcontrol_ (int* level , int* ierr);
+void mpi_type_get_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr);
+void mpi_type_get_true_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr);
+void mpi_op_create_ (void * function, int* commute, int* op, int* ierr);
+void mpi_op_free_ (int* op, int* ierr);
+void mpi_group_free_ (int* group, int* ierr);
+void mpi_group_size_ (int* group, int *size, int* ierr);
+void mpi_group_rank_ (int* group, int *rank, int* ierr);
+void mpi_group_translate_ranks_ (int* group1, int* n, int *ranks1, int* group2, int *ranks2, int* ierr);
+void mpi_group_compare_ (int* group1, int* group2, int *result, int* ierr);
+void mpi_group_union_ (int* group1, int* group2, int* newgroup, int* ierr);
+void mpi_group_intersection_ (int* group1, int* group2, int* newgroup, int* ierr);
+void mpi_group_difference_ (int* group1, int* group2, int* newgroup, int* ierr);
+void mpi_group_excl_ (int* group, int* n, int *ranks, int* newgroup, int* ierr);
+void mpi_group_range_incl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr);
+void mpi_group_range_excl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr);
+void mpi_comm_get_attr_ (int* comm, int* comm_keyval, void *attribute_val, int *flag, int* ierr);
+void mpi_comm_set_attr_ (int* comm, int* comm_keyval, void *attribute_val, int* ierr);
+void mpi_comm_delete_attr_ (int* comm, int* comm_keyval, int* ierr);
+void mpi_comm_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr);
+void mpi_comm_free_keyval_ (int* keyval, int* ierr) ;
+void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr);
+void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr);
+void mpi_comm_disconnect_ (int* comm, int* ierr);
+void mpi_request_free_ (int* request, int* ierr);
+void mpi_sendrecv_replace_ (void *buf, int* count, int* datatype, int* dst, int* sendtag, int* src, int* recvtag,
+ int* comm, MPI_Status* status, int* ierr);
+void mpi_testany_ (int* count, int* requests, int *index, int *flag, MPI_Status* status, int* ierr);
+void mpi_waitsome_ (int* incount, int* requests, int *outcount, int *indices, MPI_Status* status, int* ierr);
+void mpi_reduce_local_ (void *inbuf, void *inoutbuf, int* count, int* datatype, int* op, int* ierr);
+void mpi_reduce_scatter_block_ (void *sendbuf, void *recvbuf, int* recvcount, int* datatype, int* op, int* comm, int* ierr);
+void mpi_pack_size_ (int* incount, int* datatype, int* comm, int* size, int* ierr) ;
+void mpi_cart_coords_ (int* comm, int* rank, int* maxdims, int* coords, int* ierr) ;
+void mpi_cart_create_ (int* comm_old, int* ndims, int* dims, int* periods, int* reorder, int*  comm_cart, int* ierr) ;
+void mpi_cart_get_ (int* comm, int* maxdims, int* dims, int* periods, int* coords, int* ierr) ;
+void mpi_cart_map_ (int* comm_old, int* ndims, int* dims, int* periods, int* newrank, int* ierr) ;
+void mpi_cart_rank_ (int* comm, int* coords, int* rank, int* ierr) ;
+void mpi_cart_shift_ (int* comm, int* direction, int* displ, int* source, int* dest, int* ierr) ;
+void mpi_cart_sub_ (int* comm, int* remain_dims, int*  comm_new, int* ierr) ;
+void mpi_cartdim_get_ (int* comm, int* ndims, int* ierr) ;
+void mpi_graph_create_ (int* comm_old, int* nnodes, int* index, int* edges, int* reorder, int*  comm_graph, int* ierr) ;
+void mpi_graph_get_ (int* comm, int* maxindex, int* maxedges, int* index, int* edges, int* ierr) ;
+void mpi_graph_map_ (int* comm_old, int* nnodes, int* index, int* edges, int* newrank, int* ierr) ;
+void mpi_graph_neighbors_ (int* comm, int* rank, int* maxneighbors, int* neighbors, int* ierr) ;
+void mpi_graph_neighbors_count_ (int* comm, int* rank, int* nneighbors, int* ierr) ;
+void mpi_graphdims_get_ (int* comm, int* nnodes, int* nedges, int* ierr) ;
+void mpi_topo_test_ (int* comm, int* top_type, int* ierr) ;
+void mpi_error_class_ (int* errorcode, int* errorclass, int* ierr) ;
+void mpi_errhandler_create_ (void* function, void* errhandler, int* ierr) ;
+void mpi_errhandler_free_ (void* errhandler, int* ierr) ;
+void mpi_errhandler_get_ (int* comm, void* errhandler, int* ierr) ;
+void mpi_errhandler_set_ (int* comm, void* errhandler, int* ierr) ;
+void mpi_comm_set_errhandler_ (int* comm, void* errhandler, int* ierr) ;
+void mpi_comm_get_errhandler_ (int* comm, void* errhandler, int* ierr) ;
+void mpi_type_contiguous_ (int* count, int* old_type, int*  newtype, int* ierr) ;
+void mpi_cancel_ (int*  request, int* ierr) ;
+void mpi_buffer_attach_ (void* buffer, int* size, int* ierr) ;
+void mpi_buffer_detach_ (void* buffer, int* size, int* ierr) ;
+void mpi_testsome_ (int* incount, int*  requests, int* outcount, int* indices, MPI_Status*  statuses, int* ierr) ;
+void mpi_comm_test_inter_ (int* comm, int* flag, int* ierr) ;
+void mpi_unpack_ (void* inbuf, int* insize, int* position, void* outbuf, int* outcount, int* type, int* comm, int* ierr) ;
+void mpi_pack_external_size_ (char *datarep, int* incount, int* datatype, MPI_Aint *size, int* ierr);
+void mpi_pack_external_ (char *datarep, void *inbuf, int* incount, int* datatype, void *outbuf, MPI_Aint* outcount, MPI_Aint *position, int* ierr);
+void mpi_unpack_external_ ( char *datarep, void *inbuf, MPI_Aint* insize, MPI_Aint *position, void *outbuf, int* outcount, int* datatype, int* ierr);
+void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) ;
+void mpi_type_create_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) ;
+void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) ;
+void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int*  newtype, int* ierr) ;
+void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices,  int* old_type,  int*newtype, int* ierr);
+void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int*  old_types, int*  newtype, int* ierr) ;
+void mpi_type_create_struct_ (int* count, int* blocklens, MPI_Aint* indices, int*  old_types, int*  newtype, int* ierr) ;
+void mpi_ssend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) ;
+void mpi_ssend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int*  request, int* ierr) ;
+void mpi_intercomm_create_ (int* local_comm, int* local_leader, int* peer_comm, int* remote_leader, int* tag, int*  comm_out, int* ierr) ;
+void mpi_intercomm_merge_ (int* comm, int* high, int*  comm_out, int* ierr) ;
+void mpi_bsend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) ;
+void mpi_bsend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int*  request, int* ierr) ;
+void mpi_ibsend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int*  request, int* ierr) ;
+void mpi_comm_remote_group_ (int* comm, int*  group, int* ierr) ;
+void mpi_comm_remote_size_ (int* comm, int* size, int* ierr) ;
+void mpi_issend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int*  request, int* ierr) ;
+void mpi_probe_ (int* source, int* tag, int* comm, MPI_Status* status, int* ierr) ;
+void mpi_attr_delete_ (int* comm, int* keyval, int* ierr) ;
+void mpi_attr_put_ (int* comm, int* keyval, void* attr_value, int* ierr) ;
+void mpi_rsend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int*  request, int* ierr) ;
+void mpi_keyval_create_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr) ;
+void mpi_keyval_free_ (int* keyval, int* ierr) ;
+void mpi_test_cancelled_ (MPI_Status* status, int* flag, int* ierr) ;
+void mpi_pack_ (void* inbuf, int* incount, int* type, void* outbuf, int* outcount, int* position, int* comm, int* ierr) ;
+void mpi_get_elements_ (MPI_Status* status, int* datatype, int* elements, int* ierr) ;
+void mpi_dims_create_ (int* nnodes, int* ndims, int* dims, int* ierr) ;
+void mpi_iprobe_ (int* source, int* tag, int* comm, int* flag, MPI_Status* status, int* ierr) ;
+void mpi_type_get_envelope_ ( int* datatype, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner, int* ierr);
+void mpi_type_get_contents_ (int* datatype, int* max_integers, int* max_addresses, int* max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses,
+ int*array_of_datatypes, int* ierr);
+void mpi_type_create_darray_ (int* size, int* rank, int* ndims, int* array_of_gsizes, int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+ int* order, int* oldtype, int*newtype, int* ierr) ;
+void mpi_type_create_resized_ (int* oldtype,MPI_Aint* lb, MPI_Aint* extent, int*newtype, int* ierr);
+void mpi_type_create_subarray_ (int* ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int* order, int* oldtype, int*newtype, int* ierr);
+void mpi_type_match_size_ (int* typeclass,int* size,int*datatype, int* ierr);
+void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int*sendtypes, void *recvbuf, int *recvcnts, int *rdispls, int*recvtypes,
+ int* comm, int* ierr);
+void mpi_exscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr);
+void mpi_comm_set_name_ (int* comm, char* name, int* ierr);
+void mpi_comm_dup_with_info_ (int* comm, int* info, int* newcomm, int* ierr);
+void mpi_comm_split_type_ (int* comm, int* split_type, int* key, int* info, int*newcomm, int* ierr);
+void mpi_comm_set_info_ (int* comm, int* info, int* ierr);
+void mpi_comm_get_info_ (int* comm, int* info, int* ierr);
+void mpi_info_get_ (int* info,char *key,int* valuelen, char *value, int *flag, int* ierr);
+void mpi_comm_create_errhandler_ ( void *function, void *errhandler, int* ierr);
+void mpi_add_error_class_ ( int *errorclass, int* ierr);
+void mpi_add_error_code_ (  int* errorclass, int *errorcode, int* ierr);
+void mpi_add_error_string_ ( int* errorcode, char *string, int* ierr);
+void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr);
+void mpi_info_dup_ (int* info, int* newinfo, int* ierr);
+void mpi_info_get_valuelen_ ( int* info, char *key, int *valuelen, int *flag, int* ierr);
+void mpi_info_delete_ (int* info, char *key, int* ierr);
+void mpi_info_get_nkeys_ ( int* info, int *nkeys, int* ierr);
+void mpi_info_get_nthkey_ ( int* info, int* n, char *key, int* ierr);
+void mpi_get_version_ (int *version,int *subversion, int* ierr);
+void mpi_get_library_version_ (char *version,int *len, int* ierr);
+void mpi_request_get_status_ ( int* request, int *flag, MPI_Status* status, int* ierr);
+void mpi_grequest_start_ ( void *query_fn, void *free_fn, void *cancel_fn, void *extra_state, int*request, int* ierr);
+void mpi_grequest_complete_ ( int* request, int* ierr);
+void mpi_status_set_cancelled_ (MPI_Status* status,int* flag, int* ierr);
+void mpi_status_set_elements_ ( MPI_Status* status, int* datatype, int* count, int* ierr);
+void mpi_comm_connect_ ( char *port_name, int* info, int* root, int* comm, int* newcomm, int* ierr);
+void mpi_publish_name_ ( char *service_name, int* info, char *port_name, int* ierr);
+void mpi_unpublish_name_ ( char *service_name, int* info, char *port_name, int* ierr);
+void mpi_lookup_name_ ( char *service_name, int* info, char *port_name, int* ierr);
+void mpi_comm_join_ ( int* fd, int*intercomm, int* ierr);
+void mpi_open_port_ ( int* info, char *port_name, int* ierr);
+void mpi_close_port_ ( char *port_name, int* ierr);
+void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int* newcomm, int* ierr);
+void mpi_comm_spawn_ ( char *command, char *argv, int* maxprocs, int* info, int* root, int* comm, int*intercomm, int* array_of_errcodes, int* ierr);
+void mpi_comm_spawn_multiple_ ( int* count, char *array_of_commands, char** array_of_argv, int* array_of_maxprocs, int* array_of_info, int* root,
+ int* comm, int*intercomm, int* array_of_errcodes, int* ierr);
+void mpi_comm_get_parent_ ( int*parent, int* ierr);
+
 /********** Tracing **********/
 /* from smpi_instr.c */
 void TRACE_internal_smpi_set_category (const char *category);
 const char *TRACE_internal_smpi_get_category (void);
-void TRACE_smpi_collective_in(int rank, int root, const char *operation);
+void TRACE_smpi_collective_in(int rank, int root, const char *operation, int size);
 void TRACE_smpi_collective_out(int rank, int root, const char *operation);
 void TRACE_smpi_computing_init(int rank);
 void TRACE_smpi_computing_out(int rank);
index 067cd82..2632bac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,7 +12,7 @@
 #include "simix/smx_private.h"
 #include "surf/surf.h"
 #include "simgrid/sg_config.h"
-
+#include "colls/colls.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)");
 
@@ -25,7 +25,7 @@ static int match_recv(void* a, void* b, smx_action_t ignored) {
   xbt_assert(ref, "Cannot match recv against null reference");
   xbt_assert(req, "Cannot match recv against null request");
   if((ref->src == MPI_ANY_SOURCE || req->src == ref->src)
-    && (ref->tag == MPI_ANY_TAG || req->tag == ref->tag)){
+    && ((ref->tag == MPI_ANY_TAG && req->tag >=0) || req->tag == ref->tag)){
     //we match, we can transfer some values
     // FIXME : move this to the copy function ?
     if(ref->src == MPI_ANY_SOURCE)ref->real_src = req->src;
@@ -34,6 +34,7 @@ static int match_recv(void* a, void* b, smx_action_t ignored) {
     if(req->detached==1){
         ref->detached_sender=req; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
     }
+    XBT_DEBUG("match succeeded");
     return 1;
   }else return 0;
 }
@@ -46,7 +47,7 @@ static int match_send(void* a, void* b,smx_action_t ignored) {
    xbt_assert(req, "Cannot match send against null request");
 
    if((req->src == MPI_ANY_SOURCE || req->src == ref->src)
-             && (req->tag == MPI_ANY_TAG || req->tag == ref->tag))
+             && ((req->tag == MPI_ANY_TAG && ref->tag >=0)|| req->tag == ref->tag))
    {
      if(req->src == MPI_ANY_SOURCE)req->real_src = ref->src;
      if(req->tag == MPI_ANY_TAG)req->real_tag = ref->tag;
@@ -54,7 +55,7 @@ static int match_send(void* a, void* b,smx_action_t ignored) {
      if(ref->detached==1){
          req->detached_sender=ref; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
      }
-
+    XBT_DEBUG("match succeeded");
      return 1;
    } else return 0;
 }
@@ -128,13 +129,13 @@ static double smpi_os(double size)
   double current=0.0;
   xbt_dynar_foreach(smpi_os_values, iter, fact) {
     if (size <= fact.factor) {
-        XBT_DEBUG("os : %lf <= %ld return %f", size, fact.factor, current);
+        XBT_DEBUG("os : %f <= %ld return %f", size, fact.factor, current);
       return current;
     }else{
       current=fact.values[0]+fact.values[1]*size;
     }
   }
-  XBT_DEBUG("os : %lf > %ld return %f", size, fact.factor, current);
+  XBT_DEBUG("os : %f > %ld return %f", size, fact.factor, current);
 
   return current;
 }
@@ -150,13 +151,13 @@ static double smpi_ois(double size)
   double current=0.0;
   xbt_dynar_foreach(smpi_ois_values, iter, fact) {
     if (size <= fact.factor) {
-        XBT_DEBUG("ois : %lf <= %ld return %f", size, fact.factor, current);
+        XBT_DEBUG("ois : %f <= %ld return %f", size, fact.factor, current);
       return current;
     }else{
       current=fact.values[0]+fact.values[1]*size;
     }
   }
-  XBT_DEBUG("ois : %lf > %ld return %f", size, fact.factor, current);
+  XBT_DEBUG("ois : %f > %ld return %f", size, fact.factor, current);
 
   return current;
 }
@@ -172,12 +173,12 @@ static double smpi_or(double size)
   double current=0.0;
   xbt_dynar_foreach(smpi_or_values, iter, fact) {
     if (size <= fact.factor) {
-        XBT_DEBUG("or : %lf <= %ld return %f", size, fact.factor, current);
+        XBT_DEBUG("or : %f <= %ld return %f", size, fact.factor, current);
       return current;
     }else
       current=fact.values[0]+fact.values[1]*size;
   }
-  XBT_DEBUG("or : %lf > %ld return %f", size, fact.factor, current);
+  XBT_DEBUG("or : %f > %ld return %f", size, fact.factor, current);
 
   return current;
 }
@@ -186,7 +187,7 @@ static MPI_Request build_request(void *buf, int count,
                                  MPI_Datatype datatype, int src, int dst,
                                  int tag, MPI_Comm comm, unsigned flags)
 {
-  MPI_Request request;
+  MPI_Request request = NULL;
 
   void *old_buf = NULL;
 
@@ -218,6 +219,7 @@ static MPI_Request build_request(void *buf, int count,
   request->flags = flags;
   request->detached = 0;
   request->detached_sender = NULL;
+  request->real_src = 0;
 
   request->truncated = 0;
   request->real_size = 0;
@@ -283,9 +285,9 @@ static void smpi_mpi_request_free_voidp(void* request)
 MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
                                int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-    build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                  comm, PERSISTENT | SEND);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                          comm, PERSISTENT | SEND | PREPARED);
   request->refcount++;
   return request;
 }
@@ -293,9 +295,9 @@ MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
 MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype,
                                int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-    build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                  comm, PERSISTENT | SSEND | SEND);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                          comm, PERSISTENT | SSEND | SEND | PREPARED);
   request->refcount++;
   return request;
 }
@@ -303,9 +305,9 @@ MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype,
 MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype,
                                int src, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-    build_request(buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
-                  comm, PERSISTENT | RECV);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
+                          comm, PERSISTENT | RECV | PREPARED);
   request->refcount++;
   return request;
 }
@@ -314,10 +316,11 @@ void smpi_mpi_start(MPI_Request request)
 {
   smx_rdv_t mailbox;
 
-  xbt_assert(!request->action,
-             "Cannot (re)start a non-finished communication");
-  if(request->flags & RECV) {
+  xbt_assert(!request->action, "Cannot (re)start a non-finished communication");
+  request->flags &= ~PREPARED;
+  if (request->flags & RECV) {
     print_request("New recv", request);
+    //FIXME: if receive is posted with a large size, but send is smaller, mailboxes may not match !
     if (request->size < sg_cfg_get_int("smpi/async_small_thres"))
       mailbox = smpi_process_mailbox_small();
     else
@@ -325,13 +328,14 @@ void smpi_mpi_start(MPI_Request request)
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     request->real_size=request->size;
     smpi_datatype_use(request->old_type);
+    smpi_comm_use(request->comm);
     request->action = simcall_comm_irecv(mailbox, request->buf, &request->real_size, &match_recv, request);
 
     //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
     double sleeptime = request->detached ? smpi_or(request->size) : 0.0;
     if(sleeptime!=0.0){
         simcall_process_sleep(sleeptime);
-        XBT_DEBUG("receiving size of %zu : sleep %lf ", request->size, smpi_or(request->size));
+        XBT_DEBUG("receiving size of %zu : sleep %f ", request->size, smpi_or(request->size));
     }
 
   } else {
@@ -342,7 +346,7 @@ void smpi_mpi_start(MPI_Request request)
     #ifdef HAVE_TRACING
       int rank = smpi_process_index();
       if (TRACE_smpi_view_internals()) {
-        TRACE_smpi_send(rank, rank, receiver);
+        TRACE_smpi_send(rank, rank, receiver,request->size);
       }
     #endif
 /*    if(receiver == MPI_UNDEFINED) {*/
@@ -373,6 +377,7 @@ void smpi_mpi_start(MPI_Request request)
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     request->real_size=request->size;
     smpi_datatype_use(request->old_type);
+    smpi_comm_use(request->comm);
 
     //if we are giving back the control to the user without waiting for completion, we have to inject timings
     double sleeptime =0.0;
@@ -383,7 +388,7 @@ void smpi_mpi_start(MPI_Request request)
 
     if(sleeptime!=0.0){
         simcall_process_sleep(sleeptime);
-        XBT_DEBUG("sending size of %zu : sleep %lf ", request->size, smpi_os(request->size));
+        XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size));
     }
 
     request->action =
@@ -417,7 +422,6 @@ void smpi_mpi_startall(int count, MPI_Request * requests)
 
 void smpi_mpi_request_free(MPI_Request * request)
 {
-
   if((*request) != MPI_REQUEST_NULL){
     (*request)->refcount--;
     if((*request)->refcount<0) xbt_die("wrong refcount");
@@ -438,20 +442,18 @@ void smpi_mpi_request_free(MPI_Request * request)
 MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype,
                             int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-    build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                  comm, NON_PERSISTENT | SEND);
-
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf , count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                          comm, NON_PERSISTENT | ISEND | SEND | PREPARED);
   return request;
 }
 
 MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
                            int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-      build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                    comm, NON_PERSISTENT | ISEND | SEND);
-
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request =  build_request(buf==MPI_BOTTOM?(void*)0:buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                           comm, NON_PERSISTENT | ISEND | SEND);
   smpi_mpi_start(request);
   return request;
 }
@@ -459,9 +461,9 @@ MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
 MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype,
                            int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-      build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                    comm, NON_PERSISTENT | ISEND | SSEND | SEND);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                          comm, NON_PERSISTENT | ISEND | SSEND | SEND);
   smpi_mpi_start(request);
   return request;
 }
@@ -471,19 +473,18 @@ MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype,
 MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
                             int src, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-    build_request(buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
-                  comm, NON_PERSISTENT | RECV);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
+                          comm, NON_PERSISTENT | RECV | PREPARED);
   return request;
 }
 
 MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype,
                            int src, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-      build_request(buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
-                    comm, NON_PERSISTENT | RECV);
-
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : smpi_group_index(smpi_comm_group(comm), src), smpi_process_index(), tag,
+                          comm, NON_PERSISTENT | RECV);
   smpi_mpi_start(request);
   return request;
 }
@@ -491,9 +492,10 @@ MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype,
 void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src,
                    int tag, MPI_Comm comm, MPI_Status * status)
 {
-  MPI_Request request;
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
   request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
   smpi_mpi_wait(&request, status);
+  request = NULL;
 }
 
 
@@ -501,23 +503,25 @@ void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src,
 void smpi_mpi_send(void *buf, int count, MPI_Datatype datatype, int dst,
                    int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-      build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                    comm, NON_PERSISTENT | SEND);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                          comm, NON_PERSISTENT | SEND);
+
   smpi_mpi_start(request);
   smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
-
+  request = NULL;
 }
 
 void smpi_mpi_ssend(void *buf, int count, MPI_Datatype datatype,
                            int dst, int tag, MPI_Comm comm)
 {
-  MPI_Request request =
-      build_request(buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
-                    comm, NON_PERSISTENT | SSEND | SEND);
+  MPI_Request request = NULL; /* MC needs the comm to be set to NULL during the call */
+  request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(comm), dst), tag,
+                comm, NON_PERSISTENT | SSEND | SEND);
 
   smpi_mpi_start(request);
   smpi_mpi_wait(&request, MPI_STATUS_IGNORE);
+  request = NULL;
 }
 
 void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
@@ -527,7 +531,12 @@ void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
 {
   MPI_Request requests[2];
   MPI_Status stats[2];
-
+  int myid=smpi_process_index();
+  if ((smpi_group_index(smpi_comm_group(comm), dst) == myid) && (smpi_group_index(smpi_comm_group(comm), src) == myid)) {
+      smpi_datatype_copy(sendbuf, sendcount, sendtype,
+                                     recvbuf, recvcount, recvtype);
+      return;
+  }
   requests[0] =
     smpi_isend_init(sendbuf, sendcount, sendtype, dst, sendtag, comm);
   requests[1] =
@@ -548,10 +557,9 @@ int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype)
 static void finish_wait(MPI_Request * request, MPI_Status * status)
 {
   MPI_Request req = *request;
-  if(status != MPI_STATUS_IGNORE)
-    smpi_empty_status(status);
+  smpi_empty_status(status);
 
-  if(!(req->detached && req->flags & SEND)){
+  if(!(req->detached && req->flags & SEND) && !(req->flags & PREPARED)){
     if(status != MPI_STATUS_IGNORE) {
       int src = req->src == MPI_ANY_SOURCE ? req->real_src : req->src;
       status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(req->comm), src);
@@ -567,26 +575,27 @@ static void finish_wait(MPI_Request * request, MPI_Status * status)
     MPI_Datatype datatype = req->old_type;
 
     if(datatype->has_subtype == 1){
-        // This part handles the problem of non-contignous memory
-        // the unserialization at the reception
+      // This part handles the problem of non-contignous memory
+      // the unserialization at the reception
       s_smpi_subtype_t *subtype = datatype->substruct;
       if(req->flags & RECV) {
         subtype->unserialize(req->buf, req->old_buf, req->real_size/smpi_datatype_size(datatype) , datatype->substruct);
       }
       if(req->detached == 0) free(req->buf);
     }
+    smpi_comm_unuse(req->comm);
     smpi_datatype_unuse(datatype);
 
   }
 
 #ifdef HAVE_TRACING
-    if (TRACE_smpi_view_internals()) {
-      if(req->flags & RECV){
-        int rank = smpi_process_index();
-        int  src_traced = smpi_group_index(smpi_comm_group(req->comm), req->src == MPI_ANY_SOURCE ? req->real_src : req->src);
-        TRACE_smpi_recv(rank, src_traced, rank);
-      }
+  if (TRACE_smpi_view_internals()) {
+    if(req->flags & RECV){
+      int rank = smpi_process_index();
+      int src_traced = (req->src == MPI_ANY_SOURCE ? req->real_src : req->src);
+      TRACE_smpi_recv(rank, src_traced, rank);
     }
+  }
 #endif
 
   if(req->detached_sender!=NULL){
@@ -604,15 +613,15 @@ int smpi_mpi_test(MPI_Request * request, MPI_Status * status) {
   int flag;
 
   //assume that request is not MPI_REQUEST_NULL (filtered in PMPI_Test or smpi_mpi_testall before)
-  if ((*request)->action == NULL)
-    flag = 1;
-  else
-    flag = simcall_comm_test((*request)->action);
-  if(flag) {
-    finish_wait(request, status);
-    request=MPI_REQUEST_NULL;
-  }else{
-    smpi_empty_status(status);
+  smpi_empty_status(status);
+  flag = 1;
+  if (!((*request)->flags & PREPARED)) {
+    if ((*request)->action != NULL)
+      flag = simcall_comm_test((*request)->action);
+    if (flag) {
+      finish_wait(request, status);
+      *request = MPI_REQUEST_NULL;
+    }
   }
   return flag;
 }
@@ -626,33 +635,33 @@ int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
 
   *index = MPI_UNDEFINED;
   flag = 0;
-  if(count > 0) {
-    comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
-    map = xbt_new(int, count);
-    size = 0;
-    for(i = 0; i < count; i++) {
-      if((requests[i]!=MPI_REQUEST_NULL) && requests[i]->action) {
-         xbt_dynar_push(comms, &requests[i]->action);
-         map[size] = i;
-         size++;
-      }
+  comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
+  map = xbt_new(int, count);
+  size = 0;
+  for(i = 0; i < count; i++) {
+    if ((requests[i] != MPI_REQUEST_NULL) && requests[i]->action &&
+        !(requests[i]->flags & PREPARED)) {
+       xbt_dynar_push(comms, &requests[i]->action);
+       map[size] = i;
+       size++;
     }
-    if(size > 0) {
-      i = simcall_comm_testany(comms);
-      // not MPI_UNDEFINED, as this is a simix return code
-      if(i != -1) {
-        *index = map[i];
-        finish_wait(&requests[*index], status);
-        flag = 1;
-      }
-    }else{
-        //all requests are null or inactive, return true
-        flag=1;
-        smpi_empty_status(status);
+  }
+  if(size > 0) {
+    i = simcall_comm_testany(comms);
+    // not MPI_UNDEFINED, as this is a simix return code
+    if(i != -1) {
+      *index = map[i];
+      finish_wait(&requests[*index], status);
+      requests[*index] = MPI_REQUEST_NULL;
+      flag = 1;
     }
-    xbt_free(map);
-    xbt_dynar_free(&comms);
+  }else{
+      //all requests are null or inactive, return true
+      flag=1;
+      smpi_empty_status(status);
   }
+  xbt_free(map);
+  xbt_dynar_free(&comms);
 
   return flag;
 }
@@ -666,9 +675,11 @@ int smpi_mpi_testall(int count, MPI_Request requests[],
   int flag=1;
   int i;
   for(i=0; i<count; i++){
-    if(requests[i]!= MPI_REQUEST_NULL){
+    if (requests[i] != MPI_REQUEST_NULL && !(requests[i]->flags & PREPARED)) {
       if (smpi_mpi_test(&requests[i], pstat)!=1){
         flag=0;
+      }else{
+          requests[i]=MPI_REQUEST_NULL;
       }
     }else{
       smpi_empty_status(pstat);
@@ -721,7 +732,7 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   if(request->action){
     MPI_Request req = (MPI_Request)SIMIX_comm_get_src_data(request->action);
     *flag = 1;
-    if(status != MPI_STATUS_IGNORE) {
+    if(status != MPI_STATUS_IGNORE && !(req->flags & PREPARED)) {
       status->MPI_SOURCE = smpi_group_rank(smpi_comm_group(comm), req->src);
       status->MPI_TAG = req->tag;
       status->MPI_ERROR = MPI_SUCCESS;
@@ -741,11 +752,22 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
 void smpi_mpi_wait(MPI_Request * request, MPI_Status * status)
 {
   print_request("Waiting", *request);
+  if ((*request)->flags & PREPARED) {
+    smpi_empty_status(status);
+    return;
+  }
+
   if ((*request)->action != NULL) { // this is not a detached send
     simcall_comm_wait((*request)->action, -1.0);
   }
-  finish_wait(request, status);
 
+#ifdef HAVE_MC
+  if(MC_is_active())
+    (*request)->action->comm.dst_data = NULL; // dangling pointer : dst_data is freed with a wait, need to set it to NULL for system state comparison
+#endif
+
+  finish_wait(request, status);
+  *request = MPI_REQUEST_NULL;
   // FIXME for a detached send, finish_wait is not called:
 }
 
@@ -764,7 +786,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[],
     size = 0;
     XBT_DEBUG("Wait for one of %d", count);
     for(i = 0; i < count; i++) {
-      if(requests[i] != MPI_REQUEST_NULL) {
+      if (requests[i] != MPI_REQUEST_NULL && !(requests[i]->flags & PREPARED)) {
         if (requests[i]->action != NULL) {
           XBT_DEBUG("Waiting any %p ", requests[i]);
           xbt_dynar_push(comms, &requests[i]->action);
@@ -787,6 +809,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[],
       if (i != -1) {
         index = map[i];
         finish_wait(&requests[index], status);
+        requests[index] = MPI_REQUEST_NULL;
       }
     }
     xbt_free(map);
@@ -809,7 +832,8 @@ int smpi_mpi_waitall(int count, MPI_Request requests[],
   //tag invalid requests in the set
   if (status != MPI_STATUSES_IGNORE) {
     for (c = 0; c < count; c++) {
-      if (requests[c] == MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL) {
+      if (requests[c] == MPI_REQUEST_NULL || requests[c]->dst == MPI_PROC_NULL ||
+          (requests[c]->flags & PREPARED)) {
         smpi_empty_status(&status[c]);
       } else if (requests[c]->src == MPI_PROC_NULL) {
         smpi_empty_status(&status[c]);
@@ -874,7 +898,7 @@ int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices,
   for(i = 0; i < incount; i++) {
     if((requests[i] != MPI_REQUEST_NULL)) {
       if(smpi_mpi_test(&requests[i], pstat)) {
-         indices[count] = i;
+         indices[i] = 1;
          count++;
          if(status != MPI_STATUSES_IGNORE) {
            status[i] = *pstat;
@@ -907,7 +931,7 @@ void smpi_mpi_gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                      void *recvbuf, int recvcount, MPI_Datatype recvtype,
                      int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_GATHER;
   int rank, size, src, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -948,6 +972,8 @@ void smpi_mpi_reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
     int i, size, count;
     int *displs;
     int rank = smpi_process_index();
+    void *tmpbuf;
+
     /* arbitrarily choose root as rank 0 */
     size = smpi_comm_size(comm);
     count = 0;
@@ -956,17 +982,19 @@ void smpi_mpi_reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
       displs[i] = count;
       count += recvcounts[i];
     }
-    mpi_coll_reduce_fun(sendbuf, recvbuf, count, datatype, op, 0, comm);
-    smpi_mpi_scatterv(recvbuf, recvcounts, displs, datatype, recvbuf,
+    tmpbuf=(void*)xbt_malloc(count*smpi_datatype_get_extent(datatype));
+    mpi_coll_reduce_fun(sendbuf, tmpbuf, count, datatype, op, 0, comm);
+    smpi_mpi_scatterv(tmpbuf, recvcounts, displs, datatype, recvbuf,
                       recvcounts[rank], datatype, 0, comm);
     xbt_free(displs);
+    xbt_free(tmpbuf);
 }
 
 void smpi_mpi_gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int *recvcounts, int *displs,
                       MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_GATHERV;
   int rank, size, src, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1006,7 +1034,7 @@ void smpi_mpi_allgather(void *sendbuf, int sendcount,
                         int recvcount, MPI_Datatype recvtype,
                         MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_ALLGATHER;
   int rank, size, other, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1045,7 +1073,7 @@ void smpi_mpi_allgatherv(void *sendbuf, int sendcount,
                          int *recvcounts, int *displs,
                          MPI_Datatype recvtype, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_ALLGATHERV;
   int rank, size, other, index;
   MPI_Aint lb = 0, recvext = 0;
   MPI_Request *requests;
@@ -1083,7 +1111,7 @@ void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int recvcount, MPI_Datatype recvtype,
                       int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_SCATTER;
   int rank, size, dst, index;
   MPI_Aint lb = 0, sendext = 0;
   MPI_Request *requests;
@@ -1098,8 +1126,10 @@ void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     // FIXME: check for errors
     smpi_datatype_extent(sendtype, &lb, &sendext);
     // Local copy from root
-    smpi_datatype_copy((char *)sendbuf + root * sendcount * sendext,
-                       sendcount, sendtype, recvbuf, recvcount, recvtype);
+    if(recvbuf!=MPI_IN_PLACE){
+        smpi_datatype_copy((char *)sendbuf + root * sendcount * sendext,
+                           sendcount, sendtype, recvbuf, recvcount, recvtype);
+    }
     // Send buffers to receivers
     requests = xbt_new(MPI_Request, size - 1);
     index = 0;
@@ -1122,7 +1152,7 @@ void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs,
                        MPI_Datatype sendtype, void *recvbuf, int recvcount,
                        MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_SCATTERV;
   int rank, size, dst, index;
   MPI_Aint lb = 0, sendext = 0;
   MPI_Request *requests;
@@ -1137,8 +1167,10 @@ void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs,
     // FIXME: check for errors
     smpi_datatype_extent(sendtype, &lb, &sendext);
     // Local copy from root
-    smpi_datatype_copy((char *)sendbuf + displs[root] * sendext, sendcounts[root],
+    if(recvbuf!=MPI_IN_PLACE){
+      smpi_datatype_copy((char *)sendbuf + displs[root] * sendext, sendcounts[root],
                        sendtype, recvbuf, recvcount, recvtype);
+    }
     // Send buffers to receivers
     requests = xbt_new(MPI_Request, size - 1);
     index = 0;
@@ -1161,23 +1193,37 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count,
                      MPI_Datatype datatype, MPI_Op op, int root,
                      MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = COLL_TAG_REDUCE;
   int rank, size, src, index;
   MPI_Aint lb = 0, dataext = 0;
   MPI_Request *requests;
   void **tmpbufs;
 
+
+  char* sendtmpbuf = (char*) sendbuf;
+  if( sendbuf == MPI_IN_PLACE ) {
+    sendtmpbuf = (char *)xbt_malloc(count*smpi_datatype_get_extent(datatype));
+    smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
+  }
+
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
+  //non commutative case, use a working algo from openmpi
+  if(!smpi_op_is_commute(op)){
+    smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count,
+                     datatype, op, root, comm);
+    return;
+  }
+  
   if(rank != root) {
     // Send buffer to root
-    smpi_mpi_send(sendbuf, count, datatype, root, system_tag, comm);
+    smpi_mpi_send(sendtmpbuf, count, datatype, root, system_tag, comm);
   } else {
     // FIXME: check for errors
     smpi_datatype_extent(datatype, &lb, &dataext);
     // Local copy from root
-    if (sendbuf && recvbuf)
-      smpi_datatype_copy(sendbuf, count, datatype, recvbuf, count, datatype);
+    if (sendtmpbuf && recvbuf)
+      smpi_datatype_copy(sendtmpbuf, count, datatype, recvbuf, count, datatype);
     // Receive buffers from senders
     //TODO: make a MPI_barrier here ?
     requests = xbt_new(MPI_Request, size - 1);
@@ -1210,6 +1256,10 @@ void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count,
     }
     xbt_free(tmpbufs);
     xbt_free(requests);
+
+    if( sendbuf == MPI_IN_PLACE ) {
+      xbt_free(sendtmpbuf);
+    }
   }
 }
 
@@ -1223,7 +1273,7 @@ void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count,
 void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
                    MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
-  int system_tag = 666;
+  int system_tag = -888;
   int rank, size, other, index;
   MPI_Aint lb = 0, dataext = 0;
   MPI_Request *requests;
@@ -1258,14 +1308,94 @@ void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
   }
   // Wait for completion of all comms.
   smpi_mpi_startall(size - 1, requests);
-  for(other = 0; other < size - 1; other++) {
-    index = smpi_mpi_waitany(size - 1, requests, MPI_STATUS_IGNORE);
-    if(index == MPI_UNDEFINED) {
-      break;
+
+  if(smpi_op_is_commute(op)){
+    for(other = 0; other < size - 1; other++) {
+      index = smpi_mpi_waitany(size - 1, requests, MPI_STATUS_IGNORE);
+      if(index == MPI_UNDEFINED) {
+        break;
+      }
+      if(index < rank) {
+        // #Request is below rank: it's a irecv
+        smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+      }
+    }
+  }else{
+    //non commutative case, wait in order
+    for(other = 0; other < size - 1; other++) {
+      smpi_mpi_wait(&(requests[other]), MPI_STATUS_IGNORE);
+      if(index < rank) {
+        smpi_op_apply(op, tmpbufs[other], recvbuf, &count, &datatype);
+      }
+    }
+  }
+  for(index = 0; index < rank; index++) {
+    xbt_free(tmpbufs[index]);
+  }
+  xbt_free(tmpbufs);
+  xbt_free(requests);
+}
+
+void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count,
+                   MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+  int system_tag = -888;
+  int rank, size, other, index;
+  MPI_Aint lb = 0, dataext = 0;
+  MPI_Request *requests;
+  void **tmpbufs;
+  int recvbuf_is_empty=1;
+  rank = smpi_comm_rank(comm);
+  size = smpi_comm_size(comm);
+
+  // FIXME: check for errors
+  smpi_datatype_extent(datatype, &lb, &dataext);
+
+  // Send/Recv buffers to/from others;
+  requests = xbt_new(MPI_Request, size - 1);
+  tmpbufs = xbt_new(void *, rank);
+  index = 0;
+  for(other = 0; other < rank; other++) {
+    // FIXME: possibly overkill we we have contiguous/noncontiguous data
+    // mapping...
+    tmpbufs[index] = xbt_malloc(count * dataext);
+    requests[index] =
+      smpi_irecv_init(tmpbufs[index], count, datatype, other, system_tag,
+                      comm);
+    index++;
+  }
+  for(other = rank + 1; other < size; other++) {
+    requests[index] =
+      smpi_isend_init(sendbuf, count, datatype, other, system_tag, comm);
+    index++;
+  }
+  // Wait for completion of all comms.
+  smpi_mpi_startall(size - 1, requests);
+  if(smpi_op_is_commute(op)){
+    for(other = 0; other < size - 1; other++) {
+      index = smpi_mpi_waitany(size - 1, requests, MPI_STATUS_IGNORE);
+      if(index == MPI_UNDEFINED) {
+        break;
+      }
+      if(index < rank) {
+        if(recvbuf_is_empty){
+          smpi_datatype_copy(tmpbufs[index], count, datatype, recvbuf, count, datatype);
+          recvbuf_is_empty=0;
+        }else
+        // #Request is below rank: it's a irecv
+        smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+      }
     }
-    if(index < rank) {
-      // #Request is below rank: it's a irecv
-      smpi_op_apply(op, tmpbufs[index], recvbuf, &count, &datatype);
+  }else{
+    //non commutative case, wait in order
+    for(other = 0; other < size - 1; other++) {
+      smpi_mpi_wait(&(requests[other]), MPI_STATUS_IGNORE);
+      if(index < rank) {
+          if(recvbuf_is_empty){
+            smpi_datatype_copy(tmpbufs[other], count, datatype, recvbuf, count, datatype);
+            recvbuf_is_empty=0;
+          }else smpi_op_apply(op, tmpbufs[other], recvbuf, &count, &datatype);
+      }
     }
   }
   for(index = 0; index < rank; index++) {
index 357e6f8..6feda0f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,6 +8,7 @@
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "xbt/ex.h"
+#include "xbt/hash.h"
 #include "surf/surf.h"
 #include "simgrid/sg_config.h"
 
@@ -102,13 +103,13 @@ static void* shm_map(int fd, size_t size, shared_data_t* data) {
     xbt_die("Could not map fd %d: %s", fd, strerror(errno));
   }
   if(!allocs_metadata) {
-    allocs_metadata = xbt_dict_new();
+    allocs_metadata = xbt_dict_new_homogeneous(xbt_free);
   }
   snprintf(loc, PTR_STRLEN, "%p", mem);
   meta = xbt_new(shared_metadata_t, 1);
   meta->size = size;
   meta->data = data;
-  xbt_dict_set(allocs_metadata, loc, meta, &free);
+  xbt_dict_set(allocs_metadata, loc, meta, NULL);
   XBT_DEBUG("MMAP %zu to %p", size, mem);
   return mem;
 }
@@ -117,6 +118,7 @@ static void* shm_map(int fd, size_t size, shared_data_t* data) {
 void smpi_bench_destroy(void)
 {
   xbt_dict_free(&allocs);
+  xbt_dict_free(&allocs_metadata);
   xbt_dict_free(&samples);
   xbt_dict_free(&calls);
 }
@@ -164,7 +166,7 @@ void smpi_bench_end(void)
 unsigned int smpi_sleep(unsigned int secs)
 {
   smpi_bench_end();
-  smpi_execute((double) secs);
+  smpi_execute_flops((double) secs*simcall_host_get_speed(SIMIX_host_self()));
   smpi_bench_begin();
   return secs;
 }
@@ -342,50 +344,83 @@ void smpi_sample_3(int global, const char *file, int line)
 }
 
 #ifndef WIN32
-void *smpi_shared_malloc(size_t size, const char *file, int line)
+static void smpi_shared_alloc_free(void *p)
 {
-  char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line);
-  size_t len = strlen(loc);
-  size_t i;
-  int fd;
-  void* mem;
-  shared_data_t *data;
+  shared_data_t *data = p;
+  xbt_free(data->loc);
+  xbt_free(data);
+}
 
-  for(i = 0; i < len; i++) {
-    /* Make the 'loc' ID be a flat filename */
-    if(loc[i] == '/') {
-      loc[i] = '_';
+static char *smpi_shared_alloc_hash(char *loc)
+{
+  char hash[42];
+  char s[7];
+  unsigned val;
+  int i, j;
+
+  xbt_sha(loc, hash);
+  hash[41] = '\0';
+  s[6] = '\0';
+  loc = xbt_realloc(loc, 30);
+  loc[0] = '/';
+  for (i = 0; i < 40; i += 6) { /* base64 encode */
+    memcpy(s, hash + i, 6);
+    val = strtoul(s, NULL, 16);
+    for (j = 0; j < 4; j++) {
+      unsigned char x = (val >> (18 - 3 * j)) & 0x3f;
+      loc[1 + 4 * i / 6 + j] =
+        "ABCDEFGHIJKLMNOPQRSTUVZXYZabcdefghijklmnopqrstuvzxyz0123456789-_"[x];
     }
   }
-  if (!allocs) {
-    allocs = xbt_dict_new_homogeneous(free);
-  }
-  data = xbt_dict_get_or_null(allocs, loc);
-  if(!data) {
-    fd = shm_open(loc, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-    if(fd < 0) {
-      switch(errno) {
-        case EEXIST:
-          xbt_die("Please cleanup /dev/shm/%s", loc);
-        default:
-          xbt_die("An unhandled error occured while opening %s: %s", loc, strerror(errno));
-      }
+  loc[29] = '\0';
+  return loc;
+}
+
+void *smpi_shared_malloc(size_t size, const char *file, int line)
+{
+  void* mem;
+  if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+    char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line);
+    int fd;
+    shared_data_t *data;
+    loc = smpi_shared_alloc_hash(loc); /* hash loc, in order to have something
+                                        * not too long */
+    if (!allocs) {
+      allocs = xbt_dict_new_homogeneous(smpi_shared_alloc_free);
     }
-    data = xbt_new(shared_data_t, 1);
-    data->fd = fd;
-    data->count = 1;
-    data->loc = loc;
-    mem = shm_map(fd, size, data);
-    if(shm_unlink(loc) < 0) {
-      XBT_WARN("Could not early unlink %s: %s", loc, strerror(errno));
+    data = xbt_dict_get_or_null(allocs, loc);
+    if (!data) {
+      fd = shm_open(loc, O_RDWR | O_CREAT | O_EXCL,
+                    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+      if (fd < 0) {
+        switch(errno) {
+          case EEXIST:
+            xbt_die("Please cleanup /dev/shm/%s", loc);
+          default:
+            xbt_die("An unhandled error occured while opening %s: %s", loc, strerror(errno));
+        }
+      }
+      data = xbt_new(shared_data_t, 1);
+      data->fd = fd;
+      data->count = 1;
+      data->loc = loc;
+      mem = shm_map(fd, size, data);
+      if (shm_unlink(loc) < 0) {
+        XBT_WARN("Could not early unlink %s: %s", loc, strerror(errno));
+      }
+      xbt_dict_set(allocs, loc, data, NULL);
+      XBT_DEBUG("Mapping %s at %p through %d", loc, mem, fd);
+    } else {
+      xbt_free(loc);
+      mem = shm_map(data->fd, size, data);
+      data->count++;
     }
-    xbt_dict_set(allocs, loc, data, NULL);
-    XBT_DEBUG("Mapping %s at %p through %d", loc, mem, fd);
+    XBT_DEBUG("Shared malloc %zu in %p (metadata at %p)", size, mem, data);
   } else {
-    mem = shm_map(data->fd, size, data);
-    data->count++;
+    mem = xbt_malloc(size);
+    XBT_DEBUG("Classic malloc %zu in %p", size, mem);
   }
-  XBT_DEBUG("Malloc %zu in %p (metadata at %p)", size, mem, data);
+
   return mem;
 }
 void smpi_shared_free(void *ptr)
@@ -393,33 +428,39 @@ void smpi_shared_free(void *ptr)
   char loc[PTR_STRLEN];
   shared_metadata_t* meta;
   shared_data_t* data;
-
-  if (!allocs) {
-    XBT_WARN("Cannot free: nothing was allocated");
-    return;
-  }
-  if(!allocs_metadata) {
-    XBT_WARN("Cannot free: no metadata was allocated");
-  }
-  snprintf(loc, PTR_STRLEN, "%p", ptr);
-  meta = (shared_metadata_t*)xbt_dict_get_or_null(allocs_metadata, loc);
-  if (!meta) {
-    XBT_WARN("Cannot free: %p was not shared-allocated by SMPI", ptr);
-    return;
-  }
-  data = meta->data;
-  if(!data) {
-    XBT_WARN("Cannot free: something is broken in the metadata link");
-    return;
-  }
-  if(munmap(ptr, meta->size) < 0) {
-    XBT_WARN("Unmapping of fd %d failed: %s", data->fd, strerror(errno));
-  }
-  data->count--;
-  if (data->count <= 0) {
-    close(data->fd);
-    xbt_dict_remove(allocs, data->loc);
-    free(data->loc);
+  if (sg_cfg_get_boolean("smpi/use_shared_malloc")){
+  
+    if (!allocs) {
+      XBT_WARN("Cannot free: nothing was allocated");
+      return;
+    }
+    if(!allocs_metadata) {
+      XBT_WARN("Cannot free: no metadata was allocated");
+    }
+    snprintf(loc, PTR_STRLEN, "%p", ptr);
+    meta = (shared_metadata_t*)xbt_dict_get_or_null(allocs_metadata, loc);
+    if (!meta) {
+      XBT_WARN("Cannot free: %p was not shared-allocated by SMPI", ptr);
+      return;
+    }
+    data = meta->data;
+    if(!data) {
+      XBT_WARN("Cannot free: something is broken in the metadata link");
+      return;
+    }
+    if(munmap(ptr, meta->size) < 0) {
+      XBT_WARN("Unmapping of fd %d failed: %s", data->fd, strerror(errno));
+    }
+    data->count--;
+    XBT_DEBUG("Shared free - no removal - of %p, count = %d", ptr, data->count);
+    if (data->count <= 0) {
+      close(data->fd);
+      xbt_dict_remove(allocs, data->loc);
+      XBT_DEBUG("Shared free - with removal - of %p", ptr);
+    }
+  }else{
+    XBT_DEBUG("Classic free of %p", ptr);
+    xbt_free(ptr);
   }
 }
 #endif
index 88f8467..567f26a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 172ddb1..e6db148 100644 (file)
@@ -1,6 +1,6 @@
 /* smpi_coll.c -- various optimized routing for collectives                   */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -243,7 +243,7 @@ static void build_tree(int root, int rank, int size, proc_tree_t * tree)
 static void tree_bcast(void *buf, int count, MPI_Datatype datatype,
                        MPI_Comm comm, proc_tree_t tree)
 {
-  int system_tag = 999;         // used negative int but smpi_create_request() declares this illegal (to be checked)
+  int system_tag = COLL_TAG_BCAST;
   int rank, i;
   MPI_Request *requests;
 
@@ -281,7 +281,7 @@ static void tree_bcast(void *buf, int count, MPI_Datatype datatype,
 static void tree_antibcast(void *buf, int count, MPI_Datatype datatype,
                            MPI_Comm comm, proc_tree_t tree)
 {
-  int system_tag = 999;         // used negative int but smpi_create_request() declares this illegal (to be checked)
+  int system_tag = COLL_TAG_BCAST;
   int rank, i;
   MPI_Request *requests;
 
index d49b858..8f02e2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -14,6 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi,
 
 typedef struct s_smpi_mpi_communicator {
   MPI_Group group;
+  int refcount;
 } s_smpi_mpi_communicator_t;
 
 static int smpi_compare_rankmap(const void *a, const void *b)
@@ -43,12 +44,14 @@ MPI_Comm smpi_comm_new(MPI_Group group)
   comm = xbt_new(s_smpi_mpi_communicator_t, 1);
   comm->group = group;
   smpi_group_use(comm->group);
+  comm->refcount=1;
   return comm;
 }
 
 void smpi_comm_destroy(MPI_Comm comm)
 {
-  xbt_free(comm);
+  smpi_group_unuse(comm->group);
+  smpi_comm_unuse(comm);
 }
 
 MPI_Group smpi_comm_group(MPI_Comm comm)
@@ -78,7 +81,7 @@ void smpi_comm_get_name (MPI_Comm comm, char* name, int* len)
 
 MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
 {
-  int system_tag = 666;
+  int system_tag = 123;
   int index, rank, size, i, j, count, reqs;
   int* sendbuf;
   int* recvbuf;
@@ -128,6 +131,7 @@ MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
         group_root = group_out; /* Save root's group */
       }
       for(j = 0; j < count; j++) {
+        //increment refcounter in order to avoid freeing the group too quick before copy
         index = smpi_group_index(group, rankmap[2 * j]);
         smpi_group_set_mapping(group_out, index, j);
       }
@@ -148,7 +152,20 @@ MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
   } else {
     if(color != MPI_UNDEFINED) {
       smpi_mpi_recv(&group_out, 1, MPI_PTR, 0, system_tag, comm, MPI_STATUS_IGNORE);
+      if(group_out){
+        group_out=smpi_group_copy(group_out);
+      }
     } /* otherwise, exit with group_out == NULL */
   }
   return group_out ? smpi_comm_new(group_out) : MPI_COMM_NULL;
 }
+
+void smpi_comm_use(MPI_Comm comm){
+  comm->refcount++;
+}
+
+void smpi_comm_unuse(MPI_Comm comm){
+  comm->refcount--;
+  if(comm->refcount==0)
+    xbt_free(comm);
+}
index f7a1583..d32614f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 extern int xargc;
 extern char** xargv;
 
-static xbt_dynar_t comm_lookup = NULL;
-static xbt_dynar_t group_lookup = NULL;
+static xbt_dict_t comm_lookup = NULL;
+static xbt_dict_t group_lookup = NULL;
 static xbt_dict_t request_lookup = NULL;
-static xbt_dynar_t datatype_lookup = NULL;
-static xbt_dynar_t op_lookup = NULL;
+static xbt_dict_t datatype_lookup = NULL;
+static xbt_dict_t op_lookup = NULL;
+static int running_processes = 0;
+
+
+
+/* Convert between Fortran and C MPI_BOTTOM */
+#define F2C_BOTTOM(addr)    ((addr!=MPI_IN_PLACE && *(int*)addr == MPI_FORTRAN_BOTTOM) ? MPI_BOTTOM : (addr))
+#define F2C_IN_PLACE(addr)  ((addr!=MPI_BOTTOM &&*(int*)addr == MPI_FORTRAN_IN_PLACE) ? MPI_IN_PLACE : (addr))
+#define F2C_STATUS_IGNORE(addr) ((*(int*)addr == MPI_FORTRAN_STATUS_IGNORE) ? MPI_STATUS_IGNORE : (addr))
+#define F2C_STATUSES_IGNORE(addr) ((*(int*)addr == MPI_FORTRAN_STATUSES_IGNORE) ? MPI_STATUSES_IGNORE : (addr))
 
 #define KEY_SIZE (sizeof(int) * 2 + 1)
 
+
+static char* get_key(char* key, int id) {
+  snprintf(key, KEY_SIZE, "%x",id);
+  return key;
+}
+static char* get_key_id(char* key, int id) {
+  snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process_index());
+  return key;
+}
+
 static int new_comm(MPI_Comm comm) {
-  xbt_dynar_push(comm_lookup, &comm);
-  return (int)xbt_dynar_length(comm_lookup) - 1;
+  static int comm_id = 0;
+  char key[KEY_SIZE];
+  xbt_dict_set(comm_lookup, comm==MPI_COMM_WORLD? get_key(key, comm_id) : get_key_id(key, comm_id), comm, NULL);
+  comm_id++;
+  return comm_id-1;
 }
 
 static void free_comm(int comm) {
-  xbt_dynar_remove_at(comm_lookup, comm, NULL);
+  char key[KEY_SIZE];
+  xbt_dict_remove(comm_lookup, comm==0? get_key(key, comm) : get_key_id(key, comm));
 }
 
 static MPI_Comm get_comm(int comm) {
   if(comm == -2) {
     return MPI_COMM_SELF;
-  } else if(comm_lookup && comm >= 0 && comm < (int)xbt_dynar_length(comm_lookup)) {
-    return *(MPI_Comm*)xbt_dynar_get_ptr(comm_lookup, comm);
+  }else if(comm==0){
+    return MPI_COMM_WORLD;
+  }     else if(comm_lookup && comm >= 0) {
+
+      char key[KEY_SIZE];
+      MPI_Comm tmp =  (MPI_Comm)xbt_dict_get_or_null(comm_lookup,get_key_id(key, comm));
+      return tmp != NULL ? tmp : MPI_COMM_NULL ;
   }
   return MPI_COMM_NULL;
 }
 
 static int new_group(MPI_Group group) {
-  xbt_dynar_push(group_lookup, &group);
-  return (int)xbt_dynar_length(group_lookup) - 1;
+  static int group_id = 0;
+  char key[KEY_SIZE];
+  xbt_dict_set(group_lookup, get_key(key, group_id), group, NULL);
+  group_id++;
+  return group_id-1;
 }
 
 static MPI_Group get_group(int group) {
   if(group == -2) {
     return MPI_GROUP_EMPTY;
-  } else if(group_lookup && group >= 0 && group < (int)xbt_dynar_length(group_lookup)) {
-    return *(MPI_Group*)xbt_dynar_get_ptr(group_lookup, group);
+  } else if(group_lookup && group >= 0) {
+    char key[KEY_SIZE];
+    return (MPI_Group)xbt_dict_get_or_null(group_lookup, get_key(key, group));
   }
-  return MPI_COMM_NULL;
+  return MPI_GROUP_NULL;
 }
 
-static char* get_key(char* key, int id) {
-  snprintf(key, KEY_SIZE, "%x", id);
-  return key;
+static void free_group(int group) {
+  char key[KEY_SIZE];
+  xbt_dict_remove(group_lookup, get_key(key, group));
 }
 
+
+
 static int new_request(MPI_Request req) {
   static int request_id = INT_MIN;
   char key[KEY_SIZE];
-
-  xbt_dict_set(request_lookup, get_key(key, request_id), req, NULL);
-  return request_id++;
+  xbt_dict_set(request_lookup, get_key_id(key, request_id), req, NULL);
+  request_id++;
+  return request_id-1;
 }
 
 static MPI_Request find_request(int req) {
   char key[KEY_SIZE];
-   
-  return (MPI_Request)xbt_dict_get(request_lookup, get_key(key, req));
+  if(req==MPI_FORTRAN_REQUEST_NULL)return MPI_REQUEST_NULL;
+  return (MPI_Request)xbt_dict_get(request_lookup, get_key_id(key, req));
+}
+
+static void free_request(int request) {
+  char key[KEY_SIZE];
+  if(request!=MPI_FORTRAN_REQUEST_NULL)
+  xbt_dict_remove(request_lookup, get_key_id(key, request));
 }
 
 static int new_datatype(MPI_Datatype datatype) {
-  xbt_dynar_push(datatype_lookup, &datatype);
-  return (int)xbt_dynar_length(datatype_lookup) - 1;
+  static int datatype_id = 0;
+  char key[KEY_SIZE];
+  xbt_dict_set(datatype_lookup, get_key(key, datatype_id), datatype, NULL);
+  datatype_id++;
+  return datatype_id-1;
 }
 
 static MPI_Datatype get_datatype(int datatype) {
+  char key[KEY_SIZE];
   return datatype >= 0
-         ? *(MPI_Datatype*)xbt_dynar_get_ptr(datatype_lookup, datatype)
+         ? (MPI_Datatype)xbt_dict_get_or_null(datatype_lookup, get_key(key, datatype))
          : MPI_DATATYPE_NULL;
 }
 
 static void free_datatype(int datatype) {
-  xbt_dynar_remove_at(datatype_lookup, datatype, NULL);
+  char key[KEY_SIZE];
+  xbt_dict_remove(datatype_lookup, get_key(key, datatype));
 }
 
 static int new_op(MPI_Op op) {
-  xbt_dynar_push(op_lookup, &op);
-  return (int)xbt_dynar_length(op_lookup) - 1;
+  static int op_id = 0;
+  char key[KEY_SIZE];
+  xbt_dict_set(op_lookup, get_key(key, op_id), op, NULL);
+  op_id++;
+  return op_id-1;
 }
 
 static MPI_Op get_op(int op) {
+  char key[KEY_SIZE];
    return op >= 0
-          ? *(MPI_Op*)xbt_dynar_get_ptr(op_lookup, op)
+          ? (MPI_Op)xbt_dict_get_or_null(op_lookup,  get_key(key, op))
           : MPI_OP_NULL;
 }
 
+static void free_op(int op) {
+  char key[KEY_SIZE];
+  xbt_dict_remove(op_lookup, get_key(key, op));
+}
+
 void mpi_init_(int* ierr) {
    if(!comm_lookup){
-     comm_lookup = xbt_dynar_new(sizeof(MPI_Comm), NULL);
+     comm_lookup = xbt_dict_new_homogeneous(NULL);
      new_comm(MPI_COMM_WORLD);
-     group_lookup = xbt_dynar_new(sizeof(MPI_Group), NULL);
+     group_lookup = xbt_dict_new_homogeneous(NULL);
 
      request_lookup = xbt_dict_new_homogeneous(NULL);
 
-     datatype_lookup = xbt_dynar_new(sizeof(MPI_Datatype), NULL);
+     datatype_lookup = xbt_dict_new_homogeneous(NULL);
      new_datatype(MPI_BYTE);
      new_datatype(MPI_CHAR);
      new_datatype(MPI_INT);
@@ -128,9 +182,14 @@ void mpi_init_(int* ierr) {
      new_datatype(MPI_UINT64_T);
      new_datatype(MPI_2FLOAT);
      new_datatype(MPI_2DOUBLE);
-
-
-     op_lookup = xbt_dynar_new(sizeof(MPI_Op), NULL);
+     new_datatype(MPI_DOUBLE);
+     new_datatype(MPI_DOUBLE);
+     new_datatype(MPI_INT);
+     new_datatype(MPI_DATATYPE_NULL);
+     new_datatype(MPI_DATATYPE_NULL);
+     new_datatype(MPI_DATATYPE_NULL);
+     new_datatype(MPI_DATATYPE_NULL);
+     op_lookup = xbt_dict_new_homogeneous(NULL);
      new_op(MPI_MAX);
      new_op(MPI_MIN);
      new_op(MPI_MAXLOC);
@@ -146,18 +205,22 @@ void mpi_init_(int* ierr) {
    }
    /* smpif2c is responsible for generating a call with the final arguments */
    *ierr = MPI_Init(NULL, NULL);
+   running_processes++;
 }
 
 void mpi_finalize_(int* ierr) {
    *ierr = MPI_Finalize();
-   xbt_dynar_free(&op_lookup);
-   op_lookup = NULL;
-   xbt_dynar_free(&datatype_lookup);
-   datatype_lookup = NULL;
-   xbt_dict_free(&request_lookup);
-   request_lookup = NULL;
-   xbt_dynar_free(&comm_lookup);
-   comm_lookup = NULL;
+   running_processes--;
+   if(running_processes==0){
+     xbt_dict_free(&op_lookup);
+     op_lookup = NULL;
+     xbt_dict_free(&datatype_lookup);
+     datatype_lookup = NULL;
+     xbt_dict_free(&request_lookup);
+     request_lookup = NULL;
+     xbt_dict_free(&comm_lookup);
+     comm_lookup = NULL;
+   }
 }
 
 void mpi_abort_(int* comm, int* errorcode, int* ierr) {
@@ -255,7 +318,7 @@ void mpi_send_init_(void *buf, int* count, int* datatype, int* dst, int* tag,
 void mpi_isend_(void *buf, int* count, int* datatype, int* dst,
                  int* tag, int* comm, int* request, int* ierr) {
   MPI_Request req;
-
+  buf = (char *) F2C_BOTTOM(buf);
   *ierr = MPI_Isend(buf, *count, get_datatype(*datatype), *dst, *tag,
                     get_comm(*comm), &req);
   if(*ierr == MPI_SUCCESS) {
@@ -266,7 +329,7 @@ void mpi_isend_(void *buf, int* count, int* datatype, int* dst,
 void mpi_irsend_(void *buf, int* count, int* datatype, int* dst,
                  int* tag, int* comm, int* request, int* ierr) {
   MPI_Request req;
-
+  buf = (char *) F2C_BOTTOM(buf);
   *ierr = MPI_Irsend(buf, *count, get_datatype(*datatype), *dst, *tag,
                     get_comm(*comm), &req);
   if(*ierr == MPI_SUCCESS) {
@@ -292,7 +355,7 @@ void mpi_sendrecv_(void* sendbuf, int* sendcount, int* sendtype, int* dst,
                 int* comm, MPI_Status* status, int* ierr) {
    *ierr = MPI_Sendrecv(sendbuf, *sendcount, get_datatype(*sendtype), *dst,
        *sendtag, recvbuf, *recvcount,get_datatype(*recvtype), *src, *recvtag,
-       get_comm(*comm), status);
+       get_comm(*comm), F2C_STATUS_IGNORE(status));
 }
 
 void mpi_recv_init_(void *buf, int* count, int* datatype, int* src, int* tag,
@@ -309,7 +372,7 @@ void mpi_recv_init_(void *buf, int* count, int* datatype, int* src, int* tag,
 void mpi_irecv_(void *buf, int* count, int* datatype, int* src, int* tag,
                  int* comm, int* request, int* ierr) {
   MPI_Request req;
-
+  buf = (char *) F2C_BOTTOM(buf);
   *ierr = MPI_Irecv(buf, *count, get_datatype(*datatype), *src, *tag,
                     get_comm(*comm), &req);
   if(*ierr == MPI_SUCCESS) {
@@ -344,7 +407,11 @@ void mpi_startall_(int* count, int* requests, int* ierr) {
 void mpi_wait_(int* request, MPI_Status* status, int* ierr) {
    MPI_Request req = find_request(*request);
    
-   *ierr = MPI_Wait(&req, status);
+   *ierr = MPI_Wait(&req, F2C_STATUS_IGNORE(status));
+   if(req==MPI_REQUEST_NULL){
+     free_request(*request);
+     *request=MPI_FORTRAN_REQUEST_NULL;
+   }
 }
 
 void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int* ierr) {
@@ -356,6 +423,10 @@ void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int
     reqs[i] = find_request(requests[i]);
   }
   *ierr = MPI_Waitany(*count, reqs, index, status);
+  if(reqs[*index]==MPI_REQUEST_NULL){
+      free_request(requests[*index]);
+      requests[*index]=MPI_FORTRAN_REQUEST_NULL;
+  }
   free(reqs);
 }
 
@@ -367,7 +438,14 @@ void mpi_waitall_(int* count, int* requests, MPI_Status* status, int* ierr) {
   for(i = 0; i < *count; i++) {
     reqs[i] = find_request(requests[i]);
   }
-  *ierr = MPI_Waitall(*count, reqs, status);
+  *ierr = MPI_Waitall(*count, reqs, F2C_STATUSES_IGNORE(status));
+  for(i = 0; i < *count; i++) {
+      if(reqs[i]==MPI_REQUEST_NULL){
+          free_request(requests[i]);
+          requests[i]=MPI_FORTRAN_REQUEST_NULL;
+      }
+  }
+
   free(reqs);
 }
 
@@ -381,18 +459,23 @@ void mpi_bcast_(void *buf, int* count, int* datatype, int* root, int* comm, int*
 
 void mpi_reduce_(void* sendbuf, void* recvbuf, int* count,
                   int* datatype, int* op, int* root, int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
+  sendbuf = (char *) F2C_BOTTOM(sendbuf);
+  recvbuf = (char *) F2C_BOTTOM(recvbuf);
   *ierr = MPI_Reduce(sendbuf, recvbuf, *count,
                      get_datatype(*datatype), get_op(*op), *root, get_comm(*comm));
 }
 
 void mpi_allreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype,
                      int* op, int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
   *ierr = MPI_Allreduce(sendbuf, recvbuf, *count, get_datatype(*datatype),
                         get_op(*op), get_comm(*comm));
 }
 
 void mpi_reduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype,
                      int* op, int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
   *ierr = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, get_datatype(*datatype),
                         get_op(*op), get_comm(*comm));
 }
@@ -400,6 +483,7 @@ void mpi_reduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* dat
 void mpi_scatter_(void* sendbuf, int* sendcount, int* sendtype,
                    void* recvbuf, int* recvcount, int* recvtype, 
                    int* root, int* comm, int* ierr) {
+  recvbuf = (char *) F2C_IN_PLACE(recvbuf);
   *ierr = MPI_Scatter(sendbuf, *sendcount, get_datatype(*sendtype),
                       recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
 }
@@ -408,6 +492,7 @@ void mpi_scatter_(void* sendbuf, int* sendcount, int* sendtype,
 void mpi_scatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
                    void* recvbuf, int* recvcount, int* recvtype,
                    int* root, int* comm, int* ierr) {
+  recvbuf = (char *) F2C_IN_PLACE(recvbuf);
   *ierr = MPI_Scatterv(sendbuf, sendcounts, displs, get_datatype(*sendtype),
                       recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
 }
@@ -415,6 +500,9 @@ void mpi_scatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
 void mpi_gather_(void* sendbuf, int* sendcount, int* sendtype,
                   void* recvbuf, int* recvcount, int* recvtype,
                   int* root, int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
+  sendbuf = (char *) F2C_BOTTOM(sendbuf);
+  recvbuf = (char *) F2C_BOTTOM(recvbuf);
   *ierr = MPI_Gather(sendbuf, *sendcount, get_datatype(*sendtype),
                      recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
 }
@@ -422,6 +510,9 @@ void mpi_gather_(void* sendbuf, int* sendcount, int* sendtype,
 void mpi_gatherv_(void* sendbuf, int* sendcount, int* sendtype,
                   void* recvbuf, int* recvcounts, int* displs, int* recvtype,
                   int* root, int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
+  sendbuf = (char *) F2C_BOTTOM(sendbuf);
+  recvbuf = (char *) F2C_BOTTOM(recvbuf);
   *ierr = MPI_Gatherv(sendbuf, *sendcount, get_datatype(*sendtype),
                      recvbuf, recvcounts, displs, get_datatype(*recvtype), *root, get_comm(*comm));
 }
@@ -429,6 +520,7 @@ void mpi_gatherv_(void* sendbuf, int* sendcount, int* sendtype,
 void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype,
                      void* recvbuf, int* recvcount, int* recvtype,
                      int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
   *ierr = MPI_Allgather(sendbuf, *sendcount, get_datatype(*sendtype),
                         recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
 }
@@ -436,6 +528,7 @@ void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype,
 void mpi_allgatherv_(void* sendbuf, int* sendcount, int* sendtype,
                      void* recvbuf, int* recvcounts,int* displs, int* recvtype,
                      int* comm, int* ierr) {
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
   *ierr = MPI_Allgatherv(sendbuf, *sendcount, get_datatype(*sendtype),
                         recvbuf, recvcounts, displs, get_datatype(*recvtype), get_comm(*comm));
 }
@@ -460,7 +553,11 @@ void mpi_alltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtyp
 
 void mpi_test_ (int * request, int *flag, MPI_Status * status, int* ierr){
   MPI_Request req = find_request(*request);
-  *ierr= MPI_Test(&req, flag, status);
+  *ierr= MPI_Test(&req, flag, F2C_STATUS_IGNORE(status));
+  if(req==MPI_REQUEST_NULL){
+      free_request(*request);
+      *request=MPI_FORTRAN_REQUEST_NULL;
+  }
 }
 
 
@@ -471,7 +568,13 @@ void mpi_testall_ (int* count, int * requests,  int *flag, MPI_Status * statuses
   for(i = 0; i < *count; i++) {
     reqs[i] = find_request(requests[i]);
   }
-  *ierr= MPI_Testall(*count, reqs, flag, statuses);
+  *ierr= MPI_Testall(*count, reqs, flag, F2C_STATUSES_IGNORE(statuses));
+  for(i = 0; i < *count; i++) {
+    if(reqs[i]==MPI_REQUEST_NULL){
+        free_request(requests[i]);
+        requests[i]=MPI_FORTRAN_REQUEST_NULL;
+    }
+  }
 }
 
 
@@ -480,7 +583,7 @@ void mpi_get_processor_name_(char *name, int *resultlen, int* ierr){
 }
 
 void mpi_get_count_(MPI_Status * status, int* datatype, int *count, int* ierr){
-  *ierr = MPI_Get_count(status, get_datatype(*datatype), count);
+  *ierr = MPI_Get_count(F2C_STATUS_IGNORE(status), get_datatype(*datatype), count);
 }
 
 void mpi_attr_get_(int* comm, int* keyval, void* attr_value, int* flag, int* ierr ){
@@ -570,7 +673,7 @@ void mpi_info_create_( int *info, int* ierr){
 }
 
 void mpi_info_set_( int *info, char *key, char *value, int* ierr){
-  *ierr =  MPI_Info_set( (MPI_Info *)info, key, value);
+  *ierr =  MPI_Info_set( *(MPI_Info *)info, key, value);
 }
 
 void mpi_info_free_(int* info, int* ierr){
@@ -582,3 +685,906 @@ void mpi_get_( int *origin_addr, int* origin_count, int* origin_datatype, int *t
   *ierr =  MPI_Get( (void*)origin_addr,*origin_count, get_datatype(*origin_datatype),*target_rank,
       *target_disp, *target_count,get_datatype(*target_datatype), *(MPI_Win *)win);
 }
+
+
+//following are automatically generated, and have to be checked
+void mpi_finalized_ (int * flag, int* ierr){
+
+ *ierr = MPI_Finalized(flag);
+}
+
+void mpi_init_thread_ (int* required, int *provided, int* ierr){
+  if(!comm_lookup){
+    comm_lookup = xbt_dict_new_homogeneous(NULL);
+    new_comm(MPI_COMM_WORLD);
+    group_lookup = xbt_dict_new_homogeneous(NULL);
+
+    request_lookup = xbt_dict_new_homogeneous(NULL);
+
+    datatype_lookup = xbt_dict_new_homogeneous(NULL);
+    new_datatype(MPI_BYTE);
+    new_datatype(MPI_CHAR);
+    new_datatype(MPI_INT);
+    new_datatype(MPI_INT);
+    new_datatype(MPI_INT8_T);
+    new_datatype(MPI_INT16_T);
+    new_datatype(MPI_INT32_T);
+    new_datatype(MPI_INT64_T);
+    new_datatype(MPI_FLOAT);
+    new_datatype(MPI_FLOAT);
+    new_datatype(MPI_DOUBLE);
+    new_datatype(MPI_DOUBLE);
+    new_datatype(MPI_C_FLOAT_COMPLEX);
+    new_datatype(MPI_C_DOUBLE_COMPLEX);
+    new_datatype(MPI_2INT);
+    new_datatype(MPI_UINT8_T);
+    new_datatype(MPI_UINT16_T);
+    new_datatype(MPI_UINT32_T);
+    new_datatype(MPI_UINT64_T);
+    new_datatype(MPI_2FLOAT);
+    new_datatype(MPI_2DOUBLE);
+
+    op_lookup = xbt_dict_new_homogeneous( NULL);
+    new_op(MPI_MAX);
+    new_op(MPI_MIN);
+    new_op(MPI_MAXLOC);
+    new_op(MPI_MINLOC);
+    new_op(MPI_SUM);
+    new_op(MPI_PROD);
+    new_op(MPI_LAND);
+    new_op(MPI_LOR);
+    new_op(MPI_LXOR);
+    new_op(MPI_BAND);
+    new_op(MPI_BOR);
+    new_op(MPI_BXOR);
+  }
+  /* smpif2c is responsible for generating a call with the final arguments */
+ *ierr = MPI_Init_thread(NULL, NULL,*required, provided);
+}
+
+void mpi_query_thread_ (int *provided, int* ierr){
+
+ *ierr = MPI_Query_thread(provided);
+}
+
+void mpi_is_thread_main_ (int *flag, int* ierr){
+
+ *ierr = MPI_Is_thread_main(flag);
+}
+
+void mpi_address_ (void *location, MPI_Aint * address, int* ierr){
+
+ *ierr = MPI_Address(location, address);
+}
+
+void mpi_get_address_ (void *location, MPI_Aint * address, int* ierr){
+
+ *ierr = MPI_Get_address(location, address);
+}
+
+void mpi_type_dup_ (int*  datatype, int* newdatatype, int* ierr){
+ MPI_Datatype tmp;
+ *ierr = MPI_Type_dup(get_datatype(*datatype), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newdatatype = new_datatype(tmp);
+ }
+}
+
+void mpi_type_set_name_ (int*  datatype, char * name, int* ierr){
+
+ *ierr = MPI_Type_set_name(get_datatype(*datatype), name);
+}
+
+void mpi_type_get_name_ (int*  datatype, char * name, int* len, int* ierr){
+
+ *ierr = MPI_Type_get_name(get_datatype(*datatype),name,len);
+}
+
+void mpi_type_get_attr_ (int* type, int* type_keyval, void *attribute_val, int* flag, int* ierr){
+
+ *ierr = MPI_Type_get_attr ( get_datatype(*type), *type_keyval, attribute_val,flag);
+}
+
+void mpi_type_set_attr_ (int* type, int* type_keyval, void *attribute_val, int* ierr){
+
+ *ierr = MPI_Type_set_attr ( get_datatype(*type), *type_keyval, attribute_val);
+}
+
+void mpi_type_delete_attr_ (int* type, int* type_keyval, int* ierr){
+
+ *ierr = MPI_Type_delete_attr ( get_datatype(*type),  *type_keyval);
+}
+
+void mpi_type_create_keyval_ (void* copy_fn, void*  delete_fn, int* keyval, void* extra_state, int* ierr){
+
+ *ierr = MPI_Type_create_keyval((MPI_Type_copy_attr_function*)copy_fn, (MPI_Type_delete_attr_function*) delete_fn,  keyval,  extra_state) ;
+}
+
+void mpi_type_free_keyval_ (int* keyval, int* ierr) {
+ *ierr = MPI_Type_free_keyval( keyval);
+}
+
+void mpi_pcontrol_ (int* level , int* ierr){
+ *ierr = MPI_Pcontrol(*(const int*)level);
+}
+
+void mpi_type_get_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
+
+ *ierr = MPI_Type_get_extent(get_datatype(*datatype), lb, extent);
+}
+
+void mpi_type_get_true_extent_ (int* datatype, MPI_Aint * lb, MPI_Aint * extent, int* ierr){
+
+ *ierr = MPI_Type_get_true_extent(get_datatype(*datatype), lb, extent);
+}
+
+void mpi_op_create_ (void * function, int* commute, int* op, int* ierr){
+  MPI_Op tmp;
+ *ierr = MPI_Op_create((MPI_User_function*)function,* commute, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *op = new_op(tmp);
+ }
+}
+
+void mpi_op_free_ (int* op, int* ierr){
+  MPI_Op tmp=get_op(*op);
+  *ierr = MPI_Op_free(& tmp);
+  if(*ierr == MPI_SUCCESS) {
+    free_op(*op);
+  }
+}
+
+void mpi_group_free_ (int* group, int* ierr){
+ MPI_Group tmp=get_group(*group);
+ *ierr = MPI_Group_free(&tmp);
+ if(*ierr == MPI_SUCCESS) {
+   free_group(*group);
+ }
+}
+
+void mpi_group_size_ (int* group, int *size, int* ierr){
+
+ *ierr = MPI_Group_size(get_group(*group), size);
+}
+
+void mpi_group_rank_ (int* group, int *rank, int* ierr){
+
+ *ierr = MPI_Group_rank(get_group(*group), rank);
+}
+
+void mpi_group_translate_ranks_ (int* group1, int* n, int *ranks1, int* group2, int *ranks2, int* ierr)
+{
+
+ *ierr = MPI_Group_translate_ranks(get_group(*group1), *n, ranks1, get_group(*group2), ranks2);
+}
+
+void mpi_group_compare_ (int* group1, int* group2, int *result, int* ierr){
+
+ *ierr = MPI_Group_compare(get_group(*group1), get_group(*group2), result);
+}
+
+void mpi_group_union_ (int* group1, int* group2, int* newgroup, int* ierr){
+ MPI_Group tmp;
+ *ierr = MPI_Group_union(get_group(*group1), get_group(*group2), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_group_intersection_ (int* group1, int* group2, int* newgroup, int* ierr){
+ MPI_Group tmp;
+ *ierr = MPI_Group_intersection(get_group(*group1), get_group(*group2), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_group_difference_ (int* group1, int* group2, int* newgroup, int* ierr){
+ MPI_Group tmp;
+ *ierr = MPI_Group_difference(get_group(*group1), get_group(*group2), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_group_excl_ (int* group, int* n, int *ranks, int* newgroup, int* ierr){
+  MPI_Group tmp;
+ *ierr = MPI_Group_excl(get_group(*group), *n, ranks, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_group_range_incl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr)
+{
+  MPI_Group tmp;
+ *ierr = MPI_Group_range_incl(get_group(*group), *n, ranges, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_group_range_excl_ (int* group, int* n, int ranges[][3], int* newgroup, int* ierr)
+{
+ MPI_Group tmp;
+ *ierr = MPI_Group_range_excl(get_group(*group), *n, ranges, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *newgroup = new_group(tmp);
+ }
+}
+
+void mpi_comm_get_attr_ (int* comm, int* comm_keyval, void *attribute_val, int *flag, int* ierr){
+
+ *ierr = MPI_Comm_get_attr (get_comm(*comm), *comm_keyval, attribute_val, flag);
+}
+
+void mpi_comm_set_attr_ (int* comm, int* comm_keyval, void *attribute_val, int* ierr){
+
+ *ierr = MPI_Comm_set_attr ( get_comm(*comm), *comm_keyval, attribute_val);
+}
+
+void mpi_comm_delete_attr_ (int* comm, int* comm_keyval, int* ierr){
+
+ *ierr = MPI_Comm_delete_attr (get_comm(*comm),  *comm_keyval);
+}
+
+void mpi_comm_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr){
+
+ *ierr = MPI_Comm_create_keyval((MPI_Comm_copy_attr_function*)copy_fn,  (MPI_Comm_delete_attr_function*)delete_fn,  keyval,  extra_state) ;
+}
+
+void mpi_comm_free_keyval_ (int* keyval, int* ierr) {
+ *ierr = MPI_Comm_free_keyval( keyval);
+}
+
+void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){
+
+ *ierr = MPI_Comm_get_name(get_comm(*comm), name, len);
+}
+
+void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr){
+
+ *ierr = MPI_Comm_compare(get_comm(*comm1), get_comm(*comm2), result);
+}
+
+void mpi_comm_disconnect_ (int* comm, int* ierr){
+ MPI_Comm tmp=get_comm(*comm);
+ *ierr = MPI_Comm_disconnect(&tmp);
+ if(*ierr == MPI_SUCCESS) {
+   free_comm(*comm);
+ }
+}
+
+void mpi_request_free_ (int* request, int* ierr){
+  MPI_Request tmp=find_request(*request);
+ *ierr = MPI_Request_free(&tmp);
+ if(*ierr == MPI_SUCCESS) {
+   free_request(*request);
+ }
+}
+
+void mpi_sendrecv_replace_ (void *buf, int* count, int* datatype, int* dst, int* sendtag, int* src, int* recvtag,
+ int* comm, MPI_Status* status, int* ierr)
+{
+
+ *ierr = MPI_Sendrecv_replace(buf, *count, get_datatype(*datatype), *dst, *sendtag, *src,
+ *recvtag, get_comm(*comm), F2C_STATUS_IGNORE(status));
+}
+
+void mpi_testany_ (int* count, int* requests, int *index, int *flag, MPI_Status* status, int* ierr)
+{
+  MPI_Request* reqs;
+  int i;
+
+  reqs = xbt_new(MPI_Request, *count);
+  for(i = 0; i < *count; i++) {
+    reqs[i] = find_request(requests[i]);
+  }
+  *ierr = MPI_Testany(*count, reqs, index, flag, F2C_STATUS_IGNORE(status));
+  if(*index!=MPI_UNDEFINED)
+  if(reqs[*index]==MPI_REQUEST_NULL){
+    free_request(requests[*index]);
+    requests[*index]=MPI_FORTRAN_REQUEST_NULL;
+  }
+  free(reqs);
+}
+
+void mpi_waitsome_ (int* incount, int* requests, int *outcount, int *indices, MPI_Status* status, int* ierr)
+{
+  MPI_Request* reqs;
+  int i;
+
+  reqs = xbt_new(MPI_Request, *incount);
+  for(i = 0; i < *incount; i++) {
+    reqs[i] = find_request(requests[i]);
+  }
+  *ierr = MPI_Waitsome(*incount, reqs, outcount, indices, status);
+  for(i=0;i<*outcount;i++){
+    if(reqs[indices[i]]==MPI_REQUEST_NULL){
+        free_request(requests[indices[i]]);
+        requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
+    }
+  }
+  free(reqs);
+}
+
+void mpi_reduce_local_ (void *inbuf, void *inoutbuf, int* count, int* datatype, int* op, int* ierr){
+
+ *ierr = MPI_Reduce_local(inbuf, inoutbuf, *count, get_datatype(*datatype), get_op(*op));
+}
+
+void mpi_reduce_scatter_block_ (void *sendbuf, void *recvbuf, int* recvcount, int* datatype, int* op, int* comm, int* ierr)
+{
+  sendbuf = (char *) F2C_IN_PLACE(sendbuf);
+ *ierr = MPI_Reduce_scatter_block(sendbuf, recvbuf, *recvcount, get_datatype(*datatype), get_op(*op), get_comm(*comm));
+}
+
+void mpi_pack_size_ (int* incount, int* datatype, int* comm, int* size, int* ierr) {
+ *ierr = MPI_Pack_size(*incount, get_datatype(*datatype), get_comm(*comm), size);
+}
+
+void mpi_cart_coords_ (int* comm, int* rank, int* maxdims, int* coords, int* ierr) {
+ *ierr = MPI_Cart_coords(get_comm(*comm), *rank, *maxdims, coords);
+}
+
+void mpi_cart_create_ (int* comm_old, int* ndims, int* dims, int* periods, int* reorder, int*  comm_cart, int* ierr) {
+  MPI_Comm tmp;
+ *ierr = MPI_Cart_create(get_comm(*comm_old), *ndims, dims, periods, *reorder, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *comm_cart = new_comm(tmp);
+ }
+}
+
+void mpi_cart_get_ (int* comm, int* maxdims, int* dims, int* periods, int* coords, int* ierr) {
+ *ierr = MPI_Cart_get(get_comm(*comm), *maxdims, dims, periods, coords);
+}
+
+void mpi_cart_map_ (int* comm_old, int* ndims, int* dims, int* periods, int* newrank, int* ierr) {
+ *ierr = MPI_Cart_map(get_comm(*comm_old), *ndims, dims, periods, newrank);
+}
+
+void mpi_cart_rank_ (int* comm, int* coords, int* rank, int* ierr) {
+ *ierr = MPI_Cart_rank(get_comm(*comm), coords, rank);
+}
+
+void mpi_cart_shift_ (int* comm, int* direction, int* displ, int* source, int* dest, int* ierr) {
+ *ierr = MPI_Cart_shift(get_comm(*comm), *direction, *displ, source, dest);
+}
+
+void mpi_cart_sub_ (int* comm, int* remain_dims, int*  comm_new, int* ierr) {
+ MPI_Comm tmp;
+ *ierr = MPI_Cart_sub(get_comm(*comm), remain_dims, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *comm_new = new_comm(tmp);
+ }
+}
+
+void mpi_cartdim_get_ (int* comm, int* ndims, int* ierr) {
+ *ierr = MPI_Cartdim_get(get_comm(*comm), ndims);
+}
+
+void mpi_graph_create_ (int* comm_old, int* nnodes, int* index, int* edges, int* reorder, int*  comm_graph, int* ierr) {
+  MPI_Comm tmp;
+ *ierr = MPI_Graph_create(get_comm(*comm_old), *nnodes, index, edges, *reorder, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *comm_graph = new_comm(tmp);
+ }
+}
+
+void mpi_graph_get_ (int* comm, int* maxindex, int* maxedges, int* index, int* edges, int* ierr) {
+ *ierr = MPI_Graph_get(get_comm(*comm), *maxindex, *maxedges, index, edges);
+}
+
+void mpi_graph_map_ (int* comm_old, int* nnodes, int* index, int* edges, int* newrank, int* ierr) {
+ *ierr = MPI_Graph_map(get_comm(*comm_old), *nnodes, index, edges, newrank);
+}
+
+void mpi_graph_neighbors_ (int* comm, int* rank, int* maxneighbors, int* neighbors, int* ierr) {
+ *ierr = MPI_Graph_neighbors(get_comm(*comm), *rank, *maxneighbors, neighbors);
+}
+
+void mpi_graph_neighbors_count_ (int* comm, int* rank, int* nneighbors, int* ierr) {
+ *ierr = MPI_Graph_neighbors_count(get_comm(*comm), *rank, nneighbors);
+}
+
+void mpi_graphdims_get_ (int* comm, int* nnodes, int* nedges, int* ierr) {
+ *ierr = MPI_Graphdims_get(get_comm(*comm), nnodes, nedges);
+}
+
+void mpi_topo_test_ (int* comm, int* top_type, int* ierr) {
+ *ierr = MPI_Topo_test(get_comm(*comm), top_type);
+}
+
+void mpi_error_class_ (int* errorcode, int* errorclass, int* ierr) {
+ *ierr = MPI_Error_class(*errorcode, errorclass);
+}
+
+void mpi_errhandler_create_ (void* function, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_create((MPI_Handler_function*)function, (MPI_Errhandler*)errhandler);
+}
+
+void mpi_errhandler_free_ (void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_free((MPI_Errhandler*)errhandler);
+}
+
+void mpi_errhandler_get_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_get(get_comm(*comm), (MPI_Errhandler*) errhandler);
+}
+
+void mpi_errhandler_set_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(get_comm(*comm), *(MPI_Errhandler*)errhandler);
+}
+
+void mpi_comm_set_errhandler_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(get_comm(*comm), *(MPI_Errhandler*)errhandler);
+}
+
+void mpi_comm_get_errhandler_ (int* comm, void* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(get_comm(*comm), (MPI_Errhandler*)errhandler);
+}
+
+void mpi_type_contiguous_ (int* count, int* old_type, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_contiguous(*count, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_cancel_ (int* request, int* ierr) {
+  MPI_Request tmp=find_request(*request);
+ *ierr = MPI_Cancel(&tmp);
+ if(*ierr == MPI_SUCCESS) {
+   free_request(*request);
+ }
+}
+
+void mpi_buffer_attach_ (void* buffer, int* size, int* ierr) {
+ *ierr = MPI_Buffer_attach(buffer, *size);
+}
+
+void mpi_buffer_detach_ (void* buffer, int* size, int* ierr) {
+ *ierr = MPI_Buffer_detach(buffer, size);
+}
+
+void mpi_testsome_ (int* incount, int*  requests, int* outcount, int* indices, MPI_Status*  statuses, int* ierr) {
+  MPI_Request* reqs;
+  int i;
+
+  reqs = xbt_new(MPI_Request, *incount);
+  for(i = 0; i < *incount; i++) {
+    reqs[i] = find_request(requests[i]);
+    indices[i]=0;
+  }
+  *ierr = MPI_Testsome(*incount, reqs, outcount, indices, F2C_STATUSES_IGNORE(statuses));
+  for(i=0;i<*incount;i++){
+    if(indices[i]){
+      if(reqs[indices[i]]==MPI_REQUEST_NULL){
+          free_request(requests[indices[i]]);
+          requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
+      }
+    }
+  }
+  free(reqs);
+}
+
+void mpi_comm_test_inter_ (int* comm, int* flag, int* ierr) {
+ *ierr = MPI_Comm_test_inter(get_comm(*comm), flag);
+}
+
+void mpi_unpack_ (void* inbuf, int* insize, int* position, void* outbuf, int* outcount, int* type, int* comm, int* ierr) {
+ *ierr = MPI_Unpack(inbuf, *insize, position, outbuf, *outcount, get_datatype(*type), get_comm(*comm));
+}
+
+void mpi_pack_external_size_ (char *datarep, int* incount, int* datatype, MPI_Aint *size, int* ierr){
+ *ierr = MPI_Pack_external_size(datarep, *incount, get_datatype(*datatype), size);
+}
+
+void mpi_pack_external_ (char *datarep, void *inbuf, int* incount, int* datatype, void *outbuf, MPI_Aint* outcount, MPI_Aint *position, int* ierr){
+ *ierr = MPI_Pack_external(datarep, inbuf, *incount, get_datatype(*datatype), outbuf, *outcount, position);
+}
+
+void mpi_unpack_external_ ( char *datarep, void *inbuf, MPI_Aint* insize, MPI_Aint *position, void *outbuf, int* outcount, int* datatype, int* ierr){
+ *ierr = MPI_Unpack_external( datarep, inbuf, *insize, position, outbuf, *outcount, get_datatype(*datatype));
+}
+
+void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_hindexed(*count, blocklens, indices, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_hindexed(*count, blocklens, indices, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_indexed(*count, blocklens, indices, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices,  int* old_type,  int*newtype, int* ierr){
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_indexed_block(*count, *blocklength, indices, get_datatype(*old_type), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_struct(*count, blocklens, indices, (MPI_Datatype*)old_types, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_struct_ (int* count, int* blocklens, MPI_Aint* indices, int*  old_types, int*  newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_struct(*count, blocklens, indices, (MPI_Datatype*)old_types, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_ssend_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Ssend(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm));
+}
+
+void mpi_ssend_init_ (void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* request, int* ierr) {
+  MPI_Request tmp;
+ *ierr = MPI_Ssend_init(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_intercomm_create_ (int* local_comm, int *local_leader, int* peer_comm, int* remote_leader, int* tag, int*  comm_out, int* ierr) {
+  MPI_Comm tmp;
+  *ierr = MPI_Intercomm_create(get_comm(*local_comm), *local_leader,get_comm(*peer_comm), *remote_leader, *tag, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *comm_out = new_comm(tmp);
+  }
+}
+
+void mpi_intercomm_merge_ (int* comm, int* high, int*  comm_out, int* ierr) {
+ MPI_Comm tmp;
+ *ierr = MPI_Intercomm_merge(get_comm(*comm), *high, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *comm_out = new_comm(tmp);
+ }
+}
+
+void mpi_bsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Bsend(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm));
+}
+
+void mpi_bsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int*  request, int* ierr) {
+  MPI_Request tmp;
+  *ierr = MPI_Bsend_init(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_ibsend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int*  request, int* ierr) {
+  MPI_Request tmp;
+  *ierr = MPI_Ibsend(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_comm_remote_group_ (int* comm, int*  group, int* ierr) {
+  MPI_Group tmp;
+ *ierr = MPI_Comm_remote_group(get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *group = new_group(tmp);
+ }
+}
+
+void mpi_comm_remote_size_ (int* comm, int* size, int* ierr) {
+ *ierr = MPI_Comm_remote_size(get_comm(*comm), size);
+}
+
+void mpi_issend_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int*  request, int* ierr) {
+  MPI_Request tmp;
+  *ierr = MPI_Issend(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_probe_ (int* source, int* tag, int* comm, MPI_Status*  status, int* ierr) {
+ *ierr = MPI_Probe(*source, *tag, get_comm(*comm), F2C_STATUS_IGNORE(status));
+}
+
+void mpi_attr_delete_ (int* comm, int* keyval, int* ierr) {
+ *ierr = MPI_Attr_delete(get_comm(*comm), *keyval);
+}
+
+void mpi_attr_put_ (int* comm, int* keyval, void* attr_value, int* ierr) {
+ *ierr = MPI_Attr_put(get_comm(*comm), *keyval, attr_value);
+}
+
+void mpi_rsend_init_ (void* buf, int* count, int* datatype, int *dest, int* tag, int* comm, int*  request, int* ierr) {
+  MPI_Request tmp;
+  *ierr = MPI_Rsend_init(buf, *count, get_datatype(*datatype), *dest, *tag, get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_keyval_create_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr) {
+ *ierr = MPI_Keyval_create((MPI_Copy_function*)copy_fn, (MPI_Delete_function*)delete_fn, keyval, extra_state);
+}
+
+void mpi_keyval_free_ (int* keyval, int* ierr) {
+ *ierr = MPI_Keyval_free(keyval);
+}
+
+void mpi_test_cancelled_ (MPI_Status*  status, int* flag, int* ierr) {
+ *ierr = MPI_Test_cancelled(status, flag);
+}
+
+void mpi_pack_ (void* inbuf, int* incount, int* type, void* outbuf, int* outcount, int* position, int* comm, int* ierr) {
+ *ierr = MPI_Pack(inbuf, *incount, get_datatype(*type), outbuf, *outcount, position, get_comm(*comm));
+}
+
+void mpi_get_elements_ (MPI_Status*  status, int* datatype, int* elements, int* ierr) {
+ *ierr = MPI_Get_elements(status, get_datatype(*datatype), elements);
+}
+
+void mpi_dims_create_ (int* nnodes, int* ndims, int* dims, int* ierr) {
+ *ierr = MPI_Dims_create(*nnodes, *ndims, dims);
+}
+
+void mpi_iprobe_ (int* source, int* tag, int* comm, int* flag, MPI_Status*  status, int* ierr) {
+ *ierr = MPI_Iprobe(*source, *tag, get_comm(*comm), flag, status);
+}
+
+void mpi_type_get_envelope_ ( int* datatype, int *num_integers, int *num_addresses, int *num_datatypes, int *combiner, int* ierr){
+
+ *ierr = MPI_Type_get_envelope(  get_datatype(*datatype), num_integers,
+ num_addresses, num_datatypes, combiner);
+}
+
+void mpi_type_get_contents_ (int* datatype, int* max_integers, int* max_addresses, int* max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses,
+ int* array_of_datatypes, int* ierr){
+ *ierr = MPI_Type_get_contents(get_datatype(*datatype), *max_integers, *max_addresses,*max_datatypes, array_of_integers, array_of_addresses, (MPI_Datatype*)array_of_datatypes);
+}
+
+void mpi_type_create_darray_ (int* size, int* rank, int* ndims, int* array_of_gsizes, int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+ int* order, int* oldtype, int*newtype, int* ierr) {
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_darray(*size, *rank, *ndims,  array_of_gsizes,
+  array_of_distribs,  array_of_dargs,  array_of_psizes,
+  *order,  get_datatype(*oldtype), &tmp) ;
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_resized_ (int* oldtype,MPI_Aint* lb, MPI_Aint* extent, int*newtype, int* ierr){
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_resized(get_datatype(*oldtype),*lb, *extent, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_create_subarray_ (int* ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int* order, int* oldtype, int*newtype, int* ierr){
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_create_subarray(*ndims,array_of_sizes, array_of_subsizes, array_of_starts, *order, get_datatype(*oldtype), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newtype = new_datatype(tmp);
+  }
+}
+
+void mpi_type_match_size_ (int* typeclass,int* size,int* datatype, int* ierr){
+  MPI_Datatype tmp;
+  *ierr = MPI_Type_match_size(*typeclass,*size,&tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *datatype = new_datatype(tmp);
+  }
+}
+
+void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* sendtypes, void *recvbuf, int *recvcnts, int *rdispls, int* recvtypes,
+ int* comm, int* ierr){
+ *ierr = MPI_Alltoallw( sendbuf, sendcnts, sdispls, (MPI_Datatype*) sendtypes, recvbuf, recvcnts, rdispls, (MPI_Datatype*)recvtypes, get_comm(*comm));
+}
+
+void mpi_exscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr){
+ *ierr = MPI_Exscan(sendbuf, recvbuf, *count, get_datatype(*datatype), get_op(*op), get_comm(*comm));
+}
+
+void mpi_comm_set_name_ (int* comm, char* name, int* ierr){
+ *ierr = MPI_Comm_set_name (get_comm(*comm), name);
+}
+
+void mpi_comm_dup_with_info_ (int* comm, int* info, int* newcomm, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_dup_with_info(get_comm(*comm),*(MPI_Info*)info,&tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newcomm = new_comm(tmp);
+  }
+}
+
+void mpi_comm_split_type_ (int* comm, int* split_type, int* key, int* info, int* newcomm, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_split_type(get_comm(*comm), *split_type, *key, *(MPI_Info*)info, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newcomm = new_comm(tmp);
+  }
+}
+
+void mpi_comm_set_info_ (int* comm, int* info, int* ierr){
+ *ierr = MPI_Comm_set_info (get_comm(*comm), *(MPI_Info*)info);
+}
+
+void mpi_comm_get_info_ (int* comm, int* info, int* ierr){
+ *ierr = MPI_Comm_get_info (get_comm(*comm), (MPI_Info*)info);
+}
+
+void mpi_info_get_ (int* info,char *key,int* valuelen, char *value, int *flag, int* ierr){
+ *ierr = MPI_Info_get(*(MPI_Info*)info,key,*valuelen, value, flag);
+}
+
+void mpi_comm_create_errhandler_ ( void *function, void *errhandler, int* ierr){
+ *ierr = MPI_Comm_create_errhandler( (MPI_Comm_errhandler_fn*) function, (MPI_Errhandler*)errhandler);
+}
+
+void mpi_add_error_class_ ( int *errorclass, int* ierr){
+ *ierr = MPI_Add_error_class( errorclass);
+}
+
+void mpi_add_error_code_ (  int* errorclass, int *errorcode, int* ierr){
+ *ierr = MPI_Add_error_code(*errorclass, errorcode);
+}
+
+void mpi_add_error_string_ ( int* errorcode, char *string, int* ierr){
+ *ierr = MPI_Add_error_string(*errorcode, string);
+}
+
+void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr){
+ *ierr = MPI_Comm_call_errhandler(get_comm(*comm), *errorcode);
+}
+
+void mpi_info_dup_ (int* info, int* newinfo, int* ierr){
+ *ierr = MPI_Info_dup(*(MPI_Info*)info, (MPI_Info*)newinfo);
+}
+
+void mpi_info_get_valuelen_ ( int* info, char *key, int *valuelen, int *flag, int* ierr){
+ *ierr = MPI_Info_get_valuelen( *(MPI_Info*)info, key, valuelen, flag);
+}
+
+void mpi_info_delete_ (int* info, char *key, int* ierr){
+ *ierr = MPI_Info_delete(*(MPI_Info*)info, key);
+}
+
+void mpi_info_get_nkeys_ ( int* info, int *nkeys, int* ierr){
+ *ierr = MPI_Info_get_nkeys(  *(MPI_Info*)info, nkeys);
+}
+
+void mpi_info_get_nthkey_ ( int* info, int* n, char *key, int* ierr){
+ *ierr = MPI_Info_get_nthkey( *(MPI_Info*)info, *n, key);
+}
+
+void mpi_get_version_ (int *version,int *subversion, int* ierr){
+ *ierr = MPI_Get_version (version,subversion);
+}
+
+void mpi_get_library_version_ (char *version,int *len, int* ierr){
+ *ierr = MPI_Get_library_version (version,len);
+}
+
+void mpi_request_get_status_ ( int* request, int *flag, MPI_Status* status, int* ierr){
+ *ierr = MPI_Request_get_status( find_request(*request), flag, status);
+}
+
+void mpi_grequest_start_ ( void *query_fn, void *free_fn, void *cancel_fn, void *extra_state, int*request, int* ierr){
+  MPI_Request tmp;
+  *ierr = MPI_Grequest_start( (MPI_Grequest_query_function*)query_fn, (MPI_Grequest_free_function*)free_fn, (MPI_Grequest_cancel_function*)cancel_fn, extra_state, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *request = new_request(tmp);
+ }
+}
+
+void mpi_grequest_complete_ ( int* request, int* ierr){
+ *ierr = MPI_Grequest_complete( find_request(*request));
+}
+
+void mpi_status_set_cancelled_ (MPI_Status* status,int* flag, int* ierr){
+ *ierr = MPI_Status_set_cancelled(status,*flag);
+}
+
+void mpi_status_set_elements_ ( MPI_Status* status, int* datatype, int* count, int* ierr){
+ *ierr = MPI_Status_set_elements( status, get_datatype(*datatype), *count);
+}
+
+void mpi_comm_connect_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_connect( port_name, *(MPI_Info*)info, *root, get_comm(*comm), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newcomm = new_comm(tmp);
+  }
+}
+
+void mpi_publish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Publish_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_unpublish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Unpublish_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_lookup_name_ ( char *service_name, int* info, char *port_name, int* ierr){
+ *ierr = MPI_Lookup_name( service_name, *(MPI_Info*)info, port_name);
+}
+
+void mpi_comm_join_ ( int* fd, int* intercomm, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_join( *fd, &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *intercomm = new_comm(tmp);
+  }
+}
+
+void mpi_open_port_ ( int* info, char *port_name, int* ierr){
+ *ierr = MPI_Open_port( *(MPI_Info*)info,port_name);
+}
+
+void mpi_close_port_ ( char *port_name, int* ierr){
+ *ierr = MPI_Close_port( port_name);
+}
+
+void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_accept( port_name, *(MPI_Info*)info, *root, get_comm(*comm), &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *newcomm = new_comm(tmp);
+  }
+}
+
+void mpi_comm_spawn_ ( char *command, char *argv, int* maxprocs, int* info, int* root, int* comm, int* intercomm, int* array_of_errcodes, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_spawn( command, NULL, *maxprocs, *(MPI_Info*)info, *root, get_comm(*comm), &tmp, array_of_errcodes);
+  if(*ierr == MPI_SUCCESS) {
+    *intercomm = new_comm(tmp);
+  }
+}
+
+void mpi_comm_spawn_multiple_ ( int* count, char *array_of_commands, char** array_of_argv, int* array_of_maxprocs, int* array_of_info, int* root,
+ int* comm, int* intercomm, int* array_of_errcodes, int* ierr){
+ MPI_Comm tmp;
+ *ierr = MPI_Comm_spawn_multiple(* count, &array_of_commands, &array_of_argv, array_of_maxprocs,
+ (MPI_Info*)array_of_info, *root, get_comm(*comm), &tmp, array_of_errcodes);
+ if(*ierr == MPI_SUCCESS) {
+   *intercomm = new_comm(tmp);
+ }
+}
+
+void mpi_comm_get_parent_ ( int* parent, int* ierr){
+  MPI_Comm tmp;
+  *ierr = MPI_Comm_get_parent( &tmp);
+  if(*ierr == MPI_SUCCESS) {
+    *parent = new_comm(tmp);
+  }
+}
index c62c103..4ebd97a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,12 +29,14 @@ typedef struct s_smpi_process_data {
   double simulated;
   MPI_Comm comm_self;
   void *data; /* user data */
+  int initialized;
 } s_smpi_process_data_t;
 
 static smpi_process_data_t *process_data = NULL;
 static int process_count = 0;
 
 MPI_Comm MPI_COMM_WORLD = MPI_COMM_NULL;
+int MPI_UNIVERSE_SIZE;
 
 MPI_Errhandler* MPI_ERRORS_RETURN = NULL;
 MPI_Errhandler* MPI_ERRORS_ARE_FATAL = NULL;
@@ -79,7 +81,7 @@ void smpi_process_init(int *argc, char ***argv)
 void smpi_process_destroy(void)
 {
   int index = smpi_process_index();
-
+  process_data[index]->index=-100;
   XBT_DEBUG("<%d> Process left the game", index);
 }
 
@@ -94,6 +96,34 @@ void smpi_process_finalize(void)
   }
 }
 
+/**
+ * @brief Check if a process is finalized
+ */
+int smpi_process_finalized()
+{
+   return (smpi_process_index()==-100);
+  // If finalized, this value has been set to -100;
+}
+
+/**
+ * @brief Check if a process is initialized
+ */
+int smpi_process_initialized(void)
+{
+  int index = smpi_process_index();
+  return((index != -100) && (index!=MPI_UNDEFINED) && (process_data[index]->initialized));
+}
+
+/**
+ * @brief Mark a process as initialized (=MPI_Init called)
+ */
+void smpi_process_mark_as_initialized(void)
+{
+  int index = smpi_process_index();
+  if((index != -100)&& (index!=MPI_UNDEFINED))process_data[index]->initialized=1;
+}
+
+
 #ifdef SMPI_F2C
 int smpi_process_argc(void) {
   smpi_process_data_t data = smpi_process_data();
@@ -160,8 +190,8 @@ int smpi_process_count(void)
 int smpi_process_index(void)
 {
   smpi_process_data_t data = smpi_process_data();
-
-  return data->index;
+  //return -1 if not initialized
+  return data? data->index : MPI_UNDEFINED;
 }
 
 smx_rdv_t smpi_process_mailbox(void) {
@@ -251,15 +281,24 @@ void smpi_global_init(void)
     process_data[i]->mailbox = simcall_rdv_create(get_mailbox_name(name, i));
     process_data[i]->mailbox_small = simcall_rdv_create(get_mailbox_name_small(name, i));
     process_data[i]->timer = xbt_os_timer_new();
+    if(MC_is_active())
+      MC_ignore_heap(process_data[i]->timer, xbt_os_timer_size());
     group = smpi_group_new(1);
     process_data[i]->comm_self = smpi_comm_new(group);
+    process_data[i]->initialized =0;
+
     smpi_group_set_mapping(group, i, 0);
   }
   group = smpi_group_new(process_count);
   MPI_COMM_WORLD = smpi_comm_new(group);
+  MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD);
   for (i = 0; i < process_count; i++) {
     smpi_group_set_mapping(group, i, i);
   }
+
+  //check correctness of MPI parameters
+
+  xbt_assert(sg_cfg_get_int("smpi/async_small_thres")<=sg_cfg_get_int("smpi/send_is_detached_thres"));
 }
 
 void smpi_global_destroy(void)
@@ -268,11 +307,11 @@ void smpi_global_destroy(void)
   int i;
 
   smpi_bench_destroy();
-  smpi_group_destroy(smpi_comm_group(MPI_COMM_WORLD));
-  smpi_comm_destroy(MPI_COMM_WORLD);
+  while(smpi_group_unuse(smpi_comm_group(MPI_COMM_WORLD))>0);
+  xbt_free(MPI_COMM_WORLD);
   MPI_COMM_WORLD = MPI_COMM_NULL;
   for (i = 0; i < count; i++) {
-    smpi_group_destroy(smpi_comm_group(process_data[i]->comm_self));
+    smpi_group_unuse(smpi_comm_group(process_data[i]->comm_self));
     smpi_comm_destroy(process_data[i]->comm_self);
     xbt_os_timer_free(process_data[i]->timer);
     simcall_rdv_destroy(process_data[i]->mailbox);
@@ -433,7 +472,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
   fflush(stderr);
 
   if (MC_is_active())
-    MC_modelcheck_safety();
+    MC_do_the_modelcheck_for_real();
   else
     SIMIX_run();
 
index 0222b88..2e0125e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -35,30 +35,58 @@ MPI_Group smpi_group_new(int size)
   group->size = size;
   group->rank_to_index_map = xbt_new(int, size);
   group->index_to_rank_map = xbt_new(int, count);
-  group->refcount = 0;
+  group->refcount = 1;
   for (i = 0; i < size; i++) {
     group->rank_to_index_map[i] = MPI_UNDEFINED;
   }
   for (i = 0; i < count; i++) {
     group->index_to_rank_map[i] = MPI_UNDEFINED;
   }
+
+  return group;
+}
+
+MPI_Group smpi_group_copy(MPI_Group origin)
+{
+  MPI_Group group=origin;
+  int i, count;
+  if(origin!= smpi_comm_group(MPI_COMM_WORLD)
+            && origin != MPI_GROUP_NULL
+            && origin != smpi_comm_group(MPI_COMM_SELF)
+            && origin != MPI_GROUP_EMPTY)
+    {
+      count = smpi_process_count();
+      group = xbt_new(s_smpi_mpi_group_t, 1);
+      group->size = origin->size;
+      group->rank_to_index_map = xbt_new(int, group->size);
+      group->index_to_rank_map = xbt_new(int, count);
+      group->refcount = 1;
+      for (i = 0; i < group->size; i++) {
+        group->rank_to_index_map[i] = origin->rank_to_index_map[i];
+      }
+      for (i = 0; i < count; i++) {
+        group->index_to_rank_map[i] = origin->index_to_rank_map[i];
+      }
+    }
+
   return group;
 }
 
+
 void smpi_group_destroy(MPI_Group group)
 {
-  if (smpi_group_unuse(group) <= 0) {
-    xbt_free(group->rank_to_index_map);
-    xbt_free(group->index_to_rank_map);
-    xbt_free(group);
-  }
+  if(group!= smpi_comm_group(MPI_COMM_WORLD)
+          && group != MPI_GROUP_NULL
+          && group != smpi_comm_group(MPI_COMM_SELF)
+          && group != MPI_GROUP_EMPTY)
+  smpi_group_unuse(group);
 }
 
 void smpi_group_set_mapping(MPI_Group group, int index, int rank)
 {
   if (rank < group->size && index < smpi_process_count()) {
     group->rank_to_index_map[rank] = index;
-    group->index_to_rank_map[index] = rank;
+    if(index!=MPI_UNDEFINED)group->index_to_rank_map[index] = rank;
   }
 }
 
@@ -91,7 +119,14 @@ int smpi_group_use(MPI_Group group)
 int smpi_group_unuse(MPI_Group group)
 {
   group->refcount--;
+  if (group->refcount <= 0) {
+    xbt_free(group->rank_to_index_map);
+    xbt_free(group->index_to_rank_map);
+    xbt_free(group);
+    return 0;
+  }
   return group->refcount;
+
 }
 
 int smpi_group_size(MPI_Group group)
index 266ec5e..e6c5423 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -23,6 +23,11 @@ int MPI_Finalize(void)
   return PMPI_Finalize();
 }
 
+int MPI_Finalized(int * flag)
+{
+  return PMPI_Finalized(flag);
+}
+
 int MPI_Init_thread(int *argc, char ***argv, int required, int *provided)
 {
   return PMPI_Init_thread(argc, argv, required, provided);
@@ -58,11 +63,55 @@ int MPI_Address(void *location, MPI_Aint * address)
   return PMPI_Address(location, address);
 }
 
+int MPI_Get_address(void *location, MPI_Aint * address)
+{
+  return PMPI_Get_address(location, address);
+}
+
 int MPI_Type_free(MPI_Datatype * datatype)
 {
   return PMPI_Type_free(datatype);
 }
 
+int MPI_Type_dup(MPI_Datatype  datatype, MPI_Datatype * newdatatype)
+{
+  return PMPI_Type_dup(datatype, newdatatype);
+}
+
+int MPI_Type_set_name(MPI_Datatype  datatype, char * name)
+{
+  return PMPI_Type_set_name(datatype, name);
+}
+
+int MPI_Type_get_name(MPI_Datatype  datatype, char * name, int* len)
+{
+  return PMPI_Type_get_name(datatype,name,len);
+}
+
+int MPI_Type_get_attr (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag)
+{
+   return PMPI_Type_get_attr ( type, type_keyval, attribute_val, flag);
+}
+
+int MPI_Type_set_attr (MPI_Datatype type, int type_keyval, void *attribute_val)
+{
+   return PMPI_Type_set_attr ( type, type_keyval, attribute_val);
+}
+
+int MPI_Type_delete_attr (MPI_Datatype type, int type_keyval)
+{
+   return PMPI_Type_delete_attr (type,  type_keyval);
+}
+
+int MPI_Type_create_keyval(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state)
+{
+   return PMPI_Type_create_keyval(copy_fn,  delete_fn,  keyval,  extra_state) ;
+}
+
+int MPI_Type_free_keyval(int* keyval) {
+   return PMPI_Type_free_keyval( keyval);
+}
+
 int MPI_Pcontrol(const int level )
 {
   return PMPI_Pcontrol(level);
@@ -78,6 +127,11 @@ int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
   return PMPI_Type_get_extent(datatype, lb, extent);
 }
 
+int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
+{
+  return PMPI_Type_get_true_extent(datatype, lb, extent);
+}
+
 int MPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
 {
   return PMPI_Type_extent(datatype, extent);
@@ -181,6 +235,25 @@ int MPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int
   return PMPI_Comm_get_attr (comm, comm_keyval, attribute_val, flag);
 }
 
+int MPI_Comm_set_attr (MPI_Comm comm, int comm_keyval, void *attribute_val)
+{
+   return PMPI_Comm_set_attr ( comm, comm_keyval, attribute_val);
+}
+
+int MPI_Comm_delete_attr (MPI_Comm comm, int comm_keyval)
+{
+   return PMPI_Comm_delete_attr (comm,  comm_keyval);
+}
+
+int MPI_Comm_create_keyval(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state)
+{
+   return PMPI_Comm_create_keyval(copy_fn,  delete_fn,  keyval,  extra_state) ;
+}
+
+int MPI_Comm_free_keyval(int* keyval) {
+   return PMPI_Comm_free_keyval( keyval);
+}
+
 int MPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
 {
   return PMPI_Comm_get_name(comm, name, len);
@@ -392,6 +465,11 @@ int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
   return PMPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
 }
 
+int MPI_Reduce_local(void *inbuf, void *inoutbuf, int count,
+    MPI_Datatype datatype, MPI_Op op){
+  return PMPI_Reduce_local(inbuf, inoutbuf, count, datatype, op);
+}
+
 int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
                   MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
@@ -410,6 +488,12 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
   return PMPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm);
 }
 
+int MPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
+                      MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+  return PMPI_Reduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm);
+}
+
 int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                  void *recvbuf, int recvcount, MPI_Datatype recvtype,
                  MPI_Comm comm)
@@ -527,6 +611,14 @@ int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
   return PMPI_Errhandler_set(comm, errhandler);
 }
 
+int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) {
+  return PMPI_Errhandler_set(comm, errhandler);
+}
+
+int MPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler* errhandler) {
+  return PMPI_Errhandler_set(comm, errhandler);
+}
+
 int MPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* newtype) {
   return PMPI_Type_contiguous(count, old_type, newtype);
 }
@@ -555,6 +647,18 @@ int MPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcoun
   return PMPI_Unpack(inbuf, insize, position, outbuf, outcount, type, comm);
 }
 
+int MPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size){
+  return PMPI_Pack_external_size(datarep, incount, datatype, size);
+}
+
+int MPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position){
+  return PMPI_Pack_external(datarep, inbuf, incount, datatype, outbuf, outcount, position);
+}
+
+int MPI_Unpack_external( char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype){
+  return PMPI_Unpack_external( datarep, inbuf, insize, position, outbuf, outcount, datatype);
+}
+
 int MPI_Type_commit(MPI_Datatype* datatype) {
   return PMPI_Type_commit(datatype);
 }
@@ -563,6 +667,14 @@ int MPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype
   return PMPI_Type_hindexed(count, blocklens, indices, old_type, newtype);
 }
 
+int MPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  return PMPI_Type_create_hindexed(count, blocklens,indices,old_type,new_type);
+}
+
+int MPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
+  return PMPI_Type_create_hindexed_block(count, blocklength, indices, old_type, newtype);
+}
+
 int MPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
   return PMPI_Type_hvector(count, blocklen, stride, old_type, newtype);
 }
@@ -571,10 +683,22 @@ int MPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_t
   return PMPI_Type_indexed(count, blocklens, indices, old_type, newtype);
 }
 
+int MPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) {
+  return PMPI_Type_create_indexed(count, blocklens, indices, old_type, newtype);
+}
+
+int MPI_Type_create_indexed_block(int count, int blocklength, int* indices,  MPI_Datatype old_type,  MPI_Datatype *newtype){
+  return PMPI_Type_create_indexed_block(count, blocklength, indices, old_type, newtype);
+}
+
 int MPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
   return PMPI_Type_struct(count, blocklens, indices, old_types, newtype);
 }
 
+int MPI_Type_create_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) {
+  return PMPI_Type_create_struct(count, blocklens, indices, old_types, newtype);
+}
+
 int MPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) {
   return PMPI_Type_vector(count, blocklen, stride, old_type, newtype);
 }
@@ -699,7 +823,7 @@ int MPI_Info_create( MPI_Info *info){
   return PMPI_Info_create( info);
 }
 
-int MPI_Info_set( MPI_Info *info, char *key, char *value){
+int MPI_Info_set( MPI_Info info, char *key, char *value){
   return PMPI_Info_set( info, key, value);
 }
 
@@ -712,3 +836,194 @@ int MPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   return PMPI_Get( origin_addr,origin_count, origin_datatype,target_rank,
       target_disp, target_count,target_datatype, win);
 }
+
+int MPI_Type_get_envelope( MPI_Datatype datatype, int *num_integers,
+                          int *num_addresses, int *num_datatypes, int *combiner){
+  return PMPI_Type_get_envelope(  datatype, num_integers,
+      num_addresses, num_datatypes, combiner);
+}
+
+int MPI_Type_get_contents(MPI_Datatype datatype, int max_integers, int max_addresses,
+                            int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses,
+                            MPI_Datatype *array_of_datatypes){
+  return PMPI_Type_get_contents(datatype, max_integers, max_addresses,
+      max_datatypes, array_of_integers, array_of_addresses,
+       array_of_datatypes);
+}
+
+int MPI_Type_create_darray(int size, int rank, int ndims, int* array_of_gsizes,
+                            int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+                            int order, MPI_Datatype oldtype, MPI_Datatype *newtype) {
+  return PMPI_Type_create_darray(size, rank, ndims,  array_of_gsizes,
+       array_of_distribs,  array_of_dargs,  array_of_psizes,
+      order,  oldtype, newtype) ;
+}
+
+int MPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype){
+  return PMPI_Type_create_resized(oldtype,lb, extent, newtype);
+}
+
+int MPI_Type_create_subarray(int ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype *newtype){
+  return PMPI_Type_create_subarray(ndims,array_of_sizes, array_of_subsizes, array_of_starts, order, oldtype, newtype);
+}
+
+int MPI_Type_match_size(int typeclass,int size,MPI_Datatype *datatype){
+  return PMPI_Type_match_size(typeclass,size,datatype);
+}
+
+int MPI_Alltoallw( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes,
+                   void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes,
+                   MPI_Comm comm){
+  return PMPI_Alltoallw( sendbuf, sendcnts, sdispls, sendtypes,
+      recvbuf, recvcnts, rdispls, recvtypes,
+      comm);
+}
+
+int MPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                MPI_Op op, MPI_Comm comm){
+  return PMPI_Exscan(sendbuf, recvbuf, count, datatype, op, comm);
+}
+
+int MPI_Comm_set_name (MPI_Comm comm, char* name){
+  return PMPI_Comm_set_name (comm, name);
+}
+
+int MPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm){
+  return PMPI_Comm_dup_with_info(comm,info,newcomm);
+}
+
+int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm){
+  return PMPI_Comm_split_type(comm, split_type, key, info, newcomm);
+}
+
+int MPI_Comm_set_info (MPI_Comm comm, MPI_Info info){
+  return PMPI_Comm_set_info (comm, info);
+}
+
+int MPI_Comm_get_info (MPI_Comm comm, MPI_Info* info){
+  return PMPI_Comm_get_info (comm, info);
+}
+
+int MPI_Info_get(MPI_Info info,char *key,int valuelen, char *value, int *flag){
+  return PMPI_Info_get(info,key,valuelen, value, flag);
+}
+
+int MPI_Comm_create_errhandler( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler){
+  return PMPI_Comm_create_errhandler( function, errhandler);
+}
+
+int MPI_Add_error_class( int *errorclass){
+  return PMPI_Add_error_class( errorclass);
+}
+
+int MPI_Add_error_code(  int errorclass, int *errorcode){
+  return PMPI_Add_error_code(errorclass, errorcode);
+}
+
+int MPI_Add_error_string( int errorcode, char *string){
+  return PMPI_Add_error_string(errorcode, string);
+}
+
+int MPI_Comm_call_errhandler(MPI_Comm comm,int errorcode){
+  return PMPI_Comm_call_errhandler(comm, errorcode);
+}
+
+int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo){
+  return PMPI_Info_dup(info, newinfo);
+}
+
+int MPI_Info_get_valuelen( MPI_Info info, char *key, int *valuelen, int *flag){
+  return PMPI_Info_get_valuelen( info, key, valuelen, flag);
+}
+
+int MPI_Info_delete(MPI_Info info, char *key){
+  return PMPI_Info_delete(info, key);
+}
+
+int MPI_Info_get_nkeys( MPI_Info info, int *nkeys){
+  return PMPI_Info_get_nkeys(  info, nkeys);
+}
+
+int MPI_Info_get_nthkey( MPI_Info info, int n, char *key){
+  return PMPI_Info_get_nthkey( info, n, key);
+}
+
+int MPI_Get_version (int *version,int *subversion){
+  return PMPI_Get_version (version,subversion);
+}
+
+int MPI_Get_library_version (char *version,int *len){
+  return PMPI_Get_library_version (version,len);
+}
+
+int MPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status){
+  return PMPI_Request_get_status( request, flag, status);
+}
+
+int MPI_Grequest_start( MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request){
+  return PMPI_Grequest_start( query_fn, free_fn, cancel_fn, extra_state, request);
+}
+
+int MPI_Grequest_complete( MPI_Request request){
+  return PMPI_Grequest_complete( request);
+}
+
+int MPI_Status_set_cancelled(MPI_Status *status,int flag){
+  return PMPI_Status_set_cancelled(status,flag);
+}
+
+int MPI_Status_set_elements( MPI_Status *status, MPI_Datatype datatype, int count){
+  return PMPI_Status_set_elements( status, datatype, count);
+}
+
+int MPI_Comm_connect( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm){
+  return PMPI_Comm_connect( port_name, info, root, comm, newcomm);
+}
+
+int MPI_Publish_name( char *service_name, MPI_Info info, char *port_name){
+  return PMPI_Publish_name( service_name, info, port_name);
+}
+
+int MPI_Unpublish_name( char *service_name, MPI_Info info, char *port_name){
+  return PMPI_Unpublish_name( service_name, info, port_name);
+}
+
+int MPI_Lookup_name( char *service_name, MPI_Info info, char *port_name){
+  return PMPI_Lookup_name( service_name, info, port_name);
+}
+
+int MPI_Comm_join( int fd, MPI_Comm *intercomm){
+  return PMPI_Comm_join( fd, intercomm);
+}
+
+int MPI_Open_port( MPI_Info info, char *port_name){
+  return PMPI_Open_port( info,port_name);
+}
+
+int MPI_Close_port( char *port_name){
+  return PMPI_Close_port( port_name);
+}
+
+int MPI_Comm_accept( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm){
+ return PMPI_Comm_accept( port_name, info, root, comm, newcomm);
+}
+
+int MPI_Comm_spawn( char *command, char **argv, int maxprocs, MPI_Info info, int root,
+                    MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){
+  return PMPI_Comm_spawn( command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes);
+}
+
+int MPI_Comm_spawn_multiple( int count, char **array_of_commands, char*** array_of_argv,
+                             int* array_of_maxprocs, MPI_Info* array_of_info, int root,
+                             MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){
+  return PMPI_Comm_spawn_multiple( count, array_of_commands, array_of_argv, array_of_maxprocs,
+                                  array_of_info, root, comm, intercomm, array_of_errcodes);
+}
+
+int MPI_Comm_get_parent( MPI_Comm *parent){
+  return PMPI_Comm_get_parent( parent);
+}
+
+int MPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  return PMPI_Type_create_hvector(count, blocklen, stride, old_type, new_type);
+}
index b233c41..1e47ae2 100644 (file)
@@ -1,7 +1,7 @@
 /* smpi_mpi_dt.c -- MPI primitives to handle datatypes                        */
 /* FIXME: a very incomplete implementation                                    */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,6 +13,8 @@
 
 #include "private.h"
 #include "smpi_mpi_dt_private.h"
+#include "mc/mc.h"
+#include "simgrid/modelchecker.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi_dt, smpi,
                                 "Logging specific to SMPI (datatype)");
@@ -180,9 +182,9 @@ int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
 
       void * buf_tmp = xbt_malloc(count);
 
-      subtype->serialize( sendbuf, buf_tmp,1, subtype);
+      subtype->serialize( sendbuf, buf_tmp,count/smpi_datatype_size(sendtype), subtype);
       subtype =  recvtype->substruct;
-      subtype->unserialize( buf_tmp, recvbuf,1, subtype);
+      subtype->unserialize( buf_tmp, recvbuf,count/smpi_datatype_size(recvtype), subtype);
 
       free(buf_tmp);
     }
@@ -221,6 +223,9 @@ void serialize_vector( const void *noncontiguous_vector,
                                                                      type_c->old_type->substruct);
 
     contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    if((i+1)%type_c->block_count ==0)
+    noncontiguous_vector_char += type_c->block_length*smpi_datatype_get_extent(type_c->old_type);
+    else
     noncontiguous_vector_char += type_c->block_stride*smpi_datatype_get_extent(type_c->old_type);
   }
 }
@@ -255,6 +260,9 @@ void unserialize_vector( const void *contiguous_vector,
                                                                      type_c->block_length,
                                                                      type_c->old_type->substruct);
     contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    if((i+1)%type_c->block_count ==0)
+    noncontiguous_vector_char += type_c->block_length*smpi_datatype_get_extent(type_c->old_type);
+    else
     noncontiguous_vector_char += type_c->block_stride*smpi_datatype_get_extent(type_c->old_type);
   }
 }
@@ -286,13 +294,18 @@ void smpi_datatype_create(MPI_Datatype* new_type, int size,int lb, int ub, int h
                           void *struct_type, int flags){
   MPI_Datatype new_t= xbt_new(s_smpi_mpi_datatype_t,1);
   new_t->size = size;
-  new_t->has_subtype = has_subtype;
+  new_t->has_subtype = size>0? has_subtype:0;
   new_t->lb = lb;
   new_t->ub = ub;
   new_t->flags = flags;
   new_t->substruct = struct_type;
   new_t->in_use=0;
   *new_type = new_t;
+
+#ifdef HAVE_MC
+  if(MC_is_active())
+    MC_ignore(&(new_t->in_use), sizeof(new_t->in_use));
+#endif
 }
 
 void smpi_datatype_free(MPI_Datatype* type){
@@ -315,12 +328,22 @@ void smpi_datatype_free(MPI_Datatype* type){
 
 void smpi_datatype_use(MPI_Datatype type){
   if(type)type->in_use++;
+
+#ifdef HAVE_MC
+  if(MC_is_active())
+    MC_ignore(&(type->in_use), sizeof(type->in_use));
+#endif
 }
 
 
 void smpi_datatype_unuse(MPI_Datatype type){
   if(type && type->in_use-- == 0 && (type->flags & DT_FLAG_DESTROYED))
     smpi_datatype_free(&type);
+  
+#ifdef HAVE_MC
+  if(MC_is_active())
+    MC_ignore(&(type->in_use), sizeof(type->in_use));
+#endif
 }
 
 
@@ -498,6 +521,9 @@ void serialize_hvector( const void *noncontiguous_hvector,
                                                                    type_c->old_type->substruct);
 
     contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    if((i+1)%type_c->block_count ==0)
+    noncontiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    else
     noncontiguous_vector_char += type_c->block_stride;
   }
 }
@@ -531,6 +557,9 @@ void unserialize_hvector( const void *contiguous_vector,
                                                                      type_c->block_length,
                                                                      type_c->old_type->substruct);
     contiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    if((i+1)%type_c->block_count ==0)
+    noncontiguous_vector_char += type_c->block_length*type_c->size_oldtype;
+    else
     noncontiguous_vector_char += type_c->block_stride;
   }
 }
@@ -1448,7 +1477,7 @@ MPI_Op smpi_op_new(MPI_User_function * function, int commute)
 
 int smpi_op_is_commute(MPI_Op op)
 {
-  return op-> is_commute;
+  return (op==MPI_OP_NULL) ? 1 : op-> is_commute;
 }
 
 void smpi_op_destroy(MPI_Op op)
index 23af198..b526a23 100644 (file)
@@ -1,6 +1,6 @@
 /* smpi_mpi_dt_private.h -- functions of smpi_mpi_dt.c that are exported to other SMPI modules. */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 64c66cb..0892c28 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@ void TRACE_smpi_set_category(const char *category)
 int PMPI_Init(int *argc, char ***argv)
 {
   smpi_process_init(argc, argv);
+  smpi_process_mark_as_initialized();
 #ifdef HAVE_TRACING
   int rank = smpi_process_index();
   TRACE_smpi_init(rank);
@@ -50,6 +51,28 @@ int PMPI_Finalize(void)
   return MPI_SUCCESS;
 }
 
+int PMPI_Finalized(int* flag)
+{
+  *flag=smpi_process_finalized();
+  return MPI_SUCCESS;
+}
+
+int PMPI_Get_version (int *version,int *subversion){
+  *version = MPI_VERSION;
+  *subversion= MPI_SUBVERSION;
+  return MPI_SUCCESS;
+}
+
+int PMPI_Get_library_version (char *version,int *len){
+  int retval = MPI_SUCCESS;
+  smpi_bench_end();
+  snprintf(version,MPI_MAX_LIBRARY_VERSION_STRING,"SMPI Version %d.%d. Copyright The Simgrid Team 2007-2013",SIMGRID_VERSION_MAJOR,
+          SIMGRID_VERSION_MINOR);
+  *len = strlen(version) > MPI_MAX_LIBRARY_VERSION_STRING ? MPI_MAX_LIBRARY_VERSION_STRING : strlen(version);
+  smpi_bench_begin();
+  return retval;
+}
+
 int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
 {
   if (provided != NULL) {
@@ -60,7 +83,7 @@ int PMPI_Init_thread(int *argc, char ***argv, int required, int *provided)
 
 int PMPI_Query_thread(int *provided)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (provided == NULL) {
@@ -75,7 +98,7 @@ int PMPI_Query_thread(int *provided)
 
 int PMPI_Is_thread_main(int *flag)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (flag == NULL) {
@@ -104,12 +127,10 @@ int PMPI_Abort(MPI_Comm comm, int errorcode)
 double PMPI_Wtime(void)
 {
   double time;
-
-  smpi_bench_end();
   time = SIMIX_get_clock();
-  smpi_bench_begin();
   return time;
 }
+
 extern double sg_maxmin_precision;
 double PMPI_Wtick(void)
 {
@@ -118,7 +139,7 @@ double PMPI_Wtick(void)
 
 int PMPI_Address(void *location, MPI_Aint * address)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (!address) {
@@ -131,9 +152,14 @@ int PMPI_Address(void *location, MPI_Aint * address)
   return retval;
 }
 
+int PMPI_Get_address(void *location, MPI_Aint * address)
+{
+  return PMPI_Address(location, address);
+}
+
 int PMPI_Type_free(MPI_Datatype * datatype)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (!datatype) {
@@ -148,7 +174,7 @@ int PMPI_Type_free(MPI_Datatype * datatype)
 
 int PMPI_Type_size(MPI_Datatype datatype, int *size)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
@@ -165,7 +191,7 @@ int PMPI_Type_size(MPI_Datatype datatype, int *size)
 
 int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
@@ -179,9 +205,14 @@ int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent
   return retval;
 }
 
+int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent)
+{
+  return PMPI_Type_get_extent(datatype, lb, extent);
+}
+
 int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
@@ -198,7 +229,7 @@ int PMPI_Type_extent(MPI_Datatype datatype, MPI_Aint * extent)
 
 int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
@@ -215,7 +246,7 @@ int PMPI_Type_lb(MPI_Datatype datatype, MPI_Aint * disp)
 
 int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (datatype == MPI_DATATYPE_NULL) {
@@ -232,7 +263,7 @@ int PMPI_Type_ub(MPI_Datatype datatype, MPI_Aint * disp)
 
 int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (function == NULL || op == NULL) {
@@ -247,7 +278,7 @@ int PMPI_Op_create(MPI_User_function * function, int commute, MPI_Op * op)
 
 int PMPI_Op_free(MPI_Op * op)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (op == NULL) {
@@ -265,13 +296,12 @@ int PMPI_Op_free(MPI_Op * op)
 
 int PMPI_Group_free(MPI_Group * group)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (group == NULL) {
     retval = MPI_ERR_ARG;
   } else {
-    if(*group!= smpi_comm_group(MPI_COMM_WORLD))// do not free the group of the comm_world
     smpi_group_destroy(*group);
     *group = MPI_GROUP_NULL;
     retval = MPI_SUCCESS;
@@ -282,7 +312,7 @@ int PMPI_Group_free(MPI_Group * group)
 
 int PMPI_Group_size(MPI_Group group, int *size)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
@@ -299,7 +329,7 @@ int PMPI_Group_size(MPI_Group group, int *size)
 
 int PMPI_Group_rank(MPI_Group group, int *rank)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
@@ -318,14 +348,17 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
                               MPI_Group group2, int *ranks2)
 {
   int retval, i, index;
-
   smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     retval = MPI_ERR_GROUP;
   } else {
     for (i = 0; i < n; i++) {
-      index = smpi_group_index(group1, ranks1[i]);
-      ranks2[i] = smpi_group_rank(group2, index);
+      if(ranks1[i]==MPI_PROC_NULL){
+        ranks2[i]=MPI_PROC_NULL;
+      }else{
+        index = smpi_group_index(group1, ranks1[i]);
+        ranks2[i] = smpi_group_rank(group2, index);
+      }
     }
     retval = MPI_SUCCESS;
   }
@@ -335,7 +368,7 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1,
 
 int PMPI_Group_compare(MPI_Group group1, MPI_Group group2, int *result)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
@@ -384,7 +417,6 @@ int PMPI_Group_union(MPI_Group group1, MPI_Group group2,
         smpi_group_set_mapping(*newgroup, proc2, i);
       }
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -424,7 +456,6 @@ int PMPI_Group_intersection(MPI_Group group1, MPI_Group group2,
         }
       }
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -461,7 +492,6 @@ int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgro
         }
       }
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -482,6 +512,11 @@ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
       *newgroup = MPI_GROUP_EMPTY;
     } else if (n == smpi_group_size(group)) {
       *newgroup = group;
+      if(group!= smpi_comm_group(MPI_COMM_WORLD)
+                && group != MPI_GROUP_NULL
+                && group != smpi_comm_group(MPI_COMM_SELF)
+                && group != MPI_GROUP_EMPTY)
+      smpi_group_use(group);
     } else {
       *newgroup = smpi_group_new(n);
       for (i = 0; i < n; i++) {
@@ -489,7 +524,6 @@ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
         smpi_group_set_mapping(*newgroup, index, i);
       }
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -508,6 +542,11 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
   } else {
     if (n == 0) {
       *newgroup = group;
+      if(group!= smpi_comm_group(MPI_COMM_WORLD)
+                && group != MPI_GROUP_NULL
+                && group != smpi_comm_group(MPI_COMM_SELF)
+                && group != MPI_GROUP_EMPTY)
+      smpi_group_use(group);
     } else if (n == smpi_group_size(group)) {
       *newgroup = MPI_GROUP_EMPTY;
     } else {
@@ -532,7 +571,6 @@ int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
 
       xbt_free(to_exclude);
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -556,28 +594,41 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
       size = 0;
       for (i = 0; i < n; i++) {
         for (rank = ranges[i][0];       /* First */
-             rank >= 0 && rank <= ranges[i][1]; /* Last */
-             rank += ranges[i][2] /* Stride */ ) {
+             rank >= 0; /* Last */
+              ) {
           size++;
+
+          rank += ranges[i][2]; /* Stride */
+         if (ranges[i][0]<ranges[i][1]){
+             if(rank > ranges[i][1])
+               break;
+         }else{
+             if(rank < ranges[i][1])
+               break;
+         }
         }
       }
-      if (size == smpi_group_size(group)) {
-        *newgroup = group;
-      } else {
-        *newgroup = smpi_group_new(size);
-        j = 0;
-        for (i = 0; i < n; i++) {
-          for (rank = ranges[i][0];     /* First */
-               rank >= 0 && rank <= ranges[i][1];       /* Last */
-               rank += ranges[i][2] /* Stride */ ) {
-            index = smpi_group_index(group, rank);
-            smpi_group_set_mapping(*newgroup, index, j);
-            j++;
-          }
+
+      *newgroup = smpi_group_new(size);
+      j = 0;
+      for (i = 0; i < n; i++) {
+        for (rank = ranges[i][0];     /* First */
+             rank >= 0; /* Last */
+             ) {
+          index = smpi_group_index(group, rank);
+          smpi_group_set_mapping(*newgroup, index, j);
+          j++;
+          rank += ranges[i][2]; /* Stride */
+         if (ranges[i][0]<ranges[i][1]){
+           if(rank > ranges[i][1])
+             break;
+         }else{
+           if(rank < ranges[i][1])
+             break;
+         }
         }
       }
     }
-    smpi_group_use(*newgroup);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -587,7 +638,7 @@ int PMPI_Group_range_incl(MPI_Group group, int n, int ranges[][3],
 int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
                          MPI_Group * newgroup)
 {
-  int retval, i, newrank, rank, size, index, add;
+  int retval, i, rank, newrank,oldrank, size, index, add;
 
   smpi_bench_end();
   if (group == MPI_GROUP_NULL) {
@@ -597,41 +648,65 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
   } else {
     if (n == 0) {
       *newgroup = group;
+      if(group!= smpi_comm_group(MPI_COMM_WORLD)
+                && group != MPI_GROUP_NULL
+                && group != smpi_comm_group(MPI_COMM_SELF)
+                && group != MPI_GROUP_EMPTY)
+      smpi_group_use(group);
     } else {
       size = smpi_group_size(group);
       for (i = 0; i < n; i++) {
         for (rank = ranges[i][0];       /* First */
-             rank >= 0 && rank <= ranges[i][1]; /* Last */
-             rank += ranges[i][2] /* Stride */ ) {
+             rank >= 0; /* Last */
+              ) {
           size--;
+
+          rank += ranges[i][2]; /* Stride */
+         if (ranges[i][0]<ranges[i][1]){
+             if(rank > ranges[i][1])
+               break;
+         }else{
+             if(rank < ranges[i][1])
+               break;
+         }
         }
       }
       if (size == 0) {
         *newgroup = MPI_GROUP_EMPTY;
       } else {
         *newgroup = smpi_group_new(size);
-        newrank = 0;
+        newrank=0;
+        oldrank=0;
         while (newrank < size) {
+          add=1;
           for (i = 0; i < n; i++) {
-            add = 1;
-            for (rank = ranges[i][0];   /* First */
-                 rank >= 0 && rank <= ranges[i][1];     /* Last */
-                 rank += ranges[i][2] /* Stride */ ) {
-              if (rank == newrank) {
-                add = 0;
-                break;
+            for (rank = ranges[i][0];rank >= 0;){
+              if(rank==oldrank){
+                  add=0;
+                  break;
+              }
+
+              rank += ranges[i][2]; /* Stride */
+
+              if (ranges[i][0]<ranges[i][1]){
+                  if(rank > ranges[i][1])
+                    break;
+              }else{
+                  if(rank < ranges[i][1])
+                    break;
               }
             }
-            if (add == 1) {
-              index = smpi_group_index(group, newrank);
-              smpi_group_set_mapping(*newgroup, index, newrank);
-            }
           }
-          newrank++; //added to avoid looping, need to be checked ..
+          if(add==1){
+            index = smpi_group_index(group, oldrank);
+            smpi_group_set_mapping(*newgroup, index, newrank);
+            newrank++;
+          }
+          oldrank++;
         }
       }
     }
-    smpi_group_use(*newgroup);
+
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -640,7 +715,7 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3],
 
 int PMPI_Comm_rank(MPI_Comm comm, int *rank)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -657,7 +732,7 @@ int PMPI_Comm_rank(MPI_Comm comm, int *rank)
 
 int PMPI_Comm_size(MPI_Comm comm, int *size)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -674,7 +749,7 @@ int PMPI_Comm_size(MPI_Comm comm, int *size)
 
 int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL)  {
@@ -691,7 +766,7 @@ int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
 
 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -700,6 +775,11 @@ int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
     retval = MPI_ERR_ARG;
   } else {
     *group = smpi_comm_group(comm);
+    if(*group!= smpi_comm_group(MPI_COMM_WORLD)
+              && *group != MPI_GROUP_NULL
+              && *group != smpi_comm_group(MPI_COMM_SELF)
+              && *group != MPI_GROUP_EMPTY)
+    smpi_group_use(*group);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -708,7 +788,7 @@ int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 
 int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm1 == MPI_COMM_NULL || comm2 == MPI_COMM_NULL) {
@@ -734,7 +814,7 @@ int PMPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
 
 int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -751,7 +831,7 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
 
 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -760,7 +840,11 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
     retval = MPI_ERR_GROUP;
   } else if (newcomm == NULL) {
     retval = MPI_ERR_ARG;
-  } else {
+  } else if(smpi_group_rank(group,smpi_process_index())==MPI_UNDEFINED){
+    *newcomm= MPI_COMM_NULL;
+    retval = MPI_SUCCESS;
+  }else{
+
     *newcomm = smpi_comm_new(group);
     retval = MPI_SUCCESS;
   }
@@ -770,7 +854,7 @@ int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
 
 int PMPI_Comm_free(MPI_Comm * comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == NULL) {
@@ -789,7 +873,7 @@ int PMPI_Comm_free(MPI_Comm * comm)
 int PMPI_Comm_disconnect(MPI_Comm * comm)
 {
   /* TODO: wait until all communication in comm are done */
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == NULL) {
@@ -807,7 +891,7 @@ int PMPI_Comm_disconnect(MPI_Comm * comm)
 
 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm_out == NULL) {
@@ -823,9 +907,9 @@ int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
 }
 
 int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
-                  int tag, MPI_Comm comm, MPI_Request * request)
+                   int tag, MPI_Comm comm, MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (request == NULL) {
@@ -839,13 +923,15 @@ int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst,
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
   return retval;
 }
 
 int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
-                  int tag, MPI_Comm comm, MPI_Request * request)
+                   int tag, MPI_Comm comm, MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (request == NULL) {
@@ -853,36 +939,42 @@ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src,
   } else if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (src == MPI_PROC_NULL) {
-      retval = MPI_SUCCESS;
+    retval = MPI_SUCCESS;
   } else {
     *request = smpi_mpi_recv_init(buf, count, datatype, src, tag, comm);
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
   return retval;
 }
 
-int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request) {
-  int retval;
+int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype,
+                    int dst, int tag, MPI_Comm comm, MPI_Request* request)
+{
+  int retval = 0;
 
-    smpi_bench_end();
-    if (request == NULL) {
-      retval = MPI_ERR_ARG;
-    } else if (comm == MPI_COMM_NULL) {
-      retval = MPI_ERR_COMM;
-    } else if (dst == MPI_PROC_NULL) {
-      retval = MPI_SUCCESS;
-    } else {
-      *request = smpi_mpi_ssend_init(buf, count, datatype, dst, tag, comm);
-      retval = MPI_SUCCESS;
-    }
-    smpi_bench_begin();
-    return retval;
+  smpi_bench_end();
+  if (request == NULL) {
+    retval = MPI_ERR_ARG;
+  } else if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (dst == MPI_PROC_NULL) {
+    retval = MPI_SUCCESS;
+  } else {
+    *request = smpi_mpi_ssend_init(buf, count, datatype, dst, tag, comm);
+    retval = MPI_SUCCESS;
+  }
+  smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
+  return retval;
 }
 
 int PMPI_Start(MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (request == NULL || *request == MPI_REQUEST_NULL) {
@@ -897,7 +989,7 @@ int PMPI_Start(MPI_Request * request)
 
 int PMPI_Startall(int count, MPI_Request * requests)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (requests == NULL) {
@@ -912,7 +1004,7 @@ int PMPI_Startall(int count, MPI_Request * requests)
 
 int PMPI_Request_free(MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (*request == MPI_REQUEST_NULL) {
@@ -927,9 +1019,9 @@ int PMPI_Request_free(MPI_Request * request)
 }
 
 int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
-              int tag, MPI_Comm comm, MPI_Request * request)
+               int tag, MPI_Comm comm, MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
 
@@ -953,29 +1045,31 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src,
   } else {
 
 #ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  int src_traced = smpi_group_index(smpi_comm_group(comm), src);
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
+    int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+    int src_traced = smpi_group_index(smpi_comm_group(comm), src);
+    TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, count*smpi_datatype_size(datatype));
 #endif
 
     *request = smpi_mpi_irecv(buf, count, datatype, src, tag, comm);
     retval = MPI_SUCCESS;
 
 #ifdef HAVE_TRACING
-  TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
-  (*request)->recv = 1;
+    TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
+    (*request)->recv = 1;
 #endif
   }
 
   smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
   return retval;
 }
 
 
 int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
-              int tag, MPI_Comm comm, MPI_Request * request)
+               int tag, MPI_Comm comm, MPI_Request * request)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (request == NULL) {
@@ -986,7 +1080,7 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
     *request = MPI_REQUEST_NULL;
     retval = MPI_SUCCESS;
   } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
-    retval = MPI_ERR_COMM;
+    retval = MPI_ERR_RANK;
   } else if (count < 0) {
     retval = MPI_ERR_COUNT;
   } else if (buf==NULL && count > 0) {
@@ -998,29 +1092,33 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst,
   } else {
 
 #ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+    int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+    TRACE_smpi_computing_out(rank);
+    int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
+    TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
 #endif
 
     *request = smpi_mpi_isend(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
 #ifdef HAVE_TRACING
-  TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
-  (*request)->send = 1;
-  TRACE_smpi_computing_in(rank);
+    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    (*request)->send = 1;
+    TRACE_smpi_computing_in(rank);
 #endif
   }
 
   smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
   return retval;
 }
 
-int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request) {
-  int retval;
+int PMPI_Issend(void* buf, int count, MPI_Datatype datatype,
+                int dst, int tag, MPI_Comm comm, MPI_Request* request)
+{
+  int retval = 0;
 
   smpi_bench_end();
   if (request == NULL) {
@@ -1031,7 +1129,7 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
     *request = MPI_REQUEST_NULL;
     retval = MPI_SUCCESS;
   } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
-    retval = MPI_ERR_COMM;
+    retval = MPI_ERR_RANK;
   } else if (count < 0) {
     retval = MPI_ERR_COUNT;
   } else if (buf==NULL && count > 0) {
@@ -1043,31 +1141,33 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
   } else {
 
 #ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+    int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+    TRACE_smpi_computing_out(rank);
+    int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+    TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
+    TRACE_smpi_send(rank, rank, dst_traced, count*smpi_datatype_size(datatype));
 #endif
 
     *request = smpi_mpi_issend(buf, count, datatype, dst, tag, comm);
     retval = MPI_SUCCESS;
 
 #ifdef HAVE_TRACING
-  TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
-  (*request)->send = 1;
-  TRACE_smpi_computing_in(rank);
+    TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+    (*request)->send = 1;
+    TRACE_smpi_computing_in(rank);
 #endif
   }
 
   smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request)
+    *request = MPI_REQUEST_NULL;
   return retval;
 }
 
 int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
              MPI_Comm comm, MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
@@ -1077,7 +1177,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
     status->MPI_SOURCE = MPI_PROC_NULL;
     retval = MPI_SUCCESS;
   } else if (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0)){
-    retval = MPI_ERR_COMM;
+    retval = MPI_ERR_RANK;
   } else if (count < 0) {
     retval = MPI_ERR_COUNT;
   } else if (buf==NULL && count > 0) {
@@ -1091,8 +1191,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   int src_traced = smpi_group_index(smpi_comm_group(comm), src);
   TRACE_smpi_computing_out(rank);
-
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, count*smpi_datatype_size(datatype));
 #endif
 
     smpi_mpi_recv(buf, count, datatype, src, tag, comm, status);
@@ -1114,7 +1213,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
 int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
              MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
 
@@ -1123,7 +1222,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
   } else if (dst == MPI_PROC_NULL) {
     retval = MPI_SUCCESS;
   } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
-    retval = MPI_ERR_COMM;
+    retval = MPI_ERR_RANK;
   } else if (count < 0) {
     retval = MPI_ERR_COUNT;
   } else if (buf==NULL && count > 0) {
@@ -1138,8 +1237,8 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
   int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
+  TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
 #endif
 
     smpi_mpi_send(buf, count, datatype, dst, tag, comm);
@@ -1158,7 +1257,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag,
 
 
 int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
-  int retval;
+  int retval = 0;
 
    smpi_bench_end();
 
@@ -1167,7 +1266,7 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
    } else if (dst == MPI_PROC_NULL) {
      retval = MPI_SUCCESS;
    } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
-     retval = MPI_ERR_COMM;
+     retval = MPI_ERR_RANK;
    } else if (count < 0) {
      retval = MPI_ERR_COUNT;
    } else if (buf==NULL && count > 0) {
@@ -1182,8 +1281,8 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
    int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
    TRACE_smpi_computing_out(rank);
    int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
-   TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-   TRACE_smpi_send(rank, rank, dst_traced);
+   TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
+   TRACE_smpi_send(rank, rank, dst_traced,count*smpi_datatype_size(datatype));
  #endif
 
      smpi_mpi_ssend(buf, count, datatype, dst, tag, comm);
@@ -1204,7 +1303,7 @@ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                  MPI_Datatype recvtype, int src, int recvtag,
                  MPI_Comm comm, MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
 
@@ -1219,7 +1318,7 @@ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
       retval = MPI_SUCCESS;
   }else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0 ||
       (src!=MPI_ANY_SOURCE && (src >= smpi_group_size(smpi_comm_group(comm)) || src <0))){
-    retval = MPI_ERR_COMM;
+    retval = MPI_ERR_RANK;
   } else if (sendcount < 0 || recvcount<0) {
       retval = MPI_ERR_COUNT;
   } else if ((sendbuf==NULL && sendcount > 0)||(recvbuf==NULL && recvcount>0)) {
@@ -1233,8 +1332,8 @@ int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   TRACE_smpi_computing_out(rank);
   int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
   int src_traced = smpi_group_index(smpi_comm_group(comm), src);
-  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, sendcount*smpi_datatype_size(sendtype));
+  TRACE_smpi_send(rank, rank, dst_traced,sendcount*smpi_datatype_size(sendtype));
 #endif
 
 
@@ -1260,7 +1359,7 @@ int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 {
   //TODO: suboptimal implementation
   void *recvbuf;
-  int retval;
+  int retval = 0;
   if (datatype == MPI_DATATYPE_NULL) {
       retval = MPI_ERR_TYPE;
   } else if (count < 0) {
@@ -1282,13 +1381,14 @@ int PMPI_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
 
 int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-  if (request == MPI_REQUEST_NULL || flag == NULL) {
+  if (request == NULL || flag == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*request == MPI_REQUEST_NULL) {
     *flag= TRUE;
+    smpi_empty_status(status);
     retval = MPI_ERR_REQUEST;
   } else {
     *flag = smpi_mpi_test(request, status);
@@ -1301,7 +1401,7 @@ int PMPI_Test(MPI_Request * request, int *flag, MPI_Status * status)
 int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
                 MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (index == NULL || flag == NULL) {
@@ -1316,7 +1416,7 @@ int PMPI_Testany(int count, MPI_Request requests[], int *index, int *flag,
 
 int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* statuses)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (flag == NULL) {
@@ -1330,7 +1430,7 @@ int PMPI_Testall(int count, MPI_Request* requests, int* flag, MPI_Status* status
 }
 
 int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
-  int retval;
+  int retval = 0;
   smpi_bench_end();
 
   if (status == NULL) {
@@ -1351,7 +1451,7 @@ int PMPI_Probe(int source, int tag, MPI_Comm comm, MPI_Status* status) {
 
 
 int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) {
-  int retval;
+  int retval = 0;
   smpi_bench_end();
 
   if (flag == NULL) {
@@ -1361,6 +1461,7 @@ int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* statu
   } else if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (source == MPI_PROC_NULL) {
+    *flag=TRUE;
     smpi_empty_status(status);
     status->MPI_SOURCE = MPI_PROC_NULL;
     retval = MPI_SUCCESS;
@@ -1374,10 +1475,12 @@ int PMPI_Iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* statu
 
 int PMPI_Wait(MPI_Request * request, MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
 
+  smpi_empty_status(status);
+
   if (request == NULL) {
     retval = MPI_ERR_ARG;
   } else if (*request == MPI_REQUEST_NULL) {
@@ -1385,26 +1488,32 @@ int PMPI_Wait(MPI_Request * request, MPI_Status * status)
   } else {
 
 #ifdef HAVE_TRACING
-  int rank = request && (*request)->comm != MPI_COMM_NULL
+    int rank = request && (*request)->comm != MPI_COMM_NULL
       ? smpi_process_index()
       : -1;
-  TRACE_smpi_computing_out(rank);
+    TRACE_smpi_computing_out(rank);
 
-  int src_traced = (*request)->src;
-  int dst_traced = (*request)->dst;
-  int is_wait_for_receive = (*request)->recv;
-  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
+    int src_traced = (*request)->src;
+    int dst_traced = (*request)->dst;
+    MPI_Comm comm = (*request)->comm;
+    int is_wait_for_receive = (*request)->recv;
+    TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__,-1);
 #endif
 
     smpi_mpi_wait(request, status);
     retval = MPI_SUCCESS;
 
 #ifdef HAVE_TRACING
-  TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
-  if (is_wait_for_receive) {
-    TRACE_smpi_recv(rank, src_traced, dst_traced);
-  }
-  TRACE_smpi_computing_in(rank);
+    //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
+    TRACE_smpi_ptp_out(rank, src_traced, dst_traced, __FUNCTION__);
+    if (is_wait_for_receive) {
+      if(src_traced==MPI_ANY_SOURCE)
+        src_traced = (status!=MPI_STATUS_IGNORE) ?
+          smpi_group_rank(smpi_comm_group(comm), status->MPI_SOURCE) :
+          src_traced;
+      TRACE_smpi_recv(rank, src_traced, dst_traced);
+    }
+    TRACE_smpi_computing_in(rank);
 #endif
 
   }
@@ -1415,7 +1524,7 @@ int PMPI_Wait(MPI_Request * request, MPI_Status * status)
 
 int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * status)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
 #ifdef HAVE_TRACING
@@ -1424,18 +1533,21 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
   int *srcs = xbt_new(int, count);
   int *dsts = xbt_new(int, count);
   int *recvs = xbt_new(int, count);
+  MPI_Comm *comms = xbt_new(MPI_Comm, count);
+
   for (i = 0; i < count; i++) {
     MPI_Request req = requests[i];      //already received requests are no longer valid
     if (req) {
       srcs[i] = req->src;
       dsts[i] = req->dst;
       recvs[i] = req->recv;
+      comms[i] = req->comm;
     }
   }
   int rank_traced = smpi_process_index();
   TRACE_smpi_computing_out(rank_traced);
 
-  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,count);
 
 #endif
   if (index == NULL) {
@@ -1447,15 +1559,22 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
 #ifdef HAVE_TRACING
   if(*index!=MPI_UNDEFINED){
     int src_traced = srcs[*index];
+    //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
     int dst_traced = dsts[*index];
     int is_wait_for_receive = recvs[*index];
     if (is_wait_for_receive) {
+      if(srcs[*index]==MPI_ANY_SOURCE)
+        src_traced = (status!=MPI_STATUSES_IGNORE) ?
+                      smpi_group_rank(smpi_comm_group(comms[*index]), status->MPI_SOURCE) :
+                      srcs[*index];
       TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
     }
     TRACE_smpi_ptp_out(rank_traced, src_traced, dst_traced, __FUNCTION__);
     xbt_free(srcs);
     xbt_free(dsts);
     xbt_free(recvs);
+    xbt_free(comms);
+
   }
   TRACE_smpi_computing_in(rank_traced);
 #endif
@@ -1473,35 +1592,52 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
   int *srcs = xbt_new(int, count);
   int *dsts = xbt_new(int, count);
   int *recvs = xbt_new(int, count);
-  int valid_count = 0;
+  int *valid = xbt_new(int, count);
+  MPI_Comm *comms = xbt_new(MPI_Comm, count);
+
+  //int valid_count = 0;
   for (i = 0; i < count; i++) {
     MPI_Request req = requests[i];
     if(req!=MPI_REQUEST_NULL){
-      srcs[valid_count] = req->src;
-      dsts[valid_count] = req->dst;
-      recvs[valid_count] = req->recv;
-      valid_count++;
+      srcs[i] = req->src;
+      dsts[i] = req->dst;
+      recvs[i] = req->recv;
+      comms[i] = req->comm;
+      valid[i]=1;;
+    }else{
+      valid[i]=0;
     }
   }
   int rank_traced = smpi_process_index();
   TRACE_smpi_computing_out(rank_traced);
 
-  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,count);
 #endif
   int retval = smpi_mpi_waitall(count, requests, status);
 #ifdef HAVE_TRACING
-  for (i = 0; i < valid_count; i++) {
-    int src_traced = srcs[i];
-    int dst_traced = dsts[i];
-    int is_wait_for_receive = recvs[i];
-    if (is_wait_for_receive) {
-      TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
+  for (i = 0; i < count; i++) {
+    if(valid[i]){
+    //int src_traced = srcs[*index];
+    //the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
+      int src_traced = srcs[i];
+      int dst_traced = dsts[i];
+      int is_wait_for_receive = recvs[i];
+      if (is_wait_for_receive) {
+        if(src_traced==MPI_ANY_SOURCE)
+        src_traced = (status!=MPI_STATUSES_IGNORE) ?
+                          smpi_group_rank(smpi_comm_group(comms[i]), status[i].MPI_SOURCE) :
+                          srcs[i];
+        TRACE_smpi_recv(rank_traced, src_traced, dst_traced);
+      }
     }
   }
   TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
   xbt_free(srcs);
   xbt_free(dsts);
   xbt_free(recvs);
+  xbt_free(valid);
+  xbt_free(comms);
+
   TRACE_smpi_computing_in(rank_traced);
 #endif
   smpi_bench_begin();
@@ -1511,10 +1647,10 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
 int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
                  int *indices, MPI_Status status[])
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-  if (outcount == NULL || indices == NULL) {
+  if (outcount == NULL) {
     retval = MPI_ERR_ARG;
   } else {
     *outcount = smpi_mpi_waitsome(incount, requests, indices, status);
@@ -1527,10 +1663,10 @@ int PMPI_Waitsome(int incount, MPI_Request requests[], int *outcount,
 int PMPI_Testsome(int incount, MPI_Request requests[], int* outcount,
                  int* indices, MPI_Status status[])
 {
-  int retval;
+  int retval = 0;
 
    smpi_bench_end();
-   if (outcount == NULL || indices == NULL) {
+   if (outcount == NULL) {
      retval = MPI_ERR_ARG;
    } else {
      *outcount = smpi_mpi_testsome(incount, requests, indices, status);
@@ -1543,49 +1679,53 @@ int PMPI_Testsome(int incount, MPI_Request requests[], int* outcount,
 
 int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else {
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
   int root_traced = smpi_group_index(smpi_comm_group(comm), root);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
 #endif
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else {
     mpi_coll_bcast_fun(buf, count, datatype, root, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
 
 int PMPI_Barrier(MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else {
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, smpi_comm_size(comm));
 #endif
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else {
     mpi_coll_barrier_fun(comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1594,29 +1734,44 @@ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                void *recvbuf, int recvcount, MPI_Datatype recvtype,
                int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+            ((smpi_comm_rank(comm) == root) && (recvtype == MPI_DATATYPE_NULL))){
+    retval = MPI_ERR_TYPE;
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) ||
+            ((smpi_comm_rank(comm) == root) && (recvcount <0))){
+    retval = MPI_ERR_COUNT;
+  } else {
+
+    char* sendtmpbuf = (char*) sendbuf;
+    int sendtmpcount = sendcount;
+    MPI_Datatype sendtmptype = sendtype;
+    if( (smpi_comm_rank(comm) == root) && (sendbuf == MPI_IN_PLACE )) {
+      sendtmpcount=0;
+      sendtmptype=recvtype;
+    }
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
   int root_traced = smpi_group_index(smpi_comm_group(comm), root);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,sendcount*smpi_datatype_size(sendtmptype));
 #endif
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
-    retval = MPI_ERR_TYPE;
-  } else {
-    mpi_coll_gather_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+    mpi_coll_gather_fun(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount,
                     recvtype, root, comm);
+
+
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1625,31 +1780,43 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 void *recvbuf, int *recvcounts, int *displs,
                 MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+            ((smpi_comm_rank(comm) == root) && (recvtype == MPI_DATATYPE_NULL))){
     retval = MPI_ERR_TYPE;
+  } else if (( sendbuf != MPI_IN_PLACE) && (sendcount <0)){
+    retval = MPI_ERR_COUNT;
   } else if (recvcounts == NULL || displs == NULL) {
     retval = MPI_ERR_ARG;
   } else {
-    smpi_mpi_gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
+    char* sendtmpbuf = (char*) sendbuf;
+    int sendtmpcount = sendcount;
+    MPI_Datatype sendtmptype = sendtype;
+    if( (smpi_comm_rank(comm) == root) && (sendbuf == MPI_IN_PLACE )) {
+      sendtmpcount=0;
+      sendtmptype=recvtype;
+    }
+
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,sendcount*smpi_datatype_size(sendtmptype));
+#endif
+    smpi_mpi_gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts,
                      displs, recvtype, root, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1658,27 +1825,37 @@ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                   void *recvbuf, int recvcount, MPI_Datatype recvtype,
                   MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+            (recvtype == MPI_DATATYPE_NULL)){
     retval = MPI_ERR_TYPE;
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) ||
+            (recvcount <0)){
+    retval = MPI_ERR_COUNT;
   } else {
+    if(sendbuf == MPI_IN_PLACE) {
+      sendbuf=((char*)recvbuf)+smpi_datatype_get_extent(recvtype)*recvcount*smpi_comm_rank(comm);
+      sendcount=recvcount;
+      sendtype=recvtype;
+    }
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,sendcount*smpi_datatype_size(sendtype));
+#endif
     mpi_coll_allgather_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
                            recvtype, comm);
     retval = MPI_SUCCESS;
-  }
+
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
 #endif
+  }
   smpi_bench_begin();
   return retval;
 }
@@ -1687,30 +1864,40 @@ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                    void *recvbuf, int *recvcounts, int *displs,
                    MPI_Datatype recvtype, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
+  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+            (recvtype == MPI_DATATYPE_NULL)){
     retval = MPI_ERR_TYPE;
+  } else if (( sendbuf != MPI_IN_PLACE) && (sendcount <0)){
+    retval = MPI_ERR_COUNT;
   } else if (recvcounts == NULL || displs == NULL) {
     retval = MPI_ERR_ARG;
   } else {
+
+    if(sendbuf == MPI_IN_PLACE) {
+      sendbuf=((char*)recvbuf)+smpi_datatype_get_extent(recvtype)*displs[smpi_comm_rank(comm)];
+      sendcount=recvcounts[smpi_comm_rank(comm)];
+      sendtype=recvtype;
+    }
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,sendcount*smpi_datatype_size(sendtype));
+#endif
     mpi_coll_allgatherv_fun(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
                         displs, recvtype, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1719,30 +1906,37 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 void *recvbuf, int recvcount, MPI_Datatype recvtype,
                 int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (((smpi_comm_rank(comm)==root) && (sendtype == MPI_DATATYPE_NULL))
+             || ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
+    retval = MPI_ERR_TYPE;
+  } else {
+
+    if (recvbuf == MPI_IN_PLACE) {
+        recvtype=sendtype;
+        recvcount=sendcount;
+    }
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
   int root_traced = smpi_group_index(smpi_comm_group(comm), root);
 
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,sendcount*smpi_datatype_size(recvtype));
 #endif
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
-    retval = MPI_ERR_TYPE;
-  } else {
     mpi_coll_scatter_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount,
                      recvtype, root, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1751,31 +1945,39 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
                  MPI_Datatype sendtype, void *recvbuf, int recvcount,
                  MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (sendtype == MPI_DATATYPE_NULL
-             || recvtype == MPI_DATATYPE_NULL) {
-    retval = MPI_ERR_TYPE;
   } else if (sendcounts == NULL || displs == NULL) {
     retval = MPI_ERR_ARG;
+  } else if (((smpi_comm_rank(comm)==root) && (sendtype == MPI_DATATYPE_NULL))
+             || ((recvbuf !=MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
+    retval = MPI_ERR_TYPE;
   } else {
+    if (recvbuf == MPI_IN_PLACE) {
+        recvtype=sendtype;
+        recvcount=sendcounts[smpi_comm_rank(comm)];
+    }
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
+  int count=0, i;
+  for(i=0; i<smpi_comm_size(comm);i++)count+=sendcounts[i];
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, count*smpi_datatype_size(sendtype));
+#endif
     smpi_mpi_scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
                       recvcount, recvtype, root, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1783,42 +1985,56 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
 int PMPI_Reduce(void *sendbuf, void *recvbuf, int count,
                MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
     retval = MPI_ERR_ARG;
   } else {
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  int root_traced = smpi_group_index(smpi_comm_group(comm), root);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, count*smpi_datatype_size(datatype));
+#endif
     mpi_coll_reduce_fun(sendbuf, recvbuf, count, datatype, op, root, comm);
+
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
-                  MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int PMPI_Reduce_local(void *inbuf, void *inoutbuf, int count,
+    MPI_Datatype datatype, MPI_Op op){
+  int retval = 0;
+
+    smpi_bench_end();
+    if (datatype == MPI_DATATYPE_NULL || op == MPI_OP_NULL) {
+      retval = MPI_ERR_ARG;
+    } else {
+      smpi_op_apply(op, inbuf, inoutbuf, &count, &datatype);
+      retval=MPI_SUCCESS;
+    }
+    smpi_bench_begin();
+    return retval;
+}
+
+int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
+                  MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (datatype == MPI_DATATYPE_NULL) {
@@ -1826,13 +2042,30 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
   } else {
-      mpi_coll_allreduce_fun(sendbuf, recvbuf, count, datatype, op, comm);
+
+    char* sendtmpbuf = (char*) sendbuf;
+    if( sendbuf == MPI_IN_PLACE ) {
+      sendtmpbuf = (char *)xbt_malloc(count*smpi_datatype_get_extent(datatype));
+      smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
+    }
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, count*smpi_datatype_size(datatype));
+#endif
+    mpi_coll_allreduce_fun(sendtmpbuf, recvbuf, count, datatype, op, comm);
+
+    if( sendbuf == MPI_IN_PLACE ) {
+      xbt_free(sendtmpbuf);
+    }
+
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1840,14 +2073,40 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count,
 int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
              MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (datatype == MPI_DATATYPE_NULL) {
+    retval = MPI_ERR_TYPE;
+  } else if (op == MPI_OP_NULL) {
+    retval = MPI_ERR_OP;
+  } else {
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, count*smpi_datatype_size(datatype));
 #endif
+    smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
+    retval = MPI_SUCCESS;
+#ifdef HAVE_TRACING
+  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_computing_in(rank);
+#endif
+  }
+
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                MPI_Op op, MPI_Comm comm){
+  int retval = 0;
+
+  smpi_bench_end();
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (datatype == MPI_DATATYPE_NULL) {
@@ -1855,13 +2114,19 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
   } else {
-    smpi_mpi_scan(sendbuf, recvbuf, count, datatype, op, comm);
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, count*smpi_datatype_size(datatype));
+#endif
+    smpi_mpi_exscan(sendbuf, recvbuf, count, datatype, op, comm);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1869,31 +2134,76 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count,
 int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts,
                        MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
   smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (datatype == MPI_DATATYPE_NULL) {
+    retval = MPI_ERR_TYPE;
+  } else if (op == MPI_OP_NULL) {
+    retval = MPI_ERR_OP;
+  } else if (recvcounts == NULL) {
+    retval = MPI_ERR_ARG;
+  } else {
 #ifdef HAVE_TRACING
   int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  int count=0, i;
+  for(i=0; i<smpi_comm_size(comm);i++)count+=recvcounts[i];
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, count*smpi_datatype_size(datatype));
+#endif
+    void* sendtmpbuf=sendbuf;
+    if(sendbuf==MPI_IN_PLACE){
+      sendtmpbuf=recvbuf;
+    }
+
+    mpi_coll_reduce_scatter_fun(sendtmpbuf, recvbuf, recvcounts,
+                       datatype,  op, comm);
+    retval = MPI_SUCCESS;
+#ifdef HAVE_TRACING
+  TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
+  TRACE_smpi_computing_in(rank);
 #endif
+  }
+
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
+                       MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+  int retval,i;
+  smpi_bench_end();
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else if (op == MPI_OP_NULL) {
     retval = MPI_ERR_OP;
-  } else if (recvcounts == NULL) {
+  } else if (recvcount < 0) {
     retval = MPI_ERR_ARG;
   } else {
-
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, recvcount*smpi_comm_size(comm)*smpi_datatype_size(datatype));
+#endif
+    int count=smpi_comm_size(comm);
+    int* recvcounts=(int*)xbt_malloc(count);
+    for (i=0; i<count;i++)recvcounts[i]=recvcount;
     mpi_coll_reduce_scatter_fun(sendbuf, recvbuf, recvcounts,
                        datatype,  op, comm);
+    xbt_free(recvcounts);
     retval = MPI_SUCCESS;
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1902,26 +2212,28 @@ int PMPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                  void *recvbuf, int recvcount, MPI_Datatype recvtype,
                  MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (sendtype == MPI_DATATYPE_NULL
              || recvtype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else {
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, sendcount*smpi_datatype_size(sendtype));
+#endif
     retval = mpi_coll_alltoall_fun(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -1930,14 +2242,10 @@ int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
                   MPI_Datatype sendtype, void *recvbuf, int *recvcounts,
                   int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
 {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-#ifdef HAVE_TRACING
-  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
-  TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
-#endif
+
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
   } else if (sendtype == MPI_DATATYPE_NULL
@@ -1947,15 +2255,23 @@ int PMPI_Alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
              || recvdisps == NULL) {
     retval = MPI_ERR_ARG;
   } else {
+#ifdef HAVE_TRACING
+  int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+  TRACE_smpi_computing_out(rank);
+  int i, size=0;
+  for(i=0; i< smpi_comm_size(comm);i++)size+=sendcounts[i];
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, size*smpi_datatype_size(sendtype));
+#endif
     retval =
         mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps, sendtype,
                                   recvbuf, recvcounts, recvdisps, recvtype,
                                   comm);
-  }
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
+  }
+
   smpi_bench_begin();
   return retval;
 }
@@ -2003,7 +2319,7 @@ int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
 }
 
 int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
@@ -2018,10 +2334,10 @@ int PMPI_Type_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new_typ
 }
 
 int PMPI_Type_commit(MPI_Datatype* datatype) {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
-  if (datatype == MPI_DATATYPE_NULL) {
+  if (datatype == NULL || *datatype == MPI_DATATYPE_NULL) {
     retval = MPI_ERR_TYPE;
   } else {
     smpi_datatype_commit(datatype);
@@ -2033,7 +2349,7 @@ int PMPI_Type_commit(MPI_Datatype* datatype) {
 
 
 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
@@ -2048,7 +2364,7 @@ int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type,
 }
 
 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
@@ -2062,9 +2378,42 @@ int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old
   return retval;
 }
 
+int PMPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  return MPI_Type_hvector(count, blocklen, stride, old_type, new_type);
+}
 
 int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
+
+  smpi_bench_end();
+  if (old_type == MPI_DATATYPE_NULL) {
+    retval = MPI_ERR_TYPE;
+  } else if (count<0){
+    retval = MPI_ERR_COUNT;
+  } else {
+    retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
+  }
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  int retval = 0;
+
+  smpi_bench_end();
+  if (old_type == MPI_DATATYPE_NULL) {
+    retval = MPI_ERR_TYPE;
+  } else if (count<0){
+    retval = MPI_ERR_COUNT;
+  } else {
+    retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
+  }
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  int retval,i;
 
   smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
@@ -2072,14 +2421,37 @@ int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_
   } else if (count<0){
     retval = MPI_ERR_COUNT;
   } else {
+    int* blocklens=(int*)xbt_malloc(blocklength*count);
+    for (i=0; i<count;i++)blocklens[i]=blocklength;
     retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type);
+    xbt_free(blocklens);
   }
   smpi_bench_begin();
   return retval;
 }
 
+
 int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
+
+  smpi_bench_end();
+  if (old_type == MPI_DATATYPE_NULL) {
+    retval = MPI_ERR_TYPE;
+  } else if (count<0){
+    retval = MPI_ERR_COUNT;
+  } else {
+    retval = smpi_datatype_hindexed(count, blocklens, indices, old_type, new_type);
+  }
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  return PMPI_Type_hindexed(count, blocklens,indices,old_type,new_type);
+}
+
+int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+  int retval,i;
 
   smpi_bench_end();
   if (old_type == MPI_DATATYPE_NULL) {
@@ -2087,7 +2459,10 @@ int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatyp
   } else if (count<0){
     retval = MPI_ERR_COUNT;
   } else {
+    int* blocklens=(int*)xbt_malloc(blocklength*count);
+    for (i=0; i<count;i++)blocklens[i]=blocklength;
     retval = smpi_datatype_hindexed(count, blocklens, indices, old_type, new_type);
+    xbt_free(blocklens);
   }
   smpi_bench_begin();
   return retval;
@@ -2095,7 +2470,7 @@ int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatyp
 
 
 int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type) {
-  int retval;
+  int retval = 0;
 
   smpi_bench_end();
   if (count<0){
@@ -2104,7 +2479,13 @@ int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype*
     retval = smpi_datatype_struct(count, blocklens, indices, old_types, new_type);
   }
   smpi_bench_begin();
-  return retval;}
+  return retval;
+}
+
+int PMPI_Type_create_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type) {
+  return PMPI_Type_struct(count, blocklens, indices, old_types, new_type);
+}
+
 
 int PMPI_Error_class(int errorcode, int* errorclass) {
   // assume smpi uses only standard mpi error codes
@@ -2114,237 +2495,476 @@ int PMPI_Error_class(int errorcode, int* errorclass) {
 
 
 int PMPI_Initialized(int* flag) {
-   *flag=(smpi_process_data()!=NULL);
+   *flag=smpi_process_initialized();
    return MPI_SUCCESS;
 }
 
 /* The following calls are not yet implemented and will fail at runtime. */
 /* Once implemented, please move them above this notice. */
 
-static int not_yet_implemented(void) {
-         XBT_WARN("Not yet implemented");
-   return MPI_SUCCESS;
+#define NOT_YET_IMPLEMENTED {\
+       XBT_WARN("Not yet implemented : %s. Please contact the Simgrid team if support is needed", __FUNCTION__);\
+       return MPI_SUCCESS;\
+        }
+
+
+int PMPI_Type_dup(MPI_Datatype datatype, MPI_Datatype *newtype){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_set_name(MPI_Datatype  datatype, char * name)
+{
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_get_name(MPI_Datatype  datatype, char * name, int* len)
+{
+  NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_map(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_shift(MPI_Comm comm, int direction, int displ, int* source, int* dest) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graph_create(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graph_map(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graph_neighbors(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graph_neighbors_count(MPI_Comm comm, int rank, int* nneighbors) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Graphdims_get(MPI_Comm comm, int* nnodes, int* nedges) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Topo_test(MPI_Comm comm, int* top_type) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Errhandler_free(MPI_Errhandler* errhandler) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Error_string(int errorcode, char* string, int* resultlen) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler) {
+   NOT_YET_IMPLEMENTED
 }
 
+int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler* errhandler) {
+   NOT_YET_IMPLEMENTED
+}
 
 int PMPI_Cancel(MPI_Request* request) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Buffer_attach(void* buffer, int size) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Buffer_detach(void* buffer, int* size) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Comm_test_inter(MPI_Comm comm, int* flag) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Comm_get_attr (MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag)
 {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_set_attr (MPI_Comm comm, int comm_keyval, void *attribute_val)
+{
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_delete_attr (MPI_Comm comm, int comm_keyval)
+{
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_create_keyval(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state)
+{
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_free_keyval(int* keyval) {
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Pcontrol(const int level )
 {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_get_attr (MPI_Datatype type, int type_keyval, void *attribute_val, int* flag)
+{
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_set_attr (MPI_Datatype type, int type_keyval, void *attribute_val)
+{
+  NOT_YET_IMPLEMENTED
 }
 
+int PMPI_Type_delete_attr (MPI_Datatype type, int comm_keyval)
+{
+  NOT_YET_IMPLEMENTED
+}
 
+int PMPI_Type_create_keyval(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state)
+{
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_free_keyval(int* keyval) {
+  NOT_YET_IMPLEMENTED
+}
 
 int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Intercomm_merge(MPI_Comm comm, int high, MPI_Comm* comm_out) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Bsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Bsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Ibsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Comm_remote_group(MPI_Comm comm, MPI_Group* group) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Comm_remote_size(MPI_Comm comm, int* size) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Rsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Rsend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Irsend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Keyval_free(int* keyval) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Test_cancelled(MPI_Status* status, int* flag) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Unpack_external( char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype){
+  NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Get_elements(MPI_Status* status, MPI_Datatype datatype, int* elements) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Win_fence( int assert,  MPI_Win win){
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Win_free( MPI_Win* win){
-   return not_yet_implemented();
+   NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win){
-  return not_yet_implemented();
+  NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Info_create( MPI_Info *info){
-  return not_yet_implemented();
+  NOT_YET_IMPLEMENTED
 }
 
-int PMPI_Info_set( MPI_Info *info, char *key, char *value){
-  return not_yet_implemented();
+int PMPI_Info_set( MPI_Info info, char *key, char *value){
+  NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Info_free( MPI_Info *info){
-  return not_yet_implemented();
+  NOT_YET_IMPLEMENTED
 }
 
 int PMPI_Get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
     MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win){
-  return not_yet_implemented();
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_get_envelope( MPI_Datatype datatype, int *num_integers,
+                          int *num_addresses, int *num_datatypes, int *combiner){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_get_contents(MPI_Datatype datatype, int max_integers, int max_addresses,
+                          int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses,
+                          MPI_Datatype* array_of_datatypes){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_create_darray(int size, int rank, int ndims, int* array_of_gsizes,
+                            int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,
+                            int order, MPI_Datatype oldtype, MPI_Datatype *newtype) {
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_create_subarray(int ndims,int *array_of_sizes, int *array_of_subsizes, int *array_of_starts, int order, MPI_Datatype oldtype, MPI_Datatype *newtype){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Type_match_size(int typeclass,int size,MPI_Datatype *datatype){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Alltoallw( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes,
+                   void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes,
+                   MPI_Comm comm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_set_name(MPI_Comm comm, char* name){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_set_info (MPI_Comm comm, MPI_Info info){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_get_info (MPI_Comm comm, MPI_Info* info){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_get(MPI_Info info,char *key,int valuelen, char *value, int *flag){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_create_errhandler( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Add_error_class( int *errorclass){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Add_error_code(  int errorclass, int *errorcode){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Add_error_string( int errorcode, char *string){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_call_errhandler(MPI_Comm comm,int errorcode){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_delete(MPI_Info info, char *key){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_get_nkeys( MPI_Info info, int *nkeys){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Info_get_valuelen( MPI_Info info, char *key, int *valuelen, int *flag){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Grequest_start( MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn, MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Grequest_complete( MPI_Request request){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Status_set_cancelled(MPI_Status *status,int flag){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Status_set_elements( MPI_Status *status, MPI_Datatype datatype, int count){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_connect( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Publish_name( char *service_name, MPI_Info info, char *port_name){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Unpublish_name( char *service_name, MPI_Info info, char *port_name){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Lookup_name( char *service_name, MPI_Info info, char *port_name){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_join( int fd, MPI_Comm *intercomm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Open_port( MPI_Info info, char *port_name){
+  NOT_YET_IMPLEMENTED
 }
 
+int PMPI_Close_port(char *port_name){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_accept( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_spawn( char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_spawn_multiple( int count, char **array_of_commands, char*** array_of_argv,
+                             int* array_of_maxprocs, MPI_Info* array_of_info, int root,
+                             MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes){
+  NOT_YET_IMPLEMENTED
+}
+
+int PMPI_Comm_get_parent( MPI_Comm *parent){
+  NOT_YET_IMPLEMENTED
+}
index 5991906..fbfb107 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011, 2012. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@ static void log_timed_action (const char *const *action, double clock){
 }
 
 typedef struct {
-  xbt_dynar_t isends; /* of MPI_Request */
   xbt_dynar_t irecvs; /* of MPI_Request */
 } s_smpi_replay_globals_t, *smpi_replay_globals_t;
 
@@ -47,7 +46,7 @@ static double parse_double(const char *string)
 static MPI_Datatype decode_datatype(const char *const action)
 {
 // Declared datatypes,
+
   switch(atoi(action))
   {
     case 0:
@@ -73,7 +72,7 @@ static MPI_Datatype decode_datatype(const char *const action)
       break;
     default:
       MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
-  
+
   }
    return MPI_CURRENT_TYPE;
 }
@@ -83,12 +82,11 @@ static void action_init(const char *const *action)
   int i;
   XBT_DEBUG("Initialize the counters");
   smpi_replay_globals_t globals =  xbt_new(s_smpi_replay_globals_t, 1);
-  globals->isends = xbt_dynar_new(sizeof(MPI_Request),NULL);
   globals->irecvs = xbt_dynar_new(sizeof(MPI_Request),NULL);
 
   if(action[2]) MPI_DEFAULT_TYPE= MPI_DOUBLE; // default MPE dataype 
   else MPI_DEFAULT_TYPE= MPI_BYTE; // default TAU datatype
-  
+
   smpi_process_set_user_data((void*) globals);
 
   /* start a simulated timer */
@@ -98,7 +96,7 @@ static void action_init(const char *const *action)
 
   if (!reqq) {
     reqq=xbt_new0(xbt_dynar_t,active_processes);
-  
+
     for(i=0;i<active_processes;i++){
       reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
     }
@@ -110,9 +108,8 @@ static void action_finalize(const char *const *action)
   smpi_replay_globals_t globals =
       (smpi_replay_globals_t) smpi_process_get_user_data();
   if (globals){
-    XBT_DEBUG("There are %lu isends and %lu irecvs in the dynars",
-         xbt_dynar_length(globals->isends),xbt_dynar_length(globals->irecvs));
-    xbt_dynar_free_container(&(globals->isends));
+    XBT_DEBUG("There are %lu irecvs in the dynar",
+         xbt_dynar_length(globals->irecvs));
     xbt_dynar_free_container(&(globals->irecvs));
   }
   free(globals);
@@ -159,13 +156,13 @@ static void action_send(const char *const *action)
   } else {
     MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
   }
-    
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
   int dst_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), to);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, size*smpi_datatype_size(MPI_CURRENT_TYPE));
+  TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 
   smpi_mpi_send(NULL, size, MPI_CURRENT_TYPE, to , 0, MPI_COMM_WORLD);
@@ -189,25 +186,22 @@ static void action_Isend(const char *const *action)
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
-  smpi_replay_globals_t globals =
-     (smpi_replay_globals_t) smpi_process_get_user_data();
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
   int dst_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), to);
-  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
-  TRACE_smpi_send(rank, rank, dst_traced);
+  TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__, size*smpi_datatype_size(MPI_CURRENT_TYPE));
+  TRACE_smpi_send(rank, rank, dst_traced, size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 
   request = smpi_mpi_isend(NULL, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
-  
+
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
   request->send = 1;
   TRACE_smpi_computing_in(rank);
 #endif
 
-  xbt_dynar_push(globals->isends,&request);
   xbt_dynar_push(reqq[smpi_comm_rank(MPI_COMM_WORLD)],&request);
 
   log_timed_action (action, clock);
@@ -221,13 +215,13 @@ static void action_recv(const char *const *action) {
 
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   int src_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), from);
   TRACE_smpi_computing_out(rank);
 
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 
   smpi_mpi_recv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD, &status);
@@ -250,18 +244,18 @@ static void action_Irecv(const char *const *action)
 
   smpi_replay_globals_t globals =
      (smpi_replay_globals_t) smpi_process_get_user_data();
-  
+
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
 
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   int src_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), from);
-  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank, src_traced, rank, __FUNCTION__, size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 
   request = smpi_mpi_irecv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
-  
+
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
   request->recv = 1;
@@ -293,7 +287,7 @@ static void action_wait(const char *const *action){
   int src_traced = smpi_group_rank(group, request->src);
   int dst_traced = smpi_group_rank(group, request->dst);
   int is_wait_for_receive = request->recv;
-  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__);
+  TRACE_smpi_ptp_in(rank, src_traced, dst_traced, __FUNCTION__, -1);
 #endif
   smpi_mpi_wait(&request, &status);
 #ifdef HAVE_TRACING
@@ -317,14 +311,14 @@ static void action_waitall(const char *const *action){
   if (count_requests>0) {
     MPI_Request requests[count_requests];
     MPI_Status status[count_requests];
-  
+
     /*  The reqq is an array of dynars. Its index corresponds to the rank.
      Thus each rank saves its own requests to the array request. */
     xbt_dynar_foreach(reqq[smpi_comm_rank(MPI_COMM_WORLD)],i,requests[i]); 
-    
+
   #ifdef HAVE_TRACING
    //save information from requests
+
    xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), NULL);
    xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), NULL);
    xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), NULL);
@@ -353,7 +347,7 @@ static void action_waitall(const char *const *action){
    int rank_traced = smpi_process_index();
    TRACE_smpi_computing_out(rank_traced);
 
-   TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__);
+   TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__, count_requests);
   #endif
 
     smpi_mpi_waitall(count_requests, requests, status);
@@ -375,7 +369,7 @@ static void action_waitall(const char *const *action){
    xbt_dynar_free(&recvs);
    TRACE_smpi_computing_in(rank_traced);
   #endif
-   
+
    xbt_dynar_reset(reqq[smpi_comm_rank(MPI_COMM_WORLD)]);
   }
   log_timed_action (action, clock);
@@ -386,7 +380,7 @@ static void action_barrier(const char *const *action){
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, smpi_comm_size(MPI_COMM_WORLD));
 #endif
   smpi_mpi_barrier(MPI_COMM_WORLD);
 #ifdef HAVE_TRACING
@@ -415,12 +409,12 @@ static void action_bcast(const char *const *action)
       MPI_CURRENT_TYPE=decode_datatype(action[4]);   
     }
   }
-  
+
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
   int root_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), 0);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 
   smpi_mpi_bcast(NULL, size, MPI_CURRENT_TYPE, root, MPI_COMM_WORLD);
@@ -439,19 +433,19 @@ static void action_reduce(const char *const *action)
   double clock = smpi_process_simulated_elapsed();
   int root=0;
   MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
   if(action[4]) {
-      root= atoi(action[4]);
-      if(action[5]) {
-       MPI_CURRENT_TYPE=decode_datatype(action[5]);
-      }
+    root= atoi(action[4]);
+    if(action[5]) {
+      MPI_CURRENT_TYPE=decode_datatype(action[5]);
+    }
   }
 
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
   int root_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), 0);
-  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__,comm_size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
    mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, root, MPI_COMM_WORLD);
    smpi_execute_flops(comp_size);
@@ -466,19 +460,19 @@ static void action_reduce(const char *const *action)
 static void action_allReduce(const char *const *action) {
   double comm_size = parse_double(action[2]);
   double comp_size = parse_double(action[3]);
-  
+
   if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
   else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-  
+
   double clock = smpi_process_simulated_elapsed();
 #ifdef HAVE_TRACING
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,comp_size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
-   mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
+  mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
   smpi_execute_flops(comp_size);
-   mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
+  mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
@@ -493,7 +487,7 @@ static void action_allToAll(const char *const *action) {
   int send_size = parse_double(action[2]);
   int recv_size = parse_double(action[3]);
   MPI_Datatype MPI_CURRENT_TYPE2;
-  
+
   if(action[4]) {
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
     MPI_CURRENT_TYPE2=decode_datatype(action[5]);
@@ -508,9 +502,9 @@ static void action_allToAll(const char *const *action) {
 #ifdef HAVE_TRACING
   int rank = smpi_process_index();
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,send_size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
-  
+
   mpi_coll_alltoall_fun(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
 #ifdef HAVE_TRACING
@@ -525,8 +519,6 @@ static void action_allToAll(const char *const *action) {
 
 
 static void action_gather(const char *const *action) {
-  
-  
   /*
  The structure of the gather action for the rank 0 (total 4 processes) 
  is the following:   
@@ -538,7 +530,6 @@ static void action_gather(const char *const *action) {
   3) 0 is the root node
   4) 0 is the send datatype id, see decode_datatype()
   5) 0 is the recv datatype id, see decode_datatype()
-    
   */
   double clock = smpi_process_simulated_elapsed();
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
@@ -552,8 +543,8 @@ static void action_gather(const char *const *action) {
     MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
-  void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));  
-  void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));  
+  void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));
+  void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));
 
   int root=atoi(action[4]);
   int rank = smpi_process_index();
@@ -563,7 +554,7 @@ static void action_gather(const char *const *action) {
 
 #ifdef HAVE_TRACING
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,send_size*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
 smpi_mpi_gather(send, send_size, MPI_CURRENT_TYPE,
                 recv, recv_size, MPI_CURRENT_TYPE2,
@@ -581,7 +572,7 @@ smpi_mpi_gather(send, send_size, MPI_CURRENT_TYPE,
 
 
 static void action_reducescatter(const char *const *action) {
-  
+
     /*
  The structure of the reducescatter action for the rank 0 (total 4 processes) 
  is the following:   
@@ -591,9 +582,9 @@ static void action_reducescatter(const char *const *action) {
   1) The first four values after the name of the action declare the recvcounts array
   2) The value 11346849 is the amount of instructions
   3) The last value corresponds to the datatype, see decode_datatype().
-  
+
   We analyze a MPI_Reduce_scatter call to one MPI_Reduce and one MPI_Scatterv.
-  
+
    */
 
   double clock = smpi_process_simulated_elapsed();
@@ -618,15 +609,15 @@ static void action_reducescatter(const char *const *action) {
 
 #ifdef HAVE_TRACING
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__, recv_sum*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
    mpi_coll_reduce_fun(NULL, NULL, recv_sum, MPI_CURRENT_TYPE, MPI_OP_NULL,
        root, MPI_COMM_WORLD);
    smpi_mpi_scatterv(NULL, recvcounts, disps, MPI_CURRENT_TYPE, NULL,
                       recvcounts[rank], MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
    smpi_execute_flops(comp_size);
-    
-    
+
+
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
@@ -637,23 +628,22 @@ static void action_reducescatter(const char *const *action) {
 
 
 static void action_allgatherv(const char *const *action) {
-  
+
   /*
  The structure of the allgatherv action for the rank 0 (total 4 processes) 
  is the following:   
-0 allGatherV 275427 275427 275427 275427 204020 0 275427 550854 826281 
+0 allGatherV 275427 275427 275427 275427 204020
 
   where: 
   1) 275427 is the sendcount
   2) The next four elements declare the recvcounts array
-  3) The next four values declare the disps array
-  4) No more values mean that the datatype for sent and receive buffer
+  3) No more values mean that the datatype for sent and receive buffer
   is the default one, see decode_datatype().
 
    */
 
   double clock = smpi_process_simulated_elapsed();
-  
+
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
   int i=0;
   int sendcount=atoi(action[2]);
@@ -662,9 +652,9 @@ static void action_allgatherv(const char *const *action) {
   int recv_sum=0;  
   MPI_Datatype MPI_CURRENT_TYPE2;
 
-  if(action[3+2*comm_size]) {
-    MPI_CURRENT_TYPE = decode_datatype(action[3+2*comm_size]);
-    MPI_CURRENT_TYPE2 = decode_datatype(action[4+2*comm_size]);
+  if(action[3+comm_size]) {
+    MPI_CURRENT_TYPE = decode_datatype(action[3+comm_size]);
+    MPI_CURRENT_TYPE2 = decode_datatype(action[4+comm_size]);
   } else {
     MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;    
@@ -674,23 +664,22 @@ static void action_allgatherv(const char *const *action) {
   for(i=0;i<comm_size;i++) {
     recvcounts[i] = atoi(action[i+3]);
     recv_sum=recv_sum+recvcounts[i];
-    disps[i] = atoi(action[i+3+comm_size]);
   }
   void *recvbuf = calloc(recv_sum, smpi_datatype_size(MPI_CURRENT_TYPE2));  
 
 #ifdef HAVE_TRACING
   int rank = MPI_COMM_WORLD != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,sendcount*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
-  
+
 mpi_coll_allgatherv_fun(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcounts, disps, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
 
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
-   
+
   log_timed_action (action, clock);
   xbt_free(sendbuf);
   xbt_free(recvbuf);
@@ -703,21 +692,19 @@ static void action_allToAllv(const char *const *action) {
   /*
  The structure of the allToAllV action for the rank 0 (total 4 processes) 
  is the following:   
-  0 allToAllV 100 1 7 10 12 5 10 20 45 100 1 70 10 5 1 5 77 90
+  0 allToAllV 100 1 7 10 12 100 1 70 10 5
 
   where: 
   1) 100 is the size of the send buffer *sizeof(int),
   2) 1 7 10 12 is the sendcounts array
-  3) 5 10 20 45 is the sdispls array
-  4) 100*sizeof(int) is the size of the receiver buffer
-  5)  1 70 10 5 is the recvcounts array
-  6) 1 5 77 90 is the rdispls array
-    
+  3) 100*sizeof(int) is the size of the receiver buffer
+  4)  1 70 10 5 is the recvcounts array
+
    */
-  
-  
+
+
   double clock = smpi_process_simulated_elapsed();
-  
+
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
   int send_buf_size=0,recv_buf_size=0,i=0;
   int *sendcounts = xbt_new0(int, comm_size);  
@@ -726,42 +713,42 @@ static void action_allToAllv(const char *const *action) {
   int *recvdisps = xbt_new0(int, comm_size);  
 
   MPI_Datatype MPI_CURRENT_TYPE2;
-  
+
   send_buf_size=parse_double(action[2]);
-  recv_buf_size=parse_double(action[3+2*comm_size]);
-  if(action[4+4*comm_size]) {
-    MPI_CURRENT_TYPE=decode_datatype(action[4+4*comm_size]);    
-    MPI_CURRENT_TYPE2=decode_datatype(action[5+4*comm_size]);    
+  recv_buf_size=parse_double(action[3+comm_size]);
+  if(action[4+2*comm_size]) {
+    MPI_CURRENT_TYPE=decode_datatype(action[4+2*comm_size]);
+    MPI_CURRENT_TYPE2=decode_datatype(action[5+2*comm_size]);
   }
   else {
       MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
       MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
-  
+
   void *sendbuf = calloc(send_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE));  
   void *recvbuf = calloc(recv_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE2));  
 
   for(i=0;i<comm_size;i++) {
     sendcounts[i] = atoi(action[i+3]);
-    senddisps[i] = atoi(action[i+3+comm_size]);
-    recvcounts[i] = atoi(action[i+4+2*comm_size]);
-    recvdisps[i] = atoi(action[i+4+3*comm_size]);
+    recvcounts[i] = atoi(action[i+4+comm_size]);
   }
-  
+
 
 #ifdef HAVE_TRACING
   int rank = MPI_COMM_WORLD != MPI_COMM_NULL ? smpi_process_index() : -1;
   TRACE_smpi_computing_out(rank);
-  TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
+  int count=0;
+  for(i=0;i<comm_size;i++) count+=sendcounts[i];
+  TRACE_smpi_collective_in(rank, -1, __FUNCTION__,count*smpi_datatype_size(MPI_CURRENT_TYPE));
 #endif
-    mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps,     MPI_CURRENT_TYPE,
+    mpi_coll_alltoallv_fun(sendbuf, sendcounts, senddisps, MPI_CURRENT_TYPE,
                                recvbuf, recvcounts, recvdisps, MPI_CURRENT_TYPE,
                                MPI_COMM_WORLD);
 #ifdef HAVE_TRACING
   TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
   TRACE_smpi_computing_in(rank);
 #endif
-   
+
   log_timed_action (action, clock);
   xbt_free(sendbuf);
   xbt_free(recvbuf);
@@ -769,8 +756,6 @@ static void action_allToAllv(const char *const *action) {
   xbt_free(recvcounts);
   xbt_free(senddisps);
   xbt_free(recvdisps);
-
-  
 }
 
 void smpi_replay_init(int *argc, char***argv){
index 4b99f2b..0a48d50 100755 (executable)
@@ -25,7 +25,6 @@ foreach my $fortran (@ARGV) {
    die "F2C failed\n" if $?;
    open F2C,"<$output" or die "Unable to open file $output";
    my $started = 0;
-   my $cutext = 0;
    print $tmp "#ifndef INTEGER_STAR_8\n";
    print $tmp "#define INTEGER_STAR_8\n";
    print $tmp "#endif\n";
@@ -52,16 +51,7 @@ foreach my $fortran (@ARGV) {
       if(/\/\* Table of constant values \*\// || /MAIN__/) {
          $started = 0;
       }
-      if(/extern \/\* Subroutine \*\//) {
-         $cutext = 1;
-      }
       $_ =~ s/(mpi_[\w]*_)_/$1/g;
-      if($cutext) {
-         if(/;$/) {
-            $cutext = 0;
-         }
-         next;
-      }
       if(/\/* Main program alias \*\/\s*int\s+.*\s*\(\s*\)\s*{(.*)}/) {
          $_ = "int smpi_simulated_main_(int argc, char** argv) { smpi_process_init(&argc, &argv); $1 }\n";
       }
index 9864551..99bd888 100644 (file)
@@ -1,14 +1,17 @@
 #! /bin/bash
 
-CC=@CMAKE_Fortran_Compiler@
+CC=gfortran
 
 INCLUDEARGS="@includeflag@"
 CMAKE_LINKARGS="-L@libdir@"
 
-FFLAGS="-ff2c "
+FFLAGS="-ff2c  -fno-second-underscore"
 LINKARGS="-lsimgrid -lm -lgfortran"
 main_name=main
-TMPFILE=$(mktemp).f90
+
+declare -a TMPFILES
+trap 'rm -f "${TMPFILES[@]}"' EXIT
+
 CMDLINE=""
 while [ -n "$1" ]; do
   ARG="$1"
@@ -20,12 +23,10 @@ while [ -n "$1" ]; do
       CMDLINE="${CMDLINE} -c "
       ;;
    *.f90|*.F90)
-      SRCFILE="$(readlink -f ${ARG} 2>/dev/null)"
-      if [ -z $SRCFILE ] ; then
-         SRCFILE="$ARG"
-      fi
+      TMPFILE=$(mktemp "${ARG}_XXXXXX.f90")
+      TMPFILES+=( "${TMPFILE}" )
       #replace "program main_name by subroutine user\_main (and the end clause as well)"
-      sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /gI'  ${ARG} > ${TMPFILE}
+      sed 's/[[:space:]]*program[[:space:]]*\([a-zA-Z0-9\-\_]*\)/subroutine user\_main /gI;s/[[:space:]]*use[[:space:]]*mpi/\include \"mpif\.h\" /gI'  ${ARG} > ${TMPFILE}
       SRCFILE="${TMPFILE}"
       CMDLINE="${CMDLINE} ${SRCFILE} "
       ;;
@@ -37,9 +38,5 @@ done
 
 CMDLINE="${CC} ${FFLAGS} ${CMDLINE} ${INCLUDEARGS} ${CMAKE_LINKARGS} ${LINKARGS}"
 
-echo "${CMDLINE}"
+#echo "${CMDLINE}"
 ${CMDLINE}
-
-if [ -f ${TMPFILE} ];then
-  rm ${TMPFILE}
-fi
index b86184b..301802c 100644 (file)
@@ -30,9 +30,11 @@ if [ -n "${SRCFILES}" ]
 then
    for SRCFILE in "${SRCFILES}"
    do
-      CFILE="${SRCFILE%.f}.c"
-      #echo "$prefix/bin/smpif2c ${SRCFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE}"
-      $prefix/bin/smpif2c ${SRCFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE}
+      TMPFILE=${SRCFILE}\_$RANDOM.f
+      cp ${SRCFILE} ${TMPFILE}
+      CFILE="${TMPFILE%.f}.c"
+      #echo "$prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE}"
+      $prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE}
    done
 else
    #echo "$prefix/bin/smpicc ${ARGS}"
index fe58cf0..d550b0a 100644 (file)
@@ -1,6 +1,7 @@
 #include "cpu.hpp"
 
 extern "C" {
+XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
                                 "Logging specific to the SURF cpu module");
 }
@@ -14,11 +15,11 @@ CpuModelPtr surf_cpu_model;
 void CpuModel::updateActionsStateLazy(double now, double delta)
 {
   void *_action;
-  ActionLmmPtr action;
+  CpuActionLmmPtr action;
   while ((xbt_heap_size(p_actionHeap) > 0)
          && (double_equals(xbt_heap_maxkey(p_actionHeap), now))) {
-    action = (ActionLmmPtr) xbt_heap_pop(p_actionHeap);
-    XBT_DEBUG("Something happened to action %p", action);
+    action = dynamic_cast<CpuActionLmmPtr>(static_cast<ActionLmmPtr>(xbt_heap_pop(p_actionHeap)));
+    XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
       CpuPtr cpu = (CpuPtr) lmm_constraint_id(lmm_get_cnst_from_var(p_maxminSystem, action->p_variable, 0));
@@ -30,7 +31,9 @@ void CpuModel::updateActionsStateLazy(double now, double delta)
 #endif
 
     action->m_finish = surf_get_clock();
-    XBT_DEBUG("Action %p finished", action);
+    XBT_CDEBUG(surf_kernel, "Action %p finished", action);
+
+    action->updateEnergy();
 
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     action->m_remains = 0;
@@ -43,7 +46,7 @@ void CpuModel::updateActionsStateLazy(double now, double delta)
     //without losing the event ascending order (considering all CPU's)
     double smaller = -1;
     xbt_swag_foreach(_action, p_runningActionSet) {
-      action = dynamic_cast<ActionLmmPtr>(static_cast<ActionPtr>(_action));
+      action = dynamic_cast<CpuActionLmmPtr>(static_cast<ActionPtr>(_action));
         if (smaller < 0) {
           smaller = action->m_lastUpdate;
           continue;
@@ -63,12 +66,11 @@ void CpuModel::updateActionsStateLazy(double now, double delta)
 void CpuModel::updateActionsStateFull(double now, double delta)
 {
   void *_action, *_next_action;
-  ActionLmmPtr action = NULL;
-  ActionLmmPtr next_action = NULL;
+  CpuActionLmmPtr action = NULL;
   xbt_swag_t running_actions = p_runningActionSet;
 
   xbt_swag_foreach_safe(_action, _next_action, running_actions) {
-    action = dynamic_cast<ActionLmmPtr>(static_cast<ActionPtr>(_action));
+    action = dynamic_cast<CpuActionLmmPtr>(static_cast<ActionPtr>(_action));
 #ifdef HAVE_TRACING
     if (TRACE_is_enabled()) {
       CpuPtr x = (CpuPtr) lmm_constraint_id(lmm_get_cnst_from_var
@@ -101,6 +103,7 @@ void CpuModel::updateActionsStateFull(double now, double delta)
       action->m_finish = surf_get_clock();
       action->setState(SURF_ACTION_DONE);
     }
+    action->updateEnergy();
   }
 
   return;
@@ -144,7 +147,7 @@ void CpuActionLmm::updateRemainingLazy(double now)
   delta = now - m_lastUpdate;
 
   if (m_remains > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %lf, last_update was: %lf", this, m_remains, m_lastUpdate);
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %lf, last_update was: %lf", this, m_remains, m_lastUpdate);
     double_update(&(m_remains), m_lastValue * delta);
 
 #ifdef HAVE_TRACING
@@ -153,7 +156,7 @@ void CpuActionLmm::updateRemainingLazy(double now)
       TRACE_surf_host_set_utilization(cpu->m_name, p_category, m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
 #endif
-    XBT_DEBUG("Updating action(%p): remains is now %lf", this, m_remains);
+    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %lf", this, m_remains);
   }
 
   m_lastUpdate = now;
index 5c69982..b7c5e78 100644 (file)
@@ -46,6 +46,13 @@ public:
   virtual int getCore();
   virtual double getSpeed(double load);
   virtual double getAvailableSpeed();
+
+  virtual double getCurrentPowerPeak()=0;
+  virtual double getPowerPeakAt(int pstate_index)=0;
+  virtual int getNbPstates()=0;
+  virtual void setPowerPeakAt(int pstate_index)=0;
+  virtual double getConsumedEnergy()=0;
+
   void addTraces(void);
   double m_powerPeak;            /*< CPU power peak */
   double m_powerScale;           /*< Percentage of CPU disponible */
@@ -79,6 +86,7 @@ public:
   CpuActionLmm(ModelPtr model, double cost, bool failed)
   : Action(model, cost, failed), ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {};
   void updateRemainingLazy(double now);
+  virtual void updateEnergy()=0;
 };
 
 
diff --git a/src/surf/cpu_cas01.c b/src/surf/cpu_cas01.c
new file mode 100644 (file)
index 0000000..15cf998
--- /dev/null
@@ -0,0 +1,601 @@
+/* Copyright (c) 2009-2013. 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 "surf_private.h"
+#include "surf/surf_resource.h"
+#include "maxmin_private.h"
+#include "simgrid/sg_config.h"
+#include "cpu_cas01_private.h"
+
+#include "string.h"
+#include "stdlib.h"
+
+surf_model_t surf_cpu_model = NULL;
+
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
+                                "Logging specific to the SURF CPU IMPROVED module");
+
+static xbt_swag_t
+    cpu_running_action_set_that_does_not_need_being_checked = NULL;
+
+/* Additionnal callback function to cleanup some data, called from surf_resource_free */
+
+static void cpu_cas01_cleanup(void* r){
+  cpu_Cas01_t cpu = (cpu_Cas01_t)r;
+  unsigned int iter;
+  xbt_dynar_t power_tuple = NULL;
+  xbt_dynar_foreach(cpu->energy->power_range_watts_list, iter, power_tuple)
+    xbt_dynar_free(&power_tuple);
+  xbt_dynar_free(&cpu->energy->power_range_watts_list);
+  xbt_dynar_free(&cpu->power_peak_list);
+  xbt_free(cpu->energy);
+  return;
+}
+
+/* This function is registered as a callback to sg_platf_new_host() and never called directly */
+static void *cpu_create_resource(const char *name, xbt_dynar_t power_peak,
+                                                                int pstate,
+                                 double power_scale,
+                                 tmgr_trace_t power_trace,
+                                 int core,
+                                 e_surf_resource_state_t state_initial,
+                                 tmgr_trace_t state_trace,
+                                 xbt_dict_t cpu_properties)
+{
+  cpu_Cas01_t cpu = NULL;
+
+  xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
+             "Host '%s' declared several times in the platform file",
+             name);
+  cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
+                                        surf_cpu_model, name,
+                                        cpu_properties,  &cpu_cas01_cleanup);
+  cpu->power_peak = xbt_dynar_get_as(power_peak, pstate, double);
+  cpu->power_peak_list = power_peak;
+  cpu->pstate = pstate;
+
+  cpu->energy = xbt_new(s_energy_cpu_cas01_t, 1);
+  cpu->energy->total_energy = 0;
+  cpu->energy->power_range_watts_list = cpu_get_watts_range_list(cpu);
+  cpu->energy->last_updated = surf_get_clock();
+
+  XBT_DEBUG("CPU create: peak=%f, pstate=%d",cpu->power_peak, cpu->pstate);
+
+  xbt_assert(cpu->power_peak > 0, "Power has to be >0");
+  cpu->power_scale = power_scale;
+  cpu->core = core;
+  xbt_assert(core > 0, "Invalid number of cores %d", core);
+
+  if (power_trace)
+    cpu->power_event =
+        tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
+
+  cpu->state_current = state_initial;
+  if (state_trace)
+    cpu->state_event =
+        tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
+
+  cpu->constraint =
+      lmm_constraint_new(surf_cpu_model->model_private->maxmin_system, cpu,
+                         cpu->core * cpu->power_scale * cpu->power_peak);
+
+  xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+
+  return xbt_lib_get_elm_or_null(host_lib, name);;
+}
+
+
+static void parse_cpu_init(sg_platf_host_cbarg_t host)
+{
+  cpu_create_resource(host->id,
+                      host->power_peak,
+                      host->pstate,
+                      host->power_scale,
+                      host->power_trace,
+                      host->core_amount,
+                      host->initial_state,
+                      host->state_trace, host->properties);
+}
+
+static void cpu_add_traces_cpu(void)
+{
+  xbt_dict_cursor_t cursor = NULL;
+  char *trace_name, *elm;
+  static int called = 0;
+  if (called)
+    return;
+  called = 1;
+
+  /* connect all traces relative to hosts */
+  xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
+
+    xbt_assert(host, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    host->state_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, host);
+  }
+
+  xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
+
+    xbt_assert(host, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    host->power_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, host);
+  }
+}
+
+static void cpu_define_callbacks()
+{
+  sg_platf_host_add_cb(parse_cpu_init);
+  sg_platf_postparse_add_cb(cpu_add_traces_cpu);
+}
+
+static int cpu_resource_used(void *resource)
+{
+  return lmm_constraint_used(surf_cpu_model->model_private->maxmin_system,
+                             ((cpu_Cas01_t) resource)->constraint);
+}
+
+static double cpu_share_resources_lazy(double now)
+{
+  return generic_share_resources_lazy(now, surf_cpu_model);
+}
+
+static double cpu_share_resources_full(double now)
+{
+  s_surf_action_cpu_Cas01_t action;
+  return generic_maxmin_share_resources(surf_cpu_model->states.
+                                        running_action_set,
+                                        xbt_swag_offset(action,
+                                                        generic_lmm_action.
+                                                        variable),
+                                        surf_cpu_model->model_private->maxmin_system, lmm_solve);
+}
+
+static void cpu_update_actions_state_lazy(double now, double delta)
+{
+  generic_update_actions_state_lazy(now, delta, surf_cpu_model);
+}
+
+static void cpu_update_actions_state_full(double now, double delta)
+{
+  generic_update_actions_state_full(now, delta, surf_cpu_model);
+}
+
+xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model)
+{
+       xbt_dynar_t power_range_list;
+       xbt_dynar_t power_tuple;
+       int i = 0, pstate_nb=0;
+       xbt_dynar_t current_power_values;
+       double min_power, max_power;
+       xbt_dict_t props = cpu_model->generic_resource.properties;
+
+       if (props == NULL)
+               return NULL;
+
+       char* all_power_values_str = xbt_dict_get_or_null(props, "power_per_state");
+
+       if (all_power_values_str == NULL)
+               return NULL;
+
+
+       power_range_list = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
+       xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
+
+       pstate_nb = xbt_dynar_length(all_power_values);
+       for (i=0; i< pstate_nb; i++)
+       {
+               /* retrieve the power values associated with the current pstate */
+               current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
+               xbt_assert(xbt_dynar_length(current_power_values) > 1,
+                               "Power properties incorrectly defined - could not retrieve min and max power values for host %s",
+                               cpu_model->generic_resource.name);
+
+               /* min_power corresponds to the idle power (cpu load = 0) */
+               /* max_power is the power consumed at 100% cpu load       */
+               min_power = atof(xbt_dynar_get_as(current_power_values, 0, char*));
+               max_power = atof(xbt_dynar_get_as(current_power_values, 1, char*));
+
+               power_tuple = xbt_dynar_new(sizeof(double), NULL);
+               xbt_dynar_push_as(power_tuple, double, min_power);
+               xbt_dynar_push_as(power_tuple, double, max_power);
+
+               xbt_dynar_push_as(power_range_list, xbt_dynar_t, power_tuple);
+               xbt_dynar_free(&current_power_values);
+       }
+       xbt_dynar_free(&all_power_values);
+       return power_range_list;
+
+}
+
+/**
+ * Computes the power consumed by the host according to the current pstate and processor load
+ *
+ */
+static double cpu_get_current_watts_value(cpu_Cas01_t cpu_model, double cpu_load)
+{
+       xbt_dynar_t power_range_list = cpu_model->energy->power_range_watts_list;
+
+       if (power_range_list == NULL)
+       {
+               XBT_DEBUG("No power range properties specified for host %s", cpu_model->generic_resource.name);
+               return 0;
+       }
+       xbt_assert(xbt_dynar_length(power_range_list) == xbt_dynar_length(cpu_model->power_peak_list),
+                                               "The number of power ranges in the properties does not match the number of pstates for host %s",
+                                               cpu_model->generic_resource.name);
+
+    /* retrieve the power values associated with the current pstate */
+    xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, cpu_model->pstate, xbt_dynar_t);
+
+    /* min_power corresponds to the idle power (cpu load = 0) */
+    /* max_power is the power consumed at 100% cpu load       */
+    double min_power = xbt_dynar_get_as(current_power_values, 0, double);
+    double max_power = xbt_dynar_get_as(current_power_values, 1, double);
+    double power_slope = max_power - min_power;
+
+    double current_power = min_power + cpu_load * power_slope;
+
+       XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope);
+    XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load);
+
+       return current_power;
+
+}
+
+/**
+ * Updates the total energy consumed as the sum of the current energy and
+ *                                              the energy consumed by the current action
+ */
+void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load)
+{
+
+  double start_time = cpu_model->energy->last_updated;
+  double finish_time = surf_get_clock();
+
+  XBT_DEBUG("[cpu_update_energy] action time interval=(%f-%f), current power peak=%f, current pstate=%d",
+                 start_time, finish_time, cpu_model->power_peak, cpu_model->pstate);
+  double current_energy = cpu_model->energy->total_energy;
+  double action_energy = cpu_get_current_watts_value(cpu_model, cpu_load)*(finish_time-start_time);
+
+  cpu_model->energy->total_energy = current_energy + action_energy;
+  cpu_model->energy->last_updated = finish_time;
+
+  XBT_DEBUG("[cpu_update_energy] old_energy_value=%f, action_energy_value=%f", current_energy, action_energy);
+
+}
+
+static void cpu_update_resource_state(void *id,
+                                      tmgr_trace_event_t event_type,
+                                      double value, double date)
+{
+  cpu_Cas01_t cpu = id;
+  lmm_variable_t var = NULL;
+  lmm_element_t elem = NULL;
+
+  if (event_type == cpu->power_event) {
+    cpu->power_scale = value;
+    lmm_update_constraint_bound(surf_cpu_model->model_private->maxmin_system, cpu->constraint,
+                                cpu->core * cpu->power_scale *
+                                cpu->power_peak);
+#ifdef HAVE_TRACING
+    TRACE_surf_host_set_power(date, cpu->generic_resource.name,
+                              cpu->core * cpu->power_scale *
+                              cpu->power_peak);
+#endif
+    while ((var = lmm_get_var_from_cnst
+            (surf_cpu_model->model_private->maxmin_system, cpu->constraint, &elem))) {
+      surf_action_cpu_Cas01_t action = lmm_variable_id(var);
+      lmm_update_variable_bound(surf_cpu_model->model_private->maxmin_system,
+                                GENERIC_LMM_ACTION(action).variable,
+                                cpu->power_scale * cpu->power_peak);
+    }
+    if (tmgr_trace_event_free(event_type))
+      cpu->power_event = NULL;
+  } else if (event_type == cpu->state_event) {
+    if (value > 0) {
+      if(cpu->state_current == SURF_RESOURCE_OFF)
+        xbt_dynar_push_as(host_that_restart, char*, (cpu->generic_resource.name));
+      cpu->state_current = SURF_RESOURCE_ON;
+    } else {
+      lmm_constraint_t cnst = cpu->constraint;
+
+      cpu->state_current = SURF_RESOURCE_OFF;
+
+      while ((var = lmm_get_var_from_cnst(surf_cpu_model->model_private->maxmin_system, cnst, &elem))) {
+        surf_action_t action = lmm_variable_id(var);
+
+        if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
+            surf_action_state_get(action) == SURF_ACTION_READY ||
+            surf_action_state_get(action) ==
+            SURF_ACTION_NOT_IN_THE_SYSTEM) {
+          action->finish = date;
+          surf_action_state_set(action, SURF_ACTION_FAILED);
+        }
+      }
+    }
+    if (tmgr_trace_event_free(event_type))
+      cpu->state_event = NULL;
+  } else {
+    XBT_CRITICAL("Unknown event ! \n");
+    xbt_abort();
+  }
+
+  return;
+}
+
+static surf_action_t cpu_execute(void *cpu, double size)
+{
+  surf_action_cpu_Cas01_t action = NULL;
+  //xbt_dict_cursor_t cursor = NULL;
+  cpu_Cas01_t CPU = surf_cpu_resource_priv(cpu);
+  //xbt_dict_t props = CPU->generic_resource.properties;
+
+  XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
+  action =
+      surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
+                      surf_cpu_model,
+                      CPU->state_current != SURF_RESOURCE_ON);
+
+  GENERIC_LMM_ACTION(action).suspended = 0;     /* Should be useless because of the
+                                                   calloc but it seems to help valgrind... */
+
+  GENERIC_LMM_ACTION(action).variable =
+      lmm_variable_new(surf_cpu_model->model_private->maxmin_system, action,
+                       GENERIC_ACTION(action).priority,
+                       CPU->power_scale * CPU->power_peak, 1);
+  if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
+    GENERIC_LMM_ACTION(action).index_heap = -1;
+    GENERIC_LMM_ACTION(action).last_update = surf_get_clock();
+    GENERIC_LMM_ACTION(action).last_value = 0.0;
+  }
+
+  lmm_expand(surf_cpu_model->model_private->maxmin_system, CPU->constraint,
+             GENERIC_LMM_ACTION(action).variable, 1.0);
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static surf_action_t cpu_action_sleep(void *cpu, double duration)
+{
+  surf_action_cpu_Cas01_t action = NULL;
+
+  if (duration > 0)
+    duration = MAX(duration, MAXMIN_PRECISION);
+
+  XBT_IN("(%s,%g)", surf_resource_name(surf_cpu_resource_priv(cpu)), duration);
+  action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
+  // FIXME: sleep variables should not consume 1.0 in lmm_expand
+  GENERIC_ACTION(action).max_duration = duration;
+  GENERIC_LMM_ACTION(action).suspended = 2;
+  if (duration == NO_MAX_DURATION) {
+    /* Move to the *end* of the corresponding action set. This convention
+       is used to speed up update_resource_state  */
+    xbt_swag_remove(action, ((surf_action_t) action)->state_set);
+    ((surf_action_t) action)->state_set =
+        cpu_running_action_set_that_does_not_need_being_checked;
+    xbt_swag_insert(action, ((surf_action_t) action)->state_set);
+  }
+
+  lmm_update_variable_weight(surf_cpu_model->model_private->maxmin_system,
+                             GENERIC_LMM_ACTION(action).variable, 0.0);
+  if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {     // remove action from the heap
+    surf_action_lmm_heap_remove(surf_cpu_model->model_private->action_heap,(surf_action_lmm_t)action);
+    // this is necessary for a variable with weight 0 since such
+    // variables are ignored in lmm and we need to set its max_duration
+    // correctly at the next call to share_resources
+    xbt_swag_insert_at_head(action,surf_cpu_model->model_private->modified_set);
+  }
+
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static e_surf_resource_state_t cpu_get_state(void *cpu)
+{
+  return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->state_current;
+}
+
+static double cpu_get_speed(void *cpu, double load)
+{
+  return load * ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak;
+}
+
+static int cpu_get_core(void *cpu)
+{
+  return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->core;
+}
+
+
+static double cpu_get_available_speed(void *cpu)
+{
+  /* number between 0 and 1 */
+  return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_scale;
+}
+
+static double cpu_get_current_power_peak(void *cpu)
+{
+  return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak;
+}
+
+static double cpu_get_power_peak_at(void *cpu, int pstate_index)
+{
+  xbt_dynar_t plist = ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak_list;
+  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+
+  return xbt_dynar_get_as(plist, pstate_index, double);
+}
+
+static int cpu_get_nb_pstates(void *cpu)
+{
+  return xbt_dynar_length(((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak_list);
+}
+
+static void cpu_set_power_peak_at(void *cpu, int pstate_index)
+{
+  cpu_Cas01_t cpu_implem = (cpu_Cas01_t)surf_cpu_resource_priv(cpu);
+  xbt_dynar_t plist = cpu_implem->power_peak_list;
+  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+
+  double new_power_peak = xbt_dynar_get_as(plist, pstate_index, double);
+  cpu_implem->pstate = pstate_index;
+  cpu_implem->power_peak = new_power_peak;
+}
+
+static double cpu_get_consumed_energy(void *cpu)
+{
+  return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->energy->total_energy;
+}
+
+static void cpu_finalize(void)
+{
+  lmm_system_free(surf_cpu_model->model_private->maxmin_system);
+  surf_cpu_model->model_private->maxmin_system = NULL;
+
+  if (surf_cpu_model->model_private->action_heap)
+    xbt_heap_free(surf_cpu_model->model_private->action_heap);
+  xbt_swag_free(surf_cpu_model->model_private->modified_set);
+
+  surf_model_exit(surf_cpu_model);
+  surf_cpu_model = NULL;
+
+  xbt_swag_free(cpu_running_action_set_that_does_not_need_being_checked);
+  cpu_running_action_set_that_does_not_need_being_checked = NULL;
+}
+
+static void surf_cpu_model_init_internal()
+{
+  s_surf_action_t action;
+  s_surf_action_cpu_Cas01_t comp;
+
+  char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
+  int select =
+      xbt_cfg_get_boolean(_sg_cfg_set, "cpu/maxmin_selective_update");
+
+  surf_cpu_model = surf_model_init();
+
+  if (!strcmp(optim, "Full")) {
+    surf_cpu_model->model_private->update_mechanism = UM_FULL;
+    surf_cpu_model->model_private->selective_update = select;
+  } else if (!strcmp(optim, "Lazy")) {
+    surf_cpu_model->model_private->update_mechanism = UM_LAZY;
+    surf_cpu_model->model_private->selective_update = 1;
+    xbt_assert((select == 1)
+               ||
+               (xbt_cfg_is_default_value
+                (_sg_cfg_set, "cpu/maxmin_selective_update")),
+               "Disabling selective update while using the lazy update mechanism is dumb!");
+  } else {
+    xbt_die("Unsupported optimization (%s) for this model", optim);
+  }
+
+  cpu_running_action_set_that_does_not_need_being_checked =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+
+  surf_cpu_model->name = "cpu";
+
+  surf_cpu_model->action_unref = surf_action_unref;
+  surf_cpu_model->action_cancel = surf_action_cancel;
+  surf_cpu_model->action_state_set = surf_action_state_set;
+
+  surf_cpu_model->model_private->resource_used = cpu_resource_used;
+
+  if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
+    surf_cpu_model->model_private->share_resources =
+        cpu_share_resources_lazy;
+    surf_cpu_model->model_private->update_actions_state =
+        cpu_update_actions_state_lazy;
+  } else if (surf_cpu_model->model_private->update_mechanism == UM_FULL) {
+    surf_cpu_model->model_private->share_resources =
+        cpu_share_resources_full;
+    surf_cpu_model->model_private->update_actions_state =
+        cpu_update_actions_state_full;
+  } else
+    xbt_die("Invalid cpu update mechanism!");
+
+  surf_cpu_model->model_private->update_resource_state =
+      cpu_update_resource_state;
+  surf_cpu_model->model_private->finalize = cpu_finalize;
+
+  surf_cpu_model->suspend = surf_action_suspend;
+  surf_cpu_model->resume = surf_action_resume;
+  surf_cpu_model->is_suspended = surf_action_is_suspended;
+  surf_cpu_model->set_max_duration = surf_action_set_max_duration;
+  surf_cpu_model->set_priority = surf_action_set_priority;
+#ifdef HAVE_TRACING
+  surf_cpu_model->set_category = surf_action_set_category;
+#endif
+  surf_cpu_model->get_remains = surf_action_get_remains;
+
+  surf_cpu_model->extension.cpu.execute = cpu_execute;
+  surf_cpu_model->extension.cpu.sleep = cpu_action_sleep;
+
+  surf_cpu_model->extension.cpu.get_state = cpu_get_state;
+  surf_cpu_model->extension.cpu.get_core = cpu_get_core;
+  surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
+  surf_cpu_model->extension.cpu.get_available_speed =
+      cpu_get_available_speed;
+  surf_cpu_model->extension.cpu.get_current_power_peak = cpu_get_current_power_peak;
+  surf_cpu_model->extension.cpu.get_power_peak_at = cpu_get_power_peak_at;
+  surf_cpu_model->extension.cpu.get_nb_pstates = cpu_get_nb_pstates;
+  surf_cpu_model->extension.cpu.set_power_peak_at = cpu_set_power_peak_at;
+  surf_cpu_model->extension.cpu.get_consumed_energy = cpu_get_consumed_energy;
+
+  surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
+
+  if (!surf_cpu_model->model_private->maxmin_system) {
+    surf_cpu_model->model_private->maxmin_system = lmm_system_new(surf_cpu_model->model_private->selective_update);
+  }
+  if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
+    surf_cpu_model->model_private->action_heap = xbt_heap_new(8, NULL);
+    xbt_heap_set_update_callback(surf_cpu_model->model_private->action_heap,
+        surf_action_lmm_update_index_heap);
+    surf_cpu_model->model_private->modified_set =
+        xbt_swag_new(xbt_swag_offset(comp, generic_lmm_action.action_list_hookup));
+    surf_cpu_model->model_private->maxmin_system->keep_track = surf_cpu_model->model_private->modified_set;
+  }
+}
+
+/*********************************************************************/
+/* Basic sharing model for CPU: that is where all this started... ;) */
+/*********************************************************************/
+/* @InProceedings{casanova01simgrid, */
+/*   author =       "H. Casanova", */
+/*   booktitle =    "Proceedings of the IEEE Symposium on Cluster Computing */
+/*                  and the Grid (CCGrid'01)", */
+/*   publisher =    "IEEE Computer Society", */
+/*   title =        "Simgrid: {A} Toolkit for the Simulation of Application */
+/*                  Scheduling", */
+/*   year =         "2001", */
+/*   month =        may, */
+/*   note =         "Available at */
+/*                  \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
+/* } */
+
+void surf_cpu_model_init_Cas01()
+{
+  char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
+
+  if (surf_cpu_model)
+    return;
+
+  if (!strcmp(optim, "TI")) {
+    surf_cpu_model_init_ti();
+    return;
+  }
+
+  surf_cpu_model_init_internal();
+  cpu_define_callbacks();
+  xbt_dynar_push(model_list, &surf_cpu_model);
+}
index 6b5f1b8..61e1e9e 100644 (file)
@@ -11,7 +11,7 @@
 #include "simgrid/sg_config.h"
 
 extern "C" {
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu,
                                 "Logging specific to the SURF CPU IMPROVED module");
 }
 
@@ -124,6 +124,7 @@ void CpuCas01Model::parseInit(sg_platf_host_cbarg_t host)
 {
   createResource(host->id,
         host->power_peak,
+        host->pstate,
         host->power_scale,
         host->power_trace,
         host->core_amount,
@@ -132,7 +133,8 @@ void CpuCas01Model::parseInit(sg_platf_host_cbarg_t host)
         host->properties);
 }
 
-CpuCas01LmmPtr CpuCas01Model::createResource(const char *name, double power_peak, double power_scale,
+CpuCas01LmmPtr CpuCas01Model::createResource(const char *name, xbt_dynar_t power_peak,
+                                 int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           tmgr_trace_t state_trace,
@@ -145,7 +147,7 @@ CpuCas01LmmPtr CpuCas01Model::createResource(const char *name, double power_peak
   xbt_assert(power_peak > 0, "Power has to be >0");
   xbt_assert(core > 0, "Invalid number of cores %d", core);
 
-  cpu = new CpuCas01Lmm(this, name, power_peak, power_scale, power_trace, core, state_initial, state_trace, cpu_properties);
+  cpu = new CpuCas01Lmm(this, name, power_peak, pstate, power_scale, power_trace, core, state_initial, state_trace, cpu_properties);
   xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast<ResourcePtr>(cpu));
 
   return (CpuCas01LmmPtr) xbt_lib_get_elm_or_null(host_lib, name);
@@ -193,12 +195,22 @@ void CpuCas01Model::addTraces()
 /************
  * Resource *
  ************/
-CpuCas01Lmm::CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, double powerPeak,
-        double powerScale, tmgr_trace_t powerTrace, int core,
+CpuCas01Lmm::CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, xbt_dynar_t powerPeak,
+               int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) :
        CpuLmm(model, name, properties), Resource(model, name, properties) {
-  m_powerPeak = powerPeak;
+  m_powerPeak = xbt_dynar_get_as(powerPeak, pstate, double);
+  p_powerPeakList = powerPeak;
+  m_pstate = pstate;
+
+  p_energy = xbt_new(s_energy_cpu_cas01_t, 1);
+  p_energy->total_energy = 0;
+  p_energy->power_range_watts_list = getWattsRangeList();
+  p_energy->last_updated = surf_get_clock();
+
+  XBT_DEBUG("CPU create: peak=%f, pstate=%d", m_powerPeak, m_pstate);
+
   m_powerScale = powerScale;
   m_core = core;
   p_stateCurrent = stateInitial;
@@ -211,6 +223,17 @@ CpuCas01Lmm::CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, double powerP
   p_constraint = lmm_constraint_new(p_model->p_maxminSystem, this, m_core * m_powerScale * m_powerPeak);
 }
 
+CpuCas01Lmm::~CpuCas01Lmm(){
+  unsigned int iter;
+  xbt_dynar_t power_tuple = NULL;
+  xbt_dynar_foreach(p_energy->power_range_watts_list, iter, power_tuple)
+    xbt_dynar_free(&power_tuple);
+  xbt_dynar_free(&p_energy->power_range_watts_list);
+  xbt_dynar_free(&p_powerPeakList);
+  xbt_free(p_energy);
+  return;
+}
+
 bool CpuCas01Lmm::isUsed()
 {
   return lmm_constraint_used(p_model->p_maxminSystem, p_constraint);
@@ -221,8 +244,6 @@ void CpuCas01Lmm::updateState(tmgr_trace_event_t event_type, double value, doubl
   lmm_variable_t var = NULL;
   lmm_element_t elem = NULL;
 
-  surf_watched_hosts();
-
   if (event_type == p_powerEvent) {
     m_powerScale = value;
     lmm_update_constraint_bound(surf_cpu_model->p_maxminSystem, p_constraint,
@@ -244,9 +265,11 @@ void CpuCas01Lmm::updateState(tmgr_trace_event_t event_type, double value, doubl
     if (tmgr_trace_event_free(event_type))
       p_powerEvent = NULL;
   } else if (event_type == p_stateEvent) {
-    if (value > 0)
+    if (value > 0) {
+      if(p_stateCurrent == SURF_RESOURCE_OFF)
+        xbt_dynar_push_as(host_that_restart, char*, (char *)m_name);
       p_stateCurrent = SURF_RESOURCE_ON;
-    else {
+    else {
       lmm_constraint_t cnst = p_constraint;
 
       p_stateCurrent = SURF_RESOURCE_OFF;
@@ -329,9 +352,154 @@ ActionPtr CpuCas01Lmm::sleep(double duration)
   return action;
 }
 
+xbt_dynar_t CpuCas01Lmm::getWattsRangeList()
+{
+       xbt_dynar_t power_range_list;
+       xbt_dynar_t power_tuple;
+       int i = 0, pstate_nb=0;
+       xbt_dynar_t current_power_values;
+       double min_power, max_power;
+
+       if (m_properties == NULL)
+               return NULL;
+
+       char* all_power_values_str = (char*)xbt_dict_get_or_null(m_properties, "power_per_state");
+
+       if (all_power_values_str == NULL)
+               return NULL;
+
+
+       power_range_list = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
+       xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
+
+       pstate_nb = xbt_dynar_length(all_power_values);
+       for (i=0; i< pstate_nb; i++)
+       {
+               /* retrieve the power values associated with the current pstate */
+               current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
+               xbt_assert(xbt_dynar_length(current_power_values) > 1,
+                               "Power properties incorrectly defined - could not retrieve min and max power values for host %s",
+                               m_name);
+
+               /* min_power corresponds to the idle power (cpu load = 0) */
+               /* max_power is the power consumed at 100% cpu load       */
+               min_power = atof(xbt_dynar_get_as(current_power_values, 0, char*));
+               max_power = atof(xbt_dynar_get_as(current_power_values, 1, char*));
+
+               power_tuple = xbt_dynar_new(sizeof(double), NULL);
+               xbt_dynar_push_as(power_tuple, double, min_power);
+               xbt_dynar_push_as(power_tuple, double, max_power);
+
+               xbt_dynar_push_as(power_range_list, xbt_dynar_t, power_tuple);
+               xbt_dynar_free(&current_power_values);
+       }
+       xbt_dynar_free(&all_power_values);
+       return power_range_list;
+}
+
+/**
+ * Computes the power consumed by the host according to the current pstate and processor load
+ *
+ */
+double CpuCas01Lmm::getCurrentWattsValue(double cpu_load)
+{
+       xbt_dynar_t power_range_list = p_energy->power_range_watts_list;
+
+       if (power_range_list == NULL)
+       {
+               XBT_DEBUG("No power range properties specified for host %s", m_name);
+               return 0;
+       }
+       xbt_assert(xbt_dynar_length(power_range_list) == xbt_dynar_length(p_powerPeakList),
+                                               "The number of power ranges in the properties does not match the number of pstates for host %s",
+                                               m_name);
+
+    /* retrieve the power values associated with the current pstate */
+    xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, m_pstate, xbt_dynar_t);
+
+    /* min_power corresponds to the idle power (cpu load = 0) */
+    /* max_power is the power consumed at 100% cpu load       */
+    double min_power = xbt_dynar_get_as(current_power_values, 0, double);
+    double max_power = xbt_dynar_get_as(current_power_values, 1, double);
+    double power_slope = max_power - min_power;
+
+    double current_power = min_power + cpu_load * power_slope;
+
+       XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope);
+    XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load);
+
+       return current_power;
+}
+
+/**
+ * Updates the total energy consumed as the sum of the current energy and
+ *                                              the energy consumed by the current action
+ */
+void CpuCas01Lmm::updateEnergy(double cpu_load)
+{
+  double start_time = p_energy->last_updated;
+  double finish_time = surf_get_clock();
+
+  XBT_DEBUG("[cpu_update_energy] action time interval=(%f-%f), current power peak=%f, current pstate=%d",
+                 start_time, finish_time, m_powerPeak, m_pstate);
+  double current_energy = p_energy->total_energy;
+  double action_energy = getCurrentWattsValue(cpu_load)*(finish_time-start_time);
+
+  p_energy->total_energy = current_energy + action_energy;
+  p_energy->last_updated = finish_time;
+
+  XBT_DEBUG("[cpu_update_energy] old_energy_value=%f, action_energy_value=%f", current_energy, action_energy);
+}
+
+double CpuCas01Lmm::getCurrentPowerPeak()
+{
+  return m_powerPeak;
+}
+
+double CpuCas01Lmm::getPowerPeakAt(int pstate_index)
+{
+  xbt_dynar_t plist = p_powerPeakList;
+  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+
+  return xbt_dynar_get_as(plist, pstate_index, double);
+}
+
+int CpuCas01Lmm::getNbPstates()
+{
+  return xbt_dynar_length(p_powerPeakList);
+}
+
+void CpuCas01Lmm::setPowerPeakAt(int pstate_index)
+{
+  xbt_dynar_t plist = p_powerPeakList;
+  xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
+
+  double new_power_peak = xbt_dynar_get_as(plist, pstate_index, double);
+  m_pstate = pstate_index;
+  m_powerPeak = new_power_peak;
+}
+
+double CpuCas01Lmm::getConsumedEnergy()
+{
+  return p_energy->total_energy;
+}
 
 /**********
  * Action *
  **********/
 
+/**
+ * Update the CPU total energy for a finished action
+ *
+ */
+void CpuCas01ActionLmm::updateEnergy()
+{
+  CpuCas01LmmPtr cpu  = static_cast<CpuCas01LmmPtr>(lmm_constraint_id(lmm_get_cnst_from_var
+                                                                                 (p_model->p_maxminSystem,
+                                                                                                 p_variable, 0)));
 
+  if(cpu->p_energy->last_updated < surf_get_clock()) {
+       double load = lmm_constraint_get_usage(cpu->p_constraint) / cpu->m_powerPeak;
+    cpu->updateEnergy(load);
+  }
+}
index 779a350..5e12cc2 100644 (file)
@@ -24,7 +24,8 @@ public:
   void (CpuCas01Model::*updateActionsState)(double now, double delta);
 
   void parseInit(sg_platf_host_cbarg_t host);  
-  CpuCas01LmmPtr createResource(const char *name, double power_peak, double power_scale,
+  CpuCas01LmmPtr createResource(const char *name, xbt_dynar_t power_peak, int pstate,
+                                 double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           tmgr_trace_t state_trace,
@@ -36,19 +37,43 @@ public:
 /************
  * Resource *
  ************/
+/*
+ * Energy-related properties for the cpu_cas01 model
+ */
+typedef struct energy_cpu_cas01 {
+       xbt_dynar_t power_range_watts_list;             /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
+       double total_energy;                                    /*< Total energy consumed by the host */
+       double last_updated;                                    /*< Timestamp of the last energy update event*/
+} s_energy_cpu_cas01_t, *energy_cpu_cas01_t;
+
 class CpuCas01Lmm : public CpuLmm {
 public:
-  CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, double powerPeak,
-        double powerScale, tmgr_trace_t powerTrace, int core,
+  CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, xbt_dynar_t power_peak,
+        int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
+  ~CpuCas01Lmm();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
   ActionPtr execute(double size);
   ActionPtr sleep(double duration);
 
+  xbt_dynar_t getWattsRangeList();
+  double getCurrentWattsValue(double cpu_load);
+  void updateEnergy(double cpu_load);
+
+  double getCurrentPowerPeak();
+  double getPowerPeakAt(int pstate_index);
+  int getNbPstates();
+  void setPowerPeakAt(int pstate_index);
+  double getConsumedEnergy();
+
   bool isUsed();
 
   tmgr_trace_event_t p_powerEvent;
+
+  xbt_dynar_t p_powerPeakList;                         /*< List of supported CPU capacities */
+  int m_pstate;                                                                /*< Current pstate (index in the power_peak_list)*/
+  energy_cpu_cas01_t p_energy;                         /*< Structure with energy-consumption data */
 };
 
 /**********
@@ -58,5 +83,6 @@ class CpuCas01ActionLmm: public CpuActionLmm {
 public:
   CpuCas01ActionLmm() {};
   CpuCas01ActionLmm(ModelPtr model, double cost, bool failed): Action(model, cost, failed), CpuActionLmm(model, cost, failed) {};
+  void updateEnergy();
 
 };
diff --git a/src/surf/cpu_cas01_private.h b/src/surf/cpu_cas01_private.h
new file mode 100644 (file)
index 0000000..cb13350
--- /dev/null
@@ -0,0 +1,53 @@
+
+/* Copyright (c) 2009-2010, 2013. 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 _SURF_CPU_CAS01_PRIVATE_H
+#define _SURF_CPU_CAS01_PRIVATE_H
+
+#undef GENERIC_LMM_ACTION
+#undef GENERIC_ACTION
+#undef ACTION_GET_CPU
+#define GENERIC_LMM_ACTION(action) action->generic_lmm_action
+#define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
+#define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_t) action)->cpu
+
+typedef struct surf_action_cpu_cas01 {
+  s_surf_action_lmm_t generic_lmm_action;
+} s_surf_action_cpu_Cas01_t, *surf_action_cpu_Cas01_t;
+
+
+/*
+ * Energy-related properties for the cpu_cas01 model
+ */
+typedef struct energy_cpu_cas01 {
+       xbt_dynar_t power_range_watts_list;             /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
+       double total_energy;                                    /*< Total energy consumed by the host */
+       double last_updated;                                    /*< Timestamp of the last energy update event*/
+} s_energy_cpu_cas01_t, *energy_cpu_cas01_t;
+
+
+typedef struct cpu_Cas01 {
+  s_surf_resource_t generic_resource;
+  s_xbt_swag_hookup_t modified_cpu_hookup;
+  double power_peak;
+  double power_scale;
+  tmgr_trace_event_t power_event;
+  int core;
+  e_surf_resource_state_t state_current;
+  tmgr_trace_event_t state_event;
+  lmm_constraint_t constraint;
+
+  xbt_dynar_t power_peak_list;                         /*< List of supported CPU capacities */
+  int pstate;                                                          /*< Current pstate (index in the power_peak_list)*/
+  energy_cpu_cas01_t energy;                           /*< Structure with energy-consumption data */
+
+} s_cpu_Cas01_t, *cpu_Cas01_t;
+
+xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model);
+void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load);
+
+#endif                          /* _SURF_CPU_CAS01_PRIVATE_H */
diff --git a/src/surf/cpu_ti.c b/src/surf/cpu_ti.c
new file mode 100644 (file)
index 0000000..b14ceec
--- /dev/null
@@ -0,0 +1,1099 @@
+
+/* Copyright (c) 2009-2013. 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. */
+
+/*
+  commit: e2d6799c4182f00443b3013aadb1c2412372460f
+  This commit retrieves the old implementation of CPU_TI with multi-levels.
+*/
+
+#include "surf_private.h"
+#include "trace_mgr_private.h"
+#include "cpu_ti_private.h"
+#include "xbt/heap.h"
+#include "surf/surf_resource.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf,
+                                "Logging specific to the SURF CPU TRACE INTEGRATION module");
+
+
+static xbt_swag_t
+    cpu_ti_running_action_set_that_does_not_need_being_checked = NULL;
+static xbt_swag_t cpu_ti_modified_cpu = NULL;
+static xbt_heap_t cpu_ti_action_heap;
+
+/* prototypes of new trace functions */
+static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace,
+                                          double a, double b);
+
+
+static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
+                                      double amount);
+static double surf_cpu_ti_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t
+                                                      trace, double a,
+                                                      double amount);
+
+static void surf_cpu_ti_free_tmgr(surf_cpu_ti_tgmr_t trace);
+
+static double surf_cpu_ti_integrate_trace_simple(surf_cpu_ti_trace_t trace,
+                                                 double a, double b);
+static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t
+                                                       trace, double a);
+static double surf_cpu_ti_solve_trace_simple(surf_cpu_ti_trace_t trace,
+                                             double a, double amount);
+static int surf_cpu_ti_binary_search(double *array, double a, int low,
+                                     int high);
+/* end prototypes */
+
+static void surf_cpu_ti_free_trace(surf_cpu_ti_trace_t trace)
+{
+  xbt_free(trace->time_points);
+  xbt_free(trace->integral);
+  xbt_free(trace);
+}
+
+static void surf_cpu_ti_free_tmgr(surf_cpu_ti_tgmr_t trace)
+{
+  if (trace->trace)
+    surf_cpu_ti_free_trace(trace->trace);
+  xbt_free(trace);
+}
+
+static surf_cpu_ti_trace_t surf_cpu_ti_trace_new(tmgr_trace_t power_trace)
+{
+  surf_cpu_ti_trace_t trace;
+  s_tmgr_event_t val;
+  unsigned int cpt;
+  double integral = 0;
+  double time = 0;
+  int i = 0;
+  trace = xbt_new0(s_surf_cpu_ti_trace_t, 1);
+  trace->time_points =
+      xbt_malloc0(sizeof(double) *
+                  (xbt_dynar_length(power_trace->s_list.event_list) + 1));
+  trace->integral =
+      xbt_malloc0(sizeof(double) *
+                  (xbt_dynar_length(power_trace->s_list.event_list) + 1));
+  trace->nb_points = xbt_dynar_length(power_trace->s_list.event_list);
+  xbt_dynar_foreach(power_trace->s_list.event_list, cpt, val) {
+    trace->time_points[i] = time;
+    trace->integral[i] = integral;
+    integral += val.delta * val.value;
+    time += val.delta;
+    i++;
+  }
+  trace->time_points[i] = time;
+  trace->integral[i] = integral;
+  return trace;
+}
+
+/**
+* \brief Creates a new integration trace from a tmgr_trace_t
+*
+* \param  power_trace    CPU availability trace
+* \param  value          Percentage of CPU power available (useful to fixed tracing)
+* \param  spacing        Initial spacing
+* \return  Integration trace structure
+*/
+static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
+                                             double value)
+{
+  surf_cpu_ti_tgmr_t trace;
+  double total_time = 0.0;
+  s_tmgr_event_t val;
+  unsigned int cpt;
+  trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
+
+/* no availability file, fixed trace */
+  if (!power_trace) {
+    trace->type = TRACE_FIXED;
+    trace->value = value;
+    XBT_DEBUG("No availability trace. Constant value = %f", value);
+    return trace;
+  }
+
+  /* only one point available, fixed trace */
+  if (xbt_dynar_length(power_trace->s_list.event_list) == 1) {
+    xbt_dynar_get_cpy(power_trace->s_list.event_list, 0, &val);
+    trace->type = TRACE_FIXED;
+    trace->value = val.value;
+    return trace;
+  }
+
+  trace->type = TRACE_DYNAMIC;
+  trace->power_trace = power_trace;
+
+  /* count the total time of trace file */
+  xbt_dynar_foreach(power_trace->s_list.event_list, cpt, val) {
+    total_time += val.delta;
+  }
+  trace->trace = surf_cpu_ti_trace_new(power_trace);
+  trace->last_time = total_time;
+  trace->total =
+      surf_cpu_ti_integrate_trace_simple(trace->trace, 0, total_time);
+
+  XBT_DEBUG("Total integral %f, last_time %f ",
+         trace->total, trace->last_time);
+
+  return trace;
+}
+
+
+static void* cpu_ti_create_resource(const char *name, xbt_dynar_t power_peak,
+                                                  int pstate,
+                           double power_scale,
+                           tmgr_trace_t power_trace,
+                           int core,
+                           e_surf_resource_state_t state_initial,
+                           tmgr_trace_t state_trace,
+                           xbt_dict_t cpu_properties)
+{
+  tmgr_trace_t empty_trace;
+  s_tmgr_event_t val;
+  cpu_ti_t cpu = NULL;
+  s_surf_action_cpu_ti_t ti_action;
+  xbt_assert(core==1,"Multi-core not handled with this model yet");
+  xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
+              "Host '%s' declared several times in the platform file",
+              name);
+  xbt_assert(core==1,"Multi-core not handled with this model yet");
+  cpu = (cpu_ti_t) surf_resource_new(sizeof(s_cpu_ti_t),
+          surf_cpu_model, name,cpu_properties, NULL);
+  cpu->action_set =
+      xbt_swag_new(xbt_swag_offset(ti_action, cpu_list_hookup));
+
+  xbt_dynar_get_cpy(power_peak, 0, &cpu->power_peak);
+  xbt_dynar_free(&power_peak);  /* kill memory leak */
+  //cpu->power_peak = power_peak;
+  cpu->pstate = pstate;
+  XBT_DEBUG("CPU create: peak=%f, pstate=%d",cpu->power_peak, cpu->pstate);
+
+  xbt_assert(cpu->power_peak > 0, "Power has to be >0");
+  XBT_DEBUG("power scale %f", power_scale);
+  cpu->power_scale = power_scale;
+  cpu->avail_trace = cpu_ti_parse_trace(power_trace, power_scale);
+  cpu->state_current = state_initial;
+  if (state_trace)
+    cpu->state_event =
+        tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
+  if (power_trace && xbt_dynar_length(power_trace->s_list.event_list) > 1) {
+    /* add a fake trace event if periodicity == 0 */
+    xbt_dynar_get_cpy(power_trace->s_list.event_list,
+                      xbt_dynar_length(power_trace->s_list.event_list) - 1, &val);
+    if (val.delta == 0) {
+      empty_trace = tmgr_empty_trace_new();
+      cpu->power_event =
+          tmgr_history_add_trace(history, empty_trace,
+                                 cpu->avail_trace->last_time, 0, cpu);
+    }
+  }
+  xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
+
+  return xbt_lib_get_elm_or_null(host_lib, name);
+}
+
+
+static void parse_cpu_ti_init(sg_platf_host_cbarg_t host)
+{
+  cpu_ti_create_resource(host->id,
+        host->power_peak,
+        host->pstate,
+        host->power_scale,
+        host->power_trace,
+        host->core_amount,
+        host->initial_state,
+        host->state_trace,
+        host->properties);
+
+}
+
+static void add_traces_cpu_ti(void)
+{
+  xbt_dict_cursor_t cursor = NULL;
+  char *trace_name, *elm;
+
+  static int called = 0;
+
+  if (called)
+    return;
+  called = 1;
+
+/* connect all traces relative to hosts */
+  xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_ti_t cpu = surf_cpu_resource_priv(surf_cpu_resource_by_name(elm));
+
+    xbt_assert(cpu, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    if (cpu->state_event) {
+      XBT_DEBUG("Trace already configured for this CPU(%s), ignoring it",
+             elm);
+      continue;
+    }
+    XBT_DEBUG("Add state trace: %s to CPU(%s)", trace_name, elm);
+    cpu->state_event = tmgr_history_add_trace(history, trace, 0.0, 0, cpu);
+  }
+
+  xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_ti_t cpu = surf_cpu_resource_priv(surf_cpu_resource_by_name(elm));
+
+    xbt_assert(cpu, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    XBT_DEBUG("Add power trace: %s to CPU(%s)", trace_name, elm);
+    if (cpu->avail_trace)
+      surf_cpu_ti_free_tmgr(cpu->avail_trace);
+
+    cpu->avail_trace = cpu_ti_parse_trace(trace, cpu->power_scale);
+
+    /* add a fake trace event if periodicity == 0 */
+    if (trace && xbt_dynar_length(trace->s_list.event_list) > 1) {
+      s_tmgr_event_t val;
+      xbt_dynar_get_cpy(trace->s_list.event_list,
+                        xbt_dynar_length(trace->s_list.event_list) - 1, &val);
+      if (val.delta == 0) {
+        tmgr_trace_t empty_trace;
+        empty_trace = tmgr_empty_trace_new();
+        cpu->power_event =
+            tmgr_history_add_trace(history, empty_trace,
+                                   cpu->avail_trace->last_time, 0, cpu);
+      }
+    }
+  }
+}
+
+static void cpu_ti_define_callbacks()
+{
+  sg_platf_host_add_cb(parse_cpu_ti_init);
+  sg_platf_postparse_add_cb(add_traces_cpu_ti);
+}
+
+static int cpu_ti_resource_used(void *resource_id)
+{
+  cpu_ti_t cpu = resource_id;
+  return xbt_swag_size(cpu->action_set);
+}
+
+static int cpu_ti_action_unref(surf_action_t action)
+{
+  action->refcount--;
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+    /* remove from action_set */
+    xbt_swag_remove(action, ((cpu_ti_t)surf_cpu_resource_priv(ACTION_GET_CPU(action)))->action_set);
+    /* remove from heap */
+    xbt_heap_remove(cpu_ti_action_heap,
+                    ((surf_action_cpu_ti_t) action)->index_heap);
+    xbt_swag_insert(((cpu_ti_t)surf_cpu_resource_priv(ACTION_GET_CPU(action))), cpu_ti_modified_cpu);
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+static void cpu_ti_action_cancel(surf_action_t action)
+{
+  surf_action_state_set(action, SURF_ACTION_FAILED);
+  xbt_heap_remove(cpu_ti_action_heap,
+                  ((surf_action_cpu_ti_t) action)->index_heap);
+  xbt_swag_insert(surf_cpu_resource_priv(ACTION_GET_CPU(action)), cpu_ti_modified_cpu);
+  return;
+}
+
+static void cpu_ti_action_state_set(surf_action_t action,
+                                    e_surf_action_state_t state)
+{
+  surf_action_state_set(action, state);
+  xbt_swag_insert(surf_cpu_resource_priv(ACTION_GET_CPU(action)), cpu_ti_modified_cpu);
+  return;
+}
+
+/**
+* \brief Update the remaining amount of actions
+*
+* \param  cpu    Cpu on which the actions are running
+* \param  now    Current time
+*/
+static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now)
+{
+  double area_total;
+  surf_action_cpu_ti_t action;
+
+/* already updated */
+  if (cpu->last_update >= now)
+    return;
+
+/* calcule the surface */
+  area_total =
+      surf_cpu_ti_integrate_trace(cpu->avail_trace, cpu->last_update,
+                                  now) * cpu->power_peak;
+  XBT_DEBUG("Flops total: %f, Last update %f", area_total,
+         cpu->last_update);
+
+  xbt_swag_foreach(action, cpu->action_set) {
+    surf_action_t generic = (surf_action_t)action;
+    /* action not running, skip it */
+    if (generic->state_set !=
+        surf_cpu_model->states.running_action_set)
+      continue;
+
+    /* bogus priority, skip it */
+    if (generic->priority <= 0)
+      continue;
+
+    /* action suspended, skip it */
+    if (action->suspended != 0)
+      continue;
+
+    /* action don't need update */
+    if (generic->start >= now)
+      continue;
+
+    /* skip action that are finishing now */
+    if (generic->finish >= 0
+        && generic->finish <= now)
+      continue;
+
+    /* update remaining */
+    double_update(&(generic->remains),
+                  area_total / (cpu->sum_priority *
+                                generic->priority));
+    XBT_DEBUG("Update remaining action(%p) remaining %f", action,
+           generic->remains);
+  }
+  cpu->last_update = now;
+#undef GENERIC_ACTION
+}
+
+/**
+* \brief Update the finish date of action if necessary
+*
+* \param  cpu    Cpu on which the actions are running
+* \param  now    Current time
+*/
+static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now)
+{
+#define GENERIC_ACTION(action) action->generic_action
+  surf_action_cpu_ti_t action;
+  double sum_priority = 0.0, total_area, min_finish = -1;
+
+/* update remaning amount of actions */
+  cpu_ti_update_remaining_amount(cpu, now);
+
+  xbt_swag_foreach(action, cpu->action_set) {
+    /* action not running, skip it */
+    if (GENERIC_ACTION(action).state_set !=
+        surf_cpu_model->states.running_action_set)
+      continue;
+
+    /* bogus priority, skip it */
+    if (GENERIC_ACTION(action).priority <= 0)
+      continue;
+
+    /* action suspended, skip it */
+    if (action->suspended != 0)
+      continue;
+
+    sum_priority += 1.0 / GENERIC_ACTION(action).priority;
+  }
+  cpu->sum_priority = sum_priority;
+
+  xbt_swag_foreach(action, cpu->action_set) {
+    min_finish = -1;
+    /* action not running, skip it */
+    if (GENERIC_ACTION(action).state_set !=
+        surf_cpu_model->states.running_action_set)
+      continue;
+
+    /* verify if the action is really running on cpu */
+    if (action->suspended == 0 && GENERIC_ACTION(action).priority > 0) {
+      /* total area needed to finish the action. Used in trace integration */
+      total_area =
+          (GENERIC_ACTION(action).remains) * sum_priority *
+          GENERIC_ACTION(action).priority;
+
+      total_area /= cpu->power_peak;
+
+      GENERIC_ACTION(action).finish =
+          surf_cpu_ti_solve_trace(cpu->avail_trace, now, total_area);
+      /* verify which event will happen before (max_duration or finish time) */
+      if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
+          (GENERIC_ACTION(action).start +
+           GENERIC_ACTION(action).max_duration <
+           GENERIC_ACTION(action).finish))
+        min_finish = GENERIC_ACTION(action).start +
+            GENERIC_ACTION(action).max_duration;
+      else
+        min_finish = GENERIC_ACTION(action).finish;
+    } else {
+      /* put the max duration time on heap */
+      if (GENERIC_ACTION(action).max_duration != NO_MAX_DURATION)
+        min_finish =
+            (GENERIC_ACTION(action).start +
+             GENERIC_ACTION(action).max_duration);
+    }
+    /* add in action heap */
+    XBT_DEBUG("action(%p) index %d", action, action->index_heap);
+    if (action->index_heap >= 0) {
+      surf_action_cpu_ti_t heap_act =
+          xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
+      if (heap_act != action)
+        DIE_IMPOSSIBLE;
+    }
+    if (min_finish != NO_MAX_DURATION)
+      xbt_heap_push(cpu_ti_action_heap, action, min_finish);
+
+    XBT_DEBUG
+        ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f",
+         cpu->generic_resource.name, action, GENERIC_ACTION(action).start,
+         GENERIC_ACTION(action).finish,
+         GENERIC_ACTION(action).max_duration);
+  }
+/* remove from modified cpu */
+  xbt_swag_remove(cpu, cpu_ti_modified_cpu);
+#undef GENERIC_ACTION
+}
+
+static double cpu_ti_share_resources(double now)
+{
+  cpu_ti_t cpu, cpu_next;
+  double min_action_duration = -1;
+
+/* iterates over modified cpus to update share resources */
+  xbt_swag_foreach_safe(cpu, cpu_next, cpu_ti_modified_cpu) {
+    cpu_ti_update_action_finish_date(cpu, now);
+  }
+/* get the min next event if heap not empty */
+  if (xbt_heap_size(cpu_ti_action_heap) > 0)
+    min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now;
+
+  XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
+
+  return min_action_duration;
+}
+
+static void cpu_ti_update_actions_state(double now, double delta)
+{
+#define GENERIC_ACTION(action) action->generic_action
+  surf_action_cpu_ti_t action;
+  while ((xbt_heap_size(cpu_ti_action_heap) > 0)
+         && (xbt_heap_maxkey(cpu_ti_action_heap) <= now)) {
+    action = xbt_heap_pop(cpu_ti_action_heap);
+    XBT_DEBUG("Action %p: finish", action);
+    GENERIC_ACTION(action).finish = surf_get_clock();
+    /* set the remains to 0 due to precision problems when updating the remaining amount */
+    GENERIC_ACTION(action).remains = 0;
+    cpu_ti_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    /* update remaining amount of all actions */
+    cpu_ti_update_remaining_amount(surf_cpu_resource_priv(action->cpu), surf_get_clock());
+  }
+#undef GENERIC_ACTION
+}
+
+static void cpu_ti_update_resource_state(void *id,
+                                         tmgr_trace_event_t event_type,
+                                         double value, double date)
+{
+  cpu_ti_t cpu = id;
+  surf_action_cpu_ti_t action;
+
+  if (event_type == cpu->power_event) {
+    tmgr_trace_t power_trace;
+    surf_cpu_ti_tgmr_t trace;
+    s_tmgr_event_t val;
+
+    XBT_DEBUG("Finish trace date: %f value %f date %f", surf_get_clock(),
+           value, date);
+    /* update remaining of actions and put in modified cpu swag */
+    cpu_ti_update_remaining_amount(cpu, date);
+    xbt_swag_insert(cpu, cpu_ti_modified_cpu);
+
+    power_trace = cpu->avail_trace->power_trace;
+    xbt_dynar_get_cpy(power_trace->s_list.event_list,
+                      xbt_dynar_length(power_trace->s_list.event_list) - 1, &val);
+    /* free old trace */
+    surf_cpu_ti_free_tmgr(cpu->avail_trace);
+    cpu->power_scale = val.value;
+
+    trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
+    trace->type = TRACE_FIXED;
+    trace->value = val.value;
+    XBT_DEBUG("value %f", val.value);
+
+    cpu->avail_trace = trace;
+
+    if (tmgr_trace_event_free(event_type))
+      cpu->power_event = NULL;
+
+  } else if (event_type == cpu->state_event) {
+    if (value > 0) {
+      if(cpu->state_current == SURF_RESOURCE_OFF)
+        xbt_dynar_push_as(host_that_restart, char*, (cpu->generic_resource.name));
+      cpu->state_current = SURF_RESOURCE_ON;
+    } else {
+      cpu->state_current = SURF_RESOURCE_OFF;
+
+      /* put all action running on cpu to failed */
+      xbt_swag_foreach(action, cpu->action_set) {
+        if (surf_action_state_get((surf_action_t) action) ==
+            SURF_ACTION_RUNNING
+            || surf_action_state_get((surf_action_t) action) ==
+            SURF_ACTION_READY
+            || surf_action_state_get((surf_action_t) action) ==
+            SURF_ACTION_NOT_IN_THE_SYSTEM) {
+          action->generic_action.finish = date;
+          cpu_ti_action_state_set((surf_action_t) action,
+                                  SURF_ACTION_FAILED);
+          if (action->index_heap >= 0) {
+            surf_action_cpu_ti_t heap_act =
+                xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
+            if (heap_act != action)
+              DIE_IMPOSSIBLE;
+          }
+        }
+      }
+    }
+    if (tmgr_trace_event_free(event_type))
+      cpu->state_event = NULL;
+  } else {
+    XBT_CRITICAL("Unknown event ! \n");
+    xbt_abort();
+  }
+
+  return;
+}
+
+static surf_action_t cpu_ti_execute(void *cpu, double size)
+{
+  surf_action_cpu_ti_t action = NULL;
+  cpu_ti_t CPU = surf_cpu_resource_priv(cpu);
+
+  XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
+  action =
+      surf_action_new(sizeof(s_surf_action_cpu_ti_t), size, surf_cpu_model,
+                      CPU->state_current != SURF_RESOURCE_ON);
+  action->cpu = cpu;
+  action->index_heap = -1;
+
+  xbt_swag_insert(CPU, cpu_ti_modified_cpu);
+
+  xbt_swag_insert(action, CPU->action_set);
+
+  action->suspended = 0;        /* Should be useless because of the
+                                   calloc but it seems to help valgrind... */
+
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static void cpu_ti_action_update_index_heap(void *action, int i)
+{
+  ((surf_action_cpu_ti_t) action)->index_heap = i;
+}
+
+static surf_action_t cpu_ti_action_sleep(void *cpu, double duration)
+{
+  surf_action_cpu_ti_t action = NULL;
+
+  if (duration > 0)
+    duration = MAX(duration, MAXMIN_PRECISION);
+
+  XBT_IN("(%s,%g)", surf_resource_name(surf_cpu_resource_priv(cpu)), duration);
+  action = (surf_action_cpu_ti_t) cpu_ti_execute(cpu, 1.0);
+  action->generic_action.max_duration = duration;
+  action->suspended = 2;
+  if (duration == NO_MAX_DURATION) {
+    /* Move to the *end* of the corresponding action set. This convention
+       is used to speed up update_resource_state  */
+    xbt_swag_remove(action, ((surf_action_t) action)->state_set);
+    ((surf_action_t) action)->state_set =
+        cpu_ti_running_action_set_that_does_not_need_being_checked;
+    xbt_swag_insert(action, ((surf_action_t) action)->state_set);
+  }
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static void cpu_ti_action_suspend(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  if (((surf_action_cpu_ti_t) action)->suspended != 2) {
+    ((surf_action_cpu_ti_t) action)->suspended = 1;
+    xbt_heap_remove(cpu_ti_action_heap,
+                    ((surf_action_cpu_ti_t) action)->index_heap);
+    xbt_swag_insert(surf_cpu_resource_priv(ACTION_GET_CPU(action)), cpu_ti_modified_cpu);
+  }
+  XBT_OUT();
+}
+
+static void cpu_ti_action_resume(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  if (((surf_action_cpu_ti_t) action)->suspended != 2) {
+    ((surf_action_cpu_ti_t) action)->suspended = 0;
+    xbt_swag_insert(surf_cpu_resource_priv(ACTION_GET_CPU(action)), cpu_ti_modified_cpu);
+  }
+  XBT_OUT();
+}
+
+static int cpu_ti_action_is_suspended(surf_action_t action)
+{
+  return (((surf_action_cpu_ti_t) action)->suspended == 1);
+}
+
+static void cpu_ti_action_set_max_duration(surf_action_t action,
+                                           double duration)
+{
+  surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
+  double min_finish;
+
+  XBT_IN("(%p,%g)", action, duration);
+
+  action->max_duration = duration;
+
+  if (duration >= 0)
+    min_finish =
+        (action->start + action->max_duration) <
+        action->finish ? (action->start +
+                          action->max_duration) : action->finish;
+  else
+    min_finish = action->finish;
+
+/* add in action heap */
+  if (ACT->index_heap >= 0) {
+    surf_action_cpu_ti_t heap_act =
+        xbt_heap_remove(cpu_ti_action_heap, ACT->index_heap);
+    if (heap_act != ACT)
+      DIE_IMPOSSIBLE;
+  }
+  xbt_heap_push(cpu_ti_action_heap, ACT, min_finish);
+
+  XBT_OUT();
+}
+
+static void cpu_ti_action_set_priority(surf_action_t action,
+                                       double priority)
+{
+  XBT_IN("(%p,%g)", action, priority);
+  action->priority = priority;
+  xbt_swag_insert(surf_cpu_resource_priv(ACTION_GET_CPU(action)), cpu_ti_modified_cpu);
+  XBT_OUT();
+}
+
+static double cpu_ti_action_get_remains(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  cpu_ti_update_remaining_amount((cpu_ti_t)
+                                 ((surf_action_cpu_ti_t) action)->cpu,
+                                 surf_get_clock());
+  XBT_OUT();
+  return action->remains;
+}
+
+static e_surf_resource_state_t cpu_ti_get_state(void *cpu)
+{
+  return ((cpu_ti_t)surf_cpu_resource_priv(cpu))->state_current;
+}
+
+static double cpu_ti_get_speed(void *cpu, double load)
+{
+  return load * ((cpu_ti_t)surf_cpu_resource_priv(cpu))->power_peak;
+}
+
+/**
+* \brief Auxiliary function to update the CPU power scale.
+*
+*  This function uses the trace structure to return the power scale at the determined time a.
+* \param trace    Trace structure to search the updated power scale
+* \param a        Time
+* \return CPU power scale
+*/
+static double surf_cpu_ti_get_power_scale(surf_cpu_ti_tgmr_t trace,
+                                          double a)
+{
+  double reduced_a;
+  int point;
+  s_tmgr_event_t val;
+
+  reduced_a = a - floor(a / trace->last_time) * trace->last_time;
+  point =
+      surf_cpu_ti_binary_search(trace->trace->time_points, reduced_a, 0,
+                                trace->trace->nb_points - 1);
+  xbt_dynar_get_cpy(trace->power_trace->s_list.event_list, point, &val);
+  return val.value;
+}
+
+static double cpu_ti_get_available_speed(void *cpu)
+{
+  cpu_ti_t CPU = surf_cpu_resource_priv(cpu);
+  CPU->power_scale =
+      surf_cpu_ti_get_power_scale(CPU->avail_trace, surf_get_clock());
+/* number between 0 and 1 */
+  return CPU->power_scale;
+}
+
+static void cpu_ti_finalize(void)
+{
+  void **cpu;
+  xbt_lib_cursor_t cursor;
+  char *key;
+
+  xbt_lib_foreach(host_lib, cursor, key, cpu){
+    if(cpu[SURF_CPU_LEVEL])
+    {
+        cpu_ti_t CPU = cpu[SURF_CPU_LEVEL];
+        xbt_swag_free(CPU->action_set);
+        surf_cpu_ti_free_tmgr(CPU->avail_trace);
+    }
+  }
+
+  surf_model_exit(surf_cpu_model);
+  surf_cpu_model = NULL;
+
+  xbt_swag_free
+      (cpu_ti_running_action_set_that_does_not_need_being_checked);
+  xbt_swag_free(cpu_ti_modified_cpu);
+  cpu_ti_running_action_set_that_does_not_need_being_checked = NULL;
+  xbt_heap_free(cpu_ti_action_heap);
+}
+
+static void surf_cpu_ti_model_init_internal(void)
+{
+  s_surf_action_t action;
+  s_cpu_ti_t cpu;
+
+  surf_cpu_model = surf_model_init();
+
+  cpu_ti_running_action_set_that_does_not_need_being_checked =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+
+  cpu_ti_modified_cpu =
+      xbt_swag_new(xbt_swag_offset(cpu, modified_cpu_hookup));
+
+  surf_cpu_model->name = "cpu_ti";
+
+  surf_cpu_model->action_unref = cpu_ti_action_unref;
+  surf_cpu_model->action_cancel = cpu_ti_action_cancel;
+  surf_cpu_model->action_state_set = cpu_ti_action_state_set;
+
+  surf_cpu_model->model_private->resource_used = cpu_ti_resource_used;
+  surf_cpu_model->model_private->share_resources = cpu_ti_share_resources;
+  surf_cpu_model->model_private->update_actions_state =
+      cpu_ti_update_actions_state;
+  surf_cpu_model->model_private->update_resource_state =
+      cpu_ti_update_resource_state;
+  surf_cpu_model->model_private->finalize = cpu_ti_finalize;
+
+  surf_cpu_model->suspend = cpu_ti_action_suspend;
+  surf_cpu_model->resume = cpu_ti_action_resume;
+  surf_cpu_model->is_suspended = cpu_ti_action_is_suspended;
+  surf_cpu_model->set_max_duration = cpu_ti_action_set_max_duration;
+  surf_cpu_model->set_priority = cpu_ti_action_set_priority;
+  surf_cpu_model->get_remains = cpu_ti_action_get_remains;
+
+  surf_cpu_model->extension.cpu.execute = cpu_ti_execute;
+  surf_cpu_model->extension.cpu.sleep = cpu_ti_action_sleep;
+
+  surf_cpu_model->extension.cpu.get_state = cpu_ti_get_state;
+  surf_cpu_model->extension.cpu.get_speed = cpu_ti_get_speed;
+  surf_cpu_model->extension.cpu.get_available_speed =
+      cpu_ti_get_available_speed;
+  surf_cpu_model->extension.cpu.add_traces = add_traces_cpu_ti;
+
+  cpu_ti_action_heap = xbt_heap_new(8, NULL);
+  xbt_heap_set_update_callback(cpu_ti_action_heap,
+                               cpu_ti_action_update_index_heap);
+
+}
+
+void surf_cpu_model_init_ti()
+{
+  xbt_assert(!surf_cpu_model,"CPU model already initialized. This should not happen.");
+  surf_cpu_ti_model_init_internal();
+  cpu_ti_define_callbacks();
+  xbt_dynar_push(model_list, &surf_cpu_model);
+}
+
+
+/**
+* \brief Integrate trace
+*
+* Wrapper around surf_cpu_integrate_trace_simple() to get
+* the cyclic effect.
+*
+* \param trace Trace structure.
+* \param a      Begin of interval
+* \param b      End of interval
+* \return the integrate value. -1 if an error occurs.
+*/
+static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace,
+                                          double a, double b)
+{
+  double first_chunk;
+  double middle_chunk;
+  double last_chunk;
+  int a_index, b_index;
+
+  if ((a < 0.0) || (a > b)) {
+    XBT_CRITICAL
+        ("Error, invalid integration interval [%.2f,%.2f]. You probably have a task executing with negative computation amount. Check your code.",
+         a, b);
+    xbt_abort();
+  }
+  if (a == b)
+    return 0.0;
+
+  if (trace->type == TRACE_FIXED) {
+    return ((b - a) * trace->value);
+  }
+
+  if (ceil(a / trace->last_time) == a / trace->last_time)
+    a_index = 1 + (int) (ceil(a / trace->last_time));
+  else
+    a_index = (int) (ceil(a / trace->last_time));
+
+  b_index = (int) (floor(b / trace->last_time));
+
+  if (a_index > b_index) {      /* Same chunk */
+    return surf_cpu_ti_integrate_trace_simple(trace->trace,
+                                              a - (a_index -
+                                                   1) * trace->last_time,
+                                              b -
+                                              (b_index) *
+                                              trace->last_time);
+  }
+
+  first_chunk = surf_cpu_ti_integrate_trace_simple(trace->trace,
+                                                   a - (a_index -
+                                                        1) *
+                                                   trace->last_time,
+                                                   trace->last_time);
+  middle_chunk = (b_index - a_index) * trace->total;
+  last_chunk = surf_cpu_ti_integrate_trace_simple(trace->trace,
+                                                  0.0,
+                                                  b -
+                                                  (b_index) *
+                                                  trace->last_time);
+
+  XBT_DEBUG("first_chunk=%.2f  middle_chunk=%.2f  last_chunk=%.2f\n",
+         first_chunk, middle_chunk, last_chunk);
+
+  return (first_chunk + middle_chunk + last_chunk);
+}
+
+/**
+ * \brief Auxiliary function to calculate the integral between a and b.
+ *     It simply calculates the integral at point a and b and returns the difference 
+ *   between them.
+ * \param trace    Trace structure
+ * \param a        Initial point
+ * \param b  Final point
+ * \return  Integral
+*/
+static double surf_cpu_ti_integrate_trace_simple(surf_cpu_ti_trace_t trace,
+                                                 double a, double b)
+{
+  return surf_cpu_ti_integrate_trace_simple_point(trace,
+                                                  b) -
+      surf_cpu_ti_integrate_trace_simple_point(trace, a);
+}
+
+/**
+ * \brief Auxiliary function to calculate the integral at point a.
+ * \param trace    Trace structure
+ * \param a        point
+ * \return  Integral
+*/
+static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t
+                                                       trace, double a)
+{
+  double integral = 0;
+  int ind;
+  double a_aux = a;
+  ind =
+      surf_cpu_ti_binary_search(trace->time_points, a, 0,
+                                trace->nb_points - 1);
+  integral += trace->integral[ind];
+  XBT_DEBUG
+      ("a %f ind %d integral %f ind + 1 %f ind %f time +1 %f time %f",
+       a, ind, integral, trace->integral[ind + 1], trace->integral[ind],
+       trace->time_points[ind + 1], trace->time_points[ind]);
+  double_update(&a_aux, trace->time_points[ind]);
+  if (a_aux > 0)
+    integral +=
+        ((trace->integral[ind + 1] -
+          trace->integral[ind]) / (trace->time_points[ind + 1] -
+                                   trace->time_points[ind])) * (a -
+                                                                trace->
+                                                                time_points
+                                                                [ind]);
+  XBT_DEBUG("Integral a %f = %f", a, integral);
+
+  return integral;
+}
+
+/**
+* \brief Calculate the time needed to execute "amount" on cpu.
+*
+* Here, amount can span multiple trace periods
+*
+* \param trace   CPU trace structure
+* \param a        Initial time
+* \param amount  Amount to be executed
+* \return  End time
+*/
+static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
+                                      double amount)
+{
+  int quotient;
+  double reduced_b;
+  double reduced_amount;
+  double reduced_a;
+  double b;
+
+/* Fix very small negative numbers */
+  if ((a < 0.0) && (a > -EPSILON)) {
+    a = 0.0;
+  }
+  if ((amount < 0.0) && (amount > -EPSILON)) {
+    amount = 0.0;
+  }
+
+/* Sanity checks */
+  if ((a < 0.0) || (amount < 0.0)) {
+    XBT_CRITICAL
+        ("Error, invalid parameters [a = %.2f, amount = %.2f]. You probably have a task executing with negative computation amount. Check your code.",
+         a, amount);
+    xbt_abort();
+  }
+
+/* At this point, a and amount are positive */
+
+  if (amount < EPSILON)
+    return a;
+
+/* Is the trace fixed ? */
+  if (trace->type == TRACE_FIXED) {
+    return (a + (amount / trace->value));
+  }
+
+  XBT_DEBUG("amount %f total %f", amount, trace->total);
+/* Reduce the problem to one where amount <= trace_total */
+  quotient = (int) (floor(amount / trace->total));
+  reduced_amount = (trace->total) * ((amount / trace->total) -
+                                     floor(amount / trace->total));
+  reduced_a = a - (trace->last_time) * (int) (floor(a / trace->last_time));
+
+  XBT_DEBUG("Quotient: %d reduced_amount: %f reduced_a: %f", quotient,
+         reduced_amount, reduced_a);
+
+/* Now solve for new_amount which is <= trace_total */
+/*
+   fprintf(stderr,"reduced_a = %.2f\n",reduced_a);
+   fprintf(stderr,"reduced_amount = %.2f\n",reduced_amount);
+ */
+  reduced_b =
+      surf_cpu_ti_solve_trace_somewhat_simple(trace, reduced_a,
+                                              reduced_amount);
+
+/* Re-map to the original b and amount */
+  b = (trace->last_time) * (int) (floor(a / trace->last_time)) +
+      (quotient * trace->last_time) + reduced_b;
+  return b;
+}
+
+/**
+* \brief Auxiliary function to solve integral
+*
+* Here, amount is <= trace->total
+* and a <=trace->last_time
+*
+*/
+static double surf_cpu_ti_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t
+                                                      trace, double a,
+                                                      double amount)
+{
+  double amount_till_end;
+  double b;
+
+  XBT_DEBUG("Solve integral: [%.2f, amount=%.2f]", a, amount);
+  amount_till_end =
+      surf_cpu_ti_integrate_trace(trace, a, trace->last_time);
+/*
+   fprintf(stderr,"amount_till_end=%.2f\n",amount_till_end);
+ */
+
+  if (amount_till_end > amount) {
+    b = surf_cpu_ti_solve_trace_simple(trace->trace, a, amount);
+  } else {
+    b = trace->last_time +
+        surf_cpu_ti_solve_trace_simple(trace->trace, 0.0,
+                                       amount - amount_till_end);
+  }
+  return b;
+}
+
+/**
+ * \brief Auxiliary function to solve integral.
+ *  It returns the date when the requested amount of flops is available
+ * \param trace    Trace structure
+ * \param a        Initial point
+ * \param amount  Amount of flops 
+ * \return The date when amount is available.
+*/
+static double surf_cpu_ti_solve_trace_simple(surf_cpu_ti_trace_t trace,
+                                             double a, double amount)
+{
+  double integral_a;
+  int ind;
+  double time;
+  integral_a = surf_cpu_ti_integrate_trace_simple_point(trace, a);
+  ind =
+      surf_cpu_ti_binary_search(trace->integral, integral_a + amount, 0,
+                                trace->nb_points - 1);
+  time = trace->time_points[ind];
+  time +=
+      (integral_a + amount -
+       trace->integral[ind]) / ((trace->integral[ind + 1] -
+                                 trace->integral[ind]) /
+                                (trace->time_points[ind + 1] -
+                                 trace->time_points[ind]));
+
+  return time;
+}
+
+/**
+ * \brief Binary search in array.
+ *  It returns the first point of the interval in which "a" is. 
+ * \param array    Array
+ * \param a        Value to search
+ * \param low     Low bound to search in array
+ * \param high    Upper bound to search in array
+ * \return Index of point
+*/
+static int surf_cpu_ti_binary_search(double *array, double a, int low,
+                                     int high)
+{
+  xbt_assert(low < high, "Wrong parameters: low (%d) should be smaller than"
+      " high (%d)", low, high);
+
+  int mid;
+  do {
+    mid = low + (high - low) / 2;
+    XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid,
+        array[mid]);
+
+    if (array[mid] > a)
+      high = mid;
+    else
+      low = mid;
+  }
+  while (low < high - 1);
+
+  return low;
+}
index e512106..545f2ba 100644 (file)
@@ -6,7 +6,7 @@
 #define SURF_MODEL_CPUTI_H_
 
 extern "C" {
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
 }
 
@@ -145,7 +145,7 @@ double CpuTiTrace::integrateSimplePoint(double a)
   ind = binarySearch(p_timePoints, a, 0, m_nbPoints - 1);
   integral += p_integral[ind];
   XBT_DEBUG
-      ("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf",
+      ("a %f ind %d integral %f ind + 1 %f ind %f time +1 %f time %f",
        a, ind, integral, p_integral[ind + 1], p_integral[ind],
        p_timePoints[ind + 1], p_timePoints[ind]);
   double_update(&a_aux, p_timePoints[ind]);
@@ -154,7 +154,7 @@ double CpuTiTrace::integrateSimplePoint(double a)
         ((p_integral[ind + 1] -
           p_integral[ind]) / (p_timePoints[ind + 1] -
                               p_timePoints[ind])) * (a - p_timePoints[ind]);
-  XBT_DEBUG("Integral a %lf = %lf", a, integral);
+  XBT_DEBUG("Integral a %f = %f", a, integral);
 
   return integral;
 }
@@ -203,14 +203,14 @@ double CpuTiTgmr::solve(double a, double amount)
     return (a + (amount / m_value));
   }
 
-  XBT_DEBUG("amount %lf total %lf", amount, m_total);
+  XBT_DEBUG("amount %f total %f", amount, m_total);
 /* Reduce the problem to one where amount <= trace_total */
   quotient = (int) (floor(amount / m_total));
   reduced_amount = (m_total) * ((amount / m_total) -
                                      floor(amount / m_total));
   reduced_a = a - (m_lastTime) * (int) (floor(a / m_lastTime));
 
-  XBT_DEBUG("Quotient: %d reduced_amount: %lf reduced_a: %lf", quotient,
+  XBT_DEBUG("Quotient: %d reduced_amount: %f reduced_a: %f", quotient,
          reduced_amount, reduced_a);
 
 /* Now solve for new_amount which is <= trace_total */
@@ -318,7 +318,7 @@ CpuTiTgmr::CpuTiTgmr(tmgr_trace_t power_trace, double value)
   if (!power_trace) {
     m_type = TRACE_FIXED;
     m_value = value;
-    XBT_DEBUG("No availabily trace. Constant value = %lf", value);
+    XBT_DEBUG("No availability trace. Constant value = %lf", value);
     return;
   }
 
@@ -362,7 +362,7 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high)
   int mid;
   do {
     mid = low + (high - low) / 2;
-    XBT_DEBUG("a %lf low %d high %d mid %d value %lf", a, low, high, mid,
+    XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid,
         array[mid]);
 
     if (array[mid] > a)
@@ -451,6 +451,7 @@ void CpuTiModel::parseInit(sg_platf_host_cbarg_t host)
 {
   createResource(host->id,
         host->power_peak,
+        host->pstate,
         host->power_scale,
         host->power_trace,
         host->core_amount,
@@ -460,7 +461,8 @@ void CpuTiModel::parseInit(sg_platf_host_cbarg_t host)
 }
 
 CpuTiPtr CpuTiModel::createResource(const char *name,
-                          double powerPeak,
+                              xbt_dynar_t powerPeak,
+                              int pstate,
                            double powerScale,
                            tmgr_trace_t powerTrace,
                            int core,
@@ -475,7 +477,7 @@ CpuTiPtr CpuTiModel::createResource(const char *name,
   xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
               "Host '%s' declared several times in the platform file",
               name);
-  CpuTiPtr cpu = new CpuTi(this, name, powerPeak, powerScale, powerTrace,
+  CpuTiPtr cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
                           core, stateInitial, stateTrace, cpuProperties);
   xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast<ResourcePtr>(cpu));
   return (CpuTiPtr) xbt_lib_get_elm_or_null(host_lib, name);
@@ -499,7 +501,7 @@ double CpuTiModel::shareResources(double now)
   if (xbt_heap_size(cpu_ti_action_heap) > 0)
     min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now;
 
-  XBT_DEBUG("Share resources, min next event date: %lf", min_action_duration);
+  XBT_DEBUG("Share resources, min next event date: %f", min_action_duration);
 
   return min_action_duration;
 }
@@ -514,7 +516,7 @@ void CpuTiModel::updateActionsState(double now, double delta)
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     action->m_remains = 0;
     action->setState(SURF_ACTION_DONE);
-    /* update remaining amout of all actions */
+    /* update remaining amount of all actions */
     action->p_cpu->updateRemainingAmount(surf_get_clock());
   }
 }
@@ -579,13 +581,12 @@ void CpuTiModel::addTraces()
 /************
  * Resource *
  ************/
-CpuTi::CpuTi(CpuTiModelPtr model, const char *name, double powerPeak,
-        double powerScale, tmgr_trace_t powerTrace, int core,
+CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
+        int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) :
        Resource(model, name, properties), Cpu(model, name, properties) {
   p_stateCurrent = stateInitial;
-  m_powerPeak = powerPeak;
   m_powerScale = powerScale;
   m_core = core;
   tmgr_trace_t empty_trace;            
@@ -597,6 +598,11 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, double powerPeak,
   CpuTiActionPtr action;
   p_actionSet = xbt_swag_new(xbt_swag_offset(*action, p_cpuListHookup));
 
+  xbt_dynar_get_cpy(powerPeak, 0, &m_powerPeak);
+  xbt_dynar_free(&powerPeak);  /* kill memory leak */
+  m_pstate = pstate;
+  XBT_DEBUG("CPU create: peak=%f, pstate=%d", m_powerPeak, m_pstate);
+
   p_modifiedCpuHookup.prev = 0;
   p_modifiedCpuHookup.next = 0;
 
@@ -608,7 +614,7 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, double powerPeak,
                       xbt_dynar_length(powerTrace->s_list.event_list) - 1, &val);
     if (val.delta == 0) {
       empty_trace = tmgr_empty_trace_new();
-       p_powerEvent =
+      p_powerEvent =
         tmgr_history_add_trace(history, empty_trace,
                                p_availTrace->m_lastTime, 0, static_cast<ResourcePtr>(this));
     }
@@ -621,14 +627,12 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
   void *_action;
   CpuTiActionPtr action;
 
-  surf_watched_hosts();
-
   if (event_type == p_powerEvent) {
     tmgr_trace_t power_trace;
     CpuTiTgmrPtr trace;
     s_tmgr_event_t val;
 
-    XBT_DEBUG("Finish trace date: %lf value %lf date %lf", surf_get_clock(),
+    XBT_DEBUG("Finish trace date: %f value %lf date %f", surf_get_clock(),
            value, date);
     /* update remaining of actions and put in modified cpu swag */
     updateRemainingAmount(date);
@@ -642,7 +646,7 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
     m_powerScale = val.value;
 
     trace = new CpuTiTgmr(TRACE_FIXED, val.value);
-    XBT_DEBUG("value %lf", val.value);
+    XBT_DEBUG("value %f", val.value);
 
     p_availTrace = trace;
 
@@ -650,9 +654,11 @@ void CpuTi::updateState(tmgr_trace_event_t event_type,
       p_powerEvent = NULL;
 
   } else if (event_type == p_stateEvent) {
-    if (value > 0)
+    if (value > 0) {
+      if(p_stateCurrent == SURF_RESOURCE_OFF)
+        xbt_dynar_push_as(host_that_restart, char*, (char *)m_name);
       p_stateCurrent = SURF_RESOURCE_ON;
-    else {
+    else {
       p_stateCurrent = SURF_RESOURCE_OFF;
 
       /* put all action running on cpu to failed */
@@ -751,7 +757,7 @@ updateRemainingAmount(now);
       xbt_heap_push(cpu_ti_action_heap, action, min_finish);
 
     XBT_DEBUG
-        ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf",
+        ("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f",
          m_name, action, action->m_start,
          action->m_finish,
          action->m_maxDuration);
@@ -790,7 +796,7 @@ void CpuTi::updateRemainingAmount(double now)
 
 /* calcule the surface */
   area_total = p_availTrace->integrate(m_lastUpdate, now) * m_powerPeak;
-  XBT_DEBUG("Flops total: %lf, Last update %lf", area_total,
+  XBT_DEBUG("Flops total: %f, Last update %f", area_total,
          m_lastUpdate);
 
   xbt_swag_foreach(_action, p_actionSet) {
@@ -821,7 +827,7 @@ void CpuTi::updateRemainingAmount(double now)
     double_update(&(action->m_remains),
                   area_total / (m_sumPriority *
                                 action->m_priority));
-    XBT_DEBUG("Update remaining action(%p) remaining %lf", action,
+    XBT_DEBUG("Update remaining action(%p) remaining %f", action,
            action->m_remains);
   }
   m_lastUpdate = now;
index 6d52dd9..cccac33 100644 (file)
@@ -81,7 +81,8 @@ public:
   ~CpuTiModel();
 
   void parseInit(sg_platf_host_cbarg_t host);
-  CpuTiPtr createResource(const char *name, double power_peak, double power_scale,
+  CpuTiPtr createResource(const char *name,  xbt_dynar_t powerPeak,
+                          int pstate, double power_scale,
                           tmgr_trace_t power_trace, int core,
                           e_surf_resource_state_t state_initial,
                           tmgr_trace_t state_trace,
@@ -106,8 +107,8 @@ protected:
 class CpuTi : public Cpu {
 public:
   CpuTi() {};
-  CpuTi(CpuTiModelPtr model, const char *name, double powerPeak,
-        double powerScale, tmgr_trace_t powerTrace, int core,
+  CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
+        int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) ;
   ~CpuTi() {};
@@ -121,13 +122,27 @@ public:
   CpuActionPtr sleep(double duration);
   double getAvailableSpeed();
 
+  xbt_dynar_t getWattsRangeList() {};
+  double getCurrentWattsValue(double cpu_load) {};
+  void updateEnergy(double cpu_load) {};
+
+  double getCurrentPowerPeak() {};
+  double getPowerPeakAt(int pstate_index) {};
+  int getNbPstates() {};
+  void setPowerPeakAt(int pstate_index) {};
+  double getConsumedEnergy() {};
+
   CpuTiTgmrPtr p_availTrace;       /*< Structure with data needed to integrate trace file */
   tmgr_trace_event_t p_stateEvent;       /*< trace file with states events (ON or OFF) */
-  tmgr_trace_event_t p_powerEvent;       /*< trace file with availabitly events */
+  tmgr_trace_event_t p_powerEvent;       /*< trace file with availability events */
   xbt_swag_t p_actionSet;        /*< set with all actions running on cpu */
-  s_xbt_swag_hookup_t p_modifiedCpuHookup;      /*< hookup to swag that indicacates whether share resources must be recalculated or not */
+  s_xbt_swag_hookup_t p_modifiedCpuHookup;      /*< hookup to swag that indicates whether share resources must be recalculated or not */
   double m_sumPriority;          /*< the sum of actions' priority that are running on cpu */
   double m_lastUpdate;           /*< last update of actions' remaining amount done */
+
+  int m_pstate;                                                                /*< Current pstate (index in the power_peak_list)*/
+  double current_frequency;
+
   void updateRemainingAmount(double now);
 };
 
index b4c50c1..ba570d9 100644 (file)
@@ -1,5 +1,5 @@
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -37,15 +37,17 @@ typedef struct surf_cpu_ti_tgmr {
 typedef struct cpu_ti {
   s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interate with SURF */
   double power_peak;            /*< CPU power peak */
+  int pstate;
   double power_scale;           /*< Percentage of CPU disponible */
   surf_cpu_ti_tgmr_t avail_trace;       /*< Structure with data needed to integrate trace file */
   e_surf_resource_state_t state_current;        /*< CPU current state (ON or OFF) */
   tmgr_trace_event_t state_event;       /*< trace file with states events (ON or OFF) */
-  tmgr_trace_event_t power_event;       /*< trace file with availabitly events */
+  tmgr_trace_event_t power_event;       /*< trace file with availability events */
   xbt_swag_t action_set;        /*< set with all actions running on cpu */
   s_xbt_swag_hookup_t modified_cpu_hookup;      /*< hookup to swag that indicacates whether share resources must be recalculated or not */
   double sum_priority;          /*< the sum of actions' priority that are running on cpu */
   double last_update;           /*< last update of actions' remaining amount done */
+  double current_frequency;
 } s_cpu_ti_t, *cpu_ti_t;
 
 typedef struct surf_action_ti {
index aa9c4fa..8830107 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0e637c5..0c36743 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1be24e3..9549978 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a73ad4d..6ec3800 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 884519c..35a0118 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. 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 "instr/instr_private.h"
-#include "mc/mc.h"
 
 #ifdef HAVE_TRACING
 #include "surf/surf_private.h"
@@ -117,9 +116,6 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
   //create the link
   static long long counter = 0;
 
-  if(MC_is_active())
-    MC_ignore_data_bss(&counter, sizeof(counter));
-
   char key[INSTR_DEFAULT_STR_SIZE];
   snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
   new_pajeStartLink(SIMIX_get_clock(), father, link_type, src, "topology", key);
@@ -268,7 +264,10 @@ static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host)
     if (power == NULL){
       power = PJ_type_variable_new ("power", NULL, new->type);
     }
-    new_pajeSetVariable (0, new, power, host->power_peak);
+
+    double current_power_state;
+    xbt_dynar_get_cpy(host->power_peak, host->pstate, &current_power_state);
+    new_pajeSetVariable (0, new, power, current_power_state);
   }
   if (TRACE_uncategorized()){
     type_t power_used = PJ_type_get_or_null ("power_used", new->type);
index bf8339e..71e63b4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0eec4fb..a07c268 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -178,7 +178,7 @@ void lagrange_solve(lmm_system_t sys)
   lmm_variable_t var = NULL;
 
   /*
-   * Auxiliar variables.
+   * Auxiliary variables.
    */
   int iteration = 0;
   double tmp = 0;
index 3d49f84..feef80b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -889,3 +889,30 @@ static void lmm_remove_all_modified_set(lmm_system_t sys)
   }
   xbt_swag_reset(&sys->modified_constraint_set);
 }
+
+/**
+ *  Returns total resource load
+ *
+ *  \param cnst the lmm_constraint_t associated to the resource
+ *
+ */
+double lmm_constraint_get_usage(lmm_constraint_t cnst) {
+   double usage = 0.0;
+   xbt_swag_t elem_list = &(cnst->element_set);
+   lmm_element_t elem = NULL;
+
+   xbt_swag_foreach(elem, elem_list) {
+     /* 0-weighted elements (ie, sleep actions) are at the end of the swag and we don't want to consider them */
+     if (elem->variable->weight <= 0)
+       break;
+     if ((elem->value > 0)) {
+       if (cnst->shared)
+         usage += elem->value * elem->variable->value;
+       else if (usage < elem->value * elem->variable->value)
+         usage = elem->value * elem->variable->value;
+     }
+   }
+  return usage;
+}
+
+
index 2239cd2..a753f96 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/src/surf/network.c b/src/surf/network.c
new file mode 100644 (file)
index 0000000..d521acf
--- /dev/null
@@ -0,0 +1,986 @@
+
+/*
+ * Network with improved management of tasks, IM (Improved Management).
+ * Uses a heap to store actions so that the share_resources is faster.
+ * This model automatically sets the selective update flag to 1 and is
+ * highly dependent on the maxmin lmm module.
+ */
+
+/* Copyright (c) 2004-2013. 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 "network_private.h"
+#include "xbt/log.h"
+#include "xbt/str.h"
+
+#include "surf_private.h"
+#include "xbt/dict.h"
+#include "maxmin_private.h"
+#include "surf/surfxml_parse_values.h"
+#include "surf/surf_resource.h"
+#include "surf/surf_resource_lmm.h"
+#include "simgrid/sg_config.h"
+
+#undef GENERIC_LMM_ACTION
+#undef GENERIC_ACTION
+#define GENERIC_LMM_ACTION(action) (action)->generic_lmm_action
+#define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
+
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
+                                "Logging specific to the SURF network module");
+
+surf_model_t surf_network_model = NULL;
+static void (*network_solve) (lmm_system_t) = NULL;
+
+xbt_dynar_t smpi_bw_factor = NULL;
+xbt_dynar_t smpi_lat_factor = NULL;
+
+typedef struct s_smpi_factor *smpi_factor_t;
+typedef struct s_smpi_factor {
+  long factor;
+  double value;
+} s_smpi_factor_t;
+
+
+double sg_sender_gap = 0.0;
+double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
+double sg_bandwidth_factor = 1.0;       /* default value; can be set by model or from command line */
+double sg_weight_S_parameter = 0.0;     /* default value; can be set by model or from command line */
+
+double sg_tcp_gamma = 0.0;
+int sg_network_crosstraffic = 0;
+
+xbt_dict_t gap_lookup = NULL;
+
+/******************************************************************************/
+/*                           Factors callbacks                                */
+/******************************************************************************/
+static double constant_latency_factor(double size)
+{
+  return sg_latency_factor;
+}
+
+static double constant_bandwidth_factor(double size)
+{
+  return sg_bandwidth_factor;
+}
+
+static double constant_bandwidth_constraint(double rate, double bound,
+                                            double size)
+{
+  return rate;
+}
+
+/**********************/
+/*   SMPI callbacks   */
+/**********************/
+
+static int factor_cmp(const void *pa, const void *pb)
+{
+  return (((s_smpi_factor_t*)pa)->factor > ((s_smpi_factor_t*)pb)->factor);
+}
+
+
+static xbt_dynar_t parse_factor(const char *smpi_coef_string)
+{
+  char *value = NULL;
+  unsigned int iter = 0;
+  s_smpi_factor_t fact;
+  xbt_dynar_t smpi_factor, radical_elements, radical_elements2 = NULL;
+
+  smpi_factor = xbt_dynar_new(sizeof(s_smpi_factor_t), NULL);
+  radical_elements = xbt_str_split(smpi_coef_string, ";");
+  xbt_dynar_foreach(radical_elements, iter, value) {
+
+    radical_elements2 = xbt_str_split(value, ":");
+    if (xbt_dynar_length(radical_elements2) != 2)
+      xbt_die("Malformed radical for smpi factor!");
+    fact.factor = atol(xbt_dynar_get_as(radical_elements2, 0, char *));
+    fact.value = atof(xbt_dynar_get_as(radical_elements2, 1, char *));
+    xbt_dynar_push_as(smpi_factor, s_smpi_factor_t, fact);
+    XBT_DEBUG("smpi_factor:\t%ld : %f", fact.factor, fact.value);
+    xbt_dynar_free(&radical_elements2);
+  }
+  xbt_dynar_free(&radical_elements);
+  iter=0;
+  xbt_dynar_sort(smpi_factor, &factor_cmp);
+  xbt_dynar_foreach(smpi_factor, iter, fact) {
+    XBT_DEBUG("ordered smpi_factor:\t%ld : %f", fact.factor, fact.value);
+
+  }
+  return smpi_factor;
+}
+
+static double smpi_bandwidth_factor(double size)
+{
+  if (!smpi_bw_factor)
+    smpi_bw_factor =
+        parse_factor(sg_cfg_get_string("smpi/bw_factor"));
+
+  unsigned int iter = 0;
+  s_smpi_factor_t fact;
+  double current=1.0;
+  xbt_dynar_foreach(smpi_bw_factor, iter, fact) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current);
+      return current;
+    }else
+      current=fact.value;
+  }
+  XBT_DEBUG("%f > %ld return %f", size, fact.factor, current);
+
+  return current;
+}
+
+static double smpi_latency_factor(double size)
+{
+  if (!smpi_lat_factor)
+    smpi_lat_factor =
+        parse_factor(sg_cfg_get_string("smpi/lat_factor"));
+
+  unsigned int iter = 0;
+  s_smpi_factor_t fact;
+  double current=1.0;
+  xbt_dynar_foreach(smpi_lat_factor, iter, fact) {
+    if (size <= fact.factor) {
+      XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current);
+      return current;
+    }else
+      current=fact.value;
+  }
+  XBT_DEBUG("%f > %ld return %f", size, fact.factor, current);
+
+  return current;
+}
+
+/**--------- <copy/paste C code snippet in surf/network.c> -----------*/
+
+static double smpi_bandwidth_constraint(double rate, double bound,
+                                        double size)
+{
+  return rate < 0 ? bound : min(bound, rate * smpi_bandwidth_factor(size));
+}
+
+static double (*latency_factor_callback) (double) =
+    &constant_latency_factor;
+static double (*bandwidth_factor_callback) (double) =
+    &constant_bandwidth_factor;
+static double (*bandwidth_constraint_callback) (double, double, double) =
+    &constant_bandwidth_constraint;
+
+static void (*gap_append) (double, const link_CM02_t,
+                           surf_action_network_CM02_t) = NULL;
+
+static void *net_create_resource(const char *name,
+                                 double bw_initial,
+                                 tmgr_trace_t bw_trace,
+                                 double lat_initial,
+                                 tmgr_trace_t lat_trace,
+                                 e_surf_resource_state_t
+                                 state_initial,
+                                 tmgr_trace_t state_trace,
+                                 e_surf_link_sharing_policy_t
+                                 policy, xbt_dict_t properties)
+{
+  link_CM02_t nw_link = (link_CM02_t)
+      surf_resource_lmm_new(sizeof(s_link_CM02_t),
+                            surf_network_model, name, properties,
+                            surf_network_model->model_private->maxmin_system,
+                            sg_bandwidth_factor * bw_initial,
+                            history,
+                            state_initial, state_trace,
+                            bw_initial, bw_trace);
+
+  xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+             "Link '%s' declared several times in the platform file.",
+             name);
+
+  nw_link->lat_current = lat_initial;
+  if (lat_trace)
+    nw_link->lat_event =
+        tmgr_history_add_trace(history, lat_trace, 0.0, 0, nw_link);
+
+  if (policy == SURF_LINK_FATPIPE)
+    lmm_constraint_shared(nw_link->lmm_resource.constraint);
+
+  xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
+  XBT_DEBUG("Create link '%s'",name);
+
+  return nw_link;
+}
+
+static void net_parse_link_init(sg_platf_link_cbarg_t link)
+{
+  if (link->policy == SURF_LINK_FULLDUPLEX) {
+    char *link_id;
+    link_id = bprintf("%s_UP", link->id);
+    net_create_resource(link_id,
+                        link->bandwidth,
+                        link->bandwidth_trace,
+                        link->latency,
+                        link->latency_trace,
+                        link->state,
+                        link->state_trace, link->policy, link->properties);
+    xbt_free(link_id);
+    link_id = bprintf("%s_DOWN", link->id);
+    net_create_resource(link_id,
+                        link->bandwidth,
+                        link->bandwidth_trace,
+                        link->latency,
+                        link->latency_trace,
+                        link->state,
+                        link->state_trace, link->policy, link->properties);
+    xbt_free(link_id);
+  } else {
+    net_create_resource(link->id,
+                        link->bandwidth,
+                        link->bandwidth_trace,
+                        link->latency,
+                        link->latency_trace,
+                        link->state,
+                        link->state_trace, link->policy, link->properties);
+  }
+}
+
+static void net_add_traces(void)
+{
+  xbt_dict_cursor_t cursor = NULL;
+  char *trace_name, *elm;
+
+  static int called = 0;
+  if (called)
+    return;
+  called = 1;
+
+  /* connect all traces relative to network */
+  xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_CM02_t link = xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
+               trace_name, elm);
+    xbt_assert(trace,
+               "Cannot connect trace %s to link %s: trace undefined",
+               trace_name, elm);
+
+    link->lmm_resource.state_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+
+  xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_CM02_t link = xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
+               trace_name, elm);
+    xbt_assert(trace,
+               "Cannot connect trace %s to link %s: trace undefined",
+               trace_name, elm);
+
+    link->lmm_resource.power.event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+
+  xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_CM02_t link = xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Cannot connect trace %s to link %s: link undefined",
+               trace_name, elm);
+    xbt_assert(trace,
+               "Cannot connect trace %s to link %s: trace undefined",
+               trace_name, elm);
+
+    link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+}
+
+static void net_define_callbacks(void)
+{
+  /* Figuring out the network links */
+  sg_platf_link_add_cb(net_parse_link_init);
+  sg_platf_postparse_add_cb(net_add_traces);
+}
+
+static int net_resource_used(void *resource_id)
+{
+  return lmm_constraint_used(surf_network_model->model_private->maxmin_system, ((surf_resource_lmm_t)
+                                                     resource_id)->
+                             constraint);
+}
+
+void net_action_recycle(surf_action_t action)
+{
+  return;
+}
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+int net_get_link_latency_limited(surf_action_t action)
+{
+  return action->latency_limited;
+}
+#endif
+
+static double net_share_resources_full(double now)
+{
+  s_surf_action_lmm_t s_action;
+  surf_action_network_CM02_t action = NULL;
+  xbt_swag_t running_actions =
+      surf_network_model->states.running_action_set;
+  double min;
+
+  min = generic_maxmin_share_resources(running_actions,
+                                       xbt_swag_offset(s_action,
+                                                       variable),
+                                                       surf_network_model->model_private->maxmin_system,
+                                       network_solve);
+
+#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable)  )))
+
+  xbt_swag_foreach(action, running_actions) {
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+    if (lmm_is_variable_limited_by_latency(GENERIC_LMM_ACTION(action).variable)) {
+      action->latency_limited = 1;
+    } else {
+      action->latency_limited = 0;
+    }
+#endif
+    if (action->latency > 0) {
+      min = (min < 0) ? action->latency : min(min, action->latency);
+    }
+  }
+
+  XBT_DEBUG("Min of share resources %f", min);
+
+  return min;
+}
+
+static double net_share_resources_lazy(double now)
+{
+  return generic_share_resources_lazy(now, surf_network_model);
+}
+
+static void net_update_actions_state_full(double now, double delta)
+{
+  generic_update_actions_state_full(now, delta, surf_network_model);
+}
+
+static void net_update_actions_state_lazy(double now, double delta)
+{
+  generic_update_actions_state_lazy(now, delta, surf_network_model);
+}
+
+static void net_update_resource_state(void *id,
+                                      tmgr_trace_event_t event_type,
+                                      double value, double date)
+{
+  link_CM02_t nw_link = id;
+  /*   printf("[" "%g" "] Asking to update network card \"%s\" with value " */
+  /*     "%g" " for event %p\n", surf_get_clock(), nw_link->name, */
+  /*     value, event_type); */
+
+  if (event_type == nw_link->lmm_resource.power.event) {
+    double delta =
+        sg_weight_S_parameter / value - sg_weight_S_parameter /
+        (nw_link->lmm_resource.power.peak *
+         nw_link->lmm_resource.power.scale);
+    lmm_variable_t var = NULL;
+    lmm_element_t elem = NULL;
+    surf_action_network_CM02_t action = NULL;
+
+    nw_link->lmm_resource.power.peak = value;
+    lmm_update_constraint_bound(surf_network_model->model_private->maxmin_system,
+                                nw_link->lmm_resource.constraint,
+                                sg_bandwidth_factor *
+                                (nw_link->lmm_resource.power.peak *
+                                 nw_link->lmm_resource.power.scale));
+#ifdef HAVE_TRACING
+    TRACE_surf_link_set_bandwidth(date,
+                                  (char
+                                   *) (((nw_link->lmm_resource).
+                                        generic_resource).name),
+                                  sg_bandwidth_factor *
+                                  (nw_link->lmm_resource.power.peak *
+                                   nw_link->lmm_resource.power.scale));
+#endif
+    if (sg_weight_S_parameter > 0) {
+      while ((var = lmm_get_var_from_cnst
+              (surf_network_model->model_private->maxmin_system, nw_link->lmm_resource.constraint,
+               &elem))) {
+        action = lmm_variable_id(var);
+        action->weight += delta;
+        if (!(GENERIC_LMM_ACTION(action).suspended))
+          lmm_update_variable_weight(surf_network_model->model_private->maxmin_system,
+                                     GENERIC_LMM_ACTION(action).variable, action->weight);
+      }
+    }
+    if (tmgr_trace_event_free(event_type))
+      nw_link->lmm_resource.power.event = NULL;
+  } else if (event_type == nw_link->lat_event) {
+    double delta = value - nw_link->lat_current;
+    lmm_variable_t var = NULL;
+    lmm_element_t elem = NULL;
+    surf_action_network_CM02_t action = NULL;
+
+    nw_link->lat_current = value;
+    while ((var = lmm_get_var_from_cnst
+            (surf_network_model->model_private->maxmin_system, nw_link->lmm_resource.constraint,
+             &elem))) {
+      action = lmm_variable_id(var);
+      action->lat_current += delta;
+      action->weight += delta;
+      if (action->rate < 0)
+        lmm_update_variable_bound(surf_network_model->model_private->maxmin_system, GENERIC_LMM_ACTION(action).variable,
+                                  sg_tcp_gamma / (2.0 *
+                                                  action->lat_current));
+      else {
+        lmm_update_variable_bound(surf_network_model->model_private->maxmin_system, GENERIC_LMM_ACTION(action).variable,
+                                  min(action->rate,
+                                      sg_tcp_gamma / (2.0 *
+                                                      action->
+                                                      lat_current)));
+
+        if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
+          XBT_INFO("Flow is limited BYBANDWIDTH");
+        } else {
+          XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f",
+                   action->lat_current);
+        }
+      }
+      if (!(GENERIC_LMM_ACTION(action).suspended))
+        lmm_update_variable_weight(surf_network_model->model_private->maxmin_system, GENERIC_LMM_ACTION(action).variable,
+                                   action->weight);
+
+    }
+    if (tmgr_trace_event_free(event_type))
+      nw_link->lat_event = NULL;
+  } else if (event_type == nw_link->lmm_resource.state_event) {
+    if (value > 0)
+      nw_link->lmm_resource.state_current = SURF_RESOURCE_ON;
+    else {
+      lmm_constraint_t cnst = nw_link->lmm_resource.constraint;
+      lmm_variable_t var = NULL;
+      lmm_element_t elem = NULL;
+
+      nw_link->lmm_resource.state_current = SURF_RESOURCE_OFF;
+      while ((var = lmm_get_var_from_cnst
+              (surf_network_model->model_private->maxmin_system, cnst, &elem))) {
+        surf_action_t action = lmm_variable_id(var);
+
+        if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
+            surf_action_state_get(action) == SURF_ACTION_READY) {
+          action->finish = date;
+          surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
+        }
+      }
+    }
+    if (tmgr_trace_event_free(event_type))
+      nw_link->lmm_resource.state_event = NULL;
+  } else {
+    XBT_CRITICAL("Unknown event ! \n");
+    xbt_abort();
+  }
+
+  XBT_DEBUG
+      ("There were a resource state event, need to update actions related to the constraint (%p)",
+       nw_link->lmm_resource.constraint);
+  return;
+}
+
+
+static surf_action_t net_communicate(sg_routing_edge_t src,
+                                     sg_routing_edge_t dst,
+                                     double size, double rate)
+{
+  unsigned int i;
+  link_CM02_t link;
+  int failed = 0;
+  surf_action_network_CM02_t action = NULL;
+  double bandwidth_bound;
+  double latency = 0.0;
+  xbt_dynar_t back_route = NULL;
+  int constraints_per_variable = 0;
+
+  xbt_dynar_t route = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
+
+  XBT_IN("(%s,%s,%g,%g)", src->name, dst->name, size, rate);
+
+  routing_get_route_and_latency(src, dst, &route, &latency);
+  xbt_assert(!xbt_dynar_is_empty(route) || latency,
+             "You're trying to send data from %s to %s but there is no connection at all between these two hosts.",
+             src->name, dst->name);
+
+  xbt_dynar_foreach(route, i, link) {
+    if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
+      failed = 1;
+      break;
+    }
+  }
+  if (sg_network_crosstraffic == 1) {
+    routing_get_route_and_latency(dst, src, &back_route, NULL);
+    xbt_dynar_foreach(back_route, i, link) {
+      if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
+        failed = 1;
+        break;
+      }
+    }
+  }
+
+  action =
+      surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
+                      surf_network_model, failed);
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  action->latency_limited = 0;
+#endif
+  action->weight = action->latency = latency;
+
+  xbt_swag_insert(action, ((surf_action_t)action)->state_set);
+  action->rate = rate;
+  if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+    GENERIC_LMM_ACTION(action).index_heap = -1;
+    GENERIC_LMM_ACTION(action).last_update = surf_get_clock();
+  }
+
+  bandwidth_bound = -1.0;
+  if (sg_weight_S_parameter > 0) {
+    xbt_dynar_foreach(route, i, link) {
+      action->weight +=
+          sg_weight_S_parameter /
+          (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
+    }
+  }
+  xbt_dynar_foreach(route, i, link) {
+    double bb = bandwidth_factor_callback(size) *
+        (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
+    bandwidth_bound =
+        (bandwidth_bound < 0.0) ? bb : min(bandwidth_bound, bb);
+  }
+
+  action->lat_current = action->latency;
+  action->latency *= latency_factor_callback(size);
+  action->rate =
+      bandwidth_constraint_callback(action->rate, bandwidth_bound, size);
+  if (gap_append) {
+    xbt_assert(!xbt_dynar_is_empty(route),
+               "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!");
+
+    link = *(link_CM02_t *) xbt_dynar_get_ptr(route, 0);
+    gap_append(size, link, action);
+    XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)",
+              action, src->name, dst->name, action->sender.gap,
+              action->latency);
+  }
+
+  constraints_per_variable = xbt_dynar_length(route);
+  if (back_route != NULL)
+    constraints_per_variable += xbt_dynar_length(back_route);
+
+  if (action->latency > 0) {
+    GENERIC_LMM_ACTION(action).variable =
+        lmm_variable_new(surf_network_model->model_private->maxmin_system, action, 0.0, -1.0,
+                         constraints_per_variable);
+    if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+      // add to the heap the event when the latency is payed
+      XBT_DEBUG("Added action (%p) one latency event at date %f", action,
+                action->latency + GENERIC_LMM_ACTION(action).last_update);
+      surf_action_lmm_heap_insert(surf_network_model->model_private->action_heap,(surf_action_lmm_t)action, action->latency + GENERIC_LMM_ACTION(action).last_update,
+                  xbt_dynar_is_empty(route) ? NORMAL : LATENCY);
+    }
+  } else
+    GENERIC_LMM_ACTION(action).variable =
+        lmm_variable_new(surf_network_model->model_private->maxmin_system, action, 1.0, -1.0,
+                         constraints_per_variable);
+
+  if (action->rate < 0) {
+    lmm_update_variable_bound(surf_network_model->model_private->maxmin_system, GENERIC_LMM_ACTION(action).variable,
+                              (action->lat_current > 0) ?
+                              sg_tcp_gamma / (2.0 *
+                                              action->lat_current) : -1.0);
+  } else {
+    lmm_update_variable_bound(surf_network_model->model_private->maxmin_system, GENERIC_LMM_ACTION(action).variable,
+                              (action->lat_current > 0) ?
+                              min(action->rate,
+                                  sg_tcp_gamma / (2.0 *
+                                                  action->lat_current))
+                              : action->rate);
+  }
+
+  xbt_dynar_foreach(route, i, link) {
+    lmm_expand(surf_network_model->model_private->maxmin_system, link->lmm_resource.constraint,
+               GENERIC_LMM_ACTION(action).variable, 1.0);
+  }
+
+  if (sg_network_crosstraffic == 1) {
+    XBT_DEBUG("Fullduplex active adding backward flow using 5%%");
+    xbt_dynar_foreach(back_route, i, link) {
+      lmm_expand(surf_network_model->model_private->maxmin_system, link->lmm_resource.constraint,
+                 GENERIC_LMM_ACTION(action).variable, .05);
+    }
+  }
+
+  xbt_dynar_free(&route);
+  XBT_OUT();
+
+  return (surf_action_t) action;
+}
+
+static xbt_dynar_t net_get_route(void *src, void *dst)
+{
+  xbt_dynar_t route = NULL;
+  routing_get_route_and_latency(src, dst, &route, NULL);
+  return route;
+}
+
+static double net_get_link_bandwidth(const void *link)
+{
+  surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
+  return lmm->power.peak * lmm->power.scale;
+}
+
+static double net_get_link_latency(const void *link)
+{
+  return ((link_CM02_t) link)->lat_current;
+}
+
+static int net_link_shared(const void *link)
+{
+  return
+      lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
+}
+
+static void net_finalize(void)
+{
+  lmm_system_free(surf_network_model->model_private->maxmin_system);
+  surf_network_model->model_private->maxmin_system = NULL;
+
+  if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+    xbt_heap_free(surf_network_model->model_private->action_heap);
+    xbt_swag_free(surf_network_model->model_private->modified_set);
+  }
+
+  surf_model_exit(surf_network_model);
+  surf_network_model = NULL;
+
+  xbt_dict_free(&gap_lookup);
+  xbt_dynar_free(&smpi_bw_factor);
+  xbt_dynar_free(&smpi_lat_factor);
+}
+
+static void smpi_gap_append(double size, const link_CM02_t link,
+                            surf_action_network_CM02_t action)
+{
+  const char *src = link->lmm_resource.generic_resource.name;
+  xbt_fifo_t fifo;
+  //surf_action_network_CM02_t last_action;
+  //double bw;
+
+  if (sg_sender_gap > 0.0) {
+    if (!gap_lookup) {
+      gap_lookup = xbt_dict_new_homogeneous(NULL);
+    }
+    fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, src);
+    action->sender.gap = 0.0;
+    if (fifo && xbt_fifo_size(fifo) > 0) {
+      /* Compute gap from last send */
+      /*last_action =
+          (surf_action_network_CM02_t)
+          xbt_fifo_get_item_content(xbt_fifo_get_last_item(fifo));*/
+     // bw = net_get_link_bandwidth(link);
+      action->sender.gap = sg_sender_gap;
+        /*  max(sg_sender_gap,last_action->sender.size / bw);*/
+      action->latency += action->sender.gap;
+    }
+    /* Append action as last send */
+    /*action->sender.link_name = link->lmm_resource.generic_resource.name;
+    fifo =
+        (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup,
+                                          action->sender.link_name);
+    if (!fifo) {
+      fifo = xbt_fifo_new();
+      xbt_dict_set(gap_lookup, action->sender.link_name, fifo, NULL);
+    }
+    action->sender.fifo_item = xbt_fifo_push(fifo, action);*/
+    action->sender.size = size;
+  }
+}
+
+static void smpi_gap_remove(surf_action_lmm_t lmm_action)
+{
+  xbt_fifo_t fifo;
+  size_t size;
+  surf_action_network_CM02_t action = (surf_action_network_CM02_t)(lmm_action);
+
+  if (sg_sender_gap > 0.0 && action->sender.link_name
+      && action->sender.fifo_item) {
+    fifo =
+        (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup,
+                                          action->sender.link_name);
+    xbt_fifo_remove_item(fifo, action->sender.fifo_item);
+    size = xbt_fifo_size(fifo);
+    if (size == 0) {
+      xbt_fifo_free(fifo);
+      xbt_dict_remove(gap_lookup, action->sender.link_name);
+      size = xbt_dict_length(gap_lookup);
+      if (size == 0) {
+        xbt_dict_free(&gap_lookup);
+      }
+    }
+  }
+}
+
+static void set_update_mechanism(void)
+{
+  char *optim = xbt_cfg_get_string(_sg_cfg_set, "network/optim");
+  int select =
+      xbt_cfg_get_boolean(_sg_cfg_set, "network/maxmin_selective_update");
+
+  if (!strcmp(optim, "Full")) {
+    surf_network_model->model_private->update_mechanism = UM_FULL;
+    surf_network_model->model_private->selective_update = select;
+  } else if (!strcmp(optim, "Lazy")) {
+    surf_network_model->model_private->update_mechanism = UM_LAZY;
+    surf_network_model->model_private->selective_update = 1;
+    xbt_assert((select == 1)
+               ||
+               (xbt_cfg_is_default_value
+                (_sg_cfg_set, "network/maxmin_selective_update")),
+               "Disabling selective update while using the lazy update mechanism is dumb!");
+  } else {
+    xbt_die("Unsupported optimization (%s) for this model", optim);
+  }
+}
+
+static void surf_network_model_init_internal(void)
+{
+  s_surf_action_network_CM02_t comm;
+  surf_network_model = surf_model_init();
+
+  set_update_mechanism();
+
+  surf_network_model->name = "network";
+  surf_network_model->action_unref = surf_action_unref;
+  surf_network_model->action_cancel = surf_action_cancel;
+  surf_network_model->action_recycle = net_action_recycle;
+
+  surf_network_model->get_remains = surf_action_get_remains;
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  surf_network_model->get_latency_limited = net_get_link_latency_limited;
+#endif
+#ifdef HAVE_TRACING
+  surf_network_model->set_category = surf_action_set_category;
+#endif
+
+  surf_network_model->model_private->resource_used = net_resource_used;
+  if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+    surf_network_model->model_private->share_resources =
+        net_share_resources_lazy;
+    surf_network_model->model_private->update_actions_state =
+        net_update_actions_state_lazy;
+  } else if (surf_network_model->model_private->update_mechanism == UM_FULL) {
+    surf_network_model->model_private->share_resources =
+        net_share_resources_full;
+    surf_network_model->model_private->update_actions_state =
+        net_update_actions_state_full;
+  }
+
+  surf_network_model->model_private->update_resource_state =
+      net_update_resource_state;
+  surf_network_model->model_private->finalize = net_finalize;
+
+  surf_network_model->suspend = surf_action_suspend;
+  surf_network_model->resume = surf_action_resume;
+  surf_network_model->is_suspended = surf_action_is_suspended;
+  surf_cpu_model->set_max_duration = surf_action_set_max_duration;
+
+  surf_network_model->extension.network.communicate = net_communicate;
+  surf_network_model->extension.network.get_route = net_get_route;
+  surf_network_model->extension.network.get_link_bandwidth =
+      net_get_link_bandwidth;
+  surf_network_model->extension.network.get_link_latency =
+      net_get_link_latency;
+  surf_network_model->extension.network.link_shared = net_link_shared;
+  surf_network_model->extension.network.add_traces = net_add_traces;
+
+  if (!surf_network_model->model_private->maxmin_system)
+    surf_network_model->model_private->maxmin_system = lmm_system_new(surf_network_model->model_private->selective_update);
+
+  routing_model_create(net_create_resource("__loopback__",
+                                           498000000, NULL, 0.000015, NULL,
+                                           SURF_RESOURCE_ON, NULL,
+                                           SURF_LINK_FATPIPE, NULL));
+
+  if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+    surf_network_model->model_private->action_heap = xbt_heap_new(8, NULL);
+    xbt_heap_set_update_callback(surf_network_model->model_private->action_heap,
+                                 surf_action_lmm_update_index_heap);
+    surf_network_model->model_private->modified_set =
+        xbt_swag_new(xbt_swag_offset(comm, generic_lmm_action.action_list_hookup));
+    surf_network_model->model_private->maxmin_system->keep_track = surf_network_model->model_private->modified_set;
+  }
+
+  surf_network_model->gap_remove = NULL;
+}
+
+/************************************************************************/
+/* New model based on LV08 and experimental results of MPI ping-pongs   */
+/************************************************************************/
+/* @Inproceedings{smpi_ipdps, */
+/*  author={Pierre-Nicolas Clauss and Mark Stillwell and Stéphane Genaud and Frédéric Suter and Henri Casanova and Martin Quinson}, */
+/*  title={Single Node On-Line Simulation of {MPI} Applications with SMPI}, */
+/*  booktitle={25th IEEE International Parallel and Distributed Processing Symposium (IPDPS'11)}, */
+/*  address={Anchorage (Alaska) USA}, */
+/*  month=may, */
+/*  year={2011} */
+/*  } */
+void surf_network_model_init_SMPI(void)
+{
+
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  latency_factor_callback = &smpi_latency_factor;
+  bandwidth_factor_callback = &smpi_bandwidth_factor;
+  bandwidth_constraint_callback = &smpi_bandwidth_constraint;
+  gap_append = &smpi_gap_append;
+  surf_network_model->gap_remove = &smpi_gap_remove;
+  net_define_callbacks();
+  xbt_dynar_push(model_list, &surf_network_model);
+  network_solve = lmm_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
+}
+
+/************************************************************************/
+/* New model based on optimizations discussed during Pedro Velho's thesis*/
+/************************************************************************/
+/* @techreport{VELHO:2011:HAL-00646896:1, */
+/*      url = {http://hal.inria.fr/hal-00646896/en/}, */
+/*      title = {{Flow-level network models: have we reached the limits?}}, */
+/*      author = {Velho, Pedro and Schnorr, Lucas and Casanova, Henri and Legrand, Arnaud}, */
+/*      type = {Rapport de recherche}, */
+/*      institution = {INRIA}, */
+/*      number = {RR-7821}, */
+/*      year = {2011}, */
+/*      month = Nov, */
+/*      pdf = {http://hal.inria.fr/hal-00646896/PDF/rr-validity.pdf}, */
+/*  } */
+void surf_network_model_init_LegrandVelho(void)
+{
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  net_define_callbacks();
+  xbt_dynar_push(model_list, &surf_network_model);
+  network_solve = lmm_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
+                            13.01);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
+                            0.97);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 20537);
+}
+
+/***************************************************************************/
+/* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
+/***************************************************************************/
+/* @TechReport{      rr-lip2002-40, */
+/*   author        = {Henri Casanova and Loris Marchal}, */
+/*   institution   = {LIP}, */
+/*   title         = {A Network Model for Simulation of Grid Application}, */
+/*   number        = {2002-40}, */
+/*   month         = {oct}, */
+/*   year          = {2002} */
+/* } */
+void surf_network_model_init_CM02(void)
+{
+
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  net_define_callbacks();
+  xbt_dynar_push(model_list, &surf_network_model);
+  network_solve = lmm_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
+                            1.0);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 0.0);
+}
+
+/***************************************************************************/
+/* The models from Steven H. Low                                           */
+/***************************************************************************/
+/* @article{Low03,                                                         */
+/*   author={Steven H. Low},                                               */
+/*   title={A Duality Model of {TCP} and Queue Management Algorithms},     */
+/*   year={2003},                                                          */
+/*   journal={{IEEE/ACM} Transactions on Networking},                      */
+/*    volume={11}, number={4},                                             */
+/*  }                                                                      */
+void surf_network_model_init_Reno(void)
+{
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  net_define_callbacks();
+
+  xbt_dynar_push(model_list, &surf_network_model);
+  lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
+                                    func_reno_fpi);
+  network_solve = lagrange_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 10.4);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
+                            0.92);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
+}
+
+
+void surf_network_model_init_Reno2(void)
+{
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  net_define_callbacks();
+
+  xbt_dynar_push(model_list, &surf_network_model);
+  lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
+                                    func_reno2_fpi);
+  network_solve = lagrange_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 10.4);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
+                            0.92);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S_parameter",
+                            8775);
+}
+
+void surf_network_model_init_Vegas(void)
+{
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  net_define_callbacks();
+
+  xbt_dynar_push(model_list, &surf_network_model);
+  lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
+                                    func_vegas_fpi);
+  network_solve = lagrange_solve;
+
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 10.4);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor",
+                            0.92);
+  xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
+}
index 23a4230..e8e886e 100644 (file)
@@ -561,8 +561,8 @@ bool NetworkCm02LinkLmm::isShared()
 void NetworkCm02LinkLmm::updateState(tmgr_trace_event_t event_type,
                                       double value, double date)
 {
-  /*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
-  /*     "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
+  /*   printf("[" "%g" "] Asking to update network card \"%s\" with value " */
+  /*     "%g" " for event %p\n", surf_get_clock(), nw_link->name, */
   /*     value, event_type); */
 
   if (event_type == p_power.event) {
diff --git a/src/surf/network_constant.c b/src/surf/network_constant.c
new file mode 100644 (file)
index 0000000..8d0b9da
--- /dev/null
@@ -0,0 +1,235 @@
+/* Copyright (c) 2008-2013. 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 "surf_private.h"
+#include "surf/random_mgr.h"
+#include "xbt/dict.h"
+#include "xbt/str.h"
+#include "xbt/log.h"
+
+typedef struct surf_action_network_Constant {
+  s_surf_action_t generic_action;
+  double latency;
+  double lat_init;
+  int suspended;
+} s_surf_action_network_Constant_t, *surf_action_network_Constant_t;
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
+static int host_number_int = 0;
+
+static void netcste_count_hosts(sg_platf_host_cbarg_t h) {
+  host_number_int++;
+}
+
+static void netcste_define_callbacks(void) {
+  sg_platf_host_add_cb(netcste_count_hosts);
+}
+
+static int netcste_resource_used(void *resource_id)
+{
+  return 0;
+}
+
+static int netcste_action_unref(surf_action_t action)
+{
+  action->refcount--;
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+static void netcste_action_cancel(surf_action_t action)
+{
+  return;
+}
+
+static double netcste_share_resources(double now)
+{
+  surf_action_network_Constant_t action = NULL;
+  xbt_swag_t running_actions =
+      surf_network_model->states.running_action_set;
+  double min = -1.0;
+
+  xbt_swag_foreach(action, running_actions) {
+    if (action->latency > 0) {
+      if (min < 0)
+        min = action->latency;
+      else if (action->latency < min)
+        min = action->latency;
+    }
+  }
+
+  return min;
+}
+
+static void netcste_update_actions_state(double now, double delta)
+{
+  surf_action_network_Constant_t action = NULL;
+  surf_action_network_Constant_t next_action = NULL;
+  xbt_swag_t running_actions =
+      surf_network_model->states.running_action_set;
+
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
+    if (action->latency > 0) {
+      if (action->latency > delta) {
+        double_update(&(action->latency), delta);
+      } else {
+        action->latency = 0.0;
+      }
+    }
+    double_update(&(action->generic_action.remains),
+                  action->generic_action.cost * delta / action->lat_init);
+    if (action->generic_action.max_duration != NO_MAX_DURATION)
+      double_update(&(action->generic_action.max_duration), delta);
+
+    if (action->generic_action.remains <= 0) {
+      action->generic_action.finish = surf_get_clock();
+      surf_network_model->action_state_set((surf_action_t) action,
+                                           SURF_ACTION_DONE);
+    } else if ((action->generic_action.max_duration != NO_MAX_DURATION)
+               && (action->generic_action.max_duration <= 0)) {
+      action->generic_action.finish = surf_get_clock();
+      surf_network_model->action_state_set((surf_action_t) action,
+                                           SURF_ACTION_DONE);
+    }
+  }
+}
+
+static void netcste_update_resource_state(void *id,
+                                          tmgr_trace_event_t event_type,
+                                          double value, double time)
+{
+  DIE_IMPOSSIBLE;
+}
+
+static surf_action_t netcste_communicate(sg_routing_edge_t src,
+                                         sg_routing_edge_t dst,
+                                         double size, double rate)
+{
+  surf_action_network_Constant_t action = NULL;
+
+  char *src_name = src->name;
+  char *dst_name = dst->name;
+
+  XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+
+  action =
+      surf_action_new(sizeof(s_surf_action_network_Constant_t), size,
+                      surf_network_model, 0);
+
+  action->suspended = 0;
+
+  action->latency = sg_latency_factor;
+  action->lat_init = action->latency;
+
+  if (action->latency <= 0.0) {
+    action->generic_action.state_set =
+        surf_network_model->states.done_action_set;
+    xbt_swag_insert(action, action->generic_action.state_set);
+  }
+
+  XBT_OUT();
+
+  return (surf_action_t) action;
+}
+
+#ifdef HAVE_TRACING
+static void netcste_action_set_category(surf_action_t action, const char *category)
+{
+  //ignore completely the categories in constant model, they are not traced
+}
+#endif
+
+static double netcste_get_link_bandwidth(const void *link)
+{
+  DIE_IMPOSSIBLE;
+  return -1.0; /* useless since DIE actually abort(), but eclipse prefer to have a useless and harmless return */
+}
+
+static double netcste_get_link_latency(const void *link)
+{
+  DIE_IMPOSSIBLE;
+  return -1.0; /* useless since DIE actually abort(), but eclipse prefer to have a useless and harmless return */
+}
+
+static int link_shared(const void *link)
+{
+  DIE_IMPOSSIBLE;
+  return -1; /* useless since DIE actually abort(), but eclipse prefer to have a useless and harmless return */
+}
+
+static void netcste_action_suspend(surf_action_t action)
+{
+  ((surf_action_network_Constant_t) action)->suspended = 1;
+}
+
+static void netcste_action_resume(surf_action_t action)
+{
+  if (((surf_action_network_Constant_t) action)->suspended)
+    ((surf_action_network_Constant_t) action)->suspended = 0;
+}
+
+static int netcste_action_is_suspended(surf_action_t action)
+{
+  return ((surf_action_network_Constant_t) action)->suspended;
+}
+
+static void netcste_finalize(void)
+{
+  surf_model_exit(surf_network_model);
+  surf_network_model = NULL;
+}
+
+
+
+void surf_network_model_init_Constant()
+{
+  xbt_assert(surf_network_model == NULL);
+  if (surf_network_model)
+    return;
+  surf_network_model = surf_model_init();
+
+  surf_network_model->name = "constant time network";
+  surf_network_model->action_unref = netcste_action_unref;
+  surf_network_model->action_cancel = netcste_action_cancel;
+  surf_network_model->action_recycle = net_action_recycle;
+  surf_network_model->get_remains = surf_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  surf_network_model->get_latency_limited = net_get_link_latency_limited;
+#endif
+
+  surf_network_model->model_private->resource_used = netcste_resource_used;
+  surf_network_model->model_private->share_resources =
+      netcste_share_resources;
+  surf_network_model->model_private->update_actions_state =
+      netcste_update_actions_state;
+  surf_network_model->model_private->update_resource_state =
+      netcste_update_resource_state;
+  surf_network_model->model_private->finalize = netcste_finalize;
+
+  surf_network_model->suspend = netcste_action_suspend;
+  surf_network_model->resume = netcste_action_resume;
+  surf_network_model->is_suspended = netcste_action_is_suspended;
+  surf_cpu_model->set_max_duration = surf_action_set_max_duration;
+
+  surf_network_model->extension.network.communicate = netcste_communicate;
+  surf_network_model->extension.network.get_link_bandwidth =
+      netcste_get_link_bandwidth;
+  surf_network_model->extension.network.get_link_latency =
+      netcste_get_link_latency;
+  surf_network_model->extension.network.link_shared = link_shared;
+#ifdef HAVE_TRACING
+  surf_network_model->set_category = netcste_action_set_category;
+#endif
+
+  netcste_define_callbacks();
+  xbt_dynar_push(model_list, &surf_network_model);
+
+  routing_model_create(NULL);
+}
index 6b177d6..13fff27 100644 (file)
@@ -2,7 +2,6 @@
 #include "surf/random_mgr.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
-static random_data_t random_latency = NULL;
 static int host_number_int = 0;
 
 static void netcste_count_hosts(sg_platf_host_cbarg_t h) {
@@ -17,9 +16,6 @@ void surf_network_model_init_Constant()
   xbt_assert(surf_network_model == NULL);
   surf_network_model = new NetworkConstantModel();
 
-  if (!random_latency)
-    random_latency = random_new(RAND, 100, 0.0, 1.0, .125, .034);
-
   sg_platf_host_add_cb(netcste_count_hosts);
 
   ModelPtr model = static_cast<ModelPtr>(surf_network_model);
diff --git a/src/surf/network_gtnets.c b/src/surf/network_gtnets.c
new file mode 100644 (file)
index 0000000..4392bb3
--- /dev/null
@@ -0,0 +1,468 @@
+/* Copyright (c) 2007-2013. 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 "network_gtnets_private.h"
+#include "gtnets/gtnets_interface.h"
+#include "xbt/str.h"
+#include "surf/surfxml_parse_values.h"
+
+static double time_to_next_flow_completion = -1;
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets, surf,
+                                "Logging specific to the SURF network GTNetS module");
+
+extern routing_platf_t routing_platf;
+
+double sg_gtnets_jitter = 0.0;
+int sg_gtnets_jitter_seed = 10;
+
+static void link_new(const char *name, double bw, double lat, xbt_dict_t props)
+{
+  static int link_count = -1;
+  network_link_GTNETS_t gtnets_link;
+
+  if (xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL)) {
+    return;
+  }
+
+  XBT_DEBUG("Scanning link name %s", name);
+
+
+  gtnets_link = xbt_new0(s_network_link_GTNETS_t, 1);
+  gtnets_link->generic_resource.name = xbt_strdup(name);
+  gtnets_link->generic_resource.properties = props;
+  gtnets_link->bw_current = bw;
+  gtnets_link->lat_current = lat;
+
+  link_count++;
+
+  XBT_DEBUG("Adding new link, linkid %d, name %s, latency %g, bandwidth %g",
+           link_count, name, lat, bw);
+
+  if (gtnets_add_link(link_count, bw, lat)) {
+    xbt_die("Cannot create GTNetS link");
+  }
+  gtnets_link->id = link_count;
+
+  xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, gtnets_link);
+}
+
+static void route_new(int src_id, int dst_id, xbt_dynar_t links,
+                      int nb_link)
+{
+  network_link_GTNETS_t link;
+  unsigned int cursor;
+  int i = 0;
+  int *gtnets_links;
+
+  XBT_IN("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
+          src_id, dst_id, links, nb_link);
+
+  /* Build the list of gtnets link IDs */
+  gtnets_links = xbt_new0(int, nb_link);
+  i = 0;
+  xbt_dynar_foreach(links, cursor, link) {
+    gtnets_links[i++] = link->id;
+  }
+
+  if (gtnets_add_route(src_id, dst_id, gtnets_links, nb_link)) {
+    xbt_die("Cannot create GTNetS route");
+  }
+  XBT_OUT();
+}
+
+static void route_onehop_new(int src_id, int dst_id,
+                             network_link_GTNETS_t link)
+{
+  if (gtnets_add_onehop_route(src_id, dst_id, link->id)) {
+    xbt_die("Cannot create GTNetS route");
+  }
+}
+
+/* Parse the XML for a network link */
+static void parse_link_init(sg_platf_link_cbarg_t link)
+{
+  XBT_DEBUG("link_gtnets");
+
+  if (link->bandwidth_trace)
+    XBT_INFO
+        ("The GTNetS network model doesn't support bandwidth state traces");
+  if (link->latency_trace)
+    XBT_INFO("The GTNetS network model doesn't support latency state traces");
+  if (link->state_trace)
+    XBT_INFO("The GTNetS network model doesn't support link state traces");
+
+  if (link->policy == SURF_LINK_FULLDUPLEX)
+  {
+    link_new(bprintf("%s_UP",link->id), link->bandwidth, link->latency, current_property_set);
+    link_new(bprintf("%s_DOWN",link->id), link->bandwidth, link->latency, current_property_set);
+
+  }
+  else  link_new(link->id, link->bandwidth, link->latency, current_property_set);
+  current_property_set = NULL;
+}
+
+/* Create the gtnets topology based on routing strategy */
+static void create_gtnets_topology(void)
+{
+   XBT_DEBUG("Starting topology generation");
+// FIXME: We should take the list of hosts/routers (in the routing module), number the elements of this list,
+//   and then you can use the id to reimplement properly the following GTNets calls
+
+   //get the onelinks from the parsed platform
+   xbt_dynar_t onelink_routes = routing_platf->get_onelink_routes();
+   if (!onelink_routes)
+     return;
+
+   //save them in trace file
+   onelink_t onelink;
+   unsigned int iter;
+   xbt_dynar_foreach(onelink_routes, iter, onelink) {
+     void *link = onelink->link_ptr;
+
+     if(onelink->src->id != onelink->dst->id){
+     XBT_DEBUG("Link (#%p), src (#%s), dst (#%s), src_id = %d, dst_id = %d",
+         link,
+         onelink->src->name,
+         onelink->dst->name,
+         onelink->src->id,
+         onelink->dst->id);
+     XBT_DEBUG("Calling one link route");
+        if(onelink->src->rc_type == SURF_NETWORK_ELEMENT_ROUTER){
+          gtnets_add_router(onelink->src->id);
+        }
+        if(onelink->dst->rc_type == SURF_NETWORK_ELEMENT_ROUTER){
+         gtnets_add_router(onelink->dst->id);
+        }
+        route_onehop_new(onelink->src->id, onelink->dst->id, (network_link_GTNETS_t)(link));
+     }
+   }
+
+   if (XBT_LOG_ISENABLED(surf_network_gtnets, xbt_log_priority_debug)) {
+        gtnets_print_topology();
+   }
+}
+
+/* Main XML parsing */
+static void define_callbacks(void)
+{
+  /* Figuring out the network links */
+  sg_platf_link_add_cb (&parse_link_init);
+  sg_platf_postparse_add_cb(&create_gtnets_topology);
+}
+
+static int resource_used(void *resource_id)
+{
+  xbt_die("The resource_used feature is not implemented in GTNets model");
+}
+
+static int action_unref(surf_action_t action)
+{
+  action->refcount--;
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+#ifdef HAVE_TRACING
+    xbt_free(action->category);
+#endif
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+static void action_cancel(surf_action_t action)
+{
+  xbt_die("Cannot cancel GTNetS flow");
+  return;
+}
+
+static void action_recycle(surf_action_t action)
+{
+  xbt_die("Cannot recycle GTNetS flow");
+  return;
+}
+
+static double action_get_remains(surf_action_t action)
+{
+  return action->remains;
+}
+
+static void action_state_set(surf_action_t action,
+                             e_surf_action_state_t state)
+{
+  surf_action_state_set(action, state);
+}
+
+static double share_resources(double now)
+{
+  xbt_swag_t running_actions =
+      surf_network_model->states.running_action_set;
+
+  //get the first relevant value from the running_actions list
+  if (!xbt_swag_size(running_actions))
+    return -1.0;
+
+  xbt_assert(time_to_next_flow_completion,
+              "Time to next flow completion not initialized!\n");
+
+  XBT_DEBUG("Calling gtnets_get_time_to_next_flow_completion");
+  time_to_next_flow_completion = gtnets_get_time_to_next_flow_completion();
+  XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %g",
+         time_to_next_flow_completion);
+
+  return time_to_next_flow_completion;
+}
+
+static void update_actions_state(double now, double delta)
+{
+  surf_action_network_GTNETS_t action = NULL;
+  xbt_swag_t running_actions =
+      surf_network_model->states.running_action_set;
+
+  /* If there are no running flows, just return */
+  if (time_to_next_flow_completion < 0.0) {
+    return;
+  }
+
+  /* if delta == time_to_next_flow_completion, too. */
+  if (time_to_next_flow_completion <= delta) {  /* run until the first flow completes */
+    void **metadata;
+    int i, num_flows;
+
+    num_flows = 0;
+
+    if (gtnets_run_until_next_flow_completion(&metadata, &num_flows)) {
+      xbt_die("Cannot run GTNetS simulation until next flow completion");
+    }
+    if (num_flows < 1) {
+      xbt_die("GTNetS simulation couldn't find a flow that would complete");
+    }
+
+    xbt_swag_foreach(action, running_actions) {
+      XBT_DEBUG("Action (%p) remains old value: %f", action,
+             action->generic_action.remains);
+      double sent = gtnets_get_flow_rx(action);
+
+      XBT_DEBUG("Sent value returned by GTNetS : %f", sent);
+
+#ifdef HAVE_TRACING
+      action->last_remains = action->generic_action.remains;
+#endif
+
+     //need to trust this remain value
+     if (sent == 0) {
+       action->generic_action.remains = 0;
+      } else {
+        action->generic_action.remains =
+            action->generic_action.cost - sent;
+      }
+
+     // verify that this action is a finishing action.
+     int found=0;
+     for (i = 0; i < num_flows; i++) {
+       if(action == (surf_action_network_GTNETS_t) (metadata[i])){
+           found = 1;
+           break;
+       }
+     }
+
+     // indeed this action have not yet started
+     // because of that we need to fix the remaining to the
+     // original total cost
+     if(found != 1 && action->generic_action.remains == 0 ){
+         action->generic_action.remains = action->generic_action.cost;
+     }
+
+     XBT_DEBUG("Action (%p) remains new value: %f", action,
+             action->generic_action.remains);
+
+#ifdef HAVE_TRACING
+      if (TRACE_is_enabled()) {
+        double last_amount_sent = (action->generic_action.cost - action->last_remains);
+        double amount_sent = (action->generic_action.cost - action->generic_action.remains);
+
+        // tracing resource utilization
+        xbt_dynar_t route = NULL;
+
+        routing_get_route_and_latency (action->src, action->dst, &route, NULL);
+
+        unsigned int i;
+        for (i = 0; i < xbt_dynar_length (route); i++){
+          network_link_GTNETS_t *link = ((network_link_GTNETS_t*)xbt_dynar_get_ptr (route, i));
+          TRACE_surf_link_set_utilization ((*link)->generic_resource.name,
+                                            ((surf_action_t) action)->category,
+                                            (amount_sent - last_amount_sent)/(delta),
+                                            now-delta,
+                                            delta);
+      }
+      }
+#endif
+
+
+    }
+
+    for (i = 0; i < num_flows; i++) {
+      action = (surf_action_network_GTNETS_t) (metadata[i]);
+
+
+
+      action->generic_action.finish = now + time_to_next_flow_completion;
+      action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+      XBT_DEBUG("----> Action (%p) just terminated", action);
+
+    }
+
+
+  } else {                      /* run for a given number of seconds */
+    if (gtnets_run(delta)) {
+      xbt_die("Cannot run GTNetS simulation");
+    }
+  }
+
+  return;
+}
+
+static void update_resource_state(void *id,
+                                  tmgr_trace_event_t event_type,
+                                  double value, double date)
+{
+  xbt_die("Cannot update model state for GTNetS simulation");
+}
+
+/* Max durations are not supported */
+static surf_action_t communicate(sg_routing_edge_t src_card,
+                                 sg_routing_edge_t dst_card,
+                                 double size, double rate)
+{
+  surf_action_network_GTNETS_t action = NULL;
+
+  int src = src_card->id;
+  int dst = dst_card->id;
+  char *src_name = src_card->name;
+  char *dst_name = dst_card->name;
+
+  xbt_assert((src >= 0
+               && dst >= 0), "Either src or dst have invalid id (id<0)");
+
+  XBT_DEBUG("Setting flow src %d \"%s\", dst %d \"%s\"", src, src_name, dst,
+         dst_name);
+
+  xbt_dynar_t route = NULL;
+
+  routing_get_route_and_latency(src_card, dst_card, &route, NULL);
+
+  route_new(src, dst, route, xbt_dynar_length(route));
+
+  action =
+      surf_action_new(sizeof(s_surf_action_network_GTNETS_t), size,
+                      surf_network_model, 0);
+
+#ifdef HAVE_TRACING
+  action->last_remains = 0;
+#endif
+
+  /* Add a flow to the GTNets Simulation, associated to this action */
+  if (gtnets_create_flow(src, dst, size, (void *) action) < 0) {
+    xbt_die("Not route between host %s and host %s", src_name, dst_name);
+  }
+#ifdef HAVE_TRACING
+  TRACE_surf_gtnets_communicate(action, src_card, dst_card);
+#endif
+
+  return (surf_action_t) action;
+}
+
+/* Suspend a flow() */
+static void action_suspend(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+/* Resume a flow() */
+static void action_resume(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+/* Test whether a flow is suspended */
+static int action_is_suspended(surf_action_t action)
+{
+  return 0;
+}
+
+#ifdef HAVE_TRACING
+static void gtnets_action_set_category(surf_action_t action, const char *category)
+{
+  action->category = xbt_strdup (category);
+}
+#endif
+
+static void finalize(void)
+{
+  gtnets_finalize();
+}
+
+static void surf_network_model_init_internal(void)
+{
+  surf_network_model = surf_model_init();
+
+  surf_network_model->name = "network GTNetS";
+  surf_network_model->action_unref = action_unref;
+  surf_network_model->action_cancel = action_cancel;
+  surf_network_model->action_recycle = action_recycle;
+  surf_network_model->action_state_set = action_state_set;
+  surf_network_model->get_remains = action_get_remains;
+
+  surf_network_model->model_private->resource_used = resource_used;
+  surf_network_model->model_private->share_resources = share_resources;
+  surf_network_model->model_private->update_actions_state =
+      update_actions_state;
+  surf_network_model->model_private->update_resource_state =
+      update_resource_state;
+  surf_network_model->model_private->finalize = finalize;
+
+  surf_network_model->suspend = action_suspend;
+  surf_network_model->resume = action_resume;
+  surf_network_model->is_suspended = action_is_suspended;
+#ifdef HAVE_TRACING
+  surf_network_model->set_category = gtnets_action_set_category;
+#endif
+
+  surf_network_model->extension.network.communicate = communicate;
+
+  /* Added the initialization for GTNetS interface */
+  if (gtnets_initialize(sg_tcp_gamma)) {
+    xbt_die("Impossible to initialize GTNetS interface");
+  }
+
+  routing_model_create(NULL);
+}
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+static int get_latency_limited(surf_action_t action)
+{
+  return 0;
+}
+#endif
+
+void surf_network_model_init_GTNETS(void)
+{
+  if (surf_network_model)
+    return;
+
+  surf_network_model_init_internal();
+  define_callbacks();
+  xbt_dynar_push(model_list, &surf_network_model);
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  surf_network_model->get_latency_limited = get_latency_limited;
+#endif
+
+  if (sg_gtnets_jitter > 0.0) {
+    gtnets_set_jitter(sg_gtnets_jitter);
+    gtnets_set_jitter_seed(sg_gtnets_jitter_seed);
+  }
+}
index 2927abe..293ac16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e180da0..6398a4b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a7fc2f2..ed0ef1e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 000acc7..e9c56fb 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index b38b3fe..ee6e415 100644 (file)
@@ -88,7 +88,7 @@ void NetworkSmpiModel::gapAppend(double size, const NetworkCm02LinkLmmPtr link,
 
   if (sg_sender_gap > 0.0) {
     if (!gap_lookup) {
-      gap_lookup = xbt_dict_new();
+      gap_lookup = xbt_dict_new_homogeneous(NULL);
     }
     fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, src);
     action->m_senderGap = 0.0;
@@ -151,12 +151,12 @@ double NetworkSmpiModel::bandwidthFactor(double size)
   double current=1.0;
   xbt_dynar_foreach(smpi_bw_factor, iter, fact) {
     if (size <= fact.factor) {
-      XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current);
+      XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current);
       return current;
     }else
       current=fact.value;
   }
-  XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current);
+  XBT_DEBUG("%f > %ld return %f", size, fact.factor, current);
 
   return current;
 }
@@ -171,12 +171,12 @@ double NetworkSmpiModel::latencyFactor(double size)
   double current=1.0;
   xbt_dynar_foreach(smpi_lat_factor, iter, fact) {
     if (size <= fact.factor) {
-      XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current);
+      XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current);
       return current;
     }else
       current=fact.value;
   }
-  XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current);
+  XBT_DEBUG("%f > %ld return %f", size, fact.factor, current);
 
   return current;
 }
diff --git a/src/surf/new_model.c b/src/surf/new_model.c
new file mode 100644 (file)
index 0000000..b4346d9
--- /dev/null
@@ -0,0 +1,181 @@
+/* Copyright (c) 2004-2013. 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. */
+
+/* ********************************************************************* */
+/* TUTORIAL: New model                                                   */
+/* ********************************************************************* */
+
+#include "xbt/ex.h"
+#include "xbt/dict.h"
+#include "portable.h"
+#include "surf_private.h"
+#include "new_model_private.h"
+#include "surf/surf_resource.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_new_model, surf,
+                                "Logging specific to the SURF new model module");
+
+surf_model_t surf_new_model = NULL;
+lmm_system_t new_model_maxmin_system = NULL;
+static int new_model_selective_update = 0;
+static xbt_swag_t
+    new_model_running_action_set_that_does_not_need_being_checked = NULL;
+
+#define GENERIC_LMM_ACTION(action) action->generic_lmm_action
+#define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
+
+static void new_model_action_state_set(surf_action_t action, e_surf_action_state_t state);
+
+static surf_action_t new_model_action_execute ()
+{
+  THROW_UNIMPLEMENTED;
+  return NULL;
+}
+
+static surf_action_t new_model_action_fct()
+{
+  surf_action_t action = new_model_action_execute();
+  return action;
+}
+
+static void* new_model_create_resource(const char* id, const char* model,const char* type_id,const char* content_name)
+{
+  THROW_UNIMPLEMENTED;
+  return NULL;
+}
+
+static void new_model_finalize(void)
+{
+  lmm_system_free(new_model_maxmin_system);
+  new_model_maxmin_system = NULL;
+
+  surf_model_exit(surf_new_model);
+  surf_new_model = NULL;
+
+  xbt_swag_free
+      (new_model_running_action_set_that_does_not_need_being_checked);
+  new_model_running_action_set_that_does_not_need_being_checked = NULL;
+}
+
+static void new_model_update_actions_state(double now, double delta)
+{
+  return;
+}
+
+static double new_model_share_resources(double NOW)
+{
+  return -1;
+}
+
+static int new_model_resource_used(void *resource_id)
+{
+  THROW_UNIMPLEMENTED;
+  return 0;
+}
+
+static void new_model_resources_state(void *id, tmgr_trace_event_t event_type,
+                                 double value, double time)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static int new_model_action_unref(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;
+  return 0;
+}
+
+static void new_model_action_cancel(surf_action_t action)
+{
+  surf_action_state_set(action, SURF_ACTION_FAILED);
+  return;
+}
+
+static void new_model_action_state_set(surf_action_t action, e_surf_action_state_t state)
+{
+  surf_action_state_set(action, state);
+  return;
+}
+
+static void new_model_action_suspend(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  if (((surf_action_lmm_t) action)->suspended != 2) {
+    lmm_update_variable_weight(new_model_maxmin_system,
+                               ((surf_action_lmm_t) action)->variable,
+                               0.0);
+    ((surf_action_lmm_t) action)->suspended = 1;
+  }
+  XBT_OUT();
+}
+
+static void new_model_action_resume(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static int new_model_action_is_suspended(surf_action_t action)
+{
+  return (((surf_action_lmm_t) action)->suspended == 1);
+}
+
+static void new_model_action_set_max_duration(surf_action_t action, double duration)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static void new_model_action_set_priority(surf_action_t action, double priority)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static void new_model_define_callbacks()
+{
+}
+
+static void surf_new_model_init_internal(void)
+{
+  s_surf_action_t action;
+
+  XBT_DEBUG("surf_new_model_model_init_internal");
+  surf_new_model = surf_model_init();
+
+  new_model_running_action_set_that_does_not_need_being_checked =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+
+  surf_new_model->name = "New Model";
+  surf_new_model->action_unref = new_model_action_unref;
+  surf_new_model->action_cancel = new_model_action_cancel;
+  surf_new_model->action_state_set = new_model_action_state_set;
+
+  surf_new_model->model_private->finalize = new_model_finalize;
+  surf_new_model->model_private->update_actions_state = new_model_update_actions_state;
+  surf_new_model->model_private->share_resources = new_model_share_resources;
+  surf_new_model->model_private->resource_used = new_model_resource_used;
+  surf_new_model->model_private->update_resource_state = new_model_resources_state;
+
+  surf_new_model->suspend = new_model_action_suspend;
+  surf_new_model->resume = new_model_action_resume;
+  surf_new_model->is_suspended = new_model_action_is_suspended;
+  surf_new_model->set_max_duration = new_model_action_set_max_duration;
+  surf_new_model->set_priority = new_model_action_set_priority;
+
+  surf_new_model->extension.new_model.fct = new_model_action_fct;
+  surf_new_model->extension.new_model.create_resource = new_model_create_resource;
+
+  if (!new_model_maxmin_system) {
+    new_model_maxmin_system = lmm_system_new(new_model_selective_update);
+  }
+
+}
+
+void surf_new_model_init_default(void)
+{
+  surf_new_model_init_internal();
+  new_model_define_callbacks();
+
+  xbt_dynar_push(model_list, &surf_new_model);
+}
index b6e5b6e..f42f9f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 9e8de2d..6105510 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c09122c..d985d73 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2d5c431..0429c50 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 07cac22..ec259a0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b82d3e0..7e4d613 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3142bb8..a8cfd81 100644 (file)
 <!ATTLIST storage_type model    CDATA #REQUIRED>
 <!ATTLIST storage_type size     CDATA #REQUIRED>
 <!ATTLIST storage_type content  CDATA "">
+<!ATTLIST storage_type content_type  CDATA "txt_unix">
 
 <!ELEMENT storage (prop*)>
 <!ATTLIST storage id CDATA #REQUIRED>
 <!ATTLIST storage typeId CDATA #REQUIRED>
 <!ATTLIST storage content  CDATA "">
+<!ATTLIST storage content_type  CDATA "txt_unix">
 
 <!ELEMENT mount EMPTY>
-<!ATTLIST mount id CDATA #REQUIRED>
+<!ATTLIST mount storageId CDATA #REQUIRED>
 <!ATTLIST mount name CDATA #REQUIRED>
 
 <!ELEMENT mstorage EMPTY>
@@ -57,6 +59,7 @@
 <!ATTLIST host state (ON|OFF) "ON">
 <!ATTLIST host state_file CDATA "">
 <!ATTLIST host coordinates  CDATA "">
+<!ATTLIST host pstate CDATA "0.0">
 
 <!ELEMENT gpu EMPTY>
 <!ATTLIST gpu name CDATA #REQUIRED>
index fb7a5a7..42d9ebd 100644 (file)
@@ -403,8 +403,8 @@ static void yy_fatal_error (yyconst char msg[]  );
        *yy_cp = '\0'; \
        (yy_c_buf_p) = yy_cp;
 
-#define YY_NUM_RULES 562
-#define YY_END_OF_BUFFER 563
+#define YY_NUM_RULES 568
+#define YY_END_OF_BUFFER 569
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -412,7 +412,7 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static yyconst flex_int16_t yy_accept[3286] =
+static yyconst flex_int16_t yy_accept[3323] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -441,52 +441,52 @@ static yyconst flex_int16_t yy_accept[3286] =
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  563,  561,
-       15,   10,   10,   15,   15,  541,   10,  541,    5,    6,
-        5,    8,    9,    8,  557,  549,  550,  558,  555,  558,
-      556,  560,  549,  550,  560,  561,   22,   10,   22,   22,
-       22,   20,   22,   26,   10,   26,   26,  561,   26,  561,
+        0,    0,    0,    0,    0,    0,    0,    0,  569,  567,
+       15,   10,   10,   15,   15,  547,   10,  547,    5,    6,
+        5,    8,    9,    8,  563,  555,  556,  564,  561,  564,
+      562,  566,  555,  556,  566,  567,   22,   10,   22,   22,
+       22,   20,   22,   26,   10,   26,   26,  567,   26,  567,
 
-      561,   26,   33,   10,   33,   33,   33,   31,   33,   37,
+      567,   26,   33,   10,   33,   33,   33,   31,   33,   37,
        10,   37,   37,   48,   10,   48,   48,   48,   46,   48,
-       48,   48,  558,  557,   78,   10,   78,   78,   78,   76,
+       48,   48,  564,  563,   78,   10,   78,   78,   78,   76,
        78,   78,   78,   78,   78,   82,   10,   82,  101,   10,
       101,  101,  101,   99,  101,  101,  101,  105,   10,  105,
       126,   10,  126,  126,  126,  124,  126,  126,  130,   10,
-      130,  130,  561,  130,  561,  130,  130,  561,  561,  130,
-      561,  130,  561,  130,  143,   10,  143,  143,  143,  141,
-      143,  143,  143,  143,  147,   10,  147,  147,  158,   10,
-      158,  158,  158,  156,  158,  158,  158,  162,   10,  162,
-
-      162,  171,   10,  171,  171,  171,  169,  171,  171,  175,
-       10,  175,  184,   10,  184,  184,  184,  182,  184,  184,
-      188,   10,  188,  211,   10,  211,  211,  211,  209,  211,
-      211,  211,  211,  211,  215,   10,  215,  561,  215,  222,
-       10,  222,  222,  222,  220,  222,  226,   10,  226,  237,
-       10,  237,  237,  237,  235,  237,  237,  237,  241,   10,
-      241,  288,   10,  288,  288,  288,  286,  288,  288,  288,
-      288,  288,  288,  288,  288,  292,   10,  292,  292,  311,
-       10,  311,  311,  311,  309,  311,  311,  311,  311,  311,
-      311,  315,   10,  315,  336,   10,  336,  336,  336,  334,
-
-      336,  336,  336,  336,  336,  336,  336,  340,   10,  340,
-      349,   10,  349,  349,  349,  347,  349,  349,  353,   10,
-      353,  364,   10,  364,  364,  364,  362,  364,  364,  364,
-      368,   10,  368,  395,   10,  395,  395,  395,  393,  395,
-      395,  395,  395,  399,   10,  399,  399,  412,   10,  412,
-      412,  412,  410,  412,  412,  416,   10,  416,  561,  416,
-      433,   10,  433,  433,  433,  431,  433,  433,  433,  437,
-       10,  437,  437,  450,   10,  450,  450,  450,  448,  450,
-      450,  454,   10,  454,  463,   10,  463,  463,  463,  461,
-      463,  463,  467,   10,  467,  467,  480,   10,  480,  480,
-
-      480,  478,  480,  480,  480,  484,   10,  484,  484,  501,
-       10,  501,  501,  501,  499,  501,  501,  501,  501,  501,
-      505,   10,  505,  561,  505,  512,   10,  512,  512,  512,
-      510,  512,  516,   10,  516,  523,   10,  523,  523,  523,
-      521,  523,  527,   10,  527,  527,  536,   10,  536,  536,
-      536,  534,  536,  536,  540,   10,  540,   10,    0,    2,
-        2,    0,    4,    7,  552,  551,    0,    0,    0,    0,
+      130,  130,  567,  130,  567,  130,  130,  567,  567,  130,
+      567,  130,  567,  130,  145,   10,  145,  145,  145,  143,
+      145,  145,  145,  145,  149,   10,  149,  149,  162,   10,
+      162,  162,  162,  160,  162,  162,  162,  166,   10,  166,
+
+      166,  175,   10,  175,  175,  175,  173,  175,  175,  179,
+       10,  179,  188,   10,  188,  188,  188,  186,  188,  188,
+      192,   10,  192,  217,   10,  217,  217,  217,  215,  217,
+      217,  217,  217,  217,  221,   10,  221,  567,  221,  228,
+       10,  228,  228,  228,  226,  228,  232,   10,  232,  243,
+       10,  243,  243,  243,  241,  243,  243,  243,  247,   10,
+      247,  294,   10,  294,  294,  294,  292,  294,  294,  294,
+      294,  294,  294,  294,  294,  298,   10,  298,  298,  317,
+       10,  317,  317,  317,  315,  317,  317,  317,  317,  317,
+      317,  321,   10,  321,  342,   10,  342,  342,  342,  340,
+
+      342,  342,  342,  342,  342,  342,  342,  346,   10,  346,
+      355,   10,  355,  355,  355,  353,  355,  355,  359,   10,
+      359,  370,   10,  370,  370,  370,  368,  370,  370,  370,
+      374,   10,  374,  401,   10,  401,  401,  401,  399,  401,
+      401,  401,  401,  405,   10,  405,  405,  418,   10,  418,
+      418,  418,  416,  418,  418,  422,   10,  422,  567,  422,
+      439,   10,  439,  439,  439,  437,  439,  439,  439,  443,
+       10,  443,  443,  456,   10,  456,  456,  456,  454,  456,
+      456,  460,   10,  460,  469,   10,  469,  469,  469,  467,
+      469,  469,  473,   10,  473,  473,  486,   10,  486,  486,
+
+      486,  484,  486,  486,  486,  490,   10,  490,  490,  507,
+       10,  507,  507,  507,  505,  507,  507,  507,  507,  507,
+      511,   10,  511,  567,  511,  518,   10,  518,  518,  518,
+      516,  518,  522,   10,  522,  529,   10,  529,  529,  529,
+      527,  529,  533,   10,  533,  533,  542,   10,  542,  542,
+      542,  540,  542,  542,  546,   10,  546,   10,    0,    2,
+        2,    0,    4,    7,  558,  557,    0,    0,    0,    0,
         0,    0,    0,   21,   23,   23,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -496,285 +496,290 @@ static yyconst flex_int16_t yy_accept[3286] =
        79,   79,    0,  100,  102,  102,  102,  102,    0,  125,
       127,  127,  127,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  142,  144,  144,  144,  144,  144,    0,  157,
-      159,  159,  159,  159,    0,  170,  172,  172,  172,    0,
-      183,  185,  185,  185,    0,  210,  212,  212,  212,  212,
-      212,  212,    0,    0,  221,  223,  223,    0,  236,  238,
-      238,  238,  238,    0,  287,  289,  289,  289,  289,  289,
-
-      289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
-      289,    0,  310,  312,  312,  312,  312,  312,  312,  312,
-      312,    0,  335,  337,  337,  337,  337,  337,  337,  337,
-      337,    0,  348,  350,  350,  350,    0,  363,  365,  365,
-      365,  365,    0,  394,  396,  396,  396,  396,  396,  396,
-        0,  411,  413,  413,  413,  413,    0,    0,  432,  434,
-      434,  434,  434,  434,    0,  449,  451,  451,  451,    0,
-      462,  464,  464,  464,    0,  479,  481,  481,  481,  481,
-        0,  500,  502,  502,  502,  502,  502,  502,    0,    0,
-      511,  513,  513,    0,  522,  524,  524,    0,  535,  537,
-
-      537,  537,    0,    0,    0,    0,    0,    3,    0,    0,
-        0,    0,    0,    0,    0,  559,    0,   23,    0,    0,
-      107,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  106,    0,    0,    0,    0,    0,    0,   34,
-        0,    0,   49,    0,    0,   49,    0,    0,    0,  554,
-       79,    0,    0,   79,   79,   79,   79,   79,   79,    0,
-        0,  102,  102,  102,    0,    0,    0,    0,  127,    0,
+        0,    0,  144,  146,  146,  146,  146,  146,    0,  161,
+      163,  163,  163,  163,    0,  174,  176,  176,  176,    0,
+      187,  189,  189,  189,    0,  216,  218,  218,  218,  218,
+      218,  218,  218,    0,    0,  227,  229,  229,    0,  242,
+      244,  244,  244,  244,    0,  293,  295,  295,  295,  295,
+
+      295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
+      295,  295,    0,  316,  318,  318,  318,  318,  318,  318,
+      318,  318,    0,  341,  343,  343,  343,  343,  343,  343,
+      343,  343,    0,  354,  356,  356,  356,    0,  369,  371,
+      371,  371,  371,    0,  400,  402,  402,  402,  402,  402,
+      402,    0,  417,  419,  419,  419,  419,    0,    0,  438,
+      440,  440,  440,  440,  440,    0,  455,  457,  457,  457,
+        0,  468,  470,  470,  470,    0,  485,  487,  487,  487,
+      487,    0,  506,  508,  508,  508,  508,  508,  508,    0,
+        0,  517,  519,  519,    0,  528,  530,  530,    0,  541,
+
+      543,  543,  543,    0,    0,    0,    0,    0,    3,    0,
+        0,    0,    0,    0,    0,    0,  565,    0,   23,    0,
         0,  107,    0,    0,    0,    0,    0,    0,    0,    0,
-      106,    0,    0,    0,    0,  144,    0,    0,  144,  144,
-
-        0,    0,  159,    0,    0,  159,    0,    0,    0,    0,
-      172,    0,    0,  185,  185,    0,    0,  212,  212,  212,
-        0,    0,  212,  212,    0,    0,    0,    0,  223,    0,
-        0,  238,    0,    0,    0,    0,    0,    0,  289,  289,
-        0,    0,  289,    0,    0,  289,  289,  289,  289,  289,
-      289,  289,  289,  289,  289,    0,    0,    0,    0,    0,
-        0,  312,  312,  312,  312,  312,    0,    0,  337,  337,
-      337,    0,    0,  337,  337,  337,    0,    0,  350,    0,
-        0,    0,    0,  365,    0,    0,  365,    0,    0,  396,
-        0,    0,  396,  396,  396,    0,    0,  413,  413,  413,
-
-        0,    0,    0,  434,  434,  434,  434,    0,    0,  451,
-        0,    0,    0,    0,  464,  464,    0,    0,  481,  481,
-      481,    0,    0,  502,  502,  502,  502,  502,    0,    0,
-        0,  513,    0,    0,    0,    0,    0,    0,    0,    0,
-      537,    0,    0,    0,   14,    1,    0,    0,  547,    0,
-        0,    0,  544,  543,    0,    0,   23,    0,    0,   25,
-        0,  107,    0,    0,    0,    0,    0,    0,    0,  216,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  106,    0,    0,    0,    0,    0,
-        0,   34,    0,    0,   36,    0,   49,    0,   41,   40,
-
-       49,    0,    0,    0,   51,    0,   79,    0,   55,   54,
-        0,    0,   79,    0,    0,   79,   79,   79,    0,    0,
-       81,    0,  102,  102,  102,    0,    0,  104,    0,    0,
-      109,  108,  127,    0,    0,  129,    0,    0,    0,    0,
-      217,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      144,    0,  134,  133,  144,  144,    0,    0,  146,    0,
-      159,    0,  151,  150,  159,    0,    0,  161,    0,    0,
-      166,  165,  172,    0,    0,  174,    0,  185,  185,    0,
-        0,  187,    0,  212,  212,  212,    0,  192,  191,  212,
-      212,    0,    0,  214,    0,    0,    0,  223,    0,    0,
-
-      225,    0,  238,    0,  230,  229,    0,  232,  231,    0,
-        0,  240,    0,  289,  289,  289,  289,    0,  257,  256,
-      289,    0,  245,  244,    0,    0,  289,  289,  289,  289,
-      289,  289,  289,  289,  289,    0,    0,  291,    0,    0,
-      306,  305,    0,  296,  295,    0,    0,  312,  312,  312,
-      312,    0,    0,  314,    0,  337,  337,  337,  337,    0,
-      319,  318,    0,    0,  337,  337,    0,    0,  339,    0,
-      350,    0,  344,  343,    0,    0,  352,    0,  365,    0,
-      357,  356,  365,    0,    0,  367,    0,  396,    0,  372,
-      371,  396,  396,  396,    0,    0,  398,    0,    0,    0,
-
-        0,    0,  413,    0,    0,  415,    0,    0,    0,    0,
-      434,  434,    0,    0,  434,    0,    0,  436,    0,  451,
-        0,  441,  440,    0,    0,  453,    0,    0,    0,    0,
-        0,    0,    0,  466,    0,    0,    0,  481,  481,    0,
-        0,    0,    0,  483,    0,  502,  502,  502,  502,  502,
-        0,    0,  504,    0,    0,  513,    0,    0,  515,    0,
-        0,  520,  519,    0,    0,  526,    0,    0,  531,  530,
-      537,    0,    0,  539,    0,    0,    0,  548,  542,    0,
+        0,    0,    0,  106,    0,    0,    0,    0,    0,    0,
+       34,    0,    0,   49,    0,    0,   49,    0,    0,    0,
+      560,   79,    0,    0,   79,   79,   79,   79,   79,   79,
+        0,    0,  102,  102,  102,    0,    0,    0,    0,  127,
+        0,    0,  107,    0,    0,    0,    0,    0,    0,    0,
+        0,  106,    0,    0,    0,    0,  146,    0,    0,  146,
+
+      146,    0,    0,  163,    0,    0,  163,    0,    0,  176,
+      176,    0,    0,  189,  189,    0,    0,  218,  218,  218,
+        0,    0,  218,  218,  218,    0,    0,    0,    0,  229,
+        0,    0,  244,    0,    0,    0,    0,    0,    0,  295,
+      295,    0,    0,  295,    0,    0,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,  295,    0,    0,    0,    0,
+        0,    0,  318,  318,  318,  318,  318,    0,    0,  343,
+      343,  343,    0,    0,  343,  343,  343,    0,    0,  356,
+        0,    0,    0,    0,  371,    0,    0,  371,    0,    0,
+      402,    0,    0,  402,  402,  402,    0,    0,  419,  419,
+
+      419,    0,    0,    0,  440,  440,  440,  440,    0,    0,
+      457,    0,    0,    0,    0,  470,  470,    0,    0,  487,
+      487,  487,    0,    0,  508,  508,  508,  508,  508,    0,
+        0,    0,  519,    0,    0,    0,    0,    0,    0,    0,
+        0,  543,    0,    0,    0,   14,    1,    0,    0,  553,
+        0,    0,    0,  550,  549,    0,    0,   23,    0,    0,
+       25,    0,  107,    0,    0,    0,    0,    0,    0,    0,
+      222,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  106,    0,    0,    0,    0,
+        0,    0,   34,    0,    0,   36,    0,   49,    0,   41,
+
+       40,   49,    0,    0,    0,   51,    0,   79,    0,   55,
+       54,    0,    0,   79,    0,    0,   79,   79,   79,    0,
+        0,   81,    0,  102,  102,  102,    0,    0,  104,    0,
+        0,  109,  108,  127,    0,    0,  129,    0,    0,    0,
+        0,  223,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  146,    0,  134,  133,  146,  146,    0,    0,  148,
+        0,  163,    0,  153,  152,  163,    0,    0,  165,    0,
+      176,  176,    0,    0,  178,    0,  189,  189,    0,    0,
+      191,    0,  218,  218,  218,    0,  196,  195,  218,  218,
+      218,    0,    0,  220,    0,    0,    0,  229,    0,    0,
+
+      231,    0,  244,    0,  236,  235,    0,  238,  237,    0,
+        0,  246,    0,  295,  295,  295,  295,    0,  263,  262,
+      295,    0,  251,  250,    0,    0,  295,  295,  295,  295,
+      295,  295,  295,  295,  295,    0,    0,  297,    0,    0,
+      312,  311,    0,  302,  301,    0,    0,  318,  318,  318,
+      318,    0,    0,  320,    0,  343,  343,  343,  343,    0,
+      325,  324,    0,    0,  343,  343,    0,    0,  345,    0,
+      356,    0,  350,  349,    0,    0,  358,    0,  371,    0,
+      363,  362,  371,    0,    0,  373,    0,  402,    0,  378,
+      377,  402,  402,  402,    0,    0,  404,    0,    0,    0,
+
+        0,    0,  419,    0,    0,  421,    0,    0,    0,    0,
+      440,  440,    0,    0,  440,    0,    0,  442,    0,  457,
+        0,  447,  446,    0,    0,  459,    0,    0,    0,    0,
+        0,    0,    0,  472,    0,    0,    0,  487,  487,    0,
+        0,    0,    0,  489,    0,  508,  508,  508,  508,  508,
+        0,    0,  510,    0,    0,  519,    0,    0,  521,    0,
+        0,  526,  525,    0,    0,  532,    0,    0,  537,  536,
+      543,    0,    0,  545,    0,    0,    0,  554,  548,    0,
         0,    0,   23,    0,    0,    0,    0,    0,    0,    0,
-        0,  216,  189,    0,  369,    0,    0,  317,    0,    0,
+        0,  222,  193,    0,  375,    0,    0,  323,    0,    0,
 
-      528,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      316,    0,    0,    0,    0,    0,    0,    0,   49,    0,
+      534,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      322,    0,    0,    0,    0,    0,    0,    0,   49,    0,
         0,   79,    0,   59,   58,    0,    0,    0,   57,   56,
        79,    0,    0,   79,    0,  102,    0,    0,  102,    0,
-      127,    0,  128,    0,    0,    0,  217,  190,  370,  529,
-        0,    0,    0,    0,    0,    0,  144,  144,    0,    0,
-        0,  159,  159,    0,    0,    0,    0,    0,    0,  185,
-        0,  212,  212,    0,    0,  212,  212,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  289,  289,  289,  289,
-        0,    0,    0,  259,  258,  289,  289,  289,  289,  289,
-
-      289,  289,  289,  289,    0,    0,  308,  307,  312,  312,
-      312,  312,    0,  337,  337,  337,  337,    0,  327,  326,
-      337,  337,    0,  350,    0,  365,  365,    0,  396,  396,
-      396,  396,    0,    0,  405,  404,    0,  403,  402,  413,
-        0,  369,    0,  422,  421,  434,  434,    0,  420,  419,
-      434,    0,  451,    0,    0,  460,  459,    0,  458,  457,
-        0,    0,  473,  472,  481,  481,    0,  471,  470,    0,
-      502,    0,    0,  502,  502,  502,    0,    0,  513,    0,
-        0,  537,    0,    0,    0,    0,   12,    0,  545,  546,
-        0,   23,    0,    0,    0,    0,    0,    0,    0,    0,
-
-      189,    0,    0,  369,    0,  163,    0,  317,    0,    0,
-      528,    0,  400,    0,   39,    0,    0,    0,    0,    0,
-      316,    0,   38,    0,   30,   29,    0,    0,   43,   42,
-       49,    0,    0,   79,    0,   61,   60,   79,    0,   65,
-       64,   79,    0,  102,    0,    0,    0,    0,    0,    0,
-      127,    0,    0,    0,  190,    0,  370,  529,  401,    0,
-        0,    0,  401,  400,  144,    0,    0,    0,  138,  137,
-        0,  159,  159,    0,    0,  168,  167,    0,    0,  181,
-      180,  185,    0,  212,  212,    0,  196,  195,    0,    0,
-        0,    0,  212,    0,  164,    0,    0,  219,  218,    0,
-
-      224,    0,  234,  233,    0,  289,    0,    0,  289,  289,
-        0,  255,  254,  289,  289,    0,    0,  289,  289,  289,
-      289,  289,  289,    0,    0,    0,  312,  312,  312,    0,
-      337,    0,    0,  337,  337,    0,    0,  337,    0,  350,
-        0,  365,  365,    0,  396,  396,  396,    0,    0,  396,
-        0,  413,    0,    0,  434,  434,  434,    0,  451,    0,
-        0,  481,  481,    0,  502,    0,  488,  487,  502,  502,
-      502,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   11,    0,   23,    0,    0,    0,    0,
-        0,    0,    0,  518,    0,    0,    0,  163,    0,    0,
-
-        0,   53,  400,  341,    0,   39,    0,  517,   52,    0,
-        0,    0,    0,   38,    0,    0,   49,    0,    0,   79,
-       79,   79,    0,  102,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   96,   95,    0,  127,    0,    0,    0,
-        0,  401,  342,    0,    0,    0,  144,    0,  136,  135,
-        0,  159,    0,    0,    0,    0,    0,    0,    0,  212,
-      212,    0,  194,  193,    0,    0,    0,  212,    0,  213,
-      164,    0,    0,  289,    0,  267,  266,    0,    0,  289,
-      289,  289,    0,  253,  252,    0,    0,  289,  289,  289,
-      289,    0,    0,    0,    0,  304,  303,    0,    0,  312,
-
-        0,    0,    0,  337,    0,  323,  322,    0,    0,  337,
-        0,  321,  320,  337,    0,  338,  350,    0,  365,  365,
-        0,  396,  396,  396,    0,    0,    0,  396,    0,  397,
-      413,    0,    0,    0,    0,    0,    0,  434,    0,  451,
-        0,    0,    0,    0,    0,    0,    0,  502,  502,  502,
-      502,    0,    0,    0,  509,  508,    0,    0,    0,  533,
-      532,    0,  538,    0,    0,    0,    0,    0,    0,    0,
-      417,    0,    0,    0,    0,  294,  243,  518,    0,   28,
-        0,    0,    0,  486,   53,  341,  148,    0,  517,   52,
-      293,  242,   27,  485,    0,    0,   49,    0,    0,   50,
-
-       79,    0,    0,   79,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      418,    0,    0,    0,    0,  342,  149,    0,    0,    0,
-        0,    0,    0,  153,  152,    0,    0,  173,    0,  179,
-      178,    0,  212,  212,    0,    0,  212,    0,    0,  289,
-        0,  269,  268,  289,  289,  289,    0,  247,  246,    0,
-        0,  289,  289,  289,    0,  249,  248,    0,    0,  298,
-      297,    0,    0,    0,  300,  299,    0,  337,    0,  325,
-      324,  337,  337,  350,    0,  365,    0,    0,    0,  396,
-        0,    0,  396,  396,    0,    0,  396,  413,    0,  414,
-
-        0,    0,  426,  425,    0,  424,  423,  434,    0,  451,
-        0,    0,    0,  477,  476,    0,  475,  474,    0,  502,
-      502,  502,  502,    0,    0,    0,    0,    0,    0,    0,
-       17,    0,   19,   18,    0,  417,  506,  354,    0,    0,
-      294,  243,    0,   28,  438,  176,   16,  486,  148,    0,
-        0,  293,  242,   27,  485,    0,    0,   49,  553,   79,
-        0,   67,   66,   79,    0,   80,    0,   98,   97,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  418,  355,    0,    0,    0,  149,    0,
-        0,  140,  139,    0,    0,  155,  154,    0,    0,  212,
-
-      212,    0,    0,    0,    0,  212,  177,    0,  289,  289,
-      289,  289,    0,  251,  250,  289,  289,  289,    0,    0,
-      302,  301,    0,  337,  337,  337,  350,    0,  351,  365,
-        0,  361,  360,    0,  396,    0,  378,  377,  396,  396,
-        0,    0,    0,    0,  396,  413,  439,  434,    0,  451,
-        0,    0,    0,    0,    0,  502,  502,  502,    0,  507,
-        0,    0,  525,    0,    0,    0,   17,    0,  506,  354,
-        0,    0,  227,  438,  176,   16,    0,    0,    0,    0,
-       35,   49,    0,    0,   79,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,    0,    0,    0,  355,    0,    0,  228,
-        0,    0,    0,  160,    0,  212,  212,    0,  202,    0,
-      201,  212,  177,    0,  289,  289,  289,  289,  289,    0,
-        0,  289,  289,    0,  290,    0,  313,  337,  337,  337,
-      350,    0,    0,    0,    0,    0,  396,  396,  396,    0,
-      382,    0,  381,  396,  413,  439,  434,    0,  435,    0,
-        0,    0,    0,    0,    0,  490,  489,    0,    0,  502,
-      502,    0,  503,  507,    0,    0,    0,    0,    0,   24,
-        0,    0,  227,    0,    0,    0,   49,    0,    0,    0,
+      127,    0,  128,    0,    0,    0,  223,  194,  376,  535,
+        0,    0,    0,    0,    0,    0,  146,  146,    0,    0,
+        0,  163,  163,    0,    0,    0,  176,    0,    0,    0,
+      189,    0,  218,  218,    0,    0,  218,  218,  218,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  295,  295,
+      295,  295,    0,    0,    0,  265,  264,  295,  295,  295,
+
+      295,  295,  295,  295,  295,  295,    0,    0,  314,  313,
+      318,  318,  318,  318,    0,  343,  343,  343,  343,    0,
+      333,  332,  343,  343,    0,  356,    0,  371,  371,    0,
+      402,  402,  402,  402,    0,    0,  411,  410,    0,  409,
+      408,  419,    0,  375,    0,  428,  427,  440,  440,    0,
+      426,  425,  440,    0,  457,    0,    0,  466,  465,    0,
+      464,  463,    0,    0,  479,  478,  487,  487,    0,  477,
+      476,    0,  508,    0,    0,  508,  508,  508,    0,    0,
+      519,    0,    0,  543,    0,    0,    0,    0,   12,    0,
+      551,  552,    0,   23,    0,    0,    0,    0,    0,    0,
+
+        0,    0,  193,    0,    0,  375,    0,  167,    0,  323,
+        0,    0,  534,    0,  406,    0,   39,    0,    0,    0,
+        0,    0,  322,    0,   38,    0,   30,   29,    0,    0,
+       43,   42,   49,    0,    0,   79,    0,   61,   60,   79,
+        0,   65,   64,   79,    0,  102,    0,    0,    0,    0,
+        0,    0,  127,    0,    0,    0,  194,    0,  376,  535,
+      407,    0,    0,    0,  407,  406,  146,    0,    0,    0,
+      138,  137,    0,  163,  163,    0,    0,  172,  171,  176,
+        0,    0,  185,  184,  189,    0,  218,  218,    0,  200,
+      199,    0,    0,  218,    0,    0,  218,    0,  168,    0,
+
+        0,  225,  224,    0,  230,    0,  240,  239,    0,  295,
+        0,    0,  295,  295,    0,  261,  260,  295,  295,    0,
+        0,  295,  295,  295,  295,  295,  295,    0,    0,    0,
+      318,  318,  318,    0,  343,    0,    0,  343,  343,    0,
+        0,  343,    0,  356,    0,  371,  371,    0,  402,  402,
+      402,    0,    0,  402,    0,  419,    0,    0,  440,  440,
+      440,    0,  457,    0,    0,  487,  487,    0,  508,    0,
+      494,  493,  508,  508,  508,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   11,    0,   23,
+        0,    0,    0,    0,    0,    0,    0,  524,    0,    0,
+
+        0,  167,    0,    0,    0,   53,  406,  347,    0,   39,
+        0,  523,   52,    0,    0,    0,    0,   38,    0,    0,
+       49,    0,    0,   79,   79,   79,    0,  102,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   96,   95,    0,
+      127,    0,    0,    0,    0,  407,  348,    0,    0,    0,
+      146,    0,  136,  135,    0,  163,    0,    0,    0,  176,
+        0,    0,    0,    0,  218,  218,    0,  198,  197,    0,
+        0,    0,    0,    0,  218,    0,  219,  168,    0,    0,
+      295,    0,  273,  272,    0,    0,  295,  295,  295,    0,
+      259,  258,    0,    0,  295,  295,  295,  295,    0,    0,
+
+        0,    0,  310,  309,    0,    0,  318,    0,    0,    0,
+      343,    0,  329,  328,    0,    0,  343,    0,  327,  326,
+      343,    0,  344,  356,    0,  371,  371,    0,  402,  402,
+      402,    0,    0,    0,  402,    0,  403,  419,    0,    0,
+        0,    0,    0,    0,  440,    0,  457,    0,    0,    0,
+        0,    0,    0,    0,  508,  508,  508,  508,    0,    0,
+        0,  515,  514,    0,    0,    0,  539,  538,    0,  544,
+        0,    0,    0,    0,    0,    0,    0,  423,    0,    0,
+        0,    0,  300,  249,  524,    0,   28,    0,    0,    0,
+      492,   53,  347,  150,    0,  523,   52,  299,  248,   27,
+
+      491,    0,    0,   49,    0,    0,   50,   79,    0,    0,
        79,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  424,    0,    0,
+        0,    0,  348,  151,    0,    0,  146,    0,    0,    0,
+      163,    0,  155,  154,    0,  176,    0,  177,    0,  183,
+      182,    0,  218,  218,    0,  214,  213,    0,    0,  218,
+        0,    0,  295,    0,  275,  274,  295,  295,  295,    0,
+      253,  252,    0,    0,  295,  295,  295,    0,  255,  254,
+        0,    0,  304,  303,    0,    0,    0,  306,  305,    0,
+      343,    0,  331,  330,  343,  343,  356,    0,  371,    0,
+
+        0,    0,  402,    0,    0,  402,  402,    0,    0,  402,
+      419,    0,  420,    0,    0,  432,  431,    0,  430,  429,
+      440,    0,  457,    0,    0,    0,  483,  482,    0,  481,
+      480,    0,  508,  508,  508,  508,    0,    0,    0,    0,
+        0,    0,    0,   17,    0,   19,   18,    0,  423,  512,
+      360,    0,    0,  300,  249,    0,   28,  444,  180,   16,
+      492,  150,    0,    0,  299,  248,   27,  491,    0,    0,
+       49,  559,   79,    0,   67,   66,   79,    0,   80,    0,
+       98,   97,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  424,  361,    0,    0,
+
+        0,  151,    0,    0,  140,  139,  146,    0,    0,  157,
+      156,  163,    0,  176,    0,  218,  218,    0,    0,    0,
+        0,  218,  181,    0,  295,  295,  295,  295,    0,  257,
+      256,  295,  295,  295,    0,    0,  308,  307,    0,  343,
+      343,  343,  356,    0,  357,  371,    0,  367,  366,    0,
+      402,    0,  384,  383,  402,  402,    0,    0,    0,    0,
+      402,  419,  445,  440,    0,  457,    0,    0,    0,    0,
+        0,  508,  508,  508,    0,  513,    0,    0,  531,    0,
+        0,    0,   17,    0,  512,  360,    0,    0,  233,  444,
+      180,   16,    0,    0,    0,    0,   35,   49,    0,    0,
 
+       79,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  228,    0,    0,    0,
-      186,  212,  212,  204,  203,    0,    0,    0,  289,  289,
-      289,  289,  289,    0,  279,  278,  289,    0,    0,  337,
-      337,    0,    0,  350,    0,  359,  358,    0,  366,    0,
-      374,  373,  396,  396,  396,  384,  383,    0,    0,  413,
-      434,    0,    0,    0,    0,  452,    0,    0,    0,  494,
-      493,    0,    0,    0,    0,    0,  514,    0,    0,    0,
-        0,  455,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   79,    0,    0,    0,    0,   88,    0,
-
-        0,    0,    0,   87,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  456,    0,
-        0,  212,    0,    0,    0,  206,  205,    0,  239,  289,
-      289,  289,    0,    0,  289,  289,    0,  277,  276,  337,
-        0,    0,    0,  333,  332,    0,    0,  396,  396,  396,
-        0,  386,  385,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  492,
-      491,    0,    0,    0,    0,  455,  131,    0,    0,    0,
-       45,   44,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  361,    0,    0,  234,    0,  146,    0,  163,
+        0,  164,    0,    0,    0,  218,  218,    0,  206,    0,
+      205,  218,  181,    0,  295,  295,  295,  295,  295,    0,
+        0,  295,  295,    0,  296,    0,  319,  343,  343,  343,
+      356,    0,    0,    0,    0,    0,  402,  402,  402,    0,
+      388,    0,  387,  402,  419,  445,  440,    0,  441,    0,
+        0,    0,    0,    0,    0,  496,  495,    0,    0,  508,
+      508,    0,  509,  513,    0,    0,    0,    0,    0,   24,
+
+        0,    0,  233,    0,    0,    0,   49,    0,    0,    0,
        79,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  456,  132,    0,    0,    0,  212,    0,
-      208,  207,  289,  289,    0,    0,    0,  283,  282,    0,
-        0,  289,  337,    0,  329,  328,    0,  346,  345,  396,
-        0,    0,  396,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  234,    0,  146,    0,
+      163,    0,  170,  169,    0,  190,  218,  218,  208,  207,
+        0,    0,    0,  295,  295,  295,  295,  295,    0,  285,
+      284,  295,    0,    0,  343,  343,    0,    0,  356,    0,
+      365,  364,    0,  372,    0,  380,  379,  402,  402,  402,
+      390,  389,    0,    0,  419,  440,    0,    0,    0,    0,
+      458,    0,    0,    0,  500,  499,    0,    0,    0,    0,
+
+        0,  520,    0,    0,    0,    0,  461,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   79,    0,
+        0,    0,    0,   88,    0,    0,    0,    0,   87,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  462,    0,  146,    0,  163,  218,    0,
+        0,    0,  210,  209,    0,  245,  295,  295,  295,    0,
+        0,  295,  295,    0,  283,  282,  343,    0,    0,    0,
+      339,  338,    0,    0,  402,  402,  402,    0,  392,  391,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  498,  497,    0,    0,
+
+        0,    0,  461,  131,    0,    0,    0,   45,   44,    0,
+        0,    0,    0,    0,    0,    0,    0,   79,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  468,  131,   84,   83,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,   94,    0,    0,    0,   93,    0,    0,    0,    0,
-        0,  111,  119,    0,    0,    0,    0,  110,  118,    0,
-
-      469,  132,    0,    0,  198,  197,  212,  289,  289,    0,
-      281,  280,    0,  285,  284,  289,  337,  396,    0,  380,
-      379,  396,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  443,    0,    0,  442,    0,  465,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  468,
-       84,   83,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,   63,   62,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  113,    0,    0,    0,  112,    0,  469,    0,
-      145,  212,  289,  289,    0,    0,  337,    0,    0,    0,
+      462,  132,    0,    0,    0,    0,    0,    0,    0,  218,
+        0,  212,  211,  295,  295,    0,    0,    0,  289,  288,
+        0,    0,  295,  343,    0,  335,  334,    0,  352,  351,
+      402,    0,    0,  402,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  474,  131,   84,   83,
 
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,   75,   71,    0,    0,   74,
-       70,    0,   92,    0,    0,   91,    0,    0,    0,  103,
-        0,    0,    0,    0,    0,    0,  212,  289,  289,    0,
-        0,    0,  337,    0,  376,  375,    0,    0,    0,  409,
-        0,  408,    0,  430,    0,  429,    0,  445,  447,  444,
-      446,    0,  482,  496,    0,  495,    0,    0,    0,    0,
-       12,    0,   12,    0,    0,    0,    0,    0,   86,   90,
-       85,   89,  123,    0,  121,  122,    0,  120,  212,  289,
-      289,    0,    0,    0,    0,  337,    0,    0,    0,    0,
-
-      407,  406,  428,  427,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  115,    0,  114,    0,    0,
+        0,    0,   94,    0,    0,    0,   93,    0,    0,    0,
+        0,    0,  111,  119,    0,    0,    0,    0,  110,  118,
+        0,  475,  132,    0,  142,  141,    0,    0,  159,  158,
+        0,  202,  201,  218,  295,  295,    0,  287,  286,    0,
+      291,  290,  295,  343,  402,    0,  386,  385,  402,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  449,
+        0,    0,  448,    0,  471,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  474,   84,   83,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   63,   62,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  113,
+        0,    0,    0,  112,    0,  475,    0,  147,  218,  295,
+      295,    0,    0,  343,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   69,    0,   68,    0,    0,    0,    0,
-      200,  199,    0,  275,  274,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  331,  330,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,   11,    0,    0,    0,
+        0,    0,   75,   71,    0,    0,   74,   70,    0,   92,
+        0,    0,   91,    0,    0,    0,  103,    0,    0,    0,
+        0,    0,    0,  218,  295,  295,    0,    0,    0,  343,
+        0,  382,  381,    0,    0,    0,  415,    0,  414,    0,
+      436,    0,  435,    0,  451,  453,  450,  452,    0,  488,
+
+      502,    0,  501,    0,    0,    0,    0,   12,    0,   12,
+        0,    0,    0,    0,    0,   86,   90,   85,   89,  123,
+        0,  121,  122,    0,  120,  218,  295,  295,    0,    0,
+        0,    0,  343,    0,    0,    0,    0,  413,  412,  434,
+      433,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  115,    0,  114,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  498,  497,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       69,    0,   68,    0,    0,    0,    0,  204,  203,    0,
+      281,  280,    0,    0,    0,    0,    0,    0,    0,    0,
 
-       73,   72,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  337,  336,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,   11,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  504,  503,    0,   73,   72,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      117,  116,    0,    0,    0,    0,    0,    0,  261,    0,
-        0,  260,    0,    0,  388,    0,    0,  387,    0,    0,
-        0,    0,    0,  265,    0,  264,    0,  390,    0,  389,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  271,    0,  270,    0,    0,    0,    0,    0,
-        0,  273,  272,  263,  262,  392,  391,    0,    0,    0,
-
+        0,    0,    0,    0,    0,    0,    0,  117,  116,    0,
+        0,    0,    0,    0,    0,  267,    0,    0,  266,    0,
+        0,  394,    0,    0,  393,    0,    0,    0,    0,    0,
+
+      271,    0,  270,    0,  396,    0,  395,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  277,
+        0,  276,    0,    0,    0,    0,    0,    0,  279,  278,
+      269,  268,  398,  397,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   13,    0
+       13,    0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -821,7 +826,7 @@ static yyconst flex_int32_t yy_meta[75] =
         5,    5,    5,    5
     } ;
 
-static yyconst flex_int16_t yy_base[3766] =
+static yyconst flex_int16_t yy_base[3816] =
     {   0,
         0,    0,    0,    3,    6,    9,   12,   29,   16,   19,
        14,   17,   33,   36,   49,   55,   45,   61,   66,   72,
@@ -836,2172 +841,2204 @@ static yyconst flex_int16_t yy_base[3766] =
 
       897,  903,  921,  988,  941,  944,  947,  951, 1008, 1011,
      1014, 1018, 1055, 1123, 1075, 1078, 1081, 1085, 1143, 1146,
-     1149, 1153, 1191, 1253, 1211, 1214, 1315, 1383, 1217, 1221,
-     1451, 1518, 1224, 1273, 1276, 1279, 1283, 1286, 1335, 1338,
-     1585, 1647, 1341, 1345, 1709, 1778, 1348, 1403, 1847,    0,
-     1406, 1409, 1413, 1416, 1471, 1474, 1477, 1481, 1921, 1988,
-     1538, 1541, 2055, 2122, 1544, 1548, 2189, 2246, 1605, 1608,
-     2303, 2363, 1611, 1615, 2423, 2490, 1618, 1667, 1670, 1673,
-     1677, 1680, 1729, 1732, 2557, 2624, 1735, 1739, 1742, 1798,
-     1801, 1804, 1808, 1811, 2691, 2758, 1941, 1944, 1947, 1951,
-
-     1954, 2008, 2011, 2014, 2825, 2882, 2018, 2021, 2939, 3006,
-     2075, 2078, 2081, 2085, 2142, 2145, 2148, 2152, 3073, 3140,
-     2209, 2212, 2215, 2219, 2266, 2269, 2272, 2276, 3207, 3274,
-     2323, 2326, 2329, 2333, 2336, 2383, 2386, 2389, 3341, 3411,
-     2393, 2396, 3481, 3538, 2443, 2446, 2449, 2453, 2456, 2510,
-     2513, 2516, 3595, 3665, 2520, 2523,    0,    0, 8394,12107,
-    12107,   95,  100,   29,   41,12107,  103,   51,12107,12107,
-     8379,12107,12107, 8368,12107, 8382, 8378,  202,12107,12107,
-    12107,12107, 8376, 8370, 8324,  153,12107,  161, 8350,    0,
-      145,12107, 8315,12107,  165, 3731,   73, 2530,  315,  357,
-
-     8343, 8290,12107,  168, 8332,    0,  152,12107, 8287,12107,
-      261, 8331,   31,12107,  266, 8321,    0,  245,12107, 8283,
-     8286, 8280,  421, 8285,12107,  269, 8306,    0,  340,12107,
-     8272, 8271,  271, 8262,  238,12107,  441,  484,12107,  504,
-     8290,    0,  401,12107, 8246, 8248, 8237,12107,  561,  548,
-    12107,  571, 8282,    0,  481,12107, 8226, 8210,12107,  628,
-     3795, 8208,  163, 2532,  567,  206,   38, 8247,  954, 2523,
-      639,  907,  437,   79,12107,  634, 8238,    0,  546,12107,
-     8193, 8199, 8187, 8191,12107,  638,  313,  368,12107,  697,
-     8223,    0,  549,12107, 8179, 8188, 8158,12107,  704,  426,
-
-      497,12107,  707, 8210,    0,  747,12107, 8177, 8177,12107,
-      767,  753,12107,  773, 8205,    0,  757,12107, 8165, 8140,
-    12107,  831,  818,12107,  838, 8188,    0,  758,12107, 8137,
-     8142, 8151, 8139, 8132,12107,  841,  559,  825,  530,12107,
-      906, 8174,    0,  815,12107, 8137,12107,  914,  891,12107,
-      977, 8165,    0,  953,12107, 8120, 8125, 8112,12107,  981,
-      965,12107, 1021, 8154,    0,  966,12107, 8095,  203, 8097,
-     8094,  378,   85,  311,  972,12107, 1040,  564,  814,12107,
-     1044, 8120,    0, 1032,12107, 8068, 8085, 8069,  157, 8064,
-     8043,12107, 1048, 1086,12107, 1106, 8080,    0, 1033,12107,
-
-     8029, 8022, 8022, 8032, 8033, 8014, 8008,12107, 1111, 1099,
-    12107, 1114, 8053,    0, 1100,12107, 8005, 8013,12107, 1156,
-     1160,12107, 1173, 8043,    0, 1157,12107, 8006, 8002, 7997,
-    12107, 1180, 1228,12107, 1183, 8024,    0, 1158,12107, 7994,
-     7985, 7987,   15,12107, 1186,  899,  963,12107, 1241, 8014,
-        0, 1225,12107, 7956,  181,12107, 1248, 1294,  432,  303,
-    12107, 1305, 8002,    0, 1226,12107, 7953, 7944,  299,12107,
-     1309, 1224,  350,12107, 1365, 7994,    0, 1293,12107, 7951,
-     7954,12107, 1368, 1352,12107, 1372, 7985,    0, 1360,12107,
-     7936, 7932,12107, 1376, 1426,  676,12107, 1433, 7977,    0,
-
-     1418,12107, 7925, 7920, 7913,12107, 1438, 1436,  685,12107,
-     1503, 7958,    0, 1423,12107, 7907, 7905, 7910, 7894, 7887,
-    12107, 1507, 1504,  560, 1007,12107, 1510, 7932,    0, 1428,
-    12107, 7895,12107, 1568, 1622,12107, 1574, 7914,    0, 1482,
-    12107, 7881,12107, 1577, 1229, 1291,12107, 1635, 7902,    0,
-     1496,12107, 7869, 7870,12107, 1638, 1623, 1697,  677, 7842,
-    12107, 7903, 7891,12107,12107,12107, 1690,  253, 7842, 7840,
-     7834, 7882, 7836,12107,    0, 7829, 7829, 7843, 7815,  104,
-     1037, 7815, 7811, 7809, 7809,  889, 1636, 1105, 7797, 7797,
-     1383, 1297, 7814, 1500, 7789, 1698, 7779, 1705, 1710, 1767,
-
-    12107,    0, 7783, 7778,12107,    0, 7774, 2088, 7766,  666,
-     7759, 7805,12107,    0, 7761, 2155, 7750, 7771, 7752, 7754,
-     7742, 7736, 7721,12107,    0, 7732, 7712, 7724, 7703,12107,
-        0, 2222, 7697, 7743, 7723,  172, 7696, 7692, 7696, 1768,
-     1567, 7684, 1778, 7704,  707,  724,  814,  841, 1629, 1783,
-     1710,  888,12107,    0, 7680, 2279, 7688, 7661, 7667,12107,
-        0, 7667, 2582, 7664, 7659,12107,    0, 2588, 7656, 7653,
-    12107,    0, 7651, 7644, 7635,12107,    0, 7646,  373, 2644,
-     7622, 7635, 7626,  897,12107,    0, 7616, 7621,12107,    0,
-     7603, 2647, 2650, 7610,12107,    0, 7616, 7615, 2653, 7591,
-
-     2656, 7582, 7588, 7584, 7566, 7573, 7573, 7554, 7569, 7568,
-     7561, 7562,12107,    0, 2711, 2714, 7543, 7539, 7534, 7533,
-     7530, 7530,12107,    0, 7530, 7527, 7508, 2717, 7494, 7490,
-     7510, 7487,12107,    0, 7487, 2720, 7478,12107,    0, 7479,
-     2723, 7460, 7470,12107,    0, 7457, 2778, 7445, 7462, 7458,
-     7442,12107,    0, 7433, 7443, 7420, 7407, 7415,12107,    0,
-     7402, 7414, 7410, 7398, 7436,12107,    0, 7390, 2781, 7391,
-    12107,    0, 7382, 7392, 7391,12107,    0, 7362, 7381, 7375,
-     7374,12107,    0, 7357, 7350, 7352, 7363, 7360, 7334, 7331,
-    12107,    0, 7335, 7343,12107,    0, 2784, 7338,12107,    0,
-
-     2787, 7304, 7298, 7335, 7344, 1537, 7291,12107, 1960,    0,
-     7287, 7279, 7307, 7302, 7255,12107, 7267, 7244, 2791, 2845,
-     1980, 7251, 7252, 7228, 7237, 7216, 7218, 7210, 7210, 7215,
-     7203, 7194, 7194, 7207, 7210, 7194, 7194, 7170, 7175, 7182,
-     7168, 7160, 2047, 7167, 7146, 7158, 7151, 7129, 7142, 7133,
-     2848, 2853, 7130, 2805, 2038, 7119, 7150, 2856, 2859,12107,
-     7119, 2904, 2174, 2907, 7109, 2914, 7108, 7112, 7092, 2910,
-     2917, 7075, 7079, 7079, 2959, 2967, 2970, 2353, 7060, 2973,
-     3026, 2413, 7053, 7039, 7032, 7029, 7033, 7019, 7000, 7004,
-     2473, 7001, 6996, 6980, 6979, 6969, 2978, 2608, 6980, 6979,
-
-     3034, 3037, 6953, 3040, 2675, 6966, 3046, 3094, 3097, 2745,
-     6965, 3104, 3107, 6961, 6960, 3119, 3162, 6951, 6941, 6952,
-     3165, 2812, 6934, 6914, 3169, 3173, 6911, 6911, 6924, 3176,
-     3235, 6907, 3228, 2992, 3231, 3058, 3238, 3242, 6905, 2050,
-     3294, 3127, 6906, 3298, 3195, 3304, 6897, 6885, 6887, 6884,
-     6873, 6861, 6861, 6853, 6865, 3307, 3312, 3361, 3364, 3372,
-     3375, 3390, 3444, 3449, 3452, 3457, 3502, 3511, 6856,   37,
-     6836, 3431, 3393, 3514, 6847, 6831, 3517, 3566, 6828, 3559,
-     3401, 3562, 3569, 6841, 3572, 3434, 6838, 3618, 3641, 6831,
-     3621, 3463, 6829, 6785, 6781, 3626, 3631, 3645, 3689, 3694,
-
-     3697, 3700, 6783, 3712, 3722, 3725, 3735, 3703, 3730, 6787,
-     3743, 3471, 3755, 3763, 3774, 3799, 3802, 3806, 3809, 3821,
-     3828, 3833, 3862, 6787, 6765, 6772, 6776, 6747, 3865, 3872,
-     6757, 6722, 3887, 3891, 3839, 3651, 3894, 3897, 3868, 3900,
-     6711, 3916, 3919, 6759,12107,12107, 1070, 6717,12107, 6755,
-     6754, 6693,12107,12107, 6691, 6684, 6669, 3922, 3925,12107,
-     3928, 1704, 6662, 6650, 6658, 6659, 6650, 6636, 6644, 1837,
-     6629, 6631, 6629, 6624, 6622, 6617, 6607,  446, 6619, 6601,
-     6602, 6615, 6602, 6603, 2240, 6596, 6581, 6583, 6575, 1510,
-     6589, 3947, 3950, 3959,12107, 3969, 3965, 3972,12107,12107,
-
-     3984, 6613, 3988, 3991,12107, 3994, 6561, 3998,12107,12107,
-     4013, 4019, 4027, 4031, 4035, 6574, 4049, 6571, 4052, 4055,
-    12107, 4058, 6569, 4061, 6567, 4067, 4079,12107, 4082, 4086,
-    12107,12107, 6562, 4094, 4101,12107, 4104, 6554, 6553, 6555,
-     2297, 6535, 6542, 1772, 6524, 6524, 6536, 6535, 6505, 6503,
-     6509, 4107,12107,12107, 6501, 4115, 4123, 4126,12107, 4133,
-     6502, 4136,12107,12107, 6523, 4145, 4148,12107, 4152, 4155,
-    12107,12107, 4167, 4171, 4174,12107, 4177, 4180, 4186, 4198,
-     4204,12107, 4207, 6492, 6498, 4210, 4217,12107,12107, 6479,
-     6487, 4228, 4231,12107, 4234, 6477, 6470, 4237, 4240, 4259,
-
-    12107, 4262, 4255, 4267,12107,12107, 4281,12107,12107, 4289,
-     4292,12107, 4295, 6471, 6459, 6479, 6471, 4301,12107,12107,
-     4314, 4317,12107,12107, 4325, 4332, 6457, 6462, 6445, 6452,
-     6457, 6453, 6442, 6440, 6435, 4343, 4346,12107, 4349, 4352,
-    12107,12107, 4368,12107,12107, 4376, 4379, 6424, 6428, 6432,
-     6425, 4387, 4390,12107, 4394, 6420, 6417, 6408, 6412, 4397,
-    12107,12107, 4409, 4413, 6397, 6408, 4421, 4427,12107, 4430,
-     6391, 4433,12107,12107, 4449, 4452,12107, 4455, 6369, 4458,
-    12107,12107, 6373, 4474, 4477,12107, 4482, 6363, 4486,12107,
-    12107, 6367, 6370, 6369, 4496, 4501,12107, 4505, 4508, 4511,
-
-     4526, 4532, 6368, 4540, 4544,12107, 4548, 6360, 4551, 4569,
-     6340, 6339, 4555, 4577, 6351, 4585, 4588,12107, 4591, 6350,
-     4594,12107,12107, 4610, 4616,12107, 4619, 4622, 4625, 4640,
-     4643, 4651, 4658,12107, 4662, 4665, 4670, 6333, 6332, 4683,
-     4686, 4694, 4697,12107, 4701, 6323, 4704, 6335, 6293, 6268,
-     4707, 4716,12107, 4726, 6262, 6275, 4729, 4735,12107, 4738,
-     4741,12107,12107, 4749, 4757,12107, 4760, 4764,12107,12107,
-     6265, 4772, 4779,12107, 4782, 1099, 4792,12107,12107, 6286,
-     6285, 6246, 6157, 4801, 6137, 6143, 6151, 6131, 6079, 6071,
-     6028, 2482, 2485, 6015, 2616, 6002, 5976, 2619, 5880, 5856,
-
-     2683, 5844, 5798, 5799, 5794, 5766, 5707, 5705, 5663, 5607,
-     2686, 5544, 5517, 4804, 4822, 4807, 4813, 4831, 5466, 5491,
-     4839, 5441, 4844,12107,12107, 4852, 4859, 4870,12107,12107,
-       17, 4878, 4882,   36, 4890,  132, 4896, 4899, 4909, 4914,
-      256, 4816,12107,  313,  349,  338, 2753, 3067, 3532, 3000,
-      393,  429,  432,  460,  497,  503,  556, 4917, 4920, 4923,
-     4941,  581,  632, 4944, 4947, 4950, 4965, 4968, 4971,  633,
-     4979,  680,  698, 4986, 4989, 4998, 5009, 5012,  699,  746,
-     5016, 5020, 5034, 5037, 5041, 5049,  772, 5056,  756,  782,
-     5059, 5062, 5070,12107,12107,  793,  843, 5079,  825,  853,
-
-      854,  968,  983,  961, 5082, 5085,12107,12107, 5093, 5097,
-     5101, 5104, 5107, 1043, 5111, 1027, 1065, 5122,12107,12107,
-     5132, 1118, 5135, 1116, 5138, 1150, 1171, 5141, 1177, 1218,
-     1233, 5144, 5150, 5169,12107,12107, 5177,12107,12107, 1228,
-     5164, 4559, 5185,12107,12107, 1234, 1254, 5193,12107,12107,
-     1263, 5201, 1314, 5208, 5211,12107,12107, 5220,12107,12107,
-     5231, 5234,12107,12107, 1331, 1363, 5243,12107,12107, 5251,
-     1365, 5254, 5257, 1357, 1369, 1399, 5266, 1389, 5272, 5275,
-     5279, 5285, 5290, 1538, 1447, 5294,12107, 1462,12107,12107,
-     1425, 1428, 5299, 1423, 1440, 1471, 1487, 1502, 1531, 1546,
-
-     3100, 1564, 1573, 3265, 1594, 3269, 1597, 3322, 1600, 1619,
-     3332, 1626, 3521, 1635, 5303, 1642, 1664, 1687, 1695, 1697,
-     3336, 1685, 5309, 5318,12107,12107, 5326, 5332,12107,12107,
-     1710, 1729, 5346, 1703, 5356,12107,12107, 1712, 5365,12107,
-    12107, 1704, 5373, 1707, 5376, 2841, 2955, 5384, 5388, 5398,
-     1722, 1726, 1746, 1750, 3590, 1758, 3768, 5402, 5405, 1782,
-     1775, 1778, 5408, 5411, 1869, 5418, 5421, 5429,12107,12107,
-     5437, 1884, 5440, 5443, 5446,12107,12107, 5458, 5463,12107,
-    12107, 5477, 5480, 1910, 1899, 5485,12107,12107, 5495, 5499,
-     5508, 5513, 1909, 5521, 5526, 1915, 5529,12107,12107, 5540,
-
-    12107, 5545,12107,12107, 5553, 1916, 5559, 5562, 5572, 1904,
-     5577,12107,12107, 1910, 1928, 5585, 5590, 5603, 1920, 1938,
-     1949, 1965, 5606, 5609, 5612, 5615, 5624, 5630, 5633, 5636,
-     1977, 5642, 5651, 5660, 1966, 5663, 5666, 1976, 5681, 1969,
-     5684, 1981, 1964, 5689, 1991, 1980, 2016, 5692, 5704, 2032,
-     5712, 2028, 5715, 2044, 5719, 5722, 5725, 5743, 2040, 5746,
-     5749, 5752, 5755, 5758, 2035, 5773,12107,12107, 2051, 2049,
-     2043, 5781, 2061, 5784, 5793, 5802, 5807, 5811, 5815, 5829,
-     2101, 2100, 2167,12107, 2050, 5833, 5836, 2065, 2091, 2099,
-     2143, 2096, 2101, 5839, 2118, 2131, 2117, 5842, 2133, 2139,
-
-     2161, 5851, 5855, 5858, 2176, 5863, 2180, 5866, 5869, 2164,
-     2168, 2185, 2172, 5872, 2194, 5875, 2211, 2255, 5878, 2222,
-     5881, 2229, 5884, 5887, 2266, 2253, 2312, 2255, 2273, 2260,
-     2372, 2266, 5899,12107,12107, 5890, 5909, 2266, 2281, 2323,
-     2289, 5912, 5915, 2295, 2381, 2383, 5918, 5927,12107,12107,
-     5921, 5940, 5944, 5947, 5958, 5962, 5965, 5968, 5977, 2295,
-     2309, 5983,12107,12107, 5992, 2343, 2370, 2351, 6000,12107,
-     6003, 2357, 6007, 2361, 6012,12107,12107, 6020, 6026, 2365,
-     2391, 2395, 6034,12107,12107, 6042, 6045, 6053, 2405, 2415,
-     2408, 6056, 6060, 6074, 6077,12107,12107, 6085, 6089, 6097,
-
-     6103, 6106, 6115, 2409, 6122,12107,12107, 6130, 6134, 2419,
-     6142,12107,12107, 2415, 6150,12107, 2429, 6153, 2413, 6156,
-     6159, 2414, 6162, 2458, 6174, 2485, 2493, 2473, 6182,12107,
-     2475, 6185, 2467, 6188, 6191, 6209, 6212, 2486, 6221, 2483,
-     6227, 6230, 6233, 6236, 6251, 6254, 6262, 2486, 2488, 2482,
-     2496, 6265, 2493, 6270,12107,12107, 6284, 6288, 6292,12107,
-    12107, 6303,12107, 2573, 2772, 2536, 2518, 6307, 6310, 6318,
-     6331, 2512, 2530, 2549, 2532, 6337, 6342, 6345, 2535, 6348,
-     2543, 2553, 2547, 6351, 6354, 6357, 6360, 2550, 6363, 6366,
-     6369, 6372, 6375, 6378, 2552, 6383, 2559, 2594, 6386,12107,
-
-     2595, 6390, 6393, 2613, 6408, 6411, 6414, 2630, 2628, 2628,
-     2638, 2631, 2645, 2643, 2643, 2672, 2685, 6422, 6429, 6435,
-     6443, 2676, 2692, 2669, 2672, 6447, 6450, 6453, 6456, 6464,
-     6467, 6472, 6485,12107,12107, 6493, 6498,12107, 6501,12107,
-    12107, 6512, 2675, 2672, 2717, 2718, 2681, 2697, 6517, 2714,
-     6520,12107,12107, 2734, 2738, 2751, 6532,12107,12107, 6540,
-     6545, 2749, 2738, 2752, 6554,12107,12107, 6562, 6566,12107,
-    12107, 6574, 6577, 6585,12107,12107, 6593, 2757, 6596,12107,
-    12107, 2751, 2760, 2754, 6604, 2785, 6607, 6612, 6627, 2797,
-     6630, 6633, 2800, 2802, 2840, 2897, 2809, 2829, 6642,12107,
-
-     2819, 6648,12107,12107, 6661,12107,12107, 2847, 6656, 2842,
-     6670, 6675, 6678,12107,12107, 6690,12107,12107, 6698, 6702,
-     6708, 6712, 6720, 6726, 2854, 6730, 6733, 6738, 3069, 2916,
-     6741, 6745,12107,12107, 6753, 6760, 6763, 6766, 2861, 2862,
-     6772, 6780, 2876, 6783, 6786, 6792, 6795, 6798, 6801, 2870,
-     2893, 6804, 6807, 6813, 6816, 2902, 6819, 2897,12107, 6822,
-     6825,12107,12107, 6833, 6840,12107, 6844,12107,12107, 2942,
-     2928, 2964, 2967, 2974, 2980, 2982, 3005, 3000, 3008, 6852,
-     6855, 5765, 6838, 6864, 6867, 2969, 2976, 2988, 6872, 2983,
-     6875,12107,12107, 6883, 6886,12107,12107, 6894, 6902, 2998,
-
-     3003, 3036, 3062, 3045, 3086, 3059, 6905, 6908, 3056, 3062,
-     3061, 3131, 6914,12107,12107, 6922, 3063, 3081, 6930, 6933,
-    12107,12107, 6941, 3078, 3084, 3085, 3103, 6944,12107, 6949,
-     6954,12107,12107, 6963, 6969, 6972,12107,12107, 6982, 6987,
-     3136, 3168, 3156, 3176, 6990, 3139, 6993, 3141, 7000, 6996,
-     7008, 7020, 7027, 7023, 7032, 7042, 7049, 7052, 7055, 7060,
-     7070, 7074,12107, 7077, 3270, 3186, 7082, 7089, 7085, 7096,
-     3131, 3132, 7104, 7108, 7111, 7114, 3129, 3141, 3143, 7117,
-    12107, 3150, 7120, 7123, 3191, 3206, 3203, 3217, 3208, 3219,
-     3216, 3212, 3229, 3217, 3265, 7131, 3244, 3255, 3329, 3255,
-
-     3262, 3269, 3274, 3410, 3294, 3312, 7140, 3308, 3314, 7143,
-     3310, 7146, 7150,12107, 7153, 3317, 3319, 3384,12107, 3391,
-    12107, 7156, 7159, 7165, 3333, 3358, 3346, 3356, 3390, 7175,
-     7178, 3381, 7186, 7193,12107, 7196,12107, 3374, 3377, 7199,
-     3378, 7204, 7223, 7208, 7217, 7231, 7239, 7242, 7245, 3443,
-    12107, 3453,12107, 7248, 3404, 7251, 3418, 7266,12107, 7269,
-     7272, 7280, 7287, 7292, 7295,12107,12107, 7306, 7311, 7319,
-     7324, 7327,12107, 7330, 7333, 3557, 3510, 3563, 7337,12107,
-     3438, 3455, 7342, 3446, 3459, 3473, 7346, 7357, 3726, 3908,
-     3466, 3502, 3532, 3555, 3559, 3582, 3560, 3589, 3594, 3605,
-
-     3622, 7365, 3567, 3579, 3576, 3590, 3594, 3588, 3590, 3604,
-     3600, 3621, 3625, 3619, 3625, 3642, 7368, 3645, 7371, 7374,
-    12107, 3637, 7377,12107,12107, 7380, 7384, 7398, 3645, 3655,
-     3662, 7401, 3662, 7404,12107,12107, 3683, 7412, 7419, 3669,
-     7430, 7433, 7436, 7444, 7451,12107,12107, 7462,12107, 7465,
-    12107,12107, 7473, 7476, 7481,12107,12107, 7484, 7487, 7495,
-     7502, 7506, 3813, 4001, 7514,12107, 7520, 7523, 7533,12107,
-    12107, 7529, 7543, 7551, 7554, 7562,12107, 3736, 3728, 3753,
-     3681, 7565, 3707, 3717, 3728, 7570, 7574, 3746, 3758, 3792,
-     3781, 3785, 3912, 3767, 3808, 3792, 3794, 3807,12107, 3832,
-
-     3818, 3832, 3836,12107, 7588, 3813, 3822, 3810, 3824, 3833,
-     3856, 3841, 3851, 3839, 3853, 3862, 3867, 3869, 7591, 3887,
-     7594, 7597, 7600, 7603, 7618,12107,12107, 7626,12107, 3893,
-     3881, 7629, 7632, 7650, 7636, 3904, 7658,12107,12107, 3908,
-     7666, 7669, 7677,12107,12107, 7685, 7688, 7696, 7699, 7703,
-     7707,12107,12107, 7717, 7721, 7729, 7735, 3922, 3923, 3927,
-     3929, 3944, 3945, 7743, 7747, 7755, 3974, 3980, 7766,12107,
-    12107, 3999, 3990, 7774, 3930, 7640, 7777, 3938, 3941, 7780,
-    12107,12107, 3991, 3989, 3992, 4012, 4026, 4014, 4031, 4045,
-     7788, 4034, 4054, 4071, 4057, 4051, 4071, 4085, 4078, 7795,
-
-     4033, 4045, 4063, 4116, 4117, 4072, 4065, 4074, 4092, 4151,
-     4153, 4103, 4113, 7798, 7801, 7806, 7809, 7815, 4113, 7827,
-    12107,12107, 4131, 4127, 7835, 7838, 7846,12107,12107, 7854,
-     7858, 4119, 4139, 7866,12107,12107, 7874,12107,12107, 7882,
-     7885, 7888, 7896, 7903, 4210, 4232, 7914, 4233, 4279, 4152,
-     4163, 4197, 4161, 4182, 4213, 7922, 7925, 4195, 4202, 4217,
-     4223, 4232, 7928, 7934, 7937, 7947, 7956, 7959, 7962, 4215,
-     4227, 4247, 4241, 4246, 4262, 4264, 4261, 7968, 7971, 4273,
-     4276,12107, 4278, 4282, 4283,12107, 4292, 7979, 4272, 4262,
-     4326,12107,12107, 4285, 4286, 4272, 4333,12107,12107, 4291,
-
-     7982, 7986, 7992, 7998,12107,12107, 4300, 4302, 4303, 8007,
-    12107,12107, 8015,12107,12107, 8023, 4307, 8026, 8029,12107,
-    12107, 8037, 4329, 4341, 4332, 4347, 4339, 4350, 4348, 4360,
-     4352, 4376,12107, 4369, 4379,12107, 8046,12107, 8049, 4382,
-     4370, 4394, 4382, 4407, 8055, 8058, 8077, 8102, 8149, 8068,
-     8085, 8088, 4401, 4432, 4434, 4403, 4420, 4437, 4439, 4409,
-     8092,12107,12107, 4457, 4432, 4433, 4459, 4438, 4440, 8113,
-     4408, 4416,12107, 4430, 4425, 4427,12107, 4439, 8122, 8125,
-    12107, 4441, 4446, 4467, 8128, 8132, 4459, 8140, 8169, 8160,
-     8178, 4516, 4484, 4517, 4492, 4526, 4498, 4530, 4501, 4543,
-
-     4550, 4556, 4557, 8186, 4563, 4536, 4568, 4542, 4582, 8195,
-     4579, 4595, 8215, 8262, 4570,12107,12107, 4563, 4592,12107,
-    12107, 4571,12107, 4604, 4610,12107, 4623, 4624, 8189,12107,
-     4629, 4588, 4632, 4631, 4601, 4642, 4603, 4605, 4590, 8235,
-     4685, 4686, 4617, 8243,12107,12107, 8251, 4695, 4751,12107,
-     4669,12107, 4668,12107, 4674,12107, 4674,12107,12107,12107,
-    12107, 8208,12107,12107, 4669,12107, 4671, 4674, 4751, 4695,
-     4742, 4778, 4745, 8273, 4741, 4746, 4764, 4762,12107,12107,
-    12107,12107,12107, 4833,12107,12107, 4805,12107, 8282, 8285,
-     8288, 4808, 4762, 4829, 4768, 8293, 4836, 4771, 4842, 4772,
-
-    12107,12107,12107,12107, 4800, 4806, 8296, 4846, 4839, 4857,
-     8311, 4869, 4856, 4878, 4867,12107, 4846,12107, 4847, 8315,
-     8318, 8326, 8333, 8344, 8347, 4864, 4873, 4885, 4869, 4881,
-     4908, 8355, 8363, 4891, 4900, 4913, 4897, 4905, 4918, 4901,
-     4915, 8358, 4937,12107, 4924,12107, 4926, 4911, 4912, 8373,
-    12107,12107, 8381,12107,12107, 8389, 4957, 4967, 4939, 4945,
-     4941, 4949, 4964, 4965, 8397,12107,12107, 4967, 4975, 4971,
-     4984, 4992, 4992, 5025, 5024, 5047,12107, 5028, 5037, 4992,
-     4993, 5033, 5041, 5055, 5061, 5063, 5093, 5093, 5091, 5097,
-     5103, 5102, 5108, 5130, 5127, 5134, 5134,12107,12107, 5154,
-
-    12107,12107, 5109, 5112, 5137, 5160, 5145, 5168, 5161, 5166,
-     5183, 5179, 5177, 5194, 5188, 5186, 5205, 5194, 5198, 5216,
-     5222, 5238, 5239, 5213, 5227, 5235, 5246, 5259, 5253, 5302,
-     5283, 5278, 5307, 5292, 5286, 5319, 5300, 5294, 5323, 5317,
-    12107,12107, 5309, 5314, 5312, 5319, 5346, 5322,12107, 5347,
-     5328,12107, 5357, 5337,12107, 5363, 5340,12107, 5364, 5344,
-     5358, 5352, 5371,12107, 5390,12107, 5391,12107, 5393,12107,
-     5400, 8405, 5402, 5423, 5408, 5444, 5410, 5412, 5414, 5420,
-     8408, 5462,12107, 5461,12107, 5467, 5466, 5470, 5476, 5484,
-     5489,12107,12107,12107,12107,12107,12107, 5501, 5514, 5516,
-
-     5517, 5475, 5486, 5582, 5631, 5547, 5583, 5630, 5661, 5533,
-     5638, 5621, 5677, 5610, 5628, 5710, 5753, 5557, 5654, 5679,
-     5683, 5500, 5538, 5722, 5761, 5773, 5877, 5744, 5919, 5639,
-     5680, 5760, 5830, 5920, 5935, 5938, 5980, 5809, 5915, 5968,
-     6011, 5937, 5988, 5999, 6054, 6014, 6033, 5934, 5992, 6062,
-     6091, 6076, 6093, 6101, 6103, 6130, 6162, 6176, 6179, 6151,
-     6152, 5932, 6183, 5997, 6206, 6251, 6261, 6242, 6273, 5660,
-     6077, 6264, 6304, 6197, 6207, 5552, 6257, 6228, 6231, 5487,
-     6094, 8416, 8419,12107,12107, 8439, 8448, 8457, 8466, 8475,
-     8484, 8493, 8502, 8511, 8520, 8529, 8538, 8547, 8556, 8565,
-
-     8574, 8583, 8592, 8601, 8610, 8619, 8628, 8637, 8646, 8655,
-     8664, 8673, 8682, 8691, 8700, 8709, 8718, 8727, 8736, 8745,
-     8754, 8763, 8772, 8781, 8790, 8799, 8808, 8817, 8826, 8835,
-     8844, 8853, 8862, 8871, 8880, 8889, 8898, 8907, 8916, 8925,
-     8934, 8943, 8952, 8961, 8970, 8979, 8986, 8993, 9000, 9007,
-     9014, 9021, 9028, 9035, 9042, 9049, 9056, 9063, 9070, 9077,
-     9084, 9091, 9098, 9105, 9112, 9119, 9126, 9133, 9140, 9147,
-     9154, 9161, 9168, 9175, 9184, 9191, 9196, 9203, 9208, 9215,
-     9220, 9227, 9232, 9239, 9244, 9251, 9256, 9263, 9268, 9275,
-     9280, 9287, 9292, 9299, 9304, 9311, 9316, 9323, 9328, 9335,
-
-     9340, 9347, 9352, 9359, 9364, 9371, 9376, 9383, 9388, 9395,
-     9400, 9407, 9412, 9419, 9424, 9431, 9436, 9443, 9448, 9455,
-     9460, 9467, 9472, 9479, 9484, 9491, 9496, 9503, 9508, 9515,
-     9520, 9529, 9535, 9542, 9550, 9557, 9565, 9572, 9580, 9587,
-     9595, 9602, 9610, 9617, 9625, 9632, 9640, 9647, 9655, 9662,
-     9670, 9677, 9685, 9692, 9700, 9707, 9715, 9722, 9730, 9737,
-     9745, 9753, 9761, 9768, 9776, 9783, 9791, 9798, 9806, 9813,
-     9821, 9829, 9837, 9845, 9853, 9860, 9868, 9876, 9884, 9892,
-     9900, 9907, 9915, 9922, 9930, 9938, 9945, 9953, 9962, 9968,
-     9975, 9983, 9991, 9999,10007,10015,10022,10030,10037,10045,
-
-    10052,10060,10067,10075,10082,10090,10098,10106,10114,10122,
-    10129,10137,10145,10153,10161,10169,10176,10184,10191,10199,
-    10206,10214,10221,10229,10236,10244,10251,10259,10266,10274,
-    10281,10289,10296,10304,10312,10319,10327,10334,10342,10349,
-    10357,10365,10372,10380,10389,10398,10405,10413,10421,10428,
-    10436,10443,10451,10458,10466,10473,10480,10488,10495,10503,
-    10511,10518,10526,10533,10541,10549,10557,10564,10572,10580,
-    10588,10595,10603,10610,10618,10625,10633,10640,10648,10655,
-    10663,10670,10678,10685,10693,10701,10708,10716,10723,10731,
-    10739,10747,10755,10763,10771,10780,10789,10796,10804,10812,
-
-    10819,10827,10834,10842,10849,10857,10864,10871,10879,10886,
-    10894,10902,10910,10918,10925,10933,10941,10948,10956,10964,
-    10972,10979,10987,10994,11002,11009,11017,11024,11032,11039,
-    11047,11055,11063,11070,11078,11086,11094,11102,11109,11117,
-    11125,11133,11141,11150,11159,11167,11175,11183,11190,11198,
-    11205,11213,11221,11229,11237,11245,11253,11261,11269,11277,
-    11285,11292,11300,11307,11315,11323,11331,11338,11345,11353,
-    11360,11368,11375,11382,11390,11397,11405,11412,11420,11428,
-    11436,11443,11451,11459,11467,11476,11485,11493,11501,11508,
-    11515,11523,11531,11539,11547,11555,11562,11570,11577,11585,
-
-    11593,11600,11607,11615,11622,11630,11637,11644,11651,11659,
-    11666,11674,11682,11690,11698,11706,11714,11722,11731,11740,
-    11748,11756,11763,11771,11779,11787,11795,11803,11810,11818,
-    11825,11833,11841,11848,11855,11863,11871,11879,11886,11893,
-    11901,11909,11917,11925,11933,11941,11949,11957,11966,11975,
-    11983,11990,11997,12005,12013,12021,12028,12036,12043,12052,
-    12061,12070,12079,12088,12097
+     1149, 1153, 1191, 1258, 1211, 1214, 1325, 1393, 1217, 1221,
+     1461, 1528, 1224, 1278, 1281, 1284, 1288, 1291, 1345, 1348,
+     1595, 1657, 1351, 1355, 1719, 1788, 1358, 1413, 1857,    0,
+     1416, 1419, 1423, 1426, 1481, 1484, 1487, 1491, 1931, 1998,
+     1548, 1551, 2065, 2132, 1554, 1558, 2199, 2256, 1615, 1618,
+     2313, 2373, 1621, 1625, 2433, 2500, 1628, 1677, 1680, 1683,
+     1687, 1690, 1739, 1742, 2567, 2634, 1745, 1749, 1752, 1808,
+     1811, 1814, 1818, 1821, 2701, 2768, 1951, 1954, 1957, 1961,
+
+     1964, 2018, 2021, 2024, 2835, 2892, 2028, 2031, 2949, 3016,
+     2085, 2088, 2091, 2095, 2152, 2155, 2158, 2162, 3083, 3150,
+     2219, 2222, 2225, 2229, 2276, 2279, 2282, 2286, 3217, 3284,
+     2333, 2336, 2339, 2343, 2346, 2393, 2396, 2399, 3351, 3421,
+     2403, 2406, 3491, 3548, 2453, 2456, 2459, 2463, 2466, 2520,
+     2523, 2526, 3605, 3675, 2530, 2533,    0,    0, 8437,12292,
+    12292,   95,  100,   29,   41,12292,  103,   51,12292,12292,
+     8426,12292,12292, 8414,12292, 8429, 8428,  202,12292,12292,
+    12292,12292, 8422, 8422, 8372,  153,12292,  161, 8398,    0,
+      145,12292, 8363,12292,  165, 3741,   73, 2540,  315,  357,
+
+     8392, 8339,12292,  168, 8379,    0,  152,12292, 8341,12292,
+      261, 8384,   31,12292,  266, 8375,    0,  245,12292, 8314,
+     8314, 8312,  421, 8305,12292,  269, 8331,    0,  340,12292,
+     8296, 8292,  271, 8294,  238,12292,  441,  484,12292,  504,
+     8321,    0,  401,12292, 8276, 8278, 8267,12292,  561,  548,
+    12292,  571, 8304,    0,  481,12292, 8271, 8259,12292,  628,
+     3805, 8255,  163, 2542,  567,  206,   38, 8306,  954, 2533,
+      639,  907,  437,   79,12292,  634, 8287,    0,  546,12292,
+     8243, 8249, 8237, 8241,12292,  638,  313,  368,12292,  697,
+     8276,    0,  549,12292, 8232, 8241, 8214,12292,  704,  426,
+
+      497,12292,  707, 8259,    0,  747,12292, 8229, 8208,12292,
+      767,  753,12292,  773, 8250,    0,  757,12292, 8220, 8194,
+    12292,  831,  818,12292,  838, 8238,    0,  758,12292, 8183,
+     8176, 8181,  251, 8164,12292,  841,  559,  825,  530,12292,
+      906, 8210,    0,  815,12292, 8162,12292,  914,  891,12292,
+      977, 8186,    0,  953,12292, 8142, 8142, 8129,12292,  981,
+      965,12292, 1021, 8171,    0,  966,12292, 8120,  203, 8125,
+     8131,  378,   85,  311,  972,12292, 1040,  564,  814,12292,
+     1044, 8152,    0, 1032,12292, 8098, 8111, 8112,  157, 8109,
+     8087,12292, 1048, 1086,12292, 1106, 8132,    0, 1033,12292,
+
+     8080, 8068, 8075, 8080, 8082, 8055, 8049,12292, 1111, 1099,
+    12292, 1114, 8095,    0, 1100,12292, 8047, 8057,12292, 1156,
+     1160,12292, 1173, 8087,    0, 1157,12292, 8052, 8047, 8046,
+    12292, 1180, 1228,12292, 1183, 8073,    0, 1158,12292, 8043,
+     8038, 8033,   15,12292, 1186,  899,  963,12292, 1241, 8059,
+        0, 1225,12292, 8007,  181,12292, 1248, 1243,  432,  303,
+    12292, 1308, 8053,    0, 1226,12292, 7994, 7989,  299,12292,
+     1311, 1229,  350,12292, 1314, 8038,    0, 1303,12292, 7993,
+     7997,12292, 1319, 1362,12292, 1375, 8018,    0, 1359,12292,
+     7970, 7968,12292, 1382, 1378,  676,12292, 1445, 8006,    0,
+
+     1360,12292, 7949, 7944, 7938,12292, 1448, 1446,  685,12292,
+     1494, 7983,    0, 1370,12292, 7932, 7933, 7938, 7931, 7924,
+    12292, 1513, 1514,  560, 1007,12292, 1517, 7970,    0, 1438,
+    12292, 7936,12292, 1520, 1559,12292, 1579, 7964,    0, 1506,
+    12292, 7926,12292, 1584, 1210, 1236,12292, 1587, 7957,    0,
+     1563,12292, 7923, 7915,12292, 1645, 1632, 1648,  677, 7891,
+    12292, 7951, 7935,12292,12292,12292, 1641,  375, 7885, 7880,
+     7878, 7925, 7877,12292,    0, 7868, 7864, 7888, 7859,  104,
+     1037, 7853, 7853, 7852, 7852,  889, 1646, 1105, 7839, 7840,
+     1393, 1307, 7865, 1510, 7836, 1649, 7830, 1647, 1708, 1709,
+
+    12292,    0, 7831, 7833,12292,    0, 7828, 2098, 7810,  666,
+     7806, 7850,12292,    0, 7806, 2165, 7794, 7815, 7801, 7794,
+     7789, 7789, 7773,12292,    0, 7772, 7762, 7773, 7749,12292,
+        0, 2232, 7747, 7791, 7772,  172, 7742, 7741, 7746, 1719,
+     1319, 7726, 1720, 7754,  707,  724,  814,  841, 1577, 1651,
+     1701,  888,12292,    0, 7729, 2289, 7734, 7711, 7713,12292,
+        0, 7717, 2592, 7713, 7701,12292,    0, 7704, 7700, 7698,
+    12292,    0, 7686, 7682, 7683,12292,    0, 7686,  758, 2598,
+     7662, 7660, 7678, 7661,  897,12292,    0, 7655, 7659,12292,
+        0, 7635, 2654, 2657, 7649,12292,    0, 7654, 7654, 2660,
+
+     7634, 2663, 7628, 7633, 7627, 7608, 7625, 7624, 7601, 7620,
+     7617, 7604, 7603,12292,    0, 2666, 2721, 7569, 7565, 7580,
+     7579, 7570, 7572,12292,    0, 7563, 7563, 7544, 2724, 7537,
+     7533, 7545, 7529,12292,    0, 7528, 2727, 7517,12292,    0,
+     7520, 2730, 7512, 7529,12292,    0, 7511, 2733, 7503, 7520,
+     7514, 7502,12292,    0, 7489, 7505, 7489, 7483, 7490,12292,
+        0, 7468, 7487, 7482, 7471, 7507,12292,    0, 7457, 2788,
+     7448,12292,    0, 7439, 7454, 7446,12292,    0, 7427, 7445,
+     7437, 7437,12292,    0, 7419, 7413, 7418, 7422, 7420, 7400,
+     7397,12292,    0, 7401, 7411,12292,    0, 2791, 7407,12292,
+
+        0, 2794, 7392, 7382, 7425, 7433, 1807, 7370,12292, 1833,
+        0, 7364, 7364, 7408, 7392, 7345,12292, 7357, 7324, 2797,
+     2801, 1981, 7335, 7337, 7319, 7332, 7306, 7312, 7300, 7297,
+     7312, 7299, 7274, 7274, 7287, 7282, 7266, 7265, 7255, 7259,
+     7269, 7243, 7240, 1990, 7244, 7224, 7240, 7237, 7218, 7221,
+     7215, 2855, 2860, 7210, 2864, 2048, 7205, 7236, 2868, 2912,
+    12292, 7194, 2915, 2117, 2921, 7184, 2924, 7187, 7187, 7189,
+     2927, 2983, 7175, 7178, 7178, 2969, 2972, 2978, 2184, 7159,
+     3037, 3040, 2363, 7175, 7148, 7141, 7142, 7144, 7137, 7116,
+     7115, 2423, 7113, 7111, 7085, 7081, 7077, 2996, 2618, 7091,
+
+     7089, 3044, 3047, 7048, 3050, 2685, 7061, 3103, 3106, 7060,
+     7040, 3114, 3117, 7052, 7050, 3129, 3173, 7045, 7018, 7029,
+     3109, 2755, 7027, 7030, 7009, 3179, 3183, 7003, 7002, 7006,
+     3186, 3245, 6992, 3239, 2822, 3248, 3002, 3252, 3257, 6994,
+     1920, 3304, 3068, 6993, 3308, 3137, 3313, 6985, 6966, 6975,
+     6972, 6961, 6947, 6948, 6941, 6954, 3322, 3383, 3331, 3205,
+     3371, 3374, 3389, 3392, 3397, 3450, 3459, 3444, 3468, 6940,
+       37, 6930, 3454, 3403, 3512, 6938, 6922, 3516, 3519, 6922,
+     3522, 3411, 3525, 3571, 6925, 3574, 3473, 6923, 3577, 3580,
+     6917, 3583, 3481, 6909, 6894, 6882, 3628, 3634, 3637, 3640,
+
+     3695, 3643, 3698, 6887, 3701, 3705, 3708, 3732, 3713, 3727,
+     6894, 3735, 3662, 3738, 3765, 3746, 3775, 3779, 3784, 3809,
+     3812, 3816, 3821, 3830, 6885, 6867, 6873, 6877, 6864, 3843,
+     3872, 6868, 6853, 3878, 3881, 3834, 3884, 3892, 3902, 3840,
+     3905, 6847, 3913, 3916, 6885,12292,12292, 1070, 6843,12292,
+     6885, 6880, 6829,12292,12292, 6826, 6818, 6828, 3921, 3924,
+    12292, 3928, 1714, 6791, 6783, 6789, 6794, 6784, 6769, 6781,
+     1779, 6765, 6756, 6756, 6732, 6720, 6716, 6712,  446, 6723,
+     6706, 6697, 6711, 6701, 6677, 1849, 6671, 6655, 6660, 6645,
+     1381, 6659, 3947, 3950, 3953,12292, 3956, 3959, 3965,12292,
+
+    12292, 3977, 6681, 3981, 3984,12292, 3988, 6635, 3991,12292,
+    12292, 4007, 4010, 4019, 4025, 4030, 6649, 4039, 6642, 4043,
+     4046,12292, 4049, 6638, 4052, 6636, 4057, 4070,12292, 4076,
+     4079,12292,12292, 6631, 4089, 4095,12292, 4098, 6623, 6619,
+     6625, 1852, 6604, 6612, 1449, 6601, 6593, 6609, 6607, 6583,
+     6578, 6591, 4101,12292,12292, 6583, 4110, 4117, 4120,12292,
+     4124, 6588, 4129,12292,12292, 6600, 4139, 4143,12292, 4146,
+     4149, 4152, 4158, 4170,12292, 4173, 4177, 4180, 4200, 4203,
+    12292, 4209, 6568, 6574, 4212, 4215,12292,12292, 6559, 6555,
+     6569, 4223, 4230,12292, 4233, 6558, 6552, 4236, 4242, 4245,
+
+    12292, 4254, 4257, 4264,12292,12292, 4276,12292,12292, 4284,
+     4287,12292, 4290, 6547, 6535, 6555, 6539, 4293,12292,12292,
+     4309, 4312,12292,12292, 4322, 4327, 6525, 6538, 6521, 6519,
+     6523, 6517, 6508, 6511, 6501, 4335, 4340,12292, 4343, 4347,
+    12292,12292, 4362,12292,12292, 4370, 4373, 6490, 6498, 6497,
+     6490, 4381, 4384,12292, 4388, 6485, 6477, 6465, 6481, 4391,
+    12292,12292, 4403, 4407, 6465, 6473, 4415, 4421,12292, 4424,
+     6473, 4427,12292,12292, 4443, 4446,12292, 4449, 6449, 4452,
+    12292,12292, 6457, 4468, 4471,12292, 4476, 6446, 4480,12292,
+    12292, 6441, 6444, 6441, 4490, 4495,12292, 4499, 4502, 4505,
+
+     4520, 4526, 6434, 4534, 4538,12292, 4542, 6426, 4545, 4563,
+     6413, 6412, 4549, 4571, 6406, 4579, 4582,12292, 4585, 6407,
+     4588,12292,12292, 4604, 4610,12292, 4613, 4616, 4619, 4634,
+     4637, 4645, 4652,12292, 4656, 4659, 4664, 6371, 6369, 4677,
+     4680, 4688, 4691,12292, 4695, 6354, 4698, 6369, 6367, 6346,
+     4701, 4710,12292, 4720, 6333, 6347, 4723, 4729,12292, 4732,
+     4735,12292,12292, 4743, 4751,12292, 4754, 4758,12292,12292,
+     6346, 4766, 4773,12292, 4776, 1099, 4786,12292,12292, 6379,
+     6378, 6332, 6263, 4795, 6229, 6236, 6245, 6203, 6150, 6131,
+     6085, 2057, 2250, 6049, 2307, 6047, 6032, 2483, 6031, 5953,
+
+     2492, 5912, 5878, 5881, 5739, 5734, 5704, 5620, 5613, 5561,
+     2495, 5575,   13, 4798, 4816, 4801, 4807, 4825,   37,  172,
+     4833,  268, 4838,12292,12292, 4846, 4853, 4864,12292,12292,
+      333, 4872, 4876,  346, 4884,  343, 4890, 4893, 4903, 4908,
+      384, 4810,12292,  409,  449,  460, 2626, 2629, 2693, 2696,
+      497,  507,  551,  576,  631,  632,  667, 4911, 4914, 4917,
+     4935,  693,  715, 4938, 4941, 4944,  757, 4959, 4962, 4965,
+      779, 4973,  797,  835, 4980, 4983, 4992,  844, 5003, 5006,
+      834,  854, 5010, 5014, 5028, 5031, 5035, 5043,  981, 5050,
+      963,  984, 5053, 5056, 5064,12292,12292, 1039, 1046, 5073,
+
+     1050, 1117, 1107, 1145, 1186, 1164, 5076, 5079,12292,12292,
+     5087, 5091, 5095, 5098, 5101, 1205, 5105, 1188, 1200, 5116,
+    12292,12292, 5126, 1250, 5129, 1244, 5132, 1262, 1290, 5135,
+     1331, 1338, 1330, 5138, 5144, 5163,12292,12292, 5171,12292,
+    12292, 1341, 5158, 2763, 5179,12292,12292, 1356, 1382, 5187,
+    12292,12292, 1367, 5195, 1368, 5202, 5205,12292,12292, 5214,
+    12292,12292, 5225, 5228,12292,12292, 1386, 1406, 5237,12292,
+    12292, 5245, 1403, 5248, 5251, 1409, 1435, 1453, 5260, 1442,
+     5266, 5269, 5273, 5279, 5284, 1739, 1484, 5288,12292, 1524,
+    12292,12292, 1502, 1505, 5293, 1525, 1541, 1548, 1567, 1582,
+
+     1585, 1590, 2830, 1613, 1636, 2874, 1646, 2882, 1686, 2887,
+     1695, 1710, 2933, 1717, 3010, 1732, 3266, 1749, 1758, 1775,
+     1777, 1779, 3078, 1766, 3540, 5297,12292,12292, 5312, 5315,
+    12292,12292, 1780, 1798, 5326, 1773, 5331,12292,12292, 1782,
+     5347,12292,12292, 1774, 5340, 1781, 5359, 2516, 2779, 5367,
+     5371, 5380, 1892, 1894, 1908, 1906, 3279, 1914, 3342, 3530,
+     5385, 1921, 1919, 1922, 5388, 5391, 1922, 5394, 5402, 5412,
+    12292,12292, 5420, 1928, 5423, 5426, 5432,12292,12292, 1961,
+     5441, 5446,12292,12292, 5460, 5456, 1979, 1975, 5464,12292,
+    12292, 5478, 5481, 5489, 5492, 5496, 1984, 5510, 3670, 1991,
+
+     5514,12292,12292, 5522,12292, 5525,12292,12292, 5533, 1991,
+     5536, 5541, 5554, 1977, 5557,12292,12292, 1987, 2012, 5565,
+     5568, 5576, 2021, 2048, 2049, 2051, 5583, 5586, 5589, 5594,
+     5607, 5610, 5613, 5616, 2057, 5619, 5631, 5639, 2046, 5642,
+     5646, 2056, 5660, 2056, 5663, 2072, 2054, 5669, 2076, 2057,
+     2076, 5672, 5684, 2094, 5692, 2097, 5695, 2120, 5698, 5701,
+     5704, 5707, 2115, 5726, 5722, 5730, 5733, 5736, 2111, 5741,
+    12292,12292, 2118, 2117, 2117, 5751, 2138, 5756, 5759, 5775,
+     5778, 5781, 5784, 5803, 2178, 2177, 2252,12292, 2128, 5806,
+     5809, 2142, 2168, 2176, 2274, 2173, 2176, 3771, 2187, 2195,
+
+     2181, 4553, 2200, 2221, 2228, 5812, 5815, 5818, 2246, 5824,
+     2250, 5828, 5835, 2238, 2263, 2291, 2285, 5838, 2302, 5841,
+     2305, 2336, 5844, 2299, 5847, 2311, 5850, 5854, 2347, 2335,
+     2382, 2336, 2367, 2377, 2442, 2379, 5865,12292,12292, 5874,
+     5877, 2363, 2356, 2453, 2365, 5880, 5883, 2375, 2454, 2518,
+     5886, 5895,12292,12292, 5904, 5910, 5913, 5917, 5933, 2401,
+     5936, 5941, 5945, 5959, 2375, 2400, 5962,12292,12292, 5970,
+     5974, 5988, 2437, 2442, 2425, 5982,12292, 5996, 2433, 6001,
+     2459, 6007,12292,12292, 6015, 6020, 2474, 2494, 2484, 6029,
+    12292,12292, 6037, 6040, 6048, 2501, 2511, 2504, 6051, 6056,
+
+     6069, 6072,12292,12292, 6080, 6084, 6092, 6098, 6101, 6110,
+     2506, 6117,12292,12292, 6125, 6129, 2516, 6137,12292,12292,
+     2509, 6145,12292, 2540, 6148, 2522, 6151, 6154, 2525, 6157,
+     2550, 6169, 2567, 2569, 2550, 6177,12292, 2552, 6180, 2544,
+     6183, 6186, 6204, 6207, 2558, 6216, 2553, 6222, 6225, 6228,
+     6231, 6246, 6249, 6257, 2556, 2562, 2556, 2569, 6260, 2588,
+     6265,12292,12292, 6279, 6283, 6287,12292,12292, 6298,12292,
+     2652, 2809, 2651, 2613, 6302, 6305, 6313, 6326, 2607, 2630,
+     2645, 2627, 6332, 6337, 6340, 2630, 6343, 2631, 2685, 2678,
+     6346, 6349, 6352, 6355, 2679, 6358, 6361, 6364, 6367, 6370,
+
+     6373, 2681, 6378, 2688, 2704, 6381,12292, 2685, 6385, 6388,
+     2705, 6403, 6406, 6409, 2720, 2721, 2722, 2728, 2741, 2771,
+     2770, 2778, 2784, 2779, 6417, 6424, 6430, 6438, 2774, 2791,
+     2788, 2803, 6442, 6445, 6448, 6451, 2801, 6459, 6462, 6467,
+     2805, 6480,12292,12292, 6488, 2822, 6493,12292, 6496,12292,
+    12292, 6507, 2819, 2840, 6512,12292,12292, 2906, 2956, 2860,
+     2868, 6520, 2882, 6526,12292,12292, 2883, 2886, 2900, 6540,
+    12292,12292, 6534, 6548, 2913, 2913, 2919, 6557,12292,12292,
+     6565, 6569,12292,12292, 6577, 6580, 6588,12292,12292, 6596,
+     2924, 6599,12292,12292, 2920, 2930, 2925, 6607, 2938, 6610,
+
+     6615, 6630, 2946, 6633, 6636, 2953, 2945, 3031, 3038, 2950,
+     2994, 6645,12292, 2993, 6651,12292,12292, 6664,12292,12292,
+     3005, 6659, 2997, 6673, 6678, 6681,12292,12292, 6693,12292,
+    12292, 6701, 6705, 6711, 6715, 6723, 6729, 2993, 6733, 6736,
+     6741, 3079, 3055, 6744, 6748,12292,12292, 6756, 6763, 6766,
+     6769, 3012, 3045, 6775, 6783, 3065, 6786, 6789, 6795, 6798,
+     6801, 6804, 3057, 3065, 6807, 6810, 6816, 6819, 3074, 6822,
+     3076,12292, 6825, 6828,12292,12292, 6836, 6843,12292, 6847,
+    12292,12292, 3120, 3107, 3122, 3134, 3146, 3148, 3138, 3153,
+     3152, 3165, 6855, 6858, 3294, 6841, 6867, 6870, 3126, 3125,
+
+     3136, 6875, 3130, 6878,12292,12292, 3127, 6886, 6889,12292,
+    12292, 3128, 6897, 6905, 6908, 3147, 3157, 3185, 3207, 3188,
+     3207, 3180, 6911, 6917, 3182, 3189, 3188, 3289, 6923,12292,
+    12292, 6936, 3190, 3204, 6939, 6942,12292,12292, 6950, 3205,
+     3213, 3221, 3222, 6954,12292, 6961, 6969,12292,12292, 6964,
+     6979, 6983,12292,12292, 6991, 6997, 3251, 3273, 3273, 3304,
+     7000, 3273, 7003, 3279, 7009, 7018, 7021, 7029, 7032, 7036,
+     7041, 7054, 7059, 7062, 7065, 7072, 7084, 7087,12292, 7091,
+     3398, 3347, 7094, 7097, 7106, 7116, 3274, 3273, 7119, 7122,
+     7125, 7128, 3275, 3317, 3319, 7131,12292, 3309, 7134, 7137,
+
+     3327, 3345, 3341, 3367, 3362, 3381, 3394, 3396, 3414, 3407,
+     3421, 7145, 3400, 3408, 3420, 3403, 3417, 3421, 3429, 3529,
+     3467, 3478, 7154, 3477, 3478, 7157, 3474, 3500, 7160, 3506,
+     7164,12292, 7167, 7170, 7179, 3503, 3523, 3586,12292, 3587,
+    12292, 7185, 7188, 7191, 3531, 3553, 3541, 3533, 3572, 7194,
+     7199, 3567, 7212, 7215,12292, 7218,12292, 3560, 3566, 7221,
+     3568, 7230, 7239, 7249, 7252, 7255, 7263, 7270, 7273, 3643,
+    12292, 3641,12292, 7276, 3593, 7281, 3595, 7284,12292, 7294,
+     7297, 7305, 7308, 7312, 7317,12292,12292, 7332, 7335, 7343,
+     7346, 7350,12292, 7353, 7356, 3699, 3649, 3650, 7364,12292,
+
+     3588, 3605, 7369, 3596, 3608, 3614, 7377, 7383, 3814, 3864,
+     3660, 3695, 3704, 3704, 3721, 3738, 3722, 3733, 3736, 3742,
+     3761, 7391, 3702, 3718, 3717, 3724, 3727, 3725, 3731, 3745,
+     3743, 3761, 3767, 3760, 3771, 3795, 7395, 3787, 3805, 7398,
+     3814, 7401,12292,12292, 7410,12292, 3795, 7413,12292,12292,
+     7417, 7420, 7431, 3797, 3813, 3819, 7435, 3823, 7438,12292,
+    12292, 3840, 7446, 7453, 3827, 7464, 7470, 7473, 7482, 7488,
+    12292,12292, 7496,12292, 7500,12292,12292, 7508, 7511, 7515,
+    12292,12292, 7518, 7522, 7536, 7539, 7542, 3904, 3964, 7550,
+    12292, 7557, 7564, 7572,12292,12292, 7583, 7586, 7594, 7597,
+
+     7606,12292, 3893, 3944, 3955, 3842, 7612, 3868, 3883, 3884,
+     7615, 7626, 3899, 3904, 3980, 3905, 3910, 3996, 3910, 3973,
+     3961, 3975, 3982,12292, 4000, 3988, 3990, 4015,12292, 7618,
+     3995, 4005, 3992, 4007, 4015, 4021, 4008, 4017, 4011, 4026,
+     4034, 4040, 4026, 7637, 4042, 7640, 7643, 7646, 7649, 7653,
+     7658, 7671,12292,12292, 7679,12292, 4058, 4045, 7682, 7685,
+     7689, 7706, 4065, 7709,12292,12292, 4069, 7717, 7720, 7728,
+    12292,12292, 7736, 7739, 7747, 7750, 7754, 7758,12292,12292,
+     7768, 7772, 7780, 7786, 4094, 4098, 4099, 4103, 4121, 4121,
+     7794, 7798, 7806, 4160, 4170, 7817,12292,12292, 4249, 4145,
+
+     7825, 4111, 7828, 7831, 4099, 4101, 7834,12292,12292, 4148,
+     4151, 4153, 4161, 4169, 4157, 4159, 4169, 7846, 4182, 4206,
+     4224, 4219, 4211, 4230, 4245, 4241, 7849, 4196, 4204, 4220,
+     4269, 4275, 4223, 4216, 4231, 4249, 4294, 4296, 4246, 4255,
+     7852, 7855, 7858, 7869, 7877, 7880, 7883, 7891, 7899, 4255,
+     7909,12292,12292, 4265, 4260, 7917, 7920, 7929,12292,12292,
+     7937, 7940, 4249, 4273, 7948,12292,12292, 7956,12292,12292,
+     7964, 7967, 7970, 7978, 7985, 4313, 4317, 7996, 4324, 4335,
+     4289, 4299, 4329, 4297, 4319, 4352, 8004, 8007, 4337, 4352,
+     4351, 4370, 4378, 8010, 8016, 8019, 8029, 8038, 8041, 8044,
+
+     4364, 4376, 4378, 4375, 4380, 4394, 4396, 4395, 8050, 8053,
+     4408, 4409,12292, 4410, 4413, 4413,12292, 4427, 8061, 4406,
+     4392, 4456,12292,12292, 4412, 4412, 4399, 4459,12292,12292,
+     4424, 8064, 8068, 8074,12292,12292, 8082, 8085,12292,12292,
+     8094,12292,12292, 4424, 4428, 4430, 8102,12292,12292, 8110,
+    12292,12292, 8118, 4433, 8121, 8124,12292,12292, 8132, 4459,
+     4474, 4476, 4487, 4480, 4491, 4484, 4499, 4491, 4505,12292,
+     4498, 4508,12292, 8139,12292, 8142, 4517, 4511, 4533, 4521,
+     4581, 8145, 8151, 8164, 8195, 8242, 8172, 8175, 8178, 4538,
+     4564, 4565, 4536, 4553, 4570, 4584, 4555, 8183,12292,12292,
+
+     4590, 4565, 4567, 4594, 4571, 4576, 8206, 4544, 4560,12292,
+     4570, 4563, 4565,12292, 4575, 8215, 8218,12292, 4574, 4582,
+     4594, 8221, 8225, 4590, 8233, 8262, 8253, 8271, 4646, 4618,
+     4655, 4630, 4665, 4635, 4668, 4646, 4681, 4682, 4697, 4698,
+     8279, 4703, 4670, 4707, 4678, 4699, 8288, 4722, 4764, 8308,
+     8355, 4715,12292,12292, 4710, 4736,12292,12292, 4713,12292,
+     4760, 4766,12292, 4772, 4773, 8282,12292, 4779, 4742, 4786,
+     4785, 4746, 4799, 4770, 4771, 4759, 8328, 4806, 4819, 4785,
+     8336,12292,12292, 8344, 4825, 4833,12292, 4837,12292, 4842,
+    12292, 4848,12292, 4860,12292,12292,12292,12292, 8301,12292,
+
+    12292, 4849,12292, 4855, 4863, 4883, 4880, 4875, 4971, 4881,
+     8366, 4883, 4882, 4910, 4901,12292,12292,12292,12292,12292,
+     4925,12292,12292, 4948,12292, 8375, 8378, 8381, 4910, 4900,
+     4913, 4905, 8386, 4956, 4923, 4978, 4927,12292,12292,12292,
+    12292, 4932, 4935, 8389, 4982, 4969, 4989, 8404, 4996, 4981,
+     5006, 5002,12292, 4976,12292, 4978, 8408, 8411, 8419, 8426,
+     8437, 8440, 4988, 5007, 5020, 5003, 5016, 5039, 8448, 8456,
+     5024, 5038, 5062, 5046, 5054, 5090, 5073, 5075, 8451, 5096,
+    12292, 5089,12292, 5092, 5076, 5099, 8466,12292,12292, 8474,
+    12292,12292, 8482, 5129, 5132, 5114, 5120, 5116, 5139, 5146,
+
+     5146, 8490,12292,12292, 5150, 5159, 5163, 5165, 5177, 5174,
+     5207, 5210, 5239,12292, 5215, 5215, 5169, 5177, 5213, 5207,
+     5216, 5213, 5214, 5231, 5240, 5248, 5254, 5276, 5275, 5282,
+     5283, 5280, 5287, 5294,12292,12292, 5306,12292,12292, 5269,
+     5270, 5285, 5309, 5296, 5317, 5315, 5313, 5330, 5320, 5318,
+     5339, 5329, 5326, 5347, 5339, 5337, 5360, 5379, 5395, 5393,
+     5370, 5371, 5373, 5374, 5391, 5383, 5425, 5406, 5400, 5430,
+     5421, 5416, 5450, 5439, 5434, 5463, 5481,12292,12292, 5444,
+     5451, 5448, 5460, 5482, 5456,12292, 5494, 5471,12292, 5500,
+     5477,12292, 5506, 5486,12292, 5512, 5484, 5508, 5504, 5523,
+
+    12292, 5523,12292, 5525,12292, 5526,12292, 5528, 8498, 5536,
+     5558, 5539, 5566, 5532, 5538, 5539, 5550, 8501, 5593,12292,
+     5592,12292, 5598, 5596, 5601, 5615, 5636, 5657,12292,12292,
+    12292,12292,12292,12292, 5611, 5698, 5701, 5731, 5605, 5737,
+     5631, 5637, 5648, 5702, 5752, 5782, 5664, 5835, 5776, 5777,
+     5804, 5839, 5840, 5855, 5619, 5843, 5871, 5898, 5607, 5721,
+     5922, 5930, 5872, 5926, 5947, 5973, 5932, 5949, 5962, 6000,
+     6025, 6037, 5994, 5995, 5976, 6057, 5950, 6049, 6017, 6104,
+     6043, 6071, 6077, 6088, 6142, 6144, 6105, 6183, 6010, 6147,
+     6149, 6178, 6184, 6226, 6221, 6246, 6219, 6237, 5842, 6116,
+
+     6201, 6223, 6259, 6358, 6255, 6373, 5905, 6202, 6299, 6311,
+     6436, 6452, 6252, 6409, 6454, 6455, 6317, 6016, 8509, 8512,
+    12292,12292, 8532, 8541, 8550, 8559, 8568, 8577, 8586, 8595,
+     8604, 8613, 8622, 8631, 8640, 8649, 8658, 8667, 8676, 8685,
+     8694, 8703, 8712, 8721, 8730, 8739, 8748, 8757, 8766, 8775,
+     8784, 8793, 8802, 8811, 8820, 8829, 8838, 8847, 8856, 8865,
+     8874, 8883, 8892, 8901, 8910, 8919, 8928, 8937, 8946, 8955,
+     8964, 8973, 8982, 8991, 9000, 9009, 9018, 9027, 9036, 9045,
+     9054, 9063, 9072, 9079, 9086, 9093, 9100, 9107, 9114, 9121,
+     9128, 9135, 9142, 9149, 9156, 9163, 9170, 9177, 9184, 9191,
+
+     9198, 9205, 9212, 9219, 9226, 9233, 9240, 9247, 9254, 9261,
+     9268, 9277, 9284, 9289, 9296, 9301, 9308, 9313, 9320, 9325,
+     9332, 9337, 9344, 9349, 9356, 9361, 9368, 9373, 9380, 9385,
+     9392, 9397, 9404, 9409, 9416, 9421, 9428, 9433, 9440, 9445,
+     9452, 9457, 9464, 9469, 9476, 9481, 9488, 9493, 9500, 9505,
+     9512, 9517, 9524, 9529, 9536, 9541, 9548, 9553, 9560, 9565,
+     9572, 9577, 9584, 9589, 9596, 9601, 9608, 9613, 9622, 9628,
+     9635, 9643, 9650, 9658, 9665, 9673, 9680, 9688, 9695, 9703,
+     9710, 9718, 9725, 9733, 9740, 9748, 9755, 9763, 9770, 9778,
+     9785, 9793, 9800, 9808, 9815, 9823, 9830, 9838, 9846, 9854,
+
+     9861, 9869, 9876, 9884, 9891, 9899, 9906, 9914, 9922, 9930,
+     9938, 9946, 9953, 9961, 9969, 9977, 9985, 9993,10000,10008,
+    10015,10023,10031,10038,10046,10055,10061,10068,10076,10084,
+    10092,10100,10108,10115,10123,10130,10138,10145,10153,10160,
+    10168,10175,10183,10191,10199,10207,10215,10222,10230,10238,
+    10246,10254,10262,10269,10277,10284,10292,10299,10307,10314,
+    10322,10329,10337,10344,10352,10359,10367,10374,10382,10389,
+    10397,10405,10412,10420,10427,10435,10442,10450,10458,10465,
+    10473,10482,10491,10498,10506,10514,10521,10529,10536,10544,
+    10551,10559,10566,10573,10581,10588,10596,10603,10611,10618,
+
+    10626,10633,10641,10649,10657,10664,10672,10680,10688,10695,
+    10703,10710,10718,10725,10733,10740,10748,10755,10763,10770,
+    10778,10785,10793,10801,10808,10816,10823,10831,10839,10847,
+    10855,10863,10871,10880,10889,10896,10904,10912,10919,10927,
+    10934,10942,10949,10957,10964,10971,10979,10986,10994,11001,
+    11009,11017,11025,11032,11040,11048,11055,11063,11071,11079,
+    11086,11094,11101,11109,11116,11124,11131,11139,11146,11154,
+    11162,11170,11177,11185,11193,11201,11209,11216,11224,11232,
+    11240,11248,11257,11266,11274,11282,11290,11297,11305,11312,
+    11320,11328,11336,11344,11352,11360,11368,11376,11383,11391,
+
+    11399,11406,11414,11421,11429,11437,11445,11452,11459,11467,
+    11474,11482,11489,11496,11504,11511,11519,11526,11534,11542,
+    11550,11557,11565,11573,11581,11590,11599,11607,11615,11622,
+    11629,11637,11645,11652,11660,11667,11675,11682,11690,11697,
+    11705,11712,11720,11728,11735,11742,11750,11757,11765,11772,
+    11779,11786,11794,11801,11809,11817,11825,11833,11841,11849,
+    11857,11866,11875,11883,11891,11898,11906,11914,11921,11929,
+    11936,11944,11952,11960,11967,11975,11982,11990,11998,12005,
+    12012,12020,12028,12036,12043,12050,12058,12066,12074,12082,
+    12090,12098,12106,12114,12123,12132,12140,12147,12154,12162,
+
+    12169,12177,12184,12192,12199,12207,12214,12221,12228,12237,
+    12246,12255,12264,12273,12282
     } ;
 
-static yyconst flex_int16_t yy_def[3766] =
+static yyconst flex_int16_t yy_def[3816] =
     {   0,
-     3286, 3286, 3287, 3287, 3287, 3287, 3288, 3288, 3289, 3289,
-     3290, 3290, 3291, 3291, 3291, 3291, 3292, 3292, 3286, 3286,
-     3293, 3293, 3294, 3294, 3294, 3294, 3286, 3286, 3294, 3294,
-     3294, 3294, 3286, 3286, 3294, 3294, 3286, 3286, 3294, 3294,
-     3294, 3294, 3295, 3295, 3296, 3296, 3286, 3286, 3296, 3296,
-     3296, 3296, 3297, 3297, 3291, 3291, 3298, 3298, 3299, 3299,
-     3300, 3300, 3301, 3301, 3302, 3302, 3303, 3303, 3303, 3303,
-     3286, 3286, 3303, 3303, 3303, 3303, 3286, 3286, 3303, 3303,
-     3303, 3303, 3286, 3286, 3303, 3303, 3286, 3286, 3303, 3303,
-     3303, 3303, 3286, 3286, 3303, 3303, 3286, 3286, 3303, 3303,
-
-     3303, 3303, 3304, 3304, 3305, 3305, 3286, 3286, 3305, 3305,
-     3305, 3305, 3306, 3306, 3307, 3307, 3286, 3286, 3307, 3307,
-     3307, 3307, 3308, 3308, 3309, 3309, 3310, 3310, 3311, 3311,
-     3312, 3312, 3313, 3313, 3286, 3286, 3313, 3313, 3313, 3313,
-     3314, 3314, 3315, 3315, 3316, 3316, 3317, 3317, 3285,  149,
-     3318, 3318, 3286, 3286, 3318, 3318, 3318, 3318, 3319, 3319,
-     3320, 3320, 3321, 3321, 3322, 3322, 3323, 3323, 3324, 3324,
-     3325, 3325, 3326, 3326, 3327, 3327, 3328, 3328, 3286, 3286,
-     3328, 3328, 3328, 3328, 3329, 3329, 3330, 3330, 3286, 3286,
-     3330, 3330, 3330, 3330, 3331, 3331, 3332, 3332, 3286, 3286,
-
-     3332, 3332, 3332, 3332, 3333, 3333, 3334, 3334, 3335, 3335,
-     3336, 3336, 3286, 3286, 3336, 3336, 3336, 3336, 3337, 3337,
-     3338, 3338, 3286, 3286, 3338, 3338, 3338, 3338, 3339, 3339,
-     3340, 3340, 3286, 3286, 3340, 3340, 3340, 3340, 3341, 3341,
-     3342, 3342, 3343, 3343, 3344, 3344, 3286, 3286, 3344, 3344,
-     3344, 3344, 3345, 3345, 3346, 3346, 3286, 3286, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3347,
-     3285, 3285, 3347, 3285, 3285, 3285,  296,  296,  298,  296,
-
-      299,  299, 3285, 3285, 3285, 3348, 3285, 3285, 3348, 3285,
-     3285,  300,  299, 3285, 3285, 3285, 3349, 3285, 3285, 3349,
-     3349, 3349, 3285, 3285, 3285, 3285, 3285, 3350, 3285, 3285,
-     3350, 3350, 3350, 3350, 3350, 3285, 3285, 3285, 3285, 3285,
-     3285, 3351, 3285, 3285, 3351, 3351, 3351, 3285, 3285, 3285,
-     3285, 3285, 3285, 3352, 3285, 3285, 3352, 3352, 3285, 3285,
-     3285,  361,  299,  299,  300,  365,  364,  364,  364,  364,
-      365,  371,  369,  369, 3285, 3285, 3285, 3353, 3285, 3285,
-     3353, 3353, 3353, 3353, 3285, 3285,  299,  299, 3285, 3285,
-     3285, 3354, 3285, 3285, 3354, 3354, 3354, 3285, 3285,  299,
-
-      299, 3285, 3285, 3285, 3355, 3285, 3285, 3355, 3355, 3285,
-     3285, 3285, 3285, 3285, 3285, 3356, 3285, 3285, 3356, 3356,
-     3285, 3285, 3285, 3285, 3285, 3285, 3357, 3285, 3285, 3357,
-     3357, 3357, 3357, 3357, 3285, 3285,  299,  299,  299, 3285,
-     3285, 3285, 3358, 3285, 3285, 3358, 3285, 3285, 3285, 3285,
-     3285, 3285, 3359, 3285, 3285, 3359, 3359, 3359, 3285, 3285,
-     3285, 3285, 3285, 3285, 3360, 3285, 3285, 3360, 3360, 3360,
-     3360, 3360, 3360, 3360, 3360, 3285, 3285,  299,  299, 3285,
-     3285, 3285, 3361, 3285, 3285, 3361, 3361, 3361, 3361, 3361,
-     3361, 3285, 3285, 3285, 3285, 3285, 3285, 3362, 3285, 3285,
-
-     3362, 3362, 3362, 3362, 3362, 3362, 3362, 3285, 3285, 3285,
-     3285, 3285, 3285, 3363, 3285, 3285, 3363, 3363, 3285, 3285,
-     3285, 3285, 3285, 3285, 3364, 3285, 3285, 3364, 3364, 3364,
-     3285, 3285, 3285, 3285, 3285, 3285, 3365, 3285, 3285, 3365,
-     3365, 3365, 3365, 3285, 3285,  299,  299, 3285, 3285, 3285,
-     3366, 3285, 3285, 3366, 3366, 3285, 3285,  299,  369,  369,
-     3285, 3285, 3285, 3367, 3285, 3285, 3367, 3367, 3367, 3285,
-     3285,  369,  369, 3285, 3285, 3285, 3368, 3285, 3285, 3368,
-     3368, 3285, 3285, 3285, 3285, 3285, 3285, 3369, 3285, 3285,
-     3369, 3369, 3285, 3285,  369,  369, 3285, 3285, 3285, 3370,
-
-     3285, 3285, 3370, 3370, 3370, 3285, 3285,  369,  369, 3285,
-     3285, 3285, 3371, 3285, 3285, 3371, 3371, 3371, 3371, 3371,
-     3285, 3285,  299,  438,  299, 3285, 3285, 3285, 3372, 3285,
-     3285, 3372, 3285, 3285, 3285, 3285, 3285, 3285, 3373, 3285,
-     3285, 3373, 3285, 3285,  299,  299, 3285, 3285, 3285, 3374,
-     3285, 3285, 3374, 3374, 3285, 3285, 3285, 3285, 3375, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3376, 3376, 3377, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3378, 3378, 3379, 3285, 3380, 3380, 3380, 3380, 3285,
-     3381, 3285, 3285, 3382, 3382, 3382, 3382, 3382, 3382, 3382,
-     3382, 3382, 3383, 3285, 3384, 3384, 3384, 3384, 3385, 3285,
-     3386, 3386, 3386, 3387, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3388, 3388, 3388, 3388, 3388, 3389, 3285,
-     3390, 3390, 3390, 3390, 3391, 3285, 3392, 3392, 3392, 3393,
-     3285, 3394, 3394, 3394, 3395, 3285, 3396, 3396, 3396, 3396,
-     3396, 3396, 3397, 3285, 3285, 3398, 3398, 3399, 3285, 3400,
-     3400, 3400, 3400, 3401, 3285, 3402, 3402, 3402, 3402, 3402,
-
-     3402, 3402, 3402, 3402, 3402, 3402, 3402, 3402, 3402, 3402,
-     3402, 3403, 3285, 3404, 3404, 3404, 3404, 3404, 3404, 3404,
-     3404, 3405, 3285, 3406, 3406, 3406, 3406, 3406, 3406, 3406,
-     3406, 3407, 3285, 3408, 3408, 3408, 3409, 3285, 3410, 3410,
-     3410, 3410, 3411, 3285, 3412, 3412, 3412, 3412, 3412, 3412,
-     3413, 3285, 3414, 3414, 3414, 3414, 3415, 3285, 3285, 3416,
-     3416, 3416, 3416, 3416, 3417, 3285, 3418, 3418, 3418, 3419,
-     3285, 3420, 3420, 3420, 3421, 3285, 3422, 3422, 3422, 3422,
-     3423, 3285, 3424, 3424, 3424, 3424, 3424, 3424, 3425, 3285,
-     3285, 3426, 3426, 3427, 3285, 3428, 3428, 3429, 3285, 3430,
-
-     3430, 3430, 3431, 3432, 3285, 3432, 3285, 3285, 3285, 3433,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3434, 3435, 3435,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3436,
-     3437, 3437, 3438, 3285, 3285, 3438, 3285, 3439, 3439, 3285,
-     3440, 3285, 3285, 3440, 3440, 3440, 3440, 3440, 3440, 3441,
-     3441, 3442, 3442, 3442, 3443, 3443, 3285, 3285, 3444, 3445,
-     3445, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3446, 3285, 3285, 3446, 3446,
-
-     3447, 3447, 3448, 3285, 3285, 3448, 3449, 3449, 3285, 3285,
-     3450, 3451, 3451, 3452, 3452, 3453, 3453, 3454, 3454, 3454,
-     3285, 3285, 3454, 3454, 3455, 3455, 3285, 3285, 3456, 3457,
-     3457, 3458, 3285, 3285, 3285, 3285, 3459, 3459, 3460, 3460,
-     3285, 3285, 3460, 3285, 3285, 3460, 3460, 3460, 3460, 3460,
-     3460, 3460, 3460, 3460, 3460, 3461, 3461, 3285, 3285, 3285,
-     3285, 3462, 3462, 3462, 3462, 3462, 3463, 3463, 3464, 3464,
-     3464, 3285, 3285, 3464, 3464, 3464, 3465, 3465, 3466, 3285,
-     3285, 3467, 3467, 3468, 3285, 3285, 3468, 3469, 3469, 3470,
-     3285, 3285, 3470, 3470, 3470, 3471, 3471, 3472, 3472, 3472,
-
-     3473, 3473, 3285, 3474, 3474, 3474, 3474, 3475, 3475, 3476,
-     3285, 3285, 3477, 3477, 3478, 3478, 3479, 3479, 3480, 3480,
-     3480, 3481, 3481, 3482, 3482, 3482, 3482, 3482, 3483, 3483,
-     3285, 3484, 3485, 3485, 3285, 3285, 3486, 3486, 3285, 3285,
-     3487, 3488, 3488, 3489, 3285, 3285, 3489, 3285, 3285, 3490,
-     3285, 3285, 3285, 3285, 3285, 3285, 3491, 3285, 3492, 3285,
-     3492, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3493, 3285, 3494, 3285, 3494, 3495, 3285, 3285, 3285,
-
-     3495, 3285, 3285, 3496, 3285, 3496, 3497, 3285, 3285, 3285,
-     3285, 3285, 3497, 3285, 3285, 3497, 3497, 3497, 3285, 3498,
-     3285, 3498, 3499, 3499, 3499, 3285, 3500, 3285, 3500, 3285,
-     3285, 3285, 3501, 3285, 3502, 3285, 3502, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3503, 3285, 3285, 3285, 3503, 3503, 3285, 3504, 3285, 3504,
-     3505, 3285, 3285, 3285, 3505, 3285, 3506, 3285, 3506, 3285,
-     3285, 3285, 3507, 3285, 3508, 3285, 3508, 3509, 3509, 3285,
-     3510, 3285, 3510, 3511, 3511, 3511, 3285, 3285, 3285, 3511,
-     3511, 3285, 3512, 3285, 3512, 3285, 3285, 3513, 3285, 3514,
-
-     3285, 3514, 3515, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3516, 3285, 3516, 3517, 3517, 3517, 3517, 3285, 3285, 3285,
-     3517, 3285, 3285, 3285, 3285, 3285, 3517, 3517, 3517, 3517,
-     3517, 3517, 3517, 3517, 3517, 3285, 3518, 3285, 3518, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3519, 3519, 3519,
-     3519, 3285, 3520, 3285, 3520, 3521, 3521, 3521, 3521, 3285,
-     3285, 3285, 3285, 3285, 3521, 3521, 3285, 3522, 3285, 3522,
-     3523, 3285, 3285, 3285, 3285, 3524, 3285, 3524, 3525, 3285,
-     3285, 3285, 3525, 3285, 3526, 3285, 3526, 3527, 3285, 3285,
-     3285, 3527, 3527, 3527, 3285, 3528, 3285, 3528, 3285, 3285,
-
-     3285, 3285, 3529, 3285, 3530, 3285, 3530, 3285, 3285, 3285,
-     3531, 3531, 3285, 3285, 3531, 3285, 3532, 3285, 3532, 3533,
-     3285, 3285, 3285, 3285, 3534, 3285, 3534, 3285, 3285, 3285,
-     3285, 3285, 3535, 3285, 3535, 3285, 3285, 3536, 3536, 3285,
-     3285, 3285, 3537, 3285, 3537, 3538, 3538, 3538, 3538, 3538,
-     3285, 3539, 3285, 3539, 3285, 3540, 3285, 3541, 3285, 3541,
-     3285, 3285, 3285, 3285, 3542, 3285, 3542, 3285, 3285, 3285,
-     3543, 3285, 3544, 3285, 3544, 3545, 3546, 3285, 3285, 3285,
-     3285, 3285, 3547, 3548, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3549, 3285, 3285, 3550, 3285,
-     3551, 3552, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3552, 3285, 3285, 3552, 3553, 3554, 3285, 3285, 3554, 3555,
-     3556, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3557, 3557, 3285, 3285,
-     3558, 3559, 3559, 3560, 3285, 3285, 3561, 3285, 3285, 3562,
-     3563, 3564, 3564, 3285, 3285, 3564, 3564, 3565, 3285, 3285,
-     3285, 3285, 3566, 3285, 3285, 3567, 3568, 3568, 3568, 3568,
-     3285, 3285, 3285, 3285, 3285, 3568, 3568, 3568, 3568, 3568,
-
-     3568, 3568, 3568, 3568, 3569, 3285, 3285, 3285, 3570, 3570,
-     3570, 3570, 3571, 3572, 3572, 3572, 3572, 3285, 3285, 3285,
-     3572, 3572, 3573, 3574, 3575, 3576, 3576, 3577, 3578, 3578,
-     3578, 3578, 3579, 3285, 3285, 3285, 3285, 3285, 3285, 3580,
-     3581, 3285, 3285, 3285, 3285, 3582, 3582, 3285, 3285, 3285,
-     3582, 3583, 3584, 3585, 3285, 3285, 3285, 3285, 3285, 3285,
-     3586, 3285, 3285, 3285, 3587, 3587, 3285, 3285, 3285, 3588,
-     3589, 3285, 3285, 3589, 3589, 3589, 3590, 3285, 3591, 3592,
-     3593, 3594, 3595, 3596, 3597, 3597, 3285, 3597, 3285, 3285,
-     3285, 3598, 3599, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3600, 3285, 3285, 3285,
-     3601, 3285, 3602, 3603, 3285, 3285, 3285, 3603, 3285, 3285,
-     3285, 3603, 3604, 3605, 3285, 3285, 3285, 3285, 3285, 3606,
-     3607, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3608, 3285, 3285, 3285, 3285, 3285,
-     3609, 3610, 3610, 3611, 3285, 3285, 3285, 3612, 3285, 3285,
-     3285, 3613, 3614, 3615, 3615, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3615, 3616, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3617, 3618, 3285, 3285, 3618, 3618,
-     3285, 3285, 3285, 3618, 3618, 3285, 3285, 3618, 3618, 3618,
-     3618, 3618, 3618, 3619, 3285, 3285, 3620, 3620, 3620, 3621,
-     3622, 3285, 3285, 3622, 3622, 3285, 3285, 3622, 3623, 3624,
-     3625, 3626, 3626, 3627, 3628, 3628, 3628, 3285, 3285, 3628,
-     3629, 3630, 3631, 3285, 3632, 3632, 3632, 3633, 3634, 3635,
-     3636, 3637, 3637, 3638, 3639, 3285, 3285, 3285, 3639, 3639,
-     3639, 3640, 3285, 3285, 3285, 3641, 3642, 3285, 3285, 3643,
-     3644, 3645, 3645, 3285, 3285, 3646, 3647, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3648, 3649, 3285, 3650, 3651,
-     3651, 3651, 3652, 3653, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3654, 3655, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3656, 3285, 3285, 3285,
-     3657, 3658, 3285, 3285, 3659, 3660, 3285, 3285, 3661, 3662,
-     3662, 3285, 3285, 3285, 3285, 3285, 3285, 3662, 3285, 3285,
-     3285, 3285, 3663, 3664, 3285, 3285, 3285, 3285, 3285, 3664,
-     3664, 3664, 3285, 3285, 3285, 3285, 3285, 3664, 3664, 3664,
-     3664, 3285, 3285, 3665, 3285, 3285, 3285, 3285, 3285, 3666,
-
-     3285, 3285, 3667, 3668, 3285, 3285, 3285, 3285, 3285, 3668,
-     3285, 3285, 3285, 3668, 3285, 3285, 3669, 3670, 3671, 3671,
-     3672, 3673, 3673, 3673, 3285, 3285, 3285, 3673, 3285, 3285,
-     3674, 3675, 3285, 3285, 3285, 3285, 3285, 3676, 3677, 3678,
-     3679, 3680, 3285, 3285, 3285, 3285, 3681, 3682, 3682, 3682,
-     3682, 3683, 3285, 3285, 3285, 3285, 3684, 3685, 3285, 3285,
-     3285, 3285, 3285, 3686, 3687, 3687, 3285, 3285, 3285, 3688,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3689, 3690, 3285, 3285, 3285,
-
-     3691, 3285, 3285, 3691, 3692, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3693, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3694,
-     3285, 3285, 3285, 3285, 3285, 3695, 3285, 3285, 3285, 3285,
-     3285, 3696, 3697, 3697, 3285, 3285, 3697, 3285, 3698, 3699,
-     3285, 3285, 3285, 3699, 3699, 3699, 3285, 3285, 3285, 3285,
-     3285, 3699, 3699, 3699, 3285, 3285, 3285, 3700, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3701, 3702, 3285, 3285,
-     3285, 3702, 3702, 3703, 3704, 3705, 3285, 3285, 3706, 3707,
-     3285, 3285, 3707, 3707, 3285, 3285, 3707, 3708, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3709, 3710, 3711,
-     3712, 3713, 3285, 3285, 3285, 3285, 3285, 3285, 3714, 3715,
-     3715, 3715, 3715, 3716, 3285, 3717, 3718, 3719, 3720, 3720,
-     3285, 3285, 3285, 3285, 3721, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3722, 3723, 3285, 3724,
-     3285, 3285, 3285, 3724, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3725,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3726, 3285, 3285, 3285, 3727, 3728, 3729,
-
-     3729, 3285, 3285, 3285, 3285, 3729, 3285, 3730, 3731, 3731,
-     3731, 3731, 3285, 3285, 3285, 3731, 3731, 3731, 3732, 3285,
-     3285, 3285, 3733, 3734, 3734, 3734, 3735, 3285, 3285, 3736,
-     3285, 3285, 3285, 3737, 3738, 3285, 3285, 3285, 3738, 3738,
-     3285, 3285, 3285, 3285, 3738, 3739, 3285, 3740, 3741, 3742,
-     3743, 3744, 3745, 3285, 3285, 3746, 3746, 3746, 3747, 3285,
-     3748, 3285, 3285, 3749, 3750, 3750, 3285, 3751, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3752, 3285, 3285, 3753, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3754, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3755, 3285, 3285, 3756, 3757, 3757, 3285, 3285, 3285,
-     3285, 3757, 3285, 3758, 3759, 3759, 3759, 3759, 3759, 3285,
-     3285, 3759, 3759, 3285, 3285, 3285, 3285, 3734, 3734, 3734,
-     3735, 3285, 3285, 3737, 3285, 3285, 3738, 3738, 3738, 3285,
-     3285, 3285, 3285, 3738, 3739, 3285, 3740, 3285, 3285, 3285,
-     3285, 3743, 3744, 3745, 3285, 3285, 3285, 3285, 3285, 3746,
-     3746, 3285, 3285, 3285, 3748, 3749, 3750, 3750, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3752, 3285, 3285, 3285,
-     3753, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3754, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3755, 3285,
-     3285, 3757, 3757, 3285, 3285, 3285, 3285, 3758, 3759, 3759,
-     3759, 3759, 3759, 3285, 3285, 3285, 3759, 3285, 3285, 3734,
-     3734, 3285, 3285, 3735, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3738, 3738, 3738, 3285, 3285, 3285, 3285, 3739,
-     3740, 3285, 3285, 3285, 3285, 3285, 3744, 3745, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749, 3750, 3750,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3753, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3754, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3755, 3757, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3759,
-     3759, 3759, 3285, 3285, 3759, 3759, 3285, 3285, 3285, 3734,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3738, 3738, 3738,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3744, 3745, 3285, 3285, 3285, 3285, 3285,
-     3285, 3749, 3750, 3750, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3753, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3754,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3755, 3285, 3285, 3757, 3285,
-     3285, 3285, 3759, 3759, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3759, 3734, 3285, 3285, 3285, 3285, 3285, 3285, 3738,
-     3285, 3285, 3738, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3744, 3745, 3285, 3285, 3285,
-     3285, 3749, 3750, 3750, 3750, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3754, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3755, 3285, 3285, 3285, 3757, 3759, 3759, 3285,
-     3285, 3285, 3285, 3285, 3285, 3759, 3734, 3738, 3285, 3285,
-     3285, 3738, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3745, 3285,
-     3285, 3285, 3285, 3749, 3750, 3750, 3750, 3760, 3761, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3754,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3757, 3759, 3759, 3285, 3285, 3734, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3745, 3285, 3285, 3285, 3285, 3749, 3750,
-     3762, 3763, 3760, 3761, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3757, 3759, 3759, 3285,
-     3285, 3285, 3734, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749, 3762, 3750,
-     3764, 3763, 3765, 3750, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3757, 3759,
-     3759, 3285, 3285, 3285, 3285, 3734, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3749, 3764, 3285, 3765,
-     3750, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3749, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3749, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3749, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3749, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3749, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3749,
-     3749, 3285, 3285, 3285, 3285, 3285, 3285, 3749, 3749, 3749,
-
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3285,    0, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285
+     3323, 3323, 3324, 3324, 3324, 3324, 3325, 3325, 3326, 3326,
+     3327, 3327, 3328, 3328, 3328, 3328, 3329, 3329, 3323, 3323,
+     3330, 3330, 3331, 3331, 3331, 3331, 3323, 3323, 3331, 3331,
+     3331, 3331, 3323, 3323, 3331, 3331, 3323, 3323, 3331, 3331,
+     3331, 3331, 3332, 3332, 3333, 3333, 3323, 3323, 3333, 3333,
+     3333, 3333, 3334, 3334, 3328, 3328, 3335, 3335, 3336, 3336,
+     3337, 3337, 3338, 3338, 3339, 3339, 3340, 3340, 3340, 3340,
+     3323, 3323, 3340, 3340, 3340, 3340, 3323, 3323, 3340, 3340,
+     3340, 3340, 3323, 3323, 3340, 3340, 3323, 3323, 3340, 3340,
+     3340, 3340, 3323, 3323, 3340, 3340, 3323, 3323, 3340, 3340,
+
+     3340, 3340, 3341, 3341, 3342, 3342, 3323, 3323, 3342, 3342,
+     3342, 3342, 3343, 3343, 3344, 3344, 3323, 3323, 3344, 3344,
+     3344, 3344, 3345, 3345, 3346, 3346, 3347, 3347, 3348, 3348,
+     3349, 3349, 3350, 3350, 3323, 3323, 3350, 3350, 3350, 3350,
+     3351, 3351, 3352, 3352, 3353, 3353, 3354, 3354, 3322,  149,
+     3355, 3355, 3323, 3323, 3355, 3355, 3355, 3355, 3356, 3356,
+     3357, 3357, 3358, 3358, 3359, 3359, 3360, 3360, 3361, 3361,
+     3362, 3362, 3363, 3363, 3364, 3364, 3365, 3365, 3323, 3323,
+     3365, 3365, 3365, 3365, 3366, 3366, 3367, 3367, 3323, 3323,
+     3367, 3367, 3367, 3367, 3368, 3368, 3369, 3369, 3323, 3323,
+
+     3369, 3369, 3369, 3369, 3370, 3370, 3371, 3371, 3372, 3372,
+     3373, 3373, 3323, 3323, 3373, 3373, 3373, 3373, 3374, 3374,
+     3375, 3375, 3323, 3323, 3375, 3375, 3375, 3375, 3376, 3376,
+     3377, 3377, 3323, 3323, 3377, 3377, 3377, 3377, 3378, 3378,
+     3379, 3379, 3380, 3380, 3381, 3381, 3323, 3323, 3381, 3381,
+     3381, 3381, 3382, 3382, 3383, 3383, 3323, 3323, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3384,
+     3322, 3322, 3384, 3322, 3322, 3322,  296,  296,  298,  296,
+
+      299,  299, 3322, 3322, 3322, 3385, 3322, 3322, 3385, 3322,
+     3322,  300,  299, 3322, 3322, 3322, 3386, 3322, 3322, 3386,
+     3386, 3386, 3322, 3322, 3322, 3322, 3322, 3387, 3322, 3322,
+     3387, 3387, 3387, 3387, 3387, 3322, 3322, 3322, 3322, 3322,
+     3322, 3388, 3322, 3322, 3388, 3388, 3388, 3322, 3322, 3322,
+     3322, 3322, 3322, 3389, 3322, 3322, 3389, 3389, 3322, 3322,
+     3322,  361,  299,  299,  300,  365,  364,  364,  364,  364,
+      365,  371,  369,  369, 3322, 3322, 3322, 3390, 3322, 3322,
+     3390, 3390, 3390, 3390, 3322, 3322,  299,  299, 3322, 3322,
+     3322, 3391, 3322, 3322, 3391, 3391, 3391, 3322, 3322,  299,
+
+      299, 3322, 3322, 3322, 3392, 3322, 3322, 3392, 3392, 3322,
+     3322, 3322, 3322, 3322, 3322, 3393, 3322, 3322, 3393, 3393,
+     3322, 3322, 3322, 3322, 3322, 3322, 3394, 3322, 3322, 3394,
+     3394, 3394, 3394, 3394, 3322, 3322,  299,  299,  299, 3322,
+     3322, 3322, 3395, 3322, 3322, 3395, 3322, 3322, 3322, 3322,
+     3322, 3322, 3396, 3322, 3322, 3396, 3396, 3396, 3322, 3322,
+     3322, 3322, 3322, 3322, 3397, 3322, 3322, 3397, 3397, 3397,
+     3397, 3397, 3397, 3397, 3397, 3322, 3322,  299,  299, 3322,
+     3322, 3322, 3398, 3322, 3322, 3398, 3398, 3398, 3398, 3398,
+     3398, 3322, 3322, 3322, 3322, 3322, 3322, 3399, 3322, 3322,
+
+     3399, 3399, 3399, 3399, 3399, 3399, 3399, 3322, 3322, 3322,
+     3322, 3322, 3322, 3400, 3322, 3322, 3400, 3400, 3322, 3322,
+     3322, 3322, 3322, 3322, 3401, 3322, 3322, 3401, 3401, 3401,
+     3322, 3322, 3322, 3322, 3322, 3322, 3402, 3322, 3322, 3402,
+     3402, 3402, 3402, 3322, 3322,  299,  299, 3322, 3322, 3322,
+     3403, 3322, 3322, 3403, 3403, 3322, 3322,  299,  369,  369,
+     3322, 3322, 3322, 3404, 3322, 3322, 3404, 3404, 3404, 3322,
+     3322,  369,  369, 3322, 3322, 3322, 3405, 3322, 3322, 3405,
+     3405, 3322, 3322, 3322, 3322, 3322, 3322, 3406, 3322, 3322,
+     3406, 3406, 3322, 3322,  369,  369, 3322, 3322, 3322, 3407,
+
+     3322, 3322, 3407, 3407, 3407, 3322, 3322,  369,  369, 3322,
+     3322, 3322, 3408, 3322, 3322, 3408, 3408, 3408, 3408, 3408,
+     3322, 3322,  299,  438,  299, 3322, 3322, 3322, 3409, 3322,
+     3322, 3409, 3322, 3322, 3322, 3322, 3322, 3322, 3410, 3322,
+     3322, 3410, 3322, 3322,  299,  299, 3322, 3322, 3322, 3411,
+     3322, 3322, 3411, 3411, 3322, 3322, 3322, 3322, 3412, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3413, 3413, 3414, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3415, 3415, 3416, 3322, 3417, 3417, 3417, 3417, 3322,
+     3418, 3322, 3322, 3419, 3419, 3419, 3419, 3419, 3419, 3419,
+     3419, 3419, 3420, 3322, 3421, 3421, 3421, 3421, 3422, 3322,
+     3423, 3423, 3423, 3424, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3425, 3425, 3425, 3425, 3425, 3426, 3322,
+     3427, 3427, 3427, 3427, 3428, 3322, 3429, 3429, 3429, 3430,
+     3322, 3431, 3431, 3431, 3432, 3322, 3433, 3433, 3433, 3433,
+     3433, 3433, 3433, 3434, 3322, 3322, 3435, 3435, 3436, 3322,
+     3437, 3437, 3437, 3437, 3438, 3322, 3439, 3439, 3439, 3439,
+
+     3439, 3439, 3439, 3439, 3439, 3439, 3439, 3439, 3439, 3439,
+     3439, 3439, 3440, 3322, 3441, 3441, 3441, 3441, 3441, 3441,
+     3441, 3441, 3442, 3322, 3443, 3443, 3443, 3443, 3443, 3443,
+     3443, 3443, 3444, 3322, 3445, 3445, 3445, 3446, 3322, 3447,
+     3447, 3447, 3447, 3448, 3322, 3449, 3449, 3449, 3449, 3449,
+     3449, 3450, 3322, 3451, 3451, 3451, 3451, 3452, 3322, 3322,
+     3453, 3453, 3453, 3453, 3453, 3454, 3322, 3455, 3455, 3455,
+     3456, 3322, 3457, 3457, 3457, 3458, 3322, 3459, 3459, 3459,
+     3459, 3460, 3322, 3461, 3461, 3461, 3461, 3461, 3461, 3462,
+     3322, 3322, 3463, 3463, 3464, 3322, 3465, 3465, 3466, 3322,
+
+     3467, 3467, 3467, 3468, 3469, 3322, 3469, 3322, 3322, 3322,
+     3470, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3471, 3472,
+     3472, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3473, 3474, 3474, 3475, 3322, 3322, 3475, 3322, 3476, 3476,
+     3322, 3477, 3322, 3322, 3477, 3477, 3477, 3477, 3477, 3477,
+     3478, 3478, 3479, 3479, 3479, 3480, 3480, 3322, 3322, 3481,
+     3482, 3482, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3483, 3322, 3322, 3483,
+
+     3483, 3484, 3484, 3485, 3322, 3322, 3485, 3486, 3486, 3487,
+     3487, 3488, 3488, 3489, 3489, 3490, 3490, 3491, 3491, 3491,
+     3322, 3322, 3491, 3491, 3491, 3492, 3492, 3322, 3322, 3493,
+     3494, 3494, 3495, 3322, 3322, 3322, 3322, 3496, 3496, 3497,
+     3497, 3322, 3322, 3497, 3322, 3322, 3497, 3497, 3497, 3497,
+     3497, 3497, 3497, 3497, 3497, 3497, 3498, 3498, 3322, 3322,
+     3322, 3322, 3499, 3499, 3499, 3499, 3499, 3500, 3500, 3501,
+     3501, 3501, 3322, 3322, 3501, 3501, 3501, 3502, 3502, 3503,
+     3322, 3322, 3504, 3504, 3505, 3322, 3322, 3505, 3506, 3506,
+     3507, 3322, 3322, 3507, 3507, 3507, 3508, 3508, 3509, 3509,
+
+     3509, 3510, 3510, 3322, 3511, 3511, 3511, 3511, 3512, 3512,
+     3513, 3322, 3322, 3514, 3514, 3515, 3515, 3516, 3516, 3517,
+     3517, 3517, 3518, 3518, 3519, 3519, 3519, 3519, 3519, 3520,
+     3520, 3322, 3521, 3522, 3522, 3322, 3322, 3523, 3523, 3322,
+     3322, 3524, 3525, 3525, 3526, 3322, 3322, 3526, 3322, 3322,
+     3527, 3322, 3322, 3322, 3322, 3322, 3322, 3528, 3322, 3529,
+     3322, 3529, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3530, 3322, 3531, 3322, 3531, 3532, 3322, 3322,
+
+     3322, 3532, 3322, 3322, 3533, 3322, 3533, 3534, 3322, 3322,
+     3322, 3322, 3322, 3534, 3322, 3322, 3534, 3534, 3534, 3322,
+     3535, 3322, 3535, 3536, 3536, 3536, 3322, 3537, 3322, 3537,
+     3322, 3322, 3322, 3538, 3322, 3539, 3322, 3539, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3540, 3322, 3322, 3322, 3540, 3540, 3322, 3541, 3322,
+     3541, 3542, 3322, 3322, 3322, 3542, 3322, 3543, 3322, 3543,
+     3544, 3544, 3322, 3545, 3322, 3545, 3546, 3546, 3322, 3547,
+     3322, 3547, 3548, 3548, 3548, 3322, 3322, 3322, 3548, 3548,
+     3548, 3322, 3549, 3322, 3549, 3322, 3322, 3550, 3322, 3551,
+
+     3322, 3551, 3552, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3553, 3322, 3553, 3554, 3554, 3554, 3554, 3322, 3322, 3322,
+     3554, 3322, 3322, 3322, 3322, 3322, 3554, 3554, 3554, 3554,
+     3554, 3554, 3554, 3554, 3554, 3322, 3555, 3322, 3555, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3556, 3556, 3556,
+     3556, 3322, 3557, 3322, 3557, 3558, 3558, 3558, 3558, 3322,
+     3322, 3322, 3322, 3322, 3558, 3558, 3322, 3559, 3322, 3559,
+     3560, 3322, 3322, 3322, 3322, 3561, 3322, 3561, 3562, 3322,
+     3322, 3322, 3562, 3322, 3563, 3322, 3563, 3564, 3322, 3322,
+     3322, 3564, 3564, 3564, 3322, 3565, 3322, 3565, 3322, 3322,
+
+     3322, 3322, 3566, 3322, 3567, 3322, 3567, 3322, 3322, 3322,
+     3568, 3568, 3322, 3322, 3568, 3322, 3569, 3322, 3569, 3570,
+     3322, 3322, 3322, 3322, 3571, 3322, 3571, 3322, 3322, 3322,
+     3322, 3322, 3572, 3322, 3572, 3322, 3322, 3573, 3573, 3322,
+     3322, 3322, 3574, 3322, 3574, 3575, 3575, 3575, 3575, 3575,
+     3322, 3576, 3322, 3576, 3322, 3577, 3322, 3578, 3322, 3578,
+     3322, 3322, 3322, 3322, 3579, 3322, 3579, 3322, 3322, 3322,
+     3580, 3322, 3581, 3322, 3581, 3582, 3583, 3322, 3322, 3322,
+     3322, 3322, 3584, 3585, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3586, 3322, 3322, 3587, 3322,
+     3588, 3589, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3589, 3322, 3322, 3589, 3590, 3591, 3322, 3322, 3591, 3592,
+     3593, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3594, 3594, 3322, 3322,
+     3595, 3596, 3596, 3597, 3322, 3322, 3598, 3599, 3322, 3322,
+     3600, 3601, 3602, 3602, 3322, 3322, 3602, 3602, 3602, 3603,
+     3322, 3322, 3322, 3322, 3604, 3322, 3322, 3605, 3606, 3606,
+     3606, 3606, 3322, 3322, 3322, 3322, 3322, 3606, 3606, 3606,
+
+     3606, 3606, 3606, 3606, 3606, 3606, 3607, 3322, 3322, 3322,
+     3608, 3608, 3608, 3608, 3609, 3610, 3610, 3610, 3610, 3322,
+     3322, 3322, 3610, 3610, 3611, 3612, 3613, 3614, 3614, 3615,
+     3616, 3616, 3616, 3616, 3617, 3322, 3322, 3322, 3322, 3322,
+     3322, 3618, 3619, 3322, 3322, 3322, 3322, 3620, 3620, 3322,
+     3322, 3322, 3620, 3621, 3622, 3623, 3322, 3322, 3322, 3322,
+     3322, 3322, 3624, 3322, 3322, 3322, 3625, 3625, 3322, 3322,
+     3322, 3626, 3627, 3322, 3322, 3627, 3627, 3627, 3628, 3322,
+     3629, 3630, 3631, 3632, 3633, 3634, 3635, 3635, 3322, 3635,
+     3322, 3322, 3322, 3636, 3637, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3638, 3322,
+     3322, 3322, 3639, 3322, 3640, 3641, 3322, 3322, 3322, 3641,
+     3322, 3322, 3322, 3641, 3642, 3643, 3322, 3322, 3322, 3322,
+     3322, 3644, 3645, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3646, 3322, 3322, 3322,
+     3322, 3322, 3647, 3648, 3648, 3649, 3322, 3322, 3322, 3650,
+     3651, 3322, 3322, 3322, 3652, 3653, 3654, 3654, 3322, 3322,
+     3322, 3322, 3322, 3654, 3322, 3322, 3654, 3655, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3656, 3657,
+     3322, 3322, 3657, 3657, 3322, 3322, 3322, 3657, 3657, 3322,
+     3322, 3657, 3657, 3657, 3657, 3657, 3657, 3658, 3322, 3322,
+     3659, 3659, 3659, 3660, 3661, 3322, 3322, 3661, 3661, 3322,
+     3322, 3661, 3662, 3663, 3664, 3665, 3665, 3666, 3667, 3667,
+     3667, 3322, 3322, 3667, 3668, 3669, 3670, 3322, 3671, 3671,
+     3671, 3672, 3673, 3674, 3675, 3676, 3676, 3677, 3678, 3322,
+     3322, 3322, 3678, 3678, 3678, 3679, 3322, 3322, 3322, 3680,
+     3681, 3322, 3322, 3682, 3683, 3684, 3684, 3322, 3322, 3685,
+     3686, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3687,
+     3688, 3322, 3689, 3690, 3690, 3690, 3691, 3692, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3693,
+     3694, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3695, 3322, 3322, 3322, 3696, 3697, 3322, 3322, 3698, 3699,
+     3700, 3322, 3322, 3701, 3702, 3702, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3702, 3322, 3322, 3322, 3322, 3703,
+     3704, 3322, 3322, 3322, 3322, 3322, 3704, 3704, 3704, 3322,
+     3322, 3322, 3322, 3322, 3704, 3704, 3704, 3704, 3322, 3322,
+
+     3705, 3322, 3322, 3322, 3322, 3322, 3706, 3322, 3322, 3707,
+     3708, 3322, 3322, 3322, 3322, 3322, 3708, 3322, 3322, 3322,
+     3708, 3322, 3322, 3709, 3710, 3711, 3711, 3712, 3713, 3713,
+     3713, 3322, 3322, 3322, 3713, 3322, 3322, 3714, 3715, 3322,
+     3322, 3322, 3322, 3322, 3716, 3717, 3718, 3719, 3720, 3322,
+     3322, 3322, 3322, 3721, 3722, 3722, 3722, 3722, 3723, 3322,
+     3322, 3322, 3322, 3724, 3725, 3322, 3322, 3322, 3322, 3322,
+     3726, 3727, 3727, 3322, 3322, 3322, 3728, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3729, 3730, 3322, 3322, 3322, 3731, 3322, 3322,
+     3731, 3732, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3733, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3734, 3735, 3322, 3322,
+     3736, 3322, 3322, 3322, 3737, 3738, 3322, 3322, 3322, 3322,
+     3322, 3739, 3740, 3740, 3322, 3322, 3322, 3322, 3322, 3740,
+     3322, 3741, 3742, 3322, 3322, 3322, 3742, 3742, 3742, 3322,
+     3322, 3322, 3322, 3322, 3742, 3742, 3742, 3322, 3322, 3322,
+     3743, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3744,
+     3745, 3322, 3322, 3322, 3745, 3745, 3746, 3747, 3748, 3322,
+
+     3322, 3749, 3750, 3322, 3322, 3750, 3750, 3322, 3322, 3750,
+     3751, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3752, 3753, 3754, 3755, 3756, 3322, 3322, 3322, 3322, 3322,
+     3322, 3757, 3758, 3758, 3758, 3758, 3759, 3322, 3760, 3761,
+     3762, 3763, 3763, 3322, 3322, 3322, 3322, 3764, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3765,
+     3766, 3322, 3767, 3322, 3322, 3322, 3767, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3768, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3769, 3770, 3322, 3322,
+     3322, 3771, 3772, 3773, 3774, 3775, 3775, 3322, 3322, 3322,
+     3322, 3775, 3322, 3776, 3777, 3777, 3777, 3777, 3322, 3322,
+     3322, 3777, 3777, 3777, 3778, 3322, 3322, 3322, 3779, 3780,
+     3780, 3780, 3781, 3322, 3322, 3782, 3322, 3322, 3322, 3783,
+     3784, 3322, 3322, 3322, 3784, 3784, 3322, 3322, 3322, 3322,
+     3784, 3785, 3322, 3786, 3787, 3788, 3789, 3790, 3791, 3322,
+     3322, 3792, 3792, 3792, 3793, 3322, 3794, 3322, 3322, 3795,
+     3796, 3796, 3322, 3797, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3798, 3322, 3322,
+
+     3799, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3800, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3801, 3802, 3803,
+     3322, 3322, 3322, 3322, 3804, 3805, 3805, 3322, 3322, 3322,
+     3322, 3805, 3322, 3806, 3807, 3807, 3807, 3807, 3807, 3322,
+     3322, 3807, 3807, 3322, 3322, 3322, 3322, 3808, 3808, 3808,
+     3809, 3322, 3322, 3783, 3322, 3322, 3784, 3784, 3784, 3322,
+     3322, 3322, 3322, 3784, 3785, 3322, 3786, 3322, 3322, 3322,
+     3322, 3789, 3790, 3791, 3322, 3322, 3322, 3322, 3322, 3792,
+     3792, 3322, 3322, 3322, 3794, 3795, 3796, 3796, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3798, 3322, 3322, 3322,
+     3799, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3800, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3801, 3802,
+     3803, 3322, 3322, 3322, 3322, 3322, 3805, 3805, 3322, 3322,
+     3322, 3322, 3806, 3807, 3807, 3807, 3807, 3807, 3322, 3322,
+     3322, 3807, 3322, 3322, 3808, 3808, 3322, 3322, 3809, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3784, 3784, 3784,
+     3322, 3322, 3322, 3322, 3785, 3786, 3322, 3322, 3322, 3322,
+     3322, 3790, 3791, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3795, 3796, 3796, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3799, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3800,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3801, 3802, 3803, 3805, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3807, 3807, 3807, 3322,
+     3322, 3807, 3807, 3322, 3322, 3322, 3808, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3784, 3784, 3784, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3790, 3791, 3322, 3322, 3322, 3322, 3322, 3322, 3795, 3796,
+
+     3796, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3799, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3800, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3802, 3322, 3322, 3322, 3322, 3805,
+     3322, 3322, 3322, 3807, 3807, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3807, 3808, 3322, 3322, 3322, 3322, 3322, 3322,
+     3784, 3322, 3322, 3784, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3790, 3791, 3322, 3322,
+     3322, 3322, 3795, 3796, 3796, 3796, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3800, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3802, 3322, 3322, 3322,
+     3322, 3322, 3322, 3805, 3807, 3807, 3322, 3322, 3322, 3322,
+     3322, 3322, 3807, 3808, 3784, 3322, 3322, 3322, 3784, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3791, 3322, 3322, 3322, 3322,
+     3795, 3796, 3796, 3796, 3810, 3811, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3800, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3805, 3807,
+     3807, 3322, 3322, 3808, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3791, 3322, 3322, 3322, 3322, 3795, 3796, 3812, 3813, 3810,
+     3811, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3805, 3807, 3807, 3322, 3322, 3322, 3808,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3795, 3812, 3796, 3814, 3813, 3815,
+     3796, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3805, 3807, 3807, 3322, 3322,
+     3322, 3322, 3808, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3795, 3814, 3322, 3815, 3796, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3795, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3795, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3795, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3795, 3795, 3322, 3322,
+     3322, 3322, 3322, 3322, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3322,    0, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322
     } ;
 
-static yyconst flex_int16_t yy_nxt[12182] =
+static yyconst flex_int16_t yy_nxt[12367] =
     {   0,
-     3285,  262,  263,  262,  262,  263,  262,  262,  263,  262,
+     3322,  262,  263,  262,  262,  263,  262,  262,  263,  262,
       262,  263,  262,  267,  263,  267,  273,  264,  270,  273,
-      264,  270, 3285,  265, 3285,  271,  265, 3285,  271,  268,
+      264,  270, 3322,  265, 3322,  271,  265, 3322,  271,  268,
       267,  263,  267,  659,  274,  276,  277,  274,  276,  277,
       278,  279,  704,  278,  279,  659,  268,  283,  284,  660,
       280,  276,  277,  280,  281,  662,  278,  276,  277,  693,
-      281,  661,  278,  283,  284, 1738,  280,  263,  263,  263,
-      849,  661,  280,  263,  263,  263,  295,  263,  295,  295,
-      263,  295,  850,  286,  295,  263,  295,  680, 1742,  286,
+      281,  661,  278,  283,  284, 1725,  280,  263,  263,  263,
+      850,  661,  280,  263,  263,  263,  295,  263,  295,  295,
+      263,  295,  851,  286,  295,  263,  295,  680, 1733,  286,
       734,  285,  296, 1357,  696,  296,  658,  658,  658, 1358,
 
       297,  658,  658,  658,  658,  658,  658,  285,  287,  288,
       263,  288,  287,  287,  287,  287,  287,  287,  287,  289,
       287,  287,  287,  691,  287,  291,  287,  292,  287,  295,
       263,  295,  263,  263,  263,  263,  263,  263,  692,  295,
-      263,  295,  295,  263,  295,  297,  697,  805,  298,  662,
-      806,  298,  923,  287,  287,  296,  662,  662,  296,  295,
+      263,  295,  295,  263,  295,  297,  697,  806,  298,  662,
+      807,  298,  924,  287,  287,  296,  662,  662,  296,  295,
       263,  295,  658,  658,  658,  661,  658,  658,  658,  658,
-      658,  658,  661,  661, 3285,  299,  924,  293,  287,  288,
+      658,  658,  661,  661, 3322,  299,  925,  293,  287,  288,
       263,  288,  287,  287,  287,  287,  287,  287,  287,  289,
-      287,  287,  287, 1744,  287,  291,  287,  292,  287,  295,
+      287,  287,  287, 1734,  287,  291,  287,  292,  287,  295,
 
       263,  295,  263,  263,  263,  263,  263,  263,  667,  295,
-      263,  295,  295,  263,  295,  299,  673,  734,  300,  818,
-      983,  300,  819,  287,  287,  297,  743,  735,  297,  263,
+      263,  295,  295,  263,  295,  299,  673,  734,  300,  819,
+      984,  300,  820,  287,  287,  297,  743,  735,  297,  263,
       263,  263,  263,  263,  263,  295,  263,  295,  295,  263,
-      295,  295,  263,  295,  984,  301,  855,  293,  301,  662,
-      668,  299,  798,  856,  299,  747,  669,  302,  295,  263,
+      295,  295,  263,  295,  985,  301,  856,  293,  301,  662,
+      668,  299,  799,  857,  299,  747,  669,  302,  295,  263,
       295,  670,  658,  658,  658,  661,  671,  658,  658,  658,
-      658,  658,  658,  799,  302,  303,  304,  263,  304,  303,
+      658,  658,  658,  800,  302,  303,  304,  263,  304,  303,
       303,  303,  303,  303,  303,  303,  305,  303,  303,  303,
       721,  303,  307,  303,  308,  303,  311,  263,  311,  311,
 
       263,  311,  263,  263,  263,  722,  263,  263,  263,  311,
-      263,  311,  312,  911,  857,  312,  912, 1751,  300,  717,
+      263,  311,  312,  781,  858,  312, 1736,  782,  300,  717,
       303,  303,  300,  718,  759,  312,  677,  719,  309,  303,
       304,  263,  304,  303,  303,  303,  303,  303,  303,  303,
       305,  303,  303,  303,  662,  303,  307,  303,  308,  303,
-      311,  263,  311,  311,  263,  311,  311,  263,  311,  807,
-      661,  865,  276,  277,  863,  698,  312,  278, 3285,  313,
-      697,  864,  313,  808,  303,  303,  743,  323,  699,  759,
-      692, 1752,  309,  314,  315,  263,  315,  314,  314,  314,
-      314,  314,  314,  314,  316,  314,  314,  314, 1753,  314,
+      311,  263,  311,  311,  263,  311,  311,  263,  311,  808,
+      661,  866,  276,  277,  864,  698,  312,  278, 3322,  313,
+      697,  865,  313,  809,  303,  303,  743,  323,  699,  759,
+      692, 1740,  309,  314,  315,  263,  315,  314,  314,  314,
+      314,  314,  314,  314,  316,  314,  314,  314, 1744,  314,
 
-      318,  314,  319,  314, 1754,  662,  324,  691,  337,  263,
+      318,  314,  319,  314, 1746,  662,  324,  691,  337,  263,
       337,  337,  263,  337,  349,  263,  349,  697,  276,  277,
-      700,  661,  692,  278,  338,  710,  802,  338,  314,  314,
-      350,  696,  711,  323,  803, 1019,  320,  765, 1020,  321,
-      804,  661,  658,  658,  658, 1759,  322,  314,  315,  263,
+      700,  661,  692,  278,  338,  710,  803,  338,  314,  314,
+      350,  696,  711,  323,  804,  912,  320,  765,  913,  321,
+      805,  661,  658,  658,  658, 1753,  322,  314,  315,  263,
       315,  314,  314,  314,  314,  314,  314,  314,  316,  314,
       314,  314,  324,  314,  318,  314,  319,  314,  349,  263,
-      349,  360,  263,  360,  360,  263,  360, 1760,  360,  263,
+      349,  360,  263,  360,  360,  263,  360, 1754,  360,  263,
       360,  360,  263,  360,  350,  662,  748,  361,  662,  743,
-      361,  858,  314,  314,  362,  723, 1500,  362, 1761,  697,
+      361,  859,  314,  314,  362,  723, 1500,  362, 1755,  697,
 
       320,  661,  749,  321,  661,  658,  658,  658,  765, 1501,
       322,  325,  326,  263,  326,  325,  325,  325,  325,  325,
-      325,  325,  327,  325,  325,  325, 1762,  325,  329,  325,
+      325,  325,  327,  325,  325,  325, 1756,  325,  329,  325,
       330,  325,  263,  263,  263,  263,  263,  263,  360,  263,
-      360,  783,  360,  263,  360,  360,  263,  360,  363, 1763,
-      662,  363,  662,  662,  361, 1764,  325,  325,  361,  729,
+      360,  784,  360,  263,  360,  360,  263,  360,  363, 1761,
+      662,  363,  662,  662,  361, 1762,  325,  325,  361,  729,
       696,  364,  658,  658,  658,  331,  661,  332,  661,  661,
-      783,  333,  658,  658,  658,  812,  334,  335,  325,  326,
+      784,  333,  658,  658,  658,  813,  334,  335,  325,  326,
       263,  326,  325,  325,  325,  325,  325,  325,  325,  327,
       325,  325,  325,  696,  325,  329,  325,  330,  325,  360,
 
-      263,  360,  263,  263,  263,  263,  263,  263,  890,  360,
-      263,  360,  360,  263,  360,  364,  746, 1765,  365,  784,
+      263,  360,  263,  263,  263,  263,  263,  263,  891,  360,
+      263,  360,  360,  263,  360,  364,  746, 1763,  365,  785,
       686,  365,  743,  325,  325,  366,  739,  743,  366,  658,
       658,  658,  331,  742,  332,  658,  658,  658,  333,  658,
-      658,  658, 1772,  334,  335,  339,  340,  263,  340,  339,
+      658,  658, 1764,  334,  335,  339,  340,  263,  340,  339,
       339,  339,  339,  339,  339,  339,  341,  339,  339,  339,
       693,  339,  343,  339,  344,  339,  360,  263,  360,  360,
-      263,  360,  263,  263,  263,  905,  263,  263,  263,  360,
-      263,  360,  367, 1773, 1782,  367,  905,  875,  368,  750,
-      339,  339,  368,  737,  738,  364,  881,  345,  658,  658,
+      263,  360,  263,  263,  263,  906,  263,  263,  263,  360,
+      263,  360,  367, 1765, 1766,  367,  906,  876,  368,  750,
+      339,  339,  368,  737,  738,  364,  882,  345,  658,  658,
 
-      658,  906,  696,  346,  751,  658,  658,  658,  658,  658,
-      658,  957,  347,  339,  340,  263,  340,  339,  339,  339,
-      339,  339,  339,  339,  341,  339,  339,  339, 1784,  339,
+      658,  907,  696,  346,  751,  658,  658,  658,  658,  658,
+      658,  958,  347,  339,  340,  263,  340,  339,  339,  339,
+      339,  339,  339,  339,  341,  339,  339,  339, 1767,  339,
       343,  339,  344,  339,  360,  263,  360,  263,  263,  263,
       263,  263,  263,  697,  360,  263,  360,  360,  263,  360,
-      364,  662,  697,  369, 1785,  923,  369,  662,  339,  339,
-      367,  662,  662,  367,  770,  345, 1795,  661,  658,  658,
-      658,  346,  983,  661,  658,  658,  658,  661,  661,  992,
+      364,  662,  697,  369, 1774,  924,  369,  662,  339,  339,
+      367,  662,  662,  367,  770,  345, 1775,  661,  658,  658,
+      658,  346,  984,  661,  658,  658,  658,  661,  661,  993,
       347,  351,  352,  263,  352,  351,  351,  351,  351,  351,
-      351,  351,  353,  351,  351,  351,  924,  351,  355,  351,
+      351,  351,  353,  351,  351,  351,  925,  351,  355,  351,
 
       356,  351,  360,  263,  360,  360,  263,  360,  263,  263,
-      263, 1796,  263,  263,  263,  360,  263,  360,  370,  662,
-     1806,  370,  662, 1809,  371,  812,  351,  351,  371,  775,
-     1810,  372,  658,  658,  658,  661, 3285,  357,  661,  658,
-      658,  658,  658,  658,  658, 1814,  358,  351,  352,  263,
+      263, 1780,  263,  263,  263,  360,  263,  360,  370,  662,
+     1019,  370,  662, 1020,  371,  813,  351,  351,  371,  775,
+     1785,  372,  658,  658,  658,  661, 3322,  357,  661,  658,
+      658,  658,  658,  658,  658, 1787,  358,  351,  352,  263,
       352,  351,  351,  351,  351,  351,  351,  351,  353,  351,
-      351,  351,  983,  351,  355,  351,  356,  351,  360,  263,
+      351,  351,  984,  351,  355,  351,  356,  351,  360,  263,
       360,  263,  263,  263,  263,  263,  263,  696,  360,  263,
-      360,  360,  263,  360,  372,  784,  992,  373,  743,  923,
-      373, 1815,  351,  351,  370,  662, 1818,  370,  360,  263,
+      360,  360,  263,  360,  372,  785,  993,  373,  743,  924,
+      373, 1788,  351,  351,  370,  662, 1794,  370,  360,  263,
 
-      360, 1819,  788,  357,  360,  263,  360,  658,  658,  658,
-      851,  661,  358,  993,  374,  658,  658,  658,  734, 1820,
+      360, 1799,  789,  357,  360,  263,  360,  658,  658,  658,
+      852,  661,  358,  994,  374,  658,  658,  658,  734, 1800,
       374,  375,  376,  263,  376,  375,  375,  375,  375,  375,
-      375,  375,  377,  375,  375,  375,  983,  375,  379,  375,
+      375,  375,  377,  375,  375,  375,  984,  375,  379,  375,
       380,  375,  386,  263,  386,  386,  263,  386,  263,  263,
-      263,  932,  263,  263,  263,  933,  752,  662,  387, 1027,
-      993,  387,  743, 1028,  363, 3285,  375,  375,  363,  662,
-      662,  381,  741,  661,  851,  693,  794,  382,  658,  658,
+      263,  933,  263,  263,  263,  934,  752,  662,  387, 1028,
+      994,  387,  743, 1029,  363, 3322,  375,  375,  363,  662,
+      662,  381,  741,  661,  852,  693,  795,  382,  658,  658,
       658,  383,  658,  658,  658,  661,  661,  384,  375,  376,
       263,  376,  375,  375,  375,  375,  375,  375,  375,  377,
 
       375,  375,  375,  680,  375,  379,  375,  380,  375,  386,
-      263,  386,  386,  263,  386,  386,  263,  386,  889,  386,
-      263,  386,  658,  658,  658,  387,  696,  809,  387, 1821,
-     1822,  388, 1823,  375,  375,  388,  662,  662,  381,  810,
-      811,  658,  658,  658,  382,  658,  658,  658,  383,  658,
+      263,  386,  386,  263,  386,  386,  263,  386,  890,  386,
+      263,  386,  658,  658,  658,  387,  696,  810,  387, 1810,
+     1813,  388, 1814,  375,  375,  388,  662,  662,  381,  811,
+      812,  658,  658,  658,  382,  658,  658,  658,  383,  658,
       658,  658,  661,  661,  384,  389,  390,  263,  390,  389,
       389,  389,  389,  389,  389,  389,  391,  389,  389,  389,
       696,  389,  393,  389,  394,  389,  399,  263,  399,  399,
-      263,  399,  263,  263,  263,  925,  263,  263,  263, 1145,
-      662, 1831,  400, 1476, 1834,  400,  926,  822,  363,  927,
+      263,  399,  263,  263,  263,  926,  263,  263,  263, 1146,
+      662, 1818,  400, 1476, 1819,  400,  927,  823,  363,  928,
 
       389,  389,  363,  662,  662,  395,  661,  658,  658,  658,
-      832,  396,  658,  658,  658,  658,  658,  658, 1145,  661,
-      661, 1835,  397,  389,  390,  263,  390,  389,  389,  389,
-      389,  389,  389,  389,  391,  389,  389,  389, 1684,  389,
+      833,  396,  658,  658,  658,  658,  658,  658, 1146,  661,
+      661, 1822,  397,  389,  390,  263,  390,  389,  389,  389,
+      389,  389,  389,  389,  391,  389,  389,  389, 1686,  389,
       393,  389,  394,  389,  399,  263,  399,  399,  263,  399,
-      399,  263,  399,  937,  399,  263,  399,  658,  658,  658,
-      400,  662,  662,  400,  662, 1838,  401,  938,  389,  389,
-      401,  837, 1840,  395,  658,  658,  658,  661,  661,  396,
+      399,  263,  399,  938,  399,  263,  399,  658,  658,  658,
+      400,  662,  662,  400,  662, 1823,  401,  939,  389,  389,
+      401,  838, 1824,  395,  658,  658,  658,  661,  661,  396,
       661,  658,  658,  658,  658,  658,  658,  658,  658,  658,
       397,  402,  403,  263,  403,  402,  402,  402,  402,  402,
 
-      402,  402,  404,  402,  402,  402, 1842,  402,  406,  402,
+      402,  402,  404,  402,  402,  402, 1825,  402,  406,  402,
       407,  402,  411,  263,  411,  411,  263,  411,  422,  263,
-      422, 1843,  422,  263,  422,  436,  263,  436,  412,  662,
-      662,  412,  662, 1845,  423,  865,  402,  402,  423,  843,
-      898,  437,  658,  658,  658,  661,  661,  408,  661,  658,
-      658,  658,  409,  402,  403,  263,  403,  402,  402,  402,
-      402,  402,  402,  402,  404,  402,  402,  402, 1846,  402,
-      406,  402,  407,  402,  436,  263,  436,  263,  263,  263,
-      263,  263,  263,  858,  436,  263,  436,  436,  263,  436,
-      437,  697,  743,  438, 1847, 1852,  438,  662,  402,  402,
-
-      437, 1855,  898,  437, 1856,  857,  658,  658,  658,  408,
+      422,  899,  422,  263,  422,  436,  263,  436,  412,  662,
+      662,  412,  662, 1826,  423, 1827,  402,  402,  423,  844,
+      866,  437,  658,  658,  658,  661,  661,  899,  661,  658,
+      658,  658,  408, 1835,  858, 1838, 1839,  409,  402,  403,
+      263,  403,  402,  402,  402,  402,  402,  402,  402,  404,
+      402,  402,  402,  743,  402,  406,  402,  407,  402,  436,
+      263,  436,  263,  263,  263,  263,  263,  263,  859,  436,
+      263,  436,  436,  263,  436,  437,  697, 1842,  438,  696,
+
+     1844,  438,  859,  402,  402,  437,  696,  662,  437,  658,
+      658,  658,  658,  658,  658,  658,  658,  658, 1846,  408,
       658,  658,  658,  661,  409,  413,  414,  263,  414,  413,
       413,  413,  413,  413,  413,  413,  415,  413,  413,  413,
-     1857,  413,  417,  413,  418,  413,  436,  263,  436,  436,
-      263,  436,  448,  263,  448,  942,  448,  263,  448,  460,
-      263,  460,  439,  858,  696,  439,  662,  696,  449,  938,
-      413,  413,  449,  870,  662,  461,  658,  658,  658,  658,
-      658,  658,  661,  658,  658,  658,  419,  658,  658,  658,
-      661, 1859,  420,  413,  414,  263,  414,  413,  413,  413,
-      413,  413,  413,  413,  415,  413,  413,  413, 1862,  413,
-
+     1847,  413,  417,  413,  418,  413,  436,  263,  436,  436,
+      263,  436,  448,  263,  448,  943,  448,  263,  448,  460,
+      263,  460,  439,  662,  662,  439,  662,  943,  449,  939,
+      413,  413,  449,  871,  662,  461,  658,  658,  658,  661,
+      661,  990,  661,  658,  658,  658,  419, 1849, 1850,  876,
+      661, 1851,  420,  413,  414,  263,  414,  413,  413,  413,
+
+      413,  413,  413,  413,  415,  413,  413,  413, 1856,  413,
       417,  413,  418,  413,  460,  263,  460,  477,  263,  477,
-      477,  263,  477, 1863,  263,  263,  263,  263,  263,  263,
-      461, 1865,  662,  478, 1869, 1870,  478,  662,  413,  413,
-      363,  925,  662,  363,  658,  658,  658,  875,  661,  658,
-      658,  658,  926,  661,  419,  941, 1871,  881,  661, 1873,
+      477,  263,  477, 1859,  263,  263,  263,  263,  263,  263,
+      461, 1512, 1860,  478, 1861, 1863,  478,  859,  413,  413,
+      363,  926,  662,  363, 1501,  697,  658,  658,  658,  658,
+      658,  658,  927, 1866,  419,  942, 1867,  882,  661, 1869,
       420,  424,  425,  263,  425,  424,  424,  424,  424,  424,
-      424,  424,  426,  424,  424,  424, 1687,  424,  428,  424,
+      424,  424,  426,  424,  424,  424, 1873,  424,  428,  424,
       429,  424,  477,  263,  477,  477,  263,  477,  477,  263,
-      477, 1884,  477,  263,  477,  858,  662, 1885,  478, 1886,
-     1888,  478, 1889,  697,  479,  858,  424,  424,  479,  430,
+      477, 1874,  477,  263,  477,  658,  658,  658,  478, 1512,
 
-      662,  431,  661,  697,  658,  658,  658,  432,  658,  658,
-      658,  658,  658,  658,  433,  889,  661,  434,  424,  425,
+     1875,  478, 1877, 1689,  479,  859,  424,  424,  479,  430,
+      662,  431, 1550,  697,  658,  658,  658,  432,  658,  658,
+      658,  658,  658,  658,  433,  890,  661,  434,  424,  425,
       263,  425,  424,  424,  424,  424,  424,  424,  424,  426,
-      424,  424,  424, 1890,  424,  428,  424,  429,  424,  493,
-      263,  493,  493,  263,  493,  509,  263,  509,  944,  509,
-      263,  509,  890, 1891, 1892,  494, 1145, 1145,  494,  945,
-     1512,  510,  927,  424,  424,  510,  430,  743,  431,  658,
-      658,  658, 1147, 1501,  432,  658,  658,  658,  658,  658,
-      658,  433, 1881, 1893,  434,  440,  441,  263,  441,  440,
-      440,  440,  440,  440,  440,  440,  442,  440,  440,  440,
+      424,  424,  424, 1888,  424,  428,  424,  429,  424,  493,
+      263,  493,  493,  263,  493,  509,  263,  509,  945,  509,
+      263,  509,  891,  662, 1889,  494, 1890,  662,  494,  946,
+      895,  510,  928,  424,  424,  510,  430,  743,  431,  661,
+      658,  658,  658,  661,  432,  658,  658,  658,  658,  658,
+      658,  433, 1892, 1893,  434,  440,  441,  263,  441,  440,
 
+      440,  440,  440,  440,  440,  440,  442,  440,  440,  440,
      1894,  440,  444,  440,  445,  440,  520,  263,  520,  520,
-      263,  520,  532,  263,  532,  942,  532,  263,  532,  545,
-      263,  545,  521, 1895, 1896,  521,  662,  662,  533,  989,
-      440,  440,  533,  894,  903,  546,  658,  658,  658,  658,
-      658,  658,  661,  661, 1897, 1899,  446,  440,  441,  263,
+      263,  520,  532,  263,  532,  943,  532,  263,  532,  545,
+      263,  545,  521, 1895, 1896,  521,  662, 1897,  533,  995,
+      440,  440,  533,  904, 1898,  546,  658,  658,  658,  658,
+      658,  658,  661,  910,  910,  910,  446,  440,  441,  263,
       441,  440,  440,  440,  440,  440,  440,  440,  442,  440,
-      440,  440, 1900,  440,  444,  440,  445,  440,  545,  263,
-      545,  263,  263,  263,  263,  263,  263,  942,  545,  263,
-      545,  545,  263,  545,  546, 1901, 1902,  363,  934, 1905,
-      363,  994,  440,  440,  546,  935, 1908,  546,  658,  658,
+      440,  440, 1899,  440,  444,  440,  445,  440,  545,  263,
+      545,  263,  263,  263,  263,  263,  263, 1900,  545,  263,
+      545,  545,  263,  545,  546,  945, 1901,  363,  935,  926,
 
-      658,  936,  909,  909,  909, 1162, 1162, 1162,  446,  450,
+      363,  948,  440,  440,  546,  936,  946,  546,  936,  942,
+      946,  937,  911,  942,  949, 1163, 1163, 1163,  446,  450,
       451,  263,  451,  450,  450,  450,  450,  450,  450,  450,
-      452,  450,  450,  450, 1909,  450,  454,  450,  455,  450,
-      545,  263,  545,  545,  263,  545,  557,  263,  557, 1910,
-      557,  263,  557,  263,  263,  263,  547, 1911, 1912,  547,
-      947, 1913,  558,  944,  450,  450,  558,  935,  942,  559,
-      456,  910,  947,  948,  945,  457, 1917,  941, 1918,  935,
-     1920, 1921,  995, 1922, 1924,  936, 1937,  458,  450,  451,
+      452,  450,  450,  450, 1903,  450,  454,  450,  455,  450,
+      545,  263,  545,  545,  263,  545,  557,  263,  557,  943,
+      557,  263,  557,  263,  263,  263,  547, 1904, 1146,  547,
+      948,  935,  558,  996,  450,  450,  558,  936,  936,  559,
+      456,  935,  948,  937,  949,  457, 1905, 1906,  936,  936,
+     1492, 1492, 1492, 1885,  989,  989, 1909,  458,  450,  451,
       263,  451,  450,  450,  450,  450,  450,  450,  450,  452,
-      450,  450,  450, 1938,  450,  454,  450,  455,  450,  263,
 
-      263,  263,  557,  263,  557,  557,  263,  557, 1939,  557,
-      263,  557,  557,  263,  557,  559, 1940, 1941,  558,  934,
-      934,  558, 1512,  450,  450,  560,  935,  935,  560,  456,
-      947,  925,  948,  988,  457, 1550, 1944,  935, 1492, 1492,
-     1492, 1945,  945,  988, 1946,  941,  458,  462,  463,  263,
+      450,  450,  450, 1912,  450,  454,  450,  455,  450,  263,
+      263,  263,  557,  263,  557,  557,  263,  557, 1913,  557,
+      263,  557,  557,  263,  557,  559, 1146, 1914,  558, 1915,
+     1916,  558, 1917,  450,  450,  560, 1921, 1922,  560,  456,
+     1924, 1925, 1148, 1926,  457,  910,  910,  910, 1928, 1150,
+     1186, 1186, 1186, 1547, 1547, 1547,  458,  462,  463,  263,
       463,  462,  462,  462,  462,  462,  462,  462,  464,  462,
       462,  462,  465,  462,  466,  462,  467,  462,  465,  465,
       465,  465,  465,  465,  465,  465,  465,  465,  465,  465,
       465,  465,  465,  465,  465,  465,  465,  465,  465,  465,
-      465,  465,  462,  462,  465,  468,  469,  470,  465,  465,
 
+      465,  465,  462,  462,  465,  468,  469,  470,  465,  465,
       465,  465,  465,  471,  465,  465,  472,  465,  465,  465,
       473,  465,  474,  475,  465,  465,  465,  465,  465,  465,
       465,  480,  481,  263,  481,  480,  480,  480,  480,  480,
-      480,  480,  482,  480,  480,  480, 1947,  480,  484,  480,
+      480,  480,  482,  480,  480,  480, 1941,  480,  484,  480,
       485,  480,  571,  263,  571,  571,  263,  571,  263,  263,
-      263, 1952,  263,  263,  263,  571,  263,  571,  572, 1960,
-     1961,  572, 1968, 1972,  559, 1974,  480,  480,  559, 1980,
-      486,  572,  909,  909,  909, 1981, 1149,  487, 1982, 1988,
-      488, 1162, 1162, 1162,  489, 1989,  490,  491,  480,  481,
-      263,  481,  480,  480,  480,  480,  480,  480,  480,  482,
+      263, 1942,  263,  263,  263,  571,  263,  571,  572, 1315,
+     1943,  572, 1944, 1945,  559, 1948,  480,  480,  559, 1316,
+      486,  572, 1163, 1163, 1163, 1949, 1317,  487, 1950, 1951,
+      488, 1186, 1186, 1186,  489, 1956,  490,  491,  480,  481,
 
-      480,  480,  480, 1990,  480,  484,  480,  485,  480,  571,
-      263,  571,  571,  263,  571,  571,  263,  571, 1991,  583,
-      263,  583,  583,  263,  583,  572, 2004, 2010,  573, 2014,
-     2017,  573, 2019,  480,  480,  584, 2020,  486,  584, 1198,
-     1198, 1198, 2022, 1199,  487, 1163, 1200,  488, 1185, 1185,
-     1185,  489, 2023,  490,  491,  495,  496,  263,  496,  495,
+      263,  481,  480,  480,  480,  480,  480,  480,  480,  482,
+      480,  480,  480, 1960,  480,  484,  480,  485,  480,  571,
+      263,  571,  571,  263,  571,  571,  263,  571, 1965,  583,
+      263,  583,  583,  263,  583,  572, 1966, 1975,  573, 1979,
+     1981,  573, 1987,  480,  480,  584, 1164,  486,  584, 1199,
+     1199, 1199, 1988, 1200,  487, 1164, 1201,  488, 1492, 1492,
+     1492,  489, 1989,  490,  491,  495,  496,  263,  496,  495,
       495,  495,  495,  495,  495,  495,  497,  495,  495,  495,
-     2024,  495,  499,  495,  500,  495,  594,  263,  594,  594,
-      263,  594,  263,  263,  263, 2028,  263,  263,  263,  954,
-      954,  954,  595, 2031, 2033,  595, 2040, 2048,  559, 1315,
-
-      495,  495,  559,  501,  502,  503,  955, 2049, 2050, 1316,
-     2051,  504, 1163, 2053,  505, 2067, 1317, 2071,  506, 1687,
-     1145,  507,  495,  496,  263,  496,  495,  495,  495,  495,
-      495,  495,  495,  497,  495,  495,  495, 2064,  495,  499,
+     1995,  495,  499,  495,  500,  495,  594,  263,  594,  594,
+      263,  594,  263,  263,  263, 1996,  263,  263,  263,  955,
+
+      955,  955,  595, 1997, 1998,  595, 2011, 2017,  559, 2021,
+      495,  495,  559,  501,  502,  503,  956, 2024, 1209, 1209,
+     1209,  504, 1210, 2026,  505, 1211, 2027, 2029,  506, 2030,
+     2031,  507,  495,  496,  263,  496,  495,  495,  495,  495,
+      495,  495,  495,  497,  495,  495,  495, 2035,  495,  499,
       495,  500,  495,  594,  263,  594,  594,  263,  594,  594,
-      263,  594, 2072,  594,  263,  594,  962,  962,  962,  595,
-     2073, 2065,  595, 2076, 2074,  596, 2077,  495,  495,  596,
-      501,  502,  503,  963, 2079, 1208, 1208, 1208,  504, 1209,
-     2075,  505, 1210, 2080, 2081,  506, 1687, 2082,  507,  511,
-      512,  263,  512,  511,  511,  511,  511,  511,  511,  511,
+      263,  594, 2038,  594,  263,  594,  963,  963,  963,  595,
+     2040, 2047,  595, 2055, 2056,  596, 2057,  495,  495,  596,
+      501,  502,  503,  964, 2058, 1231, 1231, 1231,  504, 1232,
+     2060,  505, 1233, 2074, 2078,  506, 1689, 1146,  507,  511,
 
-      513,  511,  511,  511, 2083,  511,  515,  511,  516,  511,
-      607,  263,  607,  607,  263,  607,  263,  263,  263, 2066,
-      263,  263,  263,  977,  977,  977,  608, 2084, 2087,  608,
-     2088, 2091,  559, 2092,  511,  511,  559, 2093, 2094,  517,
-      978, 1185, 1185, 1185, 2095,  518,  511,  512,  263,  512,
+      512,  263,  512,  511,  511,  511,  511,  511,  511,  511,
+      513,  511,  511,  511, 2071,  511,  515,  511,  516,  511,
+      607,  263,  607,  607,  263,  607,  263,  263,  263, 2079,
+      263,  263,  263,  978,  978,  978,  608, 2080, 2072,  608,
+     2083, 2084,  559, 2086,  511,  511,  559, 2087, 2088,  517,
+      979, 1703, 1703, 1703, 2089,  518,  511,  512,  263,  512,
       511,  511,  511,  511,  511,  511,  511,  513,  511,  511,
-      511, 2097,  511,  515,  511,  516,  511,  607,  263,  607,
-      607,  263,  607,  607,  263,  607, 2098,  607,  263,  607,
-      997,  997,  997,  608, 2101, 2104,  608, 2108, 2109,  609,
-     2112,  511,  511,  609, 2113, 2114,  517,  998, 1547, 1547,
+      511, 1689,  511,  515,  511,  516,  511,  607,  263,  607,
+      607,  263,  607,  607,  263,  607, 2090,  607,  263,  607,
+      998,  998,  998,  608, 2091, 2081,  608, 1704, 2094,  609,
 
-     1547, 2117,  518,  522,  523,  263,  523,  522,  522,  522,
-      522,  522,  522,  522,  524,  522,  522,  522, 2121,  522,
+     2095,  511,  511,  609, 2073, 2098,  517,  999, 1706, 1706,
+     1706, 2082,  518,  522,  523,  263,  523,  522,  522,  522,
+      522,  522,  522,  522,  524,  522,  522,  522, 2099,  522,
       526,  522,  527,  522,  622,  263,  622,  622,  263,  622,
-      263,  263,  263, 2110,  263,  263,  263,  622,  263,  622,
-      623, 2111, 2122,  623, 2123, 2125,  624, 2127,  522,  522,
-      624, 2143,  528,  623, 1230, 1230, 1230, 2144, 1231,  529,
-     2124, 1232,  530,  522,  523,  263,  523,  522,  522,  522,
-      522,  522,  522,  522,  524,  522,  522,  522, 2145,  522,
+      263,  263,  263, 2100,  263,  263,  263,  622,  263,  622,
+      623, 2101, 2102,  623, 1707, 2104,  624, 2105,  522,  522,
+      624, 2108,  528,  623, 1163, 1163, 1163, 2111, 2115,  529,
+     2116, 2119,  530,  522,  523,  263,  523,  522,  522,  522,
+      522,  522,  522,  522,  524,  522,  522,  522, 2120,  522,
       526,  522,  527,  522,  622,  263,  622,  622,  263,  622,
-      622,  263,  622, 2115,  634,  263,  634,  634,  263,  634,
 
-      623, 2116, 2123,  625, 2074, 2146,  625, 2147,  522,  522,
-      635, 2148,  528,  635, 1162, 1162, 1162, 2150, 2075,  529,
-     2124, 2154,  530,  534,  535,  263,  535,  534,  534,  534,
-      534,  534,  534,  534,  536,  534,  534,  534, 2155,  534,
+      622,  263,  622, 2117,  634,  263,  634,  634,  263,  634,
+      623, 2118, 2121,  625, 2124, 2128,  625, 2129,  522,  522,
+      635, 2132,  528,  635, 1186, 1186, 1186, 2134, 1239,  529,
+     2146, 2153,  530,  534,  535,  263,  535,  534,  534,  534,
+      534,  534,  534,  534,  536,  534,  534,  534, 2154,  534,
       538,  534,  539,  534,  644,  263,  644,  644,  263,  644,
-      263,  263,  263, 2156,  263,  263,  263,  644,  263,  644,
-      645, 2162, 2163,  645, 2164, 2178,  363, 2182,  534,  534,
-      363, 2183,  540,  645, 1185, 1185, 1185, 2184, 1238,  541,
-     2186, 2190,  542, 1492, 1492, 1492, 1701, 1701, 1701,  543,
-      534,  535,  263,  535,  534,  534,  534,  534,  534,  534,
+      263,  263,  263, 2122,  263,  263,  263,  644,  263,  644,
+      645, 2123, 2158,  645, 2130, 2130,  363, 2159,  534,  534,
+      363, 2160,  540,  645, 1710, 1710, 1710, 2161, 1239,  541,
+     2131, 2082,  542, 1713, 1713, 1713, 1723, 1723, 1723,  543,
 
-      534,  536,  534,  534,  534, 2194,  534,  538,  534,  539,
+      534,  535,  263,  535,  534,  534,  534,  534,  534,  534,
+      534,  536,  534,  534,  534, 2163,  534,  538,  534,  539,
       534,  644,  263,  644,  644,  263,  644,  644,  263,  644,
-     2195,  656,  263,  656,  656,  263,  656,  645, 2196, 2197,
-      646, 2198, 1702,  646, 2201,  534,  534,  657, 1238,  540,
-      657, 3285, 2208,  734,  693, 2210,  541, 2220, 2221,  542,
-     2222,  693, 2223,  744, 2225, 1687,  543,  548,  549,  263,
+     2167,  656,  263,  656,  656,  263,  656,  645, 1929, 2081,
+      646, 2168, 2169,  646, 1930,  534,  534,  657, 1931,  540,
+      657, 3322, 1932,  734,  693, 2131,  541, 2175, 2176,  542,
+     2177,  693, 2191,  744, 2195, 2196,  543,  548,  549,  263,
       549,  548,  548,  548,  548,  548,  548,  548,  550,  548,
-      548,  548,  748,  548,  552,  548,  553,  548, 2231, 2237,
-      694,  745, 2238, 1004, 1004, 1004,  695, 2239,  749, 1009,
-     1009, 1009, 1145,  696, 2240,  696, 2243,  697, 2228,  690,
-
-     1005, 2230,  548,  548, 2245, 2246, 1010, 2247,  554, 1252,
-     1252, 1252, 2251, 1253, 2256, 2258, 1254, 1704, 1704, 1704,
-     1708, 1708, 1708,  555,  548,  549,  263,  549,  548,  548,
-      548,  548,  548,  548,  548,  550,  548,  548,  548, 2259,
-      548,  552,  548,  553,  548, 1021, 1021, 1021, 1033, 1033,
-     1033, 1035, 1035, 1035, 1041, 1041, 1041, 1044, 1044, 1044,
-     2260, 2264, 1022, 1705, 2270, 1034, 2271, 2272, 1036,  548,
-      548, 1042, 2273, 2274, 1045,  554, 1262, 1262, 1262, 2275,
-     1263, 2276, 2277, 1264, 1711, 1711, 1711, 1721, 1721, 1721,
-      555,  561,  562,  263,  562,  561,  561,  561,  561,  561,
+      548,  548,  748,  548,  552,  548,  553,  548, 2197, 2199,
+      694,  745, 2203, 1005, 1005, 1005,  695, 2207,  749, 1021,
+
+     1021, 1021, 2208,  696, 2209,  696, 2210,  697, 2211,  690,
+     1006, 2214,  548,  548, 2221, 2223, 1022, 2233,  554, 1253,
+     1253, 1253, 2234, 1254, 2235, 2236, 1255, 1547, 1547, 1547,
+     1757, 1757, 1757,  555,  548,  549,  263,  549,  548,  548,
+      548,  548,  548,  548,  548,  550,  548,  548,  548, 2238,
+      548,  552,  548,  553,  548, 1034, 1034, 1034, 1036, 1036,
+     1036, 1042, 1042, 1042, 1045, 1045, 1045, 1059, 1059, 1059,
+     1689, 1146, 1035, 2244, 2250, 1037, 1758, 2241, 1043,  548,
+      548, 1046, 2251, 2252, 1060,  554, 1263, 1263, 1263, 2253,
+     1264, 2256, 2258, 1265, 1759, 1759, 1759, 1760, 1760, 1760,
 
-      561,  561,  563,  561,  561,  561, 2278,  561,  565,  561,
-      566,  561, 1058, 1058, 1058, 1060, 1060, 1060, 1072, 1072,
-     1072, 1080, 1080, 1080, 1085, 1085, 1085, 2279, 2285, 1059,
-     2286, 2287, 1061, 2288, 2300, 1073,  561,  561, 1081, 2301,
-     2306, 1086,  567, 2302, 2304,  568, 1270, 1270, 1270, 2307,
-     1271, 2303, 2305, 1272, 1547, 1547, 1547,  569,  561,  562,
+      555,  561,  562,  263,  562,  561,  561,  561,  561,  561,
+      561,  561,  563,  561,  561,  561, 2243,  561,  565,  561,
+      566,  561, 1061, 1061, 1061, 1073, 1073, 1073, 1081, 1081,
+     1081, 1086, 1086, 1086, 1092, 1092, 1092, 2259, 2260, 1062,
+     1707, 2264, 1074, 2269, 2271, 1082,  561,  561, 1087, 2272,
+     2273, 1093,  567, 2277, 2283,  568, 1286, 1286, 1286, 2284,
+     1287, 2285, 2286, 1288, 1706, 1706, 1706,  569,  561,  562,
       263,  562,  561,  561,  561,  561,  561,  561,  561,  563,
-      561,  561,  561, 2309,  561,  565,  561,  566,  561, 1091,
-     1091, 1091, 1111, 1111, 1111, 1135, 1135, 1135, 1139, 1139,
-     1139, 1687, 1158, 1158, 1158, 2310, 1092, 2311, 2312, 1112,
+      561,  561,  561, 2287,  561,  565,  561,  566,  561, 1112,
+     1112, 1112, 1136, 1136, 1136, 1140, 1140, 1140, 1159, 1159,
 
-     2316, 2317, 1136,  561,  561, 1140,  954,  954,  954,  567,
-     1160, 2318,  568, 1287, 1287, 1287, 2324, 1288, 2325, 2326,
-     1289, 2327, 2229,  955,  569,  574,  575,  263,  575,  574,
+     1159, 1933, 1159, 1159, 1159, 2288, 1113, 1934, 2289, 1137,
+     1858, 1935, 1141,  561,  561, 1936, 1161, 2290, 2291,  567,
+     1161, 2292,  568, 1304, 1304, 1304, 2298, 1305, 1689, 2299,
+     1306, 1703, 1703, 1703,  569,  574,  575,  263,  575,  574,
       574,  574,  574,  574,  574,  574,  576,  574,  574,  574,
-     2330,  574,  578,  574,  579,  574, 1158, 1158, 1158, 1193,
-     1193, 1193, 2335, 2339, 1193, 1193, 1193, 1203, 1203, 1203,
-     1203, 1203, 1203, 1925, 1160, 2340, 2341, 1195, 2345, 1926,
-      574,  574, 1195, 1927, 2342, 1205,  580, 1928, 1205, 2346,
-     2347,  581,  574,  575,  263,  575,  574,  574,  574,  574,
-      574,  574,  574,  576,  574,  574,  574, 2348,  574,  578,
-
-      574,  579,  574, 2350, 1161,  962,  962,  962, 1211, 1211,
-     1211, 1219, 1219, 1219, 1196, 1214, 1214, 1214, 1219, 1219,
-     1219, 2360,  963, 2343, 1206, 1212, 2371,  574,  574, 1221,
-     2372, 2344, 1215,  580, 2373, 1687, 1221, 2377,  581,  585,
+     2300,  574,  578,  574,  579,  574, 1194, 1194, 1194, 2242,
+     1162, 1194, 1194, 1194, 2301,  955,  955,  955, 2307, 1204,
+     1204, 1204, 2312, 2314, 1196, 1706, 1706, 1706, 2316, 1196,
+      574,  574,  956, 1902, 1902, 1902,  580, 1206, 1710, 1710,
+     1710,  581,  574,  575,  263,  575,  574,  574,  574,  574,
+
+      574,  574,  574,  576,  574,  574,  574, 2317,  574,  578,
+      574,  579,  574, 1204, 1204, 1204,  963,  963,  963, 2322,
+     2323, 1197, 1212, 1212, 1212, 1215, 1215, 1215, 1220, 1220,
+     1220, 1206, 2318,  964, 1713, 1713, 1713,  574,  574, 1213,
+     2319, 2325, 1216,  580, 2326, 2327, 1222, 2328,  581,  585,
       586,  263,  586,  585,  585,  585,  585,  585,  585,  585,
-      587,  585,  585,  585, 2378,  585,  589,  585,  590,  585,
-     1226, 1226, 1226, 2379, 2382, 1222, 2386, 2387, 1226, 1226,
-     1226,  977,  977,  977, 1234, 1234, 1234, 1929, 1228,  997,
-      997,  997, 2366, 1930,  585,  585, 1228, 1931,  978, 2388,
-      591, 1932, 1236, 1304, 1304, 1304,  998, 1305, 2389, 2390,
+      587,  585,  585,  585, 2332,  585,  589,  585,  590,  585,
+     1227, 1227, 1227, 1227, 1227, 1227, 2333, 1207, 2334,  978,
+      978,  978, 2320, 2340, 1220, 1220, 1220, 2341, 1229, 2342,
+     2321, 1229, 2343, 2346,  585,  585,  979,  998,  998,  998,
 
-     1306, 1758, 1758, 1758, 2391,  592,  585,  586,  263,  586,
+      591, 2351, 1222, 1307, 1307, 1307, 2355, 1308, 2356, 2361,
+     1309, 1907, 1907, 1907,  999,  592,  585,  586,  263,  586,
       585,  585,  585,  585,  585,  585,  585,  587,  585,  585,
-      585, 2392,  585,  589,  585,  590,  585, 1234, 1234, 1234,
-     2393, 2394, 1229, 2395, 2408, 1257, 1257, 1257, 1257, 1257,
-     1257, 1004, 1004, 1004, 2409, 1236, 2410, 1266, 1266, 1266,
-     2411,  585,  585, 1259, 2416, 2417, 1259,  591, 1005, 1307,
-     1307, 1307, 2418, 1308, 1237, 1268, 1309, 2419, 1755, 1755,
-     1755, 2420,  592,  597,  598,  263,  598,  597,  597,  597,
-      597,  597,  597,  597,  599,  597,  597,  597, 1687,  597,
-      601,  597,  602,  597, 2421, 1266, 1266, 1266, 1009, 1009,
-
-     1009, 1701, 1701, 1701, 1260, 1274, 1274, 1274, 1274, 1274,
-     1274, 2422, 2425, 1268, 1756, 1010, 2426, 2427,  597,  597,
-     1280, 1280, 1280, 1276,  603, 2432, 1276,  604, 1318, 1318,
-     1318, 2365, 1319, 2433, 2438, 1320, 2439, 2440, 1282,  605,
+      585, 1223,  585,  589,  585,  590,  585, 1230, 1235, 1235,
+     1235, 1235, 1235, 1235, 2362, 1258, 1258, 1258, 1258, 1258,
+     1258, 1005, 1005, 1005, 2363, 2364, 1237, 2357, 2366, 1237,
+     2376,  585,  585, 1260, 2359, 2358, 1260,  591, 1006, 1318,
+     1318, 1318, 2360, 1319, 1689, 1908, 1320, 2387, 1238, 1723,
+     1723, 1723,  592,  597,  598,  263,  598,  597,  597,  597,
+      597,  597,  597,  597,  599,  597,  597,  597, 1689,  597,
+
+      601,  597,  602,  597, 1267, 1267, 1267, 1267, 1267, 1267,
+     1021, 1021, 1021, 2388, 1261, 1273, 1273, 1273, 1273, 1273,
+     1273, 2382, 1269, 2389, 2393, 1269, 2394, 1022,  597,  597,
+     1279, 1279, 1279, 1275,  603, 2395, 1275,  604, 1322, 1322,
+     1322, 2381, 1323, 2398, 2402, 1324, 2403, 2404, 1281,  605,
       597,  598,  263,  598,  597,  597,  597,  597,  597,  597,
-      597,  599,  597,  597,  597, 2441,  597,  601,  597,  602,
-      597, 1269, 2450, 1280, 1280, 1280, 1021, 1021, 1021, 1277,
-     1292, 1292, 1292, 2451, 1292, 1292, 1292, 1299, 1299, 1299,
-     2428, 1282, 2452, 1022, 2453,  597,  597, 2455, 1294, 2457,
-     2429,  603, 1294, 2481,  604, 1301, 1322, 1322, 1322, 2482,
+      597,  599,  597,  597,  597, 2405,  597,  601,  597,  602,
+      597, 2406, 2407, 1270, 1279, 1279, 1279, 2408, 2409, 1276,
+     1292, 1292, 1292, 2410, 1292, 1292, 1292, 1299, 1299, 1299,
+     2411, 2424, 1281, 2425, 2426,  597,  597, 2427, 1294, 2428,
 
-     1323, 2484, 2485, 1324, 2486, 1687,  605,  610,  611,  263,
+     2430,  603, 1294, 2436,  604, 1301, 1340, 1340, 1340, 2437,
+     1341, 2438, 2439, 1342, 2440, 2441,  605,  610,  611,  263,
       611,  610,  610,  610,  610,  610,  610,  610,  612,  610,
-      610,  610, 2487,  610,  614,  610,  615,  610, 1283, 1033,
-     1033, 1033, 1035, 1035, 1035, 1295, 1299, 1299, 1299, 1310,
-     1310, 1310, 2478, 1310, 1310, 1310, 1034, 2491, 2492, 1036,
-     2493, 2494,  610,  610, 1301, 2495, 2496, 1312, 2497, 2498,
-      616, 1312,  617, 2499, 2500,  618, 1704, 1704, 1704,  619,
-     1898, 1898, 1898,  620,  610,  611,  263,  611,  610,  610,
-      610,  610,  610,  610,  610,  612,  610,  610,  610, 1687,
-      610,  614,  610,  615,  610, 1041, 1041, 1041, 1302, 1044,
-
-     1044, 1044, 2501, 2503, 1313, 1325, 1325, 1325, 1336, 1336,
-     1336, 2504, 1042, 1336, 1336, 1336, 1045, 2507, 2508,  610,
-      610, 2477, 1326, 1708, 1708, 1708, 1338,  616, 2509,  617,
-     2510, 1338,  618, 1711, 1711, 1711,  619, 1721, 1721, 1721,
+      610,  610, 2442,  610,  614,  610,  615,  610, 2445, 1282,
+     1034, 1034, 1034, 2446, 2447, 1295, 1299, 1299, 1299, 1036,
+     1036, 1036, 2452, 1310, 1310, 1310, 2453, 1035, 1310, 1310,
+     1310, 2458,  610,  610, 1301, 2459, 1037, 1910, 1910, 1910,
+      616, 1312,  617, 2460, 2461,  618, 1312, 2470, 2471,  619,
+     1757, 1757, 1757,  620,  610,  611,  263,  611,  610,  610,
+      610,  610,  610,  610,  610,  612,  610,  610,  610, 2472,
+
+      610,  614,  610,  615,  610, 1042, 1042, 1042, 1302, 1045,
+     1045, 1045, 2473, 1911, 1325, 1325, 1325, 2413, 2414, 1313,
+     2415, 2475, 1043, 1336, 1336, 1336, 1046, 2477, 2416,  610,
+      610, 1326, 1059, 1059, 1059, 2417, 2501,  616, 2448,  617,
+     2502, 1338,  618, 1759, 1759, 1759,  619, 2504, 2449, 1060,
       620,  626,  627,  263,  627,  626,  626,  626,  626,  626,
-      626,  626,  628,  626,  626,  626, 2513,  626,  630,  626,
-      631,  626, 1058, 1058, 1058, 1340, 1340, 1340, 2514, 1341,
-     2515, 1339, 1342, 1060, 1060, 1060, 1343, 1343, 1343, 1059,
-     1344, 2516, 2518, 1345, 2522, 2523,  626,  626, 2505, 2524,
-     1061, 1346, 1346, 1346, 1360, 1360, 1360, 2506, 1361, 2525,
+      626,  626,  628,  626,  626,  626, 1689,  626,  630,  626,
+      631,  626, 1061, 1061, 1061, 1343, 1343, 1343, 2505, 1344,
+     2506, 2507, 1345, 2511, 1336, 1336, 1336, 2512, 2513, 1062,
+     1346, 1346, 1346, 3322, 3322, 3322,  626,  626, 3322, 3322,
 
-     2529, 1362, 1372, 1372, 1372, 2530, 1373, 2531, 1347, 1374,
+     3322, 2514, 1338, 2498, 1360, 1360, 1360, 1347, 1361, 2515,
+     3322, 1362, 1372, 1372, 1372, 3322, 1373, 1689, 2516, 1374,
       632,  626,  627,  263,  627,  626,  626,  626,  626,  626,
-      626,  626,  628,  626,  626,  626, 2532,  626,  630,  626,
-      631,  626, 1072, 1072, 1072, 1380, 1380, 1380, 2533, 1381,
-     2537, 2540, 1382, 2541, 2544, 3285, 3285, 3285, 2556, 1073,
-     3285, 3285, 3285, 3285, 3285, 3285,  626,  626, 3285, 3285,
-     3285, 2557, 3285, 2560, 1389, 1389, 1389, 3285, 1390, 2511,
-     3285, 1391, 1421, 1421, 1421, 3285, 1422, 2561, 2512, 1423,
+      626,  626,  628,  626,  626,  626, 2517,  626,  630,  626,
+      631,  626, 1339, 2518, 1348, 1352, 1352, 1352, 2519, 2497,
+     1349, 3322, 3322, 3322, 2520, 1073, 1073, 1073, 2521, 2523,
+     3322, 3322, 3322, 1354, 2524, 2527,  626,  626, 3322, 1352,
+     1352, 1352, 1074, 2528, 1380, 1380, 1380, 3322, 1381, 2525,
+     2529, 1382, 1389, 1389, 1389, 2530, 1390, 1354, 2526, 1391,
       632,  636,  637,  263,  637,  636,  636,  636,  636,  636,
-      636,  636,  638,  636,  636,  636, 1348,  636,  640,  636,
 
-      641,  636, 1349, 1352, 1352, 1352, 2581, 2582, 1350, 2583,
-     1351, 2584, 1352, 1352, 1352, 1363, 1363, 1363, 1367, 1367,
-     1367, 1354, 1903, 1903, 1903, 2585,  636,  636, 2594, 1687,
-     1354, 2595, 1364, 1757, 1757, 1757, 1369,  642,  636,  637,
+      636,  636,  638,  636,  636,  636, 1350,  636,  640,  636,
+      641,  636, 1351, 1363, 1363, 1363, 1355, 1367, 1367, 1367,
+     1367, 1367, 1367, 1081, 1081, 1081, 1375, 1375, 1375, 2533,
+     1364, 1760, 1760, 1760, 2534, 1369,  636,  636, 1369, 2535,
+     1082, 1918, 1918, 1918, 1377, 2536, 2538,  642,  636,  637,
       263,  637,  636,  636,  636,  636,  636,  636,  636,  638,
-      636,  636,  636, 2596,  636,  640,  636,  641,  636, 1355,
-     1080, 1080, 1080, 1375, 1375, 1375, 2579, 1367, 1367, 1367,
-     1375, 1375, 1375, 1085, 1085, 1085, 1145, 1081, 2597, 1705,
-     2598, 1377, 1687,  636,  636, 1369, 1904, 2599, 1377, 2600,
-     1086, 1755, 1755, 1755,  642,  647,  648,  263,  648,  647,
+      636,  636,  636, 2539,  636,  640,  636,  641,  636, 2541,
+     2547, 1370, 1375, 1375, 1375, 1086, 1086, 1086, 1384, 1384,
+     1384, 1384, 1384, 1384, 1092, 1092, 1092, 1919, 2531, 2548,
+     1377, 2549, 1087,  636,  636, 2550, 1386, 2532, 2554, 1386,
 
+     2555, 1093, 2556, 2557,  642,  647,  648,  263,  648,  647,
       647,  647,  647,  647,  647,  647,  649,  647,  647,  647,
-     2601,  647,  651,  647,  652,  647, 2578, 2602, 1370, 1384,
-     1384, 1384, 1091, 1091, 1091, 2580, 2603, 1395, 1395, 1395,
-     2604, 1378, 1395, 1395, 1395, 2606, 2607, 1386, 2608, 1092,
-      647,  647, 1384, 1384, 1384, 1397, 1399, 1399, 1399, 2609,
-     1397,  653, 1461, 1461, 1461, 2610, 1462, 2611, 2612, 1463,
-     1386, 2613, 2614, 1400,  654,  647,  648,  263,  648,  647,
+     2558,  647,  651,  647,  652,  647, 2562, 2565, 1387, 1395,
+     1395, 1395, 2566, 1378, 2569, 1395, 1395, 1395, 1399, 1399,
+     1399, 1401, 1401, 1401, 1404, 1404, 1404, 1397, 2581, 2582,
+      647,  647, 2585, 1397, 2586, 1400, 2606, 2607, 1402, 2608,
+     2609,  653, 1406, 1421, 1421, 1421, 2610, 1422, 1689, 1689,
+     1423, 1978, 1978, 1978,  654,  647,  648,  263,  648,  647,
       647,  647,  647,  647,  647,  647,  649,  647,  647,  647,
-     2615,  647,  651,  647,  652,  647, 2616, 1398, 2617, 1387,
-     1401, 1401, 1401, 2618, 2619, 3285, 3285, 3285, 1404, 1404,
-
-     1404, 1404, 1404, 1404, 1416, 1416, 1416, 1402, 2620, 2622,
-      647,  647, 3285, 1409, 1409, 1409, 1406, 2630, 2631, 1406,
-     2632,  653, 1418, 3285, 3285, 3285, 1413, 1413, 1413, 2635,
-     1410, 1416, 1416, 1416,  654,  662, 3285, 3285, 3285, 2636,
-     3285, 2640,  677, 1414, 1111, 1111, 1111, 1687, 2675, 1418,
-     2588,  661,  678, 3285, 1403, 1145, 1424, 1424, 1424, 2677,
-     2589, 1112, 1407, 2590, 1424, 1424, 1424, 2678, 1419, 1757,
-     1757, 1757, 1687, 1411, 1426, 1428, 1428, 1428, 2679,  679,
-      680,  681, 1426, 2683, 2672,  682,  683,  684, 1412, 2673,
-      685,  686, 1429, 2684,  687, 1415,  688,  689,  690,  662,
-
-     1430, 1430, 1430, 1432, 1432, 1432,  734, 1432, 1432, 1432,
-     1436, 1436, 1436, 2685, 2674,  661,  735, 1431, 2687, 1427,
-     2688, 1434, 3285, 3285, 3285, 1434, 2686, 1437, 2691, 1440,
-     1440, 1440, 2692, 2693, 1442, 1442, 1442, 2658, 2694, 3285,
-     1135, 1135, 1135,  679,  736,  691, 1441, 2659, 2695,  737,
-      738,  684, 1444, 2660,  739,  686, 2696, 1136,  740, 2697,
-      741,  742,  690, 1442, 1442, 1442, 1451, 1451, 1451, 1139,
-     1139, 1139, 1438, 1451, 1451, 1451, 2698, 2699, 1435, 2701,
-     2702, 1444, 2703, 2704, 1453, 2705, 1140, 1439, 1457, 1457,
-     1457, 1453, 1457, 1457, 1457, 1464, 1464, 1464, 1464, 1464,
-
-     1464, 1468, 1468, 1468, 2706, 1469, 1459, 2707, 1470, 2708,
-     1459, 2709, 2710, 1466, 2711, 2712, 1466, 1472, 1472, 1472,
-     1472, 1472, 1472, 1158, 1158, 1158, 1158, 1158, 1158, 1158,
-     1158, 1158, 2591, 2689, 1445, 1474, 2713, 1454, 1474, 2715,
-     2723, 1160, 2592, 2724, 1160, 2593, 2690, 1160, 1514, 1514,
-     1514, 1193, 1193, 1193, 2732, 2733, 1460, 2750, 2751, 1467,
-     1193, 1193, 1193, 2752, 2753, 1515, 1517, 1517, 1517, 1195,
-     1193, 1193, 1193, 1198, 1198, 1198, 1484, 1199, 1195, 2754,
-     1200, 2755, 2766, 1518, 1475, 3285, 3285, 3285, 1195, 1203,
-     1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 2758, 1208,
-
-     1208, 1208, 3285, 1209, 2760, 2768, 1210, 1205, 2769, 1687,
-     1205, 2759, 2770, 1205, 1211, 1211, 1211, 2761, 1145, 1516,
-     1523, 1523, 1523, 2771, 1524, 2661, 2772, 1525, 1526, 1526,
-     1526, 1212, 1214, 1214, 1214, 2662, 1528, 1528, 1528, 2773,
-     1529, 2663, 1521, 1530, 2763, 1527, 1519, 2774, 2775, 1215,
-     1532, 1532, 1532, 1219, 1219, 1219, 1219, 1219, 1219, 1219,
-     1219, 1219, 1537, 1537, 1537, 2776, 2762, 1533, 1226, 1226,
-     1226, 1221, 2777, 2780, 1221, 2781, 2782, 1221, 2783, 1538,
-     1226, 1226, 1226, 1226, 1226, 1226, 1228, 1230, 1230, 1230,
-     2784, 1231, 2785, 2786, 1232, 1234, 1234, 1234, 1228, 2787,
-
-     2789, 1228, 1234, 1234, 1234, 1542, 1542, 1542, 1252, 1252,
-     1252, 2790, 1253, 1236, 2791, 1254, 1559, 1559, 1559, 1535,
-     1236, 2792, 2793, 1543, 1257, 1257, 1257, 1257, 1257, 1257,
-     1540, 2794, 2795, 1560, 1257, 1257, 1257, 1262, 1262, 1262,
-     2796, 1263, 1259, 2797, 1264, 1259, 1266, 1266, 1266, 1266,
-     1266, 1266, 1259, 1266, 1266, 1266, 1270, 1270, 1270, 2798,
-     1271, 2799, 2800, 1272, 1268, 2801, 2807, 1268, 1565, 1565,
-     1565, 1268, 1274, 1274, 1274, 1274, 1274, 1274, 1274, 1274,
-     1274, 1568, 1568, 1568, 2808, 1566, 2809, 3285, 3285, 3285,
-     1276, 2816, 2817, 1276, 2831, 1561, 1276, 2832, 1569, 1280,
-
-     1280, 1280, 2833, 2834, 3285, 1280, 1280, 1280, 1280, 1280,
-     1280, 1574, 1574, 1574, 1564, 1570, 2835, 1282, 1287, 1287,
-     1287, 2836, 1288, 1282, 2840, 1289, 1282, 2841, 1575, 1292,
-     1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1581, 1581,
-     1581, 1299, 1299, 1299, 2823, 1567, 2842, 1294, 2843, 2853,
-     1294, 1145, 2854, 1294, 2824, 1582, 1584, 1584, 1584, 1301,
-     1299, 1299, 1299, 1299, 1299, 1299, 2825, 2827, 1304, 1304,
-     1304, 2855, 1305, 1585, 1571, 1306, 2826, 2828, 1301, 2856,
-     2857, 1301, 1307, 1307, 1307, 2844, 1308, 2858, 2859, 1309,
-     1310, 1310, 1310, 1310, 1310, 1310, 1310, 1310, 1310, 2860,
-
-     1578, 2864, 1318, 1318, 1318, 2865, 1319, 2866, 1312, 1320,
-     2867, 1312, 2868, 2829, 1312, 1591, 1591, 1591, 1322, 1322,
-     1322, 2869, 1323, 2830, 2871, 1324, 1325, 1325, 1325, 2872,
-     1583, 2873, 1592, 1593, 1593, 1593, 2874, 1594, 2875, 2876,
-     1595, 2877, 2878, 1326, 1336, 1336, 1336, 1336, 1336, 1336,
-     1336, 1336, 1336, 1340, 1340, 1340, 2882, 1341, 2883, 2884,
-     1342, 1586, 1338, 2887, 2892, 1338, 2893, 2894, 1338, 1343,
-     1343, 1343, 2895, 1344, 2896, 2897, 1345, 1346, 1346, 1346,
-     1606, 1606, 1606, 2898, 1607, 2899, 2900, 1608, 1352, 1352,
-     1352, 1352, 1352, 1352, 1347, 1352, 1352, 1352, 1360, 1360,
-
-     1360, 2901, 1361, 2902, 2903, 1362, 1354, 2905, 2906, 1354,
-     1363, 1363, 1363, 1354, 1618, 1618, 1618, 1605, 1619, 2907,
-     2908, 1620, 1367, 1367, 1367, 2915, 1145, 1364, 1367, 1367,
-     1367, 1367, 1367, 1367, 1372, 1372, 1372, 2916, 1373, 2917,
-     1369, 1374, 2918, 1613, 2919, 2920, 1369, 2921, 2922, 1369,
-     1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1380,
-     1380, 1380, 2923, 1381, 2924, 2925, 1382, 2926, 1377, 2909,
-     2927, 1377, 2928, 2931, 1377, 1384, 1384, 1384, 1384, 1384,
-     1384, 2932, 1623, 1384, 1384, 1384, 2933, 1389, 1389, 1389,
-     2934, 1390, 2935, 1386, 1391, 2936, 1386, 1395, 1395, 1395,
-
-     2937, 1386, 1395, 1395, 1395, 2938, 1395, 1395, 1395, 1399,
-     1399, 1399, 1634, 1634, 1634, 1397, 1635, 2939, 2943, 1636,
-     1397, 2950, 2951, 1625, 1397, 2952, 1400, 1401, 1401, 1401,
-     2953, 2954, 1628, 1637, 1637, 1637, 2955, 1638, 2956, 2957,
-     1639, 1404, 1404, 1404, 1402, 1404, 1404, 1404, 2958, 1404,
-     1404, 1404, 1409, 1409, 1409, 2959, 1413, 1413, 1413, 1406,
-     1704, 1704, 1704, 1406, 2960, 2961, 1633, 1406, 2964, 1410,
-     1643, 1643, 1643, 1414, 1644, 2965, 2966, 1645, 1648, 1648,
-     1648, 2967, 1649, 2975, 2970, 1650, 1416, 1416, 1416, 1416,
-     1416, 1416, 1416, 1416, 1416, 1421, 1421, 1421, 2971, 1422,
-
-     2976, 1145, 1423, 2970, 1418, 2977, 1854, 1418, 2978, 2979,
-     1418, 1424, 1424, 1424, 2973, 2980, 1641, 1424, 1424, 1424,
-     1424, 1424, 1424, 1428, 1428, 1428, 1655, 1655, 1655, 1426,
-     1656, 2981, 2982, 1657, 2983, 1426, 2984, 2985, 1426, 2986,
-     1429, 1430, 1430, 1430, 1658, 1658, 1658, 2968, 1659, 2987,
-     2988, 1660, 1432, 1432, 1432, 2989, 1652, 2990, 1431, 1432,
-     1432, 1432, 2991, 1432, 1432, 1432, 1436, 1436, 1436, 2996,
-     1434, 1662, 1662, 1662, 3001, 1663, 3002, 1434, 1664, 3003,
-     1654, 1434, 3004, 1437, 1440, 1440, 1440, 1667, 1667, 1667,
-     3005, 1668, 3006, 1145, 1669, 1442, 1442, 1442, 1442, 1442,
-
-     1442, 1441, 1442, 1442, 1442, 1672, 1672, 1672, 1451, 1451,
-     1451, 2992, 2994, 1444, 1687, 1688, 1444, 1451, 1451, 1451,
-     1444, 2997, 1673, 2993, 2995, 1661, 1453, 1451, 1451, 1451,
-     1457, 1457, 1457, 2998, 3007, 1453, 1457, 1457, 1457, 1457,
-     1457, 1457, 1461, 1461, 1461, 1453, 1462, 3009, 1459, 1463,
-     1464, 1464, 1464, 3009, 1459, 3012, 2970, 1459, 1464, 1464,
-     1464, 1464, 1464, 1464, 1670, 1468, 1468, 1468, 1466, 1469,
-     2971, 3013, 1470, 1472, 1472, 1472, 1466, 2999, 3014, 1466,
-     1472, 1472, 1472, 1472, 1472, 1472, 2970, 3015, 1677, 3000,
-     3028, 1474, 1680, 1686, 1686, 1686, 3031, 2973, 1474, 3036,
-
-     3039, 1474, 1158, 1158, 1158, 1514, 1514, 1514, 1193, 1193,
-     1193, 1687, 1688, 3018, 1517, 1517, 1517, 1542, 1542, 1542,
-     1160, 1681, 1515, 1724, 1724, 1724, 1195, 1725, 3019, 3026,
-     1726, 1518, 1728, 1728, 1728, 1543, 1729, 3040, 3016, 1730,
-     1203, 1203, 1203, 3041, 1683, 1523, 1523, 1523, 3027, 1524,
-     3029, 3009, 1525, 1526, 1526, 1526, 3017, 3034, 1205, 3043,
-     1735, 1735, 1735, 3037, 1736, 3009, 1727, 1737, 1693, 3030,
-     1527, 1528, 1528, 1528, 3044, 1529, 3035, 3045, 1530, 1532,
-     1532, 1532, 3038, 1739, 1739, 1739, 3046, 1740, 3047, 1733,
-     1741, 1219, 1219, 1219, 3048, 3049, 1533, 1537, 1537, 1537,
-
-     1745, 1745, 1745, 3059, 1746, 3060, 3061, 1747, 3062, 1221,
-     1748, 1748, 1748, 3063, 1538, 1226, 1226, 1226, 1766, 1766,
-     1766, 1559, 1559, 1559, 1768, 1768, 1768, 1749, 1769, 3064,
-     3068, 1770, 3069, 1228, 3070, 1767, 3071, 3072, 1560, 3073,
-     3074, 1743, 1257, 1257, 1257, 1266, 1266, 1266, 1565, 1565,
-     1565, 1775, 1775, 1775, 3075, 1776, 3077, 3078, 1777, 3079,
-     1259, 3080, 3081, 1268, 1750, 1566, 1274, 1274, 1274, 1568,
-     1568, 1568, 1779, 1779, 1779, 3086, 1780, 3087, 3088, 1781,
-     1280, 1280, 1280, 3082, 1276, 3089, 1569, 1574, 1574, 1574,
-     1786, 1786, 1786, 3084, 1787, 3083, 3090, 1788, 1282, 1789,
-
-     1789, 1789, 3091, 3092, 1575, 3085, 1771, 3093, 3094, 1774,
-     1791, 1791, 1791, 1292, 1292, 1292, 1790, 1581, 1581, 1581,
-     3095, 1797, 1797, 1797, 3096, 1798, 1778, 1792, 1799, 3097,
-     3098, 1294, 3099, 3101, 1582, 1800, 1800, 1800, 1584, 1584,
-     1584, 1783, 1802, 1802, 1802, 3102, 1803, 3103, 3104, 1804,
-     1310, 1310, 1310, 1801, 3105, 1585, 1793, 1807, 1807, 1807,
-     1591, 1591, 1591, 1811, 1811, 1811, 1145, 1812, 1312, 3106,
-     1813, 1593, 1593, 1593, 1808, 1594, 3107, 1592, 1595, 1794,
-     1816, 1816, 1816, 1336, 1336, 1336, 1606, 1606, 1606, 3108,
-     1607, 3100, 3109, 1608, 1825, 1825, 1825, 1817, 3285, 3285,
-
-     3285, 1338, 3285, 3285, 3285, 3285, 3285, 3285, 1352, 1352,
-     1352, 1826, 1832, 1832, 1832, 3285, 1805, 3110, 3111, 3285,
-     3112, 3113, 3285, 1618, 1618, 1618, 1354, 1619, 3114, 1833,
-     1620, 3115, 3116, 1836, 1836, 1836, 1367, 1367, 1367, 1375,
-     1375, 1375, 1384, 1384, 1384, 1848, 1848, 1848, 1824, 1828,
-     1837, 1395, 1395, 1395, 1369, 3117, 3118, 1377, 3119, 3120,
-     1386, 3122, 1849, 1830, 3123, 1404, 1404, 1404, 1827, 1397,
-     1634, 1634, 1634, 1145, 1635, 1829, 3124, 1636, 1637, 1637,
-     1637, 3125, 1638, 1406, 3126, 1639, 1643, 1643, 1643, 3127,
-     1644, 1850, 3121, 1645, 1648, 1648, 1648, 3128, 1649, 1844,
-
-     1839, 1650, 1416, 1416, 1416, 1841, 3129, 3130, 1851, 1424,
-     1424, 1424, 1655, 1655, 1655, 3131, 1656, 3132, 3133, 1657,
-     1418, 1658, 1658, 1658, 3134, 1659, 3135, 1426, 1660, 3136,
-     3137, 1853, 1432, 1432, 1432, 1662, 1662, 1662, 3138, 1663,
-     3139, 1145, 1664, 3141, 1667, 1667, 1667, 3142, 1668, 3143,
-     1434, 1669, 1442, 1442, 1442, 1672, 1672, 1672, 1866, 1866,
-     1866, 3140, 1867, 1858, 3144, 1868, 1860, 1451, 1451, 1451,
-     1444, 3145, 1673, 1874, 1874, 1874, 1457, 1457, 1457, 1861,
-     1464, 1464, 1464, 3146, 3147, 1453, 1878, 1878, 1878, 3148,
-     1875, 1472, 1472, 1472, 1459, 1686, 1686, 1686, 1466, 1864,
-
-     1158, 1158, 1158, 1879, 1906, 1906, 1906, 3149, 3150, 1474,
-     1914, 1914, 1914, 1687, 3151, 3152, 1872, 3153, 1160, 1724,
-     1724, 1724, 3154, 1725, 3155, 3156, 1726, 1193, 1193, 1193,
-     3157, 3158, 1877, 1728, 1728, 1728, 1145, 1729, 3160, 3161,
-     1730, 3162, 3159, 1876, 3163, 1195, 1882, 1203, 1203, 1203,
-     1907, 3164, 1887, 1880, 3165, 3166, 1915, 1735, 1735, 1735,
-     3167, 1736, 3168, 1883, 1737, 1205, 1739, 1739, 1739, 3169,
-     1740, 3170, 3171, 1741, 1219, 1219, 1219, 1745, 1745, 1745,
-     3173, 1746, 3174, 1145, 1747, 1748, 1748, 1748, 3175, 1933,
-     1933, 1933, 1221, 1934, 1916, 3176, 1935, 3172, 1919, 1226,
-
-     1226, 1226, 1749, 1758, 1758, 1758, 1942, 1942, 1942, 1942,
-     1942, 1942, 1903, 1903, 1903, 3177, 3178, 1228, 3179, 1766,
-     1766, 1766, 1948, 1948, 1948, 3180, 1949, 3182, 3183, 1950,
-     1768, 1768, 1768, 3184, 1769, 1923, 1767, 1770, 1257, 1257,
-     1257, 1953, 1953, 1953, 1266, 1266, 1266, 1775, 1775, 1775,
-     1936, 1776, 3185, 3186, 1777, 3187, 1259, 3188, 1954, 1274,
-     1274, 1274, 1268, 3189, 1779, 1779, 1779, 3192, 1780, 3193,
-     1943, 1781, 3194, 1904, 3195, 3196, 1943, 1276, 1957, 1957,
-     1957, 1280, 1280, 1280, 3197, 1951, 1786, 1786, 1786, 1734,
-     1787, 1955, 3282, 1788, 1145, 1958, 1789, 1789, 1789, 1282,
-
-     1962, 1962, 1962, 1145, 1963, 1145, 1145, 1964, 1145, 1791,
-     1791, 1791, 1732, 1790, 1965, 1965, 1965, 1731, 1966, 1145,
-     1145, 1967, 1969, 1969, 1969, 1956, 1792, 1971, 1971, 1971,
-     1797, 1797, 1797, 1145, 1798, 1145, 1145, 1799, 3204, 3198,
-     1970, 1800, 1800, 1800, 3199, 1959, 1802, 1802, 1802, 3205,
-     1803, 3224, 1145, 1804, 1310, 1310, 1310, 1145, 3208, 1801,
-     1807, 1807, 1807, 1975, 1975, 1975, 1145, 1976, 3200, 1723,
-     1977, 1145, 1312, 1978, 1978, 1978, 1145, 1808, 1811, 1811,
-     1811, 3201, 1812, 3202, 3203, 1813, 1816, 1816, 1816, 3225,
-     1979, 1983, 1983, 1983, 3209, 1984, 1722, 3206, 1985, 3212,
-
-     1973, 1145, 1145, 1817, 1986, 1986, 1986, 1992, 1992, 1992,
-     1336, 1336, 1336, 1825, 1825, 1825, 1995, 1995, 1995, 3278,
-     1996, 1987, 3220, 1997, 1993, 1998, 1998, 1998, 1338, 1145,
-     1826, 3285, 3285, 3285, 2001, 2001, 2001, 1352, 1352, 1352,
-     1145, 3210, 1999, 1832, 1832, 1832, 3207, 1145, 3285, 1145,
-     1145, 2002, 2005, 2005, 2005, 1354, 2006, 1145, 1145, 2007,
-     1833, 2008, 2008, 2008, 1836, 1836, 1836, 2011, 2011, 2011,
-     3216, 2012, 3211, 1145, 2013, 1720, 1994, 3214, 2009, 1145,
-     1145, 1837, 2015, 2015, 2015, 1375, 1375, 1375, 3217, 2000,
-     1384, 1384, 1384, 1848, 1848, 1848, 1145, 2003, 1145, 1145,
-
-     2016, 3232, 1145, 1377, 3213, 2025, 2025, 2025, 1386, 2026,
-     1849, 3272, 2027, 2029, 2029, 2029, 1404, 1404, 1404, 3221,
-     2034, 2034, 2034, 2036, 2036, 2036, 3285, 3285, 3285, 1145,
-     1719, 2030, 3226, 3215, 1406, 3222, 2018, 2035, 2021, 3223,
-     2037, 1145, 3233, 3285, 1416, 1416, 1416, 1424, 1424, 1424,
-     1432, 1432, 1432, 2043, 2043, 2043, 2045, 2045, 2045, 1442,
-     1442, 1442, 1418, 1145, 3218, 1426, 1718, 2032, 1434, 1717,
-     2044, 3227, 1145, 2046, 1866, 1866, 1866, 1444, 1867, 1145,
-     1145, 1868, 1451, 1451, 1451, 1874, 1874, 1874, 2397, 2398,
-     2038, 2399, 1145, 2041, 2054, 2054, 2054, 3230, 2055, 2400,
-
-     1453, 2056, 1875, 1457, 1457, 1457, 2401, 3219, 1464, 1464,
-     1464, 2039, 1878, 1878, 1878, 2042, 2059, 2059, 2059, 3240,
-     2060, 1459, 1716, 2061, 2047, 3234, 1466, 3228, 1145, 1879,
-     2062, 2062, 2062, 2052, 2068, 2068, 2068, 1158, 1158, 1158,
-     2078, 2078, 2078, 1898, 1898, 1898, 1715, 1714, 2063, 1145,
-     1713, 2069, 2085, 2085, 2085, 1160, 1903, 1903, 1903, 2086,
-     2086, 2086, 2057, 2058, 1906, 1906, 1906, 2089, 2089, 2089,
-     2090, 2090, 2090, 1914, 1914, 1914, 1193, 1193, 1193, 2099,
-     2099, 2099, 2102, 2102, 2102, 1219, 1219, 1219, 2106, 2106,
-     2106, 1226, 1226, 1226, 1195, 3235, 1145, 2100, 2070, 2103,
-
-     1933, 1933, 1933, 1221, 1934, 2107, 1712, 1935, 1710, 1228,
-     2119, 2119, 2119, 1942, 1942, 1942, 2126, 2126, 2126, 2128,
-     2128, 2128, 1257, 1257, 1257, 3241, 2096, 2120, 1948, 1948,
-     1948, 3229, 1949, 1709, 1145, 1950, 2129, 2118, 1145, 1145,
-     1259, 2131, 2131, 2131, 2105, 1953, 1953, 1953, 2133, 2133,
-     2133, 1145, 2134, 1145, 1145, 2135, 1145, 1145, 2132, 1266,
-     1266, 1266, 1954, 2137, 2137, 2137, 1957, 1957, 1957, 2139,
-     2139, 2139, 3231, 2140, 3236, 2130, 2141, 1268, 1280, 1280,
-     1280, 2138, 3250, 1958, 1962, 1962, 1962, 1145, 1963, 3237,
-     3238, 1964, 3264, 1965, 1965, 1965, 1282, 1966, 3244, 1145,
-
-     1967, 1969, 1969, 1969, 1971, 1971, 1971, 1145, 1310, 1310,
-     1310, 1145, 2136, 1975, 1975, 1975, 1145, 1976, 1145, 1970,
-     1977, 1978, 1978, 1978, 3242, 2142, 1312, 2151, 2151, 2151,
-     1145, 2152, 3239, 1145, 2153, 1983, 1983, 1983, 1979, 1984,
-     3251, 1707, 1985, 1986, 1986, 1986, 2157, 2157, 2157, 3245,
-     2158, 3266, 1145, 2159, 2160, 2160, 2160, 1992, 1992, 1992,
-     1987, 2165, 2165, 2165, 3246, 2166, 2149, 3243, 2167, 1706,
-     3248, 2161, 3252, 1145, 1993, 1336, 1336, 1336, 1995, 1995,
-     1995, 1145, 1996, 1703, 1700, 1997, 1998, 1998, 1998, 3249,
-     2169, 2169, 2169, 1338, 2170, 1145, 1145, 2171, 2172, 2172,
-
-     2172, 3253, 3282, 1999, 2001, 2001, 2001, 2174, 2174, 2174,
-     1145, 2175, 1145, 1145, 2176, 2173, 1352, 1352, 1352, 3247,
-     1145, 2002, 1145, 2005, 2005, 2005, 2168, 2006, 3273, 3254,
-     2007, 2008, 2008, 2008, 1354, 2179, 2179, 2179, 1699, 2180,
-     1698, 3258, 2181, 2011, 2011, 2011, 3255, 2012, 2009, 1145,
-     2013, 2015, 2015, 2015, 1375, 1375, 1375, 2187, 2187, 2187,
-     1384, 1384, 1384, 2191, 2191, 2191, 3256, 2177, 3257, 2016,
-     1145, 1145, 1377, 3259, 2188, 2025, 2025, 2025, 1386, 2026,
-     2192, 1145, 2027, 2029, 2029, 2029, 2199, 2199, 2199, 2034,
-     2034, 2034, 2202, 2202, 2202, 1145, 2203, 1697, 1145, 2204,
-
-     1696, 2030, 1145, 1695, 2200, 1694, 2035, 3262, 3263, 2193,
-     2036, 2036, 2036, 2205, 2205, 2205, 1145, 2206, 2185, 1692,
-     2207, 2189, 1416, 1416, 1416, 1145, 1145, 2037, 1424, 1424,
-     1424, 1432, 1432, 1432, 2043, 2043, 2043, 2213, 2213, 2213,
-     1418, 2214, 3260, 3265, 2215, 3261, 1426, 1145, 3276, 1434,
-     1145, 2044, 2045, 2045, 2045, 2216, 2216, 2216, 3277, 2217,
-     3267, 1145, 2218, 1442, 1442, 1442, 1451, 1451, 1451, 2046,
-     1145, 2054, 2054, 2054, 3274, 2055, 1145, 2211, 2056, 3280,
-     1145, 1444, 3281, 1145, 1453, 1457, 1457, 1457, 2209, 1464,
-     1464, 1464, 1145, 2059, 2059, 2059, 2212, 2060, 3270, 1691,
-
-     2061, 1690, 1689, 1459, 2062, 2062, 2062, 1466, 2068, 2068,
-     2068, 2232, 2232, 2232, 3275, 2233, 3268, 1682, 2234, 1158,
-     1158, 1158, 2063, 1145, 3279, 2069, 3269, 1679, 2219, 3271,
-     1678, 2224, 2236, 2236, 2236, 1676, 2226, 1160, 2241, 2241,
-     2241, 1675, 2227, 2242, 2242, 2242, 2078, 2078, 2078, 2244,
-     2244, 2244, 2248, 2248, 2248, 2085, 2085, 2085, 2086, 2086,
-     2086, 2249, 2249, 2249, 2089, 2089, 2089, 2090, 2090, 2090,
-     2252, 2252, 2252, 2253, 2253, 2253, 2254, 2254, 2254, 2255,
-     2255, 2255, 1674, 2235, 1193, 1193, 1193, 2099, 2099, 2099,
-     1671, 2102, 2102, 2102, 2261, 2261, 2261, 1666, 2262, 1665,
-
-     1653, 2263, 1195, 1651, 1647, 2100, 1646, 2250, 2103, 2265,
-     2265, 2265, 2106, 2106, 2106, 2267, 2267, 2267, 1642, 2268,
-     1640, 1632, 2269, 1226, 1226, 1226, 1631, 2266, 1630, 2107,
-     2119, 2119, 2119, 1629, 1627, 2257, 2281, 2281, 2281, 1626,
-     2282, 1228, 1624, 2283, 2284, 2284, 2284, 2120, 2126, 2126,
-     2126, 2289, 2289, 2289, 2128, 2128, 2128, 2291, 2291, 2291,
-     1622, 2292, 1621, 1617, 2293, 1257, 1257, 1257, 2131, 2131,
-     2131, 2129, 2280, 2295, 2295, 2295, 1616, 2296, 1615, 1614,
-     2297, 1612, 1611, 1259, 1610, 2132, 2133, 2133, 2133, 1609,
-     2134, 1604, 1603, 2135, 1266, 1266, 1266, 2290, 1602, 2137,
-
-     2137, 2137, 2139, 2139, 2139, 1601, 2140, 1600, 1599, 2141,
-     1598, 1597, 1268, 1280, 1280, 1280, 2294, 2138, 1310, 1310,
-     1310, 2151, 2151, 2151, 1596, 2152, 1590, 1589, 2153, 1588,
-     1587, 1282, 1580, 2157, 2157, 2157, 1312, 2158, 1579, 1577,
-     2159, 2160, 2160, 2160, 1576, 2298, 2313, 2313, 2313, 1573,
-     2314, 1572, 1563, 2315, 1562, 2165, 2165, 2165, 2161, 2166,
-     1558, 1557, 2167, 1336, 1336, 1336, 2299, 2169, 2169, 2169,
-     1556, 2170, 1555, 2308, 2171, 2172, 2172, 2172, 2320, 2320,
-     2320, 1338, 2321, 1554, 1553, 2322, 2174, 2174, 2174, 1552,
-     2175, 1551, 2173, 2176, 1352, 1352, 1352, 2179, 2179, 2179,
-
-     1549, 2180, 1548, 1546, 2181, 2328, 2328, 2328, 2187, 2187,
-     2187, 1545, 1354, 2331, 2331, 2331, 1544, 2332, 1541, 1539,
-     2333, 1536, 1534, 2329, 1531, 2188, 1522, 2319, 1384, 1384,
-     1384, 2191, 2191, 2191, 2336, 2336, 2336, 1520, 2337, 1513,
-     1511, 2338, 1510, 2199, 2199, 2199, 1386, 1509, 2192, 2202,
-     2202, 2202, 1508, 2203, 1507, 1506, 2204, 1416, 1416, 1416,
-     2323, 2200, 2205, 2205, 2205, 1505, 2206, 1504, 1503, 2207,
-     1502, 1424, 1424, 1424, 1499, 1418, 1432, 1432, 1432, 2213,
-     2213, 2213, 1498, 2214, 1497, 1496, 2215, 1495, 2334, 1426,
-     1494, 2216, 2216, 2216, 1434, 2217, 1493, 1491, 2218, 1442,
-
-     1442, 1442, 1490, 2354, 2354, 2354, 1489, 1488, 2349, 3285,
-     3285, 3285, 2352, 3285, 3285, 3285, 1487, 1444, 1486, 2353,
-     2355, 3285, 3285, 3285, 1485, 1483, 3285, 1451, 1451, 1451,
-     3285, 1457, 1457, 1457, 2362, 2362, 2362, 2351, 3285, 2364,
-     2364, 2364, 2367, 2367, 2367, 1453, 2232, 2232, 2232, 1459,
-     2233, 1482, 2363, 2234, 1158, 1158, 1158, 1145, 1481, 1480,
-     2356, 2236, 2236, 2236, 2369, 2369, 2369, 2370, 2370, 2370,
-     1479, 1478, 1160, 2241, 2241, 2241, 1477, 2357, 1145, 1471,
-     2358, 2242, 2242, 2242, 2244, 2244, 2244, 2374, 2374, 2374,
-     1456, 2361, 2359, 2375, 2375, 2375, 2376, 2376, 2376, 2248,
-
-     2248, 2248, 2249, 2249, 2249, 2252, 2252, 2252, 2253, 2253,
-     2253, 1455, 1450, 2368, 2254, 2254, 2254, 2255, 2255, 2255,
-     2380, 2380, 2380, 2383, 2383, 2383, 2261, 2261, 2261, 1449,
-     2262, 1448, 1447, 2263, 3285, 3285, 3285, 1446, 2381, 1420,
-     2384, 2265, 2265, 2265, 1408, 2267, 2267, 2267, 1394, 2268,
-     1393, 3285, 2269, 1226, 1226, 1226, 2281, 2281, 2281, 2266,
-     2282, 2402, 2403, 2283, 2404, 2284, 2284, 2284, 2407, 2407,
-     2407, 1228, 2405, 2289, 2289, 2289, 2291, 2291, 2291, 2406,
-     2292, 1392, 1388, 2293, 1257, 1257, 1257, 2295, 2295, 2295,
-     1383, 2296, 1379, 1371, 2297, 2413, 2413, 2413, 1366, 1365,
-
-     2385, 1359, 1259, 1280, 1280, 1280, 2423, 2423, 2423, 1310,
-     1310, 1310, 1356, 2414, 2396, 2313, 2313, 2313, 1335, 2314,
-     1334, 1282, 2315, 2430, 2430, 2430, 1333, 1312, 1332, 1331,
-     2412, 2434, 2434, 2434, 2320, 2320, 2320, 1330, 2321, 1329,
-     2431, 2322, 2436, 2436, 2436, 2328, 2328, 2328, 1328, 2435,
-     2442, 2442, 2442, 1327, 2415, 2331, 2331, 2331, 1321, 2332,
-     2437, 1314, 2333, 2329, 1384, 1384, 1384, 2443, 1303, 2424,
-     2445, 2445, 2445, 2336, 2336, 2336, 1298, 2337, 1297, 1296,
-     2338, 1291, 1386, 3285, 3285, 3285, 1290, 2446, 3285, 3285,
-     3285, 3285, 3285, 3285, 2456, 2456, 2456, 2460, 2460, 2460,
-
-     3285, 2458, 2458, 2458, 1286, 3285, 1285, 1284, 3285, 1424,
-     1424, 1424, 1279, 1278, 2461, 2444, 2447, 1273, 1265, 2459,
-     1261, 1432, 1432, 1432, 2354, 2354, 2354, 1426, 1442, 1442,
-     1442, 1256, 1255, 2465, 2465, 2465, 1251, 2466, 2448, 1434,
-     2467, 2355, 2454, 2468, 2468, 2468, 1444, 1250, 1249, 2449,
-     3285, 3285, 3285, 3285, 3285, 3285, 2472, 2472, 2472, 1248,
-     2469, 2474, 2474, 2474, 1247, 2464, 1246, 3285, 1245, 2462,
-     3285, 1457, 1457, 1457, 2473, 2362, 2362, 2362, 2364, 2364,
-     2364, 1244, 2463, 2367, 2367, 2367, 2369, 2369, 2369, 1459,
-     2479, 2479, 2479, 2363, 1243, 1242, 1145, 2370, 2370, 2370,
-
-     1241, 2470, 1240, 1239, 2471, 2483, 2483, 2483, 2480, 2374,
-     2374, 2374, 2375, 2375, 2375, 2376, 2376, 2376, 2380, 2380,
-     2380, 2383, 2383, 2383, 2488, 2488, 2488, 1233, 2489, 1225,
-     1224, 2490, 1226, 1226, 1226, 1223, 2381, 2475, 2384, 1218,
-     2476, 2407, 2407, 2407, 2517, 2517, 2517, 1257, 1257, 1257,
-     1228, 2413, 2413, 2413, 2520, 2520, 2520, 2526, 2526, 2526,
-     2423, 2423, 2423, 1217, 1216, 1259, 1310, 1310, 1310, 2414,
-     1213, 1207, 2521, 1202, 2527, 1201, 2430, 2430, 2430, 2534,
-     2534, 2534, 1197, 2535, 1312, 1192, 2536, 2538, 2538, 2538,
-     1191, 1190, 2502, 2431, 2434, 2434, 2434, 2436, 2436, 2436,
-
-     2542, 2542, 2542, 1189, 2539, 2442, 2442, 2442, 1188, 2548,
-     2548, 2548, 2435, 2519, 1187, 2437, 1186, 2543, 2445, 2445,
-     2445, 1184, 2443, 2528, 2545, 2545, 2545, 2549, 2546, 1183,
-     1182, 2547, 2550, 2550, 2550, 2446, 2551, 1181, 1180, 2552,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 2558,
-     2558, 2558, 2456, 2456, 2456, 1179, 1178, 3285, 1177, 1176,
-     3285, 1175, 1174, 3285, 1173, 1172, 2559, 2458, 2458, 2458,
-     2460, 2460, 2460, 2562, 2562, 2562, 1171, 2563, 1170, 1169,
-     2564, 2565, 2565, 2565, 1168, 2459, 1167, 2461, 1432, 1432,
-     1432, 1166, 2553, 1442, 1442, 1442, 2465, 2465, 2465, 2566,
-
-     2466, 2554, 1165, 2467, 2555, 1164, 1434, 2468, 2468, 2468,
-     1157, 1444, 2569, 2569, 2569, 1156, 2570, 1155, 1154, 2571,
-     2572, 2572, 2572, 1153, 2469, 2574, 2574, 2574, 2472, 2472,
-     2472, 2474, 2474, 2474, 2576, 2576, 2576, 2573, 2479, 2479,
-     2479, 1152, 2575, 2483, 2483, 2483, 2473, 2586, 2586, 2586,
-     1151, 1148, 2577, 1146, 1145, 2567, 2480, 2568, 2488, 2488,
-     2488, 1143, 2489, 1141, 2587, 2490, 1226, 1226, 1226, 2517,
-     2517, 2517, 1257, 1257, 1257, 2520, 2520, 2520, 2623, 2623,
-     2623, 2526, 2526, 2526, 1228, 2625, 2625, 2625, 1138, 2626,
-     1259, 1134, 2627, 2521, 1132, 2624, 1131, 1130, 2527, 2628,
-
-     2628, 2628, 2633, 2633, 2633, 2534, 2534, 2534, 1128, 2535,
-     1127, 1126, 2536, 2538, 2538, 2538, 1125, 2629, 1124, 2634,
-     2637, 2637, 2637, 1123, 2638, 1121, 2605, 2639, 1120, 1119,
-     2539, 2641, 2641, 2641, 2542, 2542, 2542, 2643, 2643, 2643,
-     1118, 2644, 1116, 2621, 2645, 2646, 2646, 2646, 2642, 1115,
-     1114, 2543, 2545, 2545, 2545, 1110, 2546, 1109, 1107, 2547,
-     1106, 1105, 2647, 2548, 2548, 2548, 2550, 2550, 2550, 1104,
-     2551, 1103, 1102, 2552, 3285, 3285, 3285, 3285, 3285, 3285,
-     1100, 2549, 3285, 3285, 3285, 2558, 2558, 2558, 2651, 2651,
-     2651, 3285, 2652, 1099, 3285, 2653, 2654, 2654, 2654, 3285,
-
-     1098, 1097, 2559, 2656, 2656, 2656, 1095, 2562, 2562, 2562,
-     1094, 2563, 1093, 2655, 2564, 2565, 2565, 2565, 1090, 1089,
-     2657, 1432, 1432, 1432, 1442, 1442, 1442, 1087, 2649, 2648,
-     2572, 2572, 2572, 2566, 2569, 2569, 2569, 2650, 2570, 1434,
-     1084, 2571, 1444, 1083, 2666, 2666, 2666, 2573, 2667, 1079,
-     1078, 2668, 2574, 2574, 2574, 2669, 2669, 2669, 1076, 2670,
-     1075, 1074, 2671, 2576, 2576, 2576, 2676, 2676, 2676, 2575,
-     1071, 2586, 2586, 2586, 1070, 2680, 2680, 2680, 1069, 2681,
-     1068, 2577, 2682, 1066, 1065, 2665, 1064, 2664, 2587, 1226,
-     1226, 1226, 2714, 2714, 2714, 1257, 1257, 1257, 2717, 2717,
-
-     2717, 2623, 2623, 2623, 2720, 2720, 2720, 1228, 2721, 1063,
-     1062, 2722, 1057, 1259, 1055, 2718, 1054, 1053, 2624, 2625,
-     2625, 2625, 1052, 2626, 1051, 1050, 2627, 2628, 2628, 2628,
-     2725, 2725, 2725, 2633, 2633, 2633, 1049, 2730, 2730, 2730,
-     2700, 2676, 2676, 2676, 2719, 2629, 1048, 2726, 1047, 1046,
-     2634, 2727, 2727, 2727, 2731, 2728, 1043, 2716, 2729, 2637,
-     2637, 2637, 1040, 2638, 1039, 1038, 2639, 2641, 2641, 2641,
-     2734, 2734, 2734, 1032, 2735, 1031, 1029, 2736, 2643, 2643,
-     2643, 1026, 2644, 1024, 2642, 2645, 2646, 2646, 2646, 2737,
-     2737, 2737, 1023, 2738, 1018, 1017, 2739, 3285, 3285, 3285,
-
-     2741, 2741, 2741, 2647, 3285, 3285, 3285, 1015, 2651, 2651,
-     2651, 1014, 2652, 1013, 3285, 2653, 1011, 2742, 2654, 2654,
-     2654, 3285, 2744, 2744, 2744, 1008, 2745, 1006, 1003, 2746,
-     2656, 2656, 2656, 1002, 1000, 2655, 2747, 2747, 2747,  999,
-     2748,  996,  991, 2749, 1432, 1432, 1432, 2657, 1442, 1442,
-     1442,  990,  987, 2743,  986, 2740, 2666, 2666, 2666,  985,
-     2667,  982, 1434, 2668,  981,  979, 1444, 2669, 2669, 2669,
-      976, 2670,  974,  973, 2671, 2764, 2764, 2764, 2767, 2767,
-     2767, 2680, 2680, 2680,  972, 2681,  971,  969, 2682, 2778,
-     2778, 2778, 2765, 1687,  968, 2756, 1226, 1226, 1226, 2714,
-
-     2714, 2714, 2802, 2802, 2802,  967, 2779, 1257, 1257, 1257,
-     2717, 2717, 2717,  966, 1228, 2757, 2804, 2804, 2804,  965,
-     2805,  964,  961, 2806,  960, 1259,  959, 2718, 2720, 2720,
-     2720,  956, 2721,  953,  952, 2722, 2725, 2725, 2725, 2810,
-     2810, 2810,  950, 2811,  949, 2788, 2812, 2727, 2727, 2727,
-      946, 2728,  943, 2726, 2729, 2730, 2730, 2730, 2803, 2813,
-     2813, 2813,  940, 2814,  939,  931, 2815, 2734, 2734, 2734,
-      930, 2735, 2731,  929, 2736, 2737, 2737, 2737,  928, 2738,
-      922,  921, 2739, 3285, 3285, 3285, 2741, 2741, 2741, 2819,
-     2819, 2819,  920, 2820,  918,  917, 2821, 3285, 3285, 3285,
-
-     3285,  916,  915, 2742, 2744, 2744, 2744,  914, 2745,  913,
-      908, 2746,  905,  907, 3285, 2747, 2747, 2747,  902, 2748,
-      901,  899, 2749, 2837, 2837, 2837, 1442, 1442, 1442, 2845,
-     2845, 2845,  897,  895, 2818, 2764, 2764, 2764, 2847, 2847,
-     2847, 2838, 2848,  893, 1444, 2849, 2846, 1687, 2850, 2850,
-     2850,  891, 2765, 1687,  888,  887, 1687, 2767, 2767, 2767,
-     2851, 2851, 2851, 2852, 2852, 2852,  886,  885, 2822, 2778,
-     2778, 2778, 2861, 2861, 2861,  884, 2862,  882,  880, 2863,
-     1226, 1226, 1226, 2879, 2879, 2879, 2779, 2802, 2802, 2802,
-      879,  878, 2839, 2880, 2880, 2880,  876,  874, 1228, 2804,
-
-     2804, 2804,  873, 2805,  871,  869, 2806,  868, 2810, 2810,
-     2810, 2881, 2811,  866,  862, 2812, 2813, 2813, 2813,  861,
-     2814,  859,  854, 2815, 2885, 2885, 2885, 2888, 2888, 2888,
-     2819, 2819, 2819,  852, 2820,  848,  847, 2821, 2890, 2890,
-     2890, 2886,  846,  844, 2889,  842, 2870, 2837, 2837, 2837,
-     1442, 1442, 1442,  841,  840, 2891, 2845, 2845, 2845, 2910,
-     2910, 2910,  838, 2911,  836, 2838, 2912,  835, 1444, 2850,
-     2850, 2850,  833, 2846, 1687,  831,  830, 1687, 2847, 2847,
-     2847,  829, 2848,  828,  827, 2849, 2851, 2851, 2851, 2852,
-     2852, 2852,  826, 2861, 2861, 2861, 1687, 2862,  825,  823,
-
-     2863, 2904, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
-     1685,  821,  820, 1685, 2929, 2929, 2929,  817, 1685, 1685,
-     1685, 1687, 1685, 2879, 2879, 2879, 2880, 2880, 2880, 2885,
-     2885, 2885, 2930, 2940, 2940, 2940,  816, 2941,  815,  813,
-     2942, 2888, 2888, 2888, 2881,  801, 2886, 1685, 1685, 1685,
-     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 2889,  800,
-     1685, 2890, 2890, 2890,  797, 1685, 1685, 1685, 1687, 1685,
-     2944, 2944, 2944,  795, 2945,  793,  792, 2946, 2891, 2947,
-     2947, 2947,  791, 2948,  789,  787, 2949, 2962, 2962, 2962,
-     2929, 2929, 2929,  785, 1685, 1685, 2910, 2910, 2910,  782,
-
-     2911,  781,  780, 2912,  779, 2963,  778,  776, 2930, 2962,
-     2962, 2962,  774,  773, 1687, 1685, 1685, 1685, 1685, 1685,
-     2974, 1685, 1685, 1685,  771,  769, 1685, 2963,  768,  766,
-      764, 1685, 1685, 1685, 1687, 1685, 2940, 2940, 2940,  763,
-     2941,  762,  760, 2942, 2944, 2944, 2944,  758, 2945,  757,
-      756, 2946, 2947, 2947, 2947,  755, 2948,  753, 3285, 2949,
-     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,
-     2974,  700,  733, 1685, 3011, 3011, 3011,  732, 1685, 1685,
-     1685, 1687, 1685, 3020, 3020, 3020, 3022, 3022, 3022, 3024,
-     3024, 3024, 1687, 1688, 3032, 3032, 3032, 3042, 3042, 3042,
-
-     3021,  730,  728, 3023,  727,  726, 3025, 1685, 1685,  724,
-      720, 3033, 3011, 3011, 3011, 1145, 3020, 3020, 3020, 3050,
-     3050, 3050,  716, 3051,  715,  713, 3052, 3022, 3022, 3022,
-     1687,  712,  709, 3021, 3053, 3053, 3053,  708, 3054,  707,
-      705, 3055,  704,  703, 3023, 3024, 3024, 3024, 3056, 3056,
-     3056,  701, 3057,  696, 3285, 3058, 3032, 3032, 3032, 3042,
-     3042, 3042, 3025, 1882, 3065, 3065, 3065,  676, 3066,  674,
-      672, 3067,  666, 3033, 3050, 3050, 3050, 1145, 3051,  665,
-      666, 3052, 3053, 3053, 3053,  665, 3054,  664,  663, 3055,
-     3056, 3056, 3056, 3285, 3057, 3285, 3076, 3058, 3065, 3065,
-
-     3065, 3285, 3066, 3285, 3285, 3067, 3181, 3181, 3181, 3181,
-     3181, 3181, 3285, 3190, 3285, 3285, 3191, 3283, 3283, 3283,
-     3283, 3283, 3283, 3285, 1145, 3285, 3285, 1145, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3284, 3285, 3285, 3284,  260,
-      260,  260,  260,  260,  260,  260,  260,  260,  261,  261,
-      261,  261,  261,  261,  261,  261,  261,  266,  266,  266,
-      266,  266,  266,  266,  266,  266,  269,  269,  269,  269,
-      269,  269,  269,  269,  269,  272,  272,  272,  272,  272,
-      272,  272,  272,  272,  275,  275,  275,  275,  275,  275,
-      275,  275,  275,  282,  282,  282,  282,  282,  282,  282,
-
-      282,  282,  290,  290,  290,  290,  290,  290,  290,  290,
-      290,  294,  294,  294,  294,  294,  294,  294,  294,  294,
-      306,  306,  306,  306,  306,  306,  306,  306,  306,  310,
-      310,  310,  310,  310,  310,  310,  310,  310,  317,  317,
-      317,  317,  317,  317,  317,  317,  317,  328,  328,  328,
-      328,  328,  328,  328,  328,  328,  336,  336,  336,  336,
-      336,  336,  336,  336,  336,  342,  342,  342,  342,  342,
-      342,  342,  342,  342,  348,  348,  348,  348,  348,  348,
-      348,  348,  348,  354,  354,  354,  354,  354,  354,  354,
-      354,  354,  359,  359,  359,  359,  359,  359,  359,  359,
-
-      359,  378,  378,  378,  378,  378,  378,  378,  378,  378,
-      385,  385,  385,  385,  385,  385,  385,  385,  385,  392,
-      392,  392,  392,  392,  392,  392,  392,  392,  398,  398,
-      398,  398,  398,  398,  398,  398,  398,  405,  405,  405,
-      405,  405,  405,  405,  405,  405,  410,  410,  410,  410,
-      410,  410,  410,  410,  410,  416,  416,  416,  416,  416,
-      416,  416,  416,  416,  421,  421,  421,  421,  421,  421,
-      421,  421,  421,  427,  427,  427,  427,  427,  427,  427,
-      427,  427,  435,  435,  435,  435,  435,  435,  435,  435,
-      435,  443,  443,  443,  443,  443,  443,  443,  443,  443,
-
-      447,  447,  447,  447,  447,  447,  447,  447,  447,  453,
-      453,  453,  453,  453,  453,  453,  453,  453,  459,  459,
-      459,  459,  459,  459,  459,  459,  459,  476,  476,  476,
-      476,  476,  476,  476,  476,  476,  483,  483,  483,  483,
-      483,  483,  483,  483,  483,  492,  492,  492,  492,  492,
-      492,  492,  492,  492,  498,  498,  498,  498,  498,  498,
-      498,  498,  498,  508,  508,  508,  508,  508,  508,  508,
-      508,  508,  514,  514,  514,  514,  514,  514,  514,  514,
-      514,  519,  519,  519,  519,  519,  519,  519,  519,  519,
-      525,  525,  525,  525,  525,  525,  525,  525,  525,  531,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  537,  537,
-      537,  537,  537,  537,  537,  537,  537,  544,  544,  544,
-      544,  544,  544,  544,  544,  544,  551,  551,  551,  551,
-      551,  551,  551,  551,  551,  556,  556,  556,  556,  556,
-      556,  556,  556,  556,  564,  564,  564,  564,  564,  564,
-      564,  564,  564,  570,  570,  570,  570,  570,  570,  570,
-      570,  570,  577,  577,  577,  577,  577,  577,  577,  577,
-      577,  582,  582,  582,  582,  582,  582,  582,  582,  582,
-      588,  588,  588,  588,  588,  588,  588,  588,  588,  593,
-      593,  593,  593,  593,  593,  593,  593,  593,  600,  600,
-
-      600,  600,  600,  600,  600,  600,  600,  606,  606,  606,
-      606,  606,  606,  606,  606,  606,  613,  613,  613,  613,
-      613,  613,  613,  613,  613,  621,  621,  621,  621,  621,
-      621,  621,  621,  621,  629,  629,  629,  629,  629,  629,
-      629,  629,  629,  633,  633,  633,  633,  633,  633,  633,
-      633,  633,  639,  639,  639,  639,  639,  639,  639,  639,
-      639,  643,  643,  643,  643,  643,  643,  643,  643,  643,
-      650,  650,  650,  650,  650,  650,  650,  650,  650,  655,
-      655,  655,  655,  655,  655,  655,  655,  655,  675,  675,
-      675, 3285, 3285, 3285,  675,  702,  702,  702, 3285, 3285,
-
-     3285,  702,  706,  706,  706, 3285, 3285, 3285,  706,  714,
-      714,  714, 3285, 3285, 3285,  714,  725,  725,  725, 3285,
-     3285, 3285,  725,  731,  731,  731, 3285, 3285, 3285,  731,
-      754,  754,  754, 3285, 3285, 3285,  754,  761,  761,  761,
-     3285, 3285, 3285,  761,  767,  767,  767, 3285, 3285, 3285,
-      767,  772,  772,  772, 3285, 3285, 3285,  772,  777,  777,
-      777, 3285, 3285, 3285,  777,  786,  786,  786, 3285, 3285,
-     3285,  786,  790,  790,  790, 3285, 3285, 3285,  790,  796,
-      796,  796, 3285, 3285, 3285,  796,  814,  814,  814, 3285,
-     3285, 3285,  814,  824,  824,  824, 3285, 3285, 3285,  824,
-
-      834,  834,  834, 3285, 3285, 3285,  834,  839,  839,  839,
-     3285, 3285, 3285,  839,  845,  845,  845, 3285, 3285, 3285,
-      845,  853,  853,  853, 3285, 3285, 3285,  853,  860,  860,
-      860, 3285, 3285, 3285,  860,  867,  867,  867, 3285, 3285,
-     3285,  867,  872,  872,  872, 3285, 3285, 3285,  872,  877,
-      877,  877, 3285, 3285, 3285,  877,  883,  883,  883, 3285,
-     3285, 3285,  883,  892,  892,  892, 3285, 3285, 3285,  892,
-      896,  896,  896, 3285, 3285, 3285,  896,  900,  900,  900,
-     3285, 3285, 3285,  900,  904,  904,  904,  904,  904,  904,
-      904, 3285,  904,  675,  675,  675, 3285, 3285, 3285,  675,
-
-      919, 3285, 3285, 3285,  919,  702,  702,  702, 3285, 3285,
-     3285,  702,  951, 3285, 3285, 3285,  951,  706,  706,  706,
-     3285, 3285, 3285,  706,  958, 3285, 3285, 3285,  958,  714,
-      714,  714, 3285, 3285, 3285,  714,  970, 3285, 3285, 3285,
-      970,  725,  725,  725, 3285, 3285, 3285,  725,  975, 3285,
-     3285, 3285,  975,  731,  731,  731, 3285, 3285, 3285,  731,
-      980, 3285, 3285, 3285,  980,  754,  754,  754, 3285, 3285,
-     3285,  754, 1001, 3285, 3285, 3285, 1001,  761,  761,  761,
-     3285, 3285, 3285,  761, 1007, 3285, 3285, 3285, 1007,  767,
-      767,  767, 3285, 3285, 3285,  767, 1012, 3285, 3285, 3285,
-
-     1012,  772,  772,  772, 3285, 3285, 3285,  772, 1016, 3285,
-     3285, 3285, 1016,  777,  777,  777, 3285, 3285, 3285,  777,
-     1025, 3285, 3285, 3285, 1025,  786,  786,  786, 3285, 3285,
-     3285,  786, 1030, 3285, 3285, 3285, 1030,  790,  790,  790,
-     3285, 3285, 3285,  790, 1037, 3285, 3285, 3285, 1037,  796,
-      796,  796, 3285, 3285, 3285,  796, 1056, 3285, 3285, 3285,
-     1056,  814,  814,  814, 3285, 3285, 3285,  814, 1067, 3285,
-     3285, 3285, 1067,  824,  824,  824, 3285, 3285, 3285,  824,
-     1077, 3285, 3285, 3285, 1077,  834,  834,  834, 3285, 3285,
-     3285,  834, 1082, 3285, 3285, 3285, 1082,  839,  839,  839,
-
-     3285, 3285, 3285,  839, 1088, 3285, 3285, 3285, 1088,  845,
-      845,  845, 3285, 3285, 3285,  845, 1096, 3285, 3285, 3285,
-     1096,  853,  853,  853, 3285, 3285, 3285,  853, 1101, 3285,
-     3285, 3285, 1101,  860,  860,  860, 3285, 3285, 3285,  860,
-     1108, 3285, 3285, 3285, 1108,  867,  867,  867, 3285, 3285,
-     3285,  867, 1113, 3285, 3285, 3285, 1113,  872,  872,  872,
-     3285, 3285, 3285,  872, 1117, 3285, 3285, 3285, 1117,  877,
-      877,  877, 3285, 3285, 3285,  877, 1122, 3285, 3285, 3285,
-     1122,  883,  883,  883, 3285, 3285, 3285,  883, 1129, 3285,
-     3285, 3285, 1129,  892,  892,  892, 3285, 3285, 3285,  892,
-
-     1133, 3285, 3285, 3285, 1133,  896,  896,  896, 3285, 3285,
-     3285,  896, 1137, 3285, 3285, 3285, 1137,  900,  900,  900,
-     3285, 3285, 3285,  900, 1142, 3285, 3285, 3285, 1142, 1144,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1150, 3285,
-     3285, 3285, 3285, 1150,  675,  675,  675, 3285, 3285, 3285,
-      675, 1159, 1159, 1159, 1159, 3285, 3285, 1159, 1159,  702,
-      702,  702, 3285, 3285, 3285,  702, 1194, 1194, 1194, 1194,
-     3285, 3285, 1194, 1194,  706,  706,  706, 3285, 3285, 3285,
-      706, 1204, 1204, 1204, 1204, 3285, 3285, 1204, 1204,  714,
-      714,  714, 3285, 3285, 3285,  714, 1220, 1220, 1220, 1220,
-
-     3285, 3285, 1220, 1220,  725,  725,  725, 3285, 3285, 3285,
-      725, 1227, 1227, 1227, 1227, 3285, 3285, 1227, 1227,  731,
-      731,  731, 3285, 3285, 3285,  731, 1235, 1235, 1235, 1235,
-     3285, 3285, 1235, 1235,  754,  754,  754, 3285, 3285, 3285,
-      754, 1258, 1258, 1258, 1258, 3285, 3285, 1258, 1258,  761,
-      761,  761, 3285, 3285, 3285,  761, 1267, 1267, 1267, 1267,
-     3285, 3285, 1267, 1267,  767,  767,  767, 3285, 3285, 3285,
-      767, 1275, 1275, 1275, 1275, 3285, 3285, 1275, 1275,  772,
-      772,  772, 3285, 3285, 3285,  772, 1281, 1281, 1281, 1281,
-     3285, 3285, 1281, 1281,  777,  777,  777, 3285, 3285, 3285,
-
-      777, 1293, 1293, 1293, 1293, 3285, 3285, 1293, 1293,  786,
-      786,  786, 3285, 3285, 3285,  786, 1300, 1300, 1300, 1300,
-     3285, 3285, 1300, 1300,  790,  790,  790, 3285, 3285, 3285,
-      790, 1311, 1311, 1311, 1311, 3285, 3285, 1311, 1311,  796,
-      796,  796, 3285, 3285, 3285,  796, 1337, 1337, 1337, 1337,
-     3285, 3285, 1337, 1337,  814,  814,  814,  814, 3285,  814,
-     3285,  814, 1353, 1353, 1353, 1353, 3285, 3285, 1353, 1353,
-      824,  824,  824, 3285, 3285, 3285,  824, 1368, 1368, 1368,
-     1368, 3285, 3285, 1368, 1368,  834,  834,  834, 3285, 3285,
-     3285,  834, 1376, 1376, 1376, 1376, 3285, 3285, 1376, 1376,
-
-      839,  839,  839, 3285, 3285, 3285,  839, 1385, 1385, 1385,
-     1385, 3285, 3285, 1385, 1385,  845,  845,  845, 3285, 3285,
-     3285,  845, 1396, 1396, 1396, 1396, 3285, 3285, 1396, 1396,
-      853,  853,  853,  853, 3285,  853, 3285,  853, 1405, 1405,
-     1405, 1405, 3285, 3285, 1405, 1405,  860,  860,  860,  860,
-     3285,  860, 3285,  860, 1417, 1417, 1417, 1417, 3285, 3285,
-     1417, 1417,  867,  867,  867, 3285, 3285, 3285,  867, 1425,
-     1425, 1425, 1425, 3285, 3285, 1425, 1425,  872,  872,  872,
-      872, 3285,  872, 3285,  872, 1433, 1433, 1433, 1433, 3285,
-     3285, 1433, 1433,  877,  877,  877,  877, 3285,  877, 3285,
-
-      877, 1443, 1443, 1443, 1443, 3285, 3285, 1443, 1443,  883,
-      883,  883, 3285, 3285, 3285,  883, 1452, 1452, 1452, 1452,
-     3285, 3285, 1452, 1452,  892,  892,  892, 3285, 3285, 3285,
-      892, 1458, 1458, 1458, 1458, 3285, 3285, 1458, 1458, 1465,
-     1465, 1465, 1465, 3285, 3285, 1465, 1465,  900,  900,  900,
-     3285, 3285, 3285,  900, 1473, 1473, 1473, 1473, 3285, 3285,
-     1473, 1473, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144,
-     1144, 1150, 3285, 1150, 3285, 3285, 1150,  675,  675,  675,
-     3285, 3285, 3285,  675, 1159, 1159, 1159, 1159, 3285, 3285,
-     1159, 1159,  702,  702,  702,  702, 3285,  702, 3285,  702,
-
-     1194, 1194, 1194, 1194, 3285, 3285, 1194, 1194,  706,  706,
-      706,  706, 3285,  706, 3285,  706, 1204, 1204, 1204, 1204,
-     3285, 3285, 1204, 1204,  714,  714,  714, 3285, 3285, 3285,
-      714, 1220, 1220, 1220, 1220, 3285, 3285, 1220, 1220,  725,
-      725,  725, 3285, 3285, 3285,  725, 1227, 1227, 1227, 1227,
-     3285, 3285, 1227, 1227,  731,  731,  731, 3285, 3285, 3285,
-      731, 1235, 1235, 1235, 1235, 3285, 3285, 1235, 1235,  754,
-      754,  754, 3285, 3285, 3285,  754, 1258, 1258, 1258, 1258,
-     3285, 3285, 1258, 1258,  761,  761,  761, 3285, 3285, 3285,
-      761, 1267, 1267, 1267, 1267, 3285, 3285, 1267, 1267,  767,
-
-      767,  767,  767, 3285,  767, 3285,  767, 1275, 1275, 1275,
-     1275, 3285, 3285, 1275, 1275,  772,  772,  772,  772, 3285,
-      772, 3285,  772, 1281, 1281, 1281, 1281, 3285, 3285, 1281,
-     1281,  777,  777,  777, 3285, 3285, 3285,  777, 1293, 1293,
-     1293, 1293, 3285, 3285, 1293, 1293,  786,  786,  786,  786,
-     3285,  786, 3285,  786, 1300, 1300, 1300, 1300, 3285, 3285,
-     1300, 1300,  790,  790,  790,  790, 3285,  790, 3285,  790,
-     1311, 1311, 1311, 1311, 3285, 3285, 1311, 1311,  796,  796,
-      796, 3285, 3285, 3285,  796, 1337, 1337, 1337, 1337, 3285,
-     3285, 1337, 1337,  814,  814,  814, 3285, 3285, 3285,  814,
-
-     1353, 1353, 1353, 1353, 3285, 3285, 1353, 1353,  824,  824,
-      824, 3285, 3285, 3285,  824, 1368, 1368, 1368, 1368, 3285,
-     3285, 1368, 1368,  834,  834,  834, 3285, 3285, 3285,  834,
-     1376, 1376, 1376, 1376, 3285, 3285, 1376, 1376,  839,  839,
-      839, 3285, 3285, 3285,  839, 1385, 1385, 1385, 1385, 3285,
-     3285, 1385, 1385,  845,  845,  845, 3285, 3285, 3285,  845,
-     1396, 1396, 1396, 1396, 3285, 3285, 1396, 1396,  853,  853,
-      853, 3285, 3285, 3285,  853, 1405, 1405, 1405, 1405, 3285,
-     3285, 1405, 1405,  860,  860,  860, 3285, 3285, 3285,  860,
-     1417, 1417, 1417, 1417, 3285, 3285, 1417, 1417,  867,  867,
-
-      867, 3285, 3285, 3285,  867, 1425, 1425, 1425, 1425, 3285,
-     3285, 1425, 1425, 1433, 1433, 1433, 1433, 3285, 3285, 1433,
-     1433,  877,  877,  877, 3285, 3285, 3285,  877, 1443, 1443,
-     1443, 1443, 3285, 3285, 1443, 1443,  883,  883,  883, 3285,
-     3285, 3285,  883, 1452, 1452, 1452, 1452, 3285, 3285, 1452,
-     1452,  892,  892,  892, 3285, 3285, 3285,  892, 1458, 1458,
-     1458, 1458, 3285, 3285, 1458, 1458, 1465, 1465, 1465, 1465,
-     3285, 3285, 1465, 1465,  900,  900,  900, 3285, 3285, 3285,
-      900, 1473, 1473, 1473, 1473, 3285, 3285, 1473, 1473, 1144,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1685, 1685,
-
-     1685, 1685, 1685, 1685, 1685, 1685, 1685,  675,  675,  675,
-     3285, 3285, 3285,  675, 1159, 1159, 1159, 1159, 3285, 3285,
-     1159, 1159, 1194, 1194, 1194, 1194, 3285, 3285, 1194, 1194,
-      706,  706,  706, 3285, 3285, 3285,  706, 1204, 1204, 1204,
-     1204, 3285, 3285, 1204, 1204,  714,  714,  714, 3285, 3285,
-     3285,  714, 1220, 1220, 1220, 1220, 3285, 3285, 1220, 1220,
-      725,  725,  725, 3285, 3285, 3285,  725, 1227, 1227, 1227,
-     1227, 3285, 3285, 1227, 1227,  731,  731,  731, 3285, 3285,
-     3285,  731,  754,  754,  754, 3285, 3285, 3285,  754, 1258,
-     1258, 1258, 1258, 3285, 3285, 1258, 1258,  761,  761,  761,
-
-     3285, 3285, 3285,  761, 1267, 1267, 1267, 1267, 3285, 3285,
-     1267, 1267, 1275, 1275, 1275, 1275, 3285, 3285, 1275, 1275,
-      772,  772,  772, 3285, 3285, 3285,  772, 1281, 1281, 1281,
-     1281, 3285, 3285, 1281, 1281,  777,  777,  777, 3285, 3285,
-     3285,  777, 1293, 1293, 1293, 1293, 3285, 3285, 1293, 1293,
-     1300, 1300, 1300, 1300, 3285, 3285, 1300, 1300, 1311, 1311,
-     1311, 1311, 3285, 3285, 1311, 1311,  796,  796,  796, 3285,
-     3285, 3285,  796, 1337, 1337, 1337, 1337, 3285, 3285, 1337,
-     1337,  814,  814,  814,  814, 3285,  814, 3285,  814, 1353,
-     1353, 1353, 1353, 3285, 3285, 1353, 1353,  824,  824,  824,
-
-     3285, 3285, 3285,  824, 1368, 1368, 1368, 1368, 3285, 3285,
-     1368, 1368,  834,  834,  834, 3285, 3285, 3285,  834, 1376,
-     1376, 1376, 1376, 3285, 3285, 1376, 1376,  839,  839,  839,
-     3285, 3285, 3285,  839, 1385, 1385, 1385, 1385, 3285, 3285,
-     1385, 1385,  845,  845,  845, 3285, 3285, 3285,  845, 1396,
-     1396, 1396, 1396, 3285, 3285, 1396, 1396,  853,  853,  853,
-     3285, 3285, 3285,  853, 1405, 1405, 1405, 1405, 3285, 3285,
-     1405, 1405,  860,  860,  860, 3285, 3285, 3285,  860, 1417,
-     1417, 1417, 1417, 3285, 3285, 1417, 1417,  867,  867,  867,
-     3285, 3285, 3285,  867, 1425, 1425, 1425, 1425, 3285, 3285,
-
-     1425, 1425, 1433, 1433, 1433, 1433, 3285, 3285, 1433, 1433,
-      877,  877,  877, 3285, 3285, 3285,  877, 1443, 1443, 1443,
-     1443, 3285, 3285, 1443, 1443,  883,  883,  883, 3285, 3285,
-     3285,  883, 1452, 1452, 1452, 1452, 3285, 3285, 1452, 1452,
-      892,  892,  892,  892, 3285,  892, 3285,  892, 1458, 1458,
-     1458, 1458, 3285, 3285, 1458, 1458, 1465, 1465, 1465, 1465,
-     3285, 3285, 1465, 1465,  900,  900,  900,  900, 3285,  900,
-     3285,  900, 1473, 1473, 1473, 1473, 3285, 3285, 1473, 1473,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1685,
-     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,  675,  675,
-
-      675, 3285, 3285, 3285,  675, 1159, 1159, 1159, 1159, 3285,
-     3285, 1159, 1159, 1194, 1194, 1194, 1194, 3285, 3285, 1194,
-     1194,  706,  706,  706, 3285, 3285, 3285,  706, 1204, 1204,
-     1204, 1204, 3285, 3285, 1204, 1204,  714,  714,  714, 3285,
-     3285, 3285,  714, 1220, 1220, 1220, 1220, 3285, 3285, 1220,
-     1220,  725,  725,  725, 3285, 3285, 3285,  725, 1227, 1227,
-     1227, 1227, 3285, 3285, 1227, 1227,  731,  731,  731, 3285,
-     3285, 3285,  731,  754,  754,  754, 3285, 3285, 3285,  754,
-     1258, 1258, 1258, 1258, 3285, 3285, 1258, 1258,  761,  761,
-      761, 3285, 3285, 3285,  761, 1267, 1267, 1267, 1267, 3285,
-
-     3285, 1267, 1267, 1275, 1275, 1275, 1275, 3285, 3285, 1275,
-     1275,  772,  772,  772,  772, 3285,  772, 3285,  772, 1281,
-     1281, 1281, 1281, 3285, 3285, 1281, 1281,  777,  777,  777,
-     3285, 3285, 3285,  777, 1293, 1293, 1293, 1293, 3285, 3285,
-     1293, 1293, 1311, 1311, 1311, 1311, 3285, 3285, 1311, 1311,
-      796,  796,  796, 3285, 3285, 3285,  796, 1337, 1337, 1337,
-     1337, 3285, 3285, 1337, 1337,  814,  814,  814,  814, 3285,
-      814, 3285,  814, 1353, 1353, 1353, 1353, 3285, 3285, 1353,
-     1353,  824,  824,  824, 3285, 3285, 3285,  824, 1368, 1368,
-     1368, 1368, 3285, 3285, 1368, 1368,  834,  834,  834, 3285,
-
-     3285, 3285,  834, 1376, 1376, 1376, 1376, 3285, 3285, 1376,
-     1376,  839,  839,  839, 3285, 3285, 3285,  839, 1385, 1385,
-     1385, 1385, 3285, 3285, 1385, 1385,  845,  845,  845, 3285,
-     3285, 3285,  845, 1396, 1396, 1396, 1396, 3285, 3285, 1396,
-     1396,  853,  853,  853, 3285, 3285, 3285,  853, 1405, 1405,
-     1405, 1405, 3285, 3285, 1405, 1405,  860,  860,  860,  860,
-     3285,  860, 3285,  860, 1417, 1417, 1417, 1417, 3285, 3285,
-     1417, 1417,  867,  867,  867, 3285, 3285, 3285,  867, 1425,
-     1425, 1425, 1425, 3285, 3285, 1425, 1425, 1433, 1433, 1433,
-     1433, 3285, 3285, 1433, 1433,  877,  877,  877,  877, 3285,
-
-      877, 3285,  877, 1443, 1443, 1443, 1443, 3285, 3285, 1443,
-     1443,  883,  883,  883, 3285, 3285, 3285,  883, 1452, 1452,
-     1452, 1452, 3285, 3285, 1452, 1452, 1458, 1458, 1458, 1458,
-     3285, 3285, 1458, 1458, 1465, 1465, 1465, 1465, 3285, 3285,
-     1465, 1465, 1473, 1473, 1473, 1473, 3285, 3285, 1473, 1473,
-     1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1685,
-     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685,  675,  675,
-      675,  675, 3285,  675, 3285,  675, 1159, 1159, 1159, 1159,
-     3285, 3285, 1159, 1159, 1194, 1194, 1194, 1194, 3285, 3285,
-     1194, 1194,  706,  706,  706, 3285, 3285, 3285,  706, 1204,
-
-     1204, 1204, 1204, 3285, 3285, 1204, 1204,  714,  714,  714,
-     3285, 3285, 3285,  714, 1220, 1220, 1220, 1220, 3285, 3285,
-     1220, 1220,  725,  725,  725,  725, 3285,  725, 3285,  725,
-     1227, 1227, 1227, 1227, 3285, 3285, 1227, 1227,  731,  731,
-      731,  731, 3285,  731, 3285,  731,  754,  754,  754,  754,
-     3285,  754, 3285,  754, 1258, 1258, 1258, 1258, 3285, 3285,
-     1258, 1258,  761,  761,  761,  761, 3285,  761, 3285,  761,
-     1267, 1267, 1267, 1267, 3285, 3285, 1267, 1267, 1275, 1275,
-     1275, 1275, 3285, 3285, 1275, 1275, 1281, 1281, 1281, 1281,
-     3285, 3285, 1281, 1281,  777,  777,  777, 3285, 3285, 3285,
-
-      777, 1311, 1311, 1311, 1311, 3285, 3285, 1311, 1311,  796,
-      796,  796, 3285, 3285, 3285,  796, 1337, 1337, 1337, 1337,
-     3285, 3285, 1337, 1337,  814,  814,  814,  814, 3285,  814,
-     3285,  814, 1353, 1353, 1353, 1353, 3285, 3285, 1353, 1353,
-      824,  824,  824, 3285, 3285, 3285,  824,  834,  834,  834,
-     3285, 3285, 3285,  834, 1376, 1376, 1376, 1376, 3285, 3285,
-     1376, 1376,  839,  839,  839, 3285, 3285, 3285,  839, 1385,
-     1385, 1385, 1385, 3285, 3285, 1385, 1385,  845,  845,  845,
-     3285, 3285, 3285,  845,  853,  853,  853, 3285, 3285, 3285,
-      853, 1405, 1405, 1405, 1405, 3285, 3285, 1405, 1405,  860,
-
-      860,  860, 3285, 3285, 3285,  860, 1417, 1417, 1417, 1417,
-     3285, 3285, 1417, 1417,  867,  867,  867, 3285, 3285, 3285,
-      867, 1425, 1425, 1425, 1425, 3285, 3285, 1425, 1425, 1433,
-     1433, 1433, 1433, 3285, 3285, 1433, 1433, 1443, 1443, 1443,
-     1443, 3285, 3285, 1443, 1443,  883,  883,  883, 3285, 3285,
-     3285,  883, 1452, 1452, 1452, 1452, 3285, 3285, 1452, 1452,
-     1458, 1458, 1458, 1458, 3285, 3285, 1458, 1458, 1465, 1465,
-     1465, 1465, 3285, 3285, 1465, 1465, 1144, 1144, 1144, 1144,
-     1144, 1144, 1144, 1144, 1144, 1685, 1685, 1685, 1685, 1685,
-     1685, 1685, 1685, 1685, 1159, 1159, 1159, 1159, 3285, 3285,
-
-     1159, 1159, 1194, 1194, 1194, 1194, 3285, 3285, 1194, 1194,
-      706,  706,  706, 3285, 3285, 3285,  706,  714,  714,  714,
-     3285, 3285, 3285,  714, 1220, 1220, 1220, 1220, 3285, 3285,
-     1220, 1220, 1227, 1227, 1227, 1227, 3285, 3285, 1227, 1227,
-     1258, 1258, 1258, 1258, 3285, 3285, 1258, 1258, 1267, 1267,
-     1267, 1267, 3285, 3285, 1267, 1267, 1281, 1281, 1281, 1281,
-     3285, 3285, 1281, 1281,  777,  777,  777, 3285, 3285, 3285,
-      777, 1311, 1311, 1311, 1311, 3285, 3285, 1311, 1311,  796,
-      796,  796, 3285, 3285, 3285,  796, 1337, 1337, 1337, 1337,
-     3285, 3285, 1337, 1337, 1353, 1353, 1353, 1353, 3285, 3285,
-
-     1353, 1353,  824,  824,  824, 3285, 3285, 3285,  824,  834,
-      834,  834, 3285, 3285, 3285,  834, 1376, 1376, 1376, 1376,
-     3285, 3285, 1376, 1376,  839,  839,  839, 3285, 3285, 3285,
-      839, 1385, 1385, 1385, 1385, 3285, 3285, 1385, 1385,  845,
-      845,  845, 3285, 3285, 3285,  845,  853,  853,  853, 3285,
-     3285, 3285,  853,  860,  860,  860, 3285, 3285, 3285,  860,
-     1417, 1417, 1417, 1417, 3285, 3285, 1417, 1417,  867,  867,
-      867, 3285, 3285, 3285,  867, 1425, 1425, 1425, 1425, 3285,
-     3285, 1425, 1425, 1433, 1433, 1433, 1433, 3285, 3285, 1433,
-     1433, 1443, 1443, 1443, 1443, 3285, 3285, 1443, 1443,  883,
-
-      883,  883,  883, 3285,  883, 3285,  883, 1452, 1452, 1452,
-     1452, 3285, 3285, 1452, 1452, 1458, 1458, 1458, 1458, 3285,
-     3285, 1458, 1458, 1465, 1465, 1465, 1465, 3285, 3285, 1465,
-     1465, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144,
-     1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1685, 1159,
-     1159, 1159, 1159, 3285, 3285, 1159, 1159, 1194, 1194, 1194,
-     1194, 3285, 3285, 1194, 1194,  706,  706,  706, 3285, 3285,
-     3285,  706,  714,  714,  714,  714, 3285,  714, 3285,  714,
-     1227, 1227, 1227, 1227, 3285, 3285, 1227, 1227, 1258, 1258,
-     1258, 1258, 3285, 3285, 1258, 1258, 1267, 1267, 1267, 1267,
-
-     3285, 3285, 1267, 1267, 1281, 1281, 1281, 1281, 3285, 3285,
-     1281, 1281,  777,  777,  777, 3285, 3285, 3285,  777, 1311,
-     1311, 1311, 1311, 3285, 3285, 1311, 1311,  796,  796,  796,
-     3285, 3285, 3285,  796, 1337, 1337, 1337, 1337, 3285, 3285,
-     1337, 1337, 1353, 1353, 1353, 1353, 3285, 3285, 1353, 1353,
-      824,  824,  824, 3285, 3285, 3285,  824,  834,  834,  834,
-     3285, 3285, 3285,  834,  839,  839,  839,  839, 3285,  839,
-     3285,  839, 1385, 1385, 1385, 1385, 3285, 3285, 1385, 1385,
-      845,  845,  845,  845, 3285,  845, 3285,  845,  853,  853,
-      853, 3285, 3285, 3285,  853,  860,  860,  860, 3285, 3285,
-
-     3285,  860, 1417, 1417, 1417, 1417, 3285, 3285, 1417, 1417,
-      867,  867,  867,  867, 3285,  867, 3285,  867, 1425, 1425,
-     1425, 1425, 3285, 3285, 1425, 1425, 1433, 1433, 1433, 1433,
-     3285, 3285, 1433, 1433, 1443, 1443, 1443, 1443, 3285, 3285,
-     1443, 1443,  883,  883,  883,  883, 3285,  883, 3285,  883,
-     1452, 1452, 1452, 1452, 3285, 3285, 1452, 1452, 1458, 1458,
-     1458, 1458, 3285, 3285, 1458, 1458, 1144, 1144, 1144, 1144,
-     1144, 1144, 1144, 1144, 1144, 1685, 1685, 1685, 1685, 1685,
-     1685, 1685, 1685, 1685, 1159, 1159, 1159, 1159, 3285, 3285,
-     1159, 1159,  706,  706,  706, 3285, 3285, 3285,  706,  714,
-
-      714,  714, 3285, 3285, 3285,  714, 1227, 1227, 1227, 1227,
-     3285, 3285, 1227, 1227, 1258, 1258, 1258, 1258, 3285, 3285,
-     1258, 1258, 1281, 1281, 1281, 1281, 3285, 3285, 1281, 1281,
-      777,  777,  777, 3285, 3285, 3285,  777, 1311, 1311, 1311,
-     1311, 3285, 3285, 1311, 1311,  796,  796,  796, 3285, 3285,
-     3285,  796, 2913, 2913, 2913, 2913, 2913, 2913, 2913, 2913,
-     2913, 2914, 2914, 2914, 2914, 2914, 2914, 2914, 2914, 2914,
-     2969, 2969, 2969, 2969, 2969, 2969, 2969, 2969, 2969, 2972,
-     2972, 2972, 2972, 2972, 2972, 2972, 2972, 2972, 3008, 3008,
-     3008, 3008, 3008, 3008, 3008, 3008, 3008, 3010, 3010, 3010,
-
-     3010, 3010, 3010, 3010, 3010, 3010,  259, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285
+     1398,  647,  651,  647,  652,  647, 3322, 3322, 3322, 1404,
+
+     1404, 1404, 1409, 1409, 1409, 2604, 3322, 3322, 3322, 1413,
+     1413, 1413, 2605, 3322, 1416, 1416, 1416, 1406, 1146, 1410,
+      647,  647, 2619, 3322, 2620, 2621, 1414, 2622, 1416, 1416,
+     1416,  653, 1418, 3322, 3322, 3322, 1112, 1112, 1112, 1424,
+     1424, 1424, 2623, 2624,  654,  662, 1418, 1428, 1428, 1428,
+     3322, 2625,  677, 1113, 2626, 1403, 1411, 1426, 2603, 2627,
+     1407,  661,  678, 2628, 1429, 1419, 1424, 1424, 1424, 2629,
+     2631, 1412, 2085, 2085, 2085, 2632, 1430, 1430, 1430, 2633,
+     1432, 1432, 1432, 2634, 1426, 1432, 1432, 1432, 2635,  679,
+      680,  681, 1415, 1431, 2636,  682,  683,  684, 1434, 2637,
+
+      685,  686, 2638, 1434,  687, 2639,  688,  689,  690,  662,
+     1436, 1436, 1436, 3322, 3322, 3322,  734, 1440, 1440, 1440,
+     2640, 1427, 1442, 1442, 1442,  661,  735, 1437, 2641, 2642,
+     3322, 1442, 1442, 1442, 1441, 1136, 1136, 1136, 2613, 2643,
+     1444, 1140, 1140, 1140, 1451, 1451, 1451, 2644, 2614, 1444,
+     2645, 2615, 1137,  679,  736,  691, 1435, 2646, 1141,  737,
+      738,  684, 1453, 1438,  739,  686, 2648, 2649,  740, 2657,
+      741,  742,  690, 1451, 1451, 1451, 2658, 2659, 1439, 1457,
+     1457, 1457, 1457, 1457, 1457, 1461, 1461, 1461, 2616, 1462,
+     2662, 1453, 1463, 1464, 1464, 1464, 2663, 1459, 2617, 2667,
+
+     1459, 2618, 1445, 1464, 1464, 1464, 1468, 1468, 1468, 2702,
+     1469, 1466, 1146, 1470, 1472, 1472, 1472, 1472, 1472, 1472,
+     2704, 1466, 1159, 1159, 1159, 1159, 1159, 1159, 2685, 1159,
+     1159, 1159, 1474, 2705, 2706, 1474, 2710, 1454, 2686, 2711,
+     1161, 2699, 2714, 1161, 2687, 2715, 1460, 1161, 1514, 1514,
+     1514, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194,
+     1517, 1517, 1517, 1689, 1467, 1515, 1199, 1199, 1199, 1196,
+     1200, 2718, 1196, 1201, 1689, 1196, 1484, 1518, 3322, 3322,
+     3322, 1475, 1204, 1204, 1204, 1204, 1204, 1204, 2688, 1204,
+     1204, 1204, 1209, 1209, 1209, 3322, 1210, 2719, 2689, 1211,
+
+     1206, 2712, 2720, 1206, 2690, 2700, 1516, 1206, 1212, 1212,
+     1212, 1523, 1523, 1523, 2713, 1524, 2701, 2716, 1525, 2721,
+     1526, 1526, 1526, 2722, 2723, 1213, 1215, 1215, 1215, 2724,
+     2717, 1528, 1528, 1528, 2725, 1529, 1521, 1527, 1530, 1519,
+     1532, 1532, 1532, 1216, 1220, 1220, 1220, 1220, 1220, 1220,
+     1220, 1220, 1220, 1537, 1537, 1537, 2726, 1533, 1227, 1227,
+     1227, 2728, 1222, 2729, 2730, 1222, 2731, 2732, 1222, 2733,
+     1538, 1227, 1227, 1227, 2734, 2735, 1229, 1227, 1227, 1227,
+     1231, 1231, 1231, 2736, 1232, 2737, 2738, 1233, 2739, 1229,
+     1235, 1235, 1235, 2740, 2742, 1229, 1235, 1235, 1235, 1542,
+
+     1542, 1542, 1253, 1253, 1253, 2754, 1254, 2755, 1237, 1255,
+     1535, 1559, 1559, 1559, 1237, 2763, 2764, 1543, 1258, 1258,
+     1258, 1258, 1258, 1258, 1540, 1258, 1258, 1258, 1560, 2781,
+     1263, 1263, 1263, 2782, 1264, 2783, 1260, 1265, 2784, 1260,
+     1267, 1267, 1267, 1260, 1267, 1267, 1267, 1267, 1267, 1267,
+     1565, 1565, 1565, 3322, 3322, 3322, 2785, 2786, 1269, 1273,
+     1273, 1273, 1269, 2797, 1689, 1269, 2799, 1566, 2800, 2801,
+     3322, 1273, 1273, 1273, 1273, 1273, 1273, 1275, 1569, 1569,
+     1569, 3322, 3322, 3322, 2789, 2802, 1561, 2803, 2804, 1275,
+     2805, 2806, 1275, 2807, 2791, 1570, 2808, 2790, 3322, 2794,
+
+     1567, 1279, 1279, 1279, 1279, 1279, 1279, 2792, 1564, 1571,
+     1279, 1279, 1279, 1575, 1575, 1575, 1286, 1286, 1286, 1281,
+     1287, 2811, 1281, 1288, 1292, 1292, 1292, 2812, 1281, 2813,
+     1576, 1292, 1292, 1292, 1292, 1292, 1292, 1583, 1583, 1583,
+     2814, 1568, 1294, 1299, 1299, 1299, 1299, 1299, 1299, 1294,
+     2815, 2816, 1294, 2817, 1584, 1299, 1299, 1299, 1586, 1586,
+     1586, 1301, 2818, 2820, 1301, 1304, 1304, 1304, 1146, 1305,
+     2821, 2822, 1306, 1301, 2823, 1587, 1572, 1307, 1307, 1307,
+     2824, 1308, 2825, 2826, 1309, 1310, 1310, 1310, 1310, 1310,
+     1310, 1310, 1310, 1310, 1318, 1318, 1318, 2827, 1319, 1580,
+
+     2828, 1320, 2829, 1312, 2830, 2831, 1312, 2832, 2844, 1312,
+     1593, 1593, 1593, 1322, 1322, 1322, 2793, 1323, 2845, 2846,
+     1324, 2853, 1585, 1325, 1325, 1325, 2854, 1594, 1595, 1595,
+     1595, 2868, 1596, 2869, 2870, 1597, 1336, 1336, 1336, 2871,
+     1326, 1336, 1336, 1336, 1336, 1336, 1336, 2860, 1340, 1340,
+     1340, 2862, 1341, 2872, 1338, 1342, 1588, 2861, 2864, 1338,
+     2873, 2863, 1338, 1343, 1343, 1343, 2877, 1344, 2865, 2866,
+     1345, 1346, 1346, 1346, 1608, 1608, 1608, 2878, 1609, 2867,
+     2879, 1610, 1352, 1352, 1352, 1352, 1352, 1352, 1347, 1352,
+     1352, 1352, 1360, 1360, 1360, 2880, 1361, 1146, 2890, 1362,
+
+     1354, 2891, 2892, 1354, 1363, 1363, 1363, 1354, 1620, 1620,
+     1620, 1607, 1621, 2893, 2894, 1622, 1367, 1367, 1367, 2895,
+     2896, 1364, 1367, 1367, 1367, 1367, 1367, 1367, 1372, 1372,
+     1372, 2881, 1373, 2897, 1369, 1374, 2901, 1615, 2902, 2903,
+     1369, 2904, 2905, 1369, 1375, 1375, 1375, 1375, 1375, 1375,
+     1375, 1375, 1375, 1380, 1380, 1380, 2906, 1381, 2908, 2909,
+     1382, 2910, 1377, 2911, 2912, 1377, 2913, 2914, 1377, 1384,
+     1384, 1384, 1384, 1384, 1384, 2915, 1625, 1384, 1384, 1384,
+     2919, 1389, 1389, 1389, 2920, 1390, 2921, 1386, 1391, 2924,
+     1386, 1395, 1395, 1395, 2929, 1386, 1395, 1395, 1395, 2930,
+
+     1395, 1395, 1395, 1399, 1399, 1399, 1636, 1636, 1636, 1397,
+     1637, 2931, 2932, 1638, 1397, 2933, 2934, 1627, 1397, 2935,
+     1400, 1401, 1401, 1401, 2936, 2937, 1630, 1639, 1639, 1639,
+     2938, 1640, 2939, 2940, 1641, 1404, 1404, 1404, 1402, 1404,
+     1404, 1404, 2942, 1404, 1404, 1404, 1409, 1409, 1409, 2943,
+     1413, 1413, 1413, 1406, 1902, 1902, 1902, 1406, 2944, 2945,
+     1635, 1406, 2952, 1410, 1645, 1645, 1645, 1414, 1646, 2953,
+     2954, 1647, 1650, 1650, 1650, 2955, 1651, 2956, 2957, 1652,
+     1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1421,
+     1421, 1421, 2958, 1422, 2959, 2960, 1423, 2961, 1418, 2962,
+
+     1146, 1418, 2963, 2964, 1418, 1424, 1424, 1424, 2965, 2968,
+     1643, 1424, 1424, 1424, 1424, 1424, 1424, 1428, 1428, 1428,
+     1657, 1657, 1657, 1426, 1658, 2969, 2970, 1659, 2971, 1426,
+     2972, 2973, 1426, 2974, 1429, 1430, 1430, 1430, 1660, 1660,
+     1660, 2975, 1661, 2946, 2976, 1662, 1432, 1432, 1432, 2980,
+     1654, 2987, 1431, 1432, 1432, 1432, 2988, 1432, 1432, 1432,
+     1436, 1436, 1436, 2989, 1434, 1664, 1664, 1664, 2990, 1665,
+     2991, 1434, 1666, 2992, 1656, 1434, 2993, 1437, 1440, 1440,
+     1440, 1669, 1669, 1669, 2994, 1670, 2995, 2996, 1671, 1442,
+     1442, 1442, 1442, 1442, 1442, 1441, 1442, 1442, 1442, 1674,
+
+     1674, 1674, 1451, 1451, 1451, 2997, 2998, 1444, 3001, 3002,
+     1444, 1451, 1451, 1451, 1444, 3003, 1675, 3004, 1146, 1663,
+     1453, 1451, 1451, 1451, 1457, 1457, 1457, 3007, 3012, 1453,
+     1457, 1457, 1457, 1457, 1457, 1457, 1461, 1461, 1461, 1453,
+     1462, 3008, 1459, 1463, 1464, 1464, 1464, 3013, 1459, 3014,
+     3015, 1459, 1464, 1464, 1464, 1464, 1464, 1464, 1672, 1468,
+     1468, 1468, 1466, 1469, 3005, 3016, 1470, 1472, 1472, 1472,
+     1466, 3017, 3007, 1466, 1472, 1472, 1472, 1472, 1472, 1472,
+     3018, 3019, 1679, 3010, 3020, 1474, 1682, 1688, 1688, 1688,
+     3021, 3022, 1474, 3023, 3024, 1474, 1159, 1159, 1159, 1514,
+
+     1514, 1514, 1194, 1194, 1194, 1689, 1690, 3025, 1517, 1517,
+     1517, 1542, 1542, 1542, 1161, 1683, 1515, 1726, 1726, 1726,
+     1196, 1727, 3026, 3027, 1728, 1518, 1730, 1730, 1730, 1543,
+     1731, 3028, 3029, 1732, 1204, 1204, 1204, 3033, 1685, 1523,
+     1523, 1523, 3038, 1524, 3030, 3031, 1525, 1526, 1526, 1526,
+     3039, 3034, 1206, 3040, 1737, 1737, 1737, 3032, 1738, 3036,
+     1729, 1739, 1695, 3035, 1527, 1528, 1528, 1528, 3041, 1529,
+     3042, 3037, 1530, 1532, 1532, 1532, 3043, 1741, 1741, 1741,
+     3046, 1742, 1146, 1735, 1743, 1220, 1220, 1220, 3007, 3046,
+     1533, 1537, 1537, 1537, 1747, 1747, 1747, 3049, 1748, 1689,
+
+     1690, 1749, 3008, 1222, 1750, 1750, 1750, 3050, 1538, 1227,
+     1227, 1227, 1768, 1768, 1768, 1559, 1559, 1559, 1770, 1770,
+     1770, 1751, 1771, 3044, 3051, 1772, 3052, 1229, 3065, 1769,
+     3053, 3063, 1560, 3068, 3066, 1745, 1258, 1258, 1258, 1267,
+     1267, 1267, 1565, 1565, 1565, 1777, 1777, 1777, 3054, 1778,
+     3064, 3073, 1779, 3067, 1260, 3076, 3055, 1269, 1752, 1566,
+     1273, 1273, 1273, 1569, 1569, 1569, 1782, 1782, 1782, 3077,
+     1783, 3056, 3078, 1784, 1279, 1279, 1279, 3071, 1275, 3007,
+     1570, 1575, 1575, 1575, 1789, 1789, 1789, 3046, 1790, 3080,
+     3010, 1791, 1281, 1792, 1792, 1792, 3072, 3046, 1576, 3074,
+
+     1773, 3081, 3082, 1776, 1795, 1795, 1795, 1292, 1292, 1292,
+     1793, 1583, 1583, 1583, 3083, 1801, 1801, 1801, 3075, 1802,
+     1781, 1796, 1803, 3084, 3085, 1294, 3086, 3096, 1584, 1804,
+     1804, 1804, 1586, 1586, 1586, 1786, 1806, 1806, 1806, 3097,
+     1807, 3098, 3099, 1808, 1310, 1310, 1310, 1805, 3100, 1587,
+     1797, 1811, 1811, 1811, 1593, 1593, 1593, 1815, 1815, 1815,
+     3101, 1816, 1312, 3105, 1817, 1595, 1595, 1595, 1812, 1596,
+     3106, 1594, 1597, 1798, 1820, 1820, 1820, 1336, 1336, 1336,
+     1608, 1608, 1608, 3107, 1609, 3108, 3109, 1610, 1829, 1829,
+     1829, 1821, 3322, 3322, 3322, 1338, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 1352, 1352, 1352, 1830, 1836, 1836, 1836, 3322,
+     1809, 3110, 3111, 3322, 3112, 3114, 3322, 1620, 1620, 1620,
+     1354, 1621, 3115, 1837, 1622, 3116, 3117, 1840, 1840, 1840,
+     1367, 1367, 1367, 1375, 1375, 1375, 1384, 1384, 1384, 1852,
+     1852, 1852, 1828, 1832, 1841, 1395, 1395, 1395, 1369, 3118,
+     3123, 1377, 3124, 3125, 1386, 3119, 1853, 1834, 3121, 1404,
+     1404, 1404, 1831, 1397, 1636, 1636, 1636, 3120, 1637, 1833,
+     3122, 1638, 1639, 1639, 1639, 3126, 1640, 1406, 3127, 1641,
+     1645, 1645, 1645, 3128, 1646, 1854, 3129, 1647, 1650, 1650,
+     1650, 3130, 1651, 1848, 1843, 1652, 1416, 1416, 1416, 1845,
+
+     3131, 3132, 1855, 1424, 1424, 1424, 1657, 1657, 1657, 3133,
+     1658, 3134, 3135, 1659, 1418, 1660, 1660, 1660, 3136, 1661,
+     3138, 1426, 1662, 3139, 3140, 1857, 1432, 1432, 1432, 1664,
+     1664, 1664, 3141, 1665, 3142, 3143, 1666, 3144, 1669, 1669,
+     1669, 3145, 1670, 3146, 1434, 1671, 1442, 1442, 1442, 1674,
+     1674, 1674, 1870, 1870, 1870, 3147, 1871, 1862, 1146, 1872,
+     1864, 1451, 1451, 1451, 1444, 3148, 1675, 1878, 1878, 1878,
+     1457, 1457, 1457, 1865, 1464, 1464, 1464, 3149, 3150, 1453,
+     1882, 1882, 1882, 3137, 1879, 1472, 1472, 1472, 1459, 1688,
+     1688, 1688, 1466, 1868, 1159, 1159, 1159, 1883, 1726, 1726,
+
+     1726, 3151, 1727, 1474, 3152, 1728, 3153, 1689, 3154, 3155,
+     1876, 3156, 1161, 1194, 1194, 1194, 1730, 1730, 1730, 3157,
+     1731, 3159, 3160, 1732, 3161, 1146, 1881, 1204, 1204, 1204,
+     3162, 1196, 1737, 1737, 1737, 3163, 1738, 1880, 3164, 1739,
+     1886, 1220, 1220, 1220, 3158, 1206, 1891, 1884, 1741, 1741,
+     1741, 3165, 1742, 3166, 3167, 1743, 3168, 1887, 3169, 1222,
+     1747, 1747, 1747, 3170, 1748, 3171, 3172, 1749, 1750, 1750,
+     1750, 3173, 1937, 1937, 1937, 3174, 1938, 3175, 1923, 1939,
+     1920, 1227, 1227, 1227, 3176, 1751, 1946, 1946, 1946, 1946,
+     1946, 1946, 1907, 1907, 1907, 1768, 1768, 1768, 1146, 1229,
+
+     3178, 3179, 1927, 1952, 1952, 1952, 3180, 1953, 3181, 3182,
+     1954, 3183, 1769, 1770, 1770, 1770, 3184, 1771, 3177, 3185,
+     1772, 1258, 1258, 1258, 1957, 1957, 1957, 1267, 1267, 1267,
+     3186, 3187, 1940, 1777, 1777, 1777, 3188, 1778, 3189, 1260,
+     1779, 1958, 1273, 1273, 1273, 1269, 3190, 1782, 1782, 1782,
+     1947, 1783, 3191, 1908, 1784, 3192, 1947, 1279, 1279, 1279,
+     1275, 1962, 1962, 1962, 3193, 1789, 1789, 1789, 1955, 1790,
+     3194, 3195, 1791, 3197, 1959, 1281, 3198, 3199, 1963, 1792,
+     1792, 1792, 1967, 1967, 1967, 3200, 1968, 3201, 3202, 1969,
+     1970, 1970, 1970, 1795, 1795, 1795, 1793, 1972, 1972, 1972,
+
+     1146, 1973, 3203, 3204, 1974, 3205, 3196, 1971, 1961, 3206,
+     1796, 1976, 1976, 1976, 3207, 1801, 1801, 1801, 3208, 1802,
+     3210, 1964, 1803, 1804, 1804, 1804, 1806, 1806, 1806, 1977,
+     1807, 1146, 3211, 1808, 1310, 1310, 1310, 1811, 1811, 1811,
+     3212, 1805, 1982, 1982, 1982, 3209, 1983, 3213, 3214, 1984,
+     3215, 3216, 1312, 3217, 1812, 1985, 1985, 1985, 1815, 1815,
+     1815, 3219, 1816, 3220, 3221, 1817, 1820, 1820, 1820, 1990,
+     1990, 1990, 1986, 1991, 3222, 3223, 1992, 1993, 1993, 1993,
+     1980, 3224, 3225, 1821, 1999, 1999, 1999, 1336, 1336, 1336,
+     1829, 1829, 1829, 3226, 1994, 2002, 2002, 2002, 3229, 2003,
+
+     3230, 2000, 2004, 3231, 3232, 1338, 3233, 1830, 2005, 2005,
+     2005, 3322, 3322, 3322, 2008, 2008, 2008, 1352, 1352, 1352,
+     1836, 1836, 1836, 3234, 1146, 2006, 1146, 1724, 3322, 1722,
+     1146, 2009, 2012, 2012, 2012, 1354, 2013, 1837, 1146, 2014,
+     2015, 2015, 2015, 1840, 1840, 1840, 3243, 2018, 2018, 2018,
+     1146, 2019, 3244, 2001, 2020, 1146, 1146, 2016, 3261, 3245,
+     1841, 2022, 2022, 2022, 1375, 1375, 1375, 1146, 3241, 2007,
+     1384, 1384, 1384, 1852, 1852, 1852, 1146, 2010, 3237, 2023,
+     1721, 1720, 1377, 1146, 3257, 2032, 2032, 2032, 1386, 2033,
+     1853, 3235, 2034, 2036, 2036, 2036, 1404, 1404, 1404, 2041,
+
+     2041, 2041, 2043, 2043, 2043, 3322, 3322, 3322, 1416, 1416,
+     1416, 2037, 3236, 3246, 1406, 2025, 2042, 1146, 2028, 2044,
+     1146, 1146, 3322, 1432, 1432, 1432, 1418, 1424, 1424, 1424,
+     3249, 2050, 2050, 2050, 2052, 2052, 2052, 1442, 1442, 1442,
+     1146, 1434, 1870, 1870, 1870, 1426, 1871, 2039, 2051, 1872,
+     1146, 2053, 1451, 1451, 1451, 1444, 1146, 1878, 1878, 1878,
+     2061, 2061, 2061, 3247, 2062, 3238, 1719, 2063, 3239, 2045,
+     1453, 1146, 3262, 2048, 1879, 2046, 1457, 1457, 1457, 1464,
+     1464, 1464, 1882, 1882, 1882, 2066, 2066, 2066, 2049, 2067,
+     1718, 1717, 2068, 3248, 1459, 1146, 1146, 1466, 3240, 1883,
+
+     3242, 1146, 2054, 2059, 2069, 2069, 2069, 2075, 2075, 2075,
+     1159, 1159, 1159, 2092, 2092, 2092, 1907, 1907, 1907, 2093,
+     2093, 2093, 2070, 1146, 2076, 1910, 1910, 1910, 1161, 2096,
+     2096, 2096, 3251, 3252, 2065, 2064, 2097, 2097, 2097, 1918,
+     1918, 1918, 1194, 1194, 1194, 2106, 2106, 2106, 2109, 2109,
+     2109, 1220, 1220, 1220, 1146, 2113, 2113, 2113, 1146, 1146,
+     1196, 1146, 1146, 2107, 3253, 2110, 1937, 1937, 1937, 1222,
+     1938, 2077, 2114, 1939, 1146, 1227, 1227, 1227, 2126, 2126,
+     2126, 1946, 1946, 1946, 2133, 2133, 2133, 2135, 2135, 2135,
+     1146, 1146, 2103, 1229, 3255, 2127, 1952, 1952, 1952, 3254,
+
+     1953, 3250, 3301, 1954, 2136, 1258, 1258, 1258, 3258, 3256,
+     2112, 2139, 2139, 2139, 1957, 1957, 1957, 1146, 2142, 2142,
+     2142, 2125, 2143, 1260, 1146, 2144, 3265, 3259, 2140, 1716,
+     1715, 1958, 3263, 2137, 1267, 1267, 1267, 2147, 2147, 2147,
+     3264, 1146, 1962, 1962, 1962, 1146, 2149, 2149, 2149, 1146,
+     2150, 1146, 1269, 2151, 3260, 2148, 3309, 2141, 2138, 1963,
+     1279, 1279, 1279, 1967, 1967, 1967, 1146, 1968, 1146, 1146,
+     1969, 1970, 1970, 1970, 1714, 2155, 2155, 2155, 1281, 2156,
+     3266, 1146, 2157, 1976, 1976, 1976, 3277, 2145, 1971, 1972,
+     1972, 1972, 1146, 1973, 3269, 1146, 1974, 1978, 1978, 1978,
+
+     3267, 1977, 1310, 1310, 1310, 1712, 3279, 2152, 1982, 1982,
+     1982, 3270, 1983, 1146, 1146, 1984, 1985, 1985, 1985, 1146,
+     1312, 2164, 2164, 2164, 3319, 2165, 3268, 3271, 2166, 1146,
+     1990, 1990, 1990, 1986, 1991, 1146, 1146, 1992, 1993, 1993,
+     1993, 2170, 2170, 2170, 1146, 2171, 3275, 3276, 2172, 2173,
+     2173, 2173, 1999, 1999, 1999, 1994, 1146, 2178, 2178, 2178,
+     2162, 2179, 1146, 3291, 2180, 3272, 2174, 3278, 1146, 2000,
+     1336, 1336, 1336, 2002, 2002, 2002, 1146, 2003, 3281, 3273,
+     2004, 2005, 2005, 2005, 1711, 2182, 2182, 2182, 1338, 2183,
+     1146, 3274, 2184, 2185, 2185, 2185, 1146, 1709, 2006, 2008,
+
+     2008, 2008, 2187, 2187, 2187, 3280, 2188, 1146, 3283, 2189,
+     2186, 1352, 1352, 1352, 1708, 3289, 2009, 1705, 2012, 2012,
+     2012, 2181, 2013, 1146, 1146, 2014, 2015, 2015, 2015, 1354,
+     2192, 2192, 2192, 3285, 2193, 1146, 3284, 2194, 2018, 2018,
+     2018, 1702, 2019, 2016, 3286, 2020, 2022, 2022, 2022, 1375,
+     1375, 1375, 2200, 2200, 2200, 1384, 1384, 1384, 2204, 2204,
+     2204, 1146, 2190, 1146, 2023, 3282, 1146, 1377, 1146, 2201,
+     2032, 2032, 2032, 1386, 2033, 2205, 3302, 2034, 2036, 2036,
+     2036, 2212, 2212, 2212, 2041, 2041, 2041, 2215, 2215, 2215,
+     3287, 2216, 3288, 3290, 2217, 3295, 2037, 1146, 1701, 2213,
+
+     3292, 2042, 1146, 1146, 2206, 2043, 2043, 2043, 2218, 2218,
+     2218, 1700, 2219, 2198, 3293, 2220, 2202, 1416, 1416, 1416,
+     1146, 1146, 2044, 1424, 1424, 1424, 1432, 1432, 1432, 2050,
+     2050, 2050, 2226, 2226, 2226, 1418, 2227, 3296, 1146, 2228,
+     1146, 1426, 1146, 3294, 1434, 1146, 2051, 2052, 2052, 2052,
+     2229, 2229, 2229, 3310, 2230, 3303, 1146, 2231, 1442, 1442,
+     1442, 1451, 1451, 1451, 2053, 1146, 2061, 2061, 2061, 1699,
+     2062, 1146, 2224, 2063, 1146, 3299, 1444, 3304, 1146, 1453,
+     1457, 1457, 1457, 2222, 1464, 1464, 1464, 3297, 2066, 2066,
+     2066, 2225, 2067, 3300, 1698, 2068, 1697, 1696, 1459, 2069,
+
+     2069, 2069, 1466, 2075, 2075, 2075, 2245, 2245, 2245, 3311,
+     2246, 3307, 3298, 2247, 1159, 1159, 1159, 2070, 1146, 3315,
+     2076, 3312, 3319, 2232, 3305, 1694, 2237, 2249, 2249, 2249,
+     1146, 2239, 1161, 2254, 2254, 2254, 1146, 2240, 2255, 2255,
+     2255, 2085, 2085, 2085, 2257, 2257, 2257, 2261, 2261, 2261,
+     2092, 2092, 2092, 2093, 2093, 2093, 2262, 2262, 2262, 2096,
+     2096, 2096, 2097, 2097, 2097, 2265, 2265, 2265, 2266, 2266,
+     2266, 2267, 2267, 2267, 2268, 2268, 2268, 1146, 2248, 1194,
+     1194, 1194, 2106, 2106, 2106, 1693, 2109, 2109, 2109, 2274,
+     2274, 2274, 1146, 2275, 1692, 1691, 2276, 1196, 1684, 1681,
+
+     2107, 1680, 2263, 2110, 2278, 2278, 2278, 2113, 2113, 2113,
+     2280, 2280, 2280, 1678, 2281, 1677, 1676, 2282, 1227, 1227,
+     1227, 1673, 2279, 3306, 2114, 2126, 2126, 2126, 1146, 3308,
+     2270, 2294, 2294, 2294, 1668, 2295, 1229, 1667, 2296, 2297,
+     2297, 2297, 2127, 2133, 2133, 2133, 2302, 2302, 2302, 2135,
+     2135, 2135, 2304, 2304, 2304, 1146, 2305, 1655, 1653, 2306,
+     1258, 1258, 1258, 2139, 2139, 2139, 2136, 2293, 2309, 2309,
+     2309, 1146, 2310, 1146, 1146, 2311, 3316, 1649, 1260, 1648,
+     2140, 2142, 2142, 2142, 1644, 2143, 1642, 3313, 2144, 1267,
+     1267, 1267, 2303, 1634, 2147, 2147, 2147, 2149, 2149, 2149,
+
+     1633, 2150, 1632, 3314, 2151, 3317, 3318, 1269, 1279, 1279,
+     1279, 2308, 2148, 2155, 2155, 2155, 1631, 2156, 1629, 1628,
+     2157, 1310, 1310, 1310, 1626, 1624, 1281, 2164, 2164, 2164,
+     1623, 2165, 1619, 1618, 2166, 2173, 2173, 2173, 1617, 1312,
+     2313, 2170, 2170, 2170, 1616, 2171, 1614, 1613, 2172, 2329,
+     2329, 2329, 2174, 2330, 1612, 1611, 2331, 1606, 2178, 2178,
+     2178, 2315, 2179, 1605, 1604, 2180, 1336, 1336, 1336, 1603,
+     2182, 2182, 2182, 1602, 2183, 1601, 2324, 2184, 2185, 2185,
+     2185, 2336, 2336, 2336, 1338, 2337, 1600, 1599, 2338, 2187,
+     2187, 2187, 1598, 2188, 1592, 2186, 2189, 1352, 1352, 1352,
+
+     2192, 2192, 2192, 1591, 2193, 1590, 1589, 2194, 2344, 2344,
+     2344, 2200, 2200, 2200, 1582, 1354, 2347, 2347, 2347, 1581,
+     2348, 1579, 1578, 2349, 1577, 1574, 2345, 1573, 2201, 1563,
+     2335, 1384, 1384, 1384, 2204, 2204, 2204, 2352, 2352, 2352,
+     1562, 2353, 1558, 1557, 2354, 1556, 2212, 2212, 2212, 1386,
+     1555, 2205, 2215, 2215, 2215, 1554, 2216, 1553, 1552, 2217,
+     1416, 1416, 1416, 2339, 2213, 2218, 2218, 2218, 1551, 2219,
+     1549, 1548, 2220, 1546, 1424, 1424, 1424, 1545, 1418, 1432,
+     1432, 1432, 2226, 2226, 2226, 1544, 2227, 1541, 1539, 2228,
+     1536, 2350, 1426, 1534, 2229, 2229, 2229, 1434, 2230, 1531,
+
+     1522, 2231, 1442, 1442, 1442, 1520, 2370, 2370, 2370, 1513,
+     1511, 2365, 3322, 3322, 3322, 2368, 3322, 3322, 3322, 1510,
+     1444, 1509, 2369, 2371, 3322, 3322, 3322, 1508, 1507, 3322,
+     1451, 1451, 1451, 3322, 1457, 1457, 1457, 2378, 2378, 2378,
+     2367, 3322, 2380, 2380, 2380, 2383, 2383, 2383, 1453, 2245,
+     2245, 2245, 1459, 2246, 1506, 2379, 2247, 1159, 1159, 1159,
+     1146, 1505, 1504, 2372, 2249, 2249, 2249, 2385, 2385, 2385,
+     2386, 2386, 2386, 1503, 1502, 1161, 2254, 2254, 2254, 1499,
+     2373, 1498, 1497, 2374, 2255, 2255, 2255, 2257, 2257, 2257,
+     2390, 2390, 2390, 1496, 2377, 2375, 2391, 2391, 2391, 2392,
+
+     2392, 2392, 2261, 2261, 2261, 2262, 2262, 2262, 2265, 2265,
+     2265, 2266, 2266, 2266, 1495, 1494, 2384, 2267, 2267, 2267,
+     2268, 2268, 2268, 2396, 2396, 2396, 2399, 2399, 2399, 2274,
+     2274, 2274, 1493, 2275, 1491, 1490, 2276, 3322, 3322, 3322,
+     1489, 2397, 1488, 2400, 2278, 2278, 2278, 1487, 2280, 2280,
+     2280, 1486, 2281, 1485, 3322, 2282, 1227, 1227, 1227, 2294,
+     2294, 2294, 2279, 2295, 2418, 2419, 2296, 2420, 2297, 2297,
+     2297, 2423, 2423, 2423, 1229, 2421, 2302, 2302, 2302, 2304,
+     2304, 2304, 2422, 2305, 1483, 1482, 2306, 1258, 1258, 1258,
+     2309, 2309, 2309, 1481, 2310, 1480, 1479, 2311, 2431, 2431,
+
+     2431, 1478, 1477, 2401, 1146, 1260, 2433, 2433, 2433, 1279,
+     1279, 1279, 2443, 2443, 2443, 1471, 2432, 2412, 1310, 1310,
+     1310, 1456, 1455, 2434, 2329, 2329, 2329, 1281, 2330, 1450,
+     1449, 2331, 1448, 2429, 1447, 1446, 1312, 2450, 2450, 2450,
+     2454, 2454, 2454, 2336, 2336, 2336, 1420, 2337, 1408, 1394,
+     2338, 2456, 2456, 2456, 2451, 2344, 2344, 2344, 2455, 1393,
+     2435, 1392, 2462, 2462, 2462, 1384, 1384, 1384, 1388, 2457,
+     2347, 2347, 2347, 2345, 2348, 1383, 1379, 2349, 2444, 2463,
+     2465, 2465, 2465, 1386, 2352, 2352, 2352, 1371, 2353, 1366,
+     1365, 2354, 3322, 3322, 3322, 1359, 1356, 2466, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 2476, 2476, 2476, 1335, 1334, 3322,
+     2478, 2478, 2478, 1333, 1332, 3322, 2464, 1331, 3322, 2480,
+     2480, 2480, 1424, 1424, 1424, 1330, 2467, 1329, 2479, 1328,
+     1432, 1432, 1432, 1442, 1442, 1442, 2481, 2370, 2370, 2370,
+     1426, 1327, 2485, 2485, 2485, 1321, 2486, 2468, 1434, 2487,
+     1314, 1444, 2474, 1303, 2371, 2488, 2488, 2488, 1298, 2469,
+     3322, 3322, 3322, 3322, 3322, 3322, 2492, 2492, 2492, 1297,
+     2484, 1296, 2489, 2494, 2494, 2494, 1291, 3322, 1290, 1289,
+     3322, 1285, 2482, 1284, 2493, 1457, 1457, 1457, 2378, 2378,
+     2378, 2483, 2380, 2380, 2380, 2383, 2383, 2383, 2499, 2499,
+
+     2499, 1283, 1278, 1459, 1277, 1272, 2379, 2385, 2385, 2385,
+     1146, 2490, 1271, 1266, 2491, 1262, 2500, 2386, 2386, 2386,
+     2503, 2503, 2503, 2390, 2390, 2390, 2391, 2391, 2391, 2392,
+     2392, 2392, 2396, 2396, 2396, 2399, 2399, 2399, 2508, 2508,
+     2508, 1257, 2509, 1256, 1252, 2510, 1227, 1227, 1227, 1251,
+     2397, 2495, 2400, 1250, 2496, 2423, 2423, 2423, 2537, 2537,
+     2537, 1258, 1258, 1258, 1229, 2431, 2431, 2431, 2433, 2433,
+     2433, 2542, 2542, 2542, 1249, 2543, 1248, 1247, 2544, 1260,
+     2545, 2545, 2545, 2432, 1246, 2434, 2551, 2551, 2551, 2443,
+     2443, 2443, 1310, 1310, 1310, 2450, 2450, 2450, 2546, 1245,
+
+     2559, 2559, 2559, 2552, 2560, 1244, 2522, 2561, 1243, 1242,
+     1312, 1241, 2451, 2563, 2563, 2563, 2454, 2454, 2454, 2456,
+     2456, 2456, 2567, 2567, 2567, 1240, 1234, 2540, 1226, 1225,
+     2564, 2462, 2462, 2462, 2455, 1224, 1219, 2457, 1218, 2568,
+     2570, 2570, 2570, 1217, 2571, 1214, 1208, 2572, 2463, 2553,
+     2573, 2573, 2573, 2465, 2465, 2465, 2575, 2575, 2575, 1203,
+     2576, 1202, 1198, 2577, 3322, 3322, 3322, 1193, 2574, 1192,
+     2466, 3322, 3322, 3322, 3322, 3322, 3322, 2583, 2583, 2583,
+     1191, 3322, 2476, 2476, 2476, 2478, 2478, 2478, 3322, 1190,
+     1189, 3322, 1188, 1187, 2584, 2480, 2480, 2480, 2587, 2587,
+
+     2587, 1185, 2588, 2479, 1184, 2589, 2590, 2590, 2590, 1432,
+     1432, 1432, 2481, 1442, 1442, 1442, 2578, 1183, 2485, 2485,
+     2485, 1182, 2486, 1181, 2591, 2487, 1180, 1434, 1179, 2579,
+     1178, 1444, 2580, 2488, 2488, 2488, 2594, 2594, 2594, 1177,
+     2595, 1176, 1175, 2596, 2597, 2597, 2597, 2599, 2599, 2599,
+     2489, 2492, 2492, 2492, 2494, 2494, 2494, 2601, 2601, 2601,
+     1174, 2598, 1173, 1172, 2600, 2499, 2499, 2499, 1171, 2493,
+     2503, 2503, 2503, 1170, 1169, 2602, 2592, 2593, 2611, 2611,
+     2611, 1168, 1167, 2500, 2508, 2508, 2508, 1166, 2509, 1165,
+     1158, 2510, 1227, 1227, 1227, 2612, 2537, 2537, 2537, 1258,
+
+     1258, 1258, 2542, 2542, 2542, 1157, 2543, 1156, 1155, 2544,
+     1229, 2545, 2545, 2545, 2650, 2650, 2650, 1260, 2551, 2551,
+     2551, 2652, 2652, 2652, 1154, 2653, 1153, 1152, 2654, 2546,
+     1149, 2651, 2655, 2655, 2655, 2552, 2660, 2660, 2660, 2559,
+     2559, 2559, 1147, 2560, 1146, 1144, 2561, 2563, 2563, 2563,
+     2656, 1142, 2630, 2661, 2664, 2664, 2664, 1139, 2665, 1135,
+     1133, 2666, 1132, 1131, 2564, 2668, 2668, 2668, 1129, 1128,
+     2647, 2567, 2567, 2567, 2670, 2670, 2670, 1127, 2671, 1126,
+     1125, 2672, 2669, 2673, 2673, 2673, 1124, 1122, 2568, 2570,
+     2570, 2570, 1121, 2571, 1120, 1119, 2572, 2573, 2573, 2573,
+
+     2674, 2575, 2575, 2575, 1117, 2576, 1116, 1115, 2577, 3322,
+     3322, 3322, 3322, 3322, 3322, 2574, 3322, 3322, 3322, 2583,
+     2583, 2583, 1111, 2678, 2678, 2678, 3322, 2679, 1110, 3322,
+     2680, 1108, 1107, 3322, 1106, 1105, 2584, 2681, 2681, 2681,
+     2683, 2683, 2683, 2587, 2587, 2587, 1104, 2588, 1103, 1101,
+     2589, 2590, 2590, 2590, 2682, 1100, 1099, 2684, 1432, 1432,
+     1432, 1098, 1096, 2676, 2675, 1442, 1442, 1442, 1095, 2591,
+     1094, 2677, 1091, 2594, 2594, 2594, 1434, 2595, 1090, 1088,
+     2596, 1085, 1084, 1444, 2597, 2597, 2597, 2693, 2693, 2693,
+     1080, 2694, 1079, 1077, 2695, 2599, 2599, 2599, 2696, 2696,
+
+     2696, 2598, 2697, 1076, 1075, 2698, 1072, 2601, 2601, 2601,
+     1071, 1070, 2600, 2703, 2703, 2703, 2611, 2611, 2611, 1227,
+     1227, 1227, 1069, 1067, 2691, 2602, 2692, 2707, 2707, 2707,
+     1066, 2708, 1065, 2612, 2709, 1064, 1063, 1229, 2741, 2741,
+     2741, 2743, 2743, 2743, 1258, 1258, 1258, 2746, 2746, 2746,
+     2748, 2748, 2748, 1058, 2650, 2650, 2650, 1056, 2744, 2751,
+     2751, 2751, 1260, 2752, 2747, 1055, 2753, 2749, 1054, 1053,
+     2727, 2651, 2652, 2652, 2652, 1052, 2653, 1051, 1050, 2654,
+     2655, 2655, 2655, 2756, 2756, 2756, 2660, 2660, 2660, 1049,
+     2758, 2758, 2758, 1048, 2759, 1047, 2750, 2760, 2656, 1044,
+
+     2757, 1041, 1040, 2661, 1039, 1033, 2745, 2761, 2761, 2761,
+     2664, 2664, 2664, 1032, 2665, 1030, 1027, 2666, 2668, 2668,
+     2668, 2765, 2765, 2765, 2762, 2766, 1025, 1024, 2767, 2670,
+     2670, 2670, 1023, 2671, 1018, 2669, 2672, 2673, 2673, 2673,
+     2768, 2768, 2768, 1017, 2769, 1015, 1014, 2770, 3322, 3322,
+     3322, 2772, 2772, 2772, 2674, 3322, 3322, 3322, 1013, 2678,
+     2678, 2678, 1011, 2679, 1010, 3322, 2680, 1009, 2773, 2681,
+     2681, 2681, 3322, 2775, 2775, 2775, 1007, 2776, 1004, 1003,
+     2777, 2683, 2683, 2683, 1001, 1000, 2682, 2778, 2778, 2778,
+      997, 2779,  992,  991, 2780, 1432, 1432, 1432, 2684, 1442,
+
+     1442, 1442,  988,  987, 2774,  986, 2771, 2693, 2693, 2693,
+      983, 2694,  982, 1434, 2695,  980,  977, 1444, 2696, 2696,
+     2696,  975, 2697,  974,  973, 2698, 2795, 2795, 2795, 2703,
+     2703, 2703, 2798, 2798, 2798, 2707, 2707, 2707,  972, 2708,
+      970,  969, 2709, 2796, 1689,  968, 2787, 2809, 2809, 2809,
+     1227, 1227, 1227, 2741, 2741, 2741, 2833, 2833, 2833, 2743,
+     2743, 2743,  967,  966, 2810,  965, 2788,  962, 1229,  961,
+     2834, 2834, 2834,  960, 2835,  957, 2744, 2836, 1258, 1258,
+     1258, 2746, 2746, 2746, 2838, 2838, 2838,  954, 2839,  953,
+      951, 2840, 2748, 2748, 2748,  950, 1260,  947, 2747, 2819,
+
+     2841, 2841, 2841,  944, 2842,  941,  940, 2843,  932, 2749,
+     2751, 2751, 2751,  931, 2752,  930,  929, 2753, 2756, 2756,
+     2756, 2847, 2847, 2847,  923, 2848,  922,  921, 2849, 2837,
+     2758, 2758, 2758,  919, 2759, 2757,  918, 2760, 2761, 2761,
+     2761, 2850, 2850, 2850,  917, 2851,  916,  915, 2852, 2765,
+     2765, 2765,  914, 2766,  909, 2762, 2767, 2768, 2768, 2768,
+      906, 2769,  908,  903, 2770, 3322, 3322, 3322, 2772, 2772,
+     2772, 2856, 2856, 2856,  902, 2857,  900,  898, 2858, 3322,
+     3322, 3322, 3322,  896,  894, 2773, 2775, 2775, 2775,  892,
+     2776,  889,  888, 2777,  887,  886, 3322, 2778, 2778, 2778,
+
+      885, 2779,  883,  881, 2780, 2874, 2874, 2874, 1442, 1442,
+     1442, 2882, 2882, 2882,  880,  879, 2855, 2795, 2795, 2795,
+     2884, 2884, 2884, 2875, 2885,  877, 1444, 2886, 2883, 1689,
+     2887, 2887, 2887,  875, 2796, 1689,  874,  872, 1689, 2798,
+     2798, 2798, 2888, 2888, 2888, 2889, 2889, 2889,  870,  869,
+     2859, 2809, 2809, 2809, 2898, 2898, 2898,  867, 2899,  863,
+      862, 2900, 1227, 1227, 1227, 2916, 2916, 2916, 2810, 2833,
+     2833, 2833,  860,  855, 2876, 2834, 2834, 2834,  853, 2835,
+     1229,  849, 2836, 2917, 2917, 2917, 2838, 2838, 2838,  848,
+     2839,  847,  845, 2840,  843, 2841, 2841, 2841,  842, 2842,
+
+      841, 2918, 2843, 2847, 2847, 2847,  839, 2848,  837,  836,
+     2849, 2850, 2850, 2850,  834, 2851,  832,  831, 2852, 2922,
+     2922, 2922, 2925, 2925, 2925, 2856, 2856, 2856, 2907, 2857,
+      830,  829, 2858, 2927, 2927, 2927, 2923,  828,  827, 2926,
+     2874, 2874, 2874, 1442, 1442, 1442, 2882, 2882, 2882,  826,
+     2928,  824, 2947, 2947, 2947,  822, 2948,  821, 2875, 2949,
+      818, 1444,  817, 2883, 1689, 2884, 2884, 2884,  816, 2885,
+     1689,  814, 2886, 2887, 2887, 2887, 2888, 2888, 2888, 2889,
+     2889, 2889,  802, 1689, 2898, 2898, 2898,  801, 2899,  798,
+      796, 2900,  794,  793, 2941, 1687, 1687, 1687, 1687, 1687,
+
+     1687, 1687, 1687, 1687,  792,  790, 1687, 2966, 2966, 2966,
+      788, 1687, 1687, 1687, 1689, 1687, 2916, 2916, 2916, 2917,
+     2917, 2917, 2922, 2922, 2922, 2967, 2977, 2977, 2977,  786,
+     2978,  783,  780, 2979, 2925, 2925, 2925, 2918,  779, 2923,
+     1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
+     1687, 2926,  778, 1687, 2927, 2927, 2927,  776, 1687, 1687,
+     1687, 1689, 1687, 2981, 2981, 2981,  774, 2982,  773,  771,
+     2983, 2928, 2984, 2984, 2984,  769, 2985,  768,  766, 2986,
+     2999, 2999, 2999, 2966, 2966, 2966,  764, 1687, 1687, 2947,
+     2947, 2947,  763, 2948,  762,  760, 2949,  758, 3000,  757,
+
+      756, 2967, 2999, 2999, 2999,  755,  753, 1689, 1687, 1687,
+     1687, 1687, 1687, 3011, 1687, 1687, 1687, 3322,  700, 1687,
+     3000,  733,  732,  730, 1687, 1687, 1687, 1689, 1687, 2977,
+     2977, 2977,  728, 2978,  727,  726, 2979, 2981, 2981, 2981,
+      724, 2982,  720,  716, 2983, 2984, 2984, 2984,  715, 2985,
+      713,  712, 2986, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
+     1687, 1687, 1687, 3011,  709,  708, 1687, 3048, 3048, 3048,
+      707, 1687, 1687, 1687, 1689, 1687, 3057, 3057, 3057, 3059,
+     3059, 3059, 3061, 3061, 3061, 1689, 1690, 3069, 3069, 3069,
+     3079, 3079, 3079, 3058,  705,  704, 3060,  703,  701, 3062,
+
+     1687, 1687,  696, 3322, 3070, 3048, 3048, 3048, 1146, 3057,
+     3057, 3057, 3087, 3087, 3087,  676, 3088,  674,  672, 3089,
+     3059, 3059, 3059, 1689,  666,  665, 3058, 3090, 3090, 3090,
+      666, 3091,  665,  664, 3092,  663, 3322, 3060, 3061, 3061,
+     3061, 3093, 3093, 3093, 3322, 3094, 3322, 3322, 3095, 3069,
+     3069, 3069, 3079, 3079, 3079, 3062, 1886, 3102, 3102, 3102,
+     3322, 3103, 3322, 3322, 3104, 3322, 3070, 3087, 3087, 3087,
+     1146, 3088, 3322, 3322, 3089, 3090, 3090, 3090, 3322, 3091,
+     3322, 3322, 3092, 3093, 3093, 3093, 3322, 3094, 3322, 3113,
+     3095, 3102, 3102, 3102, 3322, 3103, 3322, 3322, 3104, 3218,
+
+     3218, 3218, 3218, 3218, 3218, 3322, 3227, 3322, 3322, 3228,
+     3320, 3320, 3320, 3320, 3320, 3320, 3322, 1146, 3322, 3322,
+     1146, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3321, 3322,
+     3322, 3321,  260,  260,  260,  260,  260,  260,  260,  260,
+      260,  261,  261,  261,  261,  261,  261,  261,  261,  261,
+      266,  266,  266,  266,  266,  266,  266,  266,  266,  269,
+      269,  269,  269,  269,  269,  269,  269,  269,  272,  272,
+      272,  272,  272,  272,  272,  272,  272,  275,  275,  275,
+      275,  275,  275,  275,  275,  275,  282,  282,  282,  282,
+      282,  282,  282,  282,  282,  290,  290,  290,  290,  290,
+
+      290,  290,  290,  290,  294,  294,  294,  294,  294,  294,
+      294,  294,  294,  306,  306,  306,  306,  306,  306,  306,
+      306,  306,  310,  310,  310,  310,  310,  310,  310,  310,
+      310,  317,  317,  317,  317,  317,  317,  317,  317,  317,
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  336,
+      336,  336,  336,  336,  336,  336,  336,  336,  342,  342,
+      342,  342,  342,  342,  342,  342,  342,  348,  348,  348,
+      348,  348,  348,  348,  348,  348,  354,  354,  354,  354,
+      354,  354,  354,  354,  354,  359,  359,  359,  359,  359,
+      359,  359,  359,  359,  378,  378,  378,  378,  378,  378,
+
+      378,  378,  378,  385,  385,  385,  385,  385,  385,  385,
+      385,  385,  392,  392,  392,  392,  392,  392,  392,  392,
+      392,  398,  398,  398,  398,  398,  398,  398,  398,  398,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  410,
+      410,  410,  410,  410,  410,  410,  410,  410,  416,  416,
+      416,  416,  416,  416,  416,  416,  416,  421,  421,  421,
+      421,  421,  421,  421,  421,  421,  427,  427,  427,  427,
+      427,  427,  427,  427,  427,  435,  435,  435,  435,  435,
+      435,  435,  435,  435,  443,  443,  443,  443,  443,  443,
+      443,  443,  443,  447,  447,  447,  447,  447,  447,  447,
+
+      447,  447,  453,  453,  453,  453,  453,  453,  453,  453,
+      453,  459,  459,  459,  459,  459,  459,  459,  459,  459,
+      476,  476,  476,  476,  476,  476,  476,  476,  476,  483,
+      483,  483,  483,  483,  483,  483,  483,  483,  492,  492,
+      492,  492,  492,  492,  492,  492,  492,  498,  498,  498,
+      498,  498,  498,  498,  498,  498,  508,  508,  508,  508,
+      508,  508,  508,  508,  508,  514,  514,  514,  514,  514,
+      514,  514,  514,  514,  519,  519,  519,  519,  519,  519,
+      519,  519,  519,  525,  525,  525,  525,  525,  525,  525,
+      525,  525,  531,  531,  531,  531,  531,  531,  531,  531,
+
+      531,  537,  537,  537,  537,  537,  537,  537,  537,  537,
+      544,  544,  544,  544,  544,  544,  544,  544,  544,  551,
+      551,  551,  551,  551,  551,  551,  551,  551,  556,  556,
+      556,  556,  556,  556,  556,  556,  556,  564,  564,  564,
+      564,  564,  564,  564,  564,  564,  570,  570,  570,  570,
+      570,  570,  570,  570,  570,  577,  577,  577,  577,  577,
+      577,  577,  577,  577,  582,  582,  582,  582,  582,  582,
+      582,  582,  582,  588,  588,  588,  588,  588,  588,  588,
+      588,  588,  593,  593,  593,  593,  593,  593,  593,  593,
+      593,  600,  600,  600,  600,  600,  600,  600,  600,  600,
+
+      606,  606,  606,  606,  606,  606,  606,  606,  606,  613,
+      613,  613,  613,  613,  613,  613,  613,  613,  621,  621,
+      621,  621,  621,  621,  621,  621,  621,  629,  629,  629,
+      629,  629,  629,  629,  629,  629,  633,  633,  633,  633,
+      633,  633,  633,  633,  633,  639,  639,  639,  639,  639,
+      639,  639,  639,  639,  643,  643,  643,  643,  643,  643,
+      643,  643,  643,  650,  650,  650,  650,  650,  650,  650,
+      650,  650,  655,  655,  655,  655,  655,  655,  655,  655,
+      655,  675,  675,  675, 3322, 3322, 3322,  675,  702,  702,
+      702, 3322, 3322, 3322,  702,  706,  706,  706, 3322, 3322,
+
+     3322,  706,  714,  714,  714, 3322, 3322, 3322,  714,  725,
+      725,  725, 3322, 3322, 3322,  725,  731,  731,  731, 3322,
+     3322, 3322,  731,  754,  754,  754, 3322, 3322, 3322,  754,
+      761,  761,  761, 3322, 3322, 3322,  761,  767,  767,  767,
+     3322, 3322, 3322,  767,  772,  772,  772, 3322, 3322, 3322,
+      772,  777,  777,  777, 3322, 3322, 3322,  777,  787,  787,
+      787, 3322, 3322, 3322,  787,  791,  791,  791, 3322, 3322,
+     3322,  791,  797,  797,  797, 3322, 3322, 3322,  797,  815,
+      815,  815, 3322, 3322, 3322,  815,  825,  825,  825, 3322,
+     3322, 3322,  825,  835,  835,  835, 3322, 3322, 3322,  835,
+
+      840,  840,  840, 3322, 3322, 3322,  840,  846,  846,  846,
+     3322, 3322, 3322,  846,  854,  854,  854, 3322, 3322, 3322,
+      854,  861,  861,  861, 3322, 3322, 3322,  861,  868,  868,
+      868, 3322, 3322, 3322,  868,  873,  873,  873, 3322, 3322,
+     3322,  873,  878,  878,  878, 3322, 3322, 3322,  878,  884,
+      884,  884, 3322, 3322, 3322,  884,  893,  893,  893, 3322,
+     3322, 3322,  893,  897,  897,  897, 3322, 3322, 3322,  897,
+      901,  901,  901, 3322, 3322, 3322,  901,  905,  905,  905,
+      905,  905,  905,  905, 3322,  905,  675,  675,  675, 3322,
+     3322, 3322,  675,  920, 3322, 3322, 3322,  920,  702,  702,
+
+      702, 3322, 3322, 3322,  702,  952, 3322, 3322, 3322,  952,
+      706,  706,  706, 3322, 3322, 3322,  706,  959, 3322, 3322,
+     3322,  959,  714,  714,  714, 3322, 3322, 3322,  714,  971,
+     3322, 3322, 3322,  971,  725,  725,  725, 3322, 3322, 3322,
+      725,  976, 3322, 3322, 3322,  976,  731,  731,  731, 3322,
+     3322, 3322,  731,  981, 3322, 3322, 3322,  981,  754,  754,
+      754, 3322, 3322, 3322,  754, 1002, 3322, 3322, 3322, 1002,
+      761,  761,  761, 3322, 3322, 3322,  761, 1008, 3322, 3322,
+     3322, 1008,  767,  767,  767, 3322, 3322, 3322,  767, 1012,
+     3322, 3322, 3322, 1012,  772,  772,  772, 3322, 3322, 3322,
+
+      772, 1016, 3322, 3322, 3322, 1016,  777,  777,  777, 3322,
+     3322, 3322,  777, 1026, 3322, 3322, 3322, 1026,  787,  787,
+      787, 3322, 3322, 3322,  787, 1031, 3322, 3322, 3322, 1031,
+      791,  791,  791, 3322, 3322, 3322,  791, 1038, 3322, 3322,
+     3322, 1038,  797,  797,  797, 3322, 3322, 3322,  797, 1057,
+     3322, 3322, 3322, 1057,  815,  815,  815, 3322, 3322, 3322,
+      815, 1068, 3322, 3322, 3322, 1068,  825,  825,  825, 3322,
+     3322, 3322,  825, 1078, 3322, 3322, 3322, 1078,  835,  835,
+      835, 3322, 3322, 3322,  835, 1083, 3322, 3322, 3322, 1083,
+      840,  840,  840, 3322, 3322, 3322,  840, 1089, 3322, 3322,
+
+     3322, 1089,  846,  846,  846, 3322, 3322, 3322,  846, 1097,
+     3322, 3322, 3322, 1097,  854,  854,  854, 3322, 3322, 3322,
+      854, 1102, 3322, 3322, 3322, 1102,  861,  861,  861, 3322,
+     3322, 3322,  861, 1109, 3322, 3322, 3322, 1109,  868,  868,
+      868, 3322, 3322, 3322,  868, 1114, 3322, 3322, 3322, 1114,
+      873,  873,  873, 3322, 3322, 3322,  873, 1118, 3322, 3322,
+     3322, 1118,  878,  878,  878, 3322, 3322, 3322,  878, 1123,
+     3322, 3322, 3322, 1123,  884,  884,  884, 3322, 3322, 3322,
+      884, 1130, 3322, 3322, 3322, 1130,  893,  893,  893, 3322,
+     3322, 3322,  893, 1134, 3322, 3322, 3322, 1134,  897,  897,
+
+      897, 3322, 3322, 3322,  897, 1138, 3322, 3322, 3322, 1138,
+      901,  901,  901, 3322, 3322, 3322,  901, 1143, 3322, 3322,
+     3322, 1143, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145,
+     1145, 1151, 3322, 3322, 3322, 3322, 1151,  675,  675,  675,
+     3322, 3322, 3322,  675, 1160, 1160, 1160, 1160, 3322, 3322,
+     1160, 1160,  702,  702,  702, 3322, 3322, 3322,  702, 1195,
+     1195, 1195, 1195, 3322, 3322, 1195, 1195,  706,  706,  706,
+     3322, 3322, 3322,  706, 1205, 1205, 1205, 1205, 3322, 3322,
+     1205, 1205,  714,  714,  714, 3322, 3322, 3322,  714, 1221,
+     1221, 1221, 1221, 3322, 3322, 1221, 1221,  725,  725,  725,
+
+     3322, 3322, 3322,  725, 1228, 1228, 1228, 1228, 3322, 3322,
+     1228, 1228,  731,  731,  731, 3322, 3322, 3322,  731, 1236,
+     1236, 1236, 1236, 3322, 3322, 1236, 1236,  754,  754,  754,
+     3322, 3322, 3322,  754, 1259, 1259, 1259, 1259, 3322, 3322,
+     1259, 1259,  761,  761,  761, 3322, 3322, 3322,  761, 1268,
+     1268, 1268, 1268, 3322, 3322, 1268, 1268,  767,  767,  767,
+     3322, 3322, 3322,  767, 1274, 1274, 1274, 1274, 3322, 3322,
+     1274, 1274,  772,  772,  772, 3322, 3322, 3322,  772, 1280,
+     1280, 1280, 1280, 3322, 3322, 1280, 1280,  777,  777,  777,
+     3322, 3322, 3322,  777, 1293, 1293, 1293, 1293, 3322, 3322,
+
+     1293, 1293,  787,  787,  787, 3322, 3322, 3322,  787, 1300,
+     1300, 1300, 1300, 3322, 3322, 1300, 1300,  791,  791,  791,
+     3322, 3322, 3322,  791, 1311, 1311, 1311, 1311, 3322, 3322,
+     1311, 1311,  797,  797,  797, 3322, 3322, 3322,  797, 1337,
+     1337, 1337, 1337, 3322, 3322, 1337, 1337,  815,  815,  815,
+      815, 3322,  815, 3322,  815, 1353, 1353, 1353, 1353, 3322,
+     3322, 1353, 1353,  825,  825,  825, 3322, 3322, 3322,  825,
+     1368, 1368, 1368, 1368, 3322, 3322, 1368, 1368,  835,  835,
+      835, 3322, 3322, 3322,  835, 1376, 1376, 1376, 1376, 3322,
+     3322, 1376, 1376,  840,  840,  840, 3322, 3322, 3322,  840,
+
+     1385, 1385, 1385, 1385, 3322, 3322, 1385, 1385,  846,  846,
+      846, 3322, 3322, 3322,  846, 1396, 1396, 1396, 1396, 3322,
+     3322, 1396, 1396,  854,  854,  854,  854, 3322,  854, 3322,
+      854, 1405, 1405, 1405, 1405, 3322, 3322, 1405, 1405,  861,
+      861,  861,  861, 3322,  861, 3322,  861, 1417, 1417, 1417,
+     1417, 3322, 3322, 1417, 1417,  868,  868,  868, 3322, 3322,
+     3322,  868, 1425, 1425, 1425, 1425, 3322, 3322, 1425, 1425,
+      873,  873,  873,  873, 3322,  873, 3322,  873, 1433, 1433,
+     1433, 1433, 3322, 3322, 1433, 1433,  878,  878,  878,  878,
+     3322,  878, 3322,  878, 1443, 1443, 1443, 1443, 3322, 3322,
+
+     1443, 1443,  884,  884,  884, 3322, 3322, 3322,  884, 1452,
+     1452, 1452, 1452, 3322, 3322, 1452, 1452,  893,  893,  893,
+     3322, 3322, 3322,  893, 1458, 1458, 1458, 1458, 3322, 3322,
+     1458, 1458, 1465, 1465, 1465, 1465, 3322, 3322, 1465, 1465,
+      901,  901,  901, 3322, 3322, 3322,  901, 1473, 1473, 1473,
+     1473, 3322, 3322, 1473, 1473, 1145, 1145, 1145, 1145, 1145,
+     1145, 1145, 1145, 1145, 1151, 3322, 1151, 3322, 3322, 1151,
+      675,  675,  675, 3322, 3322, 3322,  675, 1160, 1160, 1160,
+     1160, 3322, 3322, 1160, 1160,  702,  702,  702,  702, 3322,
+      702, 3322,  702, 1195, 1195, 1195, 1195, 3322, 3322, 1195,
+
+     1195,  706,  706,  706,  706, 3322,  706, 3322,  706, 1205,
+     1205, 1205, 1205, 3322, 3322, 1205, 1205,  714,  714,  714,
+     3322, 3322, 3322,  714, 1221, 1221, 1221, 1221, 3322, 3322,
+     1221, 1221,  725,  725,  725, 3322, 3322, 3322,  725, 1228,
+     1228, 1228, 1228, 3322, 3322, 1228, 1228,  731,  731,  731,
+     3322, 3322, 3322,  731, 1236, 1236, 1236, 1236, 3322, 3322,
+     1236, 1236,  754,  754,  754, 3322, 3322, 3322,  754, 1259,
+     1259, 1259, 1259, 3322, 3322, 1259, 1259,  761,  761,  761,
+     3322, 3322, 3322,  761, 1268, 1268, 1268, 1268, 3322, 3322,
+     1268, 1268,  767,  767,  767,  767, 3322,  767, 3322,  767,
+
+     1274, 1274, 1274, 1274, 3322, 3322, 1274, 1274,  772,  772,
+      772,  772, 3322,  772, 3322,  772, 1280, 1280, 1280, 1280,
+     3322, 3322, 1280, 1280,  777,  777,  777, 3322, 3322, 3322,
+      777, 1293, 1293, 1293, 1293, 3322, 3322, 1293, 1293,  787,
+      787,  787,  787, 3322,  787, 3322,  787, 1300, 1300, 1300,
+     1300, 3322, 3322, 1300, 1300,  791,  791,  791,  791, 3322,
+      791, 3322,  791, 1311, 1311, 1311, 1311, 3322, 3322, 1311,
+     1311,  797,  797,  797, 3322, 3322, 3322,  797, 1337, 1337,
+     1337, 1337, 3322, 3322, 1337, 1337,  815,  815,  815, 3322,
+     3322, 3322,  815, 1353, 1353, 1353, 1353, 3322, 3322, 1353,
+
+     1353,  825,  825,  825, 3322, 3322, 3322,  825, 1368, 1368,
+     1368, 1368, 3322, 3322, 1368, 1368,  835,  835,  835, 3322,
+     3322, 3322,  835, 1376, 1376, 1376, 1376, 3322, 3322, 1376,
+     1376,  840,  840,  840, 3322, 3322, 3322,  840, 1385, 1385,
+     1385, 1385, 3322, 3322, 1385, 1385,  846,  846,  846, 3322,
+     3322, 3322,  846, 1396, 1396, 1396, 1396, 3322, 3322, 1396,
+     1396,  854,  854,  854, 3322, 3322, 3322,  854, 1405, 1405,
+     1405, 1405, 3322, 3322, 1405, 1405,  861,  861,  861, 3322,
+     3322, 3322,  861, 1417, 1417, 1417, 1417, 3322, 3322, 1417,
+     1417,  868,  868,  868, 3322, 3322, 3322,  868, 1425, 1425,
+
+     1425, 1425, 3322, 3322, 1425, 1425, 1433, 1433, 1433, 1433,
+     3322, 3322, 1433, 1433,  878,  878,  878, 3322, 3322, 3322,
+      878, 1443, 1443, 1443, 1443, 3322, 3322, 1443, 1443,  884,
+      884,  884, 3322, 3322, 3322,  884, 1452, 1452, 1452, 1452,
+     3322, 3322, 1452, 1452,  893,  893,  893, 3322, 3322, 3322,
+      893, 1458, 1458, 1458, 1458, 3322, 3322, 1458, 1458, 1465,
+     1465, 1465, 1465, 3322, 3322, 1465, 1465,  901,  901,  901,
+     3322, 3322, 3322,  901, 1473, 1473, 1473, 1473, 3322, 3322,
+     1473, 1473, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145,
+     1145, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
+
+      675,  675,  675, 3322, 3322, 3322,  675, 1160, 1160, 1160,
+     1160, 3322, 3322, 1160, 1160, 1195, 1195, 1195, 1195, 3322,
+     3322, 1195, 1195,  706,  706,  706, 3322, 3322, 3322,  706,
+     1205, 1205, 1205, 1205, 3322, 3322, 1205, 1205,  714,  714,
+      714, 3322, 3322, 3322,  714, 1221, 1221, 1221, 1221, 3322,
+     3322, 1221, 1221,  725,  725,  725, 3322, 3322, 3322,  725,
+     1228, 1228, 1228, 1228, 3322, 3322, 1228, 1228,  731,  731,
+      731, 3322, 3322, 3322,  731,  754,  754,  754, 3322, 3322,
+     3322,  754, 1259, 1259, 1259, 1259, 3322, 3322, 1259, 1259,
+      761,  761,  761, 3322, 3322, 3322,  761, 1268, 1268, 1268,
+
+     1268, 3322, 3322, 1268, 1268,  767,  767,  767, 3322, 3322,
+     3322,  767, 1274, 1274, 1274, 1274, 3322, 3322, 1274, 1274,
+      772,  772,  772, 3322, 3322, 3322,  772, 1280, 1280, 1280,
+     1280, 3322, 3322, 1280, 1280,  777,  777,  777, 3322, 3322,
+     3322,  777, 1293, 1293, 1293, 1293, 3322, 3322, 1293, 1293,
+     1300, 1300, 1300, 1300, 3322, 3322, 1300, 1300, 1311, 1311,
+     1311, 1311, 3322, 3322, 1311, 1311,  797,  797,  797, 3322,
+     3322, 3322,  797, 1337, 1337, 1337, 1337, 3322, 3322, 1337,
+     1337,  815,  815,  815,  815, 3322,  815, 3322,  815, 1353,
+     1353, 1353, 1353, 3322, 3322, 1353, 1353,  825,  825,  825,
+
+     3322, 3322, 3322,  825, 1368, 1368, 1368, 1368, 3322, 3322,
+     1368, 1368,  835,  835,  835, 3322, 3322, 3322,  835, 1376,
+     1376, 1376, 1376, 3322, 3322, 1376, 1376,  840,  840,  840,
+     3322, 3322, 3322,  840, 1385, 1385, 1385, 1385, 3322, 3322,
+     1385, 1385,  846,  846,  846, 3322, 3322, 3322,  846, 1396,
+     1396, 1396, 1396, 3322, 3322, 1396, 1396,  854,  854,  854,
+     3322, 3322, 3322,  854, 1405, 1405, 1405, 1405, 3322, 3322,
+     1405, 1405,  861,  861,  861, 3322, 3322, 3322,  861, 1417,
+     1417, 1417, 1417, 3322, 3322, 1417, 1417,  868,  868,  868,
+     3322, 3322, 3322,  868, 1425, 1425, 1425, 1425, 3322, 3322,
+
+     1425, 1425, 1433, 1433, 1433, 1433, 3322, 3322, 1433, 1433,
+      878,  878,  878, 3322, 3322, 3322,  878, 1443, 1443, 1443,
+     1443, 3322, 3322, 1443, 1443,  884,  884,  884, 3322, 3322,
+     3322,  884, 1452, 1452, 1452, 1452, 3322, 3322, 1452, 1452,
+      893,  893,  893,  893, 3322,  893, 3322,  893, 1458, 1458,
+     1458, 1458, 3322, 3322, 1458, 1458, 1465, 1465, 1465, 1465,
+     3322, 3322, 1465, 1465,  901,  901,  901,  901, 3322,  901,
+     3322,  901, 1473, 1473, 1473, 1473, 3322, 3322, 1473, 1473,
+     1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1687,
+     1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,  675,  675,
+
+      675, 3322, 3322, 3322,  675, 1160, 1160, 1160, 1160, 3322,
+     3322, 1160, 1160, 1195, 1195, 1195, 1195, 3322, 3322, 1195,
+     1195,  706,  706,  706, 3322, 3322, 3322,  706, 1205, 1205,
+     1205, 1205, 3322, 3322, 1205, 1205,  714,  714,  714, 3322,
+     3322, 3322,  714, 1221, 1221, 1221, 1221, 3322, 3322, 1221,
+     1221,  725,  725,  725, 3322, 3322, 3322,  725, 1228, 1228,
+     1228, 1228, 3322, 3322, 1228, 1228,  731,  731,  731, 3322,
+     3322, 3322,  731,  754,  754,  754, 3322, 3322, 3322,  754,
+     1259, 1259, 1259, 1259, 3322, 3322, 1259, 1259,  761,  761,
+      761, 3322, 3322, 3322,  761, 1268, 1268, 1268, 1268, 3322,
+
+     3322, 1268, 1268,  767,  767,  767, 3322, 3322, 3322,  767,
+     1274, 1274, 1274, 1274, 3322, 3322, 1274, 1274,  772,  772,
+      772,  772, 3322,  772, 3322,  772, 1280, 1280, 1280, 1280,
+     3322, 3322, 1280, 1280,  777,  777,  777, 3322, 3322, 3322,
+      777, 1293, 1293, 1293, 1293, 3322, 3322, 1293, 1293, 1311,
+     1311, 1311, 1311, 3322, 3322, 1311, 1311,  797,  797,  797,
+     3322, 3322, 3322,  797, 1337, 1337, 1337, 1337, 3322, 3322,
+     1337, 1337,  815,  815,  815,  815, 3322,  815, 3322,  815,
+     1353, 1353, 1353, 1353, 3322, 3322, 1353, 1353,  825,  825,
+      825, 3322, 3322, 3322,  825, 1368, 1368, 1368, 1368, 3322,
+
+     3322, 1368, 1368,  835,  835,  835, 3322, 3322, 3322,  835,
+     1376, 1376, 1376, 1376, 3322, 3322, 1376, 1376,  840,  840,
+      840, 3322, 3322, 3322,  840, 1385, 1385, 1385, 1385, 3322,
+     3322, 1385, 1385,  846,  846,  846, 3322, 3322, 3322,  846,
+     1396, 1396, 1396, 1396, 3322, 3322, 1396, 1396,  854,  854,
+      854, 3322, 3322, 3322,  854, 1405, 1405, 1405, 1405, 3322,
+     3322, 1405, 1405,  861,  861,  861,  861, 3322,  861, 3322,
+      861, 1417, 1417, 1417, 1417, 3322, 3322, 1417, 1417,  868,
+      868,  868, 3322, 3322, 3322,  868, 1425, 1425, 1425, 1425,
+     3322, 3322, 1425, 1425, 1433, 1433, 1433, 1433, 3322, 3322,
+
+     1433, 1433,  878,  878,  878,  878, 3322,  878, 3322,  878,
+     1443, 1443, 1443, 1443, 3322, 3322, 1443, 1443,  884,  884,
+      884, 3322, 3322, 3322,  884, 1452, 1452, 1452, 1452, 3322,
+     3322, 1452, 1452, 1458, 1458, 1458, 1458, 3322, 3322, 1458,
+     1458, 1465, 1465, 1465, 1465, 3322, 3322, 1465, 1465, 1473,
+     1473, 1473, 1473, 3322, 3322, 1473, 1473, 1145, 1145, 1145,
+     1145, 1145, 1145, 1145, 1145, 1145, 1687, 1687, 1687, 1687,
+     1687, 1687, 1687, 1687, 1687,  675,  675,  675,  675, 3322,
+      675, 3322,  675, 1160, 1160, 1160, 1160, 3322, 3322, 1160,
+     1160, 1195, 1195, 1195, 1195, 3322, 3322, 1195, 1195,  706,
+
+      706,  706, 3322, 3322, 3322,  706, 1205, 1205, 1205, 1205,
+     3322, 3322, 1205, 1205,  714,  714,  714, 3322, 3322, 3322,
+      714, 1221, 1221, 1221, 1221, 3322, 3322, 1221, 1221,  725,
+      725,  725,  725, 3322,  725, 3322,  725, 1228, 1228, 1228,
+     1228, 3322, 3322, 1228, 1228,  731,  731,  731,  731, 3322,
+      731, 3322,  731,  754,  754,  754,  754, 3322,  754, 3322,
+      754, 1259, 1259, 1259, 1259, 3322, 3322, 1259, 1259,  761,
+      761,  761,  761, 3322,  761, 3322,  761, 1268, 1268, 1268,
+     1268, 3322, 3322, 1268, 1268,  767,  767,  767, 3322, 3322,
+     3322,  767, 1274, 1274, 1274, 1274, 3322, 3322, 1274, 1274,
+
+     1280, 1280, 1280, 1280, 3322, 3322, 1280, 1280,  777,  777,
+      777, 3322, 3322, 3322,  777, 1311, 1311, 1311, 1311, 3322,
+     3322, 1311, 1311,  797,  797,  797, 3322, 3322, 3322,  797,
+     1337, 1337, 1337, 1337, 3322, 3322, 1337, 1337,  815,  815,
+      815,  815, 3322,  815, 3322,  815, 1353, 1353, 1353, 1353,
+     3322, 3322, 1353, 1353,  825,  825,  825, 3322, 3322, 3322,
+      825,  835,  835,  835, 3322, 3322, 3322,  835, 1376, 1376,
+     1376, 1376, 3322, 3322, 1376, 1376,  840,  840,  840, 3322,
+     3322, 3322,  840, 1385, 1385, 1385, 1385, 3322, 3322, 1385,
+     1385,  846,  846,  846, 3322, 3322, 3322,  846,  854,  854,
+
+      854, 3322, 3322, 3322,  854, 1405, 1405, 1405, 1405, 3322,
+     3322, 1405, 1405,  861,  861,  861, 3322, 3322, 3322,  861,
+     1417, 1417, 1417, 1417, 3322, 3322, 1417, 1417,  868,  868,
+      868, 3322, 3322, 3322,  868, 1425, 1425, 1425, 1425, 3322,
+     3322, 1425, 1425, 1433, 1433, 1433, 1433, 3322, 3322, 1433,
+     1433, 1443, 1443, 1443, 1443, 3322, 3322, 1443, 1443,  884,
+      884,  884, 3322, 3322, 3322,  884, 1452, 1452, 1452, 1452,
+     3322, 3322, 1452, 1452, 1458, 1458, 1458, 1458, 3322, 3322,
+     1458, 1458, 1465, 1465, 1465, 1465, 3322, 3322, 1465, 1465,
+     1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1687,
+
+     1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1160, 1160,
+     1160, 1160, 3322, 3322, 1160, 1160, 1195, 1195, 1195, 1195,
+     3322, 3322, 1195, 1195,  706,  706,  706, 3322, 3322, 3322,
+      706,  714,  714,  714, 3322, 3322, 3322,  714, 1221, 1221,
+     1221, 1221, 3322, 3322, 1221, 1221, 1228, 1228, 1228, 1228,
+     3322, 3322, 1228, 1228,  754,  754,  754, 3322, 3322, 3322,
+      754, 1259, 1259, 1259, 1259, 3322, 3322, 1259, 1259,  761,
+      761,  761, 3322, 3322, 3322,  761, 1268, 1268, 1268, 1268,
+     3322, 3322, 1268, 1268,  767,  767,  767, 3322, 3322, 3322,
+      767, 1280, 1280, 1280, 1280, 3322, 3322, 1280, 1280,  777,
+
+      777,  777, 3322, 3322, 3322,  777, 1311, 1311, 1311, 1311,
+     3322, 3322, 1311, 1311,  797,  797,  797, 3322, 3322, 3322,
+      797, 1337, 1337, 1337, 1337, 3322, 3322, 1337, 1337, 1353,
+     1353, 1353, 1353, 3322, 3322, 1353, 1353,  825,  825,  825,
+     3322, 3322, 3322,  825,  835,  835,  835, 3322, 3322, 3322,
+      835, 1376, 1376, 1376, 1376, 3322, 3322, 1376, 1376,  840,
+      840,  840, 3322, 3322, 3322,  840, 1385, 1385, 1385, 1385,
+     3322, 3322, 1385, 1385,  846,  846,  846, 3322, 3322, 3322,
+      846,  854,  854,  854, 3322, 3322, 3322,  854,  861,  861,
+      861, 3322, 3322, 3322,  861, 1417, 1417, 1417, 1417, 3322,
+
+     3322, 1417, 1417,  868,  868,  868, 3322, 3322, 3322,  868,
+     1425, 1425, 1425, 1425, 3322, 3322, 1425, 1425, 1433, 1433,
+     1433, 1433, 3322, 3322, 1433, 1433, 1443, 1443, 1443, 1443,
+     3322, 3322, 1443, 1443,  884,  884,  884,  884, 3322,  884,
+     3322,  884, 1452, 1452, 1452, 1452, 3322, 3322, 1452, 1452,
+     1458, 1458, 1458, 1458, 3322, 3322, 1458, 1458, 1465, 1465,
+     1465, 1465, 3322, 3322, 1465, 1465, 1145, 1145, 1145, 1145,
+     1145, 1145, 1145, 1145, 1145, 1687, 1687, 1687, 1687, 1687,
+     1687, 1687, 1687, 1687, 1160, 1160, 1160, 1160, 3322, 3322,
+     1160, 1160, 1195, 1195, 1195, 1195, 3322, 3322, 1195, 1195,
+
+      706,  706,  706, 3322, 3322, 3322,  706,  714,  714,  714,
+      714, 3322,  714, 3322,  714, 1228, 1228, 1228, 1228, 3322,
+     3322, 1228, 1228,  754,  754,  754, 3322, 3322, 3322,  754,
+     1259, 1259, 1259, 1259, 3322, 3322, 1259, 1259,  761,  761,
+      761, 3322, 3322, 3322,  761, 1268, 1268, 1268, 1268, 3322,
+     3322, 1268, 1268,  767,  767,  767,  767, 3322,  767, 3322,
+      767, 1280, 1280, 1280, 1280, 3322, 3322, 1280, 1280,  777,
+      777,  777, 3322, 3322, 3322,  777, 1311, 1311, 1311, 1311,
+     3322, 3322, 1311, 1311,  797,  797,  797, 3322, 3322, 3322,
+      797, 1337, 1337, 1337, 1337, 3322, 3322, 1337, 1337, 1353,
+
+     1353, 1353, 1353, 3322, 3322, 1353, 1353,  825,  825,  825,
+     3322, 3322, 3322,  825,  835,  835,  835, 3322, 3322, 3322,
+      835,  840,  840,  840,  840, 3322,  840, 3322,  840, 1385,
+     1385, 1385, 1385, 3322, 3322, 1385, 1385,  846,  846,  846,
+      846, 3322,  846, 3322,  846,  854,  854,  854, 3322, 3322,
+     3322,  854,  861,  861,  861, 3322, 3322, 3322,  861, 1417,
+     1417, 1417, 1417, 3322, 3322, 1417, 1417,  868,  868,  868,
+      868, 3322,  868, 3322,  868, 1425, 1425, 1425, 1425, 3322,
+     3322, 1425, 1425, 1433, 1433, 1433, 1433, 3322, 3322, 1433,
+     1433, 1443, 1443, 1443, 1443, 3322, 3322, 1443, 1443,  884,
+
+      884,  884,  884, 3322,  884, 3322,  884, 1452, 1452, 1452,
+     1452, 3322, 3322, 1452, 1452, 1458, 1458, 1458, 1458, 3322,
+     3322, 1458, 1458, 1145, 1145, 1145, 1145, 1145, 1145, 1145,
+     1145, 1145, 1687, 1687, 1687, 1687, 1687, 1687, 1687, 1687,
+     1687, 1160, 1160, 1160, 1160, 3322, 3322, 1160, 1160,  706,
+      706,  706, 3322, 3322, 3322,  706,  714,  714,  714, 3322,
+     3322, 3322,  714, 1228, 1228, 1228, 1228, 3322, 3322, 1228,
+     1228,  754,  754,  754, 3322, 3322, 3322,  754, 1259, 1259,
+     1259, 1259, 3322, 3322, 1259, 1259,  761,  761,  761, 3322,
+     3322, 3322,  761, 1280, 1280, 1280, 1280, 3322, 3322, 1280,
+
+     1280,  777,  777,  777, 3322, 3322, 3322,  777, 1311, 1311,
+     1311, 1311, 3322, 3322, 1311, 1311,  797,  797,  797, 3322,
+     3322, 3322,  797,  825,  825,  825, 3322, 3322, 3322,  825,
+      835,  835,  835, 3322, 3322, 3322,  835, 2950, 2950, 2950,
+     2950, 2950, 2950, 2950, 2950, 2950, 2951, 2951, 2951, 2951,
+     2951, 2951, 2951, 2951, 2951, 3006, 3006, 3006, 3006, 3006,
+     3006, 3006, 3006, 3006, 3009, 3009, 3009, 3009, 3009, 3009,
+     3009, 3009, 3009, 3045, 3045, 3045, 3045, 3045, 3045, 3045,
+     3045, 3045, 3047, 3047, 3047, 3047, 3047, 3047, 3047, 3047,
+     3047,  259, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322
     } ;
 
-static yyconst flex_int16_t yy_chk[12182] =
+static yyconst flex_int16_t yy_chk[12367] =
     {   0,
         0,    3,    3,    3,    4,    4,    4,    5,    5,    5,
         6,    6,    6,    7,    7,    7,   11,    3,    9,   12,
@@ -3009,10 +3046,10 @@ static yyconst flex_int16_t yy_chk[12182] =
         8,    8,    8,  264,   11,   13,   13,   12,   14,   14,
        13,   13,  313,   14,   14,  265,    8,   17,   17,  264,
        13,   15,   15,   14,   15,  268,   15,   16,   16,  367,
-       16,  265,   16,   18,   18, 1531,   15,   19,   19,   19,
+       16,  265,   16,   18,   18, 1513,   15,   19,   19,   19,
       543,  268,   16,   20,   20,   20,   23,   23,   23,   24,
-       24,   24,  543,   19,   25,   25,   25,  367, 1534,   20,
-      374,   17,   23, 1070,  313,   24,  262,  262,  262, 1070,
+       24,   24,  543,   19,   25,   25,   25,  367, 1519,   20,
+      374,   17,   23, 1071,  313,   24,  262,  262,  262, 1071,
 
        25,  263,  263,  263,  267,  267,  267,   18,   21,   21,
        21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
@@ -3023,7 +3060,7 @@ static yyconst flex_int16_t yy_chk[12182] =
        31,   31,  288,  288,  288,  291,  295,  295,  295,  304,
       304,  304,  307,  286,  363,   31,  680,   21,   22,   22,
        22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-       22,   22,   22, 1536,   22,   22,   22,   22,   22,   32,
+       22,   22,   22, 1520,   22,   22,   22,   22,   22,   32,
 
        32,   32,   33,   33,   33,   34,   34,   34,  278,   35,
        35,   35,   36,   36,   36,   32,  286,  366,   33,  489,
@@ -3037,1316 +3074,1336 @@ static yyconst flex_int16_t yy_chk[12182] =
       335,   43,   43,   43,   43,   43,   45,   45,   45,   46,
 
        46,   46,   47,   47,   47,  335,   48,   48,   48,   49,
-       49,   49,   45,  668,  560,   46,  668, 1541,   47,  333,
+       49,   49,   45,  433,  560,   46, 1522,  433,   47,  333,
        43,   43,   48,  333,  387,   49,  299,  333,   43,   44,
        44,   44,   44,   44,   44,   44,   44,   44,   44,   44,
        44,   44,   44,   44,  329,   44,   44,   44,   44,   44,
        50,   50,   50,   51,   51,   51,   52,   52,   52,  474,
       329,  573,   55,   55,  569,  299,   50,   55,  300,   51,
       560,  569,   52,  474,   44,   44,  387,   55,  299,  388,
-      299, 1544,   44,   53,   53,   53,   53,   53,   53,   53,
-       53,   53,   53,   53,   53,   53,   53,   53, 1545,   53,
+      299, 1531,   44,   53,   53,   53,   53,   53,   53,   53,
+       53,   53,   53,   53,   53,   53,   53,   53, 1534,   53,
 
-       53,   53,   53,   53, 1546,  343,   55,  300,   59,   59,
+       53,   53,   53,   53, 1536,  343,   55,  300,   59,   59,
        59,   60,   60,   60,   63,   63,   63,  573,   56,   56,
       300,  343,  300,   56,   59,  323,  472,   60,   53,   53,
-       63,  388,  323,   56,  472,  779,   53,  400,  779,   53,
-      472,  323,  337,  337,  337, 1551,   53,   54,   54,   54,
+       63,  388,  323,   56,  472,  668,   53,  400,  668,   53,
+      472,  323,  337,  337,  337, 1541,   53,   54,   54,   54,
        54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
        54,   54,   56,   54,   54,   54,   54,   54,   64,   64,
-       64,   67,   67,   67,   68,   68,   68, 1552,   69,   69,
+       64,   67,   67,   67,   68,   68,   68, 1544,   69,   69,
        69,   70,   70,   70,   64,  355,  373,   67,  338,  400,
-       68,  559,   54,   54,   69,  338, 1178,   70, 1553,  559,
+       68,  559,   54,   54,   69,  338, 1179,   70, 1545,  559,
 
-       54,  355,  373,   54,  338,  340,  340,  340,  401, 1178,
+       54,  355,  373,   54,  338,  340,  340,  340,  401, 1179,
        54,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57, 1554,   57,   57,   57,
+       57,   57,   57,   57,   57,   57, 1546,   57,   57,   57,
        57,   57,   71,   71,   71,   72,   72,   72,   73,   73,
-       73,  439,   74,   74,   74,   75,   75,   75,   71, 1555,
-      379,   72,  350,  393,   73, 1556,   57,   57,   74,  350,
+       73,  439,   74,   74,   74,   75,   75,   75,   71, 1551,
+      379,   72,  350,  393,   73, 1552,   57,   57,   74,  350,
       401,   75,  349,  349,  349,   57,  379,   57,  350,  393,
       437,   57,  352,  352,  352,  478,   57,   57,   58,   58,
        58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
        58,   58,   58,  439,   58,   58,   58,   58,   58,   76,
 
        76,   76,   77,   77,   77,   78,   78,   78,  624,   79,
-       79,   79,   80,   80,   80,   76,  365, 1557,   77,  437,
+       79,   79,   80,   80,   80,   76,  365, 1553,   77,  437,
       624,   78,  437,   58,   58,   79,  365,  478,   80,  360,
       360,  360,   58,  365,   58,  376,  376,  376,   58,  386,
-      386,  386, 1562,   58,   58,   61,   61,   61,   61,   61,
+      386,  386, 1554,   58,   58,   61,   61,   61,   61,   61,
        61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
       371,   61,   61,   61,   61,   61,   81,   81,   81,   82,
        82,   82,   83,   83,   83,  710,   84,   84,   84,   85,
-       85,   85,   81, 1563, 1570,   82,  659,  596,   83,  371,
+       85,   85,   81, 1555, 1556,   82,  659,  596,   83,  371,
        61,   61,   84,  371,  371,   85,  609,   61,  390,  390,
 
       390,  659,  371,   61,  371,  399,  399,  399,  403,  403,
       403,  710,   61,   62,   62,   62,   62,   62,   62,   62,
-       62,   62,   62,   62,   62,   62,   62,   62, 1572,   62,
+       62,   62,   62,   62,   62,   62,   62,   62, 1557,   62,
        62,   62,   62,   62,   86,   86,   86,   87,   87,   87,
        88,   88,   88,  596,   89,   89,   89,   90,   90,   90,
-       86,  406,  609,   87, 1573,  745,   88,  412,   62,   62,
-       89,  417,  428,   90,  412,   62, 1579,  406,  411,  411,
+       86,  406,  609,   87, 1562,  745,   88,  412,   62,   62,
+       89,  417,  428,   90,  412,   62, 1563,  406,  411,  411,
       411,   62,  746,  412,  414,  414,  414,  417,  428,  745,
        62,   65,   65,   65,   65,   65,   65,   65,   65,   65,
        65,   65,   65,   65,   65,   65,  746,   65,   65,   65,
 
        65,   65,   91,   91,   91,   92,   92,   92,   93,   93,
-       93, 1580,   94,   94,   94,   95,   95,   95,   91,  444,
-     1587,   92,  423, 1589,   93,  479,   65,   65,   94,  423,
-     1590,   95,  422,  422,  422,  444,  438,   65,  423,  425,
-      425,  425,  436,  436,  436, 1596,   65,   66,   66,   66,
+       93, 1567,   94,   94,   94,   95,   95,   95,   91,  444,
+      779,   92,  423,  779,   93,  479,   65,   65,   94,  423,
+     1571,   95,  422,  422,  422,  444,  438,   65,  423,  425,
+      425,  425,  436,  436,  436, 1573,   65,   66,   66,   66,
        66,   66,   66,   66,   66,   66,   66,   66,   66,   66,
        66,   66,  747,   66,   66,   66,   66,   66,   96,   96,
        96,   97,   97,   97,   98,   98,   98,  479,   99,   99,
        99,  100,  100,  100,   96,  438,  747,   97,  438,  748,
-       98, 1597,   66,   66,   99,  449, 1599,  100,  101,  101,
+       98, 1574,   66,   66,   99,  449, 1578,  100,  101,  101,
 
-      101, 1600,  449,   66,  102,  102,  102,  441,  441,  441,
-      546,  449,   66,  748,  101,  448,  448,  448,  372, 1601,
+      101, 1581,  449,   66,  102,  102,  102,  441,  441,  441,
+      546,  449,   66,  748,  101,  448,  448,  448,  372, 1582,
       102,  103,  103,  103,  103,  103,  103,  103,  103,  103,
       103,  103,  103,  103,  103,  103,  752,  103,  103,  103,
       103,  103,  105,  105,  105,  106,  106,  106,  107,  107,
-      107,  686,  108,  108,  108,  686,  372,  454,  105,  784,
-      752,  106,  546,  784,  107,  369,  103,  103,  108,  461,
+      107,  686,  108,  108,  108,  686,  372,  454,  105,  785,
+      752,  106,  546,  785,  107,  369,  103,  103,  108,  461,
       466,  103,  372,  454,  547,  369,  461,  103,  451,  451,
       451,  103,  460,  460,  460,  461,  466,  103,  104,  104,
       104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
 
       104,  104,  104,  369,  104,  104,  104,  104,  104,  109,
       109,  109,  110,  110,  110,  111,  111,  111,  625,  112,
-      112,  112,  463,  463,  463,  109,  547,  475,  110, 1602,
-     1603,  111, 1604,  104,  104,  112,  484,  499,  104,  475,
+      112,  112,  463,  463,  463,  109,  547,  475,  110, 1589,
+     1591,  111, 1592,  104,  104,  112,  484,  499,  104,  475,
       475,  477,  477,  477,  104,  481,  481,  481,  104,  493,
       493,  493,  484,  499,  104,  113,  113,  113,  113,  113,
       113,  113,  113,  113,  113,  113,  113,  113,  113,  113,
       625,  113,  113,  113,  113,  113,  115,  115,  115,  116,
-      116,  116,  117,  117,  117,  681,  118,  118,  118, 1147,
-      494, 1614,  115, 1147, 1616,  116,  681,  494,  117,  681,
+      116,  116,  117,  117,  117,  681,  118,  118,  118, 1148,
+      494, 1598,  115, 1148, 1599,  116,  681,  494,  117,  681,
 
       113,  113,  118,  510,  515,  113,  494,  496,  496,  496,
       510,  113,  509,  509,  509,  512,  512,  512, 1476,  510,
-      515, 1617,  113,  114,  114,  114,  114,  114,  114,  114,
+      515, 1601,  113,  114,  114,  114,  114,  114,  114,  114,
       114,  114,  114,  114,  114,  114,  114,  114, 1476,  114,
       114,  114,  114,  114,  119,  119,  119,  120,  120,  120,
       121,  121,  121,  688,  122,  122,  122,  520,  520,  520,
-      119,  526,  538,  120,  521, 1622,  121,  688,  114,  114,
-      122,  521, 1624,  114,  523,  523,  523,  526,  538,  114,
+      119,  526,  538,  120,  521, 1602,  121,  688,  114,  114,
+      122,  521, 1603,  114,  523,  523,  523,  526,  538,  114,
       521,  532,  532,  532,  535,  535,  535,  545,  545,  545,
       114,  123,  123,  123,  123,  123,  123,  123,  123,  123,
 
-      123,  123,  123,  123,  123,  123, 1626,  123,  123,  123,
+      123,  123,  123,  123,  123,  123, 1604,  123,  123,  123,
       123,  123,  125,  125,  125,  126,  126,  126,  129,  129,
-      129, 1627,  130,  130,  130,  133,  133,  133,  125,  552,
-      565,  126,  533, 1629,  129,  572,  123,  123,  130,  533,
-      645,  133,  549,  549,  549,  552,  565,  123,  533,  557,
-      557,  557,  123,  124,  124,  124,  124,  124,  124,  124,
-      124,  124,  124,  124,  124,  124,  124,  124, 1630,  124,
-      124,  124,  124,  124,  134,  134,  134,  135,  135,  135,
-      136,  136,  136,  572,  137,  137,  137,  138,  138,  138,
-      134,  572,  645,  135, 1631, 1640,  136,  578,  124,  124,
-
-      137, 1646,  646,  138, 1647,  558,  562,  562,  562,  124,
-      571,  571,  571,  578,  124,  127,  127,  127,  127,  127,
+      129,  645,  130,  130,  130,  133,  133,  133,  125,  552,
+      565,  126,  533, 1605,  129, 1606,  123,  123,  130,  533,
+      572,  133,  549,  549,  549,  552,  565,  646,  533,  557,
+      557,  557,  123, 1616,  558, 1618, 1619,  123,  124,  124,
+      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  124,  124,  645,  124,  124,  124,  124,  124,  134,
+      134,  134,  135,  135,  135,  136,  136,  136,  572,  137,
+      137,  137,  138,  138,  138,  134,  572, 1624,  135,  646,
+
+     1626,  136,  558,  124,  124,  137,  558,  578,  138,  562,
+      562,  562,  571,  571,  571,  575,  575,  575, 1628,  124,
+      583,  583,  583,  578,  124,  127,  127,  127,  127,  127,
       127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
-     1651,  127,  127,  127,  127,  127,  139,  139,  139,  140,
+     1629,  127,  127,  127,  127,  127,  139,  139,  139,  140,
       140,  140,  143,  143,  143,  692,  144,  144,  144,  147,
-      147,  147,  139,  558,  646,  140,  584,  558,  143,  692,
-      127,  127,  144,  584,  589,  147,  575,  575,  575,  583,
-      583,  583,  584,  586,  586,  586,  127,  594,  594,  594,
-      589, 1653,  127,  128,  128,  128,  128,  128,  128,  128,
-      128,  128,  128,  128,  128,  128,  128,  128, 1665,  128,
+      147,  147,  139,  589,  601,  140,  584,  741,  143,  692,
+      127,  127,  144,  584,  614,  147,  586,  586,  586,  589,
+      601,  741,  584,  594,  594,  594,  127, 1631, 1632,  595,
+      614, 1633,  127,  128,  128,  128,  128,  128,  128,  128,
 
+      128,  128,  128,  128,  128,  128,  128,  128, 1642,  128,
       128,  128,  128,  128,  148,  148,  148,  151,  151,  151,
-      152,  152,  152, 1666,  153,  153,  153,  154,  154,  154,
-      148, 1671,  601,  151, 1674, 1675,  152,  614,  128,  128,
-      153,  691,  630,  154,  598,  598,  598,  595,  601,  607,
-      607,  607,  691,  614,  128,  691, 1676,  608,  630, 1678,
+      152,  152,  152, 1648,  153,  153,  153,  154,  154,  154,
+      148, 1191, 1649,  151, 1653, 1655,  152,  595,  128,  128,
+      153,  691,  630,  154, 1191,  595,  598,  598,  598,  607,
+      607,  607,  691, 1667,  128,  691, 1668,  608,  630, 1673,
       128,  131,  131,  131,  131,  131,  131,  131,  131,  131,
-      131,  131,  131,  131,  131,  131, 1685,  131,  131,  131,
+      131,  131,  131,  131,  131,  131, 1676,  131,  131,  131,
       131,  131,  155,  155,  155,  156,  156,  156,  157,  157,
-      157, 1688,  158,  158,  158,  595,  640, 1691,  155, 1692,
-     1694,  156, 1695,  595,  157,  608,  131,  131,  158,  131,
+      157, 1677,  158,  158,  158,  611,  611,  611,  155, 1245,
 
-      651,  131,  640,  608,  611,  611,  611,  131,  622,  622,
-      622,  627,  627,  627,  131,  623,  651,  131,  132,  132,
+     1678,  156, 1680, 1687,  157,  608,  131,  131,  158,  131,
+      640,  131, 1245,  608,  622,  622,  622,  131,  627,  627,
+      627,  634,  634,  634,  131,  623,  640,  131,  132,  132,
       132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132, 1696,  132,  132,  132,  132,  132,  161,
+      132,  132,  132, 1690,  132,  132,  132,  132,  132,  161,
       161,  161,  162,  162,  162,  165,  165,  165,  694,  166,
-      166,  166,  623, 1697, 1698,  161,  906, 1684,  162,  694,
-     1190,  165,  694,  132,  132,  166,  132,  623,  132,  634,
-      634,  634,  906, 1190,  132,  637,  637,  637,  644,  644,
-      644,  132, 1684, 1699,  132,  141,  141,  141,  141,  141,
-      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+      166,  166,  623,  635, 1693,  161, 1694,  651,  162,  694,
+      635,  165,  694,  132,  132,  166,  132,  623,  132,  635,
+      637,  637,  637,  651,  132,  644,  644,  644,  648,  648,
+      648,  132, 1696, 1697,  132,  141,  141,  141,  141,  141,
 
-     1700,  141,  141,  141,  141,  141,  169,  169,  169,  170,
-      170,  170,  173,  173,  173,  741,  174,  174,  174,  177,
-      177,  177,  169, 1702, 1703,  170,  635,  657,  173,  741,
-      141,  141,  174,  635,  657,  177,  648,  648,  648,  656,
-      656,  656,  635,  657, 1705, 1707,  141,  142,  142,  142,
+      141,  141,  141,  141,  141,  141,  141,  141,  141,  141,
+     1698,  141,  141,  141,  141,  141,  169,  169,  169,  170,
+      170,  170,  173,  173,  173,  749,  174,  174,  174,  177,
+      177,  177,  169, 1699, 1700,  170,  657, 1701,  173,  749,
+      141,  141,  174,  657, 1702,  177,  656,  656,  656,  658,
+      658,  658,  657,  667,  667,  667,  141,  142,  142,  142,
       142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
-      142,  142, 1709,  142,  142,  142,  142,  142,  178,  178,
-      178,  179,  179,  179,  180,  180,  180,  749,  181,  181,
-      181,  182,  182,  182,  178, 1710, 1712,  179,  687, 1714,
-      180,  749,  142,  142,  181,  687, 1716,  182,  658,  658,
+      142,  142, 1704,  142,  142,  142,  142,  142,  178,  178,
+      178,  179,  179,  179,  180,  180,  180, 1705,  181,  181,
+      181,  182,  182,  182,  178,  698, 1707,  179,  687,  750,
 
-      658,  687,  667,  667,  667, 1162, 1162, 1162,  142,  145,
+      180,  696,  142,  142,  181,  687,  698,  182,  696,  698,
+      750,  687,  667,  750,  696, 1163, 1163, 1163,  142,  145,
       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
-      145,  145,  145,  145, 1717,  145,  145,  145,  145,  145,
-      183,  183,  183,  184,  184,  184,  187,  187,  187, 1718,
-      188,  188,  188,  189,  189,  189,  183, 1719, 1720,  184,
-      696, 1722,  187,  698,  145,  145,  188,  696,  751,  189,
-      145,  667,  699,  696,  698,  145, 1731,  698, 1732,  699,
-     1734, 1738,  751, 1742, 1744,  699, 1751,  145,  146,  146,
+      145,  145,  145,  145, 1709,  145,  145,  145,  145,  145,
+      183,  183,  183,  184,  184,  184,  187,  187,  187,  751,
+      188,  188,  188,  189,  189,  189,  183, 1711, 1686,  184,
+      699,  700,  187,  751,  145,  145,  188,  699,  700,  189,
+      145,  740,  743,  699,  700,  145, 1712, 1714,  740,  743,
+     1171, 1171, 1171, 1686,  740,  743, 1716,  145,  146,  146,
       146,  146,  146,  146,  146,  146,  146,  146,  146,  146,
-      146,  146,  146, 1752,  146,  146,  146,  146,  146,  190,
 
-      190,  190,  191,  191,  191,  192,  192,  192, 1753,  193,
-      193,  193,  194,  194,  194,  190, 1754, 1756,  191,  700,
-      740,  192, 1244,  146,  146,  193,  700,  740,  194,  146,
-      743,  750,  700,  740,  146, 1244, 1760,  743, 1170, 1170,
-     1170, 1761,  750,  743, 1762,  750,  146,  149,  149,  149,
-      149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
+      146,  146,  146, 1718,  146,  146,  146,  146,  146,  190,
+      190,  190,  191,  191,  191,  192,  192,  192, 1719,  193,
+      193,  193,  194,  194,  194,  190,  907, 1720,  191, 1721,
+     1722,  192, 1724,  146,  146,  193, 1733, 1734,  194,  146,
+     1736, 1740,  907, 1744,  146,  910,  910,  910, 1746,  910,
+     1186, 1186, 1186, 1242, 1242, 1242,  146,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
 
+      149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
       149,  159,  159,  159,  159,  159,  159,  159,  159,  159,
-      159,  159,  159,  159,  159,  159, 1765,  159,  159,  159,
+      159,  159,  159,  159,  159,  159, 1753,  159,  159,  159,
       159,  159,  197,  197,  197,  198,  198,  198,  199,  199,
-      199, 1772,  200,  200,  200,  201,  201,  201,  197, 1784,
-     1785,  198, 1793, 1796,  199, 1806,  159,  159,  200, 1810,
-      159,  201,  909,  909,  909, 1814,  909,  159, 1815, 1819,
-      159,  921,  921,  921,  159, 1820,  159,  159,  160,  160,
-      160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
+      199, 1754,  200,  200,  200,  201,  201,  201,  197, 1041,
+     1755,  198, 1756, 1758,  199, 1762,  159,  159,  200, 1041,
+      159,  201,  922,  922,  922, 1763, 1041,  159, 1764, 1767,
+      159,  944,  944,  944,  159, 1774,  159,  159,  160,  160,
 
-      160,  160,  160, 1821,  160,  160,  160,  160,  160,  202,
-      202,  202,  203,  203,  203,  204,  204,  204, 1822,  207,
-      207,  207,  208,  208,  208,  202, 1831, 1835,  203, 1838,
-     1840,  204, 1842,  160,  160,  207, 1843,  160,  208,  955,
-      955,  955, 1845,  955,  160,  921,  955,  160,  943,  943,
-      943,  160, 1846,  160,  160,  163,  163,  163,  163,  163,
+      160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
+      160,  160,  160, 1780,  160,  160,  160,  160,  160,  202,
+      202,  202,  203,  203,  203,  204,  204,  204, 1787,  207,
+      207,  207,  208,  208,  208,  202, 1788, 1797,  203, 1800,
+     1810,  204, 1814,  160,  160,  207,  922,  160,  208,  956,
+      956,  956, 1818,  956,  160,  944,  956,  160, 1492, 1492,
+     1492,  160, 1819,  160,  160,  163,  163,  163,  163,  163,
       163,  163,  163,  163,  163,  163,  163,  163,  163,  163,
-     1847,  163,  163,  163,  163,  163,  211,  211,  211,  212,
-      212,  212,  213,  213,  213, 1850,  214,  214,  214,  708,
-      708,  708,  211, 1852, 1854,  212, 1859, 1865,  213, 1040,
-
-      163,  163,  214,  163,  163,  163,  708, 1869, 1870, 1040,
-     1871,  163,  943, 1873,  163, 1885, 1040, 1888,  163, 1882,
-     1881,  163,  164,  164,  164,  164,  164,  164,  164,  164,
-      164,  164,  164,  164,  164,  164,  164, 1881,  164,  164,
+     1823,  163,  163,  163,  163,  163,  211,  211,  211,  212,
+      212,  212,  213,  213,  213, 1824,  214,  214,  214,  708,
+
+      708,  708,  211, 1825, 1826,  212, 1835, 1839,  213, 1842,
+      163,  163,  214,  163,  163,  163,  708, 1844,  964,  964,
+      964,  163,  964, 1846,  163,  964, 1847, 1849,  163, 1850,
+     1851,  163,  164,  164,  164,  164,  164,  164,  164,  164,
+      164,  164,  164,  164,  164,  164,  164, 1854,  164,  164,
       164,  164,  164,  215,  215,  215,  216,  216,  216,  217,
-      217,  217, 1889,  218,  218,  218,  716,  716,  716,  215,
-     1890, 1882,  216, 1892, 1891,  217, 1893,  164,  164,  218,
-      164,  164,  164,  716, 1895,  963,  963,  963,  164,  963,
-     1891,  164,  963, 1896, 1897,  164, 1883, 1899,  164,  167,
-      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
+      217,  217, 1856,  218,  218,  218,  716,  716,  716,  215,
+     1858, 1863,  216, 1869, 1873,  217, 1874,  164,  164,  218,
+      164,  164,  164,  716, 1875,  979,  979,  979,  164,  979,
+     1877,  164,  979, 1889, 1892,  164, 1886, 1885,  164,  167,
 
-      167,  167,  167,  167, 1900,  167,  167,  167,  167,  167,
-      221,  221,  221,  222,  222,  222,  223,  223,  223, 1883,
-      224,  224,  224,  732,  732,  732,  221, 1901, 1905,  222,
-     1907, 1910,  223, 1911,  167,  167,  224, 1912, 1913,  167,
-      732, 1185, 1185, 1185, 1915,  167,  168,  168,  168,  168,
+      167,  167,  167,  167,  167,  167,  167,  167,  167,  167,
+      167,  167,  167,  167, 1885,  167,  167,  167,  167,  167,
+      221,  221,  221,  222,  222,  222,  223,  223,  223, 1893,
+      224,  224,  224,  732,  732,  732,  221, 1894, 1886,  222,
+     1896, 1897,  223, 1899,  167,  167,  224, 1900, 1901,  167,
+      732, 1493, 1493, 1493, 1903,  167,  168,  168,  168,  168,
       168,  168,  168,  168,  168,  168,  168,  168,  168,  168,
-      168, 1917,  168,  168,  168,  168,  168,  225,  225,  225,
-      226,  226,  226,  227,  227,  227, 1918,  228,  228,  228,
-      756,  756,  756,  225, 1920, 1922,  226, 1925, 1926,  227,
-     1928,  168,  168,  228, 1929, 1930,  168,  756, 1241, 1241,
+      168, 1887,  168,  168,  168,  168,  168,  225,  225,  225,
+      226,  226,  226,  227,  227,  227, 1904,  228,  228,  228,
+      756,  756,  756,  225, 1905, 1895,  226, 1493, 1909,  227,
 
-     1241, 1932,  168,  171,  171,  171,  171,  171,  171,  171,
-      171,  171,  171,  171,  171,  171,  171,  171, 1938,  171,
+     1911,  168,  168,  228, 1887, 1914,  168,  756, 1495, 1495,
+     1495, 1895,  168,  171,  171,  171,  171,  171,  171,  171,
+      171,  171,  171,  171,  171,  171,  171,  171, 1915,  171,
       171,  171,  171,  171,  231,  231,  231,  232,  232,  232,
-      233,  233,  233, 1927,  234,  234,  234,  235,  235,  235,
-      231, 1927, 1939,  232, 1940, 1941,  233, 1944,  171,  171,
-      234, 1960,  171,  235,  978,  978,  978, 1961,  978,  171,
-     1940,  978,  171,  172,  172,  172,  172,  172,  172,  172,
-      172,  172,  172,  172,  172,  172,  172,  172, 1966,  172,
+      233,  233,  233, 1916,  234,  234,  234,  235,  235,  235,
+      231, 1917, 1919,  232, 1495, 1921,  233, 1922,  171,  171,
+      234, 1924,  171,  235,  983,  983,  983, 1926, 1929,  171,
+     1930, 1932,  171,  172,  172,  172,  172,  172,  172,  172,
+      172,  172,  172,  172,  172,  172,  172,  172, 1933,  172,
       172,  172,  172,  172,  236,  236,  236,  237,  237,  237,
-      238,  238,  238, 1931,  241,  241,  241,  242,  242,  242,
 
-      236, 1931, 1945,  237, 1946, 1967,  238, 1968,  172,  172,
-      241, 1972,  172,  242,  982,  982,  982, 1974, 1945,  172,
-     1946, 1980,  172,  175,  175,  175,  175,  175,  175,  175,
-      175,  175,  175,  175,  175,  175,  175,  175, 1981,  175,
+      238,  238,  238, 1931,  241,  241,  241,  242,  242,  242,
+      236, 1931, 1934,  237, 1936, 1942,  238, 1943,  172,  172,
+      241, 1945,  172,  242,  992,  992,  992, 1948,  983,  172,
+     1960, 1965,  172,  175,  175,  175,  175,  175,  175,  175,
+      175,  175,  175,  175,  175,  175,  175,  175, 1966,  175,
       175,  175,  175,  175,  245,  245,  245,  246,  246,  246,
-      247,  247,  247, 1982,  248,  248,  248,  249,  249,  249,
-      245, 1989, 1990,  246, 1991, 2004,  247, 2010,  175,  175,
-      248, 2014,  175,  249,  991,  991,  991, 2017,  982,  175,
-     2019, 2022,  175, 1492, 1492, 1492, 1493, 1493, 1493,  175,
-      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
+      247,  247,  247, 1935,  248,  248,  248,  249,  249,  249,
+      245, 1935, 1973,  246, 1944, 1949,  247, 1974,  175,  175,
+      248, 1975,  175,  249, 1498, 1498, 1498, 1979,  992,  175,
+     1944, 1949,  175, 1501, 1501, 1501, 1511, 1511, 1511,  175,
 
-      176,  176,  176,  176,  176, 2024,  176,  176,  176,  176,
+      176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
+      176,  176,  176,  176,  176, 1981,  176,  176,  176,  176,
       176,  250,  250,  250,  251,  251,  251,  252,  252,  252,
-     2026,  255,  255,  255,  256,  256,  256,  250, 2027, 2028,
-      251, 2031, 1493,  252, 2033,  176,  176,  255,  991,  176,
-      256,  298, 2038,  364,  370, 2040,  176, 2048, 2049,  176,
-     2050,  298, 2051,  364, 2053, 2066,  176,  185,  185,  185,
+     1987,  255,  255,  255,  256,  256,  256,  250, 1748, 1950,
+      251, 1988, 1989,  252, 1748,  176,  176,  255, 1748,  176,
+      256,  298, 1748,  364,  370, 1950,  176, 1996, 1997,  176,
+     1998,  298, 2011,  364, 2017, 2021,  176,  185,  185,  185,
       185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  370,  185,  185,  185,  185,  185, 2067, 2072,
-      298,  364, 2073,  763,  763,  763,  298, 2074,  370,  768,
-      768,  768, 2064,  298, 2075,  364, 2079,  298, 2064,  364,
-
-      763, 2066,  185,  185, 2081, 2082,  768, 2083,  185,  998,
-      998,  998, 2088,  998, 2095, 2097,  998, 1495, 1495, 1495,
-     1498, 1498, 1498,  185,  186,  186,  186,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186, 2098,
-      186,  186,  186,  186,  186,  780,  780,  780,  792,  792,
-      792,  793,  793,  793,  799,  799,  799,  801,  801,  801,
-     2101, 2104,  780, 1495, 2108,  792, 2109, 2110,  793,  186,
-      186,  799, 2111, 2112,  801,  186, 1005, 1005, 1005, 2113,
-     1005, 2114, 2115, 1005, 1501, 1501, 1501, 1511, 1511, 1511,
-      186,  195,  195,  195,  195,  195,  195,  195,  195,  195,
+      185,  185,  370,  185,  185,  185,  185,  185, 2024, 2026,
+      298,  364, 2029,  763,  763,  763,  298, 2031,  370,  780,
+
+      780,  780, 2033,  298, 2034,  364, 2035,  298, 2038,  364,
+      763, 2040,  185,  185, 2045, 2047,  780, 2055,  185,  999,
+      999,  999, 2056,  999, 2057, 2058,  999, 1547, 1547, 1547,
+     1548, 1548, 1548,  185,  186,  186,  186,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,  186,  186,  186, 2060,
+      186,  186,  186,  186,  186,  793,  793,  793,  794,  794,
+      794,  800,  800,  800,  802,  802,  802,  816,  816,  816,
+     2073, 2071,  793, 2074, 2079,  794, 1548, 2071,  800,  186,
+      186,  802, 2080, 2081,  816,  186, 1006, 1006, 1006, 2082,
+     1006, 2086, 2088, 1006, 1549, 1549, 1549, 1550, 1550, 1550,
 
-      195,  195,  195,  195,  195,  195, 2116,  195,  195,  195,
-      195,  195,  815,  815,  815,  816,  816,  816,  828,  828,
-      828,  836,  836,  836,  841,  841,  841, 2117, 2122,  815,
-     2123, 2124,  816, 2125, 2143,  828,  195,  195,  836, 2144,
-     2147,  841,  195, 2145, 2146,  195, 1010, 1010, 1010, 2148,
-     1010, 2145, 2146, 1010, 1547, 1547, 1547,  195,  196,  196,
+      186,  195,  195,  195,  195,  195,  195,  195,  195,  195,
+      195,  195,  195,  195,  195,  195, 2073,  195,  195,  195,
+      195,  195,  817,  817,  817,  829,  829,  829,  837,  837,
+      837,  842,  842,  842,  848,  848,  848, 2089, 2090,  817,
+     1549, 2095,  829, 2102, 2104,  837,  195,  195,  842, 2105,
+     2108,  848,  195, 2111, 2115,  195, 1022, 1022, 1022, 2116,
+     1022, 2117, 2118, 1022, 1644, 1644, 1644,  195,  196,  196,
       196,  196,  196,  196,  196,  196,  196,  196,  196,  196,
-      196,  196,  196, 2150,  196,  196,  196,  196,  196,  847,
-      847,  847,  869,  869,  869,  897,  897,  897,  901,  901,
-      901, 2065,  919,  919,  919, 2154,  847, 2155, 2156,  869,
+      196,  196,  196, 2119,  196,  196,  196,  196,  196,  870,
+      870,  870,  898,  898,  898,  902,  902,  902,  920,  920,
 
-     2162, 2163,  897,  196,  196,  901,  954,  954,  954,  196,
-      919, 2164,  196, 1022, 1022, 1022, 2178, 1022, 2182, 2183,
-     1022, 2184, 2065,  954,  196,  205,  205,  205,  205,  205,
+      920, 1749,  921,  921,  921, 2120,  870, 1749, 2121,  898,
+     1644, 1749,  902,  196,  196, 1749,  920, 2122, 2123,  196,
+      921, 2124,  196, 1035, 1035, 1035, 2129, 1035, 2072, 2130,
+     1035, 1703, 1703, 1703,  196,  205,  205,  205,  205,  205,
       205,  205,  205,  205,  205,  205,  205,  205,  205,  205,
-     2186,  205,  205,  205,  205,  205,  920,  920,  920,  951,
-      951,  951, 2190, 2193,  952,  952,  952,  958,  958,  958,
-      959,  959,  959, 1746,  920, 2194, 2195,  951, 2197, 1746,
-      205,  205,  952, 1746, 2195,  958,  205, 1746,  959, 2198,
-     2201,  205,  206,  206,  206,  206,  206,  206,  206,  206,
-      206,  206,  206,  206,  206,  206,  206, 2208,  206,  206,
-
-      206,  206,  206, 2210,  920,  962,  962,  962,  964,  964,
-      964,  970,  970,  970,  952,  966,  966,  966,  971,  971,
-      971, 2225,  962, 2196,  959,  964, 2239,  206,  206,  970,
-     2240, 2196,  966,  206, 2243, 2230,  971, 2250,  206,  209,
+     2131,  205,  205,  205,  205,  205,  952,  952,  952, 2072,
+      921,  953,  953,  953, 2132,  955,  955,  955, 2137,  959,
+      959,  959, 2141, 2146,  952, 1706, 1706, 1706, 2153,  953,
+      205,  205,  955, 1708, 1708, 1708,  205,  959, 1710, 1710,
+     1710,  205,  206,  206,  206,  206,  206,  206,  206,  206,
+
+      206,  206,  206,  206,  206,  206,  206, 2154,  206,  206,
+      206,  206,  206,  960,  960,  960,  963,  963,  963, 2160,
+     2161,  953,  965,  965,  965,  967,  967,  967,  971,  971,
+      971,  960, 2158,  963, 1713, 1713, 1713,  206,  206,  965,
+     2158, 2163,  967,  206, 2167, 2168,  971, 2169,  206,  209,
       209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
-      209,  209,  209,  209, 2251,  209,  209,  209,  209,  209,
-      975,  975,  975, 2256, 2258,  971, 2270, 2271,  976,  976,
-      976,  977,  977,  977,  980,  980,  980, 1747,  975,  997,
-      997,  997, 2230, 1747,  209,  209,  976, 1747,  977, 2272,
-      209, 1747,  980, 1034, 1034, 1034,  997, 1034, 2273, 2274,
+      209,  209,  209,  209, 2175,  209,  209,  209,  209,  209,
+      976,  976,  976,  977,  977,  977, 2176,  960, 2177,  978,
+      978,  978, 2159, 2191,  972,  972,  972, 2195,  976, 2196,
+     2159,  977, 2197, 2199,  209,  209,  978,  998,  998,  998,
 
-     1034, 1550, 1550, 1550, 2275,  209,  210,  210,  210,  210,
+      209, 2203,  972, 1037, 1037, 1037, 2206, 1037, 2207, 2210,
+     1037, 1715, 1715, 1715,  998,  209,  210,  210,  210,  210,
       210,  210,  210,  210,  210,  210,  210,  210,  210,  210,
-      210, 2276,  210,  210,  210,  210,  210,  981,  981,  981,
-     2277, 2278,  976, 2279, 2286, 1001, 1001, 1001, 1002, 1002,
-     1002, 1004, 1004, 1004, 2287,  981, 2288, 1007, 1007, 1007,
-     2290,  210,  210, 1001, 2300, 2301, 1002,  210, 1004, 1036,
-     1036, 1036, 2302, 1036,  981, 1007, 1036, 2303, 1548, 1548,
-     1548, 2304,  210,  219,  219,  219,  219,  219,  219,  219,
-      219,  219,  219,  219,  219,  219,  219,  219, 2229,  219,
-      219,  219,  219,  219, 2305, 1008, 1008, 1008, 1009, 1009,
-
-     1009, 1701, 1701, 1701, 1002, 1012, 1012, 1012, 1013, 1013,
-     1013, 2306, 2309, 1008, 1548, 1009, 2310, 2311,  219,  219,
-     1016, 1016, 1016, 1012,  219, 2317, 1013,  219, 1042, 1042,
-     1042, 2229, 1042, 2318, 2324, 1042, 2325, 2326, 1016,  219,
+      210,  972,  210,  210,  210,  210,  210,  977,  981,  981,
+      981,  982,  982,  982, 2211, 1002, 1002, 1002, 1003, 1003,
+     1003, 1005, 1005, 1005, 2214, 2221,  981, 2208, 2223,  982,
+     2238,  210,  210, 1002, 2209, 2208, 1003,  210, 1005, 1043,
+     1043, 1043, 2209, 1043, 2243, 1715, 1043, 2252,  982, 1723,
+     1723, 1723,  210,  219,  219,  219,  219,  219,  219,  219,
+      219,  219,  219,  219,  219,  219,  219,  219, 2242,  219,
+
+      219,  219,  219,  219, 1008, 1008, 1008, 1009, 1009, 1009,
+     1021, 1021, 1021, 2253, 1003, 1012, 1012, 1012, 1013, 1013,
+     1013, 2243, 1008, 2256, 2263, 1009, 2264, 1021,  219,  219,
+     1016, 1016, 1016, 1012,  219, 2269, 1013,  219, 1046, 1046,
+     1046, 2242, 1046, 2271, 2283, 1046, 2284, 2285, 1016,  219,
       220,  220,  220,  220,  220,  220,  220,  220,  220,  220,
-      220,  220,  220,  220,  220, 2327,  220,  220,  220,  220,
-      220, 1008, 2341, 1017, 1017, 1017, 1021, 1021, 1021, 1013,
-     1025, 1025, 1025, 2342, 1026, 1026, 1026, 1030, 1030, 1030,
-     2312, 1017, 2343, 1021, 2344,  220,  220, 2346, 1025, 2348,
-     2312,  220, 1026, 2371,  220, 1030, 1045, 1045, 1045, 2372,
+      220,  220,  220,  220,  220, 2286,  220,  220,  220,  220,
+      220, 2287, 2288, 1009, 1017, 1017, 1017, 2289, 2290, 1013,
+     1026, 1026, 1026, 2291, 1027, 1027, 1027, 1031, 1031, 1031,
+     2292, 2299, 1017, 2300, 2301,  220,  220, 2303, 1026, 2307,
 
-     1045, 2377, 2378, 1045, 2379, 2366,  220,  229,  229,  229,
+     2312,  220, 1027, 2316,  220, 1031, 1060, 1060, 1060, 2317,
+     1060, 2318, 2319, 1060, 2320, 2321,  220,  229,  229,  229,
       229,  229,  229,  229,  229,  229,  229,  229,  229,  229,
-      229,  229, 2382,  229,  229,  229,  229,  229, 1017, 1033,
-     1033, 1033, 1035, 1035, 1035, 1026, 1031, 1031, 1031, 1037,
-     1037, 1037, 2366, 1038, 1038, 1038, 1033, 2385, 2386, 1035,
-     2387, 2388,  229,  229, 1031, 2389, 2390, 1037, 2391, 2392,
-      229, 1038,  229, 2393, 2394,  229, 1704, 1704, 1704,  229,
-     1706, 1706, 1706,  229,  230,  230,  230,  230,  230,  230,
-      230,  230,  230,  230,  230,  230,  230,  230,  230, 2365,
-      230,  230,  230,  230,  230, 1041, 1041, 1041, 1031, 1044,
-
-     1044, 1044, 2395, 2397, 1038, 1046, 1046, 1046, 1056, 1056,
-     1056, 2398, 1041, 1057, 1057, 1057, 1044, 2400, 2401,  230,
-      230, 2365, 1046, 1708, 1708, 1708, 1056,  230, 2402,  230,
-     2403, 1057,  230, 1711, 1711, 1711,  230, 1721, 1721, 1721,
+      229,  229, 2322,  229,  229,  229,  229,  229, 2325, 1017,
+     1034, 1034, 1034, 2326, 2327, 1027, 1032, 1032, 1032, 1036,
+     1036, 1036, 2333, 1038, 1038, 1038, 2334, 1034, 1039, 1039,
+     1039, 2340,  229,  229, 1032, 2341, 1036, 1717, 1717, 1717,
+      229, 1038,  229, 2342, 2343,  229, 1039, 2357, 2358,  229,
+     1757, 1757, 1757,  229,  230,  230,  230,  230,  230,  230,
+      230,  230,  230,  230,  230,  230,  230,  230,  230, 2359,
+
+      230,  230,  230,  230,  230, 1042, 1042, 1042, 1032, 1045,
+     1045, 1045, 2360, 1717, 1047, 1047, 1047, 2295, 2295, 1039,
+     2295, 2362, 1042, 1057, 1057, 1057, 1045, 2364, 2295,  230,
+      230, 1047, 1059, 1059, 1059, 2295, 2387,  230, 2328,  230,
+     2388, 1057,  230, 1759, 1759, 1759,  230, 2393, 2328, 1059,
       230,  239,  239,  239,  239,  239,  239,  239,  239,  239,
-      239,  239,  239,  239,  239,  239, 2405,  239,  239,  239,
-      239,  239, 1058, 1058, 1058, 1059, 1059, 1059, 2406, 1059,
-     2408, 1057, 1059, 1060, 1060, 1060, 1061, 1061, 1061, 1058,
-     1061, 2409, 2411, 1061, 2416, 2417,  239,  239, 2399, 2418,
-     1060, 1062, 1062, 1062, 1073, 1073, 1073, 2399, 1073, 2420,
+      239,  239,  239,  239,  239,  239, 2382,  239,  239,  239,
+      239,  239, 1061, 1061, 1061, 1062, 1062, 1062, 2394, 1062,
+     2395, 2398, 1062, 2401, 1058, 1058, 1058, 2402, 2403, 1061,
+     1063, 1063, 1063, 1064, 1064, 1064,  239,  239, 1065, 1065,
 
-     2425, 1073, 1081, 1081, 1081, 2426, 1081, 2427, 1062, 1081,
+     1065, 2404, 1058, 2382, 1074, 1074, 1074, 1063, 1074, 2405,
+     1064, 1074, 1082, 1082, 1082, 1065, 1082, 2381, 2406, 1082,
       239,  240,  240,  240,  240,  240,  240,  240,  240,  240,
-      240,  240,  240,  240,  240,  240, 2428,  240,  240,  240,
-      240,  240, 1072, 1072, 1072, 1086, 1086, 1086, 2429, 1086,
-     2432, 2438, 1086, 2439, 2441, 1063, 1063, 1063, 2450, 1072,
-     1064, 1064, 1064, 1065, 1065, 1065,  240,  240, 1066, 1066,
-     1066, 2452, 1063, 2455, 1092, 1092, 1092, 1064, 1092, 2404,
-     1065, 1092, 1112, 1112, 1112, 1066, 1112, 2457, 2404, 1112,
+      240,  240,  240,  240,  240,  240, 2407,  240,  240,  240,
+      240,  240, 1058, 2408, 1064, 1068, 1068, 1068, 2409, 2381,
+     1065, 1066, 1066, 1066, 2410, 1073, 1073, 1073, 2411, 2413,
+     1067, 1067, 1067, 1068, 2414, 2416,  240,  240, 1066, 1069,
+     1069, 1069, 1073, 2417, 1087, 1087, 1087, 1067, 1087, 2415,
+     2418, 1087, 1093, 1093, 1093, 2419, 1093, 1069, 2415, 1093,
       240,  243,  243,  243,  243,  243,  243,  243,  243,  243,
-      243,  243,  243,  243,  243,  243, 1063,  243,  243,  243,
 
-      243,  243, 1064, 1067, 1067, 1067, 2481, 2482, 1065, 2484,
-     1066, 2485, 1068, 1068, 1068, 1074, 1074, 1074, 1077, 1077,
-     1077, 1067, 1713, 1713, 1713, 2486,  243,  243, 2491, 2477,
-     1068, 2492, 1074, 1549, 1549, 1549, 1077,  243,  244,  244,
+      243,  243,  243,  243,  243,  243, 1066,  243,  243,  243,
+      243,  243, 1067, 1075, 1075, 1075, 1069, 1078, 1078, 1078,
+     1079, 1079, 1079, 1081, 1081, 1081, 1083, 1083, 1083, 2421,
+     1075, 1760, 1760, 1760, 2422, 1078,  243,  243, 1079, 2424,
+     1081, 1725, 1725, 1725, 1083, 2425, 2427,  243,  244,  244,
       244,  244,  244,  244,  244,  244,  244,  244,  244,  244,
-      244,  244,  244, 2493,  244,  244,  244,  244,  244, 1068,
-     1080, 1080, 1080, 1082, 1082, 1082, 2477, 1078, 1078, 1078,
-     1083, 1083, 1083, 1085, 1085, 1085, 2476, 1080, 2494, 1549,
-     2495, 1082, 2478,  244,  244, 1078, 1713, 2496, 1083, 2497,
-     1085, 1755, 1755, 1755,  244,  253,  253,  253,  253,  253,
+      244,  244,  244, 2428,  244,  244,  244,  244,  244, 2430,
+     2436, 1079, 1084, 1084, 1084, 1086, 1086, 1086, 1089, 1089,
+     1089, 1090, 1090, 1090, 1092, 1092, 1092, 1725, 2420, 2437,
+     1084, 2438, 1086,  244,  244, 2440, 1089, 2420, 2445, 1090,
 
+     2446, 1092, 2447, 2448,  244,  253,  253,  253,  253,  253,
       253,  253,  253,  253,  253,  253,  253,  253,  253,  253,
-     2498,  253,  253,  253,  253,  253, 2476, 2499, 1078, 1088,
-     1088, 1088, 1091, 1091, 1091, 2478, 2500, 1096, 1096, 1096,
-     2501, 1083, 1097, 1097, 1097, 2503, 2504, 1088, 2505, 1091,
-      253,  253, 1089, 1089, 1089, 1096, 1098, 1098, 1098, 2506,
-     1097,  253, 1136, 1136, 1136, 2507, 1136, 2508, 2509, 1136,
-     1089, 2510, 2511, 1098,  253,  254,  254,  254,  254,  254,
+     2449,  253,  253,  253,  253,  253, 2452, 2458, 1090, 1097,
+     1097, 1097, 2459, 1084, 2461, 1098, 1098, 1098, 1099, 1099,
+     1099, 1100, 1100, 1100, 1102, 1102, 1102, 1097, 2470, 2472,
+      253,  253, 2475, 1098, 2477, 1099, 2501, 2502, 1100, 2504,
+     2505,  253, 1102, 1113, 1113, 1113, 2506, 1113, 2497, 2498,
+     1113, 1799, 1799, 1799,  253,  254,  254,  254,  254,  254,
       254,  254,  254,  254,  254,  254,  254,  254,  254,  254,
-     2512,  254,  254,  254,  254,  254, 2513, 1097, 2514, 1089,
-     1099, 1099, 1099, 2515, 2516, 1100, 1100, 1100, 1101, 1101,
-
-     1101, 1102, 1102, 1102, 1108, 1108, 1108, 1099, 2518, 2522,
-      254,  254, 1100, 1104, 1104, 1104, 1101, 2529, 2530, 1102,
-     2531,  254, 1108, 1105, 1105, 1105, 1106, 1106, 1106, 2533,
-     1104, 1109, 1109, 1109,  254,  296, 1107, 1107, 1107, 2537,
-     1105, 2540,  296, 1106, 1111, 1111, 1111, 2579, 2581, 1109,
-     2489,  296,  296, 1107, 1100, 2578, 1113, 1113, 1113, 2583,
-     2489, 1111, 1102, 2489, 1114, 1114, 1114, 2584, 1109, 1757,
-     1757, 1757, 2580, 1105, 1113, 1115, 1115, 1115, 2585,  296,
-      296,  296, 1114, 2588, 2578,  296,  296,  296, 1105, 2579,
-      296,  296, 1115, 2589,  296, 1107,  296,  296,  296,  361,
-
-     1116, 1116, 1116, 1117, 1117, 1117,  361, 1118, 1118, 1118,
-     1119, 1119, 1119, 2590, 2580,  361,  361, 1116, 2591, 1114,
-     2592, 1117, 1120, 1120, 1120, 1118, 2590, 1119, 2594, 1121,
-     1121, 1121, 2595, 2596, 1122, 1122, 1122, 2563, 2597, 1120,
-     1135, 1135, 1135,  361,  361,  361, 1121, 2563, 2598,  361,
-      361,  361, 1122, 2563,  361,  361, 2600, 1135,  361, 2601,
-      361,  361,  361, 1123, 1123, 1123, 1129, 1129, 1129, 1139,
-     1139, 1139, 1120, 1130, 1130, 1130, 2602, 2603, 1118, 2606,
-     2607, 1123, 2608, 2609, 1129, 2610, 1139, 1120, 1133, 1133,
-     1133, 1130, 1134, 1134, 1134, 1137, 1137, 1137, 1138, 1138,
-
-     1138, 1140, 1140, 1140, 2611, 1140, 1133, 2612, 1140, 2613,
-     1134, 2614, 2615, 1137, 2616, 2617, 1138, 1142, 1142, 1142,
-     1143, 1143, 1143, 1158, 1158, 1158, 1159, 1159, 1159, 1161,
-     1161, 1161, 2490, 2593, 1123, 1142, 2618, 1130, 1143, 2620,
-     2630, 1158, 2490, 2631, 1159, 2490, 2593, 1161, 1192, 1192,
-     1192, 1193, 1193, 1193, 2636, 2640, 1134, 2658, 2659, 1138,
-     1194, 1194, 1194, 2660, 2661, 1192, 1197, 1197, 1197, 1193,
-     1196, 1196, 1196, 1198, 1198, 1198, 1161, 1198, 1194, 2662,
-     1198, 2663, 2675, 1197, 1143, 1201, 1201, 1201, 1196, 1203,
-     1203, 1203, 1204, 1204, 1204, 1206, 1206, 1206, 2667, 1208,
-
-     1208, 1208, 1201, 1208, 2668, 2678, 1208, 1203, 2679, 2673,
-     1204, 2667, 2683, 1206, 1211, 1211, 1211, 2668, 2672, 1196,
-     1212, 1212, 1212, 2684, 1212, 2564, 2685, 1212, 1213, 1213,
-     1213, 1211, 1214, 1214, 1214, 2564, 1215, 1215, 1215, 2686,
-     1215, 2564, 1206, 1215, 2673, 1213, 1201, 2687, 2688, 1214,
-     1217, 1217, 1217, 1219, 1219, 1219, 1220, 1220, 1220, 1222,
-     1222, 1222, 1224, 1224, 1224, 2689, 2672, 1217, 1226, 1226,
-     1226, 1219, 2690, 2692, 1220, 2693, 2694, 1222, 2695, 1224,
-     1227, 1227, 1227, 1229, 1229, 1229, 1226, 1230, 1230, 1230,
-     2696, 1230, 2697, 2698, 1230, 1234, 1234, 1234, 1227, 2699,
-
-     2701, 1229, 1235, 1235, 1235, 1237, 1237, 1237, 1252, 1252,
-     1252, 2702, 1252, 1234, 2703, 1252, 1256, 1256, 1256, 1222,
-     1235, 2704, 2705, 1237, 1257, 1257, 1257, 1258, 1258, 1258,
-     1229, 2706, 2707, 1256, 1260, 1260, 1260, 1262, 1262, 1262,
-     2708, 1262, 1257, 2709, 1262, 1258, 1266, 1266, 1266, 1267,
-     1267, 1267, 1260, 1269, 1269, 1269, 1270, 1270, 1270, 2710,
-     1270, 2711, 2712, 1270, 1266, 2713, 2719, 1267, 1273, 1273,
-     1273, 1269, 1274, 1274, 1274, 1275, 1275, 1275, 1277, 1277,
-     1277, 1278, 1278, 1278, 2723, 1273, 2724, 1279, 1279, 1279,
-     1274, 2732, 2733, 1275, 2750, 1260, 1277, 2751, 1278, 1280,
-
-     1280, 1280, 2752, 2753, 1279, 1281, 1281, 1281, 1283, 1283,
-     1283, 1286, 1286, 1286, 1269, 1279, 2754, 1280, 1287, 1287,
-     1287, 2755, 1287, 1281, 2758, 1287, 1283, 2759, 1286, 1292,
-     1292, 1292, 1293, 1293, 1293, 1295, 1295, 1295, 1298, 1298,
-     1298, 1299, 1299, 1299, 2745, 1277, 2760, 1292, 2761, 2770,
-     1293, 2762, 2771, 1295, 2745, 1298, 1303, 1303, 1303, 1299,
-     1300, 1300, 1300, 1302, 1302, 1302, 2746, 2748, 1304, 1304,
-     1304, 2772, 1304, 1303, 1283, 1304, 2746, 2748, 1300, 2773,
-     2774, 1302, 1307, 1307, 1307, 2762, 1307, 2775, 2776, 1307,
-     1310, 1310, 1310, 1311, 1311, 1311, 1313, 1313, 1313, 2777,
-
-     1295, 2780, 1318, 1318, 1318, 2781, 1318, 2783, 1310, 1318,
-     2784, 1311, 2785, 2749, 1313, 1321, 1321, 1321, 1322, 1322,
-     1322, 2787, 1322, 2749, 2789, 1322, 1325, 1325, 1325, 2790,
-     1302, 2791, 1321, 1326, 1326, 1326, 2794, 1326, 2795, 2796,
-     1326, 2797, 2800, 1325, 1336, 1336, 1336, 1337, 1337, 1337,
-     1339, 1339, 1339, 1340, 1340, 1340, 2807, 1340, 2808, 2809,
-     1340, 1313, 1336, 2817, 2823, 1337, 2824, 2825, 1339, 1343,
-     1343, 1343, 2826, 1343, 2827, 2828, 1343, 1346, 1346, 1346,
-     1347, 1347, 1347, 2829, 1347, 2830, 2831, 1347, 1352, 1352,
-     1352, 1353, 1353, 1353, 1346, 1355, 1355, 1355, 1360, 1360,
-
-     1360, 2832, 1360, 2834, 2835, 1360, 1352, 2840, 2841, 1353,
-     1363, 1363, 1363, 1355, 1364, 1364, 1364, 1339, 1364, 2842,
-     2843, 1364, 1367, 1367, 1367, 2853, 2844, 1363, 1368, 1368,
-     1368, 1370, 1370, 1370, 1372, 1372, 1372, 2854, 1372, 2855,
-     1367, 1372, 2856, 1355, 2857, 2858, 1368, 2859, 2860, 1370,
-     1375, 1375, 1375, 1376, 1376, 1376, 1378, 1378, 1378, 1380,
-     1380, 1380, 2864, 1380, 2865, 2866, 1380, 2867, 1375, 2844,
-     2868, 1376, 2869, 2871, 1378, 1384, 1384, 1384, 1385, 1385,
-     1385, 2872, 1370, 1387, 1387, 1387, 2874, 1389, 1389, 1389,
-     2875, 1389, 2876, 1384, 1389, 2878, 1385, 1395, 1395, 1395,
-
-     2882, 1387, 1396, 1396, 1396, 2883, 1398, 1398, 1398, 1399,
-     1399, 1399, 1400, 1400, 1400, 1395, 1400, 2884, 2887, 1400,
-     1396, 2892, 2893, 1378, 1398, 2894, 1399, 1401, 1401, 1401,
-     2895, 2896, 1387, 1402, 1402, 1402, 2897, 1402, 2898, 2899,
-     1402, 1404, 1404, 1404, 1401, 1405, 1405, 1405, 2900, 1407,
-     1407, 1407, 1409, 1409, 1409, 2901, 1413, 1413, 1413, 1404,
-     1642, 1642, 1642, 1405, 2902, 2903, 1398, 1407, 2905, 1409,
-     1410, 1410, 1410, 1413, 1410, 2906, 2907, 1410, 1414, 1414,
-     1414, 2908, 1414, 2915, 2911, 1414, 1416, 1416, 1416, 1417,
-     1417, 1417, 1419, 1419, 1419, 1421, 1421, 1421, 2911, 1421,
-
-     2918, 2909, 1421, 2912, 1416, 2919, 1642, 1417, 2922, 2924,
-     1419, 1424, 1424, 1424, 2912, 2925, 1407, 1425, 1425, 1425,
-     1427, 1427, 1427, 1428, 1428, 1428, 1429, 1429, 1429, 1424,
-     1429, 2927, 2928, 1429, 2931, 1425, 2932, 2933, 1427, 2934,
-     1428, 1430, 1430, 1430, 1431, 1431, 1431, 2909, 1431, 2935,
-     2936, 1431, 1432, 1432, 1432, 2937, 1419, 2938, 1430, 1433,
-     1433, 1433, 2939, 1435, 1435, 1435, 1436, 1436, 1436, 2943,
-     1432, 1437, 1437, 1437, 2951, 1437, 2953, 1433, 1437, 2955,
-     1427, 1435, 2957, 1436, 1440, 1440, 1440, 1441, 1441, 1441,
-     2965, 1441, 2967, 2968, 1441, 1442, 1442, 1442, 1443, 1443,
-
-     1443, 1440, 1445, 1445, 1445, 1447, 1447, 1447, 1451, 1451,
-     1451, 2941, 2942, 1442, 2970, 2970, 1443, 1452, 1452, 1452,
-     1445, 2948, 1447, 2941, 2942, 1435, 1451, 1454, 1454, 1454,
-     1457, 1457, 1457, 2948, 2968, 1452, 1458, 1458, 1458, 1460,
-     1460, 1460, 1461, 1461, 1461, 1454, 1461, 2971, 1457, 1461,
-     1464, 1464, 1464, 2973, 1458, 2975, 2969, 1460, 1465, 1465,
-     1465, 1467, 1467, 1467, 1445, 1468, 1468, 1468, 1464, 1468,
-     2969, 2976, 1468, 1472, 1472, 1472, 1465, 2949, 2977, 1467,
-     1473, 1473, 1473, 1475, 1475, 1475, 2972, 2978, 1454, 2949,
-     2993, 1472, 1460, 1477, 1477, 1477, 2995, 2972, 1473, 2998,
-
-     3000, 1475, 1484, 1484, 1484, 1514, 1514, 1514, 1516, 1516,
-     1516, 1477, 1477, 2987, 1517, 1517, 1517, 1542, 1542, 1542,
-     1484, 1467, 1514, 1515, 1515, 1515, 1516, 1515, 2987, 2992,
-     1515, 1517, 1518, 1518, 1518, 1542, 1518, 3005, 2984, 1518,
-     1521, 1521, 1521, 3006, 1475, 1523, 1523, 1523, 2992, 1523,
-     2994, 3008, 1523, 1526, 1526, 1526, 2984, 2997, 1521, 3009,
-     1527, 1527, 1527, 2999, 1527, 3010, 1516, 1527, 1484, 2994,
-     1526, 1528, 1528, 1528, 3012, 1528, 2997, 3013, 1528, 1532,
-     1532, 1532, 2999, 1533, 1533, 1533, 3014, 1533, 3015, 1521,
-     1533, 1535, 1535, 1535, 3017, 3019, 1532, 1537, 1537, 1537,
-
-     1538, 1538, 1538, 3026, 1538, 3027, 3028, 1538, 3029, 1535,
-     1539, 1539, 1539, 3030, 1537, 1540, 1540, 1540, 1558, 1558,
-     1558, 1559, 1559, 1559, 1560, 1560, 1560, 1539, 1560, 3031,
-     3034, 1560, 3035, 1540, 3036, 1558, 3037, 3038, 1559, 3039,
-     3040, 1535, 1561, 1561, 1561, 1564, 1564, 1564, 1565, 1565,
-     1565, 1566, 1566, 1566, 3041, 1566, 3043, 3045, 1566, 3047,
-     1561, 3048, 3049, 1564, 1540, 1565, 1567, 1567, 1567, 1568,
-     1568, 1568, 1569, 1569, 1569, 3059, 1569, 3060, 3061, 1569,
-     1571, 1571, 1571, 3057, 1567, 3062, 1568, 1574, 1574, 1574,
-     1575, 1575, 1575, 3058, 1575, 3057, 3063, 1575, 1571, 1576,
-
-     1576, 1576, 3064, 3068, 1574, 3058, 1561, 3069, 3070, 1564,
-     1577, 1577, 1577, 1578, 1578, 1578, 1576, 1581, 1581, 1581,
-     3071, 1582, 1582, 1582, 3072, 1582, 1567, 1577, 1582, 3073,
-     3074, 1578, 3075, 3078, 1581, 1583, 1583, 1583, 1584, 1584,
-     1584, 1571, 1585, 1585, 1585, 3079, 1585, 3080, 3081, 1585,
-     1586, 1586, 1586, 1583, 3082, 1584, 1577, 1588, 1588, 1588,
-     1591, 1591, 1591, 1592, 1592, 1592, 3076, 1592, 1586, 3083,
-     1592, 1593, 1593, 1593, 1588, 1593, 3084, 1591, 1593, 1578,
-     1598, 1598, 1598, 1605, 1605, 1605, 1606, 1606, 1606, 3085,
-     1606, 3076, 3086, 1606, 1609, 1609, 1609, 1598, 1610, 1610,
-
-     1610, 1605, 1611, 1611, 1611, 1612, 1612, 1612, 1613, 1613,
-     1613, 1609, 1615, 1615, 1615, 1610, 1586, 3087, 3088, 1611,
-     3089, 3090, 1612, 1618, 1618, 1618, 1613, 1618, 3091, 1615,
-     1618, 3092, 3093, 1621, 1621, 1621, 1623, 1623, 1623, 1625,
-     1625, 1625, 1628, 1628, 1628, 1632, 1632, 1632, 1605, 1611,
-     1621, 1633, 1633, 1633, 1623, 3094, 3095, 1625, 3096, 3097,
-     1628, 3103, 1632, 1613, 3104, 1641, 1641, 1641, 1610, 1633,
-     1634, 1634, 1634, 3100, 1634, 1612, 3105, 1634, 1637, 1637,
-     1637, 3106, 1637, 1641, 3107, 1637, 1643, 1643, 1643, 3108,
-     1643, 1632, 3100, 1643, 1648, 1648, 1648, 3109, 1648, 1628,
-
-     1623, 1648, 1652, 1652, 1652, 1625, 3110, 3111, 1633, 1654,
-     1654, 1654, 1655, 1655, 1655, 3112, 1655, 3113, 3114, 1655,
-     1652, 1658, 1658, 1658, 3115, 1658, 3116, 1654, 1658, 3117,
-     3118, 1641, 1661, 1661, 1661, 1662, 1662, 1662, 3119, 1662,
-     3120, 3121, 1662, 3122, 1667, 1667, 1667, 3123, 1667, 3124,
-     1661, 1667, 1670, 1670, 1670, 1672, 1672, 1672, 1673, 1673,
-     1673, 3121, 1673, 1652, 3125, 1673, 1654, 1677, 1677, 1677,
-     1670, 3126, 1672, 1679, 1679, 1679, 1680, 1680, 1680, 1661,
-     1681, 1681, 1681, 3127, 3128, 1677, 1682, 1682, 1682, 3129,
-     1679, 1683, 1683, 1683, 1680, 1686, 1686, 1686, 1681, 1670,
-
-     1693, 1693, 1693, 1682, 1715, 1715, 1715, 3130, 3131, 1683,
-     1723, 1723, 1723, 1686, 3132, 3133, 1677, 3134, 1693, 1724,
-     1724, 1724, 3135, 1724, 3136, 3137, 1724, 1727, 1727, 1727,
-     3138, 3139, 1681, 1728, 1728, 1728, 3140, 1728, 3143, 3144,
-     1728, 3145, 3140, 1680, 3146, 1727, 1686, 1733, 1733, 1733,
-     1715, 3147, 1693, 1683, 3148, 3150, 1723, 1735, 1735, 1735,
-     3151, 1735, 3153, 1686, 1735, 1733, 1739, 1739, 1739, 3154,
-     1739, 3156, 3157, 1739, 1743, 1743, 1743, 1745, 1745, 1745,
-     3160, 1745, 3161, 3159, 1745, 1748, 1748, 1748, 3162, 1749,
-     1749, 1749, 1743, 1749, 1727, 3163, 1749, 3159, 1733, 1750,
-
-     1750, 1750, 1748, 1758, 1758, 1758, 1759, 1759, 1759, 1763,
-     1763, 1763, 1764, 1764, 1764, 3165, 3167, 1750, 3169, 1766,
-     1766, 1766, 1767, 1767, 1767, 3171, 1767, 3173, 3174, 1767,
-     1768, 1768, 1768, 3175, 1768, 1743, 1766, 1768, 1771, 1771,
-     1771, 1773, 1773, 1773, 1774, 1774, 1774, 1775, 1775, 1775,
-     1750, 1775, 3176, 3177, 1775, 3178, 1771, 3179, 1773, 1778,
-     1778, 1778, 1774, 3180, 1779, 1779, 1779, 3182, 1779, 3184,
-     1759, 1779, 3186, 1763, 3187, 3188, 1764, 1778, 1782, 1782,
-     1782, 1783, 1783, 1783, 3189, 1771, 1786, 1786, 1786, 1522,
-     1786, 1774, 3280, 1786, 3202, 1782, 1789, 1789, 1789, 1783,
-
-     1790, 1790, 1790, 3190, 1790, 3203, 3280, 1790, 3191, 1791,
-     1791, 1791, 1520, 1789, 1792, 1792, 1792, 1519, 1792, 3222,
-     3198, 1792, 1794, 1794, 1794, 1778, 1791, 1795, 1795, 1795,
-     1797, 1797, 1797, 3199, 1797, 3200, 3201, 1797, 3202, 3190,
-     1794, 1800, 1800, 1800, 3191, 1783, 1802, 1802, 1802, 3203,
-     1802, 3222, 3210, 1802, 1805, 1805, 1805, 3223, 3206, 1800,
-     1807, 1807, 1807, 1808, 1808, 1808, 3206, 1808, 3198, 1513,
-     1808, 3276, 1805, 1809, 1809, 1809, 3218, 1807, 1811, 1811,
-     1811, 3199, 1811, 3200, 3201, 1811, 1816, 1816, 1816, 3223,
-     1809, 1817, 1817, 1817, 3207, 1817, 1512, 3204, 1817, 3210,
-
-     1805, 3204, 3207, 1816, 1818, 1818, 1818, 1823, 1823, 1823,
-     1824, 1824, 1824, 1825, 1825, 1825, 1826, 1826, 1826, 3276,
-     1826, 1818, 3218, 1826, 1823, 1827, 1827, 1827, 1824, 3214,
-     1825, 1828, 1828, 1828, 1829, 1829, 1829, 1830, 1830, 1830,
-     3212, 3208, 1827, 1832, 1832, 1832, 3205, 3215, 1828, 3208,
-     3205, 1829, 1833, 1833, 1833, 1830, 1833, 3211, 3230, 1833,
-     1832, 1834, 1834, 1834, 1836, 1836, 1836, 1837, 1837, 1837,
-     3214, 1837, 3209, 3219, 1837, 1510, 1824, 3212, 1834, 3270,
-     3209, 1836, 1839, 1839, 1839, 1841, 1841, 1841, 3215, 1828,
-     1844, 1844, 1844, 1848, 1848, 1848, 3213, 1830, 3220, 3231,
-
-     1839, 3230, 3221, 1841, 3211, 1849, 1849, 1849, 1844, 1849,
-     1848, 3270, 1849, 1851, 1851, 1851, 1853, 1853, 1853, 3219,
-     1855, 1855, 1855, 1856, 1856, 1856, 1857, 1857, 1857, 3216,
-     1509, 1851, 3224, 3213, 1853, 3220, 1841, 1855, 1844, 3221,
-     1856, 3224, 3231, 1857, 1858, 1858, 1858, 1860, 1860, 1860,
-     1861, 1861, 1861, 1862, 1862, 1862, 1863, 1863, 1863, 1864,
-     1864, 1864, 1858, 3228, 3216, 1860, 1508, 1853, 1861, 1507,
-     1862, 3225, 3217, 1863, 1866, 1866, 1866, 1864, 1866, 3232,
-     3225, 1866, 1872, 1872, 1872, 1874, 1874, 1874, 2282, 2282,
-     1857, 2282, 3226, 1860, 1875, 1875, 1875, 3228, 1875, 2282,
-
-     1872, 1875, 1874, 1876, 1876, 1876, 2282, 3217, 1877, 1877,
-     1877, 1858, 1878, 1878, 1878, 1861, 1879, 1879, 1879, 3238,
-     1879, 1876, 1506, 1879, 1864, 3232, 1877, 3226, 3238, 1878,
-     1880, 1880, 1880, 1872, 1886, 1886, 1886, 1887, 1887, 1887,
-     1894, 1894, 1894, 1898, 1898, 1898, 1505, 1504, 1880, 3233,
-     1503, 1886, 1902, 1902, 1902, 1887, 1903, 1903, 1903, 1904,
-     1904, 1904, 1876, 1877, 1906, 1906, 1906, 1908, 1908, 1908,
-     1909, 1909, 1909, 1914, 1914, 1914, 1916, 1916, 1916, 1919,
-     1919, 1919, 1921, 1921, 1921, 1923, 1923, 1923, 1924, 1924,
-     1924, 1936, 1936, 1936, 1916, 3233, 3227, 1919, 1887, 1921,
-
-     1933, 1933, 1933, 1923, 1933, 1924, 1502, 1933, 1500, 1936,
-     1937, 1937, 1937, 1942, 1942, 1942, 1943, 1943, 1943, 1947,
-     1947, 1947, 1951, 1951, 1951, 3239, 1916, 1937, 1948, 1948,
-     1948, 3227, 1948, 1499, 3239, 1948, 1947, 1936, 3229, 3234,
-     1951, 1952, 1952, 1952, 1923, 1953, 1953, 1953, 1954, 1954,
-     1954, 3262, 1954, 3248, 3235, 1954, 3242, 3236, 1952, 1955,
-     1955, 1955, 1953, 1956, 1956, 1956, 1957, 1957, 1957, 1958,
-     1958, 1958, 3229, 1958, 3234, 1951, 1958, 1955, 1959, 1959,
-     1959, 1956, 3248, 1957, 1962, 1962, 1962, 3240, 1962, 3235,
-     3236, 1962, 3262, 1965, 1965, 1965, 1959, 1965, 3242, 3237,
-
-     1965, 1969, 1969, 1969, 1971, 1971, 1971, 3243, 1973, 1973,
-     1973, 3249, 1955, 1975, 1975, 1975, 3264, 1975, 3244, 1969,
-     1975, 1978, 1978, 1978, 3240, 1959, 1973, 1979, 1979, 1979,
-     3241, 1979, 3237, 3246, 1979, 1983, 1983, 1983, 1978, 1983,
-     3249, 1497, 1983, 1986, 1986, 1986, 1987, 1987, 1987, 3243,
-     1987, 3264, 3247, 1987, 1988, 1988, 1988, 1992, 1992, 1992,
-     1986, 1993, 1993, 1993, 3244, 1993, 1973, 3241, 1993, 1496,
-     3246, 1988, 3250, 3245, 1992, 1994, 1994, 1994, 1995, 1995,
-     1995, 3250, 1995, 1494, 1491, 1995, 1998, 1998, 1998, 3247,
-     1999, 1999, 1999, 1994, 1999, 3252, 3271, 1999, 2000, 2000,
-
-     2000, 3251, 3281, 1998, 2001, 2001, 2001, 2002, 2002, 2002,
-     3251, 2002, 3253, 3281, 2002, 2000, 2003, 2003, 2003, 3245,
-     3254, 2001, 3255, 2005, 2005, 2005, 1994, 2005, 3271, 3252,
-     2005, 2008, 2008, 2008, 2003, 2009, 2009, 2009, 1490, 2009,
-     1489, 3256, 2009, 2011, 2011, 2011, 3253, 2011, 2008, 3256,
-     2011, 2015, 2015, 2015, 2018, 2018, 2018, 2020, 2020, 2020,
-     2021, 2021, 2021, 2023, 2023, 2023, 3254, 2003, 3255, 2015,
-     3260, 3261, 2018, 3257, 2020, 2025, 2025, 2025, 2021, 2025,
-     2023, 3257, 2025, 2029, 2029, 2029, 2032, 2032, 2032, 2034,
-     2034, 2034, 2035, 2035, 2035, 3258, 2035, 1488, 3259, 2035,
-
-     1487, 2029, 3263, 1486, 2032, 1485, 2034, 3260, 3261, 2023,
-     2036, 2036, 2036, 2037, 2037, 2037, 3274, 2037, 2018, 1483,
-     2037, 2021, 2039, 2039, 2039, 3265, 3275, 2036, 2041, 2041,
-     2041, 2042, 2042, 2042, 2043, 2043, 2043, 2044, 2044, 2044,
-     2039, 2044, 3258, 3263, 2044, 3259, 2041, 3278, 3274, 2042,
-     3279, 2043, 2045, 2045, 2045, 2046, 2046, 2046, 3275, 2046,
-     3265, 3268, 2046, 2047, 2047, 2047, 2052, 2052, 2052, 2045,
-     3266, 2054, 2054, 2054, 3272, 2054, 3277, 2041, 2054, 3278,
-     3267, 2047, 3279, 3272, 2052, 2057, 2057, 2057, 2039, 2058,
-     2058, 2058, 3269, 2059, 2059, 2059, 2042, 2059, 3268, 1482,
-
-     2059, 1481, 1480, 2057, 2062, 2062, 2062, 2058, 2068, 2068,
-     2068, 2069, 2069, 2069, 3273, 2069, 3266, 1471, 2069, 2070,
-     2070, 2070, 2062, 3273, 3277, 2068, 3267, 1456, 2047, 3269,
-     1455, 2052, 2071, 2071, 2071, 1450, 2057, 2070, 2076, 2076,
-     2076, 1449, 2058, 2077, 2077, 2077, 2078, 2078, 2078, 2080,
-     2080, 2080, 2084, 2084, 2084, 2085, 2085, 2085, 2086, 2086,
-     2086, 2087, 2087, 2087, 2089, 2089, 2089, 2090, 2090, 2090,
-     2091, 2091, 2091, 2092, 2092, 2092, 2093, 2093, 2093, 2094,
-     2094, 2094, 1448, 2070, 2096, 2096, 2096, 2099, 2099, 2099,
-     1446, 2102, 2102, 2102, 2103, 2103, 2103, 1439, 2103, 1438,
-
-     1420, 2103, 2096, 1415, 1412, 2099, 1411, 2087, 2102, 2105,
-     2105, 2105, 2106, 2106, 2106, 2107, 2107, 2107, 1408, 2107,
-     1403, 1394, 2107, 2118, 2118, 2118, 1393, 2105, 1392, 2106,
-     2119, 2119, 2119, 1388, 1383, 2096, 2120, 2120, 2120, 1379,
-     2120, 2118, 1371, 2120, 2121, 2121, 2121, 2119, 2126, 2126,
-     2126, 2127, 2127, 2127, 2128, 2128, 2128, 2129, 2129, 2129,
-     1366, 2129, 1365, 1359, 2129, 2130, 2130, 2130, 2131, 2131,
-     2131, 2128, 2118, 2132, 2132, 2132, 1358, 2132, 1357, 1356,
-     2132, 1351, 1350, 2130, 1349, 2131, 2133, 2133, 2133, 1348,
-     2133, 1335, 1334, 2133, 2136, 2136, 2136, 2127, 1333, 2137,
-
-     2137, 2137, 2139, 2139, 2139, 1332, 2139, 1331, 1330, 2139,
-     1329, 1328, 2136, 2142, 2142, 2142, 2130, 2137, 2149, 2149,
-     2149, 2151, 2151, 2151, 1327, 2151, 1317, 1316, 2151, 1315,
-     1314, 2142, 1297, 2157, 2157, 2157, 2149, 2157, 1296, 1291,
-     2157, 2160, 2160, 2160, 1290, 2136, 2161, 2161, 2161, 1285,
-     2161, 1284, 1265, 2161, 1261, 2165, 2165, 2165, 2160, 2165,
-     1255, 1251, 2165, 2168, 2168, 2168, 2142, 2169, 2169, 2169,
-     1250, 2169, 1249, 2149, 2169, 2172, 2172, 2172, 2173, 2173,
-     2173, 2168, 2173, 1248, 1247, 2173, 2174, 2174, 2174, 1246,
-     2174, 1245, 2172, 2174, 2177, 2177, 2177, 2179, 2179, 2179,
-
-     1243, 2179, 1242, 1240, 2179, 2185, 2185, 2185, 2187, 2187,
-     2187, 1239, 2177, 2188, 2188, 2188, 1238, 2188, 1233, 1225,
-     2188, 1223, 1218, 2185, 1216, 2187, 1207, 2168, 2189, 2189,
-     2189, 2191, 2191, 2191, 2192, 2192, 2192, 1202, 2192, 1191,
-     1189, 2192, 1188, 2199, 2199, 2199, 2189, 1187, 2191, 2202,
-     2202, 2202, 1186, 2202, 1184, 1183, 2202, 2209, 2209, 2209,
-     2177, 2199, 2205, 2205, 2205, 1182, 2205, 1181, 1180, 2205,
-     1179, 2211, 2211, 2211, 1177, 2209, 2212, 2212, 2212, 2213,
-     2213, 2213, 1176, 2213, 1175, 1174, 2213, 1173, 2189, 2211,
-     1172, 2216, 2216, 2216, 2212, 2216, 1171, 1169, 2216, 2219,
-
-     2219, 2219, 1168, 2220, 2220, 2220, 1167, 1166, 2209, 2221,
-     2221, 2221, 2212, 2222, 2222, 2222, 1165, 2219, 1164, 2219,
-     2220, 2223, 2223, 2223, 1163, 1157, 2221, 2224, 2224, 2224,
-     2222, 2226, 2226, 2226, 2227, 2227, 2227, 2211, 2223, 2228,
-     2228, 2228, 2231, 2231, 2231, 2224, 2232, 2232, 2232, 2226,
-     2232, 1156, 2227, 2232, 2235, 2235, 2235, 2228, 1155, 1152,
-     2221, 2236, 2236, 2236, 2237, 2237, 2237, 2238, 2238, 2238,
-     1151, 1150, 2235, 2241, 2241, 2241, 1148, 2222, 1144, 1141,
-     2223, 2242, 2242, 2242, 2244, 2244, 2244, 2245, 2245, 2245,
-     1132, 2226, 2224, 2246, 2246, 2246, 2247, 2247, 2247, 2248,
-
-     2248, 2248, 2249, 2249, 2249, 2252, 2252, 2252, 2253, 2253,
-     2253, 1131, 1128, 2235, 2254, 2254, 2254, 2255, 2255, 2255,
-     2257, 2257, 2257, 2260, 2260, 2260, 2261, 2261, 2261, 1127,
-     2261, 1126, 1125, 2261, 2264, 2264, 2264, 1124, 2257, 1110,
-     2260, 2265, 2265, 2265, 1103, 2267, 2267, 2267, 1095, 2267,
-     1094, 2264, 2267, 2280, 2280, 2280, 2281, 2281, 2281, 2265,
-     2281, 2283, 2283, 2281, 2283, 2284, 2284, 2284, 2285, 2285,
-     2285, 2280, 2283, 2289, 2289, 2289, 2291, 2291, 2291, 2283,
-     2291, 1093, 1090, 2291, 2294, 2294, 2294, 2295, 2295, 2295,
-     1087, 2295, 1084, 1079, 2295, 2298, 2298, 2298, 1076, 1075,
-
-     2264, 1071, 2294, 2299, 2299, 2299, 2307, 2307, 2307, 2308,
-     2308, 2308, 1069, 2298, 2280, 2313, 2313, 2313, 1055, 2313,
-     1054, 2299, 2313, 2316, 2316, 2316, 1053, 2308, 1052, 1051,
-     2294, 2319, 2319, 2319, 2320, 2320, 2320, 1050, 2320, 1049,
-     2316, 2320, 2323, 2323, 2323, 2328, 2328, 2328, 1048, 2319,
-     2330, 2330, 2330, 1047, 2299, 2331, 2331, 2331, 1043, 2331,
-     2323, 1039, 2331, 2328, 2334, 2334, 2334, 2330, 1032, 2308,
-     2335, 2335, 2335, 2336, 2336, 2336, 1029, 2336, 1028, 1027,
-     2336, 1024, 2334, 2339, 2339, 2339, 1023, 2335, 2340, 2340,
-     2340, 2345, 2345, 2345, 2347, 2347, 2347, 2350, 2350, 2350,
-
-     2339, 2349, 2349, 2349, 1020, 2340, 1019, 1018, 2345, 2351,
-     2351, 2351, 1015, 1014, 2350, 2334, 2335, 1011, 1006, 2349,
-     1003, 2352, 2352, 2352, 2354, 2354, 2354, 2351, 2353, 2353,
-     2353, 1000,  999, 2355, 2355, 2355,  996, 2355, 2339, 2352,
-     2355, 2354, 2345, 2356, 2356, 2356, 2353,  995,  994, 2340,
-     2357, 2357, 2357, 2358, 2358, 2358, 2359, 2359, 2359,  993,
-     2356, 2360, 2360, 2360,  992, 2353,  990, 2357,  989, 2351,
-     2358, 2361, 2361, 2361, 2359, 2362, 2362, 2362, 2364, 2364,
-     2364,  988, 2352, 2367, 2367, 2367, 2369, 2369, 2369, 2361,
-     2368, 2368, 2368, 2362,  987,  986, 2364, 2370, 2370, 2370,
-
-      985, 2357,  984,  983, 2358, 2373, 2373, 2373, 2368, 2374,
-     2374, 2374, 2375, 2375, 2375, 2376, 2376, 2376, 2380, 2380,
-     2380, 2383, 2383, 2383, 2384, 2384, 2384,  979, 2384,  974,
-      973, 2384, 2396, 2396, 2396,  972, 2380, 2361, 2383,  969,
-     2364, 2407, 2407, 2407, 2410, 2410, 2410, 2412, 2412, 2412,
-     2396, 2413, 2413, 2413, 2415, 2415, 2415, 2422, 2422, 2422,
-     2423, 2423, 2423,  968,  967, 2412, 2424, 2424, 2424, 2413,
-      965,  961, 2415,  957, 2422,  956, 2430, 2430, 2430, 2431,
-     2431, 2431,  953, 2431, 2424,  950, 2431, 2433, 2433, 2433,
-      949,  948, 2396, 2430, 2434, 2434, 2434, 2436, 2436, 2436,
-
-     2440, 2440, 2440,  947, 2433, 2442, 2442, 2442,  946, 2444,
-     2444, 2444, 2434, 2412,  945, 2436,  944, 2440, 2445, 2445,
-     2445,  942, 2442, 2424, 2443, 2443, 2443, 2444, 2443,  941,
-      940, 2443, 2446, 2446, 2446, 2445, 2446,  939,  938, 2446,
-     2447, 2447, 2447, 2448, 2448, 2448, 2449, 2449, 2449, 2454,
-     2454, 2454, 2456, 2456, 2456,  937,  936, 2447,  935,  934,
-     2448,  933,  932, 2449,  931,  930, 2454, 2458, 2458, 2458,
-     2460, 2460, 2460, 2461, 2461, 2461,  929, 2461,  928,  927,
-     2461, 2462, 2462, 2462,  926, 2458,  925, 2460, 2463, 2463,
-     2463,  924, 2447, 2464, 2464, 2464, 2465, 2465, 2465, 2462,
-
-     2465, 2448,  923, 2465, 2449,  922, 2463, 2468, 2468, 2468,
-      918, 2464, 2469, 2469, 2469,  917, 2469,  915,  914, 2469,
-     2470, 2470, 2470,  913, 2468, 2471, 2471, 2471, 2472, 2472,
-     2472, 2474, 2474, 2474, 2475, 2475, 2475, 2470, 2479, 2479,
-     2479,  912, 2471, 2483, 2483, 2483, 2472, 2487, 2487, 2487,
-      911,  907, 2475,  905,  904, 2463, 2479, 2464, 2488, 2488,
-     2488,  903, 2488,  902, 2487, 2488, 2502, 2502, 2502, 2517,
-     2517, 2517, 2519, 2519, 2519, 2520, 2520, 2520, 2523, 2523,
-     2523, 2526, 2526, 2526, 2502, 2527, 2527, 2527,  898, 2527,
-     2519,  894, 2527, 2520,  893, 2523,  890,  889, 2526, 2528,
-
-     2528, 2528, 2532, 2532, 2532, 2534, 2534, 2534,  888, 2534,
-      887,  886, 2534, 2538, 2538, 2538,  885, 2528,  884, 2532,
-     2539, 2539, 2539,  881, 2539,  880, 2502, 2539,  879,  878,
-     2538, 2541, 2541, 2541, 2542, 2542, 2542, 2543, 2543, 2543,
-      875, 2543,  874, 2519, 2543, 2544, 2544, 2544, 2541,  873,
-      870, 2542, 2545, 2545, 2545,  868, 2545,  865,  864, 2545,
-      863,  862, 2544, 2548, 2548, 2548, 2550, 2550, 2550,  861,
-     2550,  858,  857, 2550, 2553, 2553, 2553, 2554, 2554, 2554,
-      856, 2548, 2555, 2555, 2555, 2558, 2558, 2558, 2559, 2559,
-     2559, 2553, 2559,  855, 2554, 2559, 2560, 2560, 2560, 2555,
-
-      854,  851, 2558, 2561, 2561, 2561,  850, 2562, 2562, 2562,
-      849, 2562,  848, 2560, 2562, 2565, 2565, 2565,  846,  843,
-     2561, 2567, 2567, 2567, 2568, 2568, 2568,  842, 2554, 2553,
-     2572, 2572, 2572, 2565, 2569, 2569, 2569, 2555, 2569, 2567,
-      840, 2569, 2568,  837, 2573, 2573, 2573, 2572, 2573,  835,
-      832, 2573, 2574, 2574, 2574, 2575, 2575, 2575,  831, 2575,
-      830,  829, 2575, 2576, 2576, 2576, 2582, 2582, 2582, 2574,
-      827, 2586, 2586, 2586,  826, 2587, 2587, 2587,  825, 2587,
-      822, 2576, 2587,  821,  820, 2568,  819, 2567, 2586, 2605,
-     2605, 2605, 2619, 2619, 2619, 2621, 2621, 2621, 2622, 2622,
-
-     2622, 2623, 2623, 2623, 2624, 2624, 2624, 2605, 2624,  818,
-      817, 2624,  812, 2621,  811, 2622,  810,  809, 2623, 2625,
-     2625, 2625,  808, 2625,  807,  806, 2625, 2628, 2628, 2628,
-     2632, 2632, 2632, 2633, 2633, 2633,  805, 2635, 2635, 2635,
-     2605, 2676, 2676, 2676, 2622, 2628,  804, 2632,  803,  802,
-     2633, 2634, 2634, 2634, 2635, 2634,  800, 2621, 2634, 2637,
-     2637, 2637,  798, 2637,  797,  794, 2637, 2641, 2641, 2641,
-     2642, 2642, 2642,  791, 2642,  788,  787, 2642, 2643, 2643,
-     2643,  783, 2643,  782, 2641, 2643, 2646, 2646, 2646, 2647,
-     2647, 2647,  781, 2647,  778,  775, 2647, 2648, 2648, 2648,
-
-     2649, 2649, 2649, 2646, 2650, 2650, 2650,  774, 2651, 2651,
-     2651,  773, 2651,  770, 2648, 2651,  769, 2649, 2654, 2654,
-     2654, 2650, 2655, 2655, 2655,  765, 2655,  764,  762, 2655,
-     2656, 2656, 2656,  759,  758, 2654, 2657, 2657, 2657,  757,
-     2657,  755,  744, 2657, 2664, 2664, 2664, 2656, 2665, 2665,
-     2665,  742,  739, 2650,  738, 2648, 2666, 2666, 2666,  737,
-     2666,  735, 2664, 2666,  734,  733, 2665, 2669, 2669, 2669,
-      729, 2669,  728,  727, 2669, 2674, 2674, 2674, 2677, 2677,
-     2677, 2680, 2680, 2680,  726, 2680,  723,  722, 2680, 2691,
-     2691, 2691, 2674, 2674,  721, 2664, 2700, 2700, 2700, 2714,
-
-     2714, 2714, 2715, 2715, 2715,  720, 2691, 2716, 2716, 2716,
-     2717, 2717, 2717,  719, 2700, 2665, 2718, 2718, 2718,  718,
-     2718,  717,  715, 2718,  712, 2716,  711, 2717, 2720, 2720,
-     2720,  709, 2720,  707,  704, 2720, 2725, 2725, 2725, 2726,
-     2726, 2726,  703, 2726,  697, 2700, 2726, 2727, 2727, 2727,
-      695, 2727,  693, 2725, 2727, 2730, 2730, 2730, 2716, 2731,
-     2731, 2731,  690, 2731,  689,  685, 2731, 2734, 2734, 2734,
-      684, 2734, 2730,  683, 2734, 2737, 2737, 2737,  682, 2737,
-      679,  678, 2737, 2740, 2740, 2740, 2741, 2741, 2741, 2742,
-     2742, 2742,  677, 2742,  676,  673, 2742, 2743, 2743, 2743,
-
-     2740,  672,  671, 2741, 2744, 2744, 2744,  670, 2744,  669,
-      663, 2744,  662,  660, 2743, 2747, 2747, 2747,  654, 2747,
-      653,  649, 2747, 2756, 2756, 2756, 2757, 2757, 2757, 2763,
-     2763, 2763,  642,  638, 2740, 2764, 2764, 2764, 2765, 2765,
-     2765, 2756, 2765,  632, 2757, 2765, 2763, 2763, 2766, 2766,
-     2766,  628, 2764, 2764,  620,  619, 2765, 2767, 2767, 2767,
-     2768, 2768, 2768, 2769, 2769, 2769,  618,  617, 2743, 2778,
-     2778, 2778, 2779, 2779, 2779,  616, 2779,  612,  605, 2779,
-     2788, 2788, 2788, 2801, 2801, 2801, 2778, 2802, 2802, 2802,
-      604,  603, 2757, 2803, 2803, 2803,  599,  592, 2788, 2804,
-
-     2804, 2804,  591, 2804,  587,  581, 2804,  580, 2810, 2810,
-     2810, 2803, 2810,  576,  568, 2810, 2813, 2813, 2813,  567,
-     2813,  563,  554, 2813, 2816, 2816, 2816, 2818, 2818, 2818,
-     2819, 2819, 2819,  550, 2819,  542,  541, 2819, 2822, 2822,
-     2822, 2816,  540,  536, 2818,  530, 2788, 2837, 2837, 2837,
-     2839, 2839, 2839,  529,  528, 2822, 2845, 2845, 2845, 2846,
-     2846, 2846,  524, 2846,  518, 2837, 2846,  517, 2839, 2850,
-     2850, 2850,  513, 2845, 2845,  507,  506, 2846, 2847, 2847,
-     2847,  505, 2847,  504,  503, 2847, 2851, 2851, 2851, 2852,
-     2852, 2852,  502, 2861, 2861, 2861, 2847, 2861,  501,  497,
-
-     2861, 2839, 2848, 2848, 2848, 2848, 2848, 2848, 2848, 2848,
-     2848,  491,  490, 2848, 2870, 2870, 2870,  488, 2848, 2848,
-     2848, 2848, 2848, 2879, 2879, 2879, 2880, 2880, 2880, 2885,
-     2885, 2885, 2870, 2886, 2886, 2886,  487, 2886,  486,  482,
-     2886, 2888, 2888, 2888, 2880,  471, 2885, 2848, 2848, 2849,
-     2849, 2849, 2849, 2849, 2849, 2849, 2849, 2849, 2888,  470,
-     2849, 2890, 2890, 2890,  468, 2849, 2849, 2849, 2849, 2849,
-     2889, 2889, 2889,  464, 2889,  458,  457, 2889, 2890, 2891,
-     2891, 2891,  456, 2891,  452,  446, 2891, 2904, 2904, 2904,
-     2929, 2929, 2929,  442, 2849, 2849, 2910, 2910, 2910,  434,
-
-     2910,  433,  432, 2910,  431, 2904,  430,  426, 2929, 2962,
-     2962, 2962,  420,  419, 2910, 2913, 2913, 2913, 2913, 2913,
-     2913, 2913, 2913, 2913,  415,  409, 2913, 2962,  408,  404,
-      397, 2913, 2913, 2913, 2913, 2913, 2940, 2940, 2940,  396,
-     2940,  395,  391, 2940, 2944, 2944, 2944,  384, 2944,  383,
-      382, 2944, 2947, 2947, 2947,  381, 2947,  377,  368, 2947,
-     2913, 2913, 2914, 2914, 2914, 2914, 2914, 2914, 2914, 2914,
-     2914,  362,  358, 2914, 2974, 2974, 2974,  357, 2914, 2914,
-     2914, 2914, 2914, 2989, 2989, 2989, 2990, 2990, 2990, 2991,
-     2991, 2991, 2974, 2974, 2996, 2996, 2996, 3007, 3007, 3007,
-
-     2989,  353,  347, 2990,  346,  345, 2991, 2914, 2914,  341,
-      334, 2996, 3011, 3011, 3011, 3007, 3020, 3020, 3020, 3021,
-     3021, 3021,  332, 3021,  331,  327, 3021, 3022, 3022, 3022,
-     3011,  324,  322, 3020, 3023, 3023, 3023,  321, 3023,  320,
-      316, 3023,  312,  309, 3022, 3024, 3024, 3024, 3025, 3025,
-     3025,  305, 3025,  302,  301, 3025, 3032, 3032, 3032, 3042,
-     3042, 3042, 3024, 3011, 3033, 3033, 3033,  293, 3033,  289,
-      285, 3033,  284, 3032, 3050, 3050, 3050, 3042, 3050,  283,
-      277, 3050, 3053, 3053, 3053,  276, 3053,  274,  271, 3053,
-     3056, 3056, 3056,  259, 3056,    0, 3042, 3056, 3065, 3065,
-
-     3065,    0, 3065,    0,    0, 3065, 3172, 3172, 3172, 3181,
-     3181, 3181,    0, 3181,    0,    0, 3181, 3282, 3282, 3282,
-     3283, 3283, 3283,    0, 3172,    0,    0, 3181,    0,    0,
-        0,    0,    0,    0,    0, 3282,    0,    0, 3283, 3286,
-     3286, 3286, 3286, 3286, 3286, 3286, 3286, 3286, 3287, 3287,
-     3287, 3287, 3287, 3287, 3287, 3287, 3287, 3288, 3288, 3288,
-     3288, 3288, 3288, 3288, 3288, 3288, 3289, 3289, 3289, 3289,
-     3289, 3289, 3289, 3289, 3289, 3290, 3290, 3290, 3290, 3290,
-     3290, 3290, 3290, 3290, 3291, 3291, 3291, 3291, 3291, 3291,
-     3291, 3291, 3291, 3292, 3292, 3292, 3292, 3292, 3292, 3292,
-
-     3292, 3292, 3293, 3293, 3293, 3293, 3293, 3293, 3293, 3293,
-     3293, 3294, 3294, 3294, 3294, 3294, 3294, 3294, 3294, 3294,
-     3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295, 3295, 3296,
-     3296, 3296, 3296, 3296, 3296, 3296, 3296, 3296, 3297, 3297,
-     3297, 3297, 3297, 3297, 3297, 3297, 3297, 3298, 3298, 3298,
-     3298, 3298, 3298, 3298, 3298, 3298, 3299, 3299, 3299, 3299,
-     3299, 3299, 3299, 3299, 3299, 3300, 3300, 3300, 3300, 3300,
-     3300, 3300, 3300, 3300, 3301, 3301, 3301, 3301, 3301, 3301,
-     3301, 3301, 3301, 3302, 3302, 3302, 3302, 3302, 3302, 3302,
-     3302, 3302, 3303, 3303, 3303, 3303, 3303, 3303, 3303, 3303,
-
-     3303, 3304, 3304, 3304, 3304, 3304, 3304, 3304, 3304, 3304,
-     3305, 3305, 3305, 3305, 3305, 3305, 3305, 3305, 3305, 3306,
-     3306, 3306, 3306, 3306, 3306, 3306, 3306, 3306, 3307, 3307,
-     3307, 3307, 3307, 3307, 3307, 3307, 3307, 3308, 3308, 3308,
-     3308, 3308, 3308, 3308, 3308, 3308, 3309, 3309, 3309, 3309,
-     3309, 3309, 3309, 3309, 3309, 3310, 3310, 3310, 3310, 3310,
-     3310, 3310, 3310, 3310, 3311, 3311, 3311, 3311, 3311, 3311,
-     3311, 3311, 3311, 3312, 3312, 3312, 3312, 3312, 3312, 3312,
-     3312, 3312, 3313, 3313, 3313, 3313, 3313, 3313, 3313, 3313,
-     3313, 3314, 3314, 3314, 3314, 3314, 3314, 3314, 3314, 3314,
-
-     3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315, 3315, 3316,
-     3316, 3316, 3316, 3316, 3316, 3316, 3316, 3316, 3317, 3317,
-     3317, 3317, 3317, 3317, 3317, 3317, 3317, 3318, 3318, 3318,
-     3318, 3318, 3318, 3318, 3318, 3318, 3319, 3319, 3319, 3319,
-     3319, 3319, 3319, 3319, 3319, 3320, 3320, 3320, 3320, 3320,
-     3320, 3320, 3320, 3320, 3321, 3321, 3321, 3321, 3321, 3321,
-     3321, 3321, 3321, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
-     3322, 3322, 3323, 3323, 3323, 3323, 3323, 3323, 3323, 3323,
+     1098,  254,  254,  254,  254,  254, 1101, 1101, 1101, 1103,
+
+     1103, 1103, 1105, 1105, 1105, 2497, 1106, 1106, 1106, 1107,
+     1107, 1107, 2498, 1101, 1109, 1109, 1109, 1103, 2496, 1105,
+      254,  254, 2511, 1106, 2512, 2513, 1107, 2514, 1110, 1110,
+     1110,  254, 1109, 1108, 1108, 1108, 1112, 1112, 1112, 1114,
+     1114, 1114, 2515, 2516,  254,  296, 1110, 1116, 1116, 1116,
+     1108, 2517,  296, 1112, 2518, 1101, 1106, 1114, 2496, 2519,
+     1103,  296,  296, 2520, 1116, 1110, 1115, 1115, 1115, 2521,
+     2523, 1106, 1898, 1898, 1898, 2524, 1117, 1117, 1117, 2525,
+     1118, 1118, 1118, 2526, 1115, 1119, 1119, 1119, 2527,  296,
+      296,  296, 1108, 1117, 2528,  296,  296,  296, 1118, 2529,
+
+      296,  296, 2530, 1119,  296, 2531,  296,  296,  296,  361,
+     1120, 1120, 1120, 1121, 1121, 1121,  361, 1122, 1122, 1122,
+     2532, 1115, 1123, 1123, 1123,  361,  361, 1120, 2533, 2534,
+     1121, 1124, 1124, 1124, 1122, 1136, 1136, 1136, 2509, 2535,
+     1123, 1140, 1140, 1140, 1130, 1130, 1130, 2536, 2509, 1124,
+     2538, 2509, 1136,  361,  361,  361, 1119, 2539, 1140,  361,
+      361,  361, 1130, 1121,  361,  361, 2541, 2547,  361, 2554,
+      361,  361,  361, 1131, 1131, 1131, 2555, 2556, 1121, 1134,
+     1134, 1134, 1135, 1135, 1135, 1137, 1137, 1137, 2510, 1137,
+     2558, 1131, 1137, 1138, 1138, 1138, 2562, 1134, 2510, 2565,
+
+     1135, 2510, 1124, 1139, 1139, 1139, 1141, 1141, 1141, 2606,
+     1141, 1138, 2603, 1141, 1143, 1143, 1143, 1144, 1144, 1144,
+     2608, 1139, 1159, 1159, 1159, 1160, 1160, 1160, 2588, 1162,
+     1162, 1162, 1143, 2609, 2610, 1144, 2613, 1131, 2588, 2614,
+     1159, 2603, 2616, 1160, 2588, 2617, 1135, 1162, 1193, 1193,
+     1193, 1194, 1194, 1194, 1195, 1195, 1195, 1197, 1197, 1197,
+     1198, 1198, 1198, 2604, 1139, 1193, 1199, 1199, 1199, 1194,
+     1199, 2619, 1195, 1199, 2605, 1197, 1162, 1198, 1202, 1202,
+     1202, 1144, 1204, 1204, 1204, 1205, 1205, 1205, 2589, 1207,
+     1207, 1207, 1209, 1209, 1209, 1202, 1209, 2620, 2589, 1209,
+
+     1204, 2615, 2621, 1205, 2589, 2604, 1197, 1207, 1212, 1212,
+     1212, 1213, 1213, 1213, 2615, 1213, 2605, 2618, 1213, 2622,
+     1214, 1214, 1214, 2623, 2625, 1212, 1215, 1215, 1215, 2626,
+     2618, 1216, 1216, 1216, 2627, 1216, 1207, 1214, 1216, 1202,
+     1218, 1218, 1218, 1215, 1220, 1220, 1220, 1221, 1221, 1221,
+     1223, 1223, 1223, 1225, 1225, 1225, 2628, 1218, 1227, 1227,
+     1227, 2631, 1220, 2632, 2633, 1221, 2634, 2635, 1223, 2636,
+     1225, 1228, 1228, 1228, 2637, 2638, 1227, 1230, 1230, 1230,
+     1231, 1231, 1231, 2639, 1231, 2640, 2641, 1231, 2642, 1228,
+     1235, 1235, 1235, 2643, 2645, 1230, 1236, 1236, 1236, 1238,
+
+     1238, 1238, 1253, 1253, 1253, 2657, 1253, 2658, 1235, 1253,
+     1223, 1257, 1257, 1257, 1236, 2663, 2667, 1238, 1258, 1258,
+     1258, 1259, 1259, 1259, 1230, 1261, 1261, 1261, 1257, 2685,
+     1263, 1263, 1263, 2686, 1263, 2687, 1258, 1263, 2688, 1259,
+     1267, 1267, 1267, 1261, 1268, 1268, 1268, 1270, 1270, 1270,
+     1271, 1271, 1271, 1272, 1272, 1272, 2689, 2690, 1267, 1273,
+     1273, 1273, 1268, 2702, 2700, 1270, 2705, 1271, 2706, 2710,
+     1272, 1274, 1274, 1274, 1276, 1276, 1276, 1273, 1277, 1277,
+     1277, 1278, 1278, 1278, 2694, 2711, 1261, 2712, 2713, 1274,
+     2714, 2715, 1276, 2716, 2695, 1277, 2717, 2694, 1278, 2700,
+
+     1272, 1279, 1279, 1279, 1280, 1280, 1280, 2695, 1270, 1278,
+     1282, 1282, 1282, 1285, 1285, 1285, 1286, 1286, 1286, 1279,
+     1286, 2719, 1280, 1286, 1292, 1292, 1292, 2720, 1282, 2721,
+     1285, 1293, 1293, 1293, 1295, 1295, 1295, 1298, 1298, 1298,
+     2722, 1276, 1292, 1299, 1299, 1299, 1300, 1300, 1300, 1293,
+     2723, 2724, 1295, 2725, 1298, 1302, 1302, 1302, 1303, 1303,
+     1303, 1299, 2726, 2728, 1300, 1304, 1304, 1304, 2699, 1304,
+     2729, 2730, 1304, 1302, 2731, 1303, 1282, 1307, 1307, 1307,
+     2732, 1307, 2733, 2734, 1307, 1310, 1310, 1310, 1311, 1311,
+     1311, 1313, 1313, 1313, 1318, 1318, 1318, 2735, 1318, 1295,
+
+     2736, 1318, 2737, 1310, 2738, 2739, 1311, 2740, 2750, 1313,
+     1321, 1321, 1321, 1322, 1322, 1322, 2699, 1322, 2754, 2755,
+     1322, 2763, 1302, 1325, 1325, 1325, 2764, 1321, 1326, 1326,
+     1326, 2781, 1326, 2782, 2783, 1326, 1336, 1336, 1336, 2784,
+     1325, 1337, 1337, 1337, 1339, 1339, 1339, 2776, 1340, 1340,
+     1340, 2777, 1340, 2785, 1336, 1340, 1313, 2776, 2779, 1337,
+     2786, 2777, 1339, 1343, 1343, 1343, 2789, 1343, 2779, 2780,
+     1343, 1346, 1346, 1346, 1347, 1347, 1347, 2790, 1347, 2780,
+     2791, 1347, 1352, 1352, 1352, 1353, 1353, 1353, 1346, 1355,
+     1355, 1355, 1360, 1360, 1360, 2792, 1360, 2793, 2801, 1360,
+
+     1352, 2802, 2803, 1353, 1363, 1363, 1363, 1355, 1364, 1364,
+     1364, 1339, 1364, 2804, 2805, 1364, 1367, 1367, 1367, 2806,
+     2807, 1363, 1368, 1368, 1368, 1370, 1370, 1370, 1372, 1372,
+     1372, 2793, 1372, 2808, 1367, 1372, 2811, 1355, 2812, 2814,
+     1368, 2815, 2816, 1370, 1375, 1375, 1375, 1376, 1376, 1376,
+     1378, 1378, 1378, 1380, 1380, 1380, 2818, 1380, 2820, 2821,
+     1380, 2822, 1375, 2825, 2826, 1376, 2827, 2828, 1378, 1384,
+     1384, 1384, 1385, 1385, 1385, 2831, 1370, 1387, 1387, 1387,
+     2844, 1389, 1389, 1389, 2845, 1389, 2846, 1384, 1389, 2854,
+     1385, 1395, 1395, 1395, 2860, 1387, 1396, 1396, 1396, 2861,
+
+     1398, 1398, 1398, 1399, 1399, 1399, 1400, 1400, 1400, 1395,
+     1400, 2862, 2863, 1400, 1396, 2864, 2865, 1378, 1398, 2866,
+     1399, 1401, 1401, 1401, 2867, 2868, 1387, 1402, 1402, 1402,
+     2869, 1402, 2871, 2872, 1402, 1404, 1404, 1404, 1401, 1405,
+     1405, 1405, 2877, 1407, 1407, 1407, 1409, 1409, 1409, 2878,
+     1413, 1413, 1413, 1404, 1902, 1902, 1902, 1405, 2879, 2880,
+     1398, 1407, 2890, 1409, 1410, 1410, 1410, 1413, 1410, 2891,
+     2892, 1410, 1414, 1414, 1414, 2893, 1414, 2894, 2895, 1414,
+     1416, 1416, 1416, 1417, 1417, 1417, 1419, 1419, 1419, 1421,
+     1421, 1421, 2896, 1421, 2897, 2901, 1421, 2902, 1416, 2903,
+
+     2881, 1417, 2904, 2905, 1419, 1424, 1424, 1424, 2906, 2908,
+     1407, 1425, 1425, 1425, 1427, 1427, 1427, 1428, 1428, 1428,
+     1429, 1429, 1429, 1424, 1429, 2909, 2911, 1429, 2912, 1425,
+     2913, 2915, 1427, 2919, 1428, 1430, 1430, 1430, 1431, 1431,
+     1431, 2920, 1431, 2881, 2921, 1431, 1432, 1432, 1432, 2924,
+     1419, 2929, 1430, 1433, 1433, 1433, 2930, 1435, 1435, 1435,
+     1436, 1436, 1436, 2931, 1432, 1437, 1437, 1437, 2932, 1437,
+     2933, 1433, 1437, 2934, 1427, 1435, 2935, 1436, 1440, 1440,
+     1440, 1441, 1441, 1441, 2936, 1441, 2937, 2938, 1441, 1442,
+     1442, 1442, 1443, 1443, 1443, 1440, 1445, 1445, 1445, 1447,
+
+     1447, 1447, 1451, 1451, 1451, 2939, 2940, 1442, 2942, 2943,
+     1443, 1452, 1452, 1452, 1445, 2944, 1447, 2945, 2946, 1435,
+     1451, 1454, 1454, 1454, 1457, 1457, 1457, 2948, 2952, 1452,
+     1458, 1458, 1458, 1460, 1460, 1460, 1461, 1461, 1461, 1454,
+     1461, 2948, 1457, 1461, 1464, 1464, 1464, 2955, 1458, 2956,
+     2959, 1460, 1465, 1465, 1465, 1467, 1467, 1467, 1445, 1468,
+     1468, 1468, 1464, 1468, 2946, 2961, 1468, 1472, 1472, 1472,
+     1465, 2962, 2949, 1467, 1473, 1473, 1473, 1475, 1475, 1475,
+     2964, 2965, 1454, 2949, 2968, 1472, 1460, 1477, 1477, 1477,
+     2969, 2970, 1473, 2971, 2972, 1475, 1484, 1484, 1484, 1514,
+
+     1514, 1514, 1516, 1516, 1516, 1477, 1477, 2973, 1517, 1517,
+     1517, 1542, 1542, 1542, 1484, 1467, 1514, 1515, 1515, 1515,
+     1516, 1515, 2974, 2975, 1515, 1517, 1518, 1518, 1518, 1542,
+     1518, 2976, 2978, 1518, 1521, 1521, 1521, 2980, 1475, 1523,
+     1523, 1523, 2988, 1523, 2978, 2979, 1523, 1526, 1526, 1526,
+     2990, 2985, 1521, 2992, 1527, 1527, 1527, 2979, 1527, 2986,
+     1516, 1527, 1484, 2985, 1526, 1528, 1528, 1528, 2994, 1528,
+     3002, 2986, 1528, 1532, 1532, 1532, 3004, 1533, 1533, 1533,
+     3008, 1533, 3005, 1521, 1533, 1535, 1535, 1535, 3006, 3010,
+     1532, 1537, 1537, 1537, 1538, 1538, 1538, 3012, 1538, 3007,
+
+     3007, 1538, 3006, 1535, 1539, 1539, 1539, 3013, 1537, 1540,
+     1540, 1540, 1558, 1558, 1558, 1559, 1559, 1559, 1560, 1560,
+     1560, 1539, 1560, 3005, 3014, 1560, 3015, 1540, 3030, 1558,
+     3021, 3029, 1559, 3032, 3031, 1535, 1561, 1561, 1561, 1564,
+     1564, 1564, 1565, 1565, 1565, 1566, 1566, 1566, 3021, 1566,
+     3029, 3035, 1566, 3031, 1561, 3037, 3024, 1564, 1540, 1565,
+     1568, 1568, 1568, 1569, 1569, 1569, 1570, 1570, 1570, 3042,
+     1570, 3024, 3043, 1570, 1572, 1572, 1572, 3034, 1568, 3009,
+     1569, 1575, 1575, 1575, 1576, 1576, 1576, 3045, 1576, 3046,
+     3009, 1576, 1572, 1577, 1577, 1577, 3034, 3047, 1575, 3036,
+
+     1561, 3049, 3050, 1564, 1579, 1579, 1579, 1580, 1580, 1580,
+     1577, 1583, 1583, 1583, 3051, 1584, 1584, 1584, 3036, 1584,
+     1568, 1579, 1584, 3052, 3054, 1580, 3056, 3063, 1583, 1585,
+     1585, 1585, 1586, 1586, 1586, 1572, 1587, 1587, 1587, 3064,
+     1587, 3065, 3066, 1587, 1588, 1588, 1588, 1585, 3067, 1586,
+     1579, 1590, 1590, 1590, 1593, 1593, 1593, 1594, 1594, 1594,
+     3068, 1594, 1588, 3071, 1594, 1595, 1595, 1595, 1590, 1595,
+     3072, 1593, 1595, 1580, 1600, 1600, 1600, 1607, 1607, 1607,
+     1608, 1608, 1608, 3073, 1608, 3074, 3075, 1608, 1611, 1611,
+     1611, 1600, 1612, 1612, 1612, 1607, 1613, 1613, 1613, 1614,
+
+     1614, 1614, 1615, 1615, 1615, 1611, 1617, 1617, 1617, 1612,
+     1588, 3076, 3077, 1613, 3078, 3080, 1614, 1620, 1620, 1620,
+     1615, 1620, 3082, 1617, 1620, 3084, 3085, 1623, 1623, 1623,
+     1625, 1625, 1625, 1627, 1627, 1627, 1630, 1630, 1630, 1634,
+     1634, 1634, 1607, 1613, 1623, 1635, 1635, 1635, 1625, 3086,
+     3096, 1627, 3097, 3098, 1630, 3094, 1634, 1615, 3095, 1643,
+     1643, 1643, 1612, 1635, 1636, 1636, 1636, 3094, 1636, 1614,
+     3095, 1636, 1639, 1639, 1639, 3099, 1639, 1643, 3100, 1639,
+     1645, 1645, 1645, 3101, 1645, 1634, 3105, 1645, 1650, 1650,
+     1650, 3106, 1650, 1630, 1625, 1650, 1654, 1654, 1654, 1627,
+
+     3107, 3108, 1635, 1656, 1656, 1656, 1657, 1657, 1657, 3109,
+     1657, 3110, 3111, 1657, 1654, 1660, 1660, 1660, 3112, 1660,
+     3115, 1656, 1660, 3116, 3117, 1643, 1663, 1663, 1663, 1664,
+     1664, 1664, 3118, 1664, 3119, 3120, 1664, 3121, 1669, 1669,
+     1669, 3122, 1669, 3123, 1663, 1669, 1672, 1672, 1672, 1674,
+     1674, 1674, 1675, 1675, 1675, 3124, 1675, 1654, 3113, 1675,
+     1656, 1679, 1679, 1679, 1672, 3125, 1674, 1681, 1681, 1681,
+     1682, 1682, 1682, 1663, 1683, 1683, 1683, 3126, 3127, 1679,
+     1684, 1684, 1684, 3113, 1681, 1685, 1685, 1685, 1682, 1688,
+     1688, 1688, 1683, 1672, 1695, 1695, 1695, 1684, 1726, 1726,
+
+     1726, 3128, 1726, 1685, 3129, 1726, 3130, 1688, 3131, 3132,
+     1679, 3133, 1695, 1729, 1729, 1729, 1730, 1730, 1730, 3134,
+     1730, 3140, 3141, 1730, 3142, 3137, 1683, 1735, 1735, 1735,
+     3143, 1729, 1737, 1737, 1737, 3144, 1737, 1682, 3145, 1737,
+     1688, 1745, 1745, 1745, 3137, 1735, 1695, 1685, 1741, 1741,
+     1741, 3146, 1741, 3147, 3148, 1741, 3149, 1688, 3150, 1745,
+     1747, 1747, 1747, 3151, 1747, 3152, 3153, 1747, 1750, 1750,
+     1750, 3154, 1751, 1751, 1751, 3155, 1751, 3156, 1735, 1751,
+     1729, 1752, 1752, 1752, 3157, 1750, 1761, 1761, 1761, 1765,
+     1765, 1765, 1766, 1766, 1766, 1768, 1768, 1768, 3158, 1752,
+
+     3159, 3160, 1745, 1769, 1769, 1769, 3161, 1769, 3162, 3163,
+     1769, 3164, 1768, 1770, 1770, 1770, 3165, 1770, 3158, 3166,
+     1770, 1773, 1773, 1773, 1775, 1775, 1775, 1776, 1776, 1776,
+     3167, 3168, 1752, 1777, 1777, 1777, 3169, 1777, 3170, 1773,
+     1777, 1775, 1781, 1781, 1781, 1776, 3171, 1782, 1782, 1782,
+     1761, 1782, 3172, 1765, 1782, 3173, 1766, 1786, 1786, 1786,
+     1781, 1785, 1785, 1785, 3174, 1789, 1789, 1789, 1773, 1789,
+     3175, 3176, 1789, 3180, 1776, 1786, 3181, 3182, 1785, 1792,
+     1792, 1792, 1793, 1793, 1793, 3183, 1793, 3184, 3185, 1793,
+     1794, 1794, 1794, 1795, 1795, 1795, 1792, 1796, 1796, 1796,
+
+     3177, 1796, 3187, 3188, 1796, 3190, 3177, 1794, 1781, 3191,
+     1795, 1798, 1798, 1798, 3193, 1801, 1801, 1801, 3194, 1801,
+     3197, 1786, 1801, 1804, 1804, 1804, 1806, 1806, 1806, 1798,
+     1806, 3196, 3198, 1806, 1809, 1809, 1809, 1811, 1811, 1811,
+     3199, 1804, 1812, 1812, 1812, 3196, 1812, 3200, 3202, 1812,
+     3204, 3206, 1809, 3208, 1811, 1813, 1813, 1813, 1815, 1815,
+     1815, 3210, 1815, 3211, 3212, 1815, 1820, 1820, 1820, 1821,
+     1821, 1821, 1813, 1821, 3213, 3214, 1821, 1822, 1822, 1822,
+     1809, 3215, 3216, 1820, 1827, 1827, 1827, 1828, 1828, 1828,
+     1829, 1829, 1829, 3217, 1822, 1830, 1830, 1830, 3219, 1830,
+
+     3221, 1827, 1830, 3223, 3224, 1828, 3225, 1829, 1831, 1831,
+     1831, 1832, 1832, 1832, 1833, 1833, 1833, 1834, 1834, 1834,
+     1836, 1836, 1836, 3226, 3239, 1831, 3259, 1512, 1832, 1510,
+     3235, 1833, 1837, 1837, 1837, 1834, 1837, 1836, 3255, 1837,
+     1838, 1838, 1838, 1840, 1840, 1840, 3241, 1841, 1841, 1841,
+     3241, 1841, 3242, 1828, 1841, 3227, 3242, 1838, 3259, 3243,
+     1840, 1843, 1843, 1843, 1845, 1845, 1845, 3243, 3239, 1832,
+     1848, 1848, 1848, 1852, 1852, 1852, 3228, 1834, 3235, 1843,
+     1509, 1508, 1845, 3247, 3255, 1853, 1853, 1853, 1848, 1853,
+     1852, 3227, 1853, 1855, 1855, 1855, 1857, 1857, 1857, 1859,
+
+     1859, 1859, 1860, 1860, 1860, 1861, 1861, 1861, 1862, 1862,
+     1862, 1855, 3228, 3244, 1857, 1845, 1859, 3236, 1848, 1860,
+     3237, 3244, 1861, 1865, 1865, 1865, 1862, 1864, 1864, 1864,
+     3247, 1866, 1866, 1866, 1867, 1867, 1867, 1868, 1868, 1868,
+     3260, 1865, 1870, 1870, 1870, 1864, 1870, 1857, 1866, 1870,
+     3238, 1867, 1876, 1876, 1876, 1868, 3240, 1878, 1878, 1878,
+     1879, 1879, 1879, 3245, 1879, 3236, 1507, 1879, 3237, 1861,
+     1876, 3245, 3260, 1864, 1878, 1862, 1880, 1880, 1880, 1881,
+     1881, 1881, 1882, 1882, 1882, 1883, 1883, 1883, 1865, 1883,
+     1506, 1505, 1883, 3246, 1880, 3249, 3250, 1881, 3238, 1882,
+
+     3240, 3246, 1868, 1876, 1884, 1884, 1884, 1890, 1890, 1890,
+     1891, 1891, 1891, 1906, 1906, 1906, 1907, 1907, 1907, 1908,
+     1908, 1908, 1884, 3251, 1890, 1910, 1910, 1910, 1891, 1912,
+     1912, 1912, 3249, 3250, 1881, 1880, 1913, 1913, 1913, 1918,
+     1918, 1918, 1920, 1920, 1920, 1923, 1923, 1923, 1925, 1925,
+     1925, 1927, 1927, 1927, 3248, 1928, 1928, 1928, 3252, 3253,
+     1920, 3299, 3256, 1923, 3251, 1925, 1937, 1937, 1937, 1927,
+     1937, 1891, 1928, 1937, 3254, 1940, 1940, 1940, 1941, 1941,
+     1941, 1946, 1946, 1946, 1947, 1947, 1947, 1951, 1951, 1951,
+     3257, 3263, 1920, 1940, 3253, 1941, 1952, 1952, 1952, 3252,
+
+     1952, 3248, 3299, 1952, 1951, 1955, 1955, 1955, 3256, 3254,
+     1927, 1956, 1956, 1956, 1957, 1957, 1957, 3258, 1958, 1958,
+     1958, 1940, 1958, 1955, 3307, 1958, 3263, 3257, 1956, 1504,
+     1503, 1957, 3261, 1951, 1959, 1959, 1959, 1961, 1961, 1961,
+     3262, 3261, 1962, 1962, 1962, 3264, 1963, 1963, 1963, 3262,
+     1963, 3267, 1959, 1963, 3258, 1961, 3307, 1956, 1955, 1962,
+     1964, 1964, 1964, 1967, 1967, 1967, 3265, 1967, 3268, 3277,
+     1967, 1970, 1970, 1970, 1502, 1971, 1971, 1971, 1964, 1971,
+     3264, 3269, 1971, 1976, 1976, 1976, 3275, 1959, 1970, 1972,
+     1972, 1972, 3266, 1972, 3267, 3275, 1972, 1978, 1978, 1978,
+
+     3265, 1976, 1980, 1980, 1980, 1500, 3277, 1964, 1982, 1982,
+     1982, 3268, 1982, 3273, 3274, 1982, 1985, 1985, 1985, 3270,
+     1980, 1986, 1986, 1986, 3318, 1986, 3266, 3269, 1986, 3289,
+     1990, 1990, 1990, 1985, 1990, 3318, 3279, 1990, 1993, 1993,
+     1993, 1994, 1994, 1994, 3271, 1994, 3273, 3274, 1994, 1995,
+     1995, 1995, 1999, 1999, 1999, 1993, 3272, 2000, 2000, 2000,
+     1980, 2000, 3281, 3289, 2000, 3270, 1995, 3276, 3278, 1999,
+     2001, 2001, 2001, 2002, 2002, 2002, 3276, 2002, 3279, 3271,
+     2002, 2005, 2005, 2005, 1499, 2006, 2006, 2006, 2001, 2006,
+     3282, 3272, 2006, 2007, 2007, 2007, 3283, 1497, 2005, 2008,
+
+     2008, 2008, 2009, 2009, 2009, 3278, 2009, 3284, 3281, 2009,
+     2007, 2010, 2010, 2010, 1496, 3287, 2008, 1494, 2012, 2012,
+     2012, 2001, 2012, 3280, 3287, 2012, 2015, 2015, 2015, 2010,
+     2016, 2016, 2016, 3283, 2016, 3300, 3282, 2016, 2018, 2018,
+     2018, 1491, 2018, 2015, 3284, 2018, 2022, 2022, 2022, 2025,
+     2025, 2025, 2027, 2027, 2027, 2028, 2028, 2028, 2030, 2030,
+     2030, 3285, 2010, 3286, 2022, 3280, 3290, 2025, 3291, 2027,
+     2032, 2032, 2032, 2028, 2032, 2030, 3300, 2032, 2036, 2036,
+     2036, 2039, 2039, 2039, 2041, 2041, 2041, 2042, 2042, 2042,
+     3285, 2042, 3286, 3288, 2042, 3293, 2036, 3292, 1490, 2039,
+
+     3290, 2041, 3288, 3293, 2030, 2043, 2043, 2043, 2044, 2044,
+     2044, 1489, 2044, 2025, 3291, 2044, 2028, 2046, 2046, 2046,
+     3301, 3308, 2043, 2048, 2048, 2048, 2049, 2049, 2049, 2050,
+     2050, 2050, 2051, 2051, 2051, 2046, 2051, 3294, 3297, 2051,
+     3295, 2048, 3302, 3292, 2049, 3294, 2050, 2052, 2052, 2052,
+     2053, 2053, 2053, 3308, 2053, 3301, 3298, 2053, 2054, 2054,
+     2054, 2059, 2059, 2059, 2052, 3296, 2061, 2061, 2061, 1488,
+     2061, 3313, 2048, 2061, 3305, 3297, 2054, 3302, 3303, 2059,
+     2064, 2064, 2064, 2046, 2065, 2065, 2065, 3295, 2066, 2066,
+     2066, 2049, 2066, 3298, 1487, 2066, 1486, 1485, 2064, 2069,
+
+     2069, 2069, 2065, 2075, 2075, 2075, 2076, 2076, 2076, 3309,
+     2076, 3305, 3296, 2076, 2077, 2077, 2077, 2069, 3309, 3313,
+     2075, 3310, 3317, 2054, 3303, 1483, 2059, 2078, 2078, 2078,
+     3310, 2064, 2077, 2083, 2083, 2083, 3317, 2065, 2084, 2084,
+     2084, 2085, 2085, 2085, 2087, 2087, 2087, 2091, 2091, 2091,
+     2092, 2092, 2092, 2093, 2093, 2093, 2094, 2094, 2094, 2096,
+     2096, 2096, 2097, 2097, 2097, 2098, 2098, 2098, 2099, 2099,
+     2099, 2100, 2100, 2100, 2101, 2101, 2101, 3304, 2077, 2103,
+     2103, 2103, 2106, 2106, 2106, 1482, 2109, 2109, 2109, 2110,
+     2110, 2110, 3306, 2110, 1481, 1480, 2110, 2103, 1471, 1456,
+
+     2106, 1455, 2094, 2109, 2112, 2112, 2112, 2113, 2113, 2113,
+     2114, 2114, 2114, 1450, 2114, 1449, 1448, 2114, 2125, 2125,
+     2125, 1446, 2112, 3304, 2113, 2126, 2126, 2126, 3314, 3306,
+     2103, 2127, 2127, 2127, 1439, 2127, 2125, 1438, 2127, 2128,
+     2128, 2128, 2126, 2133, 2133, 2133, 2134, 2134, 2134, 2135,
+     2135, 2135, 2136, 2136, 2136, 3311, 2136, 1420, 1415, 2136,
+     2138, 2138, 2138, 2139, 2139, 2139, 2135, 2125, 2140, 2140,
+     2140, 3312, 2140, 3315, 3316, 2140, 3314, 1412, 2138, 1411,
+     2139, 2142, 2142, 2142, 1408, 2142, 1403, 3311, 2142, 2145,
+     2145, 2145, 2134, 1394, 2147, 2147, 2147, 2149, 2149, 2149,
+
+     1393, 2149, 1392, 3312, 2149, 3315, 3316, 2145, 2152, 2152,
+     2152, 2138, 2147, 2155, 2155, 2155, 1388, 2155, 1383, 1379,
+     2155, 2162, 2162, 2162, 1371, 1366, 2152, 2164, 2164, 2164,
+     1365, 2164, 1359, 1358, 2164, 2173, 2173, 2173, 1357, 2162,
+     2145, 2170, 2170, 2170, 1356, 2170, 1351, 1350, 2170, 2174,
+     2174, 2174, 2173, 2174, 1349, 1348, 2174, 1335, 2178, 2178,
+     2178, 2152, 2178, 1334, 1333, 2178, 2181, 2181, 2181, 1332,
+     2182, 2182, 2182, 1331, 2182, 1330, 2162, 2182, 2185, 2185,
+     2185, 2186, 2186, 2186, 2181, 2186, 1329, 1328, 2186, 2187,
+     2187, 2187, 1327, 2187, 1317, 2185, 2187, 2190, 2190, 2190,
+
+     2192, 2192, 2192, 1316, 2192, 1315, 1314, 2192, 2198, 2198,
+     2198, 2200, 2200, 2200, 1297, 2190, 2201, 2201, 2201, 1296,
+     2201, 1291, 1290, 2201, 1289, 1284, 2198, 1283, 2200, 1266,
+     2181, 2202, 2202, 2202, 2204, 2204, 2204, 2205, 2205, 2205,
+     1262, 2205, 1256, 1252, 2205, 1251, 2212, 2212, 2212, 2202,
+     1250, 2204, 2215, 2215, 2215, 1249, 2215, 1248, 1247, 2215,
+     2222, 2222, 2222, 2190, 2212, 2218, 2218, 2218, 1246, 2218,
+     1244, 1243, 2218, 1241, 2224, 2224, 2224, 1240, 2222, 2225,
+     2225, 2225, 2226, 2226, 2226, 1239, 2226, 1234, 1226, 2226,
+     1224, 2202, 2224, 1219, 2229, 2229, 2229, 2225, 2229, 1217,
+
+     1208, 2229, 2232, 2232, 2232, 1203, 2233, 2233, 2233, 1192,
+     1190, 2222, 2234, 2234, 2234, 2225, 2235, 2235, 2235, 1189,
+     2232, 1188, 2232, 2233, 2236, 2236, 2236, 1187, 1185, 2234,
+     2237, 2237, 2237, 2235, 2239, 2239, 2239, 2240, 2240, 2240,
+     2224, 2236, 2241, 2241, 2241, 2244, 2244, 2244, 2237, 2245,
+     2245, 2245, 2239, 2245, 1184, 2240, 2245, 2248, 2248, 2248,
+     2241, 1183, 1182, 2234, 2249, 2249, 2249, 2250, 2250, 2250,
+     2251, 2251, 2251, 1181, 1180, 2248, 2254, 2254, 2254, 1178,
+     2235, 1177, 1176, 2236, 2255, 2255, 2255, 2257, 2257, 2257,
+     2258, 2258, 2258, 1175, 2239, 2237, 2259, 2259, 2259, 2260,
+
+     2260, 2260, 2261, 2261, 2261, 2262, 2262, 2262, 2265, 2265,
+     2265, 2266, 2266, 2266, 1174, 1173, 2248, 2267, 2267, 2267,
+     2268, 2268, 2268, 2270, 2270, 2270, 2273, 2273, 2273, 2274,
+     2274, 2274, 1172, 2274, 1170, 1169, 2274, 2277, 2277, 2277,
+     1168, 2270, 1167, 2273, 2278, 2278, 2278, 1166, 2280, 2280,
+     2280, 1165, 2280, 1164, 2277, 2280, 2293, 2293, 2293, 2294,
+     2294, 2294, 2278, 2294, 2296, 2296, 2294, 2296, 2297, 2297,
+     2297, 2298, 2298, 2298, 2293, 2296, 2302, 2302, 2302, 2304,
+     2304, 2304, 2296, 2304, 1158, 1157, 2304, 2308, 2308, 2308,
+     2309, 2309, 2309, 1156, 2309, 1153, 1152, 2309, 2313, 2313,
+
+     2313, 1151, 1149, 2277, 1145, 2308, 2314, 2314, 2314, 2315,
+     2315, 2315, 2323, 2323, 2323, 1142, 2313, 2293, 2324, 2324,
+     2324, 1133, 1132, 2314, 2329, 2329, 2329, 2315, 2329, 1129,
+     1128, 2329, 1127, 2308, 1126, 1125, 2324, 2332, 2332, 2332,
+     2335, 2335, 2335, 2336, 2336, 2336, 1111, 2336, 1104, 1096,
+     2336, 2339, 2339, 2339, 2332, 2344, 2344, 2344, 2335, 1095,
+     2315, 1094, 2346, 2346, 2346, 2350, 2350, 2350, 1091, 2339,
+     2347, 2347, 2347, 2344, 2347, 1088, 1085, 2347, 2324, 2346,
+     2351, 2351, 2351, 2350, 2352, 2352, 2352, 1080, 2352, 1077,
+     1076, 2352, 2355, 2355, 2355, 1072, 1070, 2351, 2356, 2356,
+
+     2356, 2361, 2361, 2361, 2363, 2363, 2363, 1056, 1055, 2355,
+     2365, 2365, 2365, 1054, 1053, 2356, 2350, 1052, 2361, 2366,
+     2366, 2366, 2367, 2367, 2367, 1051, 2351, 1050, 2365, 1049,
+     2368, 2368, 2368, 2369, 2369, 2369, 2366, 2370, 2370, 2370,
+     2367, 1048, 2371, 2371, 2371, 1044, 2371, 2355, 2368, 2371,
+     1040, 2369, 2361, 1033, 2370, 2372, 2372, 2372, 1030, 2356,
+     2373, 2373, 2373, 2374, 2374, 2374, 2375, 2375, 2375, 1029,
+     2369, 1028, 2372, 2376, 2376, 2376, 1025, 2373, 1024, 1023,
+     2374, 1020, 2367, 1019, 2375, 2377, 2377, 2377, 2378, 2378,
+     2378, 2368, 2380, 2380, 2380, 2383, 2383, 2383, 2384, 2384,
+
+     2384, 1018, 1015, 2377, 1014, 1011, 2378, 2385, 2385, 2385,
+     2380, 2373, 1010, 1007, 2374, 1004, 2384, 2386, 2386, 2386,
+     2389, 2389, 2389, 2390, 2390, 2390, 2391, 2391, 2391, 2392,
+     2392, 2392, 2396, 2396, 2396, 2399, 2399, 2399, 2400, 2400,
+     2400, 1001, 2400, 1000,  997, 2400, 2412, 2412, 2412,  996,
+     2396, 2377, 2399,  995, 2380, 2423, 2423, 2423, 2426, 2426,
+     2426, 2429, 2429, 2429, 2412, 2431, 2431, 2431, 2433, 2433,
+     2433, 2434, 2434, 2434,  994, 2434,  993,  991, 2434, 2429,
+     2435, 2435, 2435, 2431,  990, 2433, 2442, 2442, 2442, 2443,
+     2443, 2443, 2444, 2444, 2444, 2450, 2450, 2450, 2435,  989,
+
+     2451, 2451, 2451, 2442, 2451,  988, 2412, 2451,  987,  986,
+     2444,  985, 2450, 2453, 2453, 2453, 2454, 2454, 2454, 2456,
+     2456, 2456, 2460, 2460, 2460,  984,  980, 2429,  975,  974,
+     2453, 2462, 2462, 2462, 2454,  973,  970, 2456,  969, 2460,
+     2463, 2463, 2463,  968, 2463,  966,  962, 2463, 2462, 2444,
+     2464, 2464, 2464, 2465, 2465, 2465, 2466, 2466, 2466,  958,
+     2466,  957,  954, 2466, 2467, 2467, 2467,  951, 2464,  950,
+     2465, 2468, 2468, 2468, 2469, 2469, 2469, 2474, 2474, 2474,
+      949, 2467, 2476, 2476, 2476, 2478, 2478, 2478, 2468,  948,
+      947, 2469,  946,  945, 2474, 2480, 2480, 2480, 2481, 2481,
+
+     2481,  943, 2481, 2478,  942, 2481, 2482, 2482, 2482, 2483,
+     2483, 2483, 2480, 2484, 2484, 2484, 2467,  941, 2485, 2485,
+     2485,  940, 2485,  939, 2482, 2485,  938, 2483,  937, 2468,
+      936, 2484, 2469, 2488, 2488, 2488, 2489, 2489, 2489,  935,
+     2489,  934,  933, 2489, 2490, 2490, 2490, 2491, 2491, 2491,
+     2488, 2492, 2492, 2492, 2494, 2494, 2494, 2495, 2495, 2495,
+      932, 2490,  931,  930, 2491, 2499, 2499, 2499,  929, 2492,
+     2503, 2503, 2503,  928,  927, 2495, 2483, 2484, 2507, 2507,
+     2507,  926,  925, 2499, 2508, 2508, 2508,  924, 2508,  923,
+      919, 2508, 2522, 2522, 2522, 2507, 2537, 2537, 2537, 2540,
+
+     2540, 2540, 2542, 2542, 2542,  918, 2542,  916,  915, 2542,
+     2522, 2545, 2545, 2545, 2548, 2548, 2548, 2540, 2551, 2551,
+     2551, 2552, 2552, 2552,  914, 2552,  913,  912, 2552, 2545,
+      908, 2548, 2553, 2553, 2553, 2551, 2557, 2557, 2557, 2559,
+     2559, 2559,  906, 2559,  905,  904, 2559, 2563, 2563, 2563,
+     2553,  903, 2522, 2557, 2564, 2564, 2564,  899, 2564,  895,
+      894, 2564,  891,  890, 2563, 2566, 2566, 2566,  889,  888,
+     2540, 2567, 2567, 2567, 2568, 2568, 2568,  887, 2568,  886,
+      885, 2568, 2566, 2569, 2569, 2569,  882,  881, 2567, 2570,
+     2570, 2570,  880, 2570,  879,  876, 2570, 2573, 2573, 2573,
+
+     2569, 2575, 2575, 2575,  875, 2575,  874,  871, 2575, 2578,
+     2578, 2578, 2579, 2579, 2579, 2573, 2580, 2580, 2580, 2583,
+     2583, 2583,  869, 2584, 2584, 2584, 2578, 2584,  866, 2579,
+     2584,  865,  864, 2580,  863,  862, 2583, 2585, 2585, 2585,
+     2586, 2586, 2586, 2587, 2587, 2587,  859, 2587,  858,  857,
+     2587, 2590, 2590, 2590, 2585,  856,  855, 2586, 2592, 2592,
+     2592,  852,  851, 2579, 2578, 2593, 2593, 2593,  850, 2590,
+      849, 2580,  847, 2594, 2594, 2594, 2592, 2594,  844,  843,
+     2594,  841,  838, 2593, 2597, 2597, 2597, 2598, 2598, 2598,
+      836, 2598,  833,  832, 2598, 2599, 2599, 2599, 2600, 2600,
+
+     2600, 2597, 2600,  831,  830, 2600,  828, 2601, 2601, 2601,
+      827,  826, 2599, 2607, 2607, 2607, 2611, 2611, 2611, 2630,
+     2630, 2630,  823,  822, 2592, 2601, 2593, 2612, 2612, 2612,
+      821, 2612,  820, 2611, 2612,  819,  818, 2630, 2644, 2644,
+     2644, 2646, 2646, 2646, 2647, 2647, 2647, 2648, 2648, 2648,
+     2649, 2649, 2649,  813, 2650, 2650, 2650,  812, 2646, 2651,
+     2651, 2651, 2647, 2651, 2648,  811, 2651, 2649,  810,  809,
+     2630, 2650, 2652, 2652, 2652,  808, 2652,  807,  806, 2652,
+     2655, 2655, 2655, 2659, 2659, 2659, 2660, 2660, 2660,  805,
+     2661, 2661, 2661,  804, 2661,  803, 2649, 2661, 2655,  801,
+
+     2659,  799,  798, 2660,  795,  792, 2647, 2662, 2662, 2662,
+     2664, 2664, 2664,  789, 2664,  788,  784, 2664, 2668, 2668,
+     2668, 2669, 2669, 2669, 2662, 2669,  783,  782, 2669, 2670,
+     2670, 2670,  781, 2670,  778, 2668, 2670, 2673, 2673, 2673,
+     2674, 2674, 2674,  775, 2674,  774,  773, 2674, 2675, 2675,
+     2675, 2676, 2676, 2676, 2673, 2677, 2677, 2677,  770, 2678,
+     2678, 2678,  769, 2678,  768, 2675, 2678,  765, 2676, 2681,
+     2681, 2681, 2677, 2682, 2682, 2682,  764, 2682,  762,  759,
+     2682, 2683, 2683, 2683,  758,  757, 2681, 2684, 2684, 2684,
+      755, 2684,  744,  742, 2684, 2691, 2691, 2691, 2683, 2692,
+
+     2692, 2692,  739,  738, 2677,  737, 2675, 2693, 2693, 2693,
+      735, 2693,  734, 2691, 2693,  733,  729, 2692, 2696, 2696,
+     2696,  728, 2696,  727,  726, 2696, 2701, 2701, 2701, 2703,
+     2703, 2703, 2704, 2704, 2704, 2707, 2707, 2707,  723, 2707,
+      722,  721, 2707, 2701, 2701,  720, 2691, 2718, 2718, 2718,
+     2727, 2727, 2727, 2741, 2741, 2741, 2742, 2742, 2742, 2743,
+     2743, 2743,  719,  718, 2718,  717, 2692,  715, 2727,  712,
+     2744, 2744, 2744,  711, 2744,  709, 2743, 2744, 2745, 2745,
+     2745, 2746, 2746, 2746, 2747, 2747, 2747,  707, 2747,  704,
+      703, 2747, 2748, 2748, 2748,  697, 2745,  695, 2746, 2727,
+
+     2749, 2749, 2749,  693, 2749,  690,  689, 2749,  685, 2748,
+     2751, 2751, 2751,  684, 2751,  683,  682, 2751, 2756, 2756,
+     2756, 2757, 2757, 2757,  679, 2757,  678,  677, 2757, 2745,
+     2758, 2758, 2758,  676, 2758, 2756,  673, 2758, 2761, 2761,
+     2761, 2762, 2762, 2762,  672, 2762,  671,  670, 2762, 2765,
+     2765, 2765,  669, 2765,  663, 2761, 2765, 2768, 2768, 2768,
+      662, 2768,  660,  654, 2768, 2771, 2771, 2771, 2772, 2772,
+     2772, 2773, 2773, 2773,  653, 2773,  649,  642, 2773, 2774,
+     2774, 2774, 2771,  638,  632, 2772, 2775, 2775, 2775,  628,
+     2775,  620,  619, 2775,  618,  617, 2774, 2778, 2778, 2778,
+
+      616, 2778,  612,  605, 2778, 2787, 2787, 2787, 2788, 2788,
+     2788, 2794, 2794, 2794,  604,  603, 2771, 2795, 2795, 2795,
+     2796, 2796, 2796, 2787, 2796,  599, 2788, 2796, 2794, 2794,
+     2797, 2797, 2797,  592, 2795, 2795,  591,  587, 2796, 2798,
+     2798, 2798, 2799, 2799, 2799, 2800, 2800, 2800,  581,  580,
+     2774, 2809, 2809, 2809, 2810, 2810, 2810,  576, 2810,  568,
+      567, 2810, 2819, 2819, 2819, 2832, 2832, 2832, 2809, 2833,
+     2833, 2833,  563,  554, 2788, 2834, 2834, 2834,  550, 2834,
+     2819,  542, 2834, 2837, 2837, 2837, 2838, 2838, 2838,  541,
+     2838,  540,  536, 2838,  530, 2841, 2841, 2841,  529, 2841,
+
+      528, 2837, 2841, 2847, 2847, 2847,  524, 2847,  518,  517,
+     2847, 2850, 2850, 2850,  513, 2850,  507,  506, 2850, 2853,
+     2853, 2853, 2855, 2855, 2855, 2856, 2856, 2856, 2819, 2856,
+      505,  504, 2856, 2859, 2859, 2859, 2853,  503,  502, 2855,
+     2874, 2874, 2874, 2876, 2876, 2876, 2882, 2882, 2882,  501,
+     2859,  497, 2883, 2883, 2883,  491, 2883,  490, 2874, 2883,
+      488, 2876,  487, 2882, 2882, 2884, 2884, 2884,  486, 2884,
+     2883,  482, 2884, 2887, 2887, 2887, 2888, 2888, 2888, 2889,
+     2889, 2889,  471, 2884, 2898, 2898, 2898,  470, 2898,  468,
+      464, 2898,  458,  457, 2876, 2885, 2885, 2885, 2885, 2885,
+
+     2885, 2885, 2885, 2885,  456,  452, 2885, 2907, 2907, 2907,
+      446, 2885, 2885, 2885, 2885, 2885, 2916, 2916, 2916, 2917,
+     2917, 2917, 2922, 2922, 2922, 2907, 2923, 2923, 2923,  442,
+     2923,  434,  432, 2923, 2925, 2925, 2925, 2917,  431, 2922,
+     2885, 2885, 2886, 2886, 2886, 2886, 2886, 2886, 2886, 2886,
+     2886, 2925,  430, 2886, 2927, 2927, 2927,  426, 2886, 2886,
+     2886, 2886, 2886, 2926, 2926, 2926,  420, 2926,  419,  415,
+     2926, 2927, 2928, 2928, 2928,  409, 2928,  408,  404, 2928,
+     2941, 2941, 2941, 2966, 2966, 2966,  397, 2886, 2886, 2947,
+     2947, 2947,  396, 2947,  395,  391, 2947,  384, 2941,  383,
+
+      382, 2966, 2999, 2999, 2999,  381,  377, 2947, 2950, 2950,
+     2950, 2950, 2950, 2950, 2950, 2950, 2950,  368,  362, 2950,
+     2999,  358,  357,  353, 2950, 2950, 2950, 2950, 2950, 2977,
+     2977, 2977,  347, 2977,  346,  345, 2977, 2981, 2981, 2981,
+      341, 2981,  334,  332, 2981, 2984, 2984, 2984,  331, 2984,
+      327,  324, 2984, 2950, 2950, 2951, 2951, 2951, 2951, 2951,
+     2951, 2951, 2951, 2951,  322,  321, 2951, 3011, 3011, 3011,
+      320, 2951, 2951, 2951, 2951, 2951, 3026, 3026, 3026, 3027,
+     3027, 3027, 3028, 3028, 3028, 3011, 3011, 3033, 3033, 3033,
+     3044, 3044, 3044, 3026,  316,  312, 3027,  309,  305, 3028,
+
+     2951, 2951,  302,  301, 3033, 3048, 3048, 3048, 3044, 3057,
+     3057, 3057, 3058, 3058, 3058,  293, 3058,  289,  285, 3058,
+     3059, 3059, 3059, 3048,  284,  283, 3057, 3060, 3060, 3060,
+      277, 3060,  276,  274, 3060,  271,  259, 3059, 3061, 3061,
+     3061, 3062, 3062, 3062,    0, 3062,    0,    0, 3062, 3069,
+     3069, 3069, 3079, 3079, 3079, 3061, 3048, 3070, 3070, 3070,
+        0, 3070,    0,    0, 3070,    0, 3069, 3087, 3087, 3087,
+     3079, 3087,    0,    0, 3087, 3090, 3090, 3090,    0, 3090,
+        0,    0, 3090, 3093, 3093, 3093,    0, 3093,    0, 3079,
+     3093, 3102, 3102, 3102,    0, 3102,    0,    0, 3102, 3209,
+
+     3209, 3209, 3218, 3218, 3218,    0, 3218,    0,    0, 3218,
+     3319, 3319, 3319, 3320, 3320, 3320,    0, 3209,    0,    0,
+     3218,    0,    0,    0,    0,    0,    0,    0, 3319,    0,
+        0, 3320, 3323, 3323, 3323, 3323, 3323, 3323, 3323, 3323,
      3323, 3324, 3324, 3324, 3324, 3324, 3324, 3324, 3324, 3324,
      3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325, 3325, 3326,
-
      3326, 3326, 3326, 3326, 3326, 3326, 3326, 3326, 3327, 3327,
      3327, 3327, 3327, 3327, 3327, 3327, 3327, 3328, 3328, 3328,
      3328, 3328, 3328, 3328, 3328, 3328, 3329, 3329, 3329, 3329,
      3329, 3329, 3329, 3329, 3329, 3330, 3330, 3330, 3330, 3330,
+
      3330, 3330, 3330, 3330, 3331, 3331, 3331, 3331, 3331, 3331,
      3331, 3331, 3331, 3332, 3332, 3332, 3332, 3332, 3332, 3332,
      3332, 3332, 3333, 3333, 3333, 3333, 3333, 3333, 3333, 3333,
      3333, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334, 3334,
      3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3335, 3336,
      3336, 3336, 3336, 3336, 3336, 3336, 3336, 3336, 3337, 3337,
-
      3337, 3337, 3337, 3337, 3337, 3337, 3337, 3338, 3338, 3338,
      3338, 3338, 3338, 3338, 3338, 3338, 3339, 3339, 3339, 3339,
      3339, 3339, 3339, 3339, 3339, 3340, 3340, 3340, 3340, 3340,
      3340, 3340, 3340, 3340, 3341, 3341, 3341, 3341, 3341, 3341,
+
      3341, 3341, 3341, 3342, 3342, 3342, 3342, 3342, 3342, 3342,
      3342, 3342, 3343, 3343, 3343, 3343, 3343, 3343, 3343, 3343,
      3343, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344, 3344,
      3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3345, 3346,
      3346, 3346, 3346, 3346, 3346, 3346, 3346, 3346, 3347, 3347,
-     3347,    0,    0,    0, 3347, 3348, 3348, 3348,    0,    0,
-
-        0, 3348, 3349, 3349, 3349,    0,    0,    0, 3349, 3350,
-     3350, 3350,    0,    0,    0, 3350, 3351, 3351, 3351,    0,
-        0,    0, 3351, 3352, 3352, 3352,    0,    0,    0, 3352,
-     3353, 3353, 3353,    0,    0,    0, 3353, 3354, 3354, 3354,
-        0,    0,    0, 3354, 3355, 3355, 3355,    0,    0,    0,
-     3355, 3356, 3356, 3356,    0,    0,    0, 3356, 3357, 3357,
-     3357,    0,    0,    0, 3357, 3358, 3358, 3358,    0,    0,
-        0, 3358, 3359, 3359, 3359,    0,    0,    0, 3359, 3360,
-     3360, 3360,    0,    0,    0, 3360, 3361, 3361, 3361,    0,
-        0,    0, 3361, 3362, 3362, 3362,    0,    0,    0, 3362,
-
-     3363, 3363, 3363,    0,    0,    0, 3363, 3364, 3364, 3364,
-        0,    0,    0, 3364, 3365, 3365, 3365,    0,    0,    0,
-     3365, 3366, 3366, 3366,    0,    0,    0, 3366, 3367, 3367,
-     3367,    0,    0,    0, 3367, 3368, 3368, 3368,    0,    0,
-        0, 3368, 3369, 3369, 3369,    0,    0,    0, 3369, 3370,
-     3370, 3370,    0,    0,    0, 3370, 3371, 3371, 3371,    0,
-        0,    0, 3371, 3372, 3372, 3372,    0,    0,    0, 3372,
-     3373, 3373, 3373,    0,    0,    0, 3373, 3374, 3374, 3374,
-        0,    0,    0, 3374, 3375, 3375, 3375, 3375, 3375, 3375,
-     3375,    0, 3375, 3376, 3376, 3376,    0,    0,    0, 3376,
-
-     3377,    0,    0,    0, 3377, 3378, 3378, 3378,    0,    0,
-        0, 3378, 3379,    0,    0,    0, 3379, 3380, 3380, 3380,
-        0,    0,    0, 3380, 3381,    0,    0,    0, 3381, 3382,
-     3382, 3382,    0,    0,    0, 3382, 3383,    0,    0,    0,
-     3383, 3384, 3384, 3384,    0,    0,    0, 3384, 3385,    0,
-        0,    0, 3385, 3386, 3386, 3386,    0,    0,    0, 3386,
-     3387,    0,    0,    0, 3387, 3388, 3388, 3388,    0,    0,
-        0, 3388, 3389,    0,    0,    0, 3389, 3390, 3390, 3390,
-        0,    0,    0, 3390, 3391,    0,    0,    0, 3391, 3392,
-     3392, 3392,    0,    0,    0, 3392, 3393,    0,    0,    0,
-
-     3393, 3394, 3394, 3394,    0,    0,    0, 3394, 3395,    0,
-        0,    0, 3395, 3396, 3396, 3396,    0,    0,    0, 3396,
-     3397,    0,    0,    0, 3397, 3398, 3398, 3398,    0,    0,
-        0, 3398, 3399,    0,    0,    0, 3399, 3400, 3400, 3400,
-        0,    0,    0, 3400, 3401,    0,    0,    0, 3401, 3402,
-     3402, 3402,    0,    0,    0, 3402, 3403,    0,    0,    0,
-     3403, 3404, 3404, 3404,    0,    0,    0, 3404, 3405,    0,
-        0,    0, 3405, 3406, 3406, 3406,    0,    0,    0, 3406,
-     3407,    0,    0,    0, 3407, 3408, 3408, 3408,    0,    0,
-        0, 3408, 3409,    0,    0,    0, 3409, 3410, 3410, 3410,
-
-        0,    0,    0, 3410, 3411,    0,    0,    0, 3411, 3412,
-     3412, 3412,    0,    0,    0, 3412, 3413,    0,    0,    0,
-     3413, 3414, 3414, 3414,    0,    0,    0, 3414, 3415,    0,
-        0,    0, 3415, 3416, 3416, 3416,    0,    0,    0, 3416,
-     3417,    0,    0,    0, 3417, 3418, 3418, 3418,    0,    0,
-        0, 3418, 3419,    0,    0,    0, 3419, 3420, 3420, 3420,
-        0,    0,    0, 3420, 3421,    0,    0,    0, 3421, 3422,
-     3422, 3422,    0,    0,    0, 3422, 3423,    0,    0,    0,
-     3423, 3424, 3424, 3424,    0,    0,    0, 3424, 3425,    0,
-        0,    0, 3425, 3426, 3426, 3426,    0,    0,    0, 3426,
-
-     3427,    0,    0,    0, 3427, 3428, 3428, 3428,    0,    0,
-        0, 3428, 3429,    0,    0,    0, 3429, 3430, 3430, 3430,
-        0,    0,    0, 3430, 3431,    0,    0,    0, 3431, 3432,
-     3432, 3432, 3432, 3432, 3432, 3432, 3432, 3432, 3433,    0,
-        0,    0,    0, 3433, 3434, 3434, 3434,    0,    0,    0,
-     3434, 3435, 3435, 3435, 3435,    0,    0, 3435, 3435, 3436,
-     3436, 3436,    0,    0,    0, 3436, 3437, 3437, 3437, 3437,
-        0,    0, 3437, 3437, 3438, 3438, 3438,    0,    0,    0,
-     3438, 3439, 3439, 3439, 3439,    0,    0, 3439, 3439, 3440,
-     3440, 3440,    0,    0,    0, 3440, 3441, 3441, 3441, 3441,
-
-        0,    0, 3441, 3441, 3442, 3442, 3442,    0,    0,    0,
-     3442, 3443, 3443, 3443, 3443,    0,    0, 3443, 3443, 3444,
-     3444, 3444,    0,    0,    0, 3444, 3445, 3445, 3445, 3445,
-        0,    0, 3445, 3445, 3446, 3446, 3446,    0,    0,    0,
-     3446, 3447, 3447, 3447, 3447,    0,    0, 3447, 3447, 3448,
-     3448, 3448,    0,    0,    0, 3448, 3449, 3449, 3449, 3449,
-        0,    0, 3449, 3449, 3450, 3450, 3450,    0,    0,    0,
-     3450, 3451, 3451, 3451, 3451,    0,    0, 3451, 3451, 3452,
-     3452, 3452,    0,    0,    0, 3452, 3453, 3453, 3453, 3453,
-        0,    0, 3453, 3453, 3454, 3454, 3454,    0,    0,    0,
-
-     3454, 3455, 3455, 3455, 3455,    0,    0, 3455, 3455, 3456,
-     3456, 3456,    0,    0,    0, 3456, 3457, 3457, 3457, 3457,
-        0,    0, 3457, 3457, 3458, 3458, 3458,    0,    0,    0,
-     3458, 3459, 3459, 3459, 3459,    0,    0, 3459, 3459, 3460,
-     3460, 3460,    0,    0,    0, 3460, 3461, 3461, 3461, 3461,
-        0,    0, 3461, 3461, 3462, 3462, 3462, 3462,    0, 3462,
-        0, 3462, 3463, 3463, 3463, 3463,    0,    0, 3463, 3463,
-     3464, 3464, 3464,    0,    0,    0, 3464, 3465, 3465, 3465,
-     3465,    0,    0, 3465, 3465, 3466, 3466, 3466,    0,    0,
-        0, 3466, 3467, 3467, 3467, 3467,    0,    0, 3467, 3467,
-
-     3468, 3468, 3468,    0,    0,    0, 3468, 3469, 3469, 3469,
-     3469,    0,    0, 3469, 3469, 3470, 3470, 3470,    0,    0,
-        0, 3470, 3471, 3471, 3471, 3471,    0,    0, 3471, 3471,
-     3472, 3472, 3472, 3472,    0, 3472,    0, 3472, 3473, 3473,
-     3473, 3473,    0,    0, 3473, 3473, 3474, 3474, 3474, 3474,
-        0, 3474,    0, 3474, 3475, 3475, 3475, 3475,    0,    0,
-     3475, 3475, 3476, 3476, 3476,    0,    0,    0, 3476, 3477,
-     3477, 3477, 3477,    0,    0, 3477, 3477, 3478, 3478, 3478,
-     3478,    0, 3478,    0, 3478, 3479, 3479, 3479, 3479,    0,
-        0, 3479, 3479, 3480, 3480, 3480, 3480,    0, 3480,    0,
-
-     3480, 3481, 3481, 3481, 3481,    0,    0, 3481, 3481, 3482,
-     3482, 3482,    0,    0,    0, 3482, 3483, 3483, 3483, 3483,
-        0,    0, 3483, 3483, 3484, 3484, 3484,    0,    0,    0,
-     3484, 3485, 3485, 3485, 3485,    0,    0, 3485, 3485, 3486,
+     3347, 3347, 3347, 3347, 3347, 3347, 3347, 3348, 3348, 3348,
+     3348, 3348, 3348, 3348, 3348, 3348, 3349, 3349, 3349, 3349,
+     3349, 3349, 3349, 3349, 3349, 3350, 3350, 3350, 3350, 3350,
+     3350, 3350, 3350, 3350, 3351, 3351, 3351, 3351, 3351, 3351,
+     3351, 3351, 3351, 3352, 3352, 3352, 3352, 3352, 3352, 3352,
+
+     3352, 3352, 3353, 3353, 3353, 3353, 3353, 3353, 3353, 3353,
+     3353, 3354, 3354, 3354, 3354, 3354, 3354, 3354, 3354, 3354,
+     3355, 3355, 3355, 3355, 3355, 3355, 3355, 3355, 3355, 3356,
+     3356, 3356, 3356, 3356, 3356, 3356, 3356, 3356, 3357, 3357,
+     3357, 3357, 3357, 3357, 3357, 3357, 3357, 3358, 3358, 3358,
+     3358, 3358, 3358, 3358, 3358, 3358, 3359, 3359, 3359, 3359,
+     3359, 3359, 3359, 3359, 3359, 3360, 3360, 3360, 3360, 3360,
+     3360, 3360, 3360, 3360, 3361, 3361, 3361, 3361, 3361, 3361,
+     3361, 3361, 3361, 3362, 3362, 3362, 3362, 3362, 3362, 3362,
+     3362, 3362, 3363, 3363, 3363, 3363, 3363, 3363, 3363, 3363,
+
+     3363, 3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364, 3364,
+     3365, 3365, 3365, 3365, 3365, 3365, 3365, 3365, 3365, 3366,
+     3366, 3366, 3366, 3366, 3366, 3366, 3366, 3366, 3367, 3367,
+     3367, 3367, 3367, 3367, 3367, 3367, 3367, 3368, 3368, 3368,
+     3368, 3368, 3368, 3368, 3368, 3368, 3369, 3369, 3369, 3369,
+     3369, 3369, 3369, 3369, 3369, 3370, 3370, 3370, 3370, 3370,
+     3370, 3370, 3370, 3370, 3371, 3371, 3371, 3371, 3371, 3371,
+     3371, 3371, 3371, 3372, 3372, 3372, 3372, 3372, 3372, 3372,
+     3372, 3372, 3373, 3373, 3373, 3373, 3373, 3373, 3373, 3373,
+     3373, 3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374, 3374,
+
+     3375, 3375, 3375, 3375, 3375, 3375, 3375, 3375, 3375, 3376,
+     3376, 3376, 3376, 3376, 3376, 3376, 3376, 3376, 3377, 3377,
+     3377, 3377, 3377, 3377, 3377, 3377, 3377, 3378, 3378, 3378,
+     3378, 3378, 3378, 3378, 3378, 3378, 3379, 3379, 3379, 3379,
+     3379, 3379, 3379, 3379, 3379, 3380, 3380, 3380, 3380, 3380,
+     3380, 3380, 3380, 3380, 3381, 3381, 3381, 3381, 3381, 3381,
+     3381, 3381, 3381, 3382, 3382, 3382, 3382, 3382, 3382, 3382,
+     3382, 3382, 3383, 3383, 3383, 3383, 3383, 3383, 3383, 3383,
+     3383, 3384, 3384, 3384,    0,    0,    0, 3384, 3385, 3385,
+     3385,    0,    0,    0, 3385, 3386, 3386, 3386,    0,    0,
+
+        0, 3386, 3387, 3387, 3387,    0,    0,    0, 3387, 3388,
+     3388, 3388,    0,    0,    0, 3388, 3389, 3389, 3389,    0,
+        0,    0, 3389, 3390, 3390, 3390,    0,    0,    0, 3390,
+     3391, 3391, 3391,    0,    0,    0, 3391, 3392, 3392, 3392,
+        0,    0,    0, 3392, 3393, 3393, 3393,    0,    0,    0,
+     3393, 3394, 3394, 3394,    0,    0,    0, 3394, 3395, 3395,
+     3395,    0,    0,    0, 3395, 3396, 3396, 3396,    0,    0,
+        0, 3396, 3397, 3397, 3397,    0,    0,    0, 3397, 3398,
+     3398, 3398,    0,    0,    0, 3398, 3399, 3399, 3399,    0,
+        0,    0, 3399, 3400, 3400, 3400,    0,    0,    0, 3400,
+
+     3401, 3401, 3401,    0,    0,    0, 3401, 3402, 3402, 3402,
+        0,    0,    0, 3402, 3403, 3403, 3403,    0,    0,    0,
+     3403, 3404, 3404, 3404,    0,    0,    0, 3404, 3405, 3405,
+     3405,    0,    0,    0, 3405, 3406, 3406, 3406,    0,    0,
+        0, 3406, 3407, 3407, 3407,    0,    0,    0, 3407, 3408,
+     3408, 3408,    0,    0,    0, 3408, 3409, 3409, 3409,    0,
+        0,    0, 3409, 3410, 3410, 3410,    0,    0,    0, 3410,
+     3411, 3411, 3411,    0,    0,    0, 3411, 3412, 3412, 3412,
+     3412, 3412, 3412, 3412,    0, 3412, 3413, 3413, 3413,    0,
+        0,    0, 3413, 3414,    0,    0,    0, 3414, 3415, 3415,
+
+     3415,    0,    0,    0, 3415, 3416,    0,    0,    0, 3416,
+     3417, 3417, 3417,    0,    0,    0, 3417, 3418,    0,    0,
+        0, 3418, 3419, 3419, 3419,    0,    0,    0, 3419, 3420,
+        0,    0,    0, 3420, 3421, 3421, 3421,    0,    0,    0,
+     3421, 3422,    0,    0,    0, 3422, 3423, 3423, 3423,    0,
+        0,    0, 3423, 3424,    0,    0,    0, 3424, 3425, 3425,
+     3425,    0,    0,    0, 3425, 3426,    0,    0,    0, 3426,
+     3427, 3427, 3427,    0,    0,    0, 3427, 3428,    0,    0,
+        0, 3428, 3429, 3429, 3429,    0,    0,    0, 3429, 3430,
+        0,    0,    0, 3430, 3431, 3431, 3431,    0,    0,    0,
+
+     3431, 3432,    0,    0,    0, 3432, 3433, 3433, 3433,    0,
+        0,    0, 3433, 3434,    0,    0,    0, 3434, 3435, 3435,
+     3435,    0,    0,    0, 3435, 3436,    0,    0,    0, 3436,
+     3437, 3437, 3437,    0,    0,    0, 3437, 3438,    0,    0,
+        0, 3438, 3439, 3439, 3439,    0,    0,    0, 3439, 3440,
+        0,    0,    0, 3440, 3441, 3441, 3441,    0,    0,    0,
+     3441, 3442,    0,    0,    0, 3442, 3443, 3443, 3443,    0,
+        0,    0, 3443, 3444,    0,    0,    0, 3444, 3445, 3445,
+     3445,    0,    0,    0, 3445, 3446,    0,    0,    0, 3446,
+     3447, 3447, 3447,    0,    0,    0, 3447, 3448,    0,    0,
+
+        0, 3448, 3449, 3449, 3449,    0,    0,    0, 3449, 3450,
+        0,    0,    0, 3450, 3451, 3451, 3451,    0,    0,    0,
+     3451, 3452,    0,    0,    0, 3452, 3453, 3453, 3453,    0,
+        0,    0, 3453, 3454,    0,    0,    0, 3454, 3455, 3455,
+     3455,    0,    0,    0, 3455, 3456,    0,    0,    0, 3456,
+     3457, 3457, 3457,    0,    0,    0, 3457, 3458,    0,    0,
+        0, 3458, 3459, 3459, 3459,    0,    0,    0, 3459, 3460,
+        0,    0,    0, 3460, 3461, 3461, 3461,    0,    0,    0,
+     3461, 3462,    0,    0,    0, 3462, 3463, 3463, 3463,    0,
+        0,    0, 3463, 3464,    0,    0,    0, 3464, 3465, 3465,
+
+     3465,    0,    0,    0, 3465, 3466,    0,    0,    0, 3466,
+     3467, 3467, 3467,    0,    0,    0, 3467, 3468,    0,    0,
+        0, 3468, 3469, 3469, 3469, 3469, 3469, 3469, 3469, 3469,
+     3469, 3470,    0,    0,    0,    0, 3470, 3471, 3471, 3471,
+        0,    0,    0, 3471, 3472, 3472, 3472, 3472,    0,    0,
+     3472, 3472, 3473, 3473, 3473,    0,    0,    0, 3473, 3474,
+     3474, 3474, 3474,    0,    0, 3474, 3474, 3475, 3475, 3475,
+        0,    0,    0, 3475, 3476, 3476, 3476, 3476,    0,    0,
+     3476, 3476, 3477, 3477, 3477,    0,    0,    0, 3477, 3478,
+     3478, 3478, 3478,    0,    0, 3478, 3478, 3479, 3479, 3479,
+
+        0,    0,    0, 3479, 3480, 3480, 3480, 3480,    0,    0,
+     3480, 3480, 3481, 3481, 3481,    0,    0,    0, 3481, 3482,
+     3482, 3482, 3482,    0,    0, 3482, 3482, 3483, 3483, 3483,
+        0,    0,    0, 3483, 3484, 3484, 3484, 3484,    0,    0,
+     3484, 3484, 3485, 3485, 3485,    0,    0,    0, 3485, 3486,
      3486, 3486, 3486,    0,    0, 3486, 3486, 3487, 3487, 3487,
         0,    0,    0, 3487, 3488, 3488, 3488, 3488,    0,    0,
-     3488, 3488, 3489, 3489, 3489, 3489, 3489, 3489, 3489, 3489,
-     3489, 3490,    0, 3490,    0,    0, 3490, 3491, 3491, 3491,
+     3488, 3488, 3489, 3489, 3489,    0,    0,    0, 3489, 3490,
+     3490, 3490, 3490,    0,    0, 3490, 3490, 3491, 3491, 3491,
         0,    0,    0, 3491, 3492, 3492, 3492, 3492,    0,    0,
-     3492, 3492, 3493, 3493, 3493, 3493,    0, 3493,    0, 3493,
-
-     3494, 3494, 3494, 3494,    0,    0, 3494, 3494, 3495, 3495,
-     3495, 3495,    0, 3495,    0, 3495, 3496, 3496, 3496, 3496,
-        0,    0, 3496, 3496, 3497, 3497, 3497,    0,    0,    0,
-     3497, 3498, 3498, 3498, 3498,    0,    0, 3498, 3498, 3499,
-     3499, 3499,    0,    0,    0, 3499, 3500, 3500, 3500, 3500,
-        0,    0, 3500, 3500, 3501, 3501, 3501,    0,    0,    0,
-     3501, 3502, 3502, 3502, 3502,    0,    0, 3502, 3502, 3503,
-     3503, 3503,    0,    0,    0, 3503, 3504, 3504, 3504, 3504,
-        0,    0, 3504, 3504, 3505, 3505, 3505,    0,    0,    0,
-     3505, 3506, 3506, 3506, 3506,    0,    0, 3506, 3506, 3507,
-
-     3507, 3507, 3507,    0, 3507,    0, 3507, 3508, 3508, 3508,
-     3508,    0,    0, 3508, 3508, 3509, 3509, 3509, 3509,    0,
-     3509,    0, 3509, 3510, 3510, 3510, 3510,    0,    0, 3510,
-     3510, 3511, 3511, 3511,    0,    0,    0, 3511, 3512, 3512,
-     3512, 3512,    0,    0, 3512, 3512, 3513, 3513, 3513, 3513,
-        0, 3513,    0, 3513, 3514, 3514, 3514, 3514,    0,    0,
-     3514, 3514, 3515, 3515, 3515, 3515,    0, 3515,    0, 3515,
-     3516, 3516, 3516, 3516,    0,    0, 3516, 3516, 3517, 3517,
-     3517,    0,    0,    0, 3517, 3518, 3518, 3518, 3518,    0,
-        0, 3518, 3518, 3519, 3519, 3519,    0,    0,    0, 3519,
-
-     3520, 3520, 3520, 3520,    0,    0, 3520, 3520, 3521, 3521,
-     3521,    0,    0,    0, 3521, 3522, 3522, 3522, 3522,    0,
-        0, 3522, 3522, 3523, 3523, 3523,    0,    0,    0, 3523,
-     3524, 3524, 3524, 3524,    0,    0, 3524, 3524, 3525, 3525,
-     3525,    0,    0,    0, 3525, 3526, 3526, 3526, 3526,    0,
-        0, 3526, 3526, 3527, 3527, 3527,    0,    0,    0, 3527,
-     3528, 3528, 3528, 3528,    0,    0, 3528, 3528, 3529, 3529,
-     3529,    0,    0,    0, 3529, 3530, 3530, 3530, 3530,    0,
-        0, 3530, 3530, 3531, 3531, 3531,    0,    0,    0, 3531,
-     3532, 3532, 3532, 3532,    0,    0, 3532, 3532, 3533, 3533,
-
-     3533,    0,    0,    0, 3533, 3534, 3534, 3534, 3534,    0,
-        0, 3534, 3534, 3535, 3535, 3535, 3535,    0,    0, 3535,
-     3535, 3536, 3536, 3536,    0,    0,    0, 3536, 3537, 3537,
-     3537, 3537,    0,    0, 3537, 3537, 3538, 3538, 3538,    0,
-        0,    0, 3538, 3539, 3539, 3539, 3539,    0,    0, 3539,
-     3539, 3540, 3540, 3540,    0,    0,    0, 3540, 3541, 3541,
-     3541, 3541,    0,    0, 3541, 3541, 3542, 3542, 3542, 3542,
-        0,    0, 3542, 3542, 3543, 3543, 3543,    0,    0,    0,
-     3543, 3544, 3544, 3544, 3544,    0,    0, 3544, 3544, 3545,
-     3545, 3545, 3545, 3545, 3545, 3545, 3545, 3545, 3546, 3546,
-
-     3546, 3546, 3546, 3546, 3546, 3546, 3546, 3547, 3547, 3547,
-        0,    0,    0, 3547, 3548, 3548, 3548, 3548,    0,    0,
-     3548, 3548, 3549, 3549, 3549, 3549,    0,    0, 3549, 3549,
-     3550, 3550, 3550,    0,    0,    0, 3550, 3551, 3551, 3551,
-     3551,    0,    0, 3551, 3551, 3552, 3552, 3552,    0,    0,
-        0, 3552, 3553, 3553, 3553, 3553,    0,    0, 3553, 3553,
-     3554, 3554, 3554,    0,    0,    0, 3554, 3555, 3555, 3555,
-     3555,    0,    0, 3555, 3555, 3556, 3556, 3556,    0,    0,
-        0, 3556, 3557, 3557, 3557,    0,    0,    0, 3557, 3558,
-     3558, 3558, 3558,    0,    0, 3558, 3558, 3559, 3559, 3559,
-
-        0,    0,    0, 3559, 3560, 3560, 3560, 3560,    0,    0,
-     3560, 3560, 3561, 3561, 3561, 3561,    0,    0, 3561, 3561,
-     3562, 3562, 3562,    0,    0,    0, 3562, 3563, 3563, 3563,
-     3563,    0,    0, 3563, 3563, 3564, 3564, 3564,    0,    0,
-        0, 3564, 3565, 3565, 3565, 3565,    0,    0, 3565, 3565,
-     3566, 3566, 3566, 3566,    0,    0, 3566, 3566, 3567, 3567,
+
+     3492, 3492, 3493, 3493, 3493,    0,    0,    0, 3493, 3494,
+     3494, 3494, 3494,    0,    0, 3494, 3494, 3495, 3495, 3495,
+        0,    0,    0, 3495, 3496, 3496, 3496, 3496,    0,    0,
+     3496, 3496, 3497, 3497, 3497,    0,    0,    0, 3497, 3498,
+     3498, 3498, 3498,    0,    0, 3498, 3498, 3499, 3499, 3499,
+     3499,    0, 3499,    0, 3499, 3500, 3500, 3500, 3500,    0,
+        0, 3500, 3500, 3501, 3501, 3501,    0,    0,    0, 3501,
+     3502, 3502, 3502, 3502,    0,    0, 3502, 3502, 3503, 3503,
+     3503,    0,    0,    0, 3503, 3504, 3504, 3504, 3504,    0,
+        0, 3504, 3504, 3505, 3505, 3505,    0,    0,    0, 3505,
+
+     3506, 3506, 3506, 3506,    0,    0, 3506, 3506, 3507, 3507,
+     3507,    0,    0,    0, 3507, 3508, 3508, 3508, 3508,    0,
+        0, 3508, 3508, 3509, 3509, 3509, 3509,    0, 3509,    0,
+     3509, 3510, 3510, 3510, 3510,    0,    0, 3510, 3510, 3511,
+     3511, 3511, 3511,    0, 3511,    0, 3511, 3512, 3512, 3512,
+     3512,    0,    0, 3512, 3512, 3513, 3513, 3513,    0,    0,
+        0, 3513, 3514, 3514, 3514, 3514,    0,    0, 3514, 3514,
+     3515, 3515, 3515, 3515,    0, 3515,    0, 3515, 3516, 3516,
+     3516, 3516,    0,    0, 3516, 3516, 3517, 3517, 3517, 3517,
+        0, 3517,    0, 3517, 3518, 3518, 3518, 3518,    0,    0,
+
+     3518, 3518, 3519, 3519, 3519,    0,    0,    0, 3519, 3520,
+     3520, 3520, 3520,    0,    0, 3520, 3520, 3521, 3521, 3521,
+        0,    0,    0, 3521, 3522, 3522, 3522, 3522,    0,    0,
+     3522, 3522, 3523, 3523, 3523, 3523,    0,    0, 3523, 3523,
+     3524, 3524, 3524,    0,    0,    0, 3524, 3525, 3525, 3525,
+     3525,    0,    0, 3525, 3525, 3526, 3526, 3526, 3526, 3526,
+     3526, 3526, 3526, 3526, 3527,    0, 3527,    0,    0, 3527,
+     3528, 3528, 3528,    0,    0,    0, 3528, 3529, 3529, 3529,
+     3529,    0,    0, 3529, 3529, 3530, 3530, 3530, 3530,    0,
+     3530,    0, 3530, 3531, 3531, 3531, 3531,    0,    0, 3531,
+
+     3531, 3532, 3532, 3532, 3532,    0, 3532,    0, 3532, 3533,
+     3533, 3533, 3533,    0,    0, 3533, 3533, 3534, 3534, 3534,
+        0,    0,    0, 3534, 3535, 3535, 3535, 3535,    0,    0,
+     3535, 3535, 3536, 3536, 3536,    0,    0,    0, 3536, 3537,
+     3537, 3537, 3537,    0,    0, 3537, 3537, 3538, 3538, 3538,
+        0,    0,    0, 3538, 3539, 3539, 3539, 3539,    0,    0,
+     3539, 3539, 3540, 3540, 3540,    0,    0,    0, 3540, 3541,
+     3541, 3541, 3541,    0,    0, 3541, 3541, 3542, 3542, 3542,
+        0,    0,    0, 3542, 3543, 3543, 3543, 3543,    0,    0,
+     3543, 3543, 3544, 3544, 3544, 3544,    0, 3544,    0, 3544,
+
+     3545, 3545, 3545, 3545,    0,    0, 3545, 3545, 3546, 3546,
+     3546, 3546,    0, 3546,    0, 3546, 3547, 3547, 3547, 3547,
+        0,    0, 3547, 3547, 3548, 3548, 3548,    0,    0,    0,
+     3548, 3549, 3549, 3549, 3549,    0,    0, 3549, 3549, 3550,
+     3550, 3550, 3550,    0, 3550,    0, 3550, 3551, 3551, 3551,
+     3551,    0,    0, 3551, 3551, 3552, 3552, 3552, 3552,    0,
+     3552,    0, 3552, 3553, 3553, 3553, 3553,    0,    0, 3553,
+     3553, 3554, 3554, 3554,    0,    0,    0, 3554, 3555, 3555,
+     3555, 3555,    0,    0, 3555, 3555, 3556, 3556, 3556,    0,
+        0,    0, 3556, 3557, 3557, 3557, 3557,    0,    0, 3557,
+
+     3557, 3558, 3558, 3558,    0,    0,    0, 3558, 3559, 3559,
+     3559, 3559,    0,    0, 3559, 3559, 3560, 3560, 3560,    0,
+        0,    0, 3560, 3561, 3561, 3561, 3561,    0,    0, 3561,
+     3561, 3562, 3562, 3562,    0,    0,    0, 3562, 3563, 3563,
+     3563, 3563,    0,    0, 3563, 3563, 3564, 3564, 3564,    0,
+        0,    0, 3564, 3565, 3565, 3565, 3565,    0,    0, 3565,
+     3565, 3566, 3566, 3566,    0,    0,    0, 3566, 3567, 3567,
      3567, 3567,    0,    0, 3567, 3567, 3568, 3568, 3568,    0,
         0,    0, 3568, 3569, 3569, 3569, 3569,    0,    0, 3569,
-     3569, 3570, 3570, 3570, 3570,    0, 3570,    0, 3570, 3571,
-     3571, 3571, 3571,    0,    0, 3571, 3571, 3572, 3572, 3572,
-
-        0,    0,    0, 3572, 3573, 3573, 3573, 3573,    0,    0,
-     3573, 3573, 3574, 3574, 3574,    0,    0,    0, 3574, 3575,
-     3575, 3575, 3575,    0,    0, 3575, 3575, 3576, 3576, 3576,
-        0,    0,    0, 3576, 3577, 3577, 3577, 3577,    0,    0,
-     3577, 3577, 3578, 3578, 3578,    0,    0,    0, 3578, 3579,
+     3569, 3570, 3570, 3570,    0,    0,    0, 3570, 3571, 3571,
+
+     3571, 3571,    0,    0, 3571, 3571, 3572, 3572, 3572, 3572,
+        0,    0, 3572, 3572, 3573, 3573, 3573,    0,    0,    0,
+     3573, 3574, 3574, 3574, 3574,    0,    0, 3574, 3574, 3575,
+     3575, 3575,    0,    0,    0, 3575, 3576, 3576, 3576, 3576,
+        0,    0, 3576, 3576, 3577, 3577, 3577,    0,    0,    0,
+     3577, 3578, 3578, 3578, 3578,    0,    0, 3578, 3578, 3579,
      3579, 3579, 3579,    0,    0, 3579, 3579, 3580, 3580, 3580,
         0,    0,    0, 3580, 3581, 3581, 3581, 3581,    0,    0,
-     3581, 3581, 3582, 3582, 3582,    0,    0,    0, 3582, 3583,
-     3583, 3583, 3583,    0,    0, 3583, 3583, 3584, 3584, 3584,
-        0,    0,    0, 3584, 3585, 3585, 3585, 3585,    0,    0,
-
-     3585, 3585, 3586, 3586, 3586, 3586,    0,    0, 3586, 3586,
-     3587, 3587, 3587,    0,    0,    0, 3587, 3588, 3588, 3588,
-     3588,    0,    0, 3588, 3588, 3589, 3589, 3589,    0,    0,
-        0, 3589, 3590, 3590, 3590, 3590,    0,    0, 3590, 3590,
-     3591, 3591, 3591, 3591,    0, 3591,    0, 3591, 3592, 3592,
-     3592, 3592,    0,    0, 3592, 3592, 3593, 3593, 3593, 3593,
-        0,    0, 3593, 3593, 3594, 3594, 3594, 3594,    0, 3594,
+     3581, 3581, 3582, 3582, 3582, 3582, 3582, 3582, 3582, 3582,
+     3582, 3583, 3583, 3583, 3583, 3583, 3583, 3583, 3583, 3583,
+
+     3584, 3584, 3584,    0,    0,    0, 3584, 3585, 3585, 3585,
+     3585,    0,    0, 3585, 3585, 3586, 3586, 3586, 3586,    0,
+        0, 3586, 3586, 3587, 3587, 3587,    0,    0,    0, 3587,
+     3588, 3588, 3588, 3588,    0,    0, 3588, 3588, 3589, 3589,
+     3589,    0,    0,    0, 3589, 3590, 3590, 3590, 3590,    0,
+        0, 3590, 3590, 3591, 3591, 3591,    0,    0,    0, 3591,
+     3592, 3592, 3592, 3592,    0,    0, 3592, 3592, 3593, 3593,
+     3593,    0,    0,    0, 3593, 3594, 3594, 3594,    0,    0,
         0, 3594, 3595, 3595, 3595, 3595,    0,    0, 3595, 3595,
-     3596, 3596, 3596, 3596, 3596, 3596, 3596, 3596, 3596, 3597,
-     3597, 3597, 3597, 3597, 3597, 3597, 3597, 3597, 3598, 3598,
-
-     3598,    0,    0,    0, 3598, 3599, 3599, 3599, 3599,    0,
-        0, 3599, 3599, 3600, 3600, 3600, 3600,    0,    0, 3600,
-     3600, 3601, 3601, 3601,    0,    0,    0, 3601, 3602, 3602,
-     3602, 3602,    0,    0, 3602, 3602, 3603, 3603, 3603,    0,
-        0,    0, 3603, 3604, 3604, 3604, 3604,    0,    0, 3604,
-     3604, 3605, 3605, 3605,    0,    0,    0, 3605, 3606, 3606,
-     3606, 3606,    0,    0, 3606, 3606, 3607, 3607, 3607,    0,
-        0,    0, 3607, 3608, 3608, 3608,    0,    0,    0, 3608,
-     3609, 3609, 3609, 3609,    0,    0, 3609, 3609, 3610, 3610,
-     3610,    0,    0,    0, 3610, 3611, 3611, 3611, 3611,    0,
-
-        0, 3611, 3611, 3612, 3612, 3612, 3612,    0,    0, 3612,
-     3612, 3613, 3613, 3613, 3613,    0, 3613,    0, 3613, 3614,
-     3614, 3614, 3614,    0,    0, 3614, 3614, 3615, 3615, 3615,
-        0,    0,    0, 3615, 3616, 3616, 3616, 3616,    0,    0,
-     3616, 3616, 3617, 3617, 3617, 3617,    0,    0, 3617, 3617,
-     3618, 3618, 3618,    0,    0,    0, 3618, 3619, 3619, 3619,
-     3619,    0,    0, 3619, 3619, 3620, 3620, 3620, 3620,    0,
-     3620,    0, 3620, 3621, 3621, 3621, 3621,    0,    0, 3621,
-     3621, 3622, 3622, 3622,    0,    0,    0, 3622, 3623, 3623,
-     3623, 3623,    0,    0, 3623, 3623, 3624, 3624, 3624,    0,
-
-        0,    0, 3624, 3625, 3625, 3625, 3625,    0,    0, 3625,
-     3625, 3626, 3626, 3626,    0,    0,    0, 3626, 3627, 3627,
-     3627, 3627,    0,    0, 3627, 3627, 3628, 3628, 3628,    0,
-        0,    0, 3628, 3629, 3629, 3629, 3629,    0,    0, 3629,
-     3629, 3630, 3630, 3630,    0,    0,    0, 3630, 3631, 3631,
-     3631, 3631,    0,    0, 3631, 3631, 3632, 3632, 3632, 3632,
-        0, 3632,    0, 3632, 3633, 3633, 3633, 3633,    0,    0,
-     3633, 3633, 3634, 3634, 3634,    0,    0,    0, 3634, 3635,
-     3635, 3635, 3635,    0,    0, 3635, 3635, 3636, 3636, 3636,
-     3636,    0,    0, 3636, 3636, 3637, 3637, 3637, 3637,    0,
-
-     3637,    0, 3637, 3638, 3638, 3638, 3638,    0,    0, 3638,
+     3596, 3596, 3596,    0,    0,    0, 3596, 3597, 3597, 3597,
+
+     3597,    0,    0, 3597, 3597, 3598, 3598, 3598,    0,    0,
+        0, 3598, 3599, 3599, 3599, 3599,    0,    0, 3599, 3599,
+     3600, 3600, 3600,    0,    0,    0, 3600, 3601, 3601, 3601,
+     3601,    0,    0, 3601, 3601, 3602, 3602, 3602,    0,    0,
+        0, 3602, 3603, 3603, 3603, 3603,    0,    0, 3603, 3603,
+     3604, 3604, 3604, 3604,    0,    0, 3604, 3604, 3605, 3605,
+     3605, 3605,    0,    0, 3605, 3605, 3606, 3606, 3606,    0,
+        0,    0, 3606, 3607, 3607, 3607, 3607,    0,    0, 3607,
+     3607, 3608, 3608, 3608, 3608,    0, 3608,    0, 3608, 3609,
+     3609, 3609, 3609,    0,    0, 3609, 3609, 3610, 3610, 3610,
+
+        0,    0,    0, 3610, 3611, 3611, 3611, 3611,    0,    0,
+     3611, 3611, 3612, 3612, 3612,    0,    0,    0, 3612, 3613,
+     3613, 3613, 3613,    0,    0, 3613, 3613, 3614, 3614, 3614,
+        0,    0,    0, 3614, 3615, 3615, 3615, 3615,    0,    0,
+     3615, 3615, 3616, 3616, 3616,    0,    0,    0, 3616, 3617,
+     3617, 3617, 3617,    0,    0, 3617, 3617, 3618, 3618, 3618,
+        0,    0,    0, 3618, 3619, 3619, 3619, 3619,    0,    0,
+     3619, 3619, 3620, 3620, 3620,    0,    0,    0, 3620, 3621,
+     3621, 3621, 3621,    0,    0, 3621, 3621, 3622, 3622, 3622,
+        0,    0,    0, 3622, 3623, 3623, 3623, 3623,    0,    0,
+
+     3623, 3623, 3624, 3624, 3624, 3624,    0,    0, 3624, 3624,
+     3625, 3625, 3625,    0,    0,    0, 3625, 3626, 3626, 3626,
+     3626,    0,    0, 3626, 3626, 3627, 3627, 3627,    0,    0,
+        0, 3627, 3628, 3628, 3628, 3628,    0,    0, 3628, 3628,
+     3629, 3629, 3629, 3629,    0, 3629,    0, 3629, 3630, 3630,
+     3630, 3630,    0,    0, 3630, 3630, 3631, 3631, 3631, 3631,
+        0,    0, 3631, 3631, 3632, 3632, 3632, 3632,    0, 3632,
+        0, 3632, 3633, 3633, 3633, 3633,    0,    0, 3633, 3633,
+     3634, 3634, 3634, 3634, 3634, 3634, 3634, 3634, 3634, 3635,
+     3635, 3635, 3635, 3635, 3635, 3635, 3635, 3635, 3636, 3636,
+
+     3636,    0,    0,    0, 3636, 3637, 3637, 3637, 3637,    0,
+        0, 3637, 3637, 3638, 3638, 3638, 3638,    0,    0, 3638,
      3638, 3639, 3639, 3639,    0,    0,    0, 3639, 3640, 3640,
-     3640, 3640,    0,    0, 3640, 3640, 3641, 3641, 3641, 3641,
-        0,    0, 3641, 3641, 3642, 3642, 3642, 3642,    0,    0,
-     3642, 3642, 3643, 3643, 3643, 3643,    0,    0, 3643, 3643,
-     3644, 3644, 3644, 3644, 3644, 3644, 3644, 3644, 3644, 3645,
-     3645, 3645, 3645, 3645, 3645, 3645, 3645, 3645, 3646, 3646,
-     3646, 3646,    0, 3646,    0, 3646, 3647, 3647, 3647, 3647,
-        0,    0, 3647, 3647, 3648, 3648, 3648, 3648,    0,    0,
-     3648, 3648, 3649, 3649, 3649,    0,    0,    0, 3649, 3650,
-
-     3650, 3650, 3650,    0,    0, 3650, 3650, 3651, 3651, 3651,
-        0,    0,    0, 3651, 3652, 3652, 3652, 3652,    0,    0,
-     3652, 3652, 3653, 3653, 3653, 3653,    0, 3653,    0, 3653,
-     3654, 3654, 3654, 3654,    0,    0, 3654, 3654, 3655, 3655,
-     3655, 3655,    0, 3655,    0, 3655, 3656, 3656, 3656, 3656,
-        0, 3656,    0, 3656, 3657, 3657, 3657, 3657,    0,    0,
-     3657, 3657, 3658, 3658, 3658, 3658,    0, 3658,    0, 3658,
-     3659, 3659, 3659, 3659,    0,    0, 3659, 3659, 3660, 3660,
-     3660, 3660,    0,    0, 3660, 3660, 3661, 3661, 3661, 3661,
-        0,    0, 3661, 3661, 3662, 3662, 3662,    0,    0,    0,
-
-     3662, 3663, 3663, 3663, 3663,    0,    0, 3663, 3663, 3664,
-     3664, 3664,    0,    0,    0, 3664, 3665, 3665, 3665, 3665,
-        0,    0, 3665, 3665, 3666, 3666, 3666, 3666,    0, 3666,
-        0, 3666, 3667, 3667, 3667, 3667,    0,    0, 3667, 3667,
-     3668, 3668, 3668,    0,    0,    0, 3668, 3669, 3669, 3669,
-        0,    0,    0, 3669, 3670, 3670, 3670, 3670,    0,    0,
-     3670, 3670, 3671, 3671, 3671,    0,    0,    0, 3671, 3672,
-     3672, 3672, 3672,    0,    0, 3672, 3672, 3673, 3673, 3673,
-        0,    0,    0, 3673, 3674, 3674, 3674,    0,    0,    0,
-     3674, 3675, 3675, 3675, 3675,    0,    0, 3675, 3675, 3676,
-
-     3676, 3676,    0,    0,    0, 3676, 3677, 3677, 3677, 3677,
-        0,    0, 3677, 3677, 3678, 3678, 3678,    0,    0,    0,
-     3678, 3679, 3679, 3679, 3679,    0,    0, 3679, 3679, 3680,
-     3680, 3680, 3680,    0,    0, 3680, 3680, 3681, 3681, 3681,
-     3681,    0,    0, 3681, 3681, 3682, 3682, 3682,    0,    0,
-        0, 3682, 3683, 3683, 3683, 3683,    0,    0, 3683, 3683,
-     3684, 3684, 3684, 3684,    0,    0, 3684, 3684, 3685, 3685,
-     3685, 3685,    0,    0, 3685, 3685, 3686, 3686, 3686, 3686,
-     3686, 3686, 3686, 3686, 3686, 3687, 3687, 3687, 3687, 3687,
-     3687, 3687, 3687, 3687, 3688, 3688, 3688, 3688,    0,    0,
-
-     3688, 3688, 3689, 3689, 3689, 3689,    0,    0, 3689, 3689,
-     3690, 3690, 3690,    0,    0,    0, 3690, 3691, 3691, 3691,
-        0,    0,    0, 3691, 3692, 3692, 3692, 3692,    0,    0,
-     3692, 3692, 3693, 3693, 3693, 3693,    0,    0, 3693, 3693,
-     3694, 3694, 3694, 3694,    0,    0, 3694, 3694, 3695, 3695,
-     3695, 3695,    0,    0, 3695, 3695, 3696, 3696, 3696, 3696,
-        0,    0, 3696, 3696, 3697, 3697, 3697,    0,    0,    0,
-     3697, 3698, 3698, 3698, 3698,    0,    0, 3698, 3698, 3699,
-     3699, 3699,    0,    0,    0, 3699, 3700, 3700, 3700, 3700,
-        0,    0, 3700, 3700, 3701, 3701, 3701, 3701,    0,    0,
-
-     3701, 3701, 3702, 3702, 3702,    0,    0,    0, 3702, 3703,
-     3703, 3703,    0,    0,    0, 3703, 3704, 3704, 3704, 3704,
-        0,    0, 3704, 3704, 3705, 3705, 3705,    0,    0,    0,
-     3705, 3706, 3706, 3706, 3706,    0,    0, 3706, 3706, 3707,
-     3707, 3707,    0,    0,    0, 3707, 3708, 3708, 3708,    0,
-        0,    0, 3708, 3709, 3709, 3709,    0,    0,    0, 3709,
-     3710, 3710, 3710, 3710,    0,    0, 3710, 3710, 3711, 3711,
-     3711,    0,    0,    0, 3711, 3712, 3712, 3712, 3712,    0,
-        0, 3712, 3712, 3713, 3713, 3713, 3713,    0,    0, 3713,
-     3713, 3714, 3714, 3714, 3714,    0,    0, 3714, 3714, 3715,
-
-     3715, 3715, 3715,    0, 3715,    0, 3715, 3716, 3716, 3716,
-     3716,    0,    0, 3716, 3716, 3717, 3717, 3717, 3717,    0,
-        0, 3717, 3717, 3718, 3718, 3718, 3718,    0,    0, 3718,
-     3718, 3719, 3719, 3719, 3719, 3719, 3719, 3719, 3719, 3719,
-     3720, 3720, 3720, 3720, 3720, 3720, 3720, 3720, 3720, 3721,
-     3721, 3721, 3721,    0,    0, 3721, 3721, 3722, 3722, 3722,
-     3722,    0,    0, 3722, 3722, 3723, 3723, 3723,    0,    0,
-        0, 3723, 3724, 3724, 3724, 3724,    0, 3724,    0, 3724,
-     3725, 3725, 3725, 3725,    0,    0, 3725, 3725, 3726, 3726,
-     3726, 3726,    0,    0, 3726, 3726, 3727, 3727, 3727, 3727,
-
-        0,    0, 3727, 3727, 3728, 3728, 3728, 3728,    0,    0,
-     3728, 3728, 3729, 3729, 3729,    0,    0,    0, 3729, 3730,
-     3730, 3730, 3730,    0,    0, 3730, 3730, 3731, 3731, 3731,
-        0,    0,    0, 3731, 3732, 3732, 3732, 3732,    0,    0,
-     3732, 3732, 3733, 3733, 3733, 3733,    0,    0, 3733, 3733,
-     3734, 3734, 3734,    0,    0,    0, 3734, 3735, 3735, 3735,
-        0,    0,    0, 3735, 3736, 3736, 3736, 3736,    0, 3736,
-        0, 3736, 3737, 3737, 3737, 3737,    0,    0, 3737, 3737,
-     3738, 3738, 3738, 3738,    0, 3738,    0, 3738, 3739, 3739,
-     3739,    0,    0,    0, 3739, 3740, 3740, 3740,    0,    0,
-
-        0, 3740, 3741, 3741, 3741, 3741,    0,    0, 3741, 3741,
-     3742, 3742, 3742, 3742,    0, 3742,    0, 3742, 3743, 3743,
-     3743, 3743,    0,    0, 3743, 3743, 3744, 3744, 3744, 3744,
-        0,    0, 3744, 3744, 3745, 3745, 3745, 3745,    0,    0,
-     3745, 3745, 3746, 3746, 3746, 3746,    0, 3746,    0, 3746,
-     3747, 3747, 3747, 3747,    0,    0, 3747, 3747, 3748, 3748,
-     3748, 3748,    0,    0, 3748, 3748, 3749, 3749, 3749, 3749,
-     3749, 3749, 3749, 3749, 3749, 3750, 3750, 3750, 3750, 3750,
-     3750, 3750, 3750, 3750, 3751, 3751, 3751, 3751,    0,    0,
-     3751, 3751, 3752, 3752, 3752,    0,    0,    0, 3752, 3753,
-
-     3753, 3753,    0,    0,    0, 3753, 3754, 3754, 3754, 3754,
-        0,    0, 3754, 3754, 3755, 3755, 3755, 3755,    0,    0,
-     3755, 3755, 3756, 3756, 3756, 3756,    0,    0, 3756, 3756,
-     3757, 3757, 3757,    0,    0,    0, 3757, 3758, 3758, 3758,
-     3758,    0,    0, 3758, 3758, 3759, 3759, 3759,    0,    0,
-        0, 3759, 3760, 3760, 3760, 3760, 3760, 3760, 3760, 3760,
-     3760, 3761, 3761, 3761, 3761, 3761, 3761, 3761, 3761, 3761,
-     3762, 3762, 3762, 3762, 3762, 3762, 3762, 3762, 3762, 3763,
-     3763, 3763, 3763, 3763, 3763, 3763, 3763, 3763, 3764, 3764,
-     3764, 3764, 3764, 3764, 3764, 3764, 3764, 3765, 3765, 3765,
-
-     3765, 3765, 3765, 3765, 3765, 3765, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285, 3285,
-     3285
+     3640, 3640,    0,    0, 3640, 3640, 3641, 3641, 3641,    0,
+        0,    0, 3641, 3642, 3642, 3642, 3642,    0,    0, 3642,
+     3642, 3643, 3643, 3643,    0,    0,    0, 3643, 3644, 3644,
+     3644, 3644,    0,    0, 3644, 3644, 3645, 3645, 3645,    0,
+        0,    0, 3645, 3646, 3646, 3646,    0,    0,    0, 3646,
+     3647, 3647, 3647, 3647,    0,    0, 3647, 3647, 3648, 3648,
+     3648,    0,    0,    0, 3648, 3649, 3649, 3649, 3649,    0,
+
+        0, 3649, 3649, 3650, 3650, 3650,    0,    0,    0, 3650,
+     3651, 3651, 3651, 3651,    0,    0, 3651, 3651, 3652, 3652,
+     3652, 3652,    0, 3652,    0, 3652, 3653, 3653, 3653, 3653,
+        0,    0, 3653, 3653, 3654, 3654, 3654,    0,    0,    0,
+     3654, 3655, 3655, 3655, 3655,    0,    0, 3655, 3655, 3656,
+     3656, 3656, 3656,    0,    0, 3656, 3656, 3657, 3657, 3657,
+        0,    0,    0, 3657, 3658, 3658, 3658, 3658,    0,    0,
+     3658, 3658, 3659, 3659, 3659, 3659,    0, 3659,    0, 3659,
+     3660, 3660, 3660, 3660,    0,    0, 3660, 3660, 3661, 3661,
+     3661,    0,    0,    0, 3661, 3662, 3662, 3662, 3662,    0,
+
+        0, 3662, 3662, 3663, 3663, 3663,    0,    0,    0, 3663,
+     3664, 3664, 3664, 3664,    0,    0, 3664, 3664, 3665, 3665,
+     3665,    0,    0,    0, 3665, 3666, 3666, 3666, 3666,    0,
+        0, 3666, 3666, 3667, 3667, 3667,    0,    0,    0, 3667,
+     3668, 3668, 3668, 3668,    0,    0, 3668, 3668, 3669, 3669,
+     3669,    0,    0,    0, 3669, 3670, 3670, 3670, 3670,    0,
+        0, 3670, 3670, 3671, 3671, 3671, 3671,    0, 3671,    0,
+     3671, 3672, 3672, 3672, 3672,    0,    0, 3672, 3672, 3673,
+     3673, 3673,    0,    0,    0, 3673, 3674, 3674, 3674, 3674,
+        0,    0, 3674, 3674, 3675, 3675, 3675, 3675,    0,    0,
+
+     3675, 3675, 3676, 3676, 3676, 3676,    0, 3676,    0, 3676,
+     3677, 3677, 3677, 3677,    0,    0, 3677, 3677, 3678, 3678,
+     3678,    0,    0,    0, 3678, 3679, 3679, 3679, 3679,    0,
+        0, 3679, 3679, 3680, 3680, 3680, 3680,    0,    0, 3680,
+     3680, 3681, 3681, 3681, 3681,    0,    0, 3681, 3681, 3682,
+     3682, 3682, 3682,    0,    0, 3682, 3682, 3683, 3683, 3683,
+     3683, 3683, 3683, 3683, 3683, 3683, 3684, 3684, 3684, 3684,
+     3684, 3684, 3684, 3684, 3684, 3685, 3685, 3685, 3685,    0,
+     3685,    0, 3685, 3686, 3686, 3686, 3686,    0,    0, 3686,
+     3686, 3687, 3687, 3687, 3687,    0,    0, 3687, 3687, 3688,
+
+     3688, 3688,    0,    0,    0, 3688, 3689, 3689, 3689, 3689,
+        0,    0, 3689, 3689, 3690, 3690, 3690,    0,    0,    0,
+     3690, 3691, 3691, 3691, 3691,    0,    0, 3691, 3691, 3692,
+     3692, 3692, 3692,    0, 3692,    0, 3692, 3693, 3693, 3693,
+     3693,    0,    0, 3693, 3693, 3694, 3694, 3694, 3694,    0,
+     3694,    0, 3694, 3695, 3695, 3695, 3695,    0, 3695,    0,
+     3695, 3696, 3696, 3696, 3696,    0,    0, 3696, 3696, 3697,
+     3697, 3697, 3697,    0, 3697,    0, 3697, 3698, 3698, 3698,
+     3698,    0,    0, 3698, 3698, 3699, 3699, 3699,    0,    0,
+        0, 3699, 3700, 3700, 3700, 3700,    0,    0, 3700, 3700,
+
+     3701, 3701, 3701, 3701,    0,    0, 3701, 3701, 3702, 3702,
+     3702,    0,    0,    0, 3702, 3703, 3703, 3703, 3703,    0,
+        0, 3703, 3703, 3704, 3704, 3704,    0,    0,    0, 3704,
+     3705, 3705, 3705, 3705,    0,    0, 3705, 3705, 3706, 3706,
+     3706, 3706,    0, 3706,    0, 3706, 3707, 3707, 3707, 3707,
+        0,    0, 3707, 3707, 3708, 3708, 3708,    0,    0,    0,
+     3708, 3709, 3709, 3709,    0,    0,    0, 3709, 3710, 3710,
+     3710, 3710,    0,    0, 3710, 3710, 3711, 3711, 3711,    0,
+        0,    0, 3711, 3712, 3712, 3712, 3712,    0,    0, 3712,
+     3712, 3713, 3713, 3713,    0,    0,    0, 3713, 3714, 3714,
+
+     3714,    0,    0,    0, 3714, 3715, 3715, 3715, 3715,    0,
+        0, 3715, 3715, 3716, 3716, 3716,    0,    0,    0, 3716,
+     3717, 3717, 3717, 3717,    0,    0, 3717, 3717, 3718, 3718,
+     3718,    0,    0,    0, 3718, 3719, 3719, 3719, 3719,    0,
+        0, 3719, 3719, 3720, 3720, 3720, 3720,    0,    0, 3720,
+     3720, 3721, 3721, 3721, 3721,    0,    0, 3721, 3721, 3722,
+     3722, 3722,    0,    0,    0, 3722, 3723, 3723, 3723, 3723,
+        0,    0, 3723, 3723, 3724, 3724, 3724, 3724,    0,    0,
+     3724, 3724, 3725, 3725, 3725, 3725,    0,    0, 3725, 3725,
+     3726, 3726, 3726, 3726, 3726, 3726, 3726, 3726, 3726, 3727,
+
+     3727, 3727, 3727, 3727, 3727, 3727, 3727, 3727, 3728, 3728,
+     3728, 3728,    0,    0, 3728, 3728, 3729, 3729, 3729, 3729,
+        0,    0, 3729, 3729, 3730, 3730, 3730,    0,    0,    0,
+     3730, 3731, 3731, 3731,    0,    0,    0, 3731, 3732, 3732,
+     3732, 3732,    0,    0, 3732, 3732, 3733, 3733, 3733, 3733,
+        0,    0, 3733, 3733, 3734, 3734, 3734,    0,    0,    0,
+     3734, 3735, 3735, 3735, 3735,    0,    0, 3735, 3735, 3736,
+     3736, 3736,    0,    0,    0, 3736, 3737, 3737, 3737, 3737,
+        0,    0, 3737, 3737, 3738, 3738, 3738,    0,    0,    0,
+     3738, 3739, 3739, 3739, 3739,    0,    0, 3739, 3739, 3740,
+
+     3740, 3740,    0,    0,    0, 3740, 3741, 3741, 3741, 3741,
+        0,    0, 3741, 3741, 3742, 3742, 3742,    0,    0,    0,
+     3742, 3743, 3743, 3743, 3743,    0,    0, 3743, 3743, 3744,
+     3744, 3744, 3744,    0,    0, 3744, 3744, 3745, 3745, 3745,
+        0,    0,    0, 3745, 3746, 3746, 3746,    0,    0,    0,
+     3746, 3747, 3747, 3747, 3747,    0,    0, 3747, 3747, 3748,
+     3748, 3748,    0,    0,    0, 3748, 3749, 3749, 3749, 3749,
+        0,    0, 3749, 3749, 3750, 3750, 3750,    0,    0,    0,
+     3750, 3751, 3751, 3751,    0,    0,    0, 3751, 3752, 3752,
+     3752,    0,    0,    0, 3752, 3753, 3753, 3753, 3753,    0,
+
+        0, 3753, 3753, 3754, 3754, 3754,    0,    0,    0, 3754,
+     3755, 3755, 3755, 3755,    0,    0, 3755, 3755, 3756, 3756,
+     3756, 3756,    0,    0, 3756, 3756, 3757, 3757, 3757, 3757,
+        0,    0, 3757, 3757, 3758, 3758, 3758, 3758,    0, 3758,
+        0, 3758, 3759, 3759, 3759, 3759,    0,    0, 3759, 3759,
+     3760, 3760, 3760, 3760,    0,    0, 3760, 3760, 3761, 3761,
+     3761, 3761,    0,    0, 3761, 3761, 3762, 3762, 3762, 3762,
+     3762, 3762, 3762, 3762, 3762, 3763, 3763, 3763, 3763, 3763,
+     3763, 3763, 3763, 3763, 3764, 3764, 3764, 3764,    0,    0,
+     3764, 3764, 3765, 3765, 3765, 3765,    0,    0, 3765, 3765,
+
+     3766, 3766, 3766,    0,    0,    0, 3766, 3767, 3767, 3767,
+     3767,    0, 3767,    0, 3767, 3768, 3768, 3768, 3768,    0,
+        0, 3768, 3768, 3769, 3769, 3769,    0,    0,    0, 3769,
+     3770, 3770, 3770, 3770,    0,    0, 3770, 3770, 3771, 3771,
+     3771,    0,    0,    0, 3771, 3772, 3772, 3772, 3772,    0,
+        0, 3772, 3772, 3773, 3773, 3773, 3773,    0, 3773,    0,
+     3773, 3774, 3774, 3774, 3774,    0,    0, 3774, 3774, 3775,
+     3775, 3775,    0,    0,    0, 3775, 3776, 3776, 3776, 3776,
+        0,    0, 3776, 3776, 3777, 3777, 3777,    0,    0,    0,
+     3777, 3778, 3778, 3778, 3778,    0,    0, 3778, 3778, 3779,
+
+     3779, 3779, 3779,    0,    0, 3779, 3779, 3780, 3780, 3780,
+        0,    0,    0, 3780, 3781, 3781, 3781,    0,    0,    0,
+     3781, 3782, 3782, 3782, 3782,    0, 3782,    0, 3782, 3783,
+     3783, 3783, 3783,    0,    0, 3783, 3783, 3784, 3784, 3784,
+     3784,    0, 3784,    0, 3784, 3785, 3785, 3785,    0,    0,
+        0, 3785, 3786, 3786, 3786,    0,    0,    0, 3786, 3787,
+     3787, 3787, 3787,    0,    0, 3787, 3787, 3788, 3788, 3788,
+     3788,    0, 3788,    0, 3788, 3789, 3789, 3789, 3789,    0,
+        0, 3789, 3789, 3790, 3790, 3790, 3790,    0,    0, 3790,
+     3790, 3791, 3791, 3791, 3791,    0,    0, 3791, 3791, 3792,
+
+     3792, 3792, 3792,    0, 3792,    0, 3792, 3793, 3793, 3793,
+     3793,    0,    0, 3793, 3793, 3794, 3794, 3794, 3794,    0,
+        0, 3794, 3794, 3795, 3795, 3795, 3795, 3795, 3795, 3795,
+     3795, 3795, 3796, 3796, 3796, 3796, 3796, 3796, 3796, 3796,
+     3796, 3797, 3797, 3797, 3797,    0,    0, 3797, 3797, 3798,
+     3798, 3798,    0,    0,    0, 3798, 3799, 3799, 3799,    0,
+        0,    0, 3799, 3800, 3800, 3800, 3800,    0,    0, 3800,
+     3800, 3801, 3801, 3801,    0,    0,    0, 3801, 3802, 3802,
+     3802, 3802,    0,    0, 3802, 3802, 3803, 3803, 3803,    0,
+        0,    0, 3803, 3804, 3804, 3804, 3804,    0,    0, 3804,
+
+     3804, 3805, 3805, 3805,    0,    0,    0, 3805, 3806, 3806,
+     3806, 3806,    0,    0, 3806, 3806, 3807, 3807, 3807,    0,
+        0,    0, 3807, 3808, 3808, 3808,    0,    0,    0, 3808,
+     3809, 3809, 3809,    0,    0,    0, 3809, 3810, 3810, 3810,
+     3810, 3810, 3810, 3810, 3810, 3810, 3811, 3811, 3811, 3811,
+     3811, 3811, 3811, 3811, 3811, 3812, 3812, 3812, 3812, 3812,
+     3812, 3812, 3812, 3812, 3813, 3813, 3813, 3813, 3813, 3813,
+     3813, 3813, 3813, 3814, 3814, 3814, 3814, 3814, 3814, 3814,
+     3814, 3814, 3815, 3815, 3815, 3815, 3815, 3815, 3815, 3815,
+     3815, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322, 3322,
+     3322, 3322, 3322, 3322, 3322, 3322
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[563] =
+static yyconst flex_int32_t yy_rule_can_match_eol[569] =
     {   0,
 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 
     0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 
@@ -4355,28 +4412,28 @@ static yyconst flex_int32_t yy_rule_can_match_eol[563] =
     1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 
     0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
     1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 
-    1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
-    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
-    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
-    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
     1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 
-    0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 
-    1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 
+    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 
+    1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
     1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 
-    0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 
-    0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
-    1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 
-    0, 1, 0,     };
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 
+    0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 
+    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 
+    0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 
+    0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 
+    1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 
+    0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 
+    0, 0, 0, 1, 0, 0, 0, 1, 0,     };
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
@@ -4588,6 +4645,9 @@ short int surfxml_process_kill___time_isset;
 AT_surfxml_cluster_bb___bw AX_surfxml_cluster_bb___bw;
 #define A_surfxml_cluster_bb___bw (surfxml_bufferstack + AX_surfxml_cluster_bb___bw)
 short int surfxml_cluster_bb___bw_isset;
+AT_surfxml_host_pstate AX_surfxml_host_pstate;
+#define A_surfxml_host_pstate (surfxml_bufferstack + AX_surfxml_host_pstate)
+short int surfxml_host_pstate_isset;
 AT_surfxml_argument_value AX_surfxml_argument_value;
 #define A_surfxml_argument_value (surfxml_bufferstack + AX_surfxml_argument_value)
 short int surfxml_argument_value_isset;
@@ -4708,15 +4768,15 @@ short int surfxml_link_state___file_isset;
 AT_surfxml_random_radical AX_surfxml_random_radical;
 #define A_surfxml_random_radical (surfxml_bufferstack + AX_surfxml_random_radical)
 short int surfxml_random_radical_isset;
+AT_surfxml_mount_storageId AX_surfxml_mount_storageId;
+#define A_surfxml_mount_storageId (surfxml_bufferstack + AX_surfxml_mount_storageId)
+short int surfxml_mount_storageId_isset;
 AT_surfxml_bypassASroute_gw___src AX_surfxml_bypassASroute_gw___src;
 #define A_surfxml_bypassASroute_gw___src (surfxml_bufferstack + AX_surfxml_bypassASroute_gw___src)
 short int surfxml_bypassASroute_gw___src_isset;
 AT_surfxml_trace___connect_trace AX_surfxml_trace___connect_trace;
 #define A_surfxml_trace___connect_trace (surfxml_bufferstack + AX_surfxml_trace___connect_trace)
 short int surfxml_trace___connect_trace_isset;
-AT_surfxml_mount_id AX_surfxml_mount_id;
-#define A_surfxml_mount_id (surfxml_bufferstack + AX_surfxml_mount_id)
-short int surfxml_mount_id_isset;
 AT_surfxml_cluster_power AX_surfxml_cluster_power;
 #define A_surfxml_cluster_power (surfxml_bufferstack + AX_surfxml_cluster_power)
 short int surfxml_cluster_power_isset;
@@ -4726,15 +4786,18 @@ short int surfxml_process_function_isset;
 AT_surfxml_peer_id AX_surfxml_peer_id;
 #define A_surfxml_peer_id (surfxml_bufferstack + AX_surfxml_peer_id)
 short int surfxml_peer_id_isset;
+AT_surfxml_cabinet_radical AX_surfxml_cabinet_radical;
+#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical)
+short int surfxml_cabinet_radical_isset;
+AT_surfxml_storage_content___type AX_surfxml_storage_content___type;
+#define A_surfxml_storage_content___type (surfxml_bufferstack + AX_surfxml_storage_content___type)
+short int surfxml_storage_content___type_isset;
 AT_surfxml_cluster_router___id AX_surfxml_cluster_router___id;
 #define A_surfxml_cluster_router___id (surfxml_bufferstack + AX_surfxml_cluster_router___id)
 short int surfxml_cluster_router___id_isset;
 AT_surfxml_cluster_loopback___lat AX_surfxml_cluster_loopback___lat;
 #define A_surfxml_cluster_loopback___lat (surfxml_bufferstack + AX_surfxml_cluster_loopback___lat)
 short int surfxml_cluster_loopback___lat_isset;
-AT_surfxml_cabinet_radical AX_surfxml_cabinet_radical;
-#define A_surfxml_cabinet_radical (surfxml_bufferstack + AX_surfxml_cabinet_radical)
-short int surfxml_cabinet_radical_isset;
 AT_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy;
 #define A_surfxml_cluster_sharing___policy AX_surfxml_cluster_sharing___policy
 short int surfxml_cluster_sharing___policy_isset;
@@ -4765,6 +4828,9 @@ short int surfxml_route_src_isset;
 AT_surfxml_storage_id AX_surfxml_storage_id;
 #define A_surfxml_storage_id (surfxml_bufferstack + AX_surfxml_storage_id)
 short int surfxml_storage_id_isset;
+AT_surfxml_storage___type_content___type AX_surfxml_storage___type_content___type;
+#define A_surfxml_storage___type_content___type (surfxml_bufferstack + AX_surfxml_storage___type_content___type)
+short int surfxml_storage___type_content___type_isset;
 AT_surfxml_host_coordinates AX_surfxml_host_coordinates;
 #define A_surfxml_host_coordinates (surfxml_bufferstack + AX_surfxml_host_coordinates)
 short int surfxml_host_coordinates_isset;
@@ -5307,8 +5373,11 @@ YY_DECL
   bnext = inext = 1;
   surfxml_bufferliteral('\0', &bnext, "0.0");
   surfxml_bufferliteral('\0', &bnext, "2147483647");
+  surfxml_bufferliteral('\0', &bnext, "txt_unix");
+  surfxml_bufferliteral('\0', &bnext, "txt_unix");
   surfxml_bufferliteral('\0', &bnext, "1");
   surfxml_bufferliteral('\0', &bnext, "1.0");
+  surfxml_bufferliteral('\0', &bnext, "0.0");
   surfxml_bufferliteral('\0', &bnext, "1");
   surfxml_bufferliteral('\0', &bnext, "0.0");
   surfxml_bufferliteral('\0', &bnext, "-1.0");
@@ -5496,13 +5565,13 @@ yy_match:
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 3286 )
+                               if ( yy_current_state >= 3323 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 12107 );
+               while ( yy_base[yy_current_state] != 12292 );
 
 yy_find_action:
                yy_act = yy_accept[yy_current_state];
@@ -6392,6 +6461,8 @@ YY_RULE_SETUP
   surfxml_storage___type_size_isset = 0;
   AX_surfxml_storage___type_content = 0;
   surfxml_storage___type_content_isset = 0;
+  AX_surfxml_storage___type_content___type = 16;
+  surfxml_storage___type_content___type_isset = 0;
   ENTER(AL_surfxml_storage___type); pushbuffer(0);
   }
        YY_BREAK
@@ -6437,6 +6508,16 @@ YY_RULE_SETUP
 if (surfxml_storage___type_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage___type>");}  surfxml_storage___type_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content);
        YY_BREAK
 case 141:
+/* rule 141 can match eol */
+YY_RULE_SETUP
+if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage___type>");} surfxml_storage___type_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_content___type);
+       YY_BREAK
+case 142:
+/* rule 142 can match eol */
+YY_RULE_SETUP
+if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage___type>");}  surfxml_storage___type_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content___type);
+       YY_BREAK
+case 143:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage___type_id) FAIL("Required attribute `id' not set for `storage_type' element.");
@@ -6445,7 +6526,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_storage___type();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage___type);
  }
        YY_BREAK
-case 142:
+case 144:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage___type_id) FAIL("Required attribute `id' not set for `storage_type' element.");
@@ -6458,11 +6539,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 143:
+case 145:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage_type element.", surf_parse_text[0]);
        YY_BREAK
-case 144:
+case 146:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage_type' element start tag.",surf_parse_text);
        YY_BREAK
@@ -6470,8 +6551,8 @@ case YY_STATE_EOF(AL_surfxml_storage___type):
 FAIL("EOF in attribute list of `storage_type' element.");
        YY_BREAK
 
-case 145:
-/* rule 145 can match eol */
+case 147:
+/* rule 147 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -6483,12 +6564,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 146:
-/* rule 146 can match eol */
+case 148:
+/* rule 148 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage_type>' expected.",surf_parse_text);
        YY_BREAK
-case 147:
+case 149:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage_type>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -6498,13 +6579,13 @@ case YY_STATE_EOF(S_surfxml_storage___type_2):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage_type>' expected.");
        YY_BREAK
 
-case 148:
-/* rule 148 can match eol */
+case 150:
+/* rule 150 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <storage> is not allowed here.");
        YY_BREAK
-case 149:
-/* rule 149 can match eol */
+case 151:
+/* rule 151 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_storage_id = 0;
@@ -6513,41 +6594,53 @@ YY_RULE_SETUP
   surfxml_storage_typeId_isset = 0;
   AX_surfxml_storage_content = 0;
   surfxml_storage_content_isset = 0;
+  AX_surfxml_storage_content___type = 25;
+  surfxml_storage_content___type_isset = 0;
   ENTER(AL_surfxml_storage); pushbuffer(0);
   }
        YY_BREAK
 
-case 150:
-/* rule 150 can match eol */
+case 152:
+/* rule 152 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");} surfxml_storage_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_id);
        YY_BREAK
-case 151:
-/* rule 151 can match eol */
+case 153:
+/* rule 153 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");}  surfxml_storage_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_id);
        YY_BREAK
-case 152:
-/* rule 152 can match eol */
+case 154:
+/* rule 154 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");} surfxml_storage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_typeId);
        YY_BREAK
-case 153:
-/* rule 153 can match eol */
+case 155:
+/* rule 155 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");}  surfxml_storage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_typeId);
        YY_BREAK
-case 154:
-/* rule 154 can match eol */
+case 156:
+/* rule 156 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");} surfxml_storage_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content);
        YY_BREAK
-case 155:
-/* rule 155 can match eol */
+case 157:
+/* rule 157 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");}  surfxml_storage_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content);
        YY_BREAK
-case 156:
+case 158:
+/* rule 158 can match eol */
+YY_RULE_SETUP
+if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage>");} surfxml_storage_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content___type);
+       YY_BREAK
+case 159:
+/* rule 159 can match eol */
+YY_RULE_SETUP
+if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage>");}  surfxml_storage_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content___type);
+       YY_BREAK
+case 160:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage_id) FAIL("Required attribute `id' not set for `storage' element.");
@@ -6555,7 +6648,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage);
  }
        YY_BREAK
-case 157:
+case 161:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage_id) FAIL("Required attribute `id' not set for `storage' element.");
@@ -6567,11 +6660,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 158:
+case 162:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage element.", surf_parse_text[0]);
        YY_BREAK
-case 159:
+case 163:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage' element start tag.",surf_parse_text);
        YY_BREAK
@@ -6579,8 +6672,8 @@ case YY_STATE_EOF(AL_surfxml_storage):
 FAIL("EOF in attribute list of `storage' element.");
        YY_BREAK
 
-case 160:
-/* rule 160 can match eol */
+case 164:
+/* rule 164 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -6592,12 +6685,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 161:
-/* rule 161 can match eol */
+case 165:
+/* rule 165 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage>' expected.",surf_parse_text);
        YY_BREAK
-case 162:
+case 166:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -6607,55 +6700,55 @@ case YY_STATE_EOF(S_surfxml_storage_2):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage>' expected.");
        YY_BREAK
 
-case 163:
-/* rule 163 can match eol */
+case 167:
+/* rule 167 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <mount> is not allowed here.");
        YY_BREAK
-case 164:
-/* rule 164 can match eol */
+case 168:
+/* rule 168 can match eol */
 YY_RULE_SETUP
 {
-  AX_surfxml_mount_id = 0;
-  surfxml_mount_id_isset = 0;
+  AX_surfxml_mount_storageId = 0;
+  surfxml_mount_storageId_isset = 0;
   AX_surfxml_mount_name = 0;
   surfxml_mount_name_isset = 0;
   ENTER(AL_surfxml_mount); pushbuffer(0);
   }
        YY_BREAK
 
-case 165:
-/* rule 165 can match eol */
+case 169:
+/* rule 169 can match eol */
 YY_RULE_SETUP
-if (surfxml_mount_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_mount>");} surfxml_mount_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_id);
+if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");} surfxml_mount_storageId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_storageId);
        YY_BREAK
-case 166:
-/* rule 166 can match eol */
+case 170:
+/* rule 170 can match eol */
 YY_RULE_SETUP
-if (surfxml_mount_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_mount>");}  surfxml_mount_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_id);
+if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");}  surfxml_mount_storageId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_storageId);
        YY_BREAK
-case 167:
-/* rule 167 can match eol */
+case 171:
+/* rule 171 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");} surfxml_mount_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_name);
        YY_BREAK
-case 168:
-/* rule 168 can match eol */
+case 172:
+/* rule 172 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");}  surfxml_mount_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_name);
        YY_BREAK
-case 169:
+case 173:
 YY_RULE_SETUP
 {
-  if (!AX_surfxml_mount_id) FAIL("Required attribute `id' not set for `mount' element.");
+  if (!AX_surfxml_mount_storageId) FAIL("Required attribute `storageId' not set for `mount' element.");
   if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element.");
   LEAVE; STag_surfxml_mount();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mount);
  }
        YY_BREAK
-case 170:
+case 174:
 YY_RULE_SETUP
 {
-  if (!AX_surfxml_mount_id) FAIL("Required attribute `id' not set for `mount' element.");
+  if (!AX_surfxml_mount_storageId) FAIL("Required attribute `storageId' not set for `mount' element.");
   if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element.");
   LEAVE; STag_surfxml_mount(); surfxml_pcdata_ix = 0; ETag_surfxml_mount(); popbuffer(); /* attribute */
   switch (YY_START) {
@@ -6663,11 +6756,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 171:
+case 175:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of mount element.", surf_parse_text[0]);
        YY_BREAK
-case 172:
+case 176:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `mount' element start tag.",surf_parse_text);
        YY_BREAK
@@ -6675,8 +6768,8 @@ case YY_STATE_EOF(AL_surfxml_mount):
 FAIL("EOF in attribute list of `mount' element.");
        YY_BREAK
 
-case 173:
-/* rule 173 can match eol */
+case 177:
+/* rule 177 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -6687,12 +6780,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 174:
-/* rule 174 can match eol */
+case 178:
+/* rule 178 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</mount>' expected.",surf_parse_text);
        YY_BREAK
-case 175:
+case 179:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</mount>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -6700,13 +6793,13 @@ case YY_STATE_EOF(E_surfxml_mount):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</mount>' expected.");
        YY_BREAK
 
-case 176:
-/* rule 176 can match eol */
+case 180:
+/* rule 180 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <mstorage> is not allowed here.");
        YY_BREAK
-case 177:
-/* rule 177 can match eol */
+case 181:
+/* rule 181 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_mstorage_typeId = 0;
@@ -6717,27 +6810,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 178:
-/* rule 178 can match eol */
+case 182:
+/* rule 182 can match eol */
 YY_RULE_SETUP
 if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_mstorage>");} surfxml_mstorage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_typeId);
        YY_BREAK
-case 179:
-/* rule 179 can match eol */
+case 183:
+/* rule 183 can match eol */
 YY_RULE_SETUP
 if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_mstorage>");}  surfxml_mstorage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_typeId);
        YY_BREAK
-case 180:
-/* rule 180 can match eol */
+case 184:
+/* rule 184 can match eol */
 YY_RULE_SETUP
 if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mstorage>");} surfxml_mstorage_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_name);
        YY_BREAK
-case 181:
-/* rule 181 can match eol */
+case 185:
+/* rule 185 can match eol */
 YY_RULE_SETUP
 if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mstorage>");}  surfxml_mstorage_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_name);
        YY_BREAK
-case 182:
+case 186:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_mstorage_typeId) FAIL("Required attribute `typeId' not set for `mstorage' element.");
@@ -6745,7 +6838,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_mstorage();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mstorage);
  }
        YY_BREAK
-case 183:
+case 187:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_mstorage_typeId) FAIL("Required attribute `typeId' not set for `mstorage' element.");
@@ -6756,11 +6849,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 184:
+case 188:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of mstorage element.", surf_parse_text[0]);
        YY_BREAK
-case 185:
+case 189:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `mstorage' element start tag.",surf_parse_text);
        YY_BREAK
@@ -6768,8 +6861,8 @@ case YY_STATE_EOF(AL_surfxml_mstorage):
 FAIL("EOF in attribute list of `mstorage' element.");
        YY_BREAK
 
-case 186:
-/* rule 186 can match eol */
+case 190:
+/* rule 190 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -6780,12 +6873,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 187:
-/* rule 187 can match eol */
+case 191:
+/* rule 191 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</mstorage>' expected.",surf_parse_text);
        YY_BREAK
-case 188:
+case 192:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</mstorage>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -6793,22 +6886,22 @@ case YY_STATE_EOF(E_surfxml_mstorage):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</mstorage>' expected.");
        YY_BREAK
 
-case 189:
-/* rule 189 can match eol */
+case 193:
+/* rule 193 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <host> is not allowed here.");
        YY_BREAK
-case 190:
-/* rule 190 can match eol */
+case 194:
+/* rule 194 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_host_id = 0;
   surfxml_host_id_isset = 0;
   AX_surfxml_host_power = 0;
   surfxml_host_power_isset = 0;
-  AX_surfxml_host_core = 16;
+  AX_surfxml_host_core = 34;
   surfxml_host_core_isset = 0;
-  AX_surfxml_host_availability = 18;
+  AX_surfxml_host_availability = 36;
   surfxml_host_availability_isset = 0;
   AX_surfxml_host_availability___file = 0;
   surfxml_host_availability___file_isset = 0;
@@ -6818,103 +6911,115 @@ YY_RULE_SETUP
   surfxml_host_state___file_isset = 0;
   AX_surfxml_host_coordinates = 0;
   surfxml_host_coordinates_isset = 0;
+  AX_surfxml_host_pstate = 40;
+  surfxml_host_pstate_isset = 0;
   ENTER(AL_surfxml_host); pushbuffer(0);
   }
        YY_BREAK
 
-case 191:
-/* rule 191 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
-       YY_BREAK
-case 192:
-/* rule 192 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");}  surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
-       YY_BREAK
-case 193:
-/* rule 193 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");} surfxml_host_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
-       YY_BREAK
-case 194:
-/* rule 194 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");}  surfxml_host_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
-       YY_BREAK
 case 195:
 /* rule 195 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");} surfxml_host_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_core);
+if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
        YY_BREAK
 case 196:
 /* rule 196 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");}  surfxml_host_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_core);
+if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");}  surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
        YY_BREAK
 case 197:
 /* rule 197 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");} surfxml_host_availability_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
+if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");} surfxml_host_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
        YY_BREAK
 case 198:
 /* rule 198 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");}  surfxml_host_availability_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
+if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");}  surfxml_host_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
        YY_BREAK
 case 199:
 /* rule 199 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability___file);
+if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");} surfxml_host_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_core);
        YY_BREAK
 case 200:
 /* rule 200 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");}  surfxml_host_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability___file);
+if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");}  surfxml_host_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_core);
        YY_BREAK
 case 201:
 /* rule 201 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");} surfxml_host_availability_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
+       YY_BREAK
 case 202:
 /* rule 202 can match eol */
 YY_RULE_SETUP
-A_surfxml_host_state = A_surfxml_host_state_ON;
+if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");}  surfxml_host_availability_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
        YY_BREAK
 case 203:
 /* rule 203 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability___file);
+       YY_BREAK
 case 204:
 /* rule 204 can match eol */
 YY_RULE_SETUP
-A_surfxml_host_state = A_surfxml_host_state_OFF;
+if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");}  surfxml_host_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability___file);
        YY_BREAK
 case 205:
 /* rule 205 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state___file);
-       YY_BREAK
 case 206:
 /* rule 206 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");}  surfxml_host_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state___file);
+A_surfxml_host_state = A_surfxml_host_state_ON;
        YY_BREAK
 case 207:
 /* rule 207 can match eol */
-YY_RULE_SETUP
-if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates);
-       YY_BREAK
 case 208:
 /* rule 208 can match eol */
 YY_RULE_SETUP
-if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");}  surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates);
+A_surfxml_host_state = A_surfxml_host_state_OFF;
        YY_BREAK
 case 209:
+/* rule 209 can match eol */
 YY_RULE_SETUP
-{
+if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state___file);
+       YY_BREAK
+case 210:
+/* rule 210 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");}  surfxml_host_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state___file);
+       YY_BREAK
+case 211:
+/* rule 211 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates);
+       YY_BREAK
+case 212:
+/* rule 212 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");}  surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates);
+       YY_BREAK
+case 213:
+/* rule 213 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");} surfxml_host_pstate_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_pstate);
+       YY_BREAK
+case 214:
+/* rule 214 can match eol */
+YY_RULE_SETUP
+if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");}  surfxml_host_pstate_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_pstate);
+       YY_BREAK
+case 215:
+YY_RULE_SETUP
+{
   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
   if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
   LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
  }
        YY_BREAK
-case 210:
+case 216:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
@@ -6925,11 +7030,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 211:
+case 217:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host element.", surf_parse_text[0]);
        YY_BREAK
-case 212:
+case 218:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host' element start tag.",surf_parse_text);
        YY_BREAK
@@ -6937,8 +7042,8 @@ case YY_STATE_EOF(AL_surfxml_host):
 FAIL("EOF in attribute list of `host' element.");
        YY_BREAK
 
-case 213:
-/* rule 213 can match eol */
+case 219:
+/* rule 219 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -6949,12 +7054,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 214:
-/* rule 214 can match eol */
+case 220:
+/* rule 220 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host>' expected.",surf_parse_text);
        YY_BREAK
-case 215:
+case 221:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -6964,13 +7069,13 @@ case YY_STATE_EOF(S_surfxml_host_2):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host>' expected.");
        YY_BREAK
 
-case 216:
-/* rule 216 can match eol */
+case 222:
+/* rule 222 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <gpu> is not allowed here.");
        YY_BREAK
-case 217:
-/* rule 217 can match eol */
+case 223:
+/* rule 223 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_gpu_name = 0;
@@ -6979,24 +7084,24 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 218:
-/* rule 218 can match eol */
+case 224:
+/* rule 224 can match eol */
 YY_RULE_SETUP
 if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_gpu>");} surfxml_gpu_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_gpu_name);
        YY_BREAK
-case 219:
-/* rule 219 can match eol */
+case 225:
+/* rule 225 can match eol */
 YY_RULE_SETUP
 if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_gpu>");}  surfxml_gpu_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_gpu_name);
        YY_BREAK
-case 220:
+case 226:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_gpu_name) FAIL("Required attribute `name' not set for `gpu' element.");
   LEAVE; STag_surfxml_gpu();surfxml_pcdata_ix = 0; ENTER(E_surfxml_gpu);
  }
        YY_BREAK
-case 221:
+case 227:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_gpu_name) FAIL("Required attribute `name' not set for `gpu' element.");
@@ -7006,11 +7111,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 222:
+case 228:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of gpu element.", surf_parse_text[0]);
        YY_BREAK
-case 223:
+case 229:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `gpu' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7018,8 +7123,8 @@ case YY_STATE_EOF(AL_surfxml_gpu):
 FAIL("EOF in attribute list of `gpu' element.");
        YY_BREAK
 
-case 224:
-/* rule 224 can match eol */
+case 230:
+/* rule 230 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7030,12 +7135,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 225:
-/* rule 225 can match eol */
+case 231:
+/* rule 231 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</gpu>' expected.",surf_parse_text);
        YY_BREAK
-case 226:
+case 232:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</gpu>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7043,13 +7148,13 @@ case YY_STATE_EOF(E_surfxml_gpu):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</gpu>' expected.");
        YY_BREAK
 
-case 227:
-/* rule 227 can match eol */
+case 233:
+/* rule 233 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <host_link> is not allowed here.");
        YY_BREAK
-case 228:
-/* rule 228 can match eol */
+case 234:
+/* rule 234 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_host___link_id = 0;
@@ -7062,37 +7167,37 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 229:
-/* rule 229 can match eol */
+case 235:
+/* rule 235 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");} surfxml_host___link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_id);
        YY_BREAK
-case 230:
-/* rule 230 can match eol */
+case 236:
+/* rule 236 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");}  surfxml_host___link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_id);
        YY_BREAK
-case 231:
-/* rule 231 can match eol */
+case 237:
+/* rule 237 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");} surfxml_host___link_up_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_up);
        YY_BREAK
-case 232:
-/* rule 232 can match eol */
+case 238:
+/* rule 238 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");}  surfxml_host___link_up_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_up);
        YY_BREAK
-case 233:
-/* rule 233 can match eol */
+case 239:
+/* rule 239 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");} surfxml_host___link_down_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_down);
        YY_BREAK
-case 234:
-/* rule 234 can match eol */
+case 240:
+/* rule 240 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");}  surfxml_host___link_down_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_down);
        YY_BREAK
-case 235:
+case 241:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host___link_id) FAIL("Required attribute `id' not set for `host_link' element.");
@@ -7101,7 +7206,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_host___link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_host___link);
  }
        YY_BREAK
-case 236:
+case 242:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host___link_id) FAIL("Required attribute `id' not set for `host_link' element.");
@@ -7113,11 +7218,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 237:
+case 243:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host_link element.", surf_parse_text[0]);
        YY_BREAK
-case 238:
+case 244:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host_link' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7125,8 +7230,8 @@ case YY_STATE_EOF(AL_surfxml_host___link):
 FAIL("EOF in attribute list of `host_link' element.");
        YY_BREAK
 
-case 239:
-/* rule 239 can match eol */
+case 245:
+/* rule 245 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7137,12 +7242,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 240:
-/* rule 240 can match eol */
+case 246:
+/* rule 246 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host_link>' expected.",surf_parse_text);
        YY_BREAK
-case 241:
+case 247:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host_link>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7150,13 +7255,13 @@ case YY_STATE_EOF(E_surfxml_host___link):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host_link>' expected.");
        YY_BREAK
 
-case 242:
-/* rule 242 can match eol */
+case 248:
+/* rule 248 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <cluster> is not allowed here.");
        YY_BREAK
-case 243:
-/* rule 243 can match eol */
+case 249:
+/* rule 249 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_cluster_id = 0;
@@ -7169,7 +7274,7 @@ YY_RULE_SETUP
   surfxml_cluster_radical_isset = 0;
   AX_surfxml_cluster_power = 0;
   surfxml_cluster_power_isset = 0;
-  AX_surfxml_cluster_core = 22;
+  AX_surfxml_cluster_core = 44;
   surfxml_cluster_core_isset = 0;
   AX_surfxml_cluster_bw = 0;
   surfxml_cluster_bw_isset = 0;
@@ -7199,202 +7304,202 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 244:
-/* rule 244 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");} surfxml_cluster_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
-       YY_BREAK
-case 245:
-/* rule 245 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");}  surfxml_cluster_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
-       YY_BREAK
-case 246:
-/* rule 246 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
-       YY_BREAK
-case 247:
-/* rule 247 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");}  surfxml_cluster_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
-       YY_BREAK
-case 248:
-/* rule 248 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
-       YY_BREAK
-case 249:
-/* rule 249 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");}  surfxml_cluster_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
-       YY_BREAK
 case 250:
 /* rule 250 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");} surfxml_cluster_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
+if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");} surfxml_cluster_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
        YY_BREAK
 case 251:
 /* rule 251 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");}  surfxml_cluster_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
+if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");}  surfxml_cluster_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
        YY_BREAK
 case 252:
 /* rule 252 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");} surfxml_cluster_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
+if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
        YY_BREAK
 case 253:
 /* rule 253 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");}  surfxml_cluster_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
+if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");}  surfxml_cluster_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
        YY_BREAK
 case 254:
 /* rule 254 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");} surfxml_cluster_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_core);
+if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
        YY_BREAK
 case 255:
 /* rule 255 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");}  surfxml_cluster_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_core);
+if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");}  surfxml_cluster_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
        YY_BREAK
 case 256:
 /* rule 256 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");} surfxml_cluster_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
+if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");} surfxml_cluster_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
        YY_BREAK
 case 257:
 /* rule 257 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");}  surfxml_cluster_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
+if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");}  surfxml_cluster_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
        YY_BREAK
 case 258:
 /* rule 258 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");} surfxml_cluster_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
+if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");} surfxml_cluster_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
        YY_BREAK
 case 259:
 /* rule 259 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");}  surfxml_cluster_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
+if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");}  surfxml_cluster_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
        YY_BREAK
 case 260:
 /* rule 260 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");} surfxml_cluster_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_core);
+       YY_BREAK
 case 261:
 /* rule 261 can match eol */
 YY_RULE_SETUP
-A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_SHARED;
+if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");}  surfxml_cluster_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_core);
        YY_BREAK
 case 262:
 /* rule 262 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");} surfxml_cluster_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
+       YY_BREAK
 case 263:
 /* rule 263 can match eol */
 YY_RULE_SETUP
-A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FULLDUPLEX;
+if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");}  surfxml_cluster_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
        YY_BREAK
 case 264:
 /* rule 264 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");} surfxml_cluster_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
+       YY_BREAK
 case 265:
 /* rule 265 can match eol */
 YY_RULE_SETUP
-A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FATPIPE;
+if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");}  surfxml_cluster_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
        YY_BREAK
 case 266:
 /* rule 266 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");} surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___bw);
-       YY_BREAK
 case 267:
 /* rule 267 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");}  surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___bw);
+A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_SHARED;
        YY_BREAK
 case 268:
 /* rule 268 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");} surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___lat);
-       YY_BREAK
 case 269:
 /* rule 269 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");}  surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___lat);
+A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FULLDUPLEX;
        YY_BREAK
 case 270:
 /* rule 270 can match eol */
 case 271:
 /* rule 271 can match eol */
 YY_RULE_SETUP
-A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED;
+A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FATPIPE;
        YY_BREAK
 case 272:
 /* rule 272 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");} surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___bw);
+       YY_BREAK
 case 273:
 /* rule 273 can match eol */
 YY_RULE_SETUP
-A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_FATPIPE;
+if (surfxml_cluster_bb___bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");}  surfxml_cluster_bb___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___bw);
        YY_BREAK
 case 274:
 /* rule 274 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");} surfxml_cluster_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_availability___file);
+if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");} surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb___lat);
        YY_BREAK
 case 275:
 /* rule 275 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");}  surfxml_cluster_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_availability___file);
+if (surfxml_cluster_bb___lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");}  surfxml_cluster_bb___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb___lat);
        YY_BREAK
 case 276:
 /* rule 276 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");} surfxml_cluster_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_state___file);
-       YY_BREAK
 case 277:
 /* rule 277 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");}  surfxml_cluster_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_state___file);
+A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED;
        YY_BREAK
 case 278:
 /* rule 278 can match eol */
-YY_RULE_SETUP
-if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");} surfxml_cluster_router___id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_router___id);
-       YY_BREAK
 case 279:
 /* rule 279 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");}  surfxml_cluster_router___id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_router___id);
+A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_FATPIPE;
        YY_BREAK
 case 280:
 /* rule 280 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_limiter___link);
+if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");} surfxml_cluster_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_availability___file);
        YY_BREAK
 case 281:
 /* rule 281 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");}  surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_limiter___link);
+if (surfxml_cluster_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");}  surfxml_cluster_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_availability___file);
        YY_BREAK
 case 282:
 /* rule 282 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___bw);
+if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");} surfxml_cluster_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_state___file);
        YY_BREAK
 case 283:
 /* rule 283 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");}  surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___bw);
+if (surfxml_cluster_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");}  surfxml_cluster_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_state___file);
        YY_BREAK
 case 284:
 /* rule 284 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___lat);
+if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");} surfxml_cluster_router___id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_router___id);
        YY_BREAK
 case 285:
 /* rule 285 can match eol */
 YY_RULE_SETUP
-if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");}  surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___lat);
+if (surfxml_cluster_router___id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");}  surfxml_cluster_router___id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_router___id);
        YY_BREAK
 case 286:
+/* rule 286 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_limiter___link);
+       YY_BREAK
+case 287:
+/* rule 287 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");}  surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_limiter___link);
+       YY_BREAK
+case 288:
+/* rule 288 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___bw);
+       YY_BREAK
+case 289:
+/* rule 289 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");}  surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___bw);
+       YY_BREAK
+case 290:
+/* rule 290 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___lat);
+       YY_BREAK
+case 291:
+/* rule 291 can match eol */
+YY_RULE_SETUP
+if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");}  surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___lat);
+       YY_BREAK
+case 292:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
@@ -7407,7 +7512,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(S_surfxml_cluster);
  }
        YY_BREAK
-case 287:
+case 293:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_cluster_id) FAIL("Required attribute `id' not set for `cluster' element.");
@@ -7425,11 +7530,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 288:
+case 294:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of cluster element.", surf_parse_text[0]);
        YY_BREAK
-case 289:
+case 295:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `cluster' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7437,8 +7542,8 @@ case YY_STATE_EOF(AL_surfxml_cluster):
 FAIL("EOF in attribute list of `cluster' element.");
        YY_BREAK
 
-case 290:
-/* rule 290 can match eol */
+case 296:
+/* rule 296 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7451,12 +7556,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 291:
-/* rule 291 can match eol */
+case 297:
+/* rule 297 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</cluster>' expected.",surf_parse_text);
        YY_BREAK
-case 292:
+case 298:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</cluster>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7466,13 +7571,13 @@ case YY_STATE_EOF(E_surfxml_cluster):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cluster>' expected.");
        YY_BREAK
 
-case 293:
-/* rule 293 can match eol */
+case 299:
+/* rule 299 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <cabinet> is not allowed here.");
        YY_BREAK
-case 294:
-/* rule 294 can match eol */
+case 300:
+/* rule 300 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_cabinet_id = 0;
@@ -7493,77 +7598,77 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 295:
-/* rule 295 can match eol */
+case 301:
+/* rule 301 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");} surfxml_cabinet_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_id);
        YY_BREAK
-case 296:
-/* rule 296 can match eol */
+case 302:
+/* rule 302 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");}  surfxml_cabinet_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_id);
-       YY_BREAK
-case 297:
-/* rule 297 can match eol */
+       YY_BREAK
+case 303:
+/* rule 303 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_prefix);
        YY_BREAK
-case 298:
-/* rule 298 can match eol */
+case 304:
+/* rule 304 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");}  surfxml_cabinet_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_prefix);
        YY_BREAK
-case 299:
-/* rule 299 can match eol */
+case 305:
+/* rule 305 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_suffix);
        YY_BREAK
-case 300:
-/* rule 300 can match eol */
+case 306:
+/* rule 306 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");}  surfxml_cabinet_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_suffix);
        YY_BREAK
-case 301:
-/* rule 301 can match eol */
+case 307:
+/* rule 307 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_radical);
        YY_BREAK
-case 302:
-/* rule 302 can match eol */
+case 308:
+/* rule 308 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");}  surfxml_cabinet_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_radical);
        YY_BREAK
-case 303:
-/* rule 303 can match eol */
+case 309:
+/* rule 309 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cabinet>");} surfxml_cabinet_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_power);
        YY_BREAK
-case 304:
-/* rule 304 can match eol */
+case 310:
+/* rule 310 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cabinet>");}  surfxml_cabinet_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_power);
        YY_BREAK
-case 305:
-/* rule 305 can match eol */
+case 311:
+/* rule 311 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_bw);
        YY_BREAK
-case 306:
-/* rule 306 can match eol */
+case 312:
+/* rule 312 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");}  surfxml_cabinet_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_bw);
        YY_BREAK
-case 307:
-/* rule 307 can match eol */
+case 313:
+/* rule 313 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_lat);
        YY_BREAK
-case 308:
-/* rule 308 can match eol */
+case 314:
+/* rule 314 can match eol */
 YY_RULE_SETUP
 if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");}  surfxml_cabinet_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_lat);
        YY_BREAK
-case 309:
+case 315:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_cabinet_id) FAIL("Required attribute `id' not set for `cabinet' element.");
@@ -7576,7 +7681,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_cabinet();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cabinet);
  }
        YY_BREAK
-case 310:
+case 316:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_cabinet_id) FAIL("Required attribute `id' not set for `cabinet' element.");
@@ -7595,11 +7700,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 311:
+case 317:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of cabinet element.", surf_parse_text[0]);
        YY_BREAK
-case 312:
+case 318:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `cabinet' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7607,8 +7712,8 @@ case YY_STATE_EOF(AL_surfxml_cabinet):
 FAIL("EOF in attribute list of `cabinet' element.");
        YY_BREAK
 
-case 313:
-/* rule 313 can match eol */
+case 319:
+/* rule 319 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7622,12 +7727,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 314:
-/* rule 314 can match eol */
+case 320:
+/* rule 320 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</cabinet>' expected.",surf_parse_text);
        YY_BREAK
-case 315:
+case 321:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</cabinet>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7635,13 +7740,13 @@ case YY_STATE_EOF(E_surfxml_cabinet):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cabinet>' expected.");
        YY_BREAK
 
-case 316:
-/* rule 316 can match eol */
+case 322:
+/* rule 322 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <peer> is not allowed here.");
        YY_BREAK
-case 317:
-/* rule 317 can match eol */
+case 323:
+/* rule 323 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_peer_id = 0;
@@ -7664,87 +7769,87 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 318:
-/* rule 318 can match eol */
+case 324:
+/* rule 324 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");} surfxml_peer_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_id);
        YY_BREAK
-case 319:
-/* rule 319 can match eol */
+case 325:
+/* rule 325 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");}  surfxml_peer_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_id);
        YY_BREAK
-case 320:
-/* rule 320 can match eol */
+case 326:
+/* rule 326 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_peer>");} surfxml_peer_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_power);
        YY_BREAK
-case 321:
-/* rule 321 can match eol */
+case 327:
+/* rule 327 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_peer>");}  surfxml_peer_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_power);
        YY_BREAK
-case 322:
-/* rule 322 can match eol */
+case 328:
+/* rule 328 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");} surfxml_peer_bw___in_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___in);
        YY_BREAK
-case 323:
-/* rule 323 can match eol */
+case 329:
+/* rule 329 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");}  surfxml_peer_bw___in_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___in);
        YY_BREAK
-case 324:
-/* rule 324 can match eol */
+case 330:
+/* rule 330 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");} surfxml_peer_bw___out_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___out);
        YY_BREAK
-case 325:
-/* rule 325 can match eol */
+case 331:
+/* rule 331 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");}  surfxml_peer_bw___out_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___out);
        YY_BREAK
-case 326:
-/* rule 326 can match eol */
+case 332:
+/* rule 332 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");} surfxml_peer_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_lat);
        YY_BREAK
-case 327:
-/* rule 327 can match eol */
+case 333:
+/* rule 333 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");}  surfxml_peer_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_lat);
        YY_BREAK
-case 328:
-/* rule 328 can match eol */
+case 334:
+/* rule 334 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_coordinates);
        YY_BREAK
-case 329:
-/* rule 329 can match eol */
+case 335:
+/* rule 335 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");}  surfxml_peer_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_coordinates);
        YY_BREAK
-case 330:
-/* rule 330 can match eol */
+case 336:
+/* rule 336 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");} surfxml_peer_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_availability___file);
        YY_BREAK
-case 331:
-/* rule 331 can match eol */
+case 337:
+/* rule 337 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");}  surfxml_peer_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_availability___file);
        YY_BREAK
-case 332:
-/* rule 332 can match eol */
+case 338:
+/* rule 338 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");} surfxml_peer_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_state___file);
        YY_BREAK
-case 333:
-/* rule 333 can match eol */
+case 339:
+/* rule 339 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");}  surfxml_peer_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_state___file);
        YY_BREAK
-case 334:
+case 340:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_peer_id) FAIL("Required attribute `id' not set for `peer' element.");
@@ -7755,7 +7860,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_peer();surfxml_pcdata_ix = 0; ENTER(E_surfxml_peer);
  }
        YY_BREAK
-case 335:
+case 341:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_peer_id) FAIL("Required attribute `id' not set for `peer' element.");
@@ -7771,11 +7876,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 336:
+case 342:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of peer element.", surf_parse_text[0]);
        YY_BREAK
-case 337:
+case 343:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `peer' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7783,8 +7888,8 @@ case YY_STATE_EOF(AL_surfxml_peer):
 FAIL("EOF in attribute list of `peer' element.");
        YY_BREAK
 
-case 338:
-/* rule 338 can match eol */
+case 344:
+/* rule 344 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7797,12 +7902,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 339:
-/* rule 339 can match eol */
+case 345:
+/* rule 345 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</peer>' expected.",surf_parse_text);
        YY_BREAK
-case 340:
+case 346:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</peer>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7810,13 +7915,13 @@ case YY_STATE_EOF(E_surfxml_peer):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</peer>' expected.");
        YY_BREAK
 
-case 341:
-/* rule 341 can match eol */
+case 347:
+/* rule 347 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <router> is not allowed here.");
        YY_BREAK
-case 342:
-/* rule 342 can match eol */
+case 348:
+/* rule 348 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_router_id = 0;
@@ -7827,34 +7932,34 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 343:
-/* rule 343 can match eol */
+case 349:
+/* rule 349 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");} surfxml_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
        YY_BREAK
-case 344:
-/* rule 344 can match eol */
+case 350:
+/* rule 350 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");}  surfxml_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
        YY_BREAK
-case 345:
-/* rule 345 can match eol */
+case 351:
+/* rule 351 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");} surfxml_router_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_coordinates);
        YY_BREAK
-case 346:
-/* rule 346 can match eol */
+case 352:
+/* rule 352 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");}  surfxml_router_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_coordinates);
        YY_BREAK
-case 347:
+case 353:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
   LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
  }
        YY_BREAK
-case 348:
+case 354:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
@@ -7864,11 +7969,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 349:
+case 355:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of router element.", surf_parse_text[0]);
        YY_BREAK
-case 350:
+case 356:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `router' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7876,8 +7981,8 @@ case YY_STATE_EOF(AL_surfxml_router):
 FAIL("EOF in attribute list of `router' element.");
        YY_BREAK
 
-case 351:
-/* rule 351 can match eol */
+case 357:
+/* rule 357 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7888,12 +7993,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 352:
-/* rule 352 can match eol */
+case 358:
+/* rule 358 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</router>' expected.",surf_parse_text);
        YY_BREAK
-case 353:
+case 359:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</router>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -7901,13 +8006,13 @@ case YY_STATE_EOF(E_surfxml_router):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</router>' expected.");
        YY_BREAK
 
-case 354:
-/* rule 354 can match eol */
+case 360:
+/* rule 360 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <backbone> is not allowed here.");
        YY_BREAK
-case 355:
-/* rule 355 can match eol */
+case 361:
+/* rule 361 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_backbone_id = 0;
@@ -7920,37 +8025,37 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 356:
-/* rule 356 can match eol */
+case 362:
+/* rule 362 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");} surfxml_backbone_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_id);
        YY_BREAK
-case 357:
-/* rule 357 can match eol */
+case 363:
+/* rule 363 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");}  surfxml_backbone_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_id);
        YY_BREAK
-case 358:
-/* rule 358 can match eol */
+case 364:
+/* rule 364 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_bandwidth);
        YY_BREAK
-case 359:
-/* rule 359 can match eol */
+case 365:
+/* rule 365 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");}  surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_bandwidth);
        YY_BREAK
-case 360:
-/* rule 360 can match eol */
+case 366:
+/* rule 366 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");} surfxml_backbone_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_latency);
        YY_BREAK
-case 361:
-/* rule 361 can match eol */
+case 367:
+/* rule 367 can match eol */
 YY_RULE_SETUP
 if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");}  surfxml_backbone_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_latency);
        YY_BREAK
-case 362:
+case 368:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_backbone_id) FAIL("Required attribute `id' not set for `backbone' element.");
@@ -7959,7 +8064,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_backbone();surfxml_pcdata_ix = 0; ENTER(E_surfxml_backbone);
  }
        YY_BREAK
-case 363:
+case 369:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_backbone_id) FAIL("Required attribute `id' not set for `backbone' element.");
@@ -7972,11 +8077,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 364:
+case 370:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of backbone element.", surf_parse_text[0]);
        YY_BREAK
-case 365:
+case 371:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `backbone' element start tag.",surf_parse_text);
        YY_BREAK
@@ -7984,8 +8089,8 @@ case YY_STATE_EOF(AL_surfxml_backbone):
 FAIL("EOF in attribute list of `backbone' element.");
        YY_BREAK
 
-case 366:
-/* rule 366 can match eol */
+case 372:
+/* rule 372 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -7997,12 +8102,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 367:
-/* rule 367 can match eol */
+case 373:
+/* rule 373 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</backbone>' expected.",surf_parse_text);
        YY_BREAK
-case 368:
+case 374:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</backbone>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8010,13 +8115,13 @@ case YY_STATE_EOF(E_surfxml_backbone):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</backbone>' expected.");
        YY_BREAK
 
-case 369:
-/* rule 369 can match eol */
+case 375:
+/* rule 375 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link> is not allowed here.");
        YY_BREAK
-case 370:
-/* rule 370 can match eol */
+case 376:
+/* rule 376 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_link_id = 0;
@@ -8025,7 +8130,7 @@ YY_RULE_SETUP
   surfxml_link_bandwidth_isset = 0;
   AX_surfxml_link_bandwidth___file = 0;
   surfxml_link_bandwidth___file_isset = 0;
-  AX_surfxml_link_latency = 24;
+  AX_surfxml_link_latency = 46;
   surfxml_link_latency_isset = 0;
   AX_surfxml_link_latency___file = 0;
   surfxml_link_latency___file_isset = 0;
@@ -8034,107 +8139,107 @@ YY_RULE_SETUP
   AX_surfxml_link_state___file = 0;
   surfxml_link_state___file_isset = 0;
   AX_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
-  surfxml_link_sharing___policy_isset = 0;
-  ENTER(AL_surfxml_link); pushbuffer(0);
-  }
-       YY_BREAK
-
-case 371:
-/* rule 371 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
-       YY_BREAK
-case 372:
-/* rule 372 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");}  surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
-       YY_BREAK
-case 373:
-/* rule 373 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
-       YY_BREAK
-case 374:
-/* rule 374 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");}  surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
-       YY_BREAK
-case 375:
-/* rule 375 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth___file);
-       YY_BREAK
-case 376:
-/* rule 376 can match eol */
-YY_RULE_SETUP
-if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");}  surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth___file);
+  surfxml_link_sharing___policy_isset = 0;
+  ENTER(AL_surfxml_link); pushbuffer(0);
+  }
        YY_BREAK
+
 case 377:
 /* rule 377 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
+if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
        YY_BREAK
 case 378:
 /* rule 378 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");}  surfxml_link_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
+if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");}  surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
        YY_BREAK
 case 379:
 /* rule 379 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");} surfxml_link_latency___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency___file);
+if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
        YY_BREAK
 case 380:
 /* rule 380 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");}  surfxml_link_latency___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency___file);
+if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");}  surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
        YY_BREAK
 case 381:
 /* rule 381 can match eol */
+YY_RULE_SETUP
+if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth___file);
+       YY_BREAK
 case 382:
 /* rule 382 can match eol */
 YY_RULE_SETUP
-A_surfxml_link_state = A_surfxml_link_state_ON;
+if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");}  surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth___file);
        YY_BREAK
 case 383:
 /* rule 383 can match eol */
+YY_RULE_SETUP
+if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
+       YY_BREAK
 case 384:
 /* rule 384 can match eol */
 YY_RULE_SETUP
-A_surfxml_link_state = A_surfxml_link_state_OFF;
+if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");}  surfxml_link_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
        YY_BREAK
 case 385:
 /* rule 385 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state___file);
+if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");} surfxml_link_latency___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency___file);
        YY_BREAK
 case 386:
 /* rule 386 can match eol */
 YY_RULE_SETUP
-if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");}  surfxml_link_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state___file);
+if (surfxml_link_latency___file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");}  surfxml_link_latency___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency___file);
        YY_BREAK
 case 387:
 /* rule 387 can match eol */
 case 388:
 /* rule 388 can match eol */
 YY_RULE_SETUP
-A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
+A_surfxml_link_state = A_surfxml_link_state_ON;
        YY_BREAK
 case 389:
 /* rule 389 can match eol */
 case 390:
 /* rule 390 can match eol */
 YY_RULE_SETUP
-A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE;
+A_surfxml_link_state = A_surfxml_link_state_OFF;
        YY_BREAK
 case 391:
 /* rule 391 can match eol */
+YY_RULE_SETUP
+if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state___file);
+       YY_BREAK
 case 392:
 /* rule 392 can match eol */
 YY_RULE_SETUP
-A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX;
+if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");}  surfxml_link_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state___file);
        YY_BREAK
 case 393:
+/* rule 393 can match eol */
+case 394:
+/* rule 394 can match eol */
+YY_RULE_SETUP
+A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
+       YY_BREAK
+case 395:
+/* rule 395 can match eol */
+case 396:
+/* rule 396 can match eol */
+YY_RULE_SETUP
+A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE;
+       YY_BREAK
+case 397:
+/* rule 397 can match eol */
+case 398:
+/* rule 398 can match eol */
+YY_RULE_SETUP
+A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX;
+       YY_BREAK
+case 399:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
@@ -8142,7 +8247,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
  }
        YY_BREAK
-case 394:
+case 400:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
@@ -8154,11 +8259,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 395:
+case 401:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link element.", surf_parse_text[0]);
        YY_BREAK
-case 396:
+case 402:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8166,8 +8271,8 @@ case YY_STATE_EOF(AL_surfxml_link):
 FAIL("EOF in attribute list of `link' element.");
        YY_BREAK
 
-case 397:
-/* rule 397 can match eol */
+case 403:
+/* rule 403 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8179,12 +8284,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 398:
-/* rule 398 can match eol */
+case 404:
+/* rule 404 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link>' expected.",surf_parse_text);
        YY_BREAK
-case 399:
+case 405:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8194,13 +8299,13 @@ case YY_STATE_EOF(S_surfxml_link):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link>' expected.");
        YY_BREAK
 
-case 400:
-/* rule 400 can match eol */
+case 406:
+/* rule 406 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <route> is not allowed here.");
        YY_BREAK
-case 401:
-/* rule 401 can match eol */
+case 407:
+/* rule 407 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_route_src = 0;
@@ -8213,41 +8318,41 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 402:
-/* rule 402 can match eol */
+case 408:
+/* rule 408 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");} surfxml_route_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
        YY_BREAK
-case 403:
-/* rule 403 can match eol */
+case 409:
+/* rule 409 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");}  surfxml_route_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
        YY_BREAK
-case 404:
-/* rule 404 can match eol */
+case 410:
+/* rule 410 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");} surfxml_route_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
        YY_BREAK
-case 405:
-/* rule 405 can match eol */
+case 411:
+/* rule 411 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");}  surfxml_route_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
        YY_BREAK
-case 406:
-/* rule 406 can match eol */
-case 407:
-/* rule 407 can match eol */
+case 412:
+/* rule 412 can match eol */
+case 413:
+/* rule 413 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
        YY_BREAK
-case 408:
-/* rule 408 can match eol */
-case 409:
-/* rule 409 can match eol */
+case 414:
+/* rule 414 can match eol */
+case 415:
+/* rule 415 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
        YY_BREAK
-case 410:
+case 416:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
@@ -8255,7 +8360,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
  }
        YY_BREAK
-case 411:
+case 417:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_route_src) FAIL("Required attribute `src' not set for `route' element.");
@@ -8266,11 +8371,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 412:
+case 418:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of route element.", surf_parse_text[0]);
        YY_BREAK
-case 413:
+case 419:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `route' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8278,8 +8383,8 @@ case YY_STATE_EOF(AL_surfxml_route):
 FAIL("EOF in attribute list of `route' element.");
        YY_BREAK
 
-case 414:
-/* rule 414 can match eol */
+case 420:
+/* rule 420 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8290,12 +8395,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 415:
-/* rule 415 can match eol */
+case 421:
+/* rule 421 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</route>' expected.",surf_parse_text);
        YY_BREAK
-case 416:
+case 422:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</route>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8305,13 +8410,13 @@ case YY_STATE_EOF(E_surfxml_route):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</route>' expected.");
        YY_BREAK
 
-case 417:
-/* rule 417 can match eol */
+case 423:
+/* rule 423 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <ASroute> is not allowed here.");
        YY_BREAK
-case 418:
-/* rule 418 can match eol */
+case 424:
+/* rule 424 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_ASroute_src = 0;
@@ -8328,61 +8433,61 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 419:
-/* rule 419 can match eol */
+case 425:
+/* rule 425 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");} surfxml_ASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_src);
        YY_BREAK
-case 420:
-/* rule 420 can match eol */
+case 426:
+/* rule 426 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");}  surfxml_ASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_src);
        YY_BREAK
-case 421:
-/* rule 421 can match eol */
+case 427:
+/* rule 427 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_dst);
        YY_BREAK
-case 422:
-/* rule 422 can match eol */
+case 428:
+/* rule 428 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");}  surfxml_ASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_dst);
        YY_BREAK
-case 423:
-/* rule 423 can match eol */
+case 429:
+/* rule 429 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");} surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___src);
        YY_BREAK
-case 424:
-/* rule 424 can match eol */
+case 430:
+/* rule 430 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");}  surfxml_ASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___src);
        YY_BREAK
-case 425:
-/* rule 425 can match eol */
+case 431:
+/* rule 431 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");} surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw___dst);
        YY_BREAK
-case 426:
-/* rule 426 can match eol */
+case 432:
+/* rule 432 can match eol */
 YY_RULE_SETUP
 if (surfxml_ASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");}  surfxml_ASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw___dst);
        YY_BREAK
-case 427:
-/* rule 427 can match eol */
-case 428:
-/* rule 428 can match eol */
+case 433:
+/* rule 433 can match eol */
+case 434:
+/* rule 434 can match eol */
 YY_RULE_SETUP
 A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_YES;
        YY_BREAK
-case 429:
-/* rule 429 can match eol */
-case 430:
-/* rule 430 can match eol */
+case 435:
+/* rule 435 can match eol */
+case 436:
+/* rule 436 can match eol */
 YY_RULE_SETUP
 A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_NO;
        YY_BREAK
-case 431:
+case 437:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
@@ -8392,7 +8497,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_ASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_ASroute);
  }
        YY_BREAK
-case 432:
+case 438:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
@@ -8405,11 +8510,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 433:
+case 439:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of ASroute element.", surf_parse_text[0]);
        YY_BREAK
-case 434:
+case 440:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `ASroute' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8417,8 +8522,8 @@ case YY_STATE_EOF(AL_surfxml_ASroute):
 FAIL("EOF in attribute list of `ASroute' element.");
        YY_BREAK
 
-case 435:
-/* rule 435 can match eol */
+case 441:
+/* rule 441 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8429,12 +8534,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 436:
-/* rule 436 can match eol */
+case 442:
+/* rule 442 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</ASroute>' expected.",surf_parse_text);
        YY_BREAK
-case 437:
+case 443:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</ASroute>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8444,13 +8549,13 @@ case YY_STATE_EOF(S_surfxml_ASroute_2):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</ASroute>' expected.");
        YY_BREAK
 
-case 438:
-/* rule 438 can match eol */
+case 444:
+/* rule 444 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link_ctn> is not allowed here.");
        YY_BREAK
-case 439:
-/* rule 439 can match eol */
+case 445:
+/* rule 445 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_link___ctn_id = 0;
@@ -8461,45 +8566,45 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 440:
-/* rule 440 can match eol */
+case 446:
+/* rule 446 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");} surfxml_link___ctn_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link___ctn_id);
        YY_BREAK
-case 441:
-/* rule 441 can match eol */
+case 447:
+/* rule 447 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");}  surfxml_link___ctn_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link___ctn_id);
        YY_BREAK
-case 442:
-/* rule 442 can match eol */
-case 443:
-/* rule 443 can match eol */
+case 448:
+/* rule 448 can match eol */
+case 449:
+/* rule 449 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_UP;
        YY_BREAK
-case 444:
-/* rule 444 can match eol */
-case 445:
-/* rule 445 can match eol */
+case 450:
+/* rule 450 can match eol */
+case 451:
+/* rule 451 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_DOWN;
        YY_BREAK
-case 446:
-/* rule 446 can match eol */
-case 447:
-/* rule 447 can match eol */
+case 452:
+/* rule 452 can match eol */
+case 453:
+/* rule 453 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE;
        YY_BREAK
-case 448:
+case 454:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
   LEAVE; STag_surfxml_link___ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link___ctn);
  }
        YY_BREAK
-case 449:
+case 455:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
@@ -8512,11 +8617,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 450:
+case 456:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link_ctn element.", surf_parse_text[0]);
        YY_BREAK
-case 451:
+case 457:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link_ctn' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8524,8 +8629,8 @@ case YY_STATE_EOF(AL_surfxml_link___ctn):
 FAIL("EOF in attribute list of `link_ctn' element.");
        YY_BREAK
 
-case 452:
-/* rule 452 can match eol */
+case 458:
+/* rule 458 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8539,12 +8644,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 453:
-/* rule 453 can match eol */
+case 459:
+/* rule 459 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link_ctn>' expected.",surf_parse_text);
        YY_BREAK
-case 454:
+case 460:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link_ctn>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8552,13 +8657,13 @@ case YY_STATE_EOF(E_surfxml_link___ctn):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link_ctn>' expected.");
        YY_BREAK
 
-case 455:
-/* rule 455 can match eol */
+case 461:
+/* rule 461 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <bypassRoute> is not allowed here.");
        YY_BREAK
-case 456:
-/* rule 456 can match eol */
+case 462:
+/* rule 462 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_bypassRoute_src = 0;
@@ -8569,27 +8674,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 457:
-/* rule 457 can match eol */
+case 463:
+/* rule 463 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_src);
        YY_BREAK
-case 458:
-/* rule 458 can match eol */
+case 464:
+/* rule 464 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");}  surfxml_bypassRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_src);
        YY_BREAK
-case 459:
-/* rule 459 can match eol */
+case 465:
+/* rule 465 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_dst);
        YY_BREAK
-case 460:
-/* rule 460 can match eol */
+case 466:
+/* rule 466 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");}  surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_dst);
        YY_BREAK
-case 461:
+case 467:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_bypassRoute_src) FAIL("Required attribute `src' not set for `bypassRoute' element.");
@@ -8597,7 +8702,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_bypassRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassRoute);
  }
        YY_BREAK
-case 462:
+case 468:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_bypassRoute_src) FAIL("Required attribute `src' not set for `bypassRoute' element.");
@@ -8608,11 +8713,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 463:
+case 469:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of bypassRoute element.", surf_parse_text[0]);
        YY_BREAK
-case 464:
+case 470:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `bypassRoute' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8620,8 +8725,8 @@ case YY_STATE_EOF(AL_surfxml_bypassRoute):
 FAIL("EOF in attribute list of `bypassRoute' element.");
        YY_BREAK
 
-case 465:
-/* rule 465 can match eol */
+case 471:
+/* rule 471 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8632,12 +8737,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 466:
-/* rule 466 can match eol */
+case 472:
+/* rule 472 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</bypassRoute>' expected.",surf_parse_text);
        YY_BREAK
-case 467:
+case 473:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</bypassRoute>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8647,13 +8752,13 @@ case YY_STATE_EOF(E_surfxml_bypassRoute):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassRoute>' expected.");
        YY_BREAK
 
-case 468:
-/* rule 468 can match eol */
+case 474:
+/* rule 474 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <bypassASroute> is not allowed here.");
        YY_BREAK
-case 469:
-/* rule 469 can match eol */
+case 475:
+/* rule 475 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_bypassASroute_src = 0;
@@ -8668,47 +8773,47 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 470:
-/* rule 470 can match eol */
+case 476:
+/* rule 476 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_src);
        YY_BREAK
-case 471:
-/* rule 471 can match eol */
+case 477:
+/* rule 477 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");}  surfxml_bypassASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_src);
        YY_BREAK
-case 472:
-/* rule 472 can match eol */
+case 478:
+/* rule 478 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_dst);
        YY_BREAK
-case 473:
-/* rule 473 can match eol */
+case 479:
+/* rule 479 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");}  surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_dst);
        YY_BREAK
-case 474:
-/* rule 474 can match eol */
+case 480:
+/* rule 480 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___src);
        YY_BREAK
-case 475:
-/* rule 475 can match eol */
+case 481:
+/* rule 481 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");}  surfxml_bypassASroute_gw___src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___src);
        YY_BREAK
-case 476:
-/* rule 476 can match eol */
+case 482:
+/* rule 482 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw___dst);
        YY_BREAK
-case 477:
-/* rule 477 can match eol */
+case 483:
+/* rule 483 can match eol */
 YY_RULE_SETUP
 if (surfxml_bypassASroute_gw___dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");}  surfxml_bypassASroute_gw___dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw___dst);
        YY_BREAK
-case 478:
+case 484:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_bypassASroute_src) FAIL("Required attribute `src' not set for `bypassASroute' element.");
@@ -8718,7 +8823,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_bypassASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassASroute);
  }
        YY_BREAK
-case 479:
+case 485:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_bypassASroute_src) FAIL("Required attribute `src' not set for `bypassASroute' element.");
@@ -8731,11 +8836,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 480:
+case 486:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of bypassASroute element.", surf_parse_text[0]);
        YY_BREAK
-case 481:
+case 487:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `bypassASroute' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8743,8 +8848,8 @@ case YY_STATE_EOF(AL_surfxml_bypassASroute):
 FAIL("EOF in attribute list of `bypassASroute' element.");
        YY_BREAK
 
-case 482:
-/* rule 482 can match eol */
+case 488:
+/* rule 488 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8755,12 +8860,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 483:
-/* rule 483 can match eol */
+case 489:
+/* rule 489 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</bypassASroute>' expected.",surf_parse_text);
        YY_BREAK
-case 484:
+case 490:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</bypassASroute>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8770,22 +8875,22 @@ case YY_STATE_EOF(S_surfxml_bypassASroute):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassASroute>' expected.");
        YY_BREAK
 
-case 485:
-/* rule 485 can match eol */
+case 491:
+/* rule 491 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <process> is not allowed here.");
        YY_BREAK
-case 486:
-/* rule 486 can match eol */
+case 492:
+/* rule 492 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_process_host = 0;
   surfxml_process_host_isset = 0;
   AX_surfxml_process_function = 0;
   surfxml_process_function_isset = 0;
-  AX_surfxml_process_start___time = 28;
+  AX_surfxml_process_start___time = 50;
   surfxml_process_start___time_isset = 0;
-  AX_surfxml_process_kill___time = 33;
+  AX_surfxml_process_kill___time = 55;
   surfxml_process_kill___time_isset = 0;
   AX_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
   surfxml_process_on___failure_isset = 0;
@@ -8793,61 +8898,61 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 487:
-/* rule 487 can match eol */
+case 493:
+/* rule 493 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");} surfxml_process_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
        YY_BREAK
-case 488:
-/* rule 488 can match eol */
+case 494:
+/* rule 494 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");}  surfxml_process_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
        YY_BREAK
-case 489:
-/* rule 489 can match eol */
+case 495:
+/* rule 495 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");} surfxml_process_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
        YY_BREAK
-case 490:
-/* rule 490 can match eol */
+case 496:
+/* rule 496 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");}  surfxml_process_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
        YY_BREAK
-case 491:
-/* rule 491 can match eol */
+case 497:
+/* rule 497 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");} surfxml_process_start___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start___time);
        YY_BREAK
-case 492:
-/* rule 492 can match eol */
+case 498:
+/* rule 498 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");}  surfxml_process_start___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start___time);
        YY_BREAK
-case 493:
-/* rule 493 can match eol */
+case 499:
+/* rule 499 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");} surfxml_process_kill___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill___time);
        YY_BREAK
-case 494:
-/* rule 494 can match eol */
+case 500:
+/* rule 500 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");}  surfxml_process_kill___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill___time);
        YY_BREAK
-case 495:
-/* rule 495 can match eol */
-case 496:
-/* rule 496 can match eol */
+case 501:
+/* rule 501 can match eol */
+case 502:
+/* rule 502 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
        YY_BREAK
-case 497:
-/* rule 497 can match eol */
-case 498:
-/* rule 498 can match eol */
+case 503:
+/* rule 503 can match eol */
+case 504:
+/* rule 504 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_RESTART;
        YY_BREAK
-case 499:
+case 505:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
@@ -8855,7 +8960,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
  }
        YY_BREAK
-case 500:
+case 506:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_process_host) FAIL("Required attribute `host' not set for `process' element.");
@@ -8866,11 +8971,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 501:
+case 507:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of process element.", surf_parse_text[0]);
        YY_BREAK
-case 502:
+case 508:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `process' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8878,8 +8983,8 @@ case YY_STATE_EOF(AL_surfxml_process):
 FAIL("EOF in attribute list of `process' element.");
        YY_BREAK
 
-case 503:
-/* rule 503 can match eol */
+case 509:
+/* rule 509 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8890,12 +8995,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 504:
-/* rule 504 can match eol */
+case 510:
+/* rule 510 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</process>' expected.",surf_parse_text);
        YY_BREAK
-case 505:
+case 511:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</process>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8905,13 +9010,13 @@ case YY_STATE_EOF(S_surfxml_process_2):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</process>' expected.");
        YY_BREAK
 
-case 506:
-/* rule 506 can match eol */
+case 512:
+/* rule 512 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <argument> is not allowed here.");
        YY_BREAK
-case 507:
-/* rule 507 can match eol */
+case 513:
+/* rule 513 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_argument_value = 0;
@@ -8920,24 +9025,24 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 508:
-/* rule 508 can match eol */
+case 514:
+/* rule 514 can match eol */
 YY_RULE_SETUP
 if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");} surfxml_argument_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
        YY_BREAK
-case 509:
-/* rule 509 can match eol */
+case 515:
+/* rule 515 can match eol */
 YY_RULE_SETUP
 if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");}  surfxml_argument_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
        YY_BREAK
-case 510:
+case 516:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
   LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
  }
        YY_BREAK
-case 511:
+case 517:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
@@ -8947,11 +9052,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 512:
+case 518:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of argument element.", surf_parse_text[0]);
        YY_BREAK
-case 513:
+case 519:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `argument' element start tag.",surf_parse_text);
        YY_BREAK
@@ -8959,8 +9064,8 @@ case YY_STATE_EOF(AL_surfxml_argument):
 FAIL("EOF in attribute list of `argument' element.");
        YY_BREAK
 
-case 514:
-/* rule 514 can match eol */
+case 520:
+/* rule 520 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8971,12 +9076,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 515:
-/* rule 515 can match eol */
+case 521:
+/* rule 521 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</argument>' expected.",surf_parse_text);
        YY_BREAK
-case 516:
+case 522:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</argument>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -8984,13 +9089,13 @@ case YY_STATE_EOF(E_surfxml_argument):
 if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</argument>' expected.");
        YY_BREAK
 
-case 517:
-/* rule 517 can match eol */
+case 523:
+/* rule 523 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <config> is not allowed here.");
        YY_BREAK
-case 518:
-/* rule 518 can match eol */
+case 524:
+/* rule 524 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_config_id = 0;
@@ -8999,23 +9104,23 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 519:
-/* rule 519 can match eol */
+case 525:
+/* rule 525 can match eol */
 YY_RULE_SETUP
 if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");} surfxml_config_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_config_id);
        YY_BREAK
-case 520:
-/* rule 520 can match eol */
+case 526:
+/* rule 526 can match eol */
 YY_RULE_SETUP
 if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");}  surfxml_config_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_config_id);
        YY_BREAK
-case 521:
+case 527:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_config();surfxml_pcdata_ix = 0; ENTER(S_surfxml_config);
  }
        YY_BREAK
-case 522:
+case 528:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_config(); surfxml_pcdata_ix = 0; ETag_surfxml_config(); popbuffer(); /* attribute */
@@ -9024,11 +9129,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 523:
+case 529:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of config element.", surf_parse_text[0]);
        YY_BREAK
-case 524:
+case 530:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `config' element start tag.",surf_parse_text);
        YY_BREAK
@@ -9036,8 +9141,8 @@ case YY_STATE_EOF(AL_surfxml_config):
 FAIL("EOF in attribute list of `config' element.");
        YY_BREAK
 
-case 525:
-/* rule 525 can match eol */
+case 531:
+/* rule 531 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9048,12 +9153,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 526:
-/* rule 526 can match eol */
+case 532:
+/* rule 532 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</config>' expected.",surf_parse_text);
        YY_BREAK
-case 527:
+case 533:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</config>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -9065,13 +9170,13 @@ if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</config>' expected.");
 
 /* <!-- <!ATTLIST prop key CDATA #REQUIRED> -->
   * <!-- <!ATTLIST prop key CDATA #REQUIRED> -->  */
-case 528:
-/* rule 528 can match eol */
+case 534:
+/* rule 534 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <prop> is not allowed here.");
        YY_BREAK
-case 529:
-/* rule 529 can match eol */
+case 535:
+/* rule 535 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_prop_id = 0;
@@ -9082,27 +9187,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 530:
-/* rule 530 can match eol */
+case 536:
+/* rule 536 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");} surfxml_prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
        YY_BREAK
-case 531:
-/* rule 531 can match eol */
+case 537:
+/* rule 537 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");}  surfxml_prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
        YY_BREAK
-case 532:
-/* rule 532 can match eol */
+case 538:
+/* rule 538 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");} surfxml_prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
        YY_BREAK
-case 533:
-/* rule 533 can match eol */
+case 539:
+/* rule 539 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");}  surfxml_prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
        YY_BREAK
-case 534:
+case 540:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
@@ -9110,7 +9215,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
  }
        YY_BREAK
-case 535:
+case 541:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
@@ -9128,11 +9233,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 536:
+case 542:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of prop element.", surf_parse_text[0]);
        YY_BREAK
-case 537:
+case 543:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `prop' element start tag.",surf_parse_text);
        YY_BREAK
@@ -9140,8 +9245,8 @@ case YY_STATE_EOF(AL_surfxml_prop):
 FAIL("EOF in attribute list of `prop' element.");
        YY_BREAK
 
-case 538:
-/* rule 538 can match eol */
+case 544:
+/* rule 544 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9159,12 +9264,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 539:
-/* rule 539 can match eol */
+case 545:
+/* rule 545 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</prop>' expected.",surf_parse_text);
        YY_BREAK
-case 540:
+case 546:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</prop>' expected.",surf_parse_text[0]);
        YY_BREAK
@@ -9174,7 +9279,7 @@ if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</prop>' expected.");
 
 /* EPILOG: after the root element. */
 
-case 541:
+case 547:
 YY_RULE_SETUP
 {SET(PROLOG); yyless(0); CLEANUP; return -1;}
        YY_BREAK
@@ -9185,58 +9290,58 @@ SUCCEED;
 /* CHARACTER DATA. */
 
 /* Non-defined standard entities... */
-case 542:
+case 548:
 YY_RULE_SETUP
 BUFFERPUTC('&');
        YY_BREAK
-case 543:
+case 549:
 YY_RULE_SETUP
 BUFFERPUTC('<');
        YY_BREAK
-case 544:
+case 550:
 YY_RULE_SETUP
 BUFFERPUTC('>');
        YY_BREAK
-case 545:
+case 551:
 YY_RULE_SETUP
 BUFFERPUTC('\'');
        YY_BREAK
-case 546:
+case 552:
 YY_RULE_SETUP
 BUFFERPUTC('"');
        YY_BREAK
 /* Character entities. */
-case 547:
+case 553:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)atoi(surf_parse_text+2));
        YY_BREAK
-case 548:
+case 554:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)strtol(surf_parse_text+3,NULL,16));
        YY_BREAK
 
-case 549:
-/* rule 549 can match eol */
-case 550:
-/* rule 550 can match eol */
-case 551:
-/* rule 551 can match eol */
-case 552:
-/* rule 552 can match eol */
+case 555:
+/* rule 555 can match eol */
+case 556:
+/* rule 556 can match eol */
+case 557:
+/* rule 557 can match eol */
+case 558:
+/* rule 558 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC('\n');
        YY_BREAK
 
-case 553:
+case 559:
 YY_RULE_SETUP
 ENTER(CDATA);
        YY_BREAK
-case 554:
+case 560:
 YY_RULE_SETUP
 FAIL("Unexpected `]""]>' in character data.");
        YY_BREAK
 
-case 555:
+case 561:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
        YY_BREAK
@@ -9244,7 +9349,7 @@ case YY_STATE_EOF(VALUE1):
 FAIL("EOF in literal (\"'\" expected).");
        YY_BREAK
 
-case 556:
+case 562:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
        YY_BREAK
@@ -9252,22 +9357,22 @@ case YY_STATE_EOF(VALUE2):
 FAIL("EOF in literal (`\"' expected).");
        YY_BREAK
 
-case 557:
-/* rule 557 can match eol */
+case 563:
+/* rule 563 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC(surf_parse_text[0]);
        YY_BREAK
-case 558:
+case 564:
 YY_RULE_SETUP
 FAIL("Spurious `%c' in character data.",surf_parse_text[0]);
        YY_BREAK
 
-case 559:
+case 565:
 YY_RULE_SETUP
 LEAVE;
        YY_BREAK
 /* "]""]"              BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */
-case 560:
+case 566:
 YY_RULE_SETUP
 BUFFERPUTC(surf_parse_text[0]);
        YY_BREAK
@@ -9279,13 +9384,13 @@ FAIL("EOF in CDATA section.");
 /* Ideally, this should be replaced by code in flexml.pl that
     generates just the states not covered by other rules. */
 
-case 561:
-/* rule 561 can match eol */
+case 567:
+/* rule 567 can match eol */
 YY_RULE_SETUP
 FAIL("Syntax error on character `%c'.", surf_parse_text[0]);
        YY_BREAK
 
-case 562:
+case 568:
 YY_RULE_SETUP
 ECHO;
        YY_BREAK
@@ -9603,7 +9708,7 @@ static int yy_get_next_buffer (void)
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 3286 )
+                       if ( yy_current_state >= 3323 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -9631,11 +9736,11 @@ static int yy_get_next_buffer (void)
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 3286 )
+               if ( yy_current_state >= 3323 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 3285);
+       yy_is_jam = (yy_current_state == 3322);
 
        return yy_is_jam ? 0 : yy_current_state;
 }
diff --git a/src/surf/storage.c b/src/surf/storage.c
new file mode 100644 (file)
index 0000000..5369136
--- /dev/null
@@ -0,0 +1,724 @@
+/* Copyright (c) 2004-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/ex.h"
+#include "xbt/dict.h"
+#include "portable.h"
+#include "surf_private.h"
+#include "storage_private.h"
+#include "surf/surf_resource.h"
+#include <inttypes.h>
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
+                                "Logging specific to the SURF storage module");
+
+xbt_lib_t storage_lib;
+int ROUTING_STORAGE_LEVEL;      //Routing for storagelevel
+int ROUTING_STORAGE_HOST_LEVEL;
+int SURF_STORAGE_LEVEL;
+xbt_lib_t storage_type_lib;
+int ROUTING_STORAGE_TYPE_LEVEL; //Routing for storage_type level
+
+xbt_dynar_t mount_list = NULL;  /* temporary store of current mount storage */
+
+surf_model_t surf_storage_model = NULL;
+lmm_system_t storage_maxmin_system = NULL;
+static int storage_selective_update = 0;
+static xbt_swag_t
+    storage_running_action_set_that_does_not_need_being_checked = NULL;
+
+static xbt_dynar_t storage_list;
+
+#define GENERIC_LMM_ACTION(action) action->generic_lmm_action
+#define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
+
+static xbt_dict_t parse_storage_content(char *filename, sg_storage_size_t *used_size);
+static int storage_action_unref(surf_action_t action);
+static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
+static surf_action_t storage_action_execute (void *storage, sg_storage_size_t size, e_surf_action_storage_type_t type);
+
+static surf_action_t storage_action_ls(void *storage, const char* path)
+{
+  surf_action_t action = storage_action_execute(storage,0, LS);
+  action->ls_dict = NULL;
+  xbt_dict_t ls_dict = xbt_dict_new_homogeneous(xbt_free);
+
+  char* key;
+  sg_storage_size_t size = 0;
+  xbt_dict_cursor_t cursor = NULL;
+
+  xbt_dynar_t dyn = NULL;
+  char* file = NULL;
+
+  // for each file in the storage content
+  xbt_dict_foreach(((storage_t)storage)->content,cursor,key,size){
+    // Search if file start with the prefix 'path'
+    if(xbt_str_start_with(key,path)){
+      file = &key[strlen(path)];
+
+      // Split file with '/'
+      dyn = xbt_str_split(file,"/");
+      file = xbt_dynar_get_as(dyn,0,char*);
+
+      // file
+      if(xbt_dynar_length(dyn) == 1){
+        sg_storage_size_t *psize = xbt_new(sg_storage_size_t,1);
+        *psize=size;
+        xbt_dict_set(ls_dict,file,psize,NULL);
+      }
+      // Directory
+      else
+      {
+        // if directory does not exist yet in the dictionary
+        if(!xbt_dict_get_or_null(ls_dict,file))
+          xbt_dict_set(ls_dict,file,NULL,NULL);
+      }
+      xbt_dynar_free(&dyn);
+    }
+  }
+
+  action->ls_dict = ls_dict;
+  return action;
+}
+
+static surf_action_t storage_action_open(void *storage, const char* mount,
+                                         const char* path)
+{
+  XBT_DEBUG("\tOpen file '%s'",path);
+  xbt_dict_t content_dict = ((storage_t)storage)->content;
+  sg_storage_size_t size, *psize;
+  psize = (sg_storage_size_t*) xbt_dict_get_or_null(content_dict, path);
+  if (psize)
+    size = *psize;
+  else {
+  // if file does not exist create an empty file
+    psize = xbt_new(sg_storage_size_t,1);
+    size = 0;
+    *psize = size;
+    xbt_dict_set(content_dict,path,psize,NULL);
+    XBT_DEBUG("File '%s' was not found, file created.",path);
+  }
+  surf_file_t file = xbt_new0(s_surf_file_t,1);
+  file->name = xbt_strdup(path);
+  file->size = size;
+  file->mount = xbt_strdup(mount);
+
+  surf_action_t action = storage_action_execute(storage,0, OPEN);
+  action->file = (void *)file;
+  return action;
+}
+
+static surf_action_t storage_action_close(void *storage, surf_file_t fd)
+{
+  char *filename = fd->name;
+  XBT_DEBUG("\tClose file '%s' size '%" PRIu64 "'", filename, fd->size);
+  // unref write actions from storage
+  surf_action_storage_t write_action;
+  unsigned int i;
+  xbt_dynar_foreach(((storage_t)storage)->write_actions,i,write_action) {
+    if ((write_action->generic_lmm_action.generic_action.file) == fd) {
+      xbt_dynar_cursor_rm(((storage_t)storage)->write_actions, &i);
+      storage_action_unref((surf_action_t) write_action);
+    }
+  }
+  free(fd->name);
+  free(fd->mount);
+  xbt_free(fd);
+  surf_action_t action = storage_action_execute(storage,0, CLOSE);
+  return action;
+}
+
+static surf_action_t storage_action_read(void *storage, surf_file_t fd, sg_storage_size_t size)
+{
+  if(size > fd->size)
+    size = fd->size;
+  surf_action_t action = storage_action_execute(storage,size,READ);
+  return action;
+}
+
+static surf_action_t storage_action_write(void *storage, surf_file_t fd, sg_storage_size_t size)
+{
+  char *filename = fd->name;
+  XBT_DEBUG("\tWrite file '%s' size '%" PRIu64 "/%" PRIu64 "'",
+            filename, size, fd->size);
+
+  surf_action_t action = storage_action_execute(storage,size,WRITE);
+  action->file = fd;
+
+  // If the storage is full
+  if(((storage_t)storage)->used_size==((storage_t)storage)->size) {
+    storage_action_state_set((surf_action_t) action, SURF_ACTION_FAILED);
+  }
+  return action;
+}
+
+static surf_action_t storage_action_execute (void *storage, sg_storage_size_t size, e_surf_action_storage_type_t type)
+{
+  surf_action_storage_t action = NULL;
+  storage_t STORAGE = storage;
+
+  XBT_IN("(%s,%" PRIu64, surf_resource_name(STORAGE), size);
+  action =
+      surf_action_new(sizeof(s_surf_action_storage_t), size, surf_storage_model,
+          STORAGE->state_current != SURF_RESOURCE_ON);
+
+  // Save the storage on action
+  action->storage = storage;
+  GENERIC_LMM_ACTION(action).suspended = 0;     /* Should be useless because of the
+                                                   calloc but it seems to help valgrind... */
+
+  GENERIC_LMM_ACTION(action).variable =
+      lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 3);
+
+  // Must be less than the max bandwidth for all actions
+  lmm_expand(storage_maxmin_system, STORAGE->constraint,
+             GENERIC_LMM_ACTION(action).variable, 1.0);
+
+  switch(type) {
+  case OPEN:
+  case CLOSE:
+  case STAT:
+  case LS:
+    break;
+  case READ:
+    lmm_expand(storage_maxmin_system, STORAGE->constraint_read,
+               GENERIC_LMM_ACTION(action).variable, 1.0);
+    break;
+  case WRITE:
+    lmm_expand(storage_maxmin_system, STORAGE->constraint_write,
+               GENERIC_LMM_ACTION(action).variable, 1.0);
+    xbt_dynar_push(((storage_t)storage)->write_actions,&action);
+    surf_action_ref((surf_action_t) action);
+    break;
+  }
+  action->type = type;
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static xbt_dict_t storage_get_properties(const void *storage)
+{
+  return surf_resource_properties(surf_storage_resource_priv(storage));
+}
+
+static xbt_dict_t storage_get_content(void *storage)
+{
+  /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
+  /*surf_action_t action = storage_action_execute(storage,0, LS);*/
+
+  void *storage_resource = surf_storage_resource_priv(storage);
+  xbt_dict_t content_dict = xbt_dict_new_homogeneous(NULL);
+  xbt_dict_cursor_t cursor = NULL;
+  char *file;
+  sg_storage_size_t *psize;
+
+  xbt_dict_foreach(((storage_t)storage_resource)->content, cursor, file, psize){
+    xbt_dict_set(content_dict,file,psize,NULL);
+  }
+  return content_dict;
+}
+
+static sg_storage_size_t storage_get_size(void *storage){
+  void *storage_resource = surf_storage_resource_priv(storage);
+  return ((storage_t)storage_resource)->size;
+}
+
+static void* storage_create_resource(const char* id, const char* model,
+    const char* type_id, const char* content_name, const char* content_type, xbt_dict_t properties){
+  storage_t storage = NULL;
+
+  xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)),
+              "Storage '%s' declared several times in the platform file",
+              id);
+  storage = (storage_t) surf_resource_new(sizeof(s_storage_t),
+          surf_storage_model, id, properties, NULL);
+
+  storage->state_current = SURF_RESOURCE_ON;
+  storage->used_size = 0;
+  storage->size = 0;
+  storage->write_actions = xbt_dynar_new(sizeof(char *),NULL);
+
+  storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
+  double Bread =
+      surf_parse_get_bandwidth(xbt_dict_get(storage_type->properties,"Bread"));
+  double Bwrite =
+      surf_parse_get_bandwidth(xbt_dict_get(storage_type->properties,"Bwrite"));
+  double Bconnection =
+      surf_parse_get_bandwidth(xbt_dict_get(storage_type->properties,
+                                            "Bconnection"));
+  XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%lu'",Bconnection,Bread,Bwrite,(unsigned long)storage_type->size);
+  storage->constraint       = lmm_constraint_new(storage_maxmin_system, storage, Bconnection);
+  storage->constraint_read  = lmm_constraint_new(storage_maxmin_system, storage, Bread);
+  storage->constraint_write = lmm_constraint_new(storage_maxmin_system, storage, Bwrite);
+  storage->content = parse_storage_content((char*)content_name,&(storage->used_size));
+  storage->content_type = xbt_strdup(content_type);
+  storage->size = storage_type->size;
+  storage->type_id = xbt_strdup(type_id);
+
+  xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
+
+  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' \n\t\tmodel '%s' \n\t\tproperties '%p'\n\t\tBread '%f'\n",
+      id,
+      model,
+      type_id,
+      storage_type->properties,
+      Bread);
+
+  if (!storage_list)
+    storage_list = xbt_dynar_new(sizeof(char *),NULL);
+  xbt_dynar_push(storage_list,&storage);
+
+  return storage;
+}
+
+static void storage_finalize(void)
+{
+  lmm_system_free(storage_maxmin_system);
+  storage_maxmin_system = NULL;
+
+  surf_model_exit(surf_storage_model);
+  surf_storage_model = NULL;
+
+  xbt_dynar_free(&storage_list);
+
+  xbt_swag_free
+      (storage_running_action_set_that_does_not_need_being_checked);
+  storage_running_action_set_that_does_not_need_being_checked = NULL;
+}
+
+static void storage_update_actions_state(double now, double delta)
+{
+  surf_action_storage_t action = NULL;
+  surf_action_storage_t next_action = NULL;
+  xbt_swag_t running_actions = surf_storage_model->states.running_action_set;
+
+
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
+    if(action->type == WRITE)
+    {
+      // Update the disk usage
+      // Update the file size
+      // Update the storage content (with file size)
+      double rate = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
+      /* Hack to avoid rounding differences between x86 and x86_64
+       * (note that the next sizes are of type sg_storage_size_t). */
+      long incr = delta * rate + MAXMIN_PRECISION;
+      ((storage_t)(action->storage))->used_size += incr; // disk usage
+      ((surf_action_t)action)->file->size += incr; // file size
+
+      sg_storage_size_t *psize = xbt_new(sg_storage_size_t,1);
+      *psize = ((surf_action_t)action)->file->size;
+
+      xbt_dict_t content_dict = ((storage_t)(action->storage))->content;
+      xbt_dict_set(content_dict,((surf_action_t)action)->file->name,psize,NULL);
+    }
+
+    double_update(&(GENERIC_ACTION(action).remains),
+                  lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable) * delta);
+
+    if (GENERIC_LMM_ACTION(action).generic_action.max_duration != NO_MAX_DURATION)
+      double_update(&(GENERIC_ACTION(action).max_duration), delta);
+
+    if(GENERIC_ACTION(action).remains > 0 &&
+        lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0 &&
+        ((storage_t)action->storage)->used_size == ((storage_t)action->storage)->size)
+    {
+      GENERIC_ACTION(action).finish = surf_get_clock();
+      storage_action_state_set((surf_action_t) action, SURF_ACTION_FAILED);
+    } else if ((GENERIC_ACTION(action).remains <= 0) &&
+        (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0))
+    {
+      GENERIC_ACTION(action).finish = surf_get_clock();
+      storage_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    } else if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
+               (GENERIC_ACTION(action).max_duration <= 0))
+    {
+      GENERIC_ACTION(action).finish = surf_get_clock();
+      storage_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    }
+  }
+
+  return;
+}
+
+static double storage_share_resources(double NOW)
+{
+  XBT_DEBUG("storage_share_resources %f",NOW);
+  s_surf_action_storage_t action;
+  unsigned int i,j;
+  storage_t storage;
+  surf_action_storage_t write_action;
+
+  double min_completion = generic_maxmin_share_resources(surf_storage_model->states.running_action_set,
+      xbt_swag_offset(action, generic_lmm_action.variable),
+      storage_maxmin_system, lmm_solve);
+
+  double rate;
+  // Foreach disk
+  xbt_dynar_foreach(storage_list,i,storage)
+  {
+    rate = 0;
+    // Foreach write action on disk
+    xbt_dynar_foreach(storage->write_actions,j,write_action)
+    {
+      rate += lmm_variable_getvalue(write_action->generic_lmm_action.variable);
+    }
+    if(rate > 0)
+      min_completion = MIN(min_completion, (storage->size-storage->used_size)/rate);
+  }
+
+  return min_completion;
+}
+
+static int storage_resource_used(void *resource_id)
+{
+  THROW_UNIMPLEMENTED;
+  return 0;
+}
+
+static void storage_resources_state(void *id, tmgr_trace_event_t event_type,
+                                 double value, double time)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static int storage_action_unref(surf_action_t action)
+{
+  action->refcount--;
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+    if (((surf_action_lmm_t) action)->variable)
+      lmm_variable_free(storage_maxmin_system,
+                        ((surf_action_lmm_t) action)->variable);
+#ifdef HAVE_TRACING
+    xbt_free(action->category);
+#endif
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+static void storage_action_cancel(surf_action_t action)
+{
+  surf_action_state_set(action, SURF_ACTION_FAILED);
+  return;
+}
+
+static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state)
+{
+  surf_action_state_set(action, state);
+  return;
+}
+
+static void storage_action_suspend(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  if (((surf_action_lmm_t) action)->suspended != 2) {
+    lmm_update_variable_weight(storage_maxmin_system,
+                               ((surf_action_lmm_t) action)->variable,
+                               0.0);
+    ((surf_action_lmm_t) action)->suspended = 1;
+  }
+  XBT_OUT();
+}
+
+static void storage_action_resume(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static int storage_action_is_suspended(surf_action_t action)
+{
+  return (((surf_action_lmm_t) action)->suspended == 1);
+}
+
+static void storage_action_set_max_duration(surf_action_t action, double duration)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static void storage_action_set_priority(surf_action_t action, double priority)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+static void parse_storage_init(sg_platf_storage_cbarg_t storage)
+{
+  void* stype = xbt_lib_get_or_null(storage_type_lib,
+                                    storage->type_id,
+                                    ROUTING_STORAGE_TYPE_LEVEL);
+  if(!stype) xbt_die("No storage type '%s'",storage->type_id);
+
+  // if storage content is not specified use the content of storage_type if exist
+  if(!strcmp(storage->content,"") && strcmp(((storage_type_t) stype)->content,"")){
+    storage->content = ((storage_type_t) stype)->content;
+    storage->content_type = ((storage_type_t) stype)->content_type;
+    XBT_DEBUG("For disk '%s' content is empty, inherit the content (of type %s) from storage type '%s' ",
+        storage->id,((storage_type_t) stype)->content_type,
+        ((storage_type_t) stype)->type_id);
+  }
+
+  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' "
+      "\n\t\tmodel '%s' \n\t\tcontent '%s'\n\t\tcontent_type '%s' "
+      "\n\t\tproperties '%p'\n",
+      storage->id,
+      ((storage_type_t) stype)->model,
+      ((storage_type_t) stype)->type_id,
+      storage->content,
+      storage->content_type,
+      ((storage_type_t) stype)->properties);
+
+  storage_create_resource(storage->id,
+     ((storage_type_t) stype)->model,
+     ((storage_type_t) stype)->type_id,
+     storage->content,
+     storage->content_type,
+     storage->properties);
+}
+
+static void parse_mstorage_init(sg_platf_mstorage_cbarg_t mstorage)
+{
+  XBT_DEBUG("parse_mstorage_init");
+}
+
+static void parse_storage_type_init(sg_platf_storage_type_cbarg_t storagetype_)
+{
+  XBT_DEBUG("parse_storage_type_init");
+}
+
+static void parse_mount_init(sg_platf_mount_cbarg_t mount)
+{
+  XBT_DEBUG("parse_mount_init");
+}
+
+static void storage_define_callbacks()
+{
+  sg_platf_storage_add_cb(parse_storage_init);
+  sg_platf_storage_type_add_cb(parse_storage_type_init);
+  sg_platf_mstorage_add_cb(parse_mstorage_init);
+  sg_platf_mount_add_cb(parse_mount_init);
+}
+
+static void surf_storage_model_init_internal(void)
+{
+  s_surf_action_t action;
+
+  XBT_DEBUG("surf_storage_model_init_internal");
+  surf_storage_model = surf_model_init();
+
+  storage_running_action_set_that_does_not_need_being_checked =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+
+  surf_storage_model->name = "Storage";
+  surf_storage_model->action_unref = storage_action_unref;
+  surf_storage_model->action_cancel = storage_action_cancel;
+  surf_storage_model->action_state_set = storage_action_state_set;
+
+  surf_storage_model->model_private->finalize = storage_finalize;
+  surf_storage_model->model_private->update_actions_state = storage_update_actions_state;
+  surf_storage_model->model_private->share_resources = storage_share_resources;
+  surf_storage_model->model_private->resource_used = storage_resource_used;
+  surf_storage_model->model_private->update_resource_state = storage_resources_state;
+
+  surf_storage_model->suspend = storage_action_suspend;
+  surf_storage_model->resume = storage_action_resume;
+  surf_storage_model->is_suspended = storage_action_is_suspended;
+  surf_storage_model->set_max_duration = storage_action_set_max_duration;
+  surf_storage_model->set_priority = storage_action_set_priority;
+
+  surf_storage_model->extension.storage.open = storage_action_open;
+  surf_storage_model->extension.storage.close = storage_action_close;
+  surf_storage_model->extension.storage.read = storage_action_read;
+  surf_storage_model->extension.storage.write = storage_action_write;
+  surf_storage_model->extension.storage.ls = storage_action_ls;
+  surf_storage_model->extension.storage.get_properties = storage_get_properties;
+  surf_storage_model->extension.storage.get_content = storage_get_content;
+  surf_storage_model->extension.storage.get_size = storage_get_size;
+  if (!storage_maxmin_system) {
+    storage_maxmin_system = lmm_system_new(storage_selective_update);
+  }
+}
+
+void surf_storage_model_init_default(void)
+{
+  surf_storage_model_init_internal();
+  storage_define_callbacks();
+
+  xbt_dynar_push(model_list, &surf_storage_model);
+}
+
+static void storage_parse_storage(sg_platf_storage_cbarg_t storage)
+{
+  xbt_assert(!xbt_lib_get_or_null(storage_lib, storage->id,ROUTING_STORAGE_LEVEL),
+               "Reading a storage, processing unit \"%s\" already exists", storage->id);
+
+  // Verification of an existing type_id
+#ifndef NDEBUG
+  void* storage_type = xbt_lib_get_or_null(storage_type_lib, storage->type_id,ROUTING_STORAGE_TYPE_LEVEL);
+#endif
+  xbt_assert(storage_type,"Reading a storage, type id \"%s\" does not exists", storage->type_id);
+
+  XBT_DEBUG("ROUTING Create a storage name '%s' with type_id '%s' and content '%s'",
+      storage->id,
+      storage->type_id,
+      storage->content);
+
+  xbt_lib_set(storage_lib,
+      storage->id,
+      ROUTING_STORAGE_LEVEL,
+      (void *) xbt_strdup(storage->type_id));
+}
+
+static xbt_dict_t parse_storage_content(char *filename, sg_storage_size_t *used_size)
+{
+  *used_size = 0;
+  if ((!filename) || (strcmp(filename, "") == 0))
+    return NULL;
+
+  xbt_dict_t parse_content = xbt_dict_new_homogeneous(xbt_free);
+  FILE *file = NULL;
+
+  file = surf_fopen(filename, "r");
+  xbt_assert(file != NULL, "Cannot open file '%s' (path=%s)", filename,
+              xbt_str_join(surf_path, ":"));
+
+  char *line = NULL;
+  size_t len = 0;
+  ssize_t read;
+  char path[1024];
+  sg_storage_size_t size;
+
+  while ((read = xbt_getline(&line, &len, file)) != -1) {
+    if (read){
+    if (sscanf(line,"%s %" SCNu64, path, &size) == 2) {
+        *used_size += size;
+        sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+        *psize = size;
+        xbt_dict_set(parse_content,path,psize,NULL);
+      } else {
+        xbt_die("Be sure of passing a good format for content file.\n");
+      }
+    }
+  }
+  free(line);
+  fclose(file);
+  return parse_content;
+}
+
+static void storage_parse_storage_type(sg_platf_storage_type_cbarg_t storage_type)
+{
+  xbt_assert(!xbt_lib_get_or_null(storage_type_lib, storage_type->id,ROUTING_STORAGE_TYPE_LEVEL),
+               "Reading a storage type, processing unit \"%s\" already exists", storage_type->id);
+
+  storage_type_t stype = xbt_new0(s_storage_type_t, 1);
+  stype->model = xbt_strdup(storage_type->model);
+  stype->properties = storage_type->properties;
+  stype->content = xbt_strdup(storage_type->content);
+  stype->content_type = xbt_strdup(storage_type->content_type);
+  stype->type_id = xbt_strdup(storage_type->id);
+  stype->size = storage_type->size;
+
+  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s', "
+      "content '%s', and content_type '%s'",
+      stype->type_id,
+      stype->model,
+      storage_type->content,
+      storage_type->content_type);
+
+  xbt_lib_set(storage_type_lib,
+      stype->type_id,
+      ROUTING_STORAGE_TYPE_LEVEL,
+      (void *) stype);
+}
+static void storage_parse_mstorage(sg_platf_mstorage_cbarg_t mstorage)
+{
+  THROW_UNIMPLEMENTED;
+//  mount_t mnt = xbt_new0(s_mount_t, 1);
+//  mnt->id = xbt_strdup(mstorage->type_id);
+//  mnt->name = xbt_strdup(mstorage->name);
+//
+//  if(!mount_list){
+//    XBT_DEBUG("Creata a Mount list for %s",A_surfxml_host_id);
+//    mount_list = xbt_dynar_new(sizeof(char *), NULL);
+//  }
+//  xbt_dynar_push(mount_list,(void *) mnt);
+//  free(mnt->id);
+//  free(mnt->name);
+//  xbt_free(mnt);
+//  XBT_DEBUG("ROUTING Mount a storage name '%s' with type_id '%s'",mstorage->name, mstorage->id);
+}
+
+static void mount_free(void *p)
+{
+  mount_t mnt = p;
+  xbt_free(mnt->name);
+}
+
+static void storage_parse_mount(sg_platf_mount_cbarg_t mount)
+{
+  // Verification of an existing storage
+#ifndef NDEBUG
+  void* storage = xbt_lib_get_or_null(storage_lib, mount->storageId,ROUTING_STORAGE_LEVEL);
+#endif
+  xbt_assert(storage,"Disk id \"%s\" does not exists", mount->storageId);
+
+  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->storageId, mount->name);
+
+  s_mount_t mnt;
+  mnt.storage =
+    surf_storage_resource_priv(surf_storage_resource_by_name(mount->storageId));
+  mnt.name = xbt_strdup(mount->name);
+
+  if(!mount_list){
+    XBT_DEBUG("Create a Mount list for %s",A_surfxml_host_id);
+    mount_list = xbt_dynar_new(sizeof(s_mount_t), mount_free);
+  }
+  xbt_dynar_push(mount_list,&mnt);
+}
+
+static XBT_INLINE void routing_storage_type_free(void *r)
+{
+  storage_type_t stype = r;
+  free(stype->model);
+  free(stype->type_id);
+  free(stype->content);
+  free(stype->content_type);
+  xbt_dict_free(&(stype->properties));
+  free(stype);
+}
+
+static XBT_INLINE void surf_storage_resource_free(void *r)
+{
+  // specific to storage
+  storage_t storage = r;
+  xbt_dict_free(&storage->content);
+  xbt_dynar_free(&storage->write_actions);
+  free(storage->type_id);
+  free(storage->content_type);
+  // generic resource
+  surf_resource_free(r);
+}
+
+static XBT_INLINE void routing_storage_host_free(void *r)
+{
+  xbt_dynar_t dyn = r;
+  xbt_dynar_free(&dyn);
+}
+
+void storage_register_callbacks() {
+
+  ROUTING_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,xbt_free);
+  ROUTING_STORAGE_HOST_LEVEL = xbt_lib_add_level(storage_lib,routing_storage_host_free);
+  ROUTING_STORAGE_TYPE_LEVEL = xbt_lib_add_level(storage_type_lib,routing_storage_type_free);
+  SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_resource_free);
+
+  sg_platf_storage_add_cb(storage_parse_storage);
+  sg_platf_mstorage_add_cb(storage_parse_mstorage);
+  sg_platf_storage_type_add_cb(storage_parse_storage_type);
+  sg_platf_mount_add_cb(storage_parse_mount);
+}
+
index 7a28858..1244418 100644 (file)
@@ -1,6 +1,9 @@
 #include "storage.hpp"
 #include "surf_private.h"
 
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
 extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf,
                                 "Logging specific to the SURF storage module");
@@ -32,15 +35,18 @@ static XBT_INLINE void routing_storage_type_free(void *r)
   free(stype->type_id);
   free(stype->content);
   xbt_dict_free(&(stype->properties));
+  xbt_dict_free(&(stype->properties));
   free(stype);
 }
 
 static XBT_INLINE void surf_storage_resource_free(void *r)
 {
   // specific to storage
-  StoragePtr storage = (StoragePtr) r;
+  StoragePtr storage = dynamic_cast<StoragePtr>(static_cast<ResourcePtr>(r));
   xbt_dict_free(&storage->p_content);
   xbt_dynar_free(&storage->p_writeActions);
+  free(storage->p_typeId);
+  free(storage->p_contentType);
   // generic resource
   delete storage;
 }
@@ -61,19 +67,27 @@ static void parse_storage_init(sg_platf_storage_cbarg_t storage)
   // if storage content is not specified use the content of storage_type if exist
   if(!strcmp(storage->content,"") && strcmp(((storage_type_t) stype)->content,"")){
     storage->content = ((storage_type_t) stype)->content;
-    XBT_DEBUG("For disk '%s' content is empty, use the content of storage type '%s'",storage->id,((storage_type_t) stype)->type_id);
+    storage->content_type = ((storage_type_t) stype)->content_type;
+    XBT_DEBUG("For disk '%s' content is empty, inherit the content (of type %s) from storage type '%s' ",
+        storage->id,((storage_type_t) stype)->content_type,
+        ((storage_type_t) stype)->type_id);
   }
 
-  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' \n\t\tmodel '%s' \n\t\tcontent '%s'\n\t\tproperties '%p'\n",
+  XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' "
+      "\n\t\tmodel '%s' \n\t\tcontent '%s'\n\t\tcontent_type '%s' "
+      "\n\t\tproperties '%p'\n",
       storage->id,
       ((storage_type_t) stype)->model,
       ((storage_type_t) stype)->type_id,
       storage->content,
+      storage->content_type,
       ((storage_type_t) stype)->properties);
 
   surf_storage_model->createResource(storage->id, ((storage_type_t) stype)->model,
                                      ((storage_type_t) stype)->type_id,
-                                     storage->content);
+                                     storage->content,
+                                     storage->content_type,
+                                     storage->properties);
 }
 
 static void parse_mstorage_init(sg_platf_mstorage_cbarg_t mstorage)
@@ -113,13 +127,13 @@ static void storage_parse_storage(sg_platf_storage_cbarg_t storage)
       (void *) xbt_strdup(storage->type_id));
 }
 
-static xbt_dict_t parse_storage_content(char *filename, size_t *used_size)
+static xbt_dict_t parse_storage_content(char *filename, sg_storage_size_t *used_size)
 {
   *used_size = 0;
   if ((!filename) || (strcmp(filename, "") == 0))
     return NULL;
 
-  xbt_dict_t parse_content = xbt_dict_new_homogeneous(NULL);
+  xbt_dict_t parse_content = xbt_dict_new_homogeneous(xbt_free);
   FILE *file = NULL;
 
   file = surf_fopen(filename, "r");
@@ -130,14 +144,16 @@ static xbt_dict_t parse_storage_content(char *filename, size_t *used_size)
   size_t len = 0;
   ssize_t read;
   char path[1024];
-  size_t size;
+  sg_storage_size_t size;
 
 
   while ((read = xbt_getline(&line, &len, file)) != -1) {
     if (read){
-    if(sscanf(line,"%s %zu",path, &size)==2) {
+    if(sscanf(line,"%s %" SCNu64, path, &size) == 2) {
         *used_size += size;
-        xbt_dict_set(parse_content,path,(void*) size,NULL);
+        sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+        *psize = size;
+        xbt_dict_set(parse_content,path,psize,NULL);
       } else {
         xbt_die("Be sure of passing a good format for content file.\n");
       }
@@ -157,13 +173,16 @@ static void storage_parse_storage_type(sg_platf_storage_type_cbarg_t storage_typ
   stype->model = xbt_strdup(storage_type->model);
   stype->properties = storage_type->properties;
   stype->content = xbt_strdup(storage_type->content);
+  stype->content_type = xbt_strdup(storage_type->content_type);
   stype->type_id = xbt_strdup(storage_type->id);
-  stype->size = storage_type->size * 1000000000; /* storage_type->size is in Gbytes and stype->sizeis in bytes */
+  stype->size = storage_type->size;
 
-  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s' content '%s'",
+  XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s', "
+      "content '%s', and content_type '%s'",
       stype->type_id,
       stype->model,
-      storage_type->content);
+      storage_type->content,
+      storage_type->content_type);
 
   xbt_lib_set(storage_type_lib,
       stype->type_id,
@@ -198,14 +217,14 @@ static void storage_parse_mount(sg_platf_mount_cbarg_t mount)
 {
   // Verification of an existing storage
 #ifndef NDEBUG
-  void* storage = xbt_lib_get_or_null(storage_lib, mount->id,ROUTING_STORAGE_LEVEL);
+  void* storage = xbt_lib_get_or_null(storage_lib, mount->storageId, ROUTING_STORAGE_LEVEL);
 #endif
-  xbt_assert(storage,"Disk id \"%s\" does not exists", mount->id);
+  xbt_assert(storage,"Disk id \"%s\" does not exists", mount->storageId);
 
-  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->id, mount->name);
+  XBT_DEBUG("ROUTING Mount '%s' on '%s'",mount->storageId, mount->name);
 
   s_mount_t mnt;
-  mnt.id = surf_storage_resource_priv(surf_storage_resource_by_name(mount->id));
+  mnt.storage = surf_storage_resource_priv(surf_storage_resource_by_name(mount->storageId));
   mnt.name = xbt_strdup(mount->name);
 
   if(!mount_list){
@@ -272,7 +291,8 @@ StorageModel::~StorageModel(){
   storage_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
-StoragePtr StorageModel::createResource(const char* id, const char* model, const char* type_id, const char* content_name)
+StoragePtr StorageModel::createResource(const char* id, const char* model, const char* type_id,
+               const char* content_name, const char* content_type, xbt_dict_t properties)
 {
 
   xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)),
@@ -281,14 +301,15 @@ StoragePtr StorageModel::createResource(const char* id, const char* model, const
 
   storage_type_t storage_type = (storage_type_t) xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
 
-  double Bread  = atof((char*)xbt_dict_get(storage_type->properties, "Bread"));
-  double Bwrite = atof((char*)xbt_dict_get(storage_type->properties, "Bwrite"));
-  double Bconnection   = atof((char*)xbt_dict_get(storage_type->properties, "Bconnection"));
+  double Bread  = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bread"));
+  double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bwrite"));
+  double Bconnection   = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bconnection"));
 
-  StoragePtr storage = new StorageLmm(this, NULL, NULL, p_maxminSystem,
-                 Bread, Bwrite, Bconnection, (char *)content_name, storage_type->size);
+  StoragePtr storage = new StorageLmm(this, id, properties, p_maxminSystem,
+                 Bread, Bwrite, Bconnection,
+                 type_id, (char *)content_name, xbt_strdup(content_type), storage_type->size);
 
-  xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
+  xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, static_cast<ResourcePtr>(storage));
 
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' \n\t\tmodel '%s' \n\t\tproperties '%p'\n\t\tBread '%f'\n",
       id,
@@ -297,7 +318,8 @@ StoragePtr StorageModel::createResource(const char* id, const char* model, const
       storage_type->properties,
       Bread);
 
-  if(!storage_list) storage_list=xbt_dynar_new(sizeof(char *),NULL);
+  if(!storage_list)
+       storage_list = xbt_dynar_new(sizeof(char *),NULL);
   xbt_dynar_push(storage_list, &storage);
 
   return storage;
@@ -335,24 +357,26 @@ void StorageModel::updateActionsState(double now, double delta)
   void *_action, *_next_action;
   StorageActionLmmPtr action = NULL;
 
-  // Update the disk usage
-  // Update the file size
-  // For each action of type write
   xbt_swag_foreach_safe(_action, _next_action, p_runningActionSet) {
        action = dynamic_cast<StorageActionLmmPtr>(static_cast<ActionPtr>(_action));
     if(action->m_type == WRITE)
     {
+      // Update the disk usage
+     // Update the file size
+     // For each action of type write
       double rate = lmm_variable_getvalue(action->p_variable);
       /* Hack to avoid rounding differences between x86 and x86_64
-       * (note that the next sizes are of type size_t). */
+       * (note that the next sizes are of type sg_storage_size_t). */
       long incr = delta * rate + MAXMIN_PRECISION;
       action->p_storage->m_usedSize += incr; // disk usage
       action->p_file->size += incr; // file size
-    }
-  }
 
-  xbt_swag_foreach_safe(_action, _next_action, p_runningActionSet) {
-       action = dynamic_cast<StorageActionLmmPtr>(static_cast<ActionPtr>(_action));
+      sg_storage_size_t *psize = xbt_new(sg_storage_size_t,1);
+      *psize = action->p_file->size;
+
+      xbt_dict_t content_dict = action->p_storage->p_content;
+      xbt_dict_set(content_dict, action->p_file->name, psize, NULL);
+    }
 
     double_update(&action->m_remains,
                   lmm_variable_getvalue(action->p_variable) * delta);
@@ -388,7 +412,7 @@ xbt_dict_t Storage::parseContent(char *filename)
   if ((!filename) || (strcmp(filename, "") == 0))
     return NULL;
 
-  xbt_dict_t parse_content = xbt_dict_new_homogeneous(NULL);
+  xbt_dict_t parse_content = xbt_dict_new_homogeneous(xbt_free);
   FILE *file = NULL;
 
   file = surf_fopen(filename, "r");
@@ -399,14 +423,16 @@ xbt_dict_t Storage::parseContent(char *filename)
   size_t len = 0;
   ssize_t read;
   char path[1024];
-  size_t size;
+  sg_storage_size_t size;
 
 
   while ((read = xbt_getline(&line, &len, file)) != -1) {
     if (read){
-    if(sscanf(line,"%s %zu",path, &size)==2) {
+    if(sscanf(line,"%s %" SCNu64, path, &size) == 2) {
         m_usedSize += size;
-        xbt_dict_set(parse_content,path,(void*) size,NULL);
+        sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+        *psize = size;
+        xbt_dict_set(parse_content,path,psize,NULL);
       } else {
         xbt_die("Be sure of passing a good format for content file.\n");
       }
@@ -429,7 +455,7 @@ Storage::Storage(StorageModelPtr model, const char* name, xbt_dict_t properties)
 
 StorageLmm::StorageLmm(StorageModelPtr model, const char* name, xbt_dict_t properties,
             lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
-            char *content_name, size_t size)
+            const char* type_id, char *content_name, char *content_type, size_t size)
  :  Resource(model, name, properties), ResourceLmm(), Storage(model, name, properties) {
   XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%lu'", bconnection, bread, bwrite, ((unsigned long)size));
 
@@ -438,10 +464,12 @@ StorageLmm::StorageLmm(StorageModelPtr model, const char* name, xbt_dict_t prope
   m_size = 0;
 
   p_content = parseContent(content_name);
+  p_contentType = content_type;
   p_constraint = lmm_constraint_new(maxminSystem, this, bconnection);
   p_constraintRead  = lmm_constraint_new(maxminSystem, this, bread);
   p_constraintWrite = lmm_constraint_new(maxminSystem, this, bwrite);
   m_size = size;
+  p_typeId = xbt_strdup(type_id);
 }
 
 bool Storage::isUsed()
@@ -460,10 +488,10 @@ StorageActionPtr StorageLmm::ls(const char* path)
   StorageActionLmmPtr action = new StorageActionLmm(p_model, 0, p_stateCurrent != SURF_RESOURCE_ON, this, LS);
 
   action->p_lsDict = NULL;
-  xbt_dict_t ls_dict = xbt_dict_new();
+  xbt_dict_t ls_dict = xbt_dict_new_homogeneous(xbt_free);
 
   char* key;
-  size_t size = 0;
+  sg_storage_size_t size = 0;
   xbt_dict_cursor_t cursor = NULL;
 
   xbt_dynar_t dyn = NULL;
@@ -481,7 +509,9 @@ StorageActionPtr StorageLmm::ls(const char* path)
 
       // file
       if(xbt_dynar_length(dyn) == 1){
-        xbt_dict_set(ls_dict,file,&size,NULL);
+        sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+        *psize=size;
+        xbt_dict_set(ls_dict, file, psize, NULL);
       }
       // Directory
       else
@@ -501,16 +531,22 @@ StorageActionPtr StorageLmm::ls(const char* path)
 StorageActionPtr StorageLmm::open(const char* mount, const char* path)
 {
   XBT_DEBUG("\tOpen file '%s'",path);
-  size_t size = (size_t) xbt_dict_get_or_null(p_content, path);
+  sg_storage_size_t size, *psize;
+  psize = (sg_storage_size_t*) xbt_dict_get_or_null(p_content, path);
   // if file does not exist create an empty file
-  if(!size){
-    xbt_dict_set(p_content, path, &size, NULL);
+  if(psize)
+    size = *psize;
+  else {
+       psize = xbt_new(sg_storage_size_t,1);
+    size = 0;
+    *psize = size;
+    xbt_dict_set(p_content, path, psize, NULL);
     XBT_DEBUG("File '%s' was not found, file created.",path);
   }
   surf_file_t file = xbt_new0(s_surf_file_t,1);
   file->name = xbt_strdup(path);
   file->size = size;
-  file->storage = xbt_strdup(mount);
+  file->mount = xbt_strdup(mount);
 
   StorageActionLmmPtr action = new StorageActionLmm(p_model, 0, p_stateCurrent != SURF_RESOURCE_ON, this, OPEN);
   action->p_file = file;
@@ -520,7 +556,7 @@ StorageActionPtr StorageLmm::open(const char* mount, const char* path)
 StorageActionPtr StorageLmm::close(surf_file_t fd)
 {
   char *filename = fd->name;
-  XBT_DEBUG("\tClose file '%s' size '%zu'", filename, fd->size);
+  XBT_DEBUG("\tClose file '%s' size '%" PRIu64 "'", filename, fd->size);
   // unref write actions from storage
   StorageActionLmmPtr write_action;
   unsigned int i;
@@ -531,13 +567,13 @@ StorageActionPtr StorageLmm::close(surf_file_t fd)
     }
   }
   free(fd->name);
-  free(fd->storage);
+  free(fd->mount);
   xbt_free(fd);
   StorageActionLmmPtr action = new StorageActionLmm(p_model, 0, p_stateCurrent != SURF_RESOURCE_ON, this, CLOSE);
   return action;
 }
 
-StorageActionPtr StorageLmm::read(void* ptr, size_t size, surf_file_t fd)
+StorageActionPtr StorageLmm::read(surf_file_t fd, sg_storage_size_t size)
 {
   if(size > fd->size)
     size = fd->size;
@@ -545,10 +581,10 @@ StorageActionPtr StorageLmm::read(void* ptr, size_t size, surf_file_t fd)
   return action;
 }
 
-StorageActionPtr StorageLmm::write(const void* ptr, size_t size, surf_file_t fd)
+StorageActionPtr StorageLmm::write(surf_file_t fd, sg_storage_size_t size)
 {
   char *filename = fd->name;
-  XBT_DEBUG("\tWrite file '%s' size '%zu/%zu'",filename,size,fd->size);
+  XBT_DEBUG("\tWrite file '%s' size '%" PRIu64 "/%" PRIu64 "'",filename,size,fd->size);
 
   StorageActionLmmPtr action = new StorageActionLmm(p_model, size, p_stateCurrent != SURF_RESOURCE_ON, this, WRITE);
   action->p_file = fd;
@@ -560,13 +596,33 @@ StorageActionPtr StorageLmm::write(const void* ptr, size_t size, surf_file_t fd)
   return action;
 }
 
+xbt_dict_t StorageLmm::getContent()
+{
+  /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */
+  /*surf_action_t action = storage_action_execute(storage,0, LS);*/
+
+  xbt_dict_t content_dict = xbt_dict_new_homogeneous(NULL);
+  xbt_dict_cursor_t cursor = NULL;
+  char *file;
+  sg_storage_size_t *psize;
+
+  xbt_dict_foreach(p_content, cursor, file, psize){
+    xbt_dict_set(content_dict,file,psize,NULL);
+  }
+  return content_dict;
+}
+
+sg_storage_size_t StorageLmm::getSize(){
+  return m_size;
+}
+
 /**********
  * Action *
  **********/
 
 StorageActionLmm::StorageActionLmm(ModelPtr model, double cost, bool failed, StorageLmmPtr storage, e_surf_action_storage_type_t type)
   : Action(model, cost, failed), ActionLmm(model, cost, failed), StorageAction(model, cost, failed, storage, type) {
-  XBT_IN("(%s,%zu", storage->m_name, cost);
+  XBT_IN("(%s,%" PRIu64, storage->m_name, cost);
   p_variable = lmm_variable_new(p_model->p_maxminSystem, this, 1.0, -1.0 , 3);
 
   // Must be less than the max bandwidth for all actions
index 94ac7fd..cceebf5 100644 (file)
@@ -30,7 +30,8 @@ class StorageModel : public Model {
 public:
   StorageModel();
   ~StorageModel();
-  StoragePtr createResource(const char* id, const char* model, const char* type_id, const char* content_name);
+  StoragePtr createResource(const char* id, const char* model, const char* type_id,
+                  const char* content_name, const char* content_type, xbt_dict_t properties);
   double shareResources(double now);
   void updateActionsState(double now, double delta);
 
@@ -47,19 +48,23 @@ public:
   bool isUsed();
   void updateState(tmgr_trace_event_t event_type, double value, double date);
 
-  xbt_dict_t p_content; /* char * -> s_surf_file_t */
+  xbt_dict_t p_content;
+  char* p_contentType;
+  sg_storage_size_t m_size;
+  sg_storage_size_t m_usedSize;
+  char * p_typeId;
 
   virtual StorageActionPtr open(const char* mount, const char* path)=0;
   virtual StorageActionPtr close(surf_file_t fd)=0;
   //virtual StorageActionPtr unlink(surf_file_t fd)=0;
   virtual StorageActionPtr ls(const char *path)=0;
-  //virtual size_t getSize(surf_file_t fd);
-  virtual StorageActionPtr read(void* ptr, size_t size, surf_file_t fd)=0;//FIXME:why we have a useless param ptr ??
-  virtual StorageActionPtr write(const void* ptr, size_t size, surf_file_t fd)=0;//FIXME:why we have a useless param ptr ??
+  virtual StorageActionPtr read(surf_file_t fd, sg_storage_size_t size)=0;
+  virtual StorageActionPtr write(surf_file_t fd, sg_storage_size_t size)=0;
+  virtual xbt_dict_t getContent()=0;
+  virtual sg_storage_size_t getSize()=0;
+
   xbt_dict_t parseContent(char *filename);
 
-  size_t m_size;
-  size_t m_usedSize;
   xbt_dynar_t p_writeActions;
 };
 
@@ -67,15 +72,16 @@ class StorageLmm : public ResourceLmm, public Storage {
 public:
   StorageLmm(StorageModelPtr model, const char* name, xbt_dict_t properties,
                     lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
-                    char *content_name, size_t size);
+                    const char* type_id, char *content_name, char *content_type, size_t size);
 
   StorageActionPtr open(const char* mount, const char* path);
   StorageActionPtr close(surf_file_t fd);
   //StorageActionPtr unlink(surf_file_t fd);
   StorageActionPtr ls(const char *path);
-  //size_t getSize(surf_file_t fd);
-  StorageActionPtr read(void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ??
-  StorageActionPtr write(const void* ptr, size_t size, surf_file_t fd);//FIXME:why we have a useless param ptr ??
+  xbt_dict_t getContent();
+  sg_storage_size_t getSize();
+  StorageActionPtr read(surf_file_t fd, sg_storage_size_t size);//FIXME:why we have a useless param ptr ??
+  StorageActionPtr write(surf_file_t fd, sg_storage_size_t size);//FIXME:why we have a useless param ptr ??
 
   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
@@ -123,20 +129,21 @@ public:
 typedef struct s_storage_type {
   char *model;
   char *content;
+  char *content_type;
   char *type_id;
   xbt_dict_t properties;
-  size_t size;
+  sg_storage_size_t size;
 } s_storage_type_t, *storage_type_t;
 
 typedef struct s_mount {
-  void *id;
+  void *storage;
   char *name;
 } s_mount_t, *mount_t;
 
 typedef struct surf_file {
   char *name;
-  char *storage;
-  size_t size;
+  char *mount;
+  sg_storage_size_t size;
 } s_surf_file_t;
 
 
index dccf6f3..13b67f7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2013. The SimGrid Team.
+/* Copyright (c) 2009, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 typedef struct s_storage_type {
   char *model;
   char *content;
+  char *content_type;
   char *type_id;
   xbt_dict_t properties;
-  size_t size;
+  sg_storage_size_t size;
 } s_storage_type_t, *storage_type_t;
 
 typedef struct s_mount {
-  void *id;
+  void *storage;
   char *name;
 } s_mount_t, *mount_t;
 
 typedef struct surf_file {
   char *name;
-  char *storage;
-  size_t size;
+  char *mount;
+  sg_storage_size_t size;
 } s_surf_file_t;
 
+<<<<<<< HEAD
 typedef struct storage {
   //FIXME:s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interact with SURF */
+||||||| merged common ancestors
+typedef struct storage {
+  s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interact with SURF */
+=======
+typedef struct surf_storage {
+  s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interact with SURF */
+>>>>>>> 045db1657e870c721be490b411868f4181a12ced
   e_surf_resource_state_t state_current;        /*< STORAGE current state (ON or OFF) */
   lmm_constraint_t constraint;          /* Constraint for maximum bandwidth from connection */
   lmm_constraint_t constraint_write;    /* Constraint for maximum write bandwidth*/
   lmm_constraint_t constraint_read;     /* Constraint for maximum write bandwidth*/
-  xbt_dict_t content; /* char * -> s_surf_file_t */
-  size_t size;
-  size_t used_size;
+  xbt_dict_t content;
+  char* content_type;
+  sg_storage_size_t size;
+  sg_storage_size_t used_size;
+  char *type_id;
   xbt_dynar_t write_actions;
+  xbt_dict_t properties;
 } s_storage_t, *storage_t;
 
 typedef enum {
diff --git a/src/surf/surf.c b/src/surf/surf.c
new file mode 100644 (file)
index 0000000..de54e43
--- /dev/null
@@ -0,0 +1,683 @@
+/* Copyright (c) 2004-2013. 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 "surf_private.h"
+#include "xbt/module.h"
+#include "mc/mc.h"
+#include "simix/smx_host_private.h"
+#include "surf/surf_resource.h"
+#include "xbt/xbt_os_thread.h"
+#include "simgrid/sg_config.h"
+
+#include <ctype.h>
+
+XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
+                                "Logging specific to SURF (kernel)");
+
+/* Additional declarations for Windows portability. */
+
+#ifndef MAX_DRIVE
+#define MAX_DRIVE 26
+#endif
+
+#ifdef _XBT_WIN32
+#include <windows.h>
+static const char *disk_drives_letter_table[MAX_DRIVE] = {
+  "A:\\",
+  "B:\\",
+  "C:\\",
+  "D:\\",
+  "E:\\",
+  "F:\\",
+  "G:\\",
+  "H:\\",
+  "I:\\",
+  "J:\\",
+  "K:\\",
+  "L:\\",
+  "M:\\",
+  "N:\\",
+  "O:\\",
+  "P:\\",
+  "Q:\\",
+  "R:\\",
+  "S:\\",
+  "T:\\",
+  "U:\\",
+  "V:\\",
+  "W:\\",
+  "X:\\",
+  "Y:\\",
+  "Z:\\"
+};
+#endif                          /* #ifdef _XBT_WIN32 */
+
+/*
+ * Returns the initial path. On Windows the initial path is
+ * the current directory for the current process in the other
+ * case the function returns "./" that represents the current
+ * directory on Unix/Linux platforms.
+ */
+
+const char *__surf_get_initial_path(void)
+{
+
+#ifdef _XBT_WIN32
+  unsigned i;
+  char current_directory[MAX_PATH + 1] = { 0 };
+  unsigned int len = GetCurrentDirectory(MAX_PATH + 1, current_directory);
+  char root[4] = { 0 };
+
+  if (!len)
+    return NULL;
+
+  strncpy(root, current_directory, 3);
+
+  for (i = 0; i < MAX_DRIVE; i++) {
+    if (toupper(root[0]) == disk_drives_letter_table[i][0])
+      return disk_drives_letter_table[i];
+  }
+
+  return NULL;
+#else
+  return "./";
+#endif
+}
+
+/* The __surf_is_absolute_file_path() returns 1 if
+ * file_path is a absolute file path, in the other
+ * case the function returns 0.
+ */
+int __surf_is_absolute_file_path(const char *file_path)
+{
+#ifdef _XBT_WIN32
+  WIN32_FIND_DATA wfd = { 0 };
+  HANDLE hFile = FindFirstFile(file_path, &wfd);
+
+  if (INVALID_HANDLE_VALUE == hFile)
+    return 0;
+
+  FindClose(hFile);
+  return 1;
+#else
+  return (file_path[0] == '/');
+#endif
+}
+
+double NOW = 0;
+
+xbt_dynar_t model_list = NULL;
+tmgr_history_t history = NULL;
+lmm_system_t maxmin_system = NULL;
+xbt_dynar_t surf_path = NULL;
+xbt_dynar_t host_that_restart = NULL;
+xbt_dict_t watched_hosts_lib;
+
+/* Don't forget to update the option description in smx_config when you change this */
+s_surf_model_description_t surf_network_model_description[] = {
+  {"LV08",
+   "Realistic network analytic model (slow-start modeled by multiplying latency by 10.4, bandwidth by .92; bottleneck sharing uses a payload of S=8775 for evaluating RTT). ",
+   surf_network_model_init_LegrandVelho},
+  {"Constant",
+   "Simplistic network model where all communication take a constant time (one second). This model provides the lowest realism, but is (marginally) faster.",
+   surf_network_model_init_Constant},
+  {"SMPI",
+   "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
+   surf_network_model_init_SMPI},
+  {"CM02",
+   "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of small messages are thus poorly modeled).",
+   surf_network_model_init_CM02},
+#ifdef HAVE_GTNETS
+  {"GTNets",
+   "Network pseudo-model using the GTNets simulator instead of an analytic model",
+   surf_network_model_init_GTNETS},
+#endif
+#ifdef HAVE_NS3
+  {"NS3",
+   "Network pseudo-model using the NS3 tcp model instead of an analytic model",
+  surf_network_model_init_NS3},
+#endif
+  {"Reno",
+   "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
+   surf_network_model_init_Reno},
+  {"Reno2",
+   "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
+   surf_network_model_init_Reno2},
+  {"Vegas",
+   "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
+   surf_network_model_init_Vegas},
+  {NULL, NULL, NULL}      /* this array must be NULL terminated */
+};
+
+s_surf_model_description_t surf_cpu_model_description[] = {
+  {"Cas01",
+   "Simplistic CPU model (time=size/power).",
+   surf_cpu_model_init_Cas01},
+  {NULL, NULL,  NULL}      /* this array must be NULL terminated */
+};
+
+s_surf_model_description_t surf_workstation_model_description[] = {
+  {"default",
+   "Default workstation model. Currently, CPU:Cas01 and network:LV08 (with cross traffic enabled)",
+   surf_workstation_model_init_current_default},
+  {"compound",
+   "Workstation model that is automatically chosen if you change the network and CPU models",
+   surf_workstation_model_init_compound},
+  {"ptask_L07", "Workstation model somehow similar to Cas01+CM02 but allowing parallel tasks",
+   surf_workstation_model_init_ptask_L07},
+  {NULL, NULL, NULL}      /* this array must be NULL terminated */
+};
+
+s_surf_model_description_t surf_optimization_mode_description[] = {
+  {"Lazy",
+   "Lazy action management (partial invalidation in lmm + heap in action remaining).",
+   NULL},
+  {"TI",
+   "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU model for now).",
+    NULL},
+  {"Full",
+   "Full update of remaining and variables. Slow but may be useful when debugging.",
+   NULL},
+  {NULL, NULL, NULL}      /* this array must be NULL terminated */
+};
+
+s_surf_model_description_t surf_storage_model_description[] = {
+  {"default",
+   "Simplistic storage model.",
+   surf_storage_model_init_default},
+  {NULL, NULL,  NULL}      /* this array must be NULL terminated */
+};
+
+/* ********************************************************************* */
+/* TUTORIAL: New model                                                   */
+s_surf_model_description_t surf_new_model_description[] = {
+  {"default",
+   "Tutorial model.",
+   surf_new_model_init_default},
+  {NULL, NULL,  NULL}      /* this array must be NULL terminated */
+};
+/* ********************************************************************* */
+
+#ifdef CONTEXT_THREADS
+static xbt_parmap_t surf_parmap = NULL; /* parallel map on models */
+#endif
+
+static double *surf_mins = NULL; /* return value of share_resources for each model */
+static int surf_min_index;       /* current index in surf_mins */
+static double min;               /* duration determined by surf_solve */
+
+static void surf_share_resources(surf_model_t model);
+static void surf_update_actions_state(surf_model_t model);
+
+/** Displays the long description of all registered models, and quit */
+void model_help(const char *category, s_surf_model_description_t * table)
+{
+  int i;
+  printf("Long description of the %s models accepted by this simulator:\n",
+         category);
+  for (i = 0; table[i].name; i++)
+    printf("  %s: %s\n", table[i].name, table[i].description);
+}
+
+int find_model_description(s_surf_model_description_t * table,
+                           const char *name)
+{
+  int i;
+  char *name_list = NULL;
+
+  for (i = 0; table[i].name; i++)
+    if (!strcmp(name, table[i].name)) {
+      return i;
+    }
+  name_list = strdup(table[0].name);
+  for (i = 1; table[i].name; i++) {
+    name_list =
+        xbt_realloc(name_list,
+                    strlen(name_list) + strlen(table[i].name) + 3);
+    strcat(name_list, ", ");
+    strcat(name_list, table[i].name);
+  }
+  xbt_die("Model '%s' is invalid! Valid models are: %s.", name, name_list);
+  return -1;
+}
+
+double generic_maxmin_share_resources(xbt_swag_t running_actions,
+                                      size_t offset,
+                                      lmm_system_t sys,
+                                      void (*solve) (lmm_system_t))
+{
+  surf_action_t action = NULL;
+  double min = -1;
+  double value = -1;
+#define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + (offset))))
+
+  solve(sys);
+
+  xbt_swag_foreach(action, running_actions) {
+    value = lmm_variable_getvalue(VARIABLE(action));
+    if ((value > 0) || (action->max_duration >= 0))
+      break;
+  }
+
+  if (!action)
+    return -1.0;
+
+  if (value > 0) {
+    if (action->remains > 0)
+      min = action->remains / value;
+    else
+      min = 0.0;
+    if ((action->max_duration >= 0) && (action->max_duration < min))
+      min = action->max_duration;
+  } else
+    min = action->max_duration;
+
+
+  for (action = xbt_swag_getNext(action, running_actions->offset);
+       action;
+       action = xbt_swag_getNext(action, running_actions->offset)) {
+    value = lmm_variable_getvalue(VARIABLE(action));
+    if (value > 0) {
+      if (action->remains > 0)
+        value = action->remains / value;
+      else
+        value = 0.0;
+      if (value < min) {
+        min = value;
+        XBT_DEBUG("Updating min (value) with %p: %f", action, min);
+      }
+    }
+    if ((action->max_duration >= 0) && (action->max_duration < min)) {
+      min = action->max_duration;
+      XBT_DEBUG("Updating min (duration) with %p: %f", action, min);
+    }
+  }
+  XBT_DEBUG("min value : %f", min);
+
+#undef VARIABLE
+  return min;
+}
+
+double generic_share_resources_lazy(double now, surf_model_t model)
+{
+  surf_action_lmm_t action = NULL;
+  double min = -1;
+  double value;
+
+  XBT_DEBUG
+      ("Before share resources, the size of modified actions set is %d",
+       xbt_swag_size(model->model_private->modified_set));
+
+  lmm_solve(model->model_private->maxmin_system);
+
+  XBT_DEBUG
+      ("After share resources, The size of modified actions set is %d",
+       xbt_swag_size(model->model_private->modified_set));
+
+  while((action = xbt_swag_extract(model->model_private->modified_set))) {
+    int max_dur_flag = 0;
+
+    if (action->generic_action.state_set !=
+        model->states.running_action_set)
+      continue;
+
+    /* bogus priority, skip it */
+    if (action->generic_action.priority <= 0)
+      continue;
+
+    generic_update_action_remaining_lazy(action,now);
+
+    min = -1;
+    value = lmm_variable_getvalue(action->variable);
+    if (value > 0) {
+      if (action->generic_action.remains > 0) {
+        value = action->generic_action.remains / value;
+        min = now + value;
+      } else {
+        value = 0.0;
+        min = now;
+      }
+    }
+
+    if ((action->generic_action.max_duration != NO_MAX_DURATION)
+        && (min == -1
+            || action->generic_action.start +
+            action->generic_action.max_duration < min)) {
+      min = action->generic_action.start +
+          action->generic_action.max_duration;
+      max_dur_flag = 1;
+    }
+
+    XBT_DEBUG("Action(%p) Start %f Finish %f Max_duration %f", action,
+        action->generic_action.start, now + value,
+        action->generic_action.max_duration);
+
+    if (min != -1) {
+      surf_action_lmm_heap_remove(model->model_private->action_heap,action);
+      surf_action_lmm_heap_insert(model->model_private->action_heap,action, min, max_dur_flag ? MAX_DURATION : NORMAL);
+      XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min,
+                now);
+    } else DIE_IMPOSSIBLE;
+  }
+
+  //hereafter must have already the min value for this resource model
+  if (xbt_heap_size(model->model_private->action_heap) > 0)
+    min = xbt_heap_maxkey(model->model_private->action_heap) - now;
+  else
+    min = -1;
+
+  XBT_DEBUG("The minimum with the HEAP %f", min);
+
+  return min;
+}
+static XBT_INLINE void routing_asr_host_free(void *p)
+{
+  sg_routing_edge_t elm = p;
+  free(elm->name);
+  xbt_free(elm);
+}
+
+static XBT_INLINE void routing_asr_prop_free(void *p)
+{
+  xbt_dict_t elm = p;
+  xbt_dict_free(&elm);
+}
+
+void sg_version(int *ver_major,int *ver_minor,int *ver_patch) {
+  *ver_major = SIMGRID_VERSION_MAJOR;
+  *ver_minor = SIMGRID_VERSION_MINOR;
+  *ver_patch = SIMGRID_VERSION_PATCH;
+}
+
+void surf_init(int *argc, char **argv)
+{
+  XBT_DEBUG("Create all Libs");
+  host_lib = xbt_lib_new();
+  link_lib = xbt_lib_new();
+  as_router_lib = xbt_lib_new();
+  storage_lib = xbt_lib_new();
+  storage_type_lib = xbt_lib_new();
+  watched_hosts_lib = xbt_dict_new_homogeneous(NULL);
+
+  XBT_DEBUG("Add routing levels");
+  ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,routing_asr_host_free);
+  ROUTING_ASR_LEVEL  = xbt_lib_add_level(as_router_lib,routing_asr_host_free);
+  ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_prop_free);
+
+  XBT_DEBUG("Add SURF levels");
+  SURF_CPU_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
+  SURF_WKS_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
+  SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,surf_resource_free);
+
+  xbt_init(argc, argv);
+  if (!model_list)
+    model_list = xbt_dynar_new(sizeof(surf_model_private_t), NULL);
+  if (!history)
+    history = tmgr_history_new();
+
+#ifdef HAVE_TRACING
+  TRACE_add_start_function(TRACE_surf_alloc);
+  TRACE_add_end_function(TRACE_surf_release);
+#endif
+
+  sg_config_init(argc, argv);
+
+  surf_action_init();
+  if (MC_is_active())
+    MC_memory_init();
+}
+
+#ifdef _XBT_WIN32
+# define FILE_DELIM "\\"
+#else
+# define FILE_DELIM "/"         /* FIXME: move to better location */
+#endif
+
+FILE *surf_fopen(const char *name, const char *mode)
+{
+  unsigned int cpt;
+  char *path_elm = NULL;
+  char *buff;
+  FILE *file = NULL;
+
+  xbt_assert(name);
+
+  if (__surf_is_absolute_file_path(name))       /* don't mess with absolute file names */
+    return fopen(name, mode);
+
+  /* search relative files in the path */
+  xbt_dynar_foreach(surf_path, cpt, path_elm) {
+    buff = bprintf("%s" FILE_DELIM "%s", path_elm, name);
+    file = fopen(buff, mode);
+    free(buff);
+
+    if (file)
+      return file;
+  }
+  return NULL;
+}
+
+void surf_exit(void)
+{
+  unsigned int iter;
+  surf_model_t model = NULL;
+
+#ifdef HAVE_TRACING
+  TRACE_end();                  /* Just in case it was not called by the upper
+                                 * layer (or there is no upper layer) */
+#endif
+
+  sg_config_finalize();
+
+  xbt_dynar_foreach(model_list, iter, model)
+      model->model_private->finalize();
+  xbt_dynar_free(&model_list);
+  routing_exit();
+
+  if (maxmin_system) {
+    lmm_system_free(maxmin_system);
+    maxmin_system = NULL;
+  }
+  if (history) {
+    tmgr_history_free(history);
+    history = NULL;
+  }
+  surf_action_exit();
+
+#ifdef CONTEXT_THREADS
+  xbt_parmap_destroy(surf_parmap);
+  xbt_free(surf_mins);
+  surf_mins = NULL;
+#endif
+  xbt_dynar_free(&host_that_restart);
+  xbt_dynar_free(&surf_path);
+
+  xbt_lib_free(&host_lib);
+  xbt_lib_free(&link_lib);
+  xbt_lib_free(&as_router_lib);
+  xbt_lib_free(&storage_lib);
+  xbt_lib_free(&storage_type_lib);
+
+  xbt_dict_free(&watched_hosts_lib);
+
+  tmgr_finalize();
+  surf_parse_lex_destroy();
+  surf_parse_free_callbacks();
+
+  NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
+}
+
+void surf_presolve(void)
+{
+  double next_event_date = -1.0;
+  tmgr_trace_event_t event = NULL;
+  double value = -1.0;
+  surf_resource_t resource = NULL;
+  surf_model_t model = NULL;
+  unsigned int iter;
+
+  XBT_DEBUG
+      ("First Run! Let's \"purge\" events and put models in the right state");
+  while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
+    if (next_event_date > NOW)
+      break;
+    while ((event =
+            tmgr_history_get_next_event_leq(history, next_event_date,
+                                            &value,
+                                            (void **) &resource))) {
+      if (value >= 0){
+        resource->model->model_private->update_resource_state(resource,
+                                                              event, value,
+                                                              NOW);
+      }
+    }
+  }
+  xbt_dynar_foreach(model_list, iter, model)
+      model->model_private->update_actions_state(NOW, 0.0);
+}
+
+double surf_solve(double max_date)
+{
+  min = -1.0; /* duration */
+  double next_event_date = -1.0;
+  double model_next_action_end = -1.0;
+  double value = -1.0;
+  surf_resource_t resource = NULL;
+  surf_model_t model = NULL;
+  tmgr_trace_event_t event = NULL;
+  unsigned int iter;
+
+  if(!host_that_restart)
+    host_that_restart = xbt_dynar_new(sizeof(char*), NULL);
+
+  if (max_date != -1.0 && max_date != NOW) {
+    min = max_date - NOW;
+  }
+
+  XBT_DEBUG("Looking for next action end for all models except NS3");
+
+  if (surf_mins == NULL) {
+    surf_mins = xbt_new(double, xbt_dynar_length(model_list));
+  }
+  surf_min_index = 0;
+
+  /* sequential version */
+  xbt_dynar_foreach(model_list, iter, model) {
+    surf_share_resources(model);
+  }
+
+  unsigned i;
+  for (i = 0; i < xbt_dynar_length(model_list); i++) {
+    if ((min < 0.0 || surf_mins[i] < min)
+        && surf_mins[i] >= 0.0) {
+      min = surf_mins[i];
+    }
+  }
+
+  XBT_DEBUG("Min for resources (remember that NS3 don't update that value) : %f", min);
+
+  XBT_DEBUG("Looking for next trace event");
+
+  do {
+    XBT_DEBUG("Next TRACE event : %f", next_event_date);
+
+    next_event_date = tmgr_history_next_date(history);
+
+    if(surf_network_model->name && !strcmp(surf_network_model->name,"network NS3")){
+      if(next_event_date!=-1.0 && min!=-1.0) {
+        min = MIN(next_event_date - NOW, min);
+      } else{
+        min = MAX(next_event_date - NOW, min);
+      }
+
+      XBT_DEBUG("Run for network at most %f", min);
+      // run until min or next flow
+      model_next_action_end = surf_network_model->model_private->share_resources(min);
+
+      XBT_DEBUG("Min for network : %f", model_next_action_end);
+      if(model_next_action_end>=0.0)
+        min = model_next_action_end;
+    }
+
+    if (next_event_date < 0.0) {
+      XBT_DEBUG("no next TRACE event. Stop searching for it");
+      break;
+    }
+
+    if ((min == -1.0) || (next_event_date > NOW + min)) break;
+
+    XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)",min, NOW, next_event_date);
+    while ((event =
+            tmgr_history_get_next_event_leq(history, next_event_date,
+                                            &value,
+                                            (void **) &resource))) {
+      if (resource->model->model_private->resource_used(resource) ||
+          xbt_dict_get_or_null(watched_hosts_lib,resource->name)
+          ) {
+        min = next_event_date - NOW;
+        XBT_DEBUG
+            ("This event will modify model state. Next event set to %f",
+             min);
+      }
+      /* update state of model_obj according to new value. Does not touch lmm.
+         It will be modified if needed when updating actions */
+      XBT_DEBUG("Calling update_resource_state for resource %s with min %f",
+             resource->name, min);
+
+      resource->model->model_private->update_resource_state(resource,
+                                                            event, value,
+                                                            next_event_date);
+    }
+  } while (1);
+
+  /* FIXME: Moved this test to here to avoid stopping 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 */
+  if (min == -1.0) {
+  XBT_DEBUG("No next event at all. Bail out now.");
+    return -1.0;
+  }
+
+  XBT_DEBUG("Duration set to %f", min);
+
+  NOW = NOW + min;
+
+  /* sequential version */
+  xbt_dynar_foreach(model_list, iter, model) {
+    surf_update_actions_state(model);
+  }
+
+#ifdef HAVE_TRACING
+  TRACE_paje_dump_buffer (0);
+#endif
+
+  return min;
+}
+
+XBT_INLINE double surf_get_clock(void)
+{
+  return NOW;
+}
+
+static void surf_share_resources(surf_model_t model)
+{
+  double next_action_end = -1.0;
+  int i = __sync_fetch_and_add(&surf_min_index, 1);
+  if (strcmp(model->name,"network NS3")) {
+    XBT_DEBUG("Running for Resource [%s]", model->name);
+    next_action_end = model->model_private->share_resources(NOW);
+    XBT_DEBUG("Resource [%s] : next action end = %f",
+        model->name, next_action_end);
+  }
+  surf_mins[i] = next_action_end;
+}
+
+static void surf_update_actions_state(surf_model_t model)
+{
+  model->model_private->update_actions_state(NOW, min);
+}
+
index 41545d8..010de57 100644 (file)
@@ -51,7 +51,7 @@ static void remove_watched_host(void *key)
   xbt_dict_remove(watched_hosts_lib, *(char**)key);
 }
 
-void surf_watched_hosts(void)
+/*void surf_watched_hosts(void)
 {
   char *key;
   void *host;
@@ -71,13 +71,15 @@ void surf_watched_hosts(void)
   }
   xbt_dynar_map(hosts, remove_watched_host);
   xbt_dynar_free(&hosts);
-}
+}*/
 
 
 xbt_dynar_t model_list = NULL;
 tmgr_history_t history = NULL;
 lmm_system_t maxmin_system = NULL;
 xbt_dynar_t surf_path = NULL;
+xbt_dynar_t host_that_restart = NULL;
+xbt_dict_t watched_hosts_lib;
 
 /* Don't forget to update the option description in smx_config when you change this */
 s_surf_model_description_t surf_network_model_description[] = {
@@ -169,30 +171,6 @@ double surf_get_clock(void)
   return NOW;
 }
 
-/*TODO: keepit void surf_watched_hosts(void)
-{
-  char *key;
-  void *_host;
-  smx_host_t host;
-  xbt_dict_cursor_t cursor;
-  xbt_dynar_t hosts = xbt_dynar_new(sizeof(char*), NULL);
-
-  XBT_DEBUG("Check for host SURF_RESOURCE_ON on watched_hosts_lib");
-  xbt_dict_foreach(watched_hosts_lib,cursor,key,_host)
-  {
-    host = (smx_host_t) host;
-    if(SIMIX_host_get_state(host) == SURF_RESOURCE_ON){
-      XBT_INFO("Restart processes on host: %s",SIMIX_host_get_name(host));
-      SIMIX_host_autorestart(host);
-      xbt_dynar_push_as(hosts, char*, key);
-    }
-    else
-      XBT_DEBUG("See SURF_RESOURCE_OFF on host: %s",key);
-  }
-  xbt_dynar_map(hosts, remove_watched_host);
-  xbt_dynar_free(&hosts);
-}*/
-
 #ifdef _XBT_WIN32
 # define FILE_DELIM "\\"
 #else
@@ -346,7 +324,7 @@ void surf_init(int *argc, char **argv)
   as_router_lib = xbt_lib_new();
   storage_lib = xbt_lib_new();
   storage_type_lib = xbt_lib_new();
-  watched_hosts_lib = xbt_dict_new();
+  watched_hosts_lib = xbt_dict_new_homogeneous(NULL);
 
   XBT_DEBUG("Add routing levels");
   ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,routing_asr_host_free);
@@ -381,6 +359,11 @@ void surf_exit(void)
   unsigned int iter;
   ModelPtr model = NULL;
 
+#ifdef HAVE_TRACING
+  TRACE_end();                  /* Just in case it was not called by the upper
+                                 * layer (or there is no upper layer) */
+#endif
+
   sg_config_finalize();
 
   xbt_dynar_foreach(model_list, iter, model)
@@ -403,7 +386,7 @@ void surf_exit(void)
   xbt_free(surf_mins);
   surf_mins = NULL;
 #endif
-
+  xbt_dynar_free(&host_that_restart);
   xbt_dynar_free(&surf_path);
 
   xbt_lib_free(&host_lib);
@@ -1013,7 +996,7 @@ void ActionLmm::updateRemainingLazy(double now)
   delta = now - m_lastUpdate;
 
   if (m_remains > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %lf, last_update was: %lf", this, m_remains, m_lastUpdate);
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, m_remains, m_lastUpdate);
     double_update(&m_remains, m_lastValue * delta);
 
 #ifdef HAVE_TRACING
@@ -1022,7 +1005,7 @@ void ActionLmm::updateRemainingLazy(double now)
       TRACE_surf_host_set_utilization(cpu->m_name, p_category, m_lastValue, m_lastUpdate, now - m_lastUpdate);
     }
 #endif
-    XBT_DEBUG("Updating action(%p): remains is now %lf", this, m_remains);
+    XBT_DEBUG("Updating action(%p): remains is now %f", this, m_remains);
   }
 
   if(p_model == static_cast<ModelPtr>(surf_network_model))
index 862173d..874acdd 100644 (file)
@@ -50,7 +50,6 @@ extern xbt_dynar_t surf_path;
 extern "C" {
 #endif
 XBT_PUBLIC(double) surf_get_clock(void);
-XBT_PUBLIC(void) surf_watched_hosts(void);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/surf/surf_action.c b/src/surf/surf_action.c
new file mode 100644 (file)
index 0000000..86e752d
--- /dev/null
@@ -0,0 +1,597 @@
+/* Copyright (c) 2009-2013. 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 "surf_private.h"
+#include "network_private.h"
+#include "maxmin_private.h"
+#include "surf/datatypes.h"
+#include "cpu_cas01_private.h"
+#include "xbt/mallocator.h"
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_kernel);
+
+/*
+ * Generic action
+ */
+
+const char *surf_action_state_names[6] = {
+  "SURF_ACTION_READY",
+  "SURF_ACTION_RUNNING",
+  "SURF_ACTION_FAILED",
+  "SURF_ACTION_DONE",
+  "SURF_ACTION_TO_FREE",
+  "SURF_ACTION_NOT_IN_THE_SYSTEM"
+};
+
+/* Surf actions mallocator */
+static xbt_mallocator_t action_mallocator = NULL;
+static int action_mallocator_allocated_size = 0;
+static void* surf_action_mallocator_new_f(void);
+#define surf_action_mallocator_free_f xbt_free_f
+static void surf_action_mallocator_reset_f(void* action);
+
+/**
+ * \brief Initializes the action module of Surf.
+ */
+void surf_action_init(void) {
+
+  /* the action mallocator will always provide actions of the following size,
+   * so this size should be set to the maximum size of the surf action structures
+   */
+  action_mallocator_allocated_size = sizeof(s_surf_action_network_CM02_t);
+  action_mallocator = xbt_mallocator_new(65536, surf_action_mallocator_new_f,
+      surf_action_mallocator_free_f, surf_action_mallocator_reset_f);
+}
+
+/**
+ * \brief Uninitializes the action module of Surf.
+ */
+void surf_action_exit(void) {
+
+  xbt_mallocator_free(action_mallocator);
+}
+
+static void* surf_action_mallocator_new_f(void) {
+  return xbt_malloc(action_mallocator_allocated_size);
+}
+
+static void surf_action_mallocator_reset_f(void* action) {
+  memset(action, 0, action_mallocator_allocated_size);
+}
+
+void *surf_action_new(size_t size, double cost, surf_model_t model,
+                      int failed)
+{
+  xbt_assert(size <= action_mallocator_allocated_size,
+      "Cannot create a surf action of size %zu: the mallocator only provides actions of size %d",
+      size, action_mallocator_allocated_size);
+
+  surf_action_t action = xbt_mallocator_get(action_mallocator);
+  action->refcount = 1;
+  action->cost = cost;
+  action->remains = cost;
+  action->priority = 1.0;
+  action->max_duration = NO_MAX_DURATION;
+  action->start = surf_get_clock();
+  action->finish = -1.0;
+  action->model_type = model;
+#ifdef HAVE_TRACING
+  action->category = NULL;
+#endif
+
+  if (failed)
+    action->state_set = model->states.failed_action_set;
+  else
+    action->state_set = model->states.running_action_set;
+
+  xbt_swag_insert(action, action->state_set);
+
+  return action;
+}
+
+e_surf_action_state_t surf_action_state_get(surf_action_t action)
+{
+  surf_action_state_t action_state = &(action->model_type->states);
+
+  if (action->state_set == action_state->ready_action_set)
+    return SURF_ACTION_READY;
+  if (action->state_set == action_state->running_action_set)
+    return SURF_ACTION_RUNNING;
+  if (action->state_set == action_state->failed_action_set)
+    return SURF_ACTION_FAILED;
+  if (action->state_set == action_state->done_action_set)
+    return SURF_ACTION_DONE;
+  return SURF_ACTION_NOT_IN_THE_SYSTEM;
+}
+
+double surf_action_get_start_time(surf_action_t action)
+{
+  return action->start;
+}
+
+double surf_action_get_finish_time(surf_action_t action)
+{
+  /* keep the function behavior, some models (cpu_ti) change the finish time before the action end */
+  return action->remains == 0 ? action->finish : -1;
+}
+
+XBT_INLINE void surf_action_free(surf_action_t * action)
+{
+  xbt_mallocator_release(action_mallocator, *action);
+  *action = NULL;
+}
+
+void surf_action_state_set(surf_action_t action,
+                           e_surf_action_state_t state)
+{
+  surf_action_state_t action_state = &(action->model_type->states);
+  XBT_IN("(%p,%s)", action, surf_action_state_names[state]);
+  xbt_swag_remove(action, action->state_set);
+
+  if (state == SURF_ACTION_READY)
+    action->state_set = action_state->ready_action_set;
+  else if (state == SURF_ACTION_RUNNING)
+    action->state_set = action_state->running_action_set;
+  else if (state == SURF_ACTION_FAILED)
+    action->state_set = action_state->failed_action_set;
+  else if (state == SURF_ACTION_DONE)
+    action->state_set = action_state->done_action_set;
+  else
+    action->state_set = NULL;
+
+  if (action->state_set)
+    xbt_swag_insert(action, action->state_set);
+  XBT_OUT();
+}
+
+void surf_action_data_set(surf_action_t action, void *data)
+{
+  action->data = data;
+}
+
+XBT_INLINE void surf_action_ref(surf_action_t action)
+{
+  action->refcount++;
+}
+
+/*
+ * Maxmin action
+ */
+
+/* added to manage the communication action's heap */
+void surf_action_lmm_update_index_heap(void *action, int i) {
+  surf_action_lmm_t a = action;
+  a->index_heap = i;
+}
+/* insert action on heap using a given key and a hat (heap_action_type)
+ * a hat can be of three types for communications:
+ *
+ * NORMAL = this is a normal heap entry stating the date to finish transmitting
+ * LATENCY = this is a heap entry to warn us when the latency is payed
+ * MAX_DURATION =this is a heap entry to warn us when the max_duration limit is reached
+ */
+void surf_action_lmm_heap_insert(xbt_heap_t heap, surf_action_lmm_t action, double key,
+    enum heap_action_type hat)
+{
+  action->hat = hat;
+  xbt_heap_push(heap, action, key);
+}
+
+void surf_action_lmm_heap_remove(xbt_heap_t heap, surf_action_lmm_t action)
+{
+  action->hat = NOTSET;
+  if (action->index_heap >= 0) {
+    xbt_heap_remove(heap, action->index_heap);
+  }
+}
+
+void surf_action_cancel(surf_action_t action)
+{
+  surf_model_t model = action->model_type;
+  surf_action_state_set(action, SURF_ACTION_FAILED);
+  if (model->model_private->update_mechanism == UM_LAZY) {
+    xbt_swag_remove(action, model->model_private->modified_set);
+    surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+  }
+  return;
+}
+
+int surf_action_unref(surf_action_t action)
+{
+  surf_model_t model = action->model_type;
+  action->refcount--;
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+    if (((surf_action_lmm_t) action)->variable)
+      lmm_variable_free(model->model_private->maxmin_system,
+                        ((surf_action_lmm_t) action)->variable);
+    if (model->model_private->update_mechanism == UM_LAZY) {
+      /* remove from heap */
+      surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+      xbt_swag_remove(action, model->model_private->modified_set);
+    }
+#ifdef HAVE_TRACING
+    xbt_free(action->category);
+#endif
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+void surf_action_suspend(surf_action_t action)
+{
+  surf_model_t model = action->model_type;
+  XBT_IN("(%p)", action);
+  if (((surf_action_lmm_t) action)->suspended != 2) {
+    lmm_update_variable_weight(model->model_private->maxmin_system,
+                               ((surf_action_lmm_t) action)->variable,
+                               0.0);
+    ((surf_action_lmm_t) action)->suspended = 1;
+    if (model->model_private->update_mechanism == UM_LAZY)
+      surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+  }
+  XBT_OUT();
+}
+
+void surf_action_resume(surf_action_t action)
+{
+  surf_model_t model = action->model_type;
+  XBT_IN("(%p)", action);
+  if (((surf_action_lmm_t) action)->suspended != 2) {
+    lmm_update_variable_weight(model->model_private->maxmin_system,
+                               ((surf_action_lmm_t) action)->variable,
+                               action->priority);
+    ((surf_action_lmm_t) action)->suspended = 0;
+    if (model->model_private->update_mechanism == UM_LAZY)
+      surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+  }
+  XBT_OUT();
+}
+
+int surf_action_is_suspended(surf_action_t action)
+{
+  return (((surf_action_lmm_t) action)->suspended == 1);
+}
+
+void surf_action_set_max_duration(surf_action_t action, double duration)
+{
+  surf_model_t model = action->model_type;
+  XBT_IN("(%p,%g)", action, duration);
+  action->max_duration = duration;
+  if (model->model_private->update_mechanism == UM_LAZY)      // remove action from the heap
+    surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+  XBT_OUT();
+}
+
+void surf_action_set_priority(surf_action_t action, double priority)
+{
+  surf_model_t model = action->model_type;
+  XBT_IN("(%p,%g)", action, priority);
+  action->priority = priority;
+  lmm_update_variable_weight(model->model_private->maxmin_system,
+                             ((surf_action_lmm_t) action)->variable,
+                             priority);
+
+  if (model->model_private->update_mechanism == UM_LAZY)
+    surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+  XBT_OUT();
+}
+
+#ifdef HAVE_TRACING
+void surf_action_set_category(surf_action_t action,
+                                    const char *category)
+{
+  XBT_IN("(%p,%s)", action, category);
+  action->category = xbt_strdup(category);
+  XBT_OUT();
+}
+#endif
+
+void generic_update_action_remaining_lazy( surf_action_lmm_t action, double now)
+{
+  double delta = 0.0;
+  surf_model_t model = action->generic_action.model_type;
+
+  if(model == surf_network_model)
+  {
+    if (action->suspended != 0)
+      return;
+  }
+  else
+  {
+    xbt_assert(action->generic_action.state_set == model->states.running_action_set,
+        "You're updating an action that is not running.");
+
+      /* bogus priority, skip it */
+    xbt_assert(action->generic_action.priority > 0,
+        "You're updating an action that seems suspended.");
+  }
+
+  delta = now - action->last_update;
+
+  if (action->generic_action.remains > 0) {
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", action, action->generic_action.remains, action->last_update);
+    double_update(&(action->generic_action.remains),
+        action->last_value * delta);
+
+#ifdef HAVE_TRACING
+    if (model == surf_cpu_model && TRACE_is_enabled()) {
+      surf_resource_t cpu =
+          lmm_constraint_id(lmm_get_cnst_from_var
+              (model->model_private->maxmin_system,
+                  action->variable, 0));
+      TRACE_surf_host_set_utilization(cpu->name,
+          action->generic_action.category,
+          action->last_value,
+          action->last_update,
+          now - action->last_update);
+    }
+#endif
+    XBT_DEBUG("Updating action(%p): remains is now %f", action,
+        action->generic_action.remains);
+  }
+
+  if(model == surf_network_model)
+  {
+    if (((surf_action_t)action)->max_duration != NO_MAX_DURATION)
+      double_update(&(((surf_action_t)action)->max_duration), delta);
+
+    if ((((surf_action_t)action)->remains <= 0) &&
+        (lmm_get_variable_weight(action->variable) > 0)) {
+      ((surf_action_t)action)->finish = surf_get_clock();
+      model->action_state_set((surf_action_t) action,
+          SURF_ACTION_DONE);
+
+      surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+    } else if (((((surf_action_t)action)->max_duration != NO_MAX_DURATION)
+        && (((surf_action_t)action)->max_duration <= 0))) {
+      ((surf_action_t)action)->finish = surf_get_clock();
+      model->action_state_set((surf_action_t) action,
+          SURF_ACTION_DONE);
+      surf_action_lmm_heap_remove(model->model_private->action_heap,(surf_action_lmm_t)action);
+    }
+  }
+
+  action->last_update = now;
+  action->last_value = lmm_variable_getvalue(action->variable);
+}
+
+double surf_action_get_remains(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  surf_model_t model = action->model_type;
+  /* update remains before return it */
+  if (model->model_private->update_mechanism == UM_LAZY)      /* update remains before return it */
+    generic_update_action_remaining_lazy((surf_action_lmm_t)action, surf_get_clock());
+  XBT_OUT();
+  return action->remains;
+}
+
+/**
+ * Update the CPU total energy for a finished action
+ *
+ */
+void update_resource_energy(surf_model_t model, surf_action_lmm_t action)
+{
+    if(model == surf_cpu_model){
+        cpu_Cas01_t cpu_model = (cpu_Cas01_t)lmm_constraint_id(lmm_get_cnst_from_var
+                                                                                 (model->model_private->maxmin_system,
+                                                                                                 action->variable, 0));
+
+        if( cpu_model->energy->last_updated < surf_get_clock()) {
+               double load = lmm_constraint_get_usage(cpu_model->constraint) / cpu_model->power_peak;
+               cpu_update_energy(cpu_model, load);
+        }
+    }
+}
+
+
+
+
+void generic_update_actions_state_lazy(double now, double delta, surf_model_t model)
+{
+  surf_action_lmm_t action;
+  while ((xbt_heap_size(model->model_private->action_heap) > 0)
+         && (double_equals(xbt_heap_maxkey(model->model_private->action_heap), now))) {
+    action = xbt_heap_pop(model->model_private->action_heap);
+    XBT_DEBUG("Something happened to action %p", action);
+#ifdef HAVE_TRACING
+    if (TRACE_is_enabled()) {
+      if(model == surf_cpu_model){
+      surf_resource_t cpu =
+          lmm_constraint_id(lmm_get_cnst_from_var
+                            (model->model_private->maxmin_system,
+                             action->variable, 0));
+      TRACE_surf_host_set_utilization(cpu->name,
+                                      ((surf_action_t)action)->category,
+                                      lmm_variable_getvalue(action->variable),
+                                      action->last_update,
+                                      now - action->last_update);
+      }
+      else{
+        int n = lmm_get_number_of_cnst_from_var(model->model_private->maxmin_system, action->variable);
+        unsigned int i;
+        for (i = 0; i < n; i++){
+          lmm_constraint_t constraint = lmm_get_cnst_from_var(model->model_private->maxmin_system,
+                                                              action->variable,
+                                                              i);
+          link_CM02_t link = lmm_constraint_id(constraint);
+          TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
+                                          ((surf_action_t)action)->category,
+                                          (lmm_variable_getvalue(action->variable)*
+                                              lmm_get_cnst_weight_from_var(model->model_private->maxmin_system,
+                                                  action->variable,
+                                                  i)),
+                                          action->last_update,
+                                          now - action->last_update);
+        }
+      }
+    }
+#endif
+
+    if(model == surf_cpu_model){
+      action->generic_action.finish = surf_get_clock();
+
+      update_resource_energy(model, action);
+
+      /* set the remains to 0 due to precision problems when updating the remaining amount */
+      action->generic_action.remains = 0;
+      surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+      surf_action_lmm_heap_remove(model->model_private->action_heap,action); //FIXME: strange call since action was already popped
+    }
+    else{
+      // if I am wearing a latency hat
+      if (action->hat == LATENCY) {
+        XBT_DEBUG("Latency paid for action %p. Activating", action);
+        lmm_update_variable_weight(model->model_private->maxmin_system, action->variable,
+            ((surf_action_network_CM02_t)(action))->weight);
+        surf_action_lmm_heap_remove(model->model_private->action_heap,action);
+        action->last_update = surf_get_clock();
+
+        // if I am wearing a max_duration or normal hat
+      } else if (action->hat == MAX_DURATION ||
+          action->hat == NORMAL) {
+        // no need to communicate anymore
+        // assume that flows that reached max_duration have remaining of 0
+       action->generic_action.finish = surf_get_clock();
+       XBT_DEBUG("Action %p finished", action);
+       action->generic_action.remains = 0;
+        ((surf_action_t)action)->finish = surf_get_clock();
+        model->action_state_set((surf_action_t) action,
+                                             SURF_ACTION_DONE);
+        surf_action_lmm_heap_remove(model->model_private->action_heap,action);
+
+        if (model->gap_remove && model == surf_network_model)
+          model->gap_remove(action);
+      }
+    }
+  }
+#ifdef HAVE_TRACING
+  if (TRACE_is_enabled() && model == surf_cpu_model) {
+    //defining the last timestamp that we can safely dump to trace file
+    //without losing the event ascending order (considering all CPU's)
+    double smaller = -1;
+    xbt_swag_t running_actions = model->states.running_action_set;
+    xbt_swag_foreach(action, running_actions) {
+        if (smaller < 0) {
+          smaller = action->last_update;
+          continue;
+        }
+        if (action->last_update < smaller) {
+          smaller = action->last_update;
+        }
+    }
+    if (smaller > 0) {
+      TRACE_last_timestamp_to_dump = smaller;
+    }
+  }
+#endif
+  return;
+}
+
+void generic_update_actions_state_full(double now, double delta, surf_model_t model)
+{
+  surf_action_lmm_t action = NULL;
+  surf_action_lmm_t next_action = NULL;
+  xbt_swag_t running_actions = model->states.running_action_set;
+
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
+
+    if(model == surf_network_model)
+    {
+      double deltap = 0.0;
+      deltap = delta;
+      if (((surf_action_network_CM02_t)action)->latency > 0) {
+        if (((surf_action_network_CM02_t)action)->latency > deltap) {
+          double_update(&(((surf_action_network_CM02_t)action)->latency), deltap);
+          deltap = 0.0;
+        } else {
+          double_update(&(deltap), ((surf_action_network_CM02_t)action)->latency);
+          ((surf_action_network_CM02_t)action)->latency = 0.0;
+        }
+        if ((((surf_action_network_CM02_t)action)->latency == 0.0) && !(action->suspended))
+          lmm_update_variable_weight(model->model_private->maxmin_system, action->variable,
+              ((surf_action_network_CM02_t)action)->weight);
+      }
+  #ifdef HAVE_TRACING
+      if (TRACE_is_enabled()) {
+        int n = lmm_get_number_of_cnst_from_var(model->model_private->maxmin_system, action->variable);
+        unsigned int i;
+        for (i = 0; i < n; i++){
+          lmm_constraint_t constraint = lmm_get_cnst_from_var(model->model_private->maxmin_system,
+                                                              action->variable,
+                                                              i);
+          link_CM02_t link = lmm_constraint_id(constraint);
+          TRACE_surf_link_set_utilization(link->lmm_resource.generic_resource.name,
+                                          ((surf_action_t)action)->category,
+                                          (lmm_variable_getvalue(action->variable)*
+                                          lmm_get_cnst_weight_from_var(model->model_private->maxmin_system,
+                                              action->variable,
+                                              i)),
+                                          now - delta,
+                                          delta);
+        }
+      }
+  #endif
+      if (!lmm_get_number_of_cnst_from_var
+          (model->model_private->maxmin_system, action->variable)) {
+        /* There is actually no link used, hence an infinite bandwidth.
+         * This happens often when using models like vivaldi.
+         * In such case, just make sure that the action completes immediately.
+         */
+        double_update(&(action->generic_action.remains),
+                      action->generic_action.remains);
+      }
+    }
+    else
+    {
+#ifdef HAVE_TRACING
+      if (TRACE_is_enabled()) {
+        surf_resource_t x =
+            lmm_constraint_id(lmm_get_cnst_from_var
+                              (model->model_private->maxmin_system,
+                               action->variable, 0));
+
+        TRACE_surf_host_set_utilization(x->name,
+                                        ((surf_action_t)action)->category,
+                                        lmm_variable_getvalue(action->variable),
+                                        now - delta,
+                                        delta);
+        TRACE_last_timestamp_to_dump = now - delta;
+      }
+#endif
+    }
+
+    double_update(&(action->generic_action.remains),
+                  lmm_variable_getvalue(action->variable) * delta);
+
+
+    if (action->generic_action.max_duration != NO_MAX_DURATION)
+      double_update(&(action->generic_action.max_duration), delta);
+
+
+    if ((action->generic_action.remains <= 0) &&
+        (lmm_get_variable_weight(action->variable) > 0)) {
+      action->generic_action.finish = surf_get_clock();
+      surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+
+      if (model->gap_remove && model == surf_network_model)
+        model->gap_remove(action);
+    } else if ((action->generic_action.max_duration != NO_MAX_DURATION) &&
+               (action->generic_action.max_duration <= 0)) {
+      action->generic_action.finish = surf_get_clock();
+      surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+
+      if (model->gap_remove && model == surf_network_model)
+        model->gap_remove(action);
+    }
+
+    update_resource_energy(model, action);
+  }
+
+  return;
+}
index 44867ae..8718872 100644 (file)
@@ -87,6 +87,9 @@ double surf_solve(double max_date)
   tmgr_trace_event_t event = NULL;
   unsigned int iter;
 
+  if(!host_that_restart)
+    host_that_restart = xbt_dynar_new(sizeof(char*), NULL);
+
   if (max_date != -1.0 && max_date != NOW) {
     surf_min = max_date - NOW;
   }
@@ -148,7 +151,7 @@ double surf_solve(double max_date)
             tmgr_history_get_next_event_leq(history, next_event_date,
                                             &value,
                                             (void **) &resource))) {
-      if (resource->isUsed()) {
+      if (resource->isUsed() || xbt_dict_get_or_null(watched_hosts_lib, resource->m_name)) {
         surf_min = next_event_date - NOW;
         XBT_DEBUG
             ("This event will modify model state. Next event set to %f",
@@ -157,7 +160,7 @@ double surf_solve(double max_date)
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
       XBT_DEBUG("Calling update_resource_state for resource %s with min %lf",
-             resource->p_model->m_name.c_str(), surf_min);
+             resource->m_name, surf_min);
       resource->updateState(event, value, next_event_date);
     }
   } while (1);
@@ -282,6 +285,29 @@ surf_action_t surf_workstation_execute(surf_resource_t resource, double size){
   return get_casted_workstation(resource)->execute(size);
 }
 
+double surf_workstation_get_current_power_peak(surf_resource_t resource){
+  return get_casted_workstation(resource)->getCurrentPowerPeak();
+}
+
+double surf_workstation_get_power_peak_at(surf_resource_t resource, int pstate_index){
+  return get_casted_workstation(resource)->getPowerPeakAt(pstate_index);
+}
+
+int surf_workstation_get_nb_pstates(surf_resource_t resource){
+  return get_casted_workstation(resource)->getNbPstates();
+}
+
+void surf_workstation_set_power_peak_at(surf_resource_t resource, int pstate_index){
+  return get_casted_workstation(resource)->setPowerPeakAt(pstate_index);
+}
+
+double surf_workstation_get_consumed_energy(surf_resource_t resource){
+  return get_casted_workstation(resource)->getConsumedEnergy();
+}
+
+xbt_dict_t surf_workstation_get_storage_list(surf_resource_t workstation){
+  return get_casted_workstation(workstation)->getStorageList();
+}
 surf_action_t surf_workstation_open(surf_resource_t workstation, const char* mount, const char* path){
   return get_casted_workstation(workstation)->open(mount, path);
 }
@@ -302,12 +328,23 @@ size_t surf_workstation_get_size(surf_resource_t workstation, surf_file_t fd){
   return get_casted_workstation(workstation)->getSize(fd);
 }
 
-surf_action_t surf_workstation_read(surf_resource_t resource, void *ptr, size_t size, surf_file_t fd){
-  return get_casted_workstation(resource)->read(ptr, size, fd);
+surf_action_t surf_workstation_read(surf_resource_t resource, surf_file_t fd, sg_storage_size_t size){
+  return get_casted_workstation(resource)->read(fd, size);
+}
+
+surf_action_t surf_workstation_write(surf_resource_t resource, surf_file_t fd, sg_storage_size_t size){
+  return get_casted_workstation(resource)->write(fd, size);
+}
+
+xbt_dynar_t surf_workstation_get_info(surf_resource_t resource, surf_file_t fd){
+  return get_casted_workstation(resource)->getInfo(fd);
 }
 
-surf_action_t surf_workstation_write(surf_resource_t resource, const void *ptr, size_t size, surf_file_t fd){
-  return get_casted_workstation(resource)->write(ptr, size, fd);
+sg_storage_size_t surf_workstation_get_free_size(surf_resource_t resource, const char* name){
+  return get_casted_workstation(resource)->getFreeSize(name);
+}
+sg_storage_size_t surf_workstation_get_used_size(surf_resource_t resource, const char* name){
+  return get_casted_workstation(resource)->getUsedSize(name);
 }
 
 int surf_network_link_is_shared(surf_cpp_resource_t link){
@@ -322,6 +359,14 @@ double surf_network_link_get_latency(surf_cpp_resource_t link){
   return dynamic_cast<NetworkCm02LinkPtr>(link)->getLatency();
 }
 
+xbt_dict_t surf_storage_get_content(surf_resource_t resource){
+  return dynamic_cast<StoragePtr>(static_cast<ResourcePtr>(surf_storage_resource_priv(resource)))->getContent();
+}
+
+sg_storage_size_t surf_storage_get_size(surf_resource_t resource){
+  return dynamic_cast<StoragePtr>(static_cast<ResourcePtr>(surf_storage_resource_priv(resource)))->getSize();
+}
+
 surf_action_t surf_cpu_execute(surf_resource_t cpu, double size){
   return get_casted_cpu(cpu)->execute(size);
 }
diff --git a/src/surf/surf_model.c b/src/surf/surf_model.c
new file mode 100644 (file)
index 0000000..3cb98f1
--- /dev/null
@@ -0,0 +1,66 @@
+
+/* Copyright (c) 2009-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "surf_private.h"
+#include "xbt/dict.h"
+
+static void void_die_impossible_paction(surf_action_t action)
+{
+  DIE_IMPOSSIBLE;
+}
+
+static int int_die_impossible_paction(surf_action_t action)
+{
+  DIE_IMPOSSIBLE;
+  return -1;
+}
+
+/** @brief initialize common datastructures to all models */
+surf_model_t surf_model_init(void)
+{
+  s_surf_action_t action;
+  surf_model_t model = xbt_new0(s_surf_model_t, 1);
+
+  model->model_private = xbt_new0(s_surf_model_private_t, 1);
+
+  model->states.ready_action_set =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+  model->states.running_action_set =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+  model->states.failed_action_set =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+  model->states.done_action_set =
+      xbt_swag_new(xbt_swag_offset(action, state_hookup));
+
+  model->action_unref = int_die_impossible_paction;
+  model->action_cancel = void_die_impossible_paction;
+  model->action_recycle = void_die_impossible_paction;
+
+  model->action_state_get = surf_action_state_get;
+  model->action_state_set = surf_action_state_set;
+  model->action_get_start_time = surf_action_get_start_time;
+  model->action_get_finish_time = surf_action_get_finish_time;
+  model->action_data_set = surf_action_data_set;
+
+  model->model_private->modified_set = NULL;
+  model->model_private->action_heap = NULL;
+  model->model_private->update_mechanism = UM_UNDEFINED;
+  model->model_private->selective_update = 0;
+
+  return model;
+}
+
+/** @brief finalize common datastructures to all models */
+void surf_model_exit(surf_model_t model)
+{
+  xbt_swag_free(model->states.ready_action_set);
+  xbt_swag_free(model->states.running_action_set);
+  xbt_swag_free(model->states.failed_action_set);
+  xbt_swag_free(model->states.done_action_set);
+  free(model->model_private);
+  free(model);
+}
index 2153f8c..9f60ac9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -84,6 +84,7 @@ void surf_action_set_category(surf_action_t action,
                                     const char *category);
 #endif
 double surf_action_get_remains(surf_action_t action);
+void update_resource_energy(surf_model_t model, surf_action_lmm_t action);
 void generic_update_action_remaining_lazy( surf_action_lmm_t action, double now);
 void generic_update_actions_state_lazy(double now, double delta, surf_model_t model);
 void generic_update_actions_state_full(double now, double delta, surf_model_t model);
index a3a53c4..d667710 100644 (file)
@@ -1,7 +1,16 @@
+/* Copyright (c) 2009, 2010, 2011. 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 "surf_routing.hpp"
 #include "surf_routing_private.hpp"
+
+#include "simgrid/platf_interface.h"    // platform creation API internal interface
+#include "simgrid/sg_config.h"
+
 #include "surf/surfxml_parse_values.h"
-#include "surf/random_mgr.h"
 
 /**
  * @ingroup SURF_build_api
@@ -12,14 +21,15 @@ xbt_lib_t host_lib;
 int ROUTING_HOST_LEVEL;         //Routing level
 int SURF_CPU_LEVEL;             //Surf cpu level
 int SURF_WKS_LEVEL;             //Surf workstation level
-int SIMIX_HOST_LEVEL;           //Simix level
-int MSG_HOST_LEVEL;             //Msg level
-int SD_HOST_LEVEL;              //Simdag level
+int SIMIX_HOST_LEVEL;           //Simix host level
+int SIMIX_STORAGE_LEVEL;        //Simix storage level
+int MSG_HOST_LEVEL;             //Msg host level
+int MSG_STORAGE_LEVEL;          //Msg storage level
+int SD_HOST_LEVEL;              //Simdag host level
+int SD_STORAGE_LEVEL;           //Simdag storage level
 int COORD_HOST_LEVEL=0;         //Coordinates level
 int NS3_HOST_LEVEL;             //host node for ns3
 
-xbt_dict_t watched_hosts_lib;
-
 /**
  * @ingroup SURF_build_api
  * @brief A library containing all known links
@@ -312,8 +322,6 @@ static void routing_parse_trace_connect(sg_platf_trace_connect_cbarg_t trace_con
   }
 }
 
-extern int _sg_init_status; /* yay, this is an horrible hack */
-
 /**
  * \brief Make a new routing component to the platform
  *
@@ -336,7 +344,9 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS)
              (as_router_lib, AS->id, ROUTING_ASR_LEVEL),
              "The AS \"%s\" already exists", AS->id);
 
-  _sg_init_status = 2; /* horrible hack: direct access to the global controlling the level of configuration to prevent any further config */
+  _sg_cfg_init_status = 2; /* horrible hack: direct access to the global
+                            * controlling the level of configuration to prevent
+                            * any further config */
 
   /* search the routing model */
   switch(AS->routing){
@@ -744,7 +754,7 @@ static void routing_parse_cabinet(sg_platf_cabinet_cbarg_t cabinet)
     s_sg_platf_host_cbarg_t host;
     memset(&host, 0, sizeof(host));
     host.initial_state = SURF_RESOURCE_ON;
-    host.power_peak = cabinet->power;
+    host.pstate = 0;
     host.power_scale = 1.0;
     host.core_amount = 1;
 
@@ -763,6 +773,9 @@ static void routing_parse_cabinet(sg_platf_cabinet_cbarg_t cabinet)
       link_id = bprintf("link_%s%d%s",cabinet->prefix,i,cabinet->suffix);
       host.id = host_id;
       link.id = link_id;
+      xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL);
+      xbt_dynar_push(power_state_list,&cabinet->power);
+      host.power_peak = power_state_list;
       sg_platf_new_host(&host);
       sg_platf_new_link(&link);
 
@@ -860,7 +873,12 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster)
         XBT_DEBUG("\tstate_file=\"\"");
       }
 
-      host.power_peak = cluster->power;
+      xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL);
+      xbt_dynar_push(power_state_list,&cluster->power);
+      host.power_peak = power_state_list;
+      host.pstate = 0;
+
+      //host.power_peak = cluster->power;
       host.power_scale = 1.0;
       host.core_amount = cluster->core_amount;
       host.initial_state = SURF_RESOURCE_ON;
@@ -994,23 +1012,37 @@ static void routing_parse_postparse(void) {
 static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
 {
   char *host_id = NULL;
-  char *link_id;
+  char *link_id = NULL;
+  char *router_id = NULL;
 
   XBT_DEBUG(" ");
   host_id = HOST_PEER(peer->id);
   link_id = LINK_PEER(peer->id);
+  router_id = ROUTER_PEER(peer->id);
+
+  XBT_DEBUG("<AS id=\"%s\"\trouting=\"Cluster\">", peer->id);
+  s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER;
+  AS.id = peer->id;
+  AS.routing = A_surfxml_AS_routing_Cluster;
+  sg_platf_new_AS_begin(&AS);
+
+  current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
 
   XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
   s_sg_platf_host_cbarg_t host;
   memset(&host, 0, sizeof(host));
   host.initial_state = SURF_RESOURCE_ON;
   host.id = host_id;
-  host.power_peak = peer->power;
+
+  xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL);
+  xbt_dynar_push(power_state_list,&peer->power);
+  host.power_peak = power_state_list;
+  host.pstate = 0;
+  //host.power_peak = peer->power;
   host.power_scale = 1.0;
   host.power_trace = peer->availability_trace;
   host.state_trace = peer->state_trace;
   host.core_amount = 1;
-  host.coord = peer->coord;
   sg_platf_new_host(&host);
 
   s_sg_platf_link_cbarg_t link;
@@ -1041,9 +1073,20 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
   host_link.link_down= link_down;
   sg_platf_new_host_link(&host_link);
 
+  XBT_DEBUG("<router id=\"%s\"/>", router_id);
+  s_sg_platf_router_cbarg_t router;
+  memset(&router, 0, sizeof(router));
+  router.id = router_id;
+  router.coord = peer->coord;
+  sg_platf_new_router(&router);
+  static_cast<AsClusterPtr>(current_routing)->p_router = static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
+
+  XBT_DEBUG("</AS>");
+  sg_platf_new_AS_end();
   XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
+  free(router_id);
   free(host_id);
   free(link_id);
   free(link_up);
diff --git a/src/surf/surf_routing_cluster.c b/src/surf/surf_routing_cluster.c
new file mode 100644 (file)
index 0000000..4e17552
--- /dev/null
@@ -0,0 +1,174 @@
+/* Copyright (c) 2009-2013. 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 "surf_routing_private.h"
+#include "xbt/graph.h"
+
+/* Global vars */
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
+
+/* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
+ * Note that a router is created, easing the interconnexion with the rest of the world.
+ */
+
+/* Business methods */
+static void cluster_get_route_and_latency(AS_t as,
+                                          sg_routing_edge_t src,
+                                          sg_routing_edge_t dst,
+                                          sg_platf_route_cbarg_t route,
+                                          double *lat)
+{
+
+  s_surf_parsing_link_up_down_t info;
+  XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
+            src->name, src->id, dst->name, dst->id);
+
+  if (src->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {    // No specific link for router
+    info =
+        xbt_dynar_get_as(as->link_up_down_list, src->id,
+                         s_surf_parsing_link_up_down_t);
+                         
+    if((src->id == dst->id) && info.loopback_link  ){
+      xbt_dynar_push_as(route->link_list, void *, info.loopback_link);
+      if (lat)
+        *lat +=
+            surf_network_model->extension.network.get_link_latency(info.
+                                                                   loopback_link);
+      return;
+    }
+                         
+                         
+    if (info.limiter_link)          // limiter for sender
+      xbt_dynar_push_as(route->link_list, void *, info.limiter_link);
+    
+    if (info.link_up) {         // link up
+      xbt_dynar_push_as(route->link_list, void *, info.link_up);
+      if (lat)
+        *lat +=
+            surf_network_model->extension.network.get_link_latency(info.
+                                                                   link_up);
+    }
+  }
+
+  if (((as_cluster_t) as)->backbone) {
+    xbt_dynar_push_as(route->link_list, void *, ((as_cluster_t) as)->backbone);
+    if (lat)
+      *lat +=
+          surf_network_model->extension.network.
+          get_link_latency(((as_cluster_t) as)->backbone);
+  }
+
+  if (dst->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {    // No specific link for router
+    info =
+        xbt_dynar_get_as(as->link_up_down_list, dst->id,
+                         s_surf_parsing_link_up_down_t);
+    if (info.link_down) {       // link down
+      xbt_dynar_push_as(route->link_list, void *, info.link_down);
+      if (lat)
+        *lat +=
+            surf_network_model->extension.network.get_link_latency(info.
+                                                                   link_down);
+    }
+    
+    if (info.limiter_link)          // limiter for receiver
+      xbt_dynar_push_as(route->link_list, void *, info.limiter_link);
+    
+  }
+}
+
+static void cluster_get_graph(xbt_graph_t graph, xbt_dict_t nodes,
+                              xbt_dict_t edges, AS_t rc)
+{
+  int isrc;
+  int table_size = xbt_dynar_length(rc->index_network_elm);
+
+  sg_routing_edge_t src;
+  xbt_node_t current, previous, backboneNode = NULL, routerNode;
+  s_surf_parsing_link_up_down_t info;
+
+  xbt_assert(((as_cluster_t) rc)->router,"Malformed cluster");
+
+  /* create the router */
+  char *link_name =
+    ((sg_routing_edge_t) ((as_cluster_t) rc)->router)->name;
+  routerNode = new_xbt_graph_node(graph, link_name, nodes);
+
+  if(((as_cluster_t) rc)->backbone) {
+    char *link_nameR =
+      ((surf_resource_t) ((as_cluster_t) rc)->backbone)->name;
+    backboneNode = new_xbt_graph_node(graph, link_nameR, nodes);
+
+    new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
+  }
+
+  for (isrc = 0; isrc < table_size; isrc++) {
+    src = xbt_dynar_get_as(rc->index_network_elm, isrc, sg_routing_edge_t);
+
+    if (src->rc_type != SURF_NETWORK_ELEMENT_ROUTER) {
+      previous = new_xbt_graph_node(graph, src->name, nodes);
+
+      info = xbt_dynar_get_as(rc->link_up_down_list, src->id,
+                              s_surf_parsing_link_up_down_t);
+
+      if (info.link_up) {     // link up
+
+        char *link_name = ((surf_resource_t) info.link_up)->name;
+        current = new_xbt_graph_node(graph, link_name, nodes);
+        new_xbt_graph_edge(graph, previous, current, edges);
+
+        if (((as_cluster_t) rc)->backbone) {
+          new_xbt_graph_edge(graph, current, backboneNode, edges);
+        } else {
+          new_xbt_graph_edge(graph, current, routerNode, edges);
+        }
+
+      }
+
+      if (info.link_down) {    // link down
+        char *link_name = ((surf_resource_t) info.link_down)->name;
+        current = new_xbt_graph_node(graph, link_name, nodes);
+        new_xbt_graph_edge(graph, previous, current, edges);
+
+        if (((as_cluster_t) rc)->backbone) {
+          new_xbt_graph_edge(graph, current, backboneNode, edges);
+        } else {
+          new_xbt_graph_edge(graph, current, routerNode, edges);
+        }
+      }
+    }
+
+  }
+}
+
+static void model_cluster_finalize(AS_t as)
+{
+  model_none_finalize(as);
+}
+
+static int cluster_parse_PU(AS_t rc, sg_routing_edge_t elm) {
+  XBT_DEBUG("Load process unit \"%s\"", elm->name);
+  xbt_dynar_push_as(rc->index_network_elm,sg_routing_edge_t,elm);
+  return xbt_dynar_length(rc->index_network_elm)-1;
+}
+
+static int cluster_parse_AS(AS_t rc, sg_routing_edge_t elm) {
+  XBT_DEBUG("Load Autonomous system \"%s\"", elm->name);
+  xbt_dynar_push_as(rc->index_network_elm,sg_routing_edge_t,elm);
+  return xbt_dynar_length(rc->index_network_elm)-1;
+}
+
+/* Creation routing model functions */
+AS_t model_cluster_create(void)
+{
+  AS_t result = model_none_create_sized(sizeof(s_as_cluster_t));
+  result->get_route_and_latency = cluster_get_route_and_latency;
+  result->finalize = model_cluster_finalize;
+  result->get_graph = cluster_get_graph;
+  result->parse_AS = cluster_parse_AS;
+  result->parse_PU = cluster_parse_PU;
+
+  return (AS_t) result;
+}
index d748a0f..a90140b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 1cfc5c0..16c2565 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2009-2013. 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 "surf_routing_private.h"
 #include "surf_routing_floyd.hpp"
 #include "network.hpp"
index 21338ff..f0767dc 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2009-2013. 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 "surf_routing_private.h"
 #include "surf_routing_full.hpp"
 #include "network.hpp"
index 42dbfc2..d78421c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/src/surf/surf_routing_none.c b/src/surf/surf_routing_none.c
new file mode 100644 (file)
index 0000000..1887c32
--- /dev/null
@@ -0,0 +1,74 @@
+/* Copyright (c) 2009-2013. 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 "surf_routing_private.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf");
+
+static xbt_dynar_t none_get_onelink_routes(AS_t rc) {
+  return NULL;
+}
+
+static void none_get_route_and_latency(AS_t rc, sg_routing_edge_t src, sg_routing_edge_t dst,
+    sg_platf_route_cbarg_t res,double *lat)
+{
+  *lat = 0.0;
+}
+
+static void none_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc)
+{
+       XBT_INFO("No routing no graph");
+}
+
+static sg_platf_route_cbarg_t none_get_bypass_route(AS_t rc,
+    sg_routing_edge_t src,
+    sg_routing_edge_t dst, double *lat) {
+  return NULL;
+}
+
+static int none_parse_PU(AS_t rc, sg_routing_edge_t elm) {
+  XBT_DEBUG("Load process unit \"%s\"", elm->name);
+  xbt_dynar_push_as(rc->index_network_elm,sg_routing_edge_t,elm);
+  /* don't care about PUs */
+  return -1;
+}
+
+static int none_parse_AS(AS_t rc, sg_routing_edge_t elm) {
+  XBT_DEBUG("Load Autonomous system \"%s\"", elm->name);
+  xbt_dynar_push_as(rc->index_network_elm,sg_routing_edge_t,elm);
+  /* even don't care about sub-ASes -- I'm as nihilist as an old punk*/
+  return -1;
+}
+
+/* Creation routing model functions */
+AS_t model_none_create() {
+  return model_none_create_sized(sizeof(s_as_t));
+}
+AS_t model_none_create_sized(size_t childsize) {
+  AS_t new_component = xbt_malloc0(childsize);
+  new_component->parse_PU = none_parse_PU;
+  new_component->parse_AS = none_parse_AS;
+  new_component->parse_route = NULL;
+  new_component->parse_ASroute = NULL;
+  new_component->parse_bypassroute = NULL;
+  new_component->get_route_and_latency = none_get_route_and_latency;
+  new_component->get_onelink_routes = none_get_onelink_routes;
+  new_component->get_bypass_route = none_get_bypass_route;
+  new_component->finalize = model_none_finalize;
+  new_component->get_graph = none_get_graph;
+  new_component->routing_sons = xbt_dict_new_homogeneous(NULL);
+  new_component->index_network_elm = xbt_dynar_new(sizeof(char*),NULL);
+
+  return new_component;
+}
+
+void model_none_finalize(AS_t as) {
+  xbt_dict_free(&as->routing_sons);
+  xbt_dynar_free(&as->index_network_elm);
+  xbt_dynar_free(&as->link_up_down_list);
+  xbt_free(as);
+}
+
index 7673961..18c6753 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/src/surf/surf_routing_vivaldi.c b/src/surf/surf_routing_vivaldi.c
new file mode 100644 (file)
index 0000000..2a925fc
--- /dev/null
@@ -0,0 +1,117 @@
+/* Copyright (c) 2009-2013. 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 "surf_routing_private.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_vivaldi, surf, "Routing part of surf");
+
+static XBT_INLINE double euclidean_dist_comp(int index, xbt_dynar_t src, xbt_dynar_t dst) {
+  double src_coord, dst_coord;
+
+  src_coord = xbt_dynar_get_as(src, index, double);
+  dst_coord = xbt_dynar_get_as(dst, index, double);
+
+  return (src_coord-dst_coord)*(src_coord-dst_coord);
+}
+
+static void vivaldi_get_route_and_latency(
+    AS_t rc, sg_routing_edge_t src_p, sg_routing_edge_t dst_p,
+    sg_platf_route_cbarg_t route, double *lat)
+{
+  s_surf_parsing_link_up_down_t info;
+
+  XBT_DEBUG("vivaldi_get_route_and_latency from '%s'[%d] '%s'[%d]",src_p->name,src_p->id,dst_p->name,dst_p->id);
+  char *src = (char*)src_p->name;
+  char *dst = (char*)dst_p->name;
+
+  if(src_p->rc_type == SURF_NETWORK_ELEMENT_AS) {
+    char *rp_src = ROUTER_PEER(src);
+    char *rp_dst = ROUTER_PEER(dst);
+    route->gw_src = xbt_lib_get_or_null(as_router_lib, rp_src,
+                                        ROUTING_ASR_LEVEL);
+    route->gw_dst = xbt_lib_get_or_null(as_router_lib, rp_dst,
+                                        ROUTING_ASR_LEVEL);
+    xbt_free(rp_src);
+    xbt_free(rp_dst);
+  }
+
+  double euclidean_dist;
+  xbt_dynar_t src_ctn, dst_ctn;
+  char *tmp_src_name, *tmp_dst_name;
+
+  if(src_p->rc_type == SURF_NETWORK_ELEMENT_HOST){
+    tmp_src_name = HOST_PEER(src);
+
+    if(rc->link_up_down_list){
+      info = xbt_dynar_get_as(rc->link_up_down_list,src_p->id,s_surf_parsing_link_up_down_t);
+      if(info.link_up) { // link up
+        xbt_dynar_push_as(route->link_list,void*,info.link_up);
+        if (lat)
+          *lat += surf_network_model->extension.network.get_link_latency(info.link_up);
+      }
+    }
+    src_ctn = xbt_lib_get_or_null(host_lib, tmp_src_name, COORD_HOST_LEVEL);
+    if(!src_ctn ) src_ctn = xbt_lib_get_or_null(host_lib, src, COORD_HOST_LEVEL);
+  }
+  else if(src_p->rc_type == SURF_NETWORK_ELEMENT_ROUTER || src_p->rc_type == SURF_NETWORK_ELEMENT_AS){
+    tmp_src_name = ROUTER_PEER(src);
+    src_ctn = xbt_lib_get_or_null(as_router_lib, tmp_src_name, COORD_ASR_LEVEL);
+  }
+  else{
+    THROW_IMPOSSIBLE;
+  }
+
+  if(dst_p->rc_type == SURF_NETWORK_ELEMENT_HOST){
+    tmp_dst_name = HOST_PEER(dst);
+
+    if(rc->link_up_down_list){
+      info = xbt_dynar_get_as(rc->link_up_down_list,dst_p->id,s_surf_parsing_link_up_down_t);
+      if(info.link_down) { // link down
+        xbt_dynar_push_as(route->link_list,void*,info.link_down);
+        if (lat)
+          *lat += surf_network_model->extension.network.get_link_latency(info.link_down);
+      }
+    }
+    dst_ctn = xbt_lib_get_or_null(host_lib, tmp_dst_name, COORD_HOST_LEVEL);
+    if(!dst_ctn ) dst_ctn = xbt_lib_get_or_null(host_lib, dst, COORD_HOST_LEVEL);
+  }
+  else if(dst_p->rc_type == SURF_NETWORK_ELEMENT_ROUTER || dst_p->rc_type == SURF_NETWORK_ELEMENT_AS){
+    tmp_dst_name = ROUTER_PEER(dst);
+    dst_ctn = xbt_lib_get_or_null(as_router_lib, tmp_dst_name, COORD_ASR_LEVEL);
+  }
+  else{
+    THROW_IMPOSSIBLE;
+  }
+
+  xbt_assert(src_ctn,"No coordinate found for element '%s'",tmp_src_name);
+  xbt_assert(dst_ctn,"No coordinate found for element '%s'",tmp_dst_name);
+  free(tmp_src_name);
+  free(tmp_dst_name);
+
+  euclidean_dist = sqrt (euclidean_dist_comp(0,src_ctn,dst_ctn)+euclidean_dist_comp(1,src_ctn,dst_ctn))
+                      + fabs(xbt_dynar_get_as(src_ctn, 2, double))+fabs(xbt_dynar_get_as(dst_ctn, 2, double));
+
+  if (lat){
+    XBT_DEBUG("Updating latency %f += %f",*lat,euclidean_dist);
+    *lat += euclidean_dist / 1000.0; //From .ms to .s
+  }
+}
+
+static int vivaldi_parse_PU(AS_t rc, sg_routing_edge_t elm) {
+  XBT_DEBUG("Load process unit \"%s\"", elm->name);
+  xbt_dynar_push_as(rc->index_network_elm,sg_routing_edge_t,elm);
+  return xbt_dynar_length(rc->index_network_elm)-1;
+}
+
+/* Creation routing model functions */
+AS_t model_vivaldi_create(void)
+{
+  AS_t new_component = model_generic_create_sized(sizeof *new_component);
+  
+  new_component->get_route_and_latency = vivaldi_get_route_and_latency;
+  new_component->parse_PU = vivaldi_parse_PU;
+  new_component->get_graph = generic_get_graph;
+  return new_component;
+}
index ba782bb..2013d9a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -34,9 +34,12 @@ extern AS_t current_routing;
 void surf_parse_error(const char *fmt, ...) {
   va_list va;
   va_start(va,fmt);
+  int lineno = surf_parse_lineno;
   char *msg = bvprintf(fmt,va);
   va_end(va);
-  xbt_die("Parse error at %s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg);
+  cleanup();
+  surf_exit();
+  xbt_die("Parse error at %s:%d: %s", surf_parsed_filename, lineno, msg);
 }
 void surf_parse_warn(const char *fmt, ...) {
   va_list va;
@@ -52,7 +55,7 @@ double surf_parse_get_double(const char *string) {
   int ret = sscanf(string, "%lg", &res);
   if (ret != 1)
     surf_parse_error("%s is not a double", string);
-  //printf("Parsed double [%lg] %s\n", res, string);  
+  //printf("Parsed double [%g] %s\n", res, string);
   return res;
 }
 
@@ -110,6 +113,33 @@ double surf_parse_get_time(const char *string)
   return surf_parse_get_value_with_unit(string, units);
 }
 
+double surf_parse_get_size(const char *string)
+{
+  const struct unit_scale units[] = {
+    { "TiB", pow(1024, 4) },
+    { "GiB", pow(1024, 3) },
+    { "MiB", pow(1024, 2) },
+    { "KiB", 1024 },
+    { "TB",  1e12 },
+    { "GB",  1e9 },
+    { "MB",  1e6 },
+    { "kB",  1e3 },
+    { "B",   1.0 },
+    { "",      1.0 },           /* default unit is bytes*/
+    { "Tib", 0.125 * pow(1024, 4) },
+    { "Gib", 0.125 * pow(1024, 3) },
+    { "Mib", 0.125 * pow(1024, 2) },
+    { "Kib", 0.125 * 1024 },
+    { "Tb",  0.125 * 1e12 },
+    { "Gb",  0.125 * 1e9 },
+    { "Mb",  0.125 * 1e6 },
+    { "kb",  0.125 * 1e3 },
+    { "b",   0.125 },
+    { NULL,    0 }
+  };
+  return surf_parse_get_value_with_unit(string, units);
+}
+
 double surf_parse_get_bandwidth(const char *string)
 {
   const struct unit_scale units[] = {
@@ -206,6 +236,7 @@ void ETag_surfxml_storage(void)
   storage.id = A_surfxml_storage_id;
   storage.type_id = A_surfxml_storage_typeId;
   storage.content = A_surfxml_storage_content;
+  storage.content_type = A_surfxml_storage_content___type;
   storage.properties = current_property_set;
   sg_platf_new_storage(&storage);
   current_property_set = NULL;
@@ -222,10 +253,11 @@ void ETag_surfxml_storage___type(void)
   memset(&storage_type,0,sizeof(storage_type));
 
   storage_type.content = A_surfxml_storage___type_content;
+  storage_type.content_type = A_surfxml_storage___type_content___type;
   storage_type.id = A_surfxml_storage___type_id;
   storage_type.model = A_surfxml_storage___type_model;
   storage_type.properties = current_property_set;
-  storage_type.size = surf_parse_get_int(A_surfxml_storage___type_size);
+  storage_type.size = surf_parse_get_size(A_surfxml_storage___type_size);
   sg_platf_new_storage_type(&storage_type);
   current_property_set = NULL;
 }
@@ -252,7 +284,7 @@ void ETag_surfxml_mount(void)
   memset(&mount,0,sizeof(mount));
 
   mount.name = A_surfxml_mount_name;
-  mount.id = A_surfxml_mount_id;
+  mount.storageId = A_surfxml_mount_storageId;
   sg_platf_new_mount(&mount);
 }
 
@@ -393,16 +425,45 @@ void STag_surfxml_prop(void)
 
 void ETag_surfxml_host(void)    {
   s_sg_platf_host_cbarg_t host;
+  char* buf;
   memset(&host,0,sizeof(host));
 
+
   host.properties = current_property_set;
 
   host.id = A_surfxml_host_id;
-  host.power_peak = get_cpu_power(A_surfxml_host_power);
+
+  buf = A_surfxml_host_power;
+  XBT_DEBUG("Buffer: %s", buf);
+  host.power_peak = xbt_dynar_new(sizeof(double), NULL);
+  if (strchr(buf, ',') == NULL){
+         double power_value = get_cpu_power(A_surfxml_host_power);
+         xbt_dynar_push_as(host.power_peak,double, power_value);
+  }
+  else {
+         xbt_dynar_t pstate_list = xbt_str_split(buf, ",");
+         int i;
+         for (i = 0; i < xbt_dynar_length(pstate_list); i++) {
+                 double power_value;
+                 char* power_value_str;
+
+                 xbt_dynar_get_cpy(pstate_list, i, &power_value_str);
+                 xbt_str_trim(power_value_str, NULL);
+                 power_value = get_cpu_power(power_value_str);
+                 xbt_dynar_push_as(host.power_peak, double, power_value);
+                 XBT_DEBUG("Power value: %f", power_value);
+         }
+         xbt_dynar_free(&pstate_list);
+  }
+
+  XBT_DEBUG("pstate: %s", A_surfxml_host_pstate);
+  //host.power_peak = get_cpu_power(A_surfxml_host_power);
   host.power_scale = surf_parse_get_double( A_surfxml_host_availability);
   host.core_amount = surf_parse_get_int(A_surfxml_host_core);
   host.power_trace = tmgr_trace_new_from_file(A_surfxml_host_availability___file);
   host.state_trace = tmgr_trace_new_from_file(A_surfxml_host_state___file);
+  host.pstate = surf_parse_get_int(A_surfxml_host_pstate);
+
   xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
         (A_surfxml_host_state == A_surfxml_host_state_OFF), "Invalid state");
   if (A_surfxml_host_state == A_surfxml_host_state_ON)
@@ -542,10 +603,10 @@ void ETag_surfxml_link(void){
 
   link.id = A_surfxml_link_id;
   link.bandwidth = surf_parse_get_bandwidth(A_surfxml_link_bandwidth);
-  //printf("Link bandwidth [%lg]\n", link.bandwidth);  
+  //printf("Link bandwidth [%g]\n", link.bandwidth);
   link.bandwidth_trace = tmgr_trace_new_from_file(A_surfxml_link_bandwidth___file);
   link.latency = surf_parse_get_time(A_surfxml_link_latency);
-  //printf("Link latency [%lg]\n", link.latency);  
+  //printf("Link latency [%g]\n", link.latency);
   link.latency_trace = tmgr_trace_new_from_file(A_surfxml_link_latency___file);
 
   switch (A_surfxml_link_state) {
@@ -801,13 +862,11 @@ void ETag_surfxml_AS(void){
   sg_platf_new_AS_end();
 }
 
-extern int _sg_init_status; /* FIXME: find a proper way to export this at some point */
-
 void STag_surfxml_config(void){
   AS_TAG = 0;
   xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
   XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
-  if (_sg_init_status == 2) {
+  if (_sg_cfg_init_status == 2) {
     surf_parse_error("All <config> tags must be given before any platform elements (such as <AS>, <host>, <cluster>, <link>, etc).");
   }
 }
@@ -1022,7 +1081,7 @@ static void init_randomness(void)
 
 static void add_randomness(void)
 {
-  /* If needed aditional properties can be added by using the prop tag */
+  /* If needed, additional properties can be added by using the prop tag */
   random_data_t random =
       random_new(random_generator, 0, random_min, random_max, random_mean,
                  random_std_deviation);
index b3fdf29..04d93a7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3d174c4..db28597 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -269,7 +269,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
   }
 
   xbt_assert(periodicity >= 0,
-              "Invalid periodicity %lg (must be positive)", periodicity);
+              "Invalid periodicity %g (must be positive)", periodicity);
 
   trace = xbt_new0(s_tmgr_trace_t, 1);
   trace->type = e_trace_list;
@@ -292,7 +292,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
     if (last_event) {
       if (last_event->delta > event.delta) {
         xbt_die("%s:%d: Invalid trace: Events must be sorted, "
-                "but time %lg > time %lg.\n%s",
+                "but time %g > time %g.\n%s",
                 id, linecount, last_event->delta, event.delta, input);
       }
       last_event->delta = event.delta - last_event->delta;
index 4611c81..1911def 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004, 2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/src/surf/workstation.c b/src/surf/workstation.c
new file mode 100644 (file)
index 0000000..f50cf05
--- /dev/null
@@ -0,0 +1,578 @@
+/* Copyright (c) 2004-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/ex.h"
+#include "xbt/dict.h"
+#include "portable.h"
+#include "surf_private.h"
+#include "storage_private.h"
+#include "surf/surf_resource.h"
+#include "simgrid/sg_config.h"
+
+typedef struct workstation_CLM03 {
+  s_surf_resource_t generic_resource;   /* Must remain first to add this to a trace */
+  void *net_elm;
+  xbt_dynar_t storage;
+} s_workstation_CLM03_t, *workstation_CLM03_t;
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf,
+                                "Logging specific to the SURF workstation module");
+
+surf_model_t surf_workstation_model = NULL;
+
+static void workstation_new(sg_platf_host_cbarg_t host)
+{
+  workstation_CLM03_t workstation = xbt_new0(s_workstation_CLM03_t, 1);
+
+  workstation->generic_resource.model = surf_workstation_model;
+  workstation->generic_resource.name = xbt_strdup(host->id);
+  workstation->storage = xbt_lib_get_or_null(storage_lib,host->id,ROUTING_STORAGE_HOST_LEVEL);
+  workstation->net_elm = xbt_lib_get_or_null(host_lib,host->id,ROUTING_HOST_LEVEL);
+  XBT_DEBUG("Create workstation %s with %ld mounted disks",host->id,xbt_dynar_length(workstation->storage));
+  xbt_lib_set(host_lib, host->id, SURF_WKS_LEVEL, workstation);
+}
+
+static int ws_resource_used(void *resource_id)
+{
+  THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
+  return -1;
+}
+
+static void ws_parallel_action_cancel(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
+}
+
+static int ws_parallel_action_free(surf_action_t action)
+{
+  THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
+  return -1;
+}
+
+static int ws_action_unref(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    return surf_network_model->action_unref(action);
+  else if (action->model_type == surf_cpu_model)
+    return surf_cpu_model->action_unref(action);
+  else if (action->model_type == surf_workstation_model)
+    return ws_parallel_action_free(action);
+  else
+    DIE_IMPOSSIBLE;
+  return 0;
+}
+
+static void ws_action_cancel(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->action_cancel(action);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->action_cancel(action);
+  else if (action->model_type == surf_workstation_model)
+    ws_parallel_action_cancel(action);
+  else
+    DIE_IMPOSSIBLE;
+  return;
+}
+
+static void ws_action_state_set(surf_action_t action,
+                                e_surf_action_state_t state)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->action_state_set(action, state);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->action_state_set(action, state);
+  else if (action->model_type == surf_workstation_model)
+    surf_action_state_set(action, state);
+  else
+    DIE_IMPOSSIBLE;
+  return;
+}
+
+static double ws_share_resources(double now)
+{
+  return -1.0;
+}
+
+static void ws_update_actions_state(double now, double delta)
+{
+  return;
+}
+
+static void ws_update_resource_state(void *id,
+                                     tmgr_trace_event_t event_type,
+                                     double value, double date)
+{
+  THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
+}
+
+static surf_action_t ws_execute(void *workstation, double size)
+{
+  surf_resource_t cpu = ((surf_resource_t) surf_cpu_resource_priv(workstation));
+  return cpu->model->extension.cpu.execute(workstation, size);
+}
+
+static surf_action_t ws_action_sleep(void *workstation, double duration)
+{
+  return surf_cpu_model->extension.cpu.
+      sleep(workstation, duration);
+}
+
+static void ws_action_suspend(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->suspend(action);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->suspend(action);
+  else
+    DIE_IMPOSSIBLE;
+}
+
+static void ws_action_resume(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->resume(action);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->resume(action);
+  else
+    DIE_IMPOSSIBLE;
+}
+
+static int ws_action_is_suspended(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    return surf_network_model->is_suspended(action);
+  if (action->model_type == surf_cpu_model)
+    return surf_cpu_model->is_suspended(action);
+  DIE_IMPOSSIBLE;
+  return -1;
+}
+
+static void ws_action_set_max_duration(surf_action_t action,
+                                       double duration)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->set_max_duration(action, duration);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->set_max_duration(action, duration);
+  else
+    DIE_IMPOSSIBLE;
+}
+
+static void ws_action_set_priority(surf_action_t action, double priority)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->set_priority(action, priority);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->set_priority(action, priority);
+  else
+    DIE_IMPOSSIBLE;
+}
+
+#ifdef HAVE_TRACING
+static void ws_action_set_category(surf_action_t action, const char *category)
+{
+  if (action->model_type == surf_network_model)
+    surf_network_model->set_category(action, category);
+  else if (action->model_type == surf_cpu_model)
+    surf_cpu_model->set_category(action, category);
+  else
+    DIE_IMPOSSIBLE;
+}
+#endif
+
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+static int ws_get_latency_limited(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    return surf_network_model->get_latency_limited(action);
+  else
+    return 0;
+}
+#endif
+
+static double ws_action_get_remains(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    return surf_network_model->get_remains(action);
+  if (action->model_type == surf_cpu_model)
+    return surf_cpu_model->get_remains(action);
+  DIE_IMPOSSIBLE;
+  return -1.0;
+}
+
+static surf_action_t ws_communicate(void *workstation_src,
+                                    void *workstation_dst, double size,
+                                    double rate)
+{
+  workstation_CLM03_t src = surf_workstation_resource_priv(workstation_src);
+  workstation_CLM03_t dst = surf_workstation_resource_priv(workstation_dst);
+  return surf_network_model->extension.network.
+      communicate(src->net_elm,
+                  dst->net_elm, size, rate);
+}
+
+static e_surf_resource_state_t ws_get_state(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_state(workstation);
+}
+
+static double ws_get_speed(void *workstation, double load)
+{
+  return surf_cpu_model->extension.cpu.
+      get_speed(workstation, load);
+}
+
+static int ws_get_core(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_core(workstation);
+}
+
+
+
+static double ws_get_available_speed(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_available_speed(workstation);
+}
+
+static double ws_get_current_power_peak(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_current_power_peak(workstation);
+}
+
+static double ws_get_power_peak_at(void *workstation, int pstate_index)
+{
+  return surf_cpu_model->extension.cpu.
+      get_power_peak_at(workstation, pstate_index);
+}
+
+static int ws_get_nb_pstates(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_nb_pstates(workstation);
+}
+
+static void ws_set_power_peak_at(void *workstation, int pstate_index)
+{
+  surf_cpu_model->extension.cpu.
+      set_power_peak_at(workstation, pstate_index);
+}
+
+static double ws_get_consumed_energy(void *workstation)
+{
+  return surf_cpu_model->extension.cpu.
+      get_consumed_energy(workstation);
+}
+
+
+static surf_action_t ws_execute_parallel_task(int workstation_nb,
+                                              void **workstation_list,
+                                              double *computation_amount,
+                                              double *communication_amount,
+                                              double rate)
+{
+#define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
+  if ((workstation_nb == 1)
+      && (cost_or_zero(communication_amount, 0) == 0.0))
+    return ws_execute(workstation_list[0], computation_amount[0]);
+  else if ((workstation_nb == 1)
+           && (cost_or_zero(computation_amount, 0) == 0.0))
+    return ws_communicate(workstation_list[0], workstation_list[0],communication_amount[0], rate);
+  else if ((workstation_nb == 2)
+             && (cost_or_zero(computation_amount, 0) == 0.0)
+             && (cost_or_zero(computation_amount, 1) == 0.0)) {
+    int i,nb = 0;
+    double value = 0.0;
+
+    for (i = 0; i < workstation_nb * workstation_nb; i++) {
+      if (cost_or_zero(communication_amount, i) > 0.0) {
+        nb++;
+        value = cost_or_zero(communication_amount, i);
+      }
+    }
+    if (nb == 1)
+      return ws_communicate(workstation_list[0], workstation_list[1],value, rate);
+  }
+#undef cost_or_zero
+
+  THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
+  return NULL;
+}
+
+
+/* returns an array of network_link_CM02_t */
+static xbt_dynar_t ws_get_route(void *workstation_src, void *workstation_dst)
+{
+  XBT_DEBUG("ws_get_route");
+  workstation_CLM03_t src = surf_workstation_resource_priv(workstation_src);
+  workstation_CLM03_t dst = surf_workstation_resource_priv(workstation_dst);
+  return surf_network_model->extension.
+      network.get_route(src->net_elm,
+                  dst->net_elm);
+}
+
+static double ws_get_link_bandwidth(const void *link)
+{
+  return surf_network_model->extension.network.get_link_bandwidth(link);
+}
+
+static double ws_get_link_latency(const void *link)
+{
+  return surf_network_model->extension.network.get_link_latency(link);
+}
+
+static int ws_link_shared(const void *link)
+{
+  return surf_network_model->extension.network.link_shared(link);
+}
+
+static void ws_finalize(void)
+{
+  surf_model_exit(surf_workstation_model);
+  surf_workstation_model = NULL;
+}
+
+static xbt_dict_t ws_get_properties(const void *ws)
+{
+  return surf_resource_properties(surf_cpu_resource_priv(ws));
+}
+
+static storage_t find_storage_on_mount_list(void *workstation,const char* mount)
+{
+  storage_t st = NULL;
+  s_mount_t mnt;
+  unsigned int cursor;
+  workstation_CLM03_t ws = (workstation_CLM03_t) surf_workstation_resource_priv(workstation);
+  xbt_dynar_t storage_list = ws->storage;
+
+  XBT_DEBUG("Search for storage name '%s' on '%s'",mount,ws->generic_resource.name);
+  xbt_dynar_foreach(storage_list,cursor,mnt)
+  {
+    XBT_DEBUG("See '%s'",mnt.name);
+    if(!strcmp(mount,mnt.name)){
+      st = mnt.storage;
+      break;
+    }
+  }
+  if(!st) xbt_die("Can't find mount '%s' for '%s'",mount,ws->generic_resource.name);
+  return st;
+}
+
+static xbt_dict_t ws_get_storage_list(void *workstation)
+{
+  s_mount_t mnt;
+  unsigned int i;
+  xbt_dict_t storage_list = xbt_dict_new_homogeneous(NULL);
+  char *storage_name = NULL;
+
+  workstation_CLM03_t ws = (workstation_CLM03_t) surf_workstation_resource_priv(workstation);
+  xbt_dynar_t storages = ws->storage;
+
+  xbt_dynar_foreach(storages,i,mnt){
+    storage_name = ((storage_t)mnt.storage)->generic_resource.name;
+    xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
+  }
+  return storage_list;
+}
+
+static surf_action_t ws_action_open(void *workstation, const char* mount,
+                                    const char* path)
+{
+  storage_t st = find_storage_on_mount_list(workstation, mount);
+  XBT_DEBUG("OPEN on disk '%s'",st->generic_resource.name);
+  surf_model_t model = st->generic_resource.model;
+  return model->extension.storage.open(st, mount, path);
+}
+
+static surf_action_t ws_action_close(void *workstation, surf_file_t fd)
+{
+  storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+  XBT_DEBUG("CLOSE on disk '%s'",st->generic_resource.name);
+  surf_model_t model = st->generic_resource.model;
+  return model->extension.storage.close(st, fd);
+}
+
+static surf_action_t ws_action_read(void *workstation, surf_file_t fd, sg_storage_size_t size)
+{
+  storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+  XBT_DEBUG("READ on disk '%s'",st->generic_resource.name);
+  surf_model_t model = st->generic_resource.model;
+  return model->extension.storage.read(st, fd, size);
+}
+
+static surf_action_t ws_action_write(void *workstation, surf_file_t fd, sg_storage_size_t size)
+{
+  storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+  XBT_DEBUG("WRITE on disk '%s'",st->generic_resource.name);
+  surf_model_t model = st->generic_resource.model;
+  return model->extension.storage.write(st, fd, size);
+}
+
+static int ws_file_unlink(void *workstation, surf_file_t fd)
+{
+  if (!fd){
+    XBT_WARN("No such file descriptor. Impossible to unlink");
+    return 0;
+  } else {
+//    XBT_INFO("%s %zu", fd->storage, fd->size);
+    storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+    xbt_dict_t content_dict = (st)->content;
+    /* Check if the file is on this storage */
+    if (!xbt_dict_get_or_null(content_dict, fd->name)){
+      XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name,
+          st->generic_resource.name);
+      return 0;
+    } else {
+      XBT_DEBUG("UNLINK on disk '%s'",st->generic_resource.name);
+      st->used_size -= fd->size;
+
+      // Remove the file from storage
+      xbt_dict_remove(content_dict,fd->name);
+
+      free(fd->name);
+      free(fd->mount);
+      xbt_free(fd);
+      return 1;
+    }
+  }
+}
+
+static surf_action_t ws_action_ls(void *workstation, const char* mount,
+                                  const char *path)
+{
+  XBT_DEBUG("LS on mount '%s' and file '%s'",mount, path);
+  storage_t st = find_storage_on_mount_list(workstation, mount);
+  surf_model_t model = st->generic_resource.model;
+  return model->extension.storage.ls(st, path);
+}
+
+static sg_storage_size_t ws_file_get_size(void *workstation, surf_file_t fd)
+{
+  return fd->size;
+}
+
+static xbt_dynar_t ws_file_get_info(void *workstation, surf_file_t fd)
+{
+  storage_t st = find_storage_on_mount_list(workstation, fd->mount);
+  sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+  *psize = fd->size;
+  xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
+  xbt_dynar_push_as(info, sg_storage_size_t *, psize);
+  xbt_dynar_push_as(info, void *, fd->mount);
+  xbt_dynar_push_as(info, void *, st->generic_resource.name);
+  xbt_dynar_push_as(info, void *, st->type_id);
+  xbt_dynar_push_as(info, void *, st->content_type);
+
+  return info;
+}
+
+static sg_storage_size_t ws_storage_get_free_size(void *workstation,const char* name)
+{
+  storage_t st = find_storage_on_mount_list(workstation, name);
+  return st->size - st->used_size;
+}
+
+static sg_storage_size_t ws_storage_get_used_size(void *workstation,const char* name)
+{
+  storage_t st = find_storage_on_mount_list(workstation, name);
+  return st->used_size;
+}
+
+static void surf_workstation_model_init_internal(void)
+{
+  surf_workstation_model = surf_model_init();
+
+  surf_workstation_model->name = "Workstation";
+  surf_workstation_model->action_unref = ws_action_unref;
+  surf_workstation_model->action_cancel = ws_action_cancel;
+  surf_workstation_model->action_state_set = ws_action_state_set;
+
+  surf_workstation_model->model_private->resource_used = ws_resource_used;
+  surf_workstation_model->model_private->share_resources =
+      ws_share_resources;
+  surf_workstation_model->model_private->update_actions_state =
+      ws_update_actions_state;
+  surf_workstation_model->model_private->update_resource_state =
+      ws_update_resource_state;
+  surf_workstation_model->model_private->finalize = ws_finalize;
+
+  surf_workstation_model->suspend = ws_action_suspend;
+  surf_workstation_model->resume = ws_action_resume;
+  surf_workstation_model->is_suspended = ws_action_is_suspended;
+  surf_workstation_model->set_max_duration = ws_action_set_max_duration;
+  surf_workstation_model->set_priority = ws_action_set_priority;
+#ifdef HAVE_TRACING
+  surf_workstation_model->set_category = ws_action_set_category;
+#endif
+  surf_workstation_model->get_remains = ws_action_get_remains;
+#ifdef HAVE_LATENCY_BOUND_TRACKING
+  surf_workstation_model->get_latency_limited = ws_get_latency_limited;
+#endif
+
+  surf_workstation_model->extension.workstation.execute = ws_execute;
+  surf_workstation_model->extension.workstation.sleep = ws_action_sleep;
+  surf_workstation_model->extension.workstation.get_state = ws_get_state;
+  surf_workstation_model->extension.workstation.get_core = ws_get_core;
+  surf_workstation_model->extension.workstation.get_speed = ws_get_speed;
+  surf_workstation_model->extension.workstation.get_available_speed =
+      ws_get_available_speed;
+  surf_workstation_model->extension.workstation.get_current_power_peak = ws_get_current_power_peak;
+  surf_workstation_model->extension.workstation.get_power_peak_at = ws_get_power_peak_at;
+  surf_workstation_model->extension.workstation.get_nb_pstates = ws_get_nb_pstates;
+  surf_workstation_model->extension.workstation.set_power_peak_at = ws_set_power_peak_at;
+  surf_workstation_model->extension.workstation.get_consumed_energy = ws_get_consumed_energy;
+
+  surf_workstation_model->extension.workstation.communicate =
+      ws_communicate;
+  surf_workstation_model->extension.workstation.get_route = ws_get_route;
+  surf_workstation_model->extension.workstation.execute_parallel_task =
+      ws_execute_parallel_task;
+  surf_workstation_model->extension.workstation.get_link_bandwidth =
+      ws_get_link_bandwidth;
+  surf_workstation_model->extension.workstation.get_link_latency =
+      ws_get_link_latency;
+  surf_workstation_model->extension.workstation.link_shared =
+      ws_link_shared;
+  surf_workstation_model->extension.workstation.get_properties =
+      ws_get_properties;
+
+  surf_workstation_model->extension.workstation.open = ws_action_open;
+  surf_workstation_model->extension.workstation.close = ws_action_close;
+  surf_workstation_model->extension.workstation.read = ws_action_read;
+  surf_workstation_model->extension.workstation.write = ws_action_write;
+  surf_workstation_model->extension.workstation.unlink = ws_file_unlink;
+  surf_workstation_model->extension.workstation.ls = ws_action_ls;
+  surf_workstation_model->extension.workstation.get_size = ws_file_get_size;
+  surf_workstation_model->extension.workstation.get_info = ws_file_get_info;
+  surf_workstation_model->extension.workstation.get_free_size = ws_storage_get_free_size;
+  surf_workstation_model->extension.workstation.get_used_size = ws_storage_get_used_size;
+  surf_workstation_model->extension.workstation.get_storage_list = ws_get_storage_list;
+}
+
+void surf_workstation_model_init_current_default(void)
+{
+  surf_workstation_model_init_internal();
+  xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "yes");
+  surf_cpu_model_init_Cas01();
+  surf_network_model_init_LegrandVelho();
+
+  xbt_dynar_push(model_list, &surf_workstation_model);
+  sg_platf_host_add_cb(workstation_new);
+}
+
+void surf_workstation_model_init_compound()
+{
+
+  xbt_assert(surf_cpu_model, "No CPU model defined yet!");
+  xbt_assert(surf_network_model, "No network model defined yet!");
+  surf_workstation_model_init_internal();
+  xbt_dynar_push(model_list, &surf_workstation_model);
+  sg_platf_host_add_cb(workstation_new);
+}
index 069500c..31aef93 100644 (file)
@@ -25,7 +25,7 @@ static void workstation_new(sg_platf_host_cbarg_t host){
 void surf_workstation_model_init_current_default(void)
 {
   surf_workstation_model = new WorkstationModel();
-  xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", xbt_strdup("yes"));
+  xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "yes");
   surf_cpu_model_init_Cas01();
   surf_network_model_init_LegrandVelho();
 
@@ -160,31 +160,71 @@ double WorkstationCLM03::getAvailableSpeed(){
   return p_cpu->getAvailableSpeed();
 }
 
+double WorkstationCLM03::getCurrentPowerPeak()
+{
+  return p_cpu->getCurrentPowerPeak();
+}
+
+double WorkstationCLM03::getPowerPeakAt(int pstate_index)
+{
+  return p_cpu->getPowerPeakAt(pstate_index);
+}
+
+int WorkstationCLM03::getNbPstates()
+{
+  return p_cpu->getNbPstates();
+}
+
+void WorkstationCLM03::setPowerPeakAt(int pstate_index)
+{
+       p_cpu->setPowerPeakAt(pstate_index);
+}
+
+double WorkstationCLM03::getConsumedEnergy()
+{
+  return p_cpu->getConsumedEnergy();
+}
+
+
 xbt_dict_t WorkstationCLM03::getProperties()
 {
   return p_cpu->m_properties;
 }
 
 
-StoragePtr WorkstationCLM03::findStorageOnMountList(const char* storage)
+StoragePtr WorkstationCLM03::findStorageOnMountList(const char* mount)
 {
   StoragePtr st = NULL;
   s_mount_t mnt;
   unsigned int cursor;
 
-  XBT_DEBUG("Search for storage name '%s' on '%s'",storage,m_name);
+  XBT_DEBUG("Search for storage name '%s' on '%s'", mount, m_name);
   xbt_dynar_foreach(p_storage,cursor,mnt)
   {
     XBT_DEBUG("See '%s'",mnt.name);
-    if(!strcmp(storage,mnt.name)){
-      st = (StoragePtr)mnt.id;
+    if(!strcmp(mount,mnt.name)){
+      st = dynamic_cast<StoragePtr>(static_cast<ResourcePtr>(mnt.storage));
       break;
     }
   }
-  if(!st) xbt_die("Can't find mount '%s' for '%s'",storage,m_name);
+  if(!st) xbt_die("Can't find mount '%s' for '%s'", mount, m_name);
   return st;
 }
 
+xbt_dict_t WorkstationCLM03::getStorageList()
+{
+  s_mount_t mnt;
+  unsigned int i;
+  xbt_dict_t storage_list = xbt_dict_new_homogeneous(NULL);
+  char *storage_name = NULL;
+
+  xbt_dynar_foreach(p_storage,i,mnt){
+    storage_name = (char *)dynamic_cast<StoragePtr>(static_cast<ResourcePtr>(mnt.storage))->m_name;
+    xbt_dict_set(storage_list,mnt.name,storage_name,NULL);
+  }
+  return storage_list;
+}
+
 ActionPtr WorkstationCLM03::open(const char* mount, const char* path) {
   StoragePtr st = findStorageOnMountList(mount);
   XBT_DEBUG("OPEN on disk '%s'", st->m_name);
@@ -192,21 +232,21 @@ ActionPtr WorkstationCLM03::open(const char* mount, const char* path) {
 }
 
 ActionPtr WorkstationCLM03::close(surf_file_t fd) {
-  StoragePtr st = findStorageOnMountList(fd->storage);
+  StoragePtr st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("CLOSE on disk '%s'",st->m_name);
   return st->close(fd);
 }
 
-ActionPtr WorkstationCLM03::read(void* ptr, size_t size, surf_file_t fd) {
-  StoragePtr st = findStorageOnMountList(fd->storage);
+ActionPtr WorkstationCLM03::read(surf_file_t fd, sg_storage_size_t size) {
+  StoragePtr st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("READ on disk '%s'",st->m_name);
-  return st->read(ptr, size, fd);
+  return st->read(fd, size);
 }
 
-ActionPtr WorkstationCLM03::write(const void* ptr, size_t size, surf_file_t fd) {
-  StoragePtr st = findStorageOnMountList(fd->storage);
+ActionPtr WorkstationCLM03::write(surf_file_t fd, sg_storage_size_t size) {
+  StoragePtr st = findStorageOnMountList(fd->mount);
   XBT_DEBUG("WRITE on disk '%s'",st->m_name);
-  return st->write(ptr, size, fd);
+  return st->write(fd, size);
 }
 
 int WorkstationCLM03::unlink(surf_file_t fd) {
@@ -215,7 +255,7 @@ int WorkstationCLM03::unlink(surf_file_t fd) {
     return 0;
   } else {
 //    XBT_INFO("%s %zu", fd->storage, fd->size);
-    StoragePtr st = findStorageOnMountList(fd->storage);
+    StoragePtr st = findStorageOnMountList(fd->mount);
     /* Check if the file is on this storage */
     if (!xbt_dict_get_or_null(st->p_content, fd->name)){
       XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->name,
@@ -229,7 +269,7 @@ int WorkstationCLM03::unlink(surf_file_t fd) {
       xbt_dict_remove(st->p_content, fd->name);
 
       free(fd->name);
-      free(fd->storage);
+      free(fd->mount);
       xbt_free(fd);
       return 1;
     }
@@ -242,10 +282,37 @@ ActionPtr WorkstationCLM03::ls(const char* mount, const char *path){
   return st->ls(path);
 }
 
-size_t WorkstationCLM03::getSize(surf_file_t fd){
+sg_storage_size_t WorkstationCLM03::getSize(surf_file_t fd){
   return fd->size;
 }
 
+xbt_dynar_t WorkstationCLM03::getInfo( surf_file_t fd)
+{
+  StoragePtr st = findStorageOnMountList(fd->mount);
+  sg_storage_size_t *psize = xbt_new(sg_storage_size_t, 1);
+  *psize = fd->size;
+  xbt_dynar_t info = xbt_dynar_new(sizeof(void*), NULL);
+  xbt_dynar_push_as(info, sg_storage_size_t *, psize);
+  xbt_dynar_push_as(info, void *, fd->mount);
+  xbt_dynar_push_as(info, void *, (void *)st->m_name);
+  xbt_dynar_push_as(info, void *, st->p_typeId);
+  xbt_dynar_push_as(info, void *, st->p_contentType);
+
+  return info;
+}
+
+sg_storage_size_t WorkstationCLM03::getFreeSize(const char* name)
+{
+  StoragePtr st = findStorageOnMountList(name);
+  return st->m_size - st->m_usedSize;
+}
+
+sg_storage_size_t WorkstationCLM03::getUsedSize(const char* name)
+{
+  StoragePtr st = findStorageOnMountList(name);
+  return st->m_usedSize;
+}
+
 e_surf_resource_state_t WorkstationCLM03Lmm::getState() {
   return WorkstationCLM03::getState();
 }
index 675cfad..08940e0 100644 (file)
@@ -69,17 +69,27 @@ public:
   virtual int getCore();
   virtual double getSpeed(double load);
   virtual double getAvailableSpeed();
+  virtual double getCurrentPowerPeak();
+  virtual double getPowerPeakAt(int pstate_index);
+  virtual int getNbPstates();
+  virtual void setPowerPeakAt(int pstate_index);
+  virtual double getConsumedEnergy();
 
   xbt_dict_t getProperties();
 
   StoragePtr findStorageOnMountList(const char* storage);
+  xbt_dict_t getStorageList();
   ActionPtr open(const char* mount, const char* path);
   ActionPtr close(surf_file_t fd);
   int unlink(surf_file_t fd);
   ActionPtr ls(const char* mount, const char *path);
-  size_t getSize(surf_file_t fd);
-  ActionPtr read(void* ptr, size_t size, surf_file_t fd);
-  ActionPtr write(const void* ptr, size_t size, surf_file_t fd);
+  sg_storage_size_t getSize(surf_file_t fd);
+  ActionPtr read(surf_file_t fd, sg_storage_size_t size);
+  ActionPtr write(surf_file_t fd, sg_storage_size_t size);
+  xbt_dynar_t getInfo( surf_file_t fd);
+  sg_storage_size_t getFreeSize(const char* name);
+  sg_storage_size_t getUsedSize(const char* name);
+
   bool isUsed();
   //bool isShared();
   xbt_dynar_t p_storage;
diff --git a/src/surf/workstation_ptask_L07.c b/src/surf/workstation_ptask_L07.c
new file mode 100644 (file)
index 0000000..e6d026b
--- /dev/null
@@ -0,0 +1,966 @@
+/* Copyright (c) 2007-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/ex.h"
+#include "xbt/str.h"
+#include "xbt/dict.h"
+#include "surf_private.h"
+#include "surf/surf_resource.h"
+//#include "surf/surf_resource_lmm.h"
+
+typedef enum {
+  SURF_WORKSTATION_RESOURCE_CPU,
+  SURF_WORKSTATION_RESOURCE_LINK
+} e_surf_workstation_model_type_t;
+
+/**************************************/
+/********* cpu object *****************/
+/**************************************/
+typedef struct cpu_L07 {
+  s_surf_resource_t generic_resource;   /* Do not move this field: must match surf_resource_t */
+  e_surf_workstation_model_type_t type; /* Do not move this field: must match link_L07_t */
+  lmm_constraint_t constraint;  /* Do not move this field: must match link_L07_t */
+  double power_scale;
+  double power_current;
+  tmgr_trace_event_t power_event;
+  tmgr_trace_event_t state_event;
+  e_surf_resource_state_t state_current;
+  sg_routing_edge_t info;
+} s_cpu_L07_t, *cpu_L07_t;
+
+/**************************************/
+/*********** network object ***********/
+/**************************************/
+
+typedef struct link_L07 {
+  s_surf_resource_t generic_resource;   /* Do not move this field: must match surf_resource_t */
+  e_surf_workstation_model_type_t type; /* Do not move this field: must match cpu_L07_t */
+  lmm_constraint_t constraint;  /* Do not move this field: must match cpu_L07_t */
+  double lat_current;
+  tmgr_trace_event_t lat_event;
+  double bw_current;
+  tmgr_trace_event_t bw_event;
+  e_surf_resource_state_t state_current;
+  tmgr_trace_event_t state_event;
+} s_link_L07_t, *link_L07_t;
+
+/**************************************/
+/*************** actions **************/
+/**************************************/
+typedef struct surf_action_workstation_L07 {
+  s_surf_action_t generic_action;
+  lmm_variable_t variable;
+  int workstation_nb;
+  cpu_L07_t *workstation_list;
+  double *computation_amount;
+  double *communication_amount;
+  double latency;
+  double rate;
+  int suspended;
+} s_surf_action_workstation_L07_t, *surf_action_workstation_L07_t;
+
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_workstation);
+
+static int ptask_host_count = 0;
+static xbt_dict_t ptask_parallel_task_link_set = NULL;
+lmm_system_t ptask_maxmin_system = NULL;
+
+static surf_action_t die_impossible_communicate (sg_routing_edge_t src,
+                                                 sg_routing_edge_t dst,
+                                                 double size, double rate)
+{
+  DIE_IMPOSSIBLE;
+  return NULL;
+}
+
+static xbt_dynar_t die_impossible_get_route(void *src, void *dst)
+{
+  DIE_IMPOSSIBLE;
+  return NULL;
+}
+
+static void ptask_update_action_bound(surf_action_workstation_L07_t action)
+{
+  int workstation_nb = action->workstation_nb;
+  double lat_current = 0.0;
+  double lat_bound = -1.0;
+  int i, j;
+
+  for (i = 0; i < workstation_nb; i++) {
+    for (j = 0; j < workstation_nb; j++) {
+      xbt_dynar_t route=NULL;
+
+      if (action->communication_amount[i * workstation_nb + j] > 0) {
+        double lat = 0.0;
+        routing_get_route_and_latency(((cpu_L07_t)surf_workstation_resource_priv(action->workstation_list[i]))->info,
+            ((cpu_L07_t)surf_workstation_resource_priv(action->workstation_list[j]))->info,
+            &route, &lat);
+        lat_current =
+            MAX(lat_current,
+                lat * action->communication_amount[i * workstation_nb + j]);
+      }
+    }
+  }
+  lat_bound = sg_tcp_gamma / (2.0 * lat_current);
+  XBT_DEBUG("action (%p) : lat_bound = %g", action, lat_bound);
+  if ((action->latency == 0.0) && (action->suspended == 0)) {
+    if (action->rate < 0)
+      lmm_update_variable_bound(ptask_maxmin_system, action->variable,
+                                lat_bound);
+    else
+      lmm_update_variable_bound(ptask_maxmin_system, action->variable,
+                                min(action->rate, lat_bound));
+  }
+}
+
+/**************************************/
+/******* Resource Public     **********/
+/**************************************/
+
+static int ptask_action_unref(surf_action_t action)
+{
+  action->refcount--;
+
+  if (!action->refcount) {
+    xbt_swag_remove(action, action->state_set);
+    if (((surf_action_workstation_L07_t) action)->variable)
+      lmm_variable_free(ptask_maxmin_system,
+                        ((surf_action_workstation_L07_t)
+                         action)->variable);
+    free(((surf_action_workstation_L07_t) action)->workstation_list);
+    free(((surf_action_workstation_L07_t) action)->communication_amount);
+    free(((surf_action_workstation_L07_t) action)->computation_amount);
+#ifdef HAVE_TRACING
+    xbt_free(action->category);
+#endif
+    surf_action_free(&action);
+    return 1;
+  }
+  return 0;
+}
+
+static void ptask_action_cancel(surf_action_t action)
+{
+  surf_action_state_set(action, SURF_ACTION_FAILED);
+  return;
+}
+
+/* action_change_state is inherited from the surf module */
+/* action_set_data is inherited from the surf module */
+
+static void ptask_action_suspend(surf_action_t action)
+{
+  XBT_IN("(%p))", action);
+  if (((surf_action_workstation_L07_t) action)->suspended != 2) {
+    ((surf_action_workstation_L07_t) action)->suspended = 1;
+    lmm_update_variable_weight(ptask_maxmin_system,
+                               ((surf_action_workstation_L07_t)
+                                action)->variable, 0.0);
+  }
+  XBT_OUT();
+}
+
+static void ptask_action_resume(surf_action_t action)
+{
+  surf_action_workstation_L07_t act =
+      (surf_action_workstation_L07_t) action;
+
+  XBT_IN("(%p)", act);
+  if (act->suspended != 2) {
+    lmm_update_variable_weight(ptask_maxmin_system, act->variable, 1.0);
+    act->suspended = 0;
+  }
+  XBT_OUT();
+}
+
+static int ptask_action_is_suspended(surf_action_t action)
+{
+  return (((surf_action_workstation_L07_t) action)->suspended == 1);
+}
+
+static void ptask_action_set_max_duration(surf_action_t action,
+                                          double duration)
+{                               /* FIXME: should inherit */
+  XBT_IN("(%p,%g)", action, duration);
+  action->max_duration = duration;
+  XBT_OUT();
+}
+
+
+static void ptask_action_set_priority(surf_action_t action,
+                                      double priority)
+{                               /* FIXME: should inherit */
+  XBT_IN("(%p,%g)", action, priority);
+  action->priority = priority;
+  XBT_OUT();
+}
+
+static double ptask_action_get_remains(surf_action_t action)
+{
+  XBT_IN("(%p)", action);
+  XBT_OUT();
+  return action->remains;
+}
+
+/**************************************/
+/******* Resource Private    **********/
+/**************************************/
+
+static int ptask_resource_used(void *resource_id)
+{
+  /* We can freely cast as a link_L07_t because it has
+     the same prefix as cpu_L07_t */
+  return lmm_constraint_used(ptask_maxmin_system,
+                             ((link_L07_t) resource_id)->constraint);
+
+}
+
+static double ptask_share_resources(double now)
+{
+  s_surf_action_workstation_L07_t s_action;
+  surf_action_workstation_L07_t action = NULL;
+
+  xbt_swag_t running_actions =
+      surf_workstation_model->states.running_action_set;
+  double min = generic_maxmin_share_resources(running_actions,
+                                              xbt_swag_offset(s_action,
+                                                              variable),
+                                              ptask_maxmin_system,
+                                              bottleneck_solve);
+
+  xbt_swag_foreach(action, running_actions) {
+    if (action->latency > 0) {
+      if (min < 0) {
+        min = action->latency;
+        XBT_DEBUG("Updating min (value) with %p (start %f): %f", action,
+               action->generic_action.start, min);
+      } else if (action->latency < min) {
+        min = action->latency;
+        XBT_DEBUG("Updating min (latency) with %p (start %f): %f", action,
+               action->generic_action.start, min);
+      }
+    }
+  }
+
+  XBT_DEBUG("min value : %f", min);
+
+  return min;
+}
+
+static void ptask_update_actions_state(double now, double delta)
+{
+  double deltap = 0.0;
+  surf_action_workstation_L07_t action = NULL;
+  surf_action_workstation_L07_t next_action = NULL;
+  xbt_swag_t running_actions =
+      surf_workstation_model->states.running_action_set;
+
+  xbt_swag_foreach_safe(action, next_action, running_actions) {
+    deltap = delta;
+    if (action->latency > 0) {
+      if (action->latency > deltap) {
+        double_update(&(action->latency), deltap);
+        deltap = 0.0;
+      } else {
+        double_update(&(deltap), action->latency);
+        action->latency = 0.0;
+      }
+      if ((action->latency == 0.0) && (action->suspended == 0)) {
+        ptask_update_action_bound(action);
+        lmm_update_variable_weight(ptask_maxmin_system, action->variable,
+                                   1.0);
+      }
+    }
+    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.",
+           action, action->generic_action.remains,
+           lmm_variable_getvalue(action->variable) * delta);
+    double_update(&(action->generic_action.remains),
+                  lmm_variable_getvalue(action->variable) * delta);
+
+    if (action->generic_action.max_duration != NO_MAX_DURATION)
+      double_update(&(action->generic_action.max_duration), delta);
+
+    XBT_DEBUG("Action (%p) : remains (%g).",
+           action, action->generic_action.remains);
+    if ((action->generic_action.remains <= 0) &&
+        (lmm_get_variable_weight(action->variable) > 0)) {
+      action->generic_action.finish = surf_get_clock();
+      surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    } else if ((action->generic_action.max_duration != NO_MAX_DURATION) &&
+               (action->generic_action.max_duration <= 0)) {
+      action->generic_action.finish = surf_get_clock();
+      surf_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    } else {
+      /* Need to check that none of the model has failed */
+      lmm_constraint_t cnst = NULL;
+      int i = 0;
+      void *constraint_id = NULL;
+
+      while ((cnst =
+              lmm_get_cnst_from_var(ptask_maxmin_system, action->variable,
+                                    i++))) {
+        constraint_id = lmm_constraint_id(cnst);
+
+/*   if(((link_L07_t)constraint_id)->type== */
+/*      SURF_WORKSTATION_RESOURCE_LINK) { */
+/*     XBT_DEBUG("Checking for link %s (%p)", */
+/*      ((link_L07_t)constraint_id)->name, */
+/*      ((link_L07_t)constraint_id)); */
+/*   } */
+/*   if(((cpu_L07_t)constraint_id)->type== */
+/*      SURF_WORKSTATION_RESOURCE_CPU) { */
+/*     XBT_DEBUG("Checking for cpu %s (%p) : %s", */
+/*      ((cpu_L07_t)constraint_id)->name, */
+/*      ((cpu_L07_t)constraint_id), */
+/*      ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
+/*   } */
+
+        if (((((link_L07_t) constraint_id)->type ==
+              SURF_WORKSTATION_RESOURCE_LINK) &&
+             (((link_L07_t) constraint_id)->state_current ==
+              SURF_RESOURCE_OFF)) ||
+            ((((cpu_L07_t) constraint_id)->type ==
+              SURF_WORKSTATION_RESOURCE_CPU) &&
+             (((cpu_L07_t) constraint_id)->state_current ==
+              SURF_RESOURCE_OFF))) {
+          XBT_DEBUG("Action (%p) Failed!!", action);
+          action->generic_action.finish = surf_get_clock();
+          surf_action_state_set((surf_action_t) action,
+                                SURF_ACTION_FAILED);
+          break;
+        }
+      }
+    }
+  }
+  return;
+}
+
+static void ptask_update_resource_state(void *id,
+                                        tmgr_trace_event_t event_type,
+                                        double value, double date)
+{
+  cpu_L07_t cpu = id;
+  link_L07_t nw_link = id;
+
+  if (nw_link->type == SURF_WORKSTATION_RESOURCE_LINK) {
+    XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g",
+      surf_resource_name(nw_link), nw_link, value, date);
+    if (event_type == nw_link->bw_event) {
+      nw_link->bw_current = value;
+      lmm_update_constraint_bound(ptask_maxmin_system, nw_link->constraint,
+                                  nw_link->bw_current);
+      if (tmgr_trace_event_free(event_type))
+        nw_link->bw_event = NULL;
+    } else if (event_type == nw_link->lat_event) {
+      lmm_variable_t var = NULL;
+      surf_action_workstation_L07_t action = NULL;
+      lmm_element_t elem = NULL;
+
+      nw_link->lat_current = value;
+      while ((var = lmm_get_var_from_cnst
+              (ptask_maxmin_system, nw_link->constraint, &elem))) {
+
+
+        action = lmm_variable_id(var);
+        ptask_update_action_bound(action);
+      }
+      if (tmgr_trace_event_free(event_type))
+        nw_link->lat_event = NULL;
+
+    } else if (event_type == nw_link->state_event) {
+      if (value > 0)
+        nw_link->state_current = SURF_RESOURCE_ON;
+      else
+        nw_link->state_current = SURF_RESOURCE_OFF;
+      if (tmgr_trace_event_free(event_type))
+        nw_link->state_event = NULL;
+    } else {
+      XBT_CRITICAL("Unknown event ! \n");
+      xbt_abort();
+    }
+    return;
+  } else if (cpu->type == SURF_WORKSTATION_RESOURCE_CPU) {
+    XBT_DEBUG("Updating cpu %s (%p) with value %g", surf_resource_name(cpu),
+           cpu, value);
+    if (event_type == cpu->power_event) {
+      cpu->power_current = value;
+      lmm_update_constraint_bound(ptask_maxmin_system, cpu->constraint,
+                                  cpu->power_current * cpu->power_scale);
+      if (tmgr_trace_event_free(event_type))
+        cpu->power_event = NULL;
+    } else if (event_type == cpu->state_event) {
+      if (value > 0)
+        cpu->state_current = SURF_RESOURCE_ON;
+      else
+        cpu->state_current = SURF_RESOURCE_OFF;
+      if (tmgr_trace_event_free(event_type))
+        cpu->state_event = NULL;
+    } else {
+      XBT_CRITICAL("Unknown event ! \n");
+      xbt_abort();
+    }
+    return;
+  } else {
+    DIE_IMPOSSIBLE;
+  }
+  return;
+}
+
+static void ptask_finalize(void)
+{
+  xbt_dict_free(&ptask_parallel_task_link_set);
+
+  surf_model_exit(surf_workstation_model);
+  surf_workstation_model = NULL;
+  surf_model_exit(surf_network_model);
+  surf_network_model = NULL;
+
+  ptask_host_count = 0;
+
+  if (ptask_maxmin_system) {
+    lmm_system_free(ptask_maxmin_system);
+    ptask_maxmin_system = NULL;
+  }
+}
+
+/**************************************/
+/******* Resource Private    **********/
+/**************************************/
+
+static e_surf_resource_state_t ptask_resource_get_state(void *cpu)
+{
+  return ((cpu_L07_t)surf_workstation_resource_priv(cpu))->state_current;
+}
+
+static double ptask_get_speed(void *cpu, double load)
+{
+  return load * ((cpu_L07_t)surf_workstation_resource_priv(cpu))->power_scale;
+}
+
+static double ptask_get_available_speed(void *cpu)
+{
+  return ((cpu_L07_t)surf_workstation_resource_priv(cpu))->power_current;
+}
+
+static double ws_get_current_power_peak(void *cpu)
+{
+  return ((cpu_L07_t)surf_workstation_resource_priv(cpu))->power_current;
+}
+
+static double ws_get_power_peak_at(void *cpu, int pstate_index)
+{
+       XBT_DEBUG("[ws_get_power_peak_at] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
+static int ws_get_nb_pstates(void *workstation)
+{
+       XBT_DEBUG("[ws_get_nb_pstates] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
+static void ws_set_power_peak_at(void *cpu, int pstate_index)
+{
+       XBT_DEBUG("[ws_set_power_peak_at] Not implemented for workstation_ptask_L07");
+}
+
+static double ws_get_consumed_energy(void *cpu)
+{
+       XBT_DEBUG("[ws_get_consumed_energy] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
+static surf_action_t ptask_execute_parallel_task(int workstation_nb,
+                                                 void **workstation_list,
+                                                 double
+                                                 *computation_amount, double
+                                                 *communication_amount,
+                                                 double rate)
+{
+  surf_action_workstation_L07_t action = NULL;
+  int i, j;
+  unsigned int cpt;
+  int nb_link = 0;
+  int nb_host = 0;
+  double latency = 0.0;
+
+  if (ptask_parallel_task_link_set == NULL)
+    ptask_parallel_task_link_set = xbt_dict_new_homogeneous(NULL);
+
+  xbt_dict_reset(ptask_parallel_task_link_set);
+
+  /* Compute the number of affected resources... */
+  for (i = 0; i < workstation_nb; i++) {
+    for (j = 0; j < workstation_nb; j++) {
+      xbt_dynar_t route=NULL;
+
+      if (communication_amount[i * workstation_nb + j] > 0) {
+        double lat=0.0;
+        unsigned int cpt;
+        link_L07_t link;
+
+        routing_get_route_and_latency(
+            ((cpu_L07_t)surf_workstation_resource_priv(workstation_list[i]))->info,
+            ((cpu_L07_t)surf_workstation_resource_priv(workstation_list[j]))->info,
+            &route,&lat);
+        latency = MAX(latency, lat);
+
+        xbt_dynar_foreach(route, cpt, link) {
+           xbt_dict_set(ptask_parallel_task_link_set,link->generic_resource.name,link,NULL);
+        }
+      }
+    }
+  }
+
+  nb_link = xbt_dict_length(ptask_parallel_task_link_set);
+  xbt_dict_reset(ptask_parallel_task_link_set);
+
+  for (i = 0; i < workstation_nb; i++)
+    if (computation_amount[i] > 0)
+      nb_host++;
+
+  action =
+      surf_action_new(sizeof(s_surf_action_workstation_L07_t), 1,
+                      surf_workstation_model, 0);
+  XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
+         action, workstation_nb, nb_link);
+  action->suspended = 0;        /* Should be useless because of the
+                                   calloc but it seems to help valgrind... */
+  action->workstation_nb = workstation_nb;
+  action->workstation_list = (cpu_L07_t *) workstation_list;
+  action->computation_amount = computation_amount;
+  action->communication_amount = communication_amount;
+  action->latency = latency;
+  action->rate = rate;
+
+  action->variable =
+      lmm_variable_new(ptask_maxmin_system, action, 1.0,
+                       (action->rate > 0) ? action->rate : -1.0,
+                       workstation_nb + nb_link);
+
+  if (action->latency > 0)
+    lmm_update_variable_weight(ptask_maxmin_system, action->variable, 0.0);
+
+  for (i = 0; i < workstation_nb; i++)
+    lmm_expand(ptask_maxmin_system,
+               ((cpu_L07_t)surf_workstation_resource_priv(workstation_list[i]))->constraint,
+               action->variable, computation_amount[i]);
+
+  for (i = 0; i < workstation_nb; i++) {
+    for (j = 0; j < workstation_nb; j++) {
+      link_L07_t link;
+      xbt_dynar_t route=NULL;
+      if (communication_amount[i * workstation_nb + j] == 0.0)
+        continue;
+
+      routing_get_route_and_latency(
+          ((cpu_L07_t)surf_workstation_resource_priv(workstation_list[i]))->info,
+          ((cpu_L07_t)surf_workstation_resource_priv(workstation_list[j]))->info,
+          &route,NULL);
+
+      xbt_dynar_foreach(route, cpt, link) {
+        lmm_expand_add(ptask_maxmin_system, link->constraint,
+                       action->variable,
+                       communication_amount[i * workstation_nb + j]);
+      }
+    }
+  }
+
+  if (nb_link + nb_host == 0) {
+    action->generic_action.cost = 1.0;
+    action->generic_action.remains = 0.0;
+  }
+
+  return (surf_action_t) action;
+}
+
+static surf_action_t ptask_execute(void *cpu, double size)
+{
+  void **workstation_list = xbt_new0(void *, 1);
+  double *computation_amount = xbt_new0(double, 1);
+  double *communication_amount = xbt_new0(double, 1);
+
+  workstation_list[0] = cpu;
+  communication_amount[0] = 0.0;
+  computation_amount[0] = size;
+
+  return ptask_execute_parallel_task(1, workstation_list,
+                                     computation_amount,
+                                     communication_amount, -1);
+}
+
+static surf_action_t ptask_communicate(void *src, void *dst, double size,
+                                       double rate)
+{
+  void **workstation_list = xbt_new0(void *, 2);
+  double *computation_amount = xbt_new0(double, 2);
+  double *communication_amount = xbt_new0(double, 4);
+  surf_action_t res = NULL;
+
+  workstation_list[0] = src;
+  workstation_list[1] = dst;
+  communication_amount[1] = size;
+
+  res = ptask_execute_parallel_task(2, workstation_list,
+                                    computation_amount,
+                                    communication_amount, rate);
+
+  return res;
+}
+
+static surf_action_t ptask_action_sleep(void *cpu, double duration)
+{
+  surf_action_workstation_L07_t action = NULL;
+
+  XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
+
+  action = (surf_action_workstation_L07_t) ptask_execute(cpu, 1.0);
+  action->generic_action.max_duration = duration;
+  action->suspended = 2;
+  lmm_update_variable_weight(ptask_maxmin_system, action->variable, 0.0);
+
+  XBT_OUT();
+  return (surf_action_t) action;
+}
+
+static xbt_dynar_t ptask_get_route(void *src, void *dst) // FIXME: kill that callback kind?
+{
+  xbt_dynar_t route=NULL;
+  routing_get_route_and_latency(
+      ((cpu_L07_t)surf_workstation_resource_priv(src))->info, ((cpu_L07_t)surf_workstation_resource_priv(dst))->info,
+      &route,NULL);
+  return route;
+}
+
+static double ptask_get_link_bandwidth(const void *link)
+{
+  return ((link_L07_t) link)->bw_current;
+}
+
+static double ptask_get_link_latency(const void *link)
+{
+  return ((link_L07_t) link)->lat_current;
+}
+
+static int ptask_link_shared(const void *link)
+{
+  return lmm_constraint_is_shared(((link_L07_t) link)->constraint);
+}
+
+/**************************************/
+/*** Resource Creation & Destruction **/
+/**************************************/
+
+static void* ptask_cpu_create_resource(const char *name, double power_scale,
+                               double power_initial,
+                               tmgr_trace_t power_trace,
+                               e_surf_resource_state_t state_initial,
+                               tmgr_trace_t state_trace,
+                               xbt_dict_t cpu_properties)
+{
+  cpu_L07_t cpu = NULL;
+  xbt_assert(!surf_workstation_resource_priv(surf_workstation_resource_by_name(name)),
+              "Host '%s' declared several times in the platform file.",
+              name);
+
+  cpu = (cpu_L07_t) surf_resource_new(sizeof(s_cpu_L07_t),
+          surf_workstation_model, name,cpu_properties, NULL);
+
+  cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
+  cpu->info = xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL);
+  if(!(cpu->info)) xbt_die("Don't find ROUTING_HOST_LEVEL for '%s'",name);
+
+  cpu->power_scale = power_scale;
+  xbt_assert(cpu->power_scale > 0, "Power has to be >0");
+
+  cpu->power_current = power_initial;
+  if (power_trace)
+    cpu->power_event =
+        tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
+
+  cpu->state_current = state_initial;
+  if (state_trace)
+    cpu->state_event =
+        tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
+
+  cpu->constraint =
+      lmm_constraint_new(ptask_maxmin_system, cpu,
+                         cpu->power_current * cpu->power_scale);
+
+  xbt_lib_set(host_lib, name, SURF_WKS_LEVEL, cpu);
+
+  return xbt_lib_get_elm_or_null(host_lib, name);
+}
+
+static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
+{
+  double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double);
+ //cpu->power_peak = power_peak;
+  xbt_dynar_free(&(host->power_peak));  /* kill memory leak */
+  ptask_cpu_create_resource(
+      host->id,
+      power_peak,
+      host->power_scale,
+      host->power_trace,
+      host->initial_state,
+      host->state_trace,
+      host->properties);
+}
+
+static void* ptask_link_create_resource(const char *name,
+                                 double bw_initial,
+                                 tmgr_trace_t bw_trace,
+                                 double lat_initial,
+                                 tmgr_trace_t lat_trace,
+                                 e_surf_resource_state_t
+                                 state_initial,
+                                 tmgr_trace_t state_trace,
+                                 e_surf_link_sharing_policy_t
+                                 policy, xbt_dict_t properties)
+{
+  link_L07_t nw_link = xbt_new0(s_link_L07_t, 1);
+  xbt_assert(!xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL),
+              "Link '%s' declared several times in the platform file.",
+              name);
+
+  nw_link->generic_resource.model = surf_workstation_model;
+  nw_link->generic_resource.properties = properties;
+  nw_link->generic_resource.name = xbt_strdup(name);
+  nw_link->type = SURF_WORKSTATION_RESOURCE_LINK;
+  nw_link->bw_current = bw_initial;
+  if (bw_trace)
+    nw_link->bw_event =
+        tmgr_history_add_trace(history, bw_trace, 0.0, 0, nw_link);
+  nw_link->state_current = state_initial;
+  nw_link->lat_current = lat_initial;
+  if (lat_trace)
+    nw_link->lat_event =
+        tmgr_history_add_trace(history, lat_trace, 0.0, 0, nw_link);
+  if (state_trace)
+    nw_link->state_event =
+        tmgr_history_add_trace(history, state_trace, 0.0, 0, nw_link);
+
+  nw_link->constraint =
+      lmm_constraint_new(ptask_maxmin_system, nw_link,
+                         nw_link->bw_current);
+
+  if (policy == SURF_LINK_FATPIPE)
+    lmm_constraint_shared(nw_link->constraint);
+
+  xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, nw_link);
+  return nw_link;
+}
+
+static void ptask_parse_link_init(sg_platf_link_cbarg_t link)
+{
+  if (link->policy == SURF_LINK_FULLDUPLEX) {
+    char *link_id;
+    link_id = bprintf("%s_UP", link->id);
+    ptask_link_create_resource(link_id,
+                               link->bandwidth,
+                               link->bandwidth_trace,
+                               link->latency,
+                               link->latency_trace,
+                               link->state,
+                               link->state_trace,
+                               link->policy,
+                               link->properties);
+    xbt_free(link_id);
+    link_id = bprintf("%s_DOWN", link->id);
+    ptask_link_create_resource(link_id,
+                               link->bandwidth,
+                               link->bandwidth_trace,
+                               link->latency,
+                               link->latency_trace,
+                               link->state,
+                               link->state_trace,
+                               link->policy,
+                               NULL); /* FIXME: We need to deep copy the
+                                       * properties or we won't be able to free
+                                       * it */
+    xbt_free(link_id);
+  } else {
+    ptask_link_create_resource(link->id,
+                               link->bandwidth,
+                               link->bandwidth_trace,
+                               link->latency,
+                               link->latency_trace,
+                               link->state,
+                               link->state_trace,
+                               link->policy,
+                               link->properties);
+  }
+
+  current_property_set = NULL;
+}
+
+static void ptask_add_traces(void)
+{
+  xbt_dict_cursor_t cursor = NULL;
+  char *trace_name, *elm;
+
+  if (!trace_connect_list_host_avail)
+    return;
+
+  /* Connect traces relative to cpu */
+  xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_L07_t host = surf_workstation_resource_priv(surf_workstation_resource_by_name(elm));
+
+    xbt_assert(host, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    host->state_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, host);
+  }
+
+  xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    cpu_L07_t host = surf_workstation_resource_priv(surf_workstation_resource_by_name(elm));
+
+    xbt_assert(host, "Host %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    host->power_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, host);
+  }
+
+  /* Connect traces relative to network */
+  xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_L07_t link =
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Link %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    link->state_event =
+        tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+
+  xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_L07_t link =
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Link %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    link->bw_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+
+  xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
+    tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
+    link_L07_t link =
+        xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+
+    xbt_assert(link, "Link %s undefined", elm);
+    xbt_assert(trace, "Trace %s undefined", trace_name);
+
+    link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
+  }
+}
+
+static void ptask_define_callbacks()
+{
+  sg_platf_host_add_cb(ptask_parse_cpu_init);
+  sg_platf_link_add_cb(ptask_parse_link_init);
+  sg_platf_postparse_add_cb(ptask_add_traces);
+}
+
+/**************************************/
+/********* Module  creation ***********/
+/**************************************/
+
+static void ptask_model_init_internal(void)
+{
+  surf_workstation_model = surf_model_init();
+
+  surf_workstation_model->action_unref = ptask_action_unref;
+  surf_workstation_model->action_cancel = ptask_action_cancel;
+  surf_workstation_model->action_state_set = surf_action_state_set;
+  surf_workstation_model->suspend = ptask_action_suspend;
+  surf_workstation_model->resume = ptask_action_resume;
+  surf_workstation_model->is_suspended = ptask_action_is_suspended;
+  surf_workstation_model->set_max_duration = ptask_action_set_max_duration;
+  surf_workstation_model->set_priority = ptask_action_set_priority;
+  surf_workstation_model->get_remains = ptask_action_get_remains;
+  surf_workstation_model->name = "Workstation ptask_L07";
+
+  surf_workstation_model->model_private->resource_used =
+      ptask_resource_used;
+  surf_workstation_model->model_private->share_resources =
+      ptask_share_resources;
+  surf_workstation_model->model_private->update_actions_state =
+      ptask_update_actions_state;
+  surf_workstation_model->model_private->update_resource_state =
+      ptask_update_resource_state;
+  surf_workstation_model->model_private->finalize = ptask_finalize;
+
+
+  surf_workstation_model->extension.workstation.execute = ptask_execute;
+  surf_workstation_model->extension.workstation.sleep = ptask_action_sleep;
+  surf_workstation_model->extension.workstation.get_state =
+      ptask_resource_get_state;
+  surf_workstation_model->extension.workstation.get_speed =
+      ptask_get_speed;
+  surf_workstation_model->extension.workstation.get_available_speed =
+      ptask_get_available_speed;
+  surf_workstation_model->extension.workstation.get_current_power_peak = ws_get_current_power_peak;
+  surf_workstation_model->extension.workstation.get_power_peak_at = ws_get_power_peak_at;
+  surf_workstation_model->extension.workstation.get_nb_pstates = ws_get_nb_pstates;
+  surf_workstation_model->extension.workstation.set_power_peak_at = ws_set_power_peak_at;
+  surf_workstation_model->extension.workstation.get_consumed_energy = ws_get_consumed_energy;
+
+  surf_workstation_model->extension.workstation.communicate =
+      ptask_communicate;
+  surf_workstation_model->extension.workstation.get_route =
+      ptask_get_route;
+  surf_workstation_model->extension.workstation.execute_parallel_task =
+      ptask_execute_parallel_task;
+  surf_workstation_model->extension.workstation.get_link_bandwidth =
+      ptask_get_link_bandwidth;
+  surf_workstation_model->extension.workstation.get_link_latency =
+      ptask_get_link_latency;
+  surf_workstation_model->extension.workstation.link_shared =
+      ptask_link_shared;
+  surf_workstation_model->extension.workstation.get_properties =
+      surf_resource_properties;
+  surf_workstation_model->extension.workstation.add_traces =
+      ptask_add_traces;
+
+  if (!ptask_maxmin_system)
+    ptask_maxmin_system = lmm_system_new(1);
+
+  routing_model_create(ptask_link_create_resource("__loopback__",
+                                                  498000000, NULL,
+                                                  0.000015, NULL,
+                                                  SURF_RESOURCE_ON, NULL,
+                                                  SURF_LINK_FATPIPE, NULL));
+
+  surf_network_model = surf_model_init();
+
+  surf_network_model->extension.network.communicate = die_impossible_communicate;
+  surf_network_model->extension.network.get_route = die_impossible_get_route;
+  surf_network_model->extension.network.get_link_bandwidth = ptask_get_link_bandwidth;
+  surf_network_model->extension.network.get_link_latency = ptask_get_link_latency;
+  surf_network_model->extension.network.link_shared = ptask_link_shared;
+  surf_network_model->extension.network.add_traces = NULL;
+}
+
+/**************************************/
+/*************** Generic **************/
+/**************************************/
+void surf_workstation_model_init_ptask_L07(void)
+{
+  XBT_INFO("surf_workstation_model_init_ptask_L07");
+  xbt_assert(!surf_cpu_model, "CPU model type already defined");
+  xbt_assert(!surf_network_model, "network model type already defined");
+  ptask_define_callbacks();
+  ptask_model_init_internal();
+  xbt_dynar_push(model_list, &surf_workstation_model);
+}
index 8f11693..507d25e 100644 (file)
@@ -443,6 +443,29 @@ WorkstationL07::WorkstationL07(WorkstationModelPtr model, const char* name, xbt_
 {
 }
 
+double WorkstationL07::getPowerPeakAt(int pstate_index)
+{
+       XBT_DEBUG("[ws_get_power_peak_at] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
+int WorkstationL07::getNbPstates()
+{
+       XBT_DEBUG("[ws_get_nb_pstates] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
+void WorkstationL07::setPowerPeakAt(int pstate_index)
+{
+       XBT_DEBUG("[ws_set_power_peak_at] Not implemented for workstation_ptask_L07");
+}
+
+double WorkstationL07::getConsumedEnergy()
+{
+       XBT_DEBUG("[ws_get_consumed_energy] Not implemented for workstation_ptask_L07");
+       return 0.0;
+}
+
 CpuL07::CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t props)
  : Resource(model, name, props), CpuLmm(model, name, props) {
 
@@ -740,9 +763,12 @@ static void ptask_finalize(void)
 
 static void ptask_parse_workstation_init(sg_platf_host_cbarg_t host)
 {
+  double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double);
+  //cpu->power_peak = power_peak;
+  xbt_dynar_free(&(host->power_peak));  /* kill memory leak */
   static_cast<WorkstationL07ModelPtr>(surf_workstation_model)->createResource(
       host->id,
-      host->power_peak,
+      power_peak,
       host->power_scale,
       host->power_trace,
       host->initial_state,
@@ -752,9 +778,10 @@ static void ptask_parse_workstation_init(sg_platf_host_cbarg_t host)
 
 static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
 {
-       static_cast<CpuL07ModelPtr>(surf_cpu_model)->createResource(
+  double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double);
+  static_cast<CpuL07ModelPtr>(surf_cpu_model)->createResource(
       host->id,
-      host->power_peak,
+      power_peak,
       host->power_scale,
       host->power_trace,
       host->initial_state,
index ded3df2..0cd7713 100644 (file)
@@ -111,6 +111,10 @@ public:
   ActionPtr execute(double size);
   ActionPtr sleep(double duration);
   e_surf_resource_state_t getState();
+  double getPowerPeakAt(int pstate_index);
+  int getNbPstates();
+  void setPowerPeakAt(int pstate_index);
+  double getConsumedEnergy();
 };
 
 class CpuL07 : public CpuLmm {
@@ -124,6 +128,13 @@ public:
   double getAvailableSpeed();
   ActionPtr execute(double size) {DIE_IMPOSSIBLE;};
   ActionPtr sleep(double duration) {DIE_IMPOSSIBLE;};
+
+  double getCurrentPowerPeak() {};
+  double getPowerPeakAt(int pstate_index) {};
+  int getNbPstates() {};
+  void setPowerPeakAt(int pstate_index) {};
+  double getConsumedEnergy() {};
+
   double m_powerCurrent;
 };
 
index 9f0d9f2..36a84ee 100644 (file)
@@ -4,7 +4,7 @@
 
 /* config.h - simgrid config selection for windows platforms. */
 
-/* Copyright (c) 2006, 2007, 2008, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2008, 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7e0916a..e3abf53 100644 (file)
@@ -1,6 +1,7 @@
 /* automaton - representation of büchi automaton */
 
-/* Copyright (c) 2011-2013. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2011-2013. 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. */
index 34dcbc5..1fbf4e5 100644 (file)
@@ -1,6 +1,7 @@
 /* methods for implementation of automaton from promela description */
 
-/* Copyright (c) 2011-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2011-2013. 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. */
index 0fe4f77..3b86fe7 100644 (file)
@@ -1,6 +1,6 @@
 /* backtrace_dummy -- stubs of this module for non-supported archs          */
 
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7ca1899..da9ced5 100644 (file)
@@ -1,7 +1,7 @@
 /* backtrace_linux - backtrace displaying on linux platform                 */
 /* This file is included by ex.c on need (have execinfo.h, popen & addrline)*/
 
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0ad381d..c21dacc 100644 (file)
@@ -1,7 +1,7 @@
 /* backtrace_windows - backtrace displaying on windows platform             */
 /* This file is included by ex.c on need (windows x86)                      */
 
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2eee32a..7873dd4 100644 (file)
@@ -2,7 +2,7 @@
 
 /* This is useful to build named structs, like option or property sets.     */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -66,7 +66,7 @@ static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t cfg, const char *name,
 
 /** @brief Constructor
  *
- * Initialise an config set
+ * Initialise a config set
  */
 
 
@@ -77,8 +77,8 @@ xbt_cfg_t xbt_cfg_new(void)
 
 /** \brief Copy an existing configuration set
  *
- * \arg whereto the config set to be created
- * \arg tocopy the source data
+ * @param whereto the config set to be created
+ * @param tocopy the source data
  *
  * This only copy the registrations, not the actual content
  */
@@ -94,7 +94,7 @@ void xbt_cfg_cpy(xbt_cfg_t tocopy, xbt_cfg_t * whereto)
   xbt_assert(tocopy, "cannot copy NULL config");
 
   xbt_dict_foreach((xbt_dict_t) tocopy, cursor, name, variable) {
-    xbt_cfg_register(whereto, name, variable->desc, variable->type, NULL,
+    xbt_cfg_register(whereto, name, variable->desc, variable->type,
                      variable->min, variable->max, variable->cb_set,
                      variable->cb_rm);
   }
@@ -109,9 +109,9 @@ void xbt_cfg_free(xbt_cfg_t * cfg)
 
 /** @brief Dump a config set for debuging purpose
  *
- * \arg name The name to give to this config set
- * \arg indent what to write at the begining of each line (right number of spaces)
- * \arg cfg the config set
+ * @param name The name to give to this config set
+ * @param indent what to write at the begining of each line (right number of spaces)
+ * @param cfg the config set
  */
 void xbt_cfg_dump(const char *name, const char *indent, xbt_cfg_t cfg)
 {
@@ -210,16 +210,20 @@ void xbt_cfgelm_free(void *data)
 
 /** @brief Register an element within a config set
  *
- *  @arg cfg the config set
- *  @arg type the type of the config element
- *  @arg min the minimum
- *  @arg max the maximum
+ *  @param cfg the config set
+ *  @param name the name of the config element
+ *  @param desc a description for this item (used by xbt_cfg_help())
+ *  @param type the type of the config element
+ *  @param min the minimum number of values for this config element
+ *  @param max the maximum number of values for this config element
+ *  @param cb_set callback function called when a value is set
+ *  @param cb_rm callback function called when a value is removed
  */
 
 void
 xbt_cfg_register(xbt_cfg_t * cfg,
                  const char *name, const char *desc,
-                 e_xbt_cfgelm_type_t type, void *default_value, int min,
+                 e_xbt_cfgelm_type_t type, int min,
                  int max, xbt_cfg_cb_t cb_set, xbt_cfg_cb_t cb_rm)
 {
   xbt_cfgelm_t res;
@@ -252,32 +256,22 @@ xbt_cfg_register(xbt_cfg_t * cfg,
   switch (type) {
   case xbt_cfgelm_int:
     res->content = xbt_dynar_new(sizeof(int), NULL);
-    if (default_value)
-      xbt_dynar_push(res->content, default_value);
     break;
 
   case xbt_cfgelm_double:
     res->content = xbt_dynar_new(sizeof(double), NULL);
-    if (default_value)
-      xbt_dynar_push(res->content, default_value);
     break;
 
   case xbt_cfgelm_string:
     res->content = xbt_dynar_new(sizeof(char *), xbt_free_ref);
-    if (default_value)
-      xbt_dynar_push(res->content, default_value);
     break;
 
   case xbt_cfgelm_boolean:
     res->content = xbt_dynar_new(sizeof(int), NULL);
-    if (default_value)
-      xbt_dynar_push(res->content, default_value);
     break;
 
   case xbt_cfgelm_peer:
     res->content = xbt_dynar_new(sizeof(xbt_peer_t), xbt_peer_free_voidp);
-    if (default_value)
-      xbt_dynar_push(res->content, default_value);
     break;
 
   default:
@@ -289,8 +283,8 @@ xbt_cfg_register(xbt_cfg_t * cfg,
 
 /** @brief Unregister an element from a config set.
  *
- *  @arg cfg the config set
- *  @arg name the name of the elem to be freed
+ *  @param cfg the config set
+ *  @param name the name of the elem to be freed
  *
  *  Note that it removes both the description and the actual content.
  *  Throws not_found when no such element exists.
@@ -305,8 +299,8 @@ void xbt_cfg_unregister(xbt_cfg_t cfg, const char *name)
 /**
  * @brief Parse a string and register the stuff described.
  *
- * @arg cfg the config set
- * @arg entry a string describing the element to register
+ * @param cfg the config set
+ * @param entry a string describing the element to register
  *
  * The string may consist in several variable descriptions separated by a space.
  * Each of them must use the following syntax: \<name\>:\<min nb\>_to_\<max nb\>_\<type\>
@@ -354,7 +348,7 @@ void xbt_cfg_register_str(xbt_cfg_t * cfg, const char *entry)
               "Invalid type in config element descriptor: %s%s", entry,
               "; Should be one of 'string', 'int', 'peer' or 'double'.");
 
-  xbt_cfg_register(cfg, entrycpy, NULL, type, NULL, min, max, NULL, NULL);
+  xbt_cfg_register(cfg, entrycpy, NULL, type, min, max, NULL, NULL);
 
   free(entrycpy);               /* strdup'ed by dict mechanism, but cannot be const */
 }
@@ -412,9 +406,16 @@ void xbt_cfg_help(xbt_cfg_t cfg)
         printf("'%s'%s", xbt_dynar_get_as(variable->content, i, char *), sep);
         break;
 
-      case xbt_cfgelm_boolean:
-        printf("'%d'%s", xbt_dynar_get_as(variable->content, i, int), sep);
+      case xbt_cfgelm_boolean: {
+        int b = xbt_dynar_get_as(variable->content, i, int);
+        const char *bs = b ? xbt_cfgelm_boolean_values[0].true_val
+                           : xbt_cfgelm_boolean_values[0].false_val;
+        if (b == 0 || b == 1)
+          printf("'%s'%s", bs, sep);
+        else
+          printf("'%s/%d'%s", bs, b, sep);
         break;
+      }
 
       case xbt_cfgelm_peer: {
         xbt_peer_t hval = xbt_dynar_get_as(variable->content, i, xbt_peer_t);
@@ -487,10 +488,10 @@ static xbt_cfgelm_t xbt_cfgelm_get(xbt_cfg_t cfg,
 
 /** @brief Get the type of this variable in that configuration set
  *
- * \arg cfg the config set
- * \arg name the name of the element
- * \arg type the result
+ * @param cfg the config set
+ * @param name the name of the element
  *
+ * @return the type of the given element
  */
 
 e_xbt_cfgelm_type_t xbt_cfg_get_type(xbt_cfg_t cfg, const char *name)
@@ -512,9 +513,9 @@ e_xbt_cfgelm_type_t xbt_cfg_get_type(xbt_cfg_t cfg, const char *name)
 /*----[ Setting ]---------------------------------------------------------*/
 /**  @brief va_args version of xbt_cfg_set
  *
- * \arg cfg config set to fill
- * \arg n   variable name
- * \arg pa  variable value
+ * @param cfg config set to fill
+ * @param name  variable name
+ * @param pa  variable value
  *
  * Add some values to the config set.
  */
@@ -574,9 +575,9 @@ void xbt_cfg_set_vargs(xbt_cfg_t cfg, const char *name, va_list pa)
 
 /** @brief Add a NULL-terminated list of pairs {(char*)key, value} to the set
  *
- * \arg cfg config set to fill
- * \arg name variable name
- * \arg varargs variable value
+ * @param cfg config set to fill
+ * @param name variable name
+ * @param ... variable value
  *
  */
 void xbt_cfg_set(xbt_cfg_t cfg, const char *name, ...)
@@ -590,8 +591,8 @@ void xbt_cfg_set(xbt_cfg_t cfg, const char *name, ...)
 
 /** @brief Add values parsed from a string into a config set
  *
- * \arg cfg config set to fill
- * \arg options a string containing the content to add to the config set. This
+ * @param cfg config set to fill
+ * @param options a string containing the content to add to the config set. This
  * is a '\\t',' ' or '\\n' or ',' separated list of variables. Each individual variable is
  * like "[name]:[value]" where [name] is the name of an already registred
  * variable, and [value] conforms to the data type under which this variable was
@@ -657,7 +658,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) {
 
     val = strchr(name, ':');
     if (!val) {
-      free(optionlist_cpy);
+      /* don't free(optionlist_cpy) here, 'name' points inside it */
       xbt_die("Option '%s' badly formated. Should be of the form 'name:value'",
               name);
     }
@@ -678,9 +679,9 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) {
 
 /** @brief Set the value of a variable, using the string representation of that value
  *
- * @arg cfg config set to modify
- * @arg key name of the variable to modify
- * @arg value string representation of the value to set
+ * @param cfg config set to modify
+ * @param key name of the variable to modify
+ * @param value string representation of the value to set
  *
  * @return the first char after the parsed value in val
  */
@@ -794,7 +795,7 @@ void xbt_cfg_setdefault_double(xbt_cfg_t cfg, const char *name, double val)
   }
   else
     XBT_DEBUG
-        ("Do not override configuration variable '%s' with value '%lf' because it was already set.",
+        ("Do not override configuration variable '%s' with value '%f' because it was already set.",
          name, val);
 }
 
@@ -860,9 +861,9 @@ void xbt_cfg_setdefault_peer(xbt_cfg_t cfg, const char *name,
 
 /** @brief Set or add an integer value to \a name within \a cfg
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value of the variable
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value of the variable
  */
 void xbt_cfg_set_int(xbt_cfg_t cfg, const char *name, int val)
 {
@@ -894,9 +895,9 @@ void xbt_cfg_set_int(xbt_cfg_t cfg, const char *name, int val)
 
 /** @brief Set or add a double value to \a name within \a cfg
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the doule to set
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the doule to set
  */
 
 void xbt_cfg_set_double(xbt_cfg_t cfg, const char *name, double val)
@@ -928,9 +929,9 @@ void xbt_cfg_set_double(xbt_cfg_t cfg, const char *name, double val)
 
 /** @brief Set or add a string value to \a name within \a cfg
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value to be added
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value to be added
  *
  */
 
@@ -973,9 +974,9 @@ void xbt_cfg_set_string(xbt_cfg_t cfg, const char *name, const char *val)
 
 /** @brief Set or add a boolean value to \a name within \a cfg
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value of the variable
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value of the variable
  */
 void xbt_cfg_set_boolean(xbt_cfg_t cfg, const char *name, const char *val)
 {
@@ -1022,10 +1023,10 @@ void xbt_cfg_set_boolean(xbt_cfg_t cfg, const char *name, const char *val)
 
 /** @brief Set or add an peer value to \a name within \a cfg
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg peer the peer
- * \arg port the port number
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param peer the peer
+ * @param port the port number
  *
  * \e peer values are composed of a string (peername) and an integer (port)
  */
@@ -1065,9 +1066,9 @@ xbt_cfg_set_peer(xbt_cfg_t cfg, const char *name, const char *peer,
 
 /** @brief Remove the provided \e val integer value from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value to be removed
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value to be removed
  */
 void xbt_cfg_rm_int(xbt_cfg_t cfg, const char *name, int val)
 {
@@ -1099,9 +1100,9 @@ void xbt_cfg_rm_int(xbt_cfg_t cfg, const char *name, int val)
 
 /** @brief Remove the provided \e val double value from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value to be removed
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value to be removed
  */
 
 void xbt_cfg_rm_double(xbt_cfg_t cfg, const char *name, double val)
@@ -1133,9 +1134,9 @@ void xbt_cfg_rm_double(xbt_cfg_t cfg, const char *name, double val)
 
 /** @brief Remove the provided \e val string value from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value of the string which will be removed
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value of the string which will be removed
  */
 void xbt_cfg_rm_string(xbt_cfg_t cfg, const char *name, const char *val)
 {
@@ -1166,9 +1167,9 @@ void xbt_cfg_rm_string(xbt_cfg_t cfg, const char *name, const char *val)
 
 /** @brief Remove the provided \e val boolean value from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the value to be removed
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param val the value to be removed
  */
 void xbt_cfg_rm_boolean(xbt_cfg_t cfg, const char *name, int val)
 {
@@ -1200,10 +1201,10 @@ void xbt_cfg_rm_boolean(xbt_cfg_t cfg, const char *name, int val)
 
 /** @brief Remove the provided \e val peer value from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg peer the peername
- * \arg port the port number
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param peer the peername
+ * @param port the port number
  */
 
 void
@@ -1256,8 +1257,8 @@ void xbt_cfg_rm_at(xbt_cfg_t cfg, const char *name, int pos)
 
 /** @brief Remove all the values from a variable
  *
- * \arg cfg the config set
- * \arg name the name of the variable
+ * @param cfg the config set
+ * @param name the name of the variable
  */
 
 void xbt_cfg_empty(xbt_cfg_t cfg, const char *name)
@@ -1302,9 +1303,8 @@ int xbt_cfg_is_default_value(xbt_cfg_t cfg, const char *name)
 
 /** @brief Retrieve an integer value of a variable (get a warning if not uniq)
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the wanted value
+ * @param cfg the config set
+ * @param name the name of the variable
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using
@@ -1327,9 +1327,8 @@ int xbt_cfg_get_int(xbt_cfg_t cfg, const char *name)
 
 /** @brief Retrieve a double value of a variable (get a warning if not uniq)
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the wanted value
+ * @param cfg the config set
+ * @param name the name of the variable
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using
@@ -1353,9 +1352,8 @@ double xbt_cfg_get_double(xbt_cfg_t cfg, const char *name)
 
 /** @brief Retrieve a string value of a variable (get a warning if not uniq)
  *
- * \arg th the config set
- * \arg name the name of the variable
- * \arg val the wanted value
+ * @param cfg the config set
+ * @param name the name of the variable
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using
@@ -1381,9 +1379,8 @@ char *xbt_cfg_get_string(xbt_cfg_t cfg, const char *name)
 
 /** @brief Retrieve a boolean value of a variable (get a warning if not uniq)
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg val the wanted value
+ * @param cfg the config set
+ * @param name the name of the variable
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using
@@ -1406,10 +1403,10 @@ int xbt_cfg_get_boolean(xbt_cfg_t cfg, const char *name)
 
 /** @brief Retrieve an peer value of a variable (get a warning if not uniq)
  *
- * \arg cfg the config set
- * \arg name the name of the variable
- * \arg peer the peer
- * \arg port the port number
+ * @param cfg the config set
+ * @param name the name of the variable
+ * @param peer the peer
+ * @param port the port number
  *
  * Returns the first value from the config set under the given name.
  * If there is more than one value, it will issue a warning. Consider using
@@ -1439,9 +1436,8 @@ void xbt_cfg_get_peer(xbt_cfg_t cfg, const char *name, char **peer,
 
 /** @brief Retrieve the dynar of all the values stored in a variable
  *
- * \arg cfg where to search in
- * \arg name what to search for
- * \arg dynar result
+ * @param cfg where to search in
+ * @param name what to search for
  *
  * Get the data stored in the config set.
  *
index a3798ee..dd06384 100644 (file)
@@ -1,6 +1,6 @@
 /* cunit - A little C Unit facility                                         */
 
-/* Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2005-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b2726fd..be839e3 100644 (file)
@@ -1,6 +1,6 @@
 /* dict - a generic dictionary, variation over hash table                   */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -713,19 +713,24 @@ static void fill(xbt_dict_t * head, int homogeneous)
 
 static void search_ext(xbt_dict_t head, const char *key, const char *data)
 {
-  void *found;
+  char *found;
 
   xbt_test_add("Search %s", key);
   found = xbt_dict_get(head, key);
-  xbt_test_log("Found %s", (char *) found);
-  if (data)
+  xbt_test_log("Found %s", found);
+  if (data) {
     xbt_test_assert(found,
-                     "data do not match expectations: found NULL while searching for %s",
-                     data);
-  if (found)
-    xbt_test_assert(!strcmp((char *) data, found),
-                     "data do not match expectations: found %s while searching for %s",
-                     (char *) found, data);
+                    "data do not match expectations: found NULL while searching for %s",
+                    data);
+    if (found)
+      xbt_test_assert(!strcmp(data, found),
+                      "data do not match expectations: found %s while searching for %s",
+                      found, data);
+  } else {
+    xbt_test_assert(!found,
+                    "data do not match expectations: found %s while searching for NULL",
+                    found);
+  }
 }
 
 static void search(xbt_dict_t head, const char *key)
index cd7e189..790536c 100644 (file)
@@ -1,6 +1,6 @@
 /* dict_cursor - iterators over dictionnaries                               */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 540c7d9..3ac7b11 100644 (file)
@@ -1,6 +1,6 @@
 /* dict - a generic dictionary, variation over hash table                   */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a6f8887..3051278 100644 (file)
@@ -1,6 +1,6 @@
 /* dict_multi - dictionnaries of dictionnaries of ... of data               */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 77292d1..f5ccfd9 100644 (file)
@@ -1,7 +1,7 @@
 /* dict_elm - elements of generic dictionnaries                             */
 /* This file is not to be loaded from anywhere but dict.c                   */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index b29a851..7517190 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic DYNamic ARray implementation.                                  */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f383208..9433046 100644 (file)
@@ -1,6 +1,6 @@
 /* ex - Exception Handling                                                  */
 
-/*  Copyright (c) 2005-2010 The SimGrid team                                */
+/*  Copyright (c) 2005-2013. The SimGrid Team.                              */
 /*  Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com>       */
 /*  Copyright (c) 2002-2004 The OSSP Project <http://www.ossp.org/>         */
 /*  Copyright (c) 2002-2004 Cable & Wireless <http://www.cw.com/>           */
@@ -75,7 +75,7 @@ xbt_running_ctx_t *__xbt_ex_ctx_default(void)
      real life and in simulation when using threads to implement the simulation
      processes (ie, with pthreads and on windows).
 
-     It also gets overriden in xbt/context.c when using ucontextes (as well as
+     It also gets overriden in xbt/context.c when using ucontexts (as well as
      in Java for now, but after the java overhaul, it will get cleaned out)
    */
   static xbt_running_ctx_t ctx = XBT_RUNNING_CTX_INITIALIZER;
index ca34f34..11ebf27 100644 (file)
@@ -2,7 +2,7 @@
 /* This file is to loaded in any location defining exception handlers       */
 /* (such as context.c), to exchange them.        */
 
-/* Copyright (c) 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 841aebe..e28cc7e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 9c40bed..64067af 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 20092010. The SimGrid Team.
+/* Copyright (c) 2004, 2009-2010. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 05e32c2..6e5fdb1 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic graph library.                                                 */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 70a9728..9028ed6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006, 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3edfa48..679e9b1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c795b76..ac3cafe 100644 (file)
@@ -1,6 +1,6 @@
 /* a generic and efficient heap                                             */
 
-/* Copyright (c) 2004, 2005, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -123,11 +123,11 @@ void *xbt_heap_pop(xbt_heap_t H)
   int size = H->size;
   void *max;
 
-  XBT_DEBUG("Heap has %d elements before extraction and max elem was %g",xbt_heap_size(H),xbt_heap_maxkey(H));
-
   if (H->count == 0)
     return NULL;
 
+  XBT_DEBUG("Heap has %d elements before extraction and max elem was %g",xbt_heap_size(H),xbt_heap_maxkey(H));
+
   max = CONTENT(H, 0);
 
   items[0] = items[(H->count) - 1];
index 40a17af..6ff1e78 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ccb1e0e..cc6f9e6 100644 (file)
@@ -1,6 +1,6 @@
 /* lib - a generic library, variation over dictionary                    */
 
-/* Copyright (c) 2011. The SimGrid Team.
+/* Copyright (c) 2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fd8d595..fd81fda 100644 (file)
@@ -1,6 +1,6 @@
 /* log - a generic logging facility in the spirit of log4j                  */
 
-/* Copyright (c) 2004-2011. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -1099,7 +1099,12 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
         break;
       }
     }
-    if (i < xbt_log_priority_infinite) {
+
+    if(i<XBT_LOG_STATIC_THRESHOLD){
+     THROWF(arg_error, 0,
+             "Priority: %s is above allowed priority : %s (for debug and trace levels, recompile SimGrid with -Denable_debug=ON)",
+             eq + 1, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
+    }else if (i < xbt_log_priority_infinite) {
       set->thresh = (e_xbt_log_priority_t) i;
     } else {
       THROWF(arg_error, 0,
index 1088355..8528834 100644 (file)
@@ -1,6 +1,6 @@
 /* mallocator - recycle objects to avoid malloc() / free()                  */
 
-/* Copyright (c) 2006-2011. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e5e918c..266c026 100644 (file)
@@ -1,6 +1,6 @@
 /* mallocator - recycle objects to avoid malloc() / free()                  */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ad5e05e..6cfd06c 100644 (file)
@@ -4,7 +4,7 @@
    Written May 1989 by Mike Haertel.
    Heavily modified Mar 1992 by Fred Fish.  (fnf@cygnus.com) */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -168,7 +168,8 @@ void mfree(struct mdesc *mdp, void *ptr)
 
     /* Set size used in the fragment to -1 */
     mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1;
-    
+    mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
+
 //    fprintf(stderr,"nfree:%zu capa:%d\n", mdp->heapinfo[block].busy_frag.nfree,(BLOCKSIZE >> type));
     if (mdp->heapinfo[block].busy_frag.nfree ==
         (BLOCKSIZE >> type) - 1) {
index ade101a..d5d5610 100644 (file)
@@ -6,7 +6,7 @@
 
 /* Copyright 1996, 2000 Free Software Foundation  */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index adf6b2e..49c5968 100644 (file)
@@ -1,6 +1,7 @@
 /* mm_diff - Memory snapshooting and comparison                             */
 
-/* Copyright (c) 2008-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-2013. 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. */
@@ -9,6 +10,7 @@
 #include "xbt/str.h"
 #include "mc/mc.h"
 #include "xbt/mmalloc.h"
+#include "mc/datatypes.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mm_diff, xbt,
                                 "Logging specific to mm_diff in mmalloc");
@@ -17,22 +19,11 @@ xbt_dynar_t mc_heap_comparison_ignore;
 xbt_dynar_t stacks_areas;
 void *maestro_stack_start, *maestro_stack_end;
 
-static void heap_area_pair_free(heap_area_pair_t pair);
-static void heap_area_pair_free_voidp(void *d);
-static int add_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2);
-static int is_new_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2);
-static heap_area_t new_heap_area(int block, int fragment);
 
-static size_t heap_comparison_ignore_size(xbt_dynar_t list, void *address);
-static void add_heap_equality(xbt_dynar_t equals, void *a1, void *a2);
-static void remove_heap_equality(xbt_dynar_t equals, int address, void *a);
+/********************************* Backtrace ***********************************/
+/******************************************************************************/
 
-static int is_stack(void *address);
-static int is_block_stack(int block);
-static int equal_blocks(int b1, int b2);
-static int equal_fragments(int b1, int f1, int b2, int f2);
-
-void mmalloc_backtrace_block_display(void* heapinfo, int block){
+static void mmalloc_backtrace_block_display(void* heapinfo, int block){
 
   /* xbt_ex_t e; */
 
@@ -59,7 +50,7 @@ void mmalloc_backtrace_block_display(void* heapinfo, int block){
   /* } */
 }
 
-void mmalloc_backtrace_fragment_display(void* heapinfo, int block, int frag){
+static void mmalloc_backtrace_fragment_display(void* heapinfo, int block, int frag){
 
   /* xbt_ex_t e; */
 
@@ -82,7 +73,7 @@ void mmalloc_backtrace_fragment_display(void* heapinfo, int block, int frag){
 
 }
 
-void mmalloc_backtrace_display(void *addr){
+static void mmalloc_backtrace_display(void *addr){
 
   /* size_t block, frag_nb; */
   /* int type; */
@@ -113,12 +104,215 @@ void mmalloc_backtrace_display(void *addr){
 }
 
 
-void *s_heap = NULL, *heapbase1 = NULL, *heapbase2 = NULL;
-malloc_info *heapinfo1 = NULL, *heapinfo2 = NULL;
-size_t heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
-xbt_dynar_t to_ignore1 = NULL, to_ignore2 = NULL;
+static int compare_backtrace(int b1, int f1, int b2, int f2){
+  /*int i = 0;
+  if(f1 != -1){
+    for(i=0; i< XBT_BACKTRACE_SIZE; i++){
+      if(heapinfo1[b1].busy_frag.bt[f1][i] != heapinfo2[b2].busy_frag.bt[f2][i]){
+        //mmalloc_backtrace_fragment_display((void*)heapinfo1, b1, f1);
+        //mmalloc_backtrace_fragment_display((void*)heapinfo2, b2, f2);
+        return 1;
+      }
+    }
+  }else{
+    for(i=0; i< heapinfo1[b1].busy_block.bt_size; i++){
+      if(heapinfo1[b1].busy_block.bt[i] != heapinfo2[b2].busy_block.bt[i]){
+        //mmalloc_backtrace_block_display((void*)heapinfo1, b1);
+        //mmalloc_backtrace_block_display((void*)heapinfo2, b2);
+        return 1;
+      }
+    }
+    }*/
+  return 0;
+}
+
+
+/*********************************** Heap comparison ***********************************/
+/***************************************************************************************/
+
+typedef char* type_name;
+
+__thread void *s_heap = NULL, *heapbase1 = NULL, *heapbase2 = NULL;
+__thread malloc_info *heapinfo1 = NULL, *heapinfo2 = NULL;
+__thread size_t heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
+__thread xbt_dynar_t to_ignore1 = NULL, to_ignore2 = NULL;
+__thread heap_area_t **equals_to1, **equals_to2;
+__thread type_name **types1, **types2;
+
+/*********************************** Free functions ************************************/
+
+static void heap_area_pair_free(heap_area_pair_t pair){
+  xbt_free(pair);
+  pair = NULL;
+}
+
+static void heap_area_pair_free_voidp(void *d){
+  heap_area_pair_free((heap_area_pair_t) * (void **) d);
+}
+
+static void heap_area_free(heap_area_t area){
+  xbt_free(area);
+  area = NULL;
+}
+
+/************************************************************************************/
+
+static heap_area_t new_heap_area(int block, int fragment){
+  heap_area_t area = NULL;
+  area = xbt_new0(s_heap_area_t, 1);
+  area->block = block;
+  area->fragment = fragment;
+  return area;
+}
+
+static int is_new_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2){
+  
+  unsigned int cursor = 0;
+  heap_area_pair_t current_pair;
+
+  xbt_dynar_foreach(list, cursor, current_pair){
+    if(current_pair->block1 == block1 && current_pair->block2 == block2 && current_pair->fragment1 == fragment1 && current_pair->fragment2 == fragment2)
+      return 0; 
+  }
+  
+  return 1;
+}
+
+static int add_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2){
+
+  if(is_new_heap_area_pair(list, block1, fragment1, block2, fragment2)){
+    heap_area_pair_t pair = NULL;
+    pair = xbt_new0(s_heap_area_pair_t, 1);
+    pair->block1 = block1;
+    pair->fragment1 = fragment1;
+    pair->block2 = block2;
+    pair->fragment2 = fragment2;
+    
+    xbt_dynar_push(list, &pair); 
+
+    return 1;
+  }
+
+  return 0;
+}
+
+static ssize_t heap_comparison_ignore_size(xbt_dynar_t ignore_list, void *address){
+
+  unsigned int cursor = 0;
+  int start = 0;
+  int end = xbt_dynar_length(ignore_list) - 1;
+  mc_heap_ignore_region_t region;
+
+  while(start <= end){
+    cursor = (start + end) / 2;
+    region = (mc_heap_ignore_region_t)xbt_dynar_get_as(ignore_list, cursor, mc_heap_ignore_region_t);
+    if(region->address == address)
+      return region->size;
+    if(region->address < address)
+      start = cursor + 1;
+    if(region->address > address)
+      end = cursor - 1;   
+  }
+
+  return -1;
+}
+
+static int is_stack(void *address){
+  unsigned int cursor = 0;
+  stack_region_t stack;
+
+  xbt_dynar_foreach(stacks_areas, cursor, stack){
+    if(address == stack->address)
+      return 1;
+  }
+
+  return 0;
+}
+
+static int is_block_stack(int block){
+  unsigned int cursor = 0;
+  stack_region_t stack;
+
+  xbt_dynar_foreach(stacks_areas, cursor, stack){
+    if(block == stack->block)
+      return 1;
+  }
+
+  return 0;
+}
+
+static void match_equals(xbt_dynar_t list){
+
+  unsigned int cursor = 0;
+  heap_area_pair_t current_pair;
+  heap_area_t previous_area;
+
+  xbt_dynar_foreach(list, cursor, current_pair){
+
+    if(current_pair->fragment1 != -1){
+
+      if(equals_to1[current_pair->block1][current_pair->fragment1] != NULL){
+        previous_area = equals_to1[current_pair->block1][current_pair->fragment1];
+        heap_area_free(equals_to2[previous_area->block][previous_area->fragment]);
+        equals_to2[previous_area->block][previous_area->fragment] = NULL;
+        heap_area_free(previous_area);
+      }
+      if(equals_to2[current_pair->block2][current_pair->fragment2] != NULL){
+        previous_area = equals_to2[current_pair->block2][current_pair->fragment2];
+        heap_area_free(equals_to1[previous_area->block][previous_area->fragment]);
+        equals_to1[previous_area->block][previous_area->fragment] = NULL;
+        heap_area_free(previous_area);
+      }
+
+      equals_to1[current_pair->block1][current_pair->fragment1] = new_heap_area(current_pair->block2, current_pair->fragment2);
+      equals_to2[current_pair->block2][current_pair->fragment2] = new_heap_area(current_pair->block1, current_pair->fragment1);
+      
+    }else{
+
+      if(equals_to1[current_pair->block1][0] != NULL){
+        previous_area = equals_to1[current_pair->block1][0];
+        heap_area_free(equals_to2[previous_area->block][0]);
+        equals_to2[previous_area->block][0] = NULL;
+        heap_area_free(previous_area);
+      }
+      if(equals_to2[current_pair->block2][0] != NULL){
+        previous_area = equals_to2[current_pair->block2][0];
+        heap_area_free(equals_to1[previous_area->block][0]);
+        equals_to1[previous_area->block][0] = NULL;
+        heap_area_free(previous_area);
+      }
+
+      equals_to1[current_pair->block1][0] = new_heap_area(current_pair->block2, current_pair->fragment2);
+      equals_to2[current_pair->block2][0] = new_heap_area(current_pair->block1, current_pair->fragment1);
+
+    }
+
+  }
+}
+
+static int equal_blocks(int b1, int b2){
+  
+  if(equals_to1[b1][0]->block == b2 && equals_to2[b2][0]->block == b1)
+    return 1;
+
+  return 0;
+}
+
+static int equal_fragments(int b1, int f1, int b2, int f2){
+  
+  if(equals_to1[b1][f1]->block == b2 && equals_to1[b1][f1]->fragment == f2 && equals_to2[b2][f2]->block == b1 && equals_to2[b2][f2]->fragment == f1)
+    return 1;
+
+  return 0;
+}
+
+int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, xbt_dynar_t i2){
+
+  if((((struct mdesc *)heap1)->heaplimit != ((struct mdesc *)heap2)->heaplimit) || ((((struct mdesc *)heap1)->heapsize != ((struct mdesc *)heap2)->heapsize) ))
+    return -1;
 
-void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1, xbt_dynar_t i2){
+  int i, j;
 
   heaplimit = ((struct mdesc *)heap1)->heaplimit;
 
@@ -136,36 +330,93 @@ void init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t i1,
   to_ignore1 = i1;
   to_ignore2 = i2;
 
+  equals_to1 = malloc(heaplimit * sizeof(heap_area_t *));
+  types1 = malloc(heaplimit * sizeof(type_name *));
+  for(i=0; i<=heaplimit; i++){
+    equals_to1[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t));
+    types1[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(type_name));
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK; j++){
+      equals_to1[i][j] = NULL;
+      types1[i][j] = NULL;
+    }      
+  }
+
+  equals_to2 = malloc(heaplimit * sizeof(heap_area_t *));
+  types2 = malloc(heaplimit * sizeof(type_name *));
+  for(i=0; i<=heaplimit; i++){
+    equals_to2[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(heap_area_t));
+    types2[i] = malloc(MAX_FRAGMENT_PER_BLOCK * sizeof(type_name));
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK; j++){
+      equals_to2[i][j] = NULL;
+      types2[i][j] = NULL;
+    }
+  }
+
   if(MC_is_active()){
-    MC_ignore_data_bss(&heaplimit, sizeof(heaplimit));
-    MC_ignore_data_bss(&s_heap, sizeof(s_heap));
-    MC_ignore_data_bss(&heapbase1, sizeof(heapbase1));
-    MC_ignore_data_bss(&heapbase2, sizeof(heapbase2));
-    MC_ignore_data_bss(&heapinfo1, sizeof(heapinfo1));
-    MC_ignore_data_bss(&heapinfo2, sizeof(heapinfo2));
-    MC_ignore_data_bss(&heapsize1, sizeof(heapsize1));
-    MC_ignore_data_bss(&heapsize2, sizeof(heapsize2));
-    MC_ignore_data_bss(&to_ignore1, sizeof(to_ignore1));
-    MC_ignore_data_bss(&to_ignore2, sizeof(to_ignore2));
+    MC_ignore_global_variable("heaplimit");
+    MC_ignore_global_variable("s_heap");
+    MC_ignore_global_variable("heapbase1");
+    MC_ignore_global_variable("heapbase2");
+    MC_ignore_global_variable("heapinfo1");
+    MC_ignore_global_variable("heapinfo2");
+    MC_ignore_global_variable("heapsize1");
+    MC_ignore_global_variable("heapsize2");
+    MC_ignore_global_variable("to_ignore1");
+    MC_ignore_global_variable("to_ignore2");
+    MC_ignore_global_variable("equals_to1");
+    MC_ignore_global_variable("equals_to2");
+    MC_ignore_global_variable("types1");
+    MC_ignore_global_variable("types2");
   }
+
+  return 0;
+
 }
 
-int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
+void reset_heap_information(){
 
-  if(heap1 == NULL && heap1 == NULL){
-    XBT_DEBUG("Malloc descriptors null");
-    return 0;
+  size_t i = 0, j;
+
+  for(i=0; i<=heaplimit; i++){
+    for(j=0; j<MAX_FRAGMENT_PER_BLOCK;j++){
+      heap_area_free(equals_to1[i][j]);
+      equals_to1[i][j] = NULL;
+      heap_area_free(equals_to2[i][j]);
+      equals_to2[i][j] = NULL;
+      xbt_free(types1[i][j]);
+      types1[i][j] = NULL;
+      xbt_free(types2[i][j]);
+      types2[i][j] = NULL;
+    }
+    free(equals_to1[i]);
+    free(equals_to2[i]);
+    free(types1[i]);
+    free(types2[i]);
   }
 
-  if(heap1->heaplimit != heap2->heaplimit){
-    XBT_DEBUG("Different limit of valid info table indices");
-    return 1;
+  free(equals_to1);
+  free(equals_to2);
+  free(types1);
+  free(types2);
+
+  s_heap = NULL, heapbase1 = NULL, heapbase2 = NULL;
+  heapinfo1 = NULL, heapinfo2 = NULL;
+  heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
+  to_ignore1 = NULL, to_ignore2 = NULL;
+  equals_to1 = NULL, equals_to2 = NULL;
+  types1 = NULL, types2 = NULL;
+
+}
+
+int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dict_t all_types, xbt_dict_t other_types){
+
+  if(heap1 == NULL && heap2 == NULL){
+    XBT_DEBUG("Malloc descriptors null");
+    return 0;
   }
 
   /* Start comparison */
   size_t i1, i2, j1, j2, k;
-  size_t current_block = -1;    /* avoid "maybe uninitialized" warning */
-  size_t current_fragment;
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
   int nb_diff1 = 0, nb_diff2 = 0;
 
@@ -179,8 +430,6 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
   while(i1 <= heaplimit){
 
-    current_block = i1;
-
     if(heapinfo1[i1].type == -1){ /* Free block */
       i1++;
       continue;
@@ -192,14 +441,14 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       
       if(is_stack(addr_block1)){
         for(k=0; k < heapinfo1[i1].busy_block.size; k++)
-          heapinfo1[i1+k].busy_block.equal_to = new_heap_area(i1, -1);
+          equals_to1[i1+k][0] = new_heap_area(i1, -1);
         for(k=0; k < heapinfo2[i1].busy_block.size; k++)
-          heapinfo2[i1+k].busy_block.equal_to = new_heap_area(i1, -1);
-        i1 = i1 + heapinfo1[current_block].busy_block.size;
+          equals_to2[i1+k][0] = new_heap_area(i1, -1);
+        i1 += heapinfo1[i1].busy_block.size;
         continue;
       }
 
-      if(heapinfo1[i1].busy_block.equal_to != NULL){
+      if(equals_to1[i1][0] != NULL){
         i1++;
         continue;
       }
@@ -209,21 +458,21 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       res_compare = 0;
   
       /* Try first to associate to same block in the other heap */
-      if(heapinfo2[current_block].type == heapinfo1[current_block].type){
+      if(heapinfo2[i1].type == heapinfo1[i1].type){
 
-        if(heapinfo2[current_block].busy_block.equal_to == NULL){  
-        
-          addr_block2 = ((void*) (((ADDR2UINT(current_block)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+        if(equals_to2[i1][0] == NULL){
+
+          addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
         
-          res_compare = compare_area(addr_block1, addr_block2, NULL);
+          res_compare = compare_heap_area(addr_block1, addr_block2, NULL, all_types, other_types, NULL, 0);
         
-          if(res_compare == 0){
-            for(k=1; k < heapinfo2[current_block].busy_block.size; k++)
-              heapinfo2[current_block+k].busy_block.equal_to = new_heap_area(i1, -1);
-            for(k=1; k < heapinfo1[current_block].busy_block.size; k++)
-              heapinfo1[current_block+k].busy_block.equal_to = new_heap_area(i1, -1);
+          if(res_compare != 1){
+            for(k=1; k < heapinfo2[i1].busy_block.size; k++)
+              equals_to2[i1+k][0] = new_heap_area(i1, -1);
+            for(k=1; k < heapinfo1[i1].busy_block.size; k++)
+              equals_to1[i1+k][0] = new_heap_area(i1, -1);
             equal = 1;
-            i1 = i1 + heapinfo1[current_block].busy_block.size;
+            i1 += heapinfo1[i1].busy_block.size;
           }
         
           xbt_dynar_reset(previous);
@@ -236,7 +485,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));        
            
-        if(i2 == current_block){
+        if(i2 == i1){
           i2++;
           continue;
         }
@@ -245,21 +494,21 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
           i2++;
           continue;
         }
-
-        if(heapinfo2[i2].busy_block.equal_to != NULL){         
+    
+        if(equals_to2[i2][0] != NULL){  
           i2++;
           continue;
         }
           
-        res_compare = compare_area(addr_block1, addr_block2, NULL);
+        res_compare = compare_heap_area(addr_block1, addr_block2, NULL, all_types, other_types, NULL, 0);
         
-        if(res_compare == 0){
+        if(res_compare != 1 ){
           for(k=1; k < heapinfo2[i2].busy_block.size; k++)
-            heapinfo2[i2+k].busy_block.equal_to = new_heap_area(i1, -1);
+            equals_to2[i2+k][0] = new_heap_area(i1, -1);
           for(k=1; k < heapinfo1[i1].busy_block.size; k++)
-            heapinfo1[i1+k].busy_block.equal_to = new_heap_area(i2, -1);
+            equals_to1[i1+k][0] = new_heap_area(i2, -1);
           equal = 1;
-          i1 = i1 + heapinfo1[i1].busy_block.size;
+          i1 += heapinfo1[i1].busy_block.size;
         }
 
         xbt_dynar_reset(previous);
@@ -269,22 +518,20 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       }
 
       if(!equal){
-        /*XBT_DEBUG("Block %zu not found (size_used = %zu, addr = %p)", i1, heapinfo1[i1].busy_block.busy_size, addr_block1);
+        XBT_DEBUG("Block %zu not found (size_used = %zu, addr = %p)", i1, heapinfo1[i1].busy_block.busy_size, addr_block1);
         i1 = heaplimit + 1;
-        nb_diff1++;*/
-        i1++;
+        nb_diff1++;
+          //i1++;
       }
       
     }else{ /* Fragmented block */
 
       for(j1=0; j1 < (size_t) (BLOCKSIZE >> heapinfo1[i1].type); j1++){
 
-        current_fragment = j1;
-
         if(heapinfo1[i1].busy_frag.frag_size[j1] == -1) /* Free fragment */
           continue;
 
-        if(heapinfo1[i1].busy_frag.equal_to[j1] != NULL)
+        if(equals_to1[i1][j1] != NULL)
           continue;
 
         addr_frag1 = (void*) ((char *)addr_block1 + (j1 << heapinfo1[i1].type));
@@ -293,16 +540,16 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
         equal = 0;
         
         /* Try first to associate to same fragment in the other heap */
-        if(heapinfo2[current_block].type == heapinfo1[current_block].type){
+        if(heapinfo2[i1].type == heapinfo1[i1].type){
 
-          if(heapinfo2[current_block].busy_frag.equal_to[current_fragment] == NULL){  
-          
-            addr_block2 = ((void*) (((ADDR2UINT(current_block)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
-            addr_frag2 = (void*) ((char *)addr_block2 + (current_fragment << ((xbt_mheap_t)s_heap)->heapinfo[current_block].type));
+          if(equals_to2[i1][j1] == NULL){
 
-            res_compare = compare_area(addr_frag1, addr_frag2, NULL);
+            addr_block2 = ((void*) (((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+            addr_frag2 = (void*) ((char *)addr_block2 + (j1 << ((xbt_mheap_t)s_heap)->heapinfo[i1].type));
 
-            if(res_compare == 0)
+            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, all_types, other_types, NULL, 0);
+
+            if(res_compare !=  1)
               equal = 1;
         
             xbt_dynar_reset(previous);
@@ -313,7 +560,6 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         while(i2 <= heaplimit && !equal){
 
-          
           if(heapinfo2[i2].type <= 0){
             i2++;
             continue;
@@ -321,18 +567,18 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
           for(j2=0; j2 < (size_t) (BLOCKSIZE >> heapinfo2[i2].type); j2++){
 
-            if(i2 == current_block && j2 == current_fragment)
+            if(i2 == i1 && j2 == j1)
+              continue;
+           
+            if(equals_to2[i2][j2] != NULL)
               continue;
-
-            if(heapinfo2[i2].busy_frag.equal_to[j2] != NULL)                
-              continue;            
                           
             addr_block2 = ((void*) (((ADDR2UINT(i2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
-            addr_frag2 = (void*) ((char *)addr_block2 + (j2 << ((xbt_mheap_t)s_heap)->heapinfo[i2].type));
+            addr_frag2 = (void*) ((char *)addr_block2 + (j2 <<((xbt_mheap_t)s_heap)->heapinfo[i2].type));
 
-            res_compare = compare_area(addr_frag1, addr_frag2, NULL);
+            res_compare = compare_heap_area(addr_frag1, addr_frag2, NULL, all_types, other_types, NULL, 0);
             
-            if(res_compare == 0){
+            if(res_compare != 1){
               equal = 1;
               xbt_dynar_reset(previous);
               break;
@@ -346,13 +592,13 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
 
         }
 
-        /*if(heapinfo1[i1].busy_frag.equal_to[j1] == NULL){
-          fprintf(stderr,"Block %zu, fragment %zu not found (size_used = %zd, address = %p, ignore %d)\n", i1, j1, heapinfo1[i1].busy_frag.frag_size[j1], addr_frag1, heapinfo1[i1].busy_frag.ignore[j1]);
+        if(!equal){
+          XBT_DEBUG("Block %zu, fragment %zu not found (size_used = %zd, address = %p)\n", i1, j1, heapinfo1[i1].busy_frag.frag_size[j1], addr_frag1);
           i2 = heaplimit + 1;
           i1 = heaplimit + 1;
           nb_diff1++;
           break;
-          }*/
+        }
 
       }
 
@@ -368,9 +614,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
  
   while(i<=heaplimit){
     if(heapinfo1[i].type == 0){
-      if(current_block == heaplimit){
+      if(i1 == heaplimit){
         if(heapinfo1[i].busy_block.busy_size > 0){
-          if(heapinfo1[i].busy_block.equal_to == NULL){
+          if(equals_to1[i][0] == NULL){            
             if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
               addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase1));
               XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block1, heapinfo1[i].busy_block.busy_size);
@@ -385,9 +631,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       addr_block1 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase1));
       real_addr_block1 =  ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)((struct mdesc *)s_heap)->heapbase));
       for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo1[i].type); j++){
-        if(current_block == heaplimit){
+        if(i1== heaplimit){
           if(heapinfo1[i].busy_frag.frag_size[j] > 0){
-            if(heapinfo1[i].busy_frag.equal_to[j] == NULL){
+            if(equals_to1[i][j] == NULL){
               if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
                 addr_frag1 = (void*) ((char *)addr_block1 + (j << heapinfo1[i].type));
                 real_addr_frag1 = (void*) ((char *)real_addr_block1 + (j << ((struct mdesc *)s_heap)->heapinfo[i].type));
@@ -403,16 +649,16 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
     i++; 
   }
 
-  if(current_block == heaplimit)
+  if(i1 == heaplimit)
     XBT_DEBUG("Number of blocks/fragments not found in heap1 : %d", nb_diff1);
 
   i = 1;
 
   while(i<=heaplimit){
     if(heapinfo2[i].type == 0){
-      if(current_block == heaplimit){
+      if(i1 == heaplimit){
         if(heapinfo2[i].busy_block.busy_size > 0){
-          if(heapinfo2[i].busy_block.equal_to == NULL){
+          if(equals_to2[i][0] == NULL){
             if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
               addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase2));
               XBT_DEBUG("Block %zu (%p) not found (size used = %zu)", i, addr_block2, heapinfo2[i].busy_block.busy_size);
@@ -427,9 +673,9 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
       addr_block2 = ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)heapbase2));
       real_addr_block2 =  ((void*) (((ADDR2UINT(i)) - 1) * BLOCKSIZE + (char*)((struct mdesc *)s_heap)->heapbase));
       for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo2[i].type); j++){
-        if(current_block == heaplimit){
+        if(i1 == heaplimit){
           if(heapinfo2[i].busy_frag.frag_size[j] > 0){
-            if(heapinfo2[i].busy_frag.equal_to[j] == NULL){
+            if(equals_to2[i][j] == NULL){
               if(XBT_LOG_ISENABLED(mm_diff, xbt_log_priority_debug)){
                 addr_frag2 = (void*) ((char *)addr_block2 + (j << heapinfo2[i].type));
                 real_addr_frag2 = (void*) ((char *)real_addr_block2 + (j << ((struct mdesc *)s_heap)->heapinfo[i].type));
@@ -445,7 +691,7 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
     i++; 
   }
 
-  if(current_block == heaplimit)
+  if(i1 == heaplimit)
     XBT_DEBUG("Number of blocks/fragments not found in heap2 : %d", nb_diff2);
 
   xbt_dynar_free(&previous);
@@ -454,89 +700,300 @@ int mmalloc_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
   return ((nb_diff1 > 0) || (nb_diff2 > 0));
 }
 
-void reset_heap_information(){
+static int compare_heap_area_without_type(void *real_area1, void *real_area2, void *area1, void *area2, xbt_dynar_t previous, xbt_dict_t all_types, xbt_dict_t other_types, int size, int check_ignore){
 
-  size_t i = 0, j;
+  int i = 0;
+  void *addr_pointed1, *addr_pointed2;
+  int pointer_align, ignore1, ignore2, res_compare;
 
-  while(i<=heaplimit){
-    if(heapinfo1[i].type == 0){
-      xbt_free(heapinfo1[i].busy_block.equal_to);
-      heapinfo1[i].busy_block.equal_to = NULL;
-    }
-    if(heapinfo1[i].type > 0){
-      for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo1[i].type); j++){
-        xbt_free(heapinfo1[i].busy_frag.equal_to[j]);
-        heapinfo1[i].busy_frag.equal_to[j] = NULL;
+  while(i<size){
+
+    if(check_ignore > 0){
+      if((ignore1 = heap_comparison_ignore_size(to_ignore1, (char *)real_area1 + i)) != -1){
+        if((ignore2 = heap_comparison_ignore_size(to_ignore2, (char *)real_area2 + i))  == ignore1){
+          if(ignore1 == 0){
+            check_ignore--;
+            return 0;
+          }else{
+            i = i + ignore2;
+            check_ignore--;
+            continue;
+          }
+        }
       }
     }
-    i++; 
-  }
 
-  i = 0;
+    if(memcmp(((char *)area1) + i, ((char *)area2) + i, 1) != 0){
 
-  while(i<=heaplimit){
-    if(heapinfo2[i].type == 0){
-      xbt_free(heapinfo2[i].busy_block.equal_to);
-      heapinfo2[i].busy_block.equal_to = NULL;
-    }
-    if(heapinfo2[i].type > 0){
-      for(j=0; j < (size_t) (BLOCKSIZE >> heapinfo2[i].type); j++){
-        xbt_free(heapinfo2[i].busy_frag.equal_to[j]);
-        heapinfo2[i].busy_frag.equal_to[j] = NULL;
+      pointer_align = (i / sizeof(void*)) * sizeof(void*);
+      addr_pointed1 = *((void **)((char *)area1 + pointer_align));
+      addr_pointed2 = *((void **)((char *)area2 + pointer_align));
+      
+      if(addr_pointed1 > maestro_stack_start && addr_pointed1 < maestro_stack_end && addr_pointed2 > maestro_stack_start && addr_pointed2 < maestro_stack_end){
+        i = pointer_align + sizeof(void *);
+        continue;
+      }else if((addr_pointed1 > s_heap) && ((char *)addr_pointed1 < (char *)s_heap + STD_HEAP_SIZE) 
+               && (addr_pointed2 > s_heap) && ((char *)addr_pointed2 < (char *)s_heap + STD_HEAP_SIZE)){
+        res_compare = compare_heap_area(addr_pointed1, addr_pointed2, previous, all_types, other_types, NULL, 0); 
+        if(res_compare == 1){
+          return res_compare;
+        }
+        i = pointer_align + sizeof(void *);
+        continue;
+      }else{
+        return 1;
       }
+      
     }
-    i++; 
-  }
+    
+    i++;
 
-  s_heap = NULL, heapbase1 = NULL, heapbase2 = NULL;
-  heapinfo1 = NULL, heapinfo2 = NULL;
-  heaplimit = 0, heapsize1 = 0, heapsize2 = 0;
-  to_ignore1 = NULL, to_ignore2 = NULL;
+  }
 
+  return 0;
 }
 
-static heap_area_t new_heap_area(int block, int fragment){
-  heap_area_t area = NULL;
-  area = xbt_new0(s_heap_area_t, 1);
-  area->block = block;
-  area->fragment = fragment;
-  return area;
-}
 
+static int compare_heap_area_with_type(void *real_area1, void *real_area2, void *area1, void *area2, 
+                                       xbt_dynar_t previous, xbt_dict_t all_types, xbt_dict_t other_types, char *type_id, 
+                                       int area_size, int check_ignore, int pointer_level){
 
-static size_t heap_comparison_ignore_size(xbt_dynar_t ignore_list, void *address){
+  if(is_stack(real_area1) && is_stack(real_area2))
+    return 0;
 
-  unsigned int cursor = 0;
-  int start = 0;
-  int end = xbt_dynar_length(ignore_list) - 1;
-  mc_heap_ignore_region_t region;
+  size_t ignore1, ignore2;
 
-  while(start <= end){
-    cursor = (start + end) / 2;
-    region = (mc_heap_ignore_region_t)xbt_dynar_get_as(ignore_list, cursor, mc_heap_ignore_region_t);
-    if(region->address == address)
-      return region->size;
-    if(region->address < address)
-      start = cursor + 1;
-    if(region->address > address)
-      end = cursor - 1;   
+  if((check_ignore > 0) && ((ignore1 = heap_comparison_ignore_size(to_ignore1, real_area1)) > 0) && ((ignore2 = heap_comparison_ignore_size(to_ignore2, real_area2))  == ignore1)){
+    return 0;
+  }
+  
+  dw_type_t type = xbt_dict_get_or_null(all_types, type_id);
+  dw_type_t subtype, subsubtype;
+  int res, elm_size, i, switch_types = 0;
+  unsigned int cursor = 0;
+  dw_type_t member;
+  void *addr_pointed1, *addr_pointed2;;
+  char *type_desc;
+
+  switch(type->type){
+  case e_dw_base_type:
+    if(strcmp(type->name, "char") == 0){ /* String, hence random (arbitrary ?) size */
+      if(real_area1 == real_area2)
+        return -1;
+      else
+        return (memcmp(area1, area2, area_size) != 0);
+    }else{
+      if(area_size != -1 && type->size != area_size)
+        return -1;
+      else{
+        return  (memcmp(area1, area2, type->size) != 0);
+      }
+    }
+    break;
+  case e_dw_enumeration_type:
+    if(area_size != -1 && type->size != area_size)
+      return -1;
+    else
+      return (memcmp(area1, area2, type->size) != 0);
+    break;
+  case e_dw_typedef:
+    return compare_heap_area_with_type(real_area1, real_area2, area1, area2, previous, all_types, other_types, type->dw_type_id, area_size, check_ignore, pointer_level);
+    break;
+  case e_dw_const_type:
+    return 0;
+    break;
+  case e_dw_array_type:
+    subtype = xbt_dict_get_or_null(all_types, type->dw_type_id);
+    switch(subtype->type){
+    case e_dw_base_type:
+    case e_dw_enumeration_type:
+    case e_dw_pointer_type:
+    case e_dw_structure_type:
+    case e_dw_union_type:
+      if(subtype->size == 0){ /*declaration of the type, need the complete description */
+        type_desc = get_type_description(all_types, subtype->name);
+        if(type_desc){
+          subtype = xbt_dict_get_or_null(all_types, type_desc);
+        }else{
+          subtype = xbt_dict_get_or_null(other_types, get_type_description(other_types, subtype->name));
+          switch_types = 1;
+        }
+      }
+      elm_size = subtype->size;
+      break;
+    case e_dw_typedef:
+    case e_dw_volatile_type:
+      subsubtype = xbt_dict_get_or_null(all_types, subtype->dw_type_id);
+      if(subsubtype->size == 0){ /*declaration of the type, need the complete description */
+        type_desc = get_type_description(all_types, subsubtype->name);
+        if(type_desc){
+          subsubtype = xbt_dict_get_or_null(all_types, type_desc);
+        }else{
+          subsubtype = xbt_dict_get_or_null(other_types, get_type_description(other_types, subtype->name));
+          switch_types = 1;
+        }
+      }
+      elm_size = subsubtype->size;
+      break;
+    default : 
+      return 0;
+      break;
+    }
+    for(i=0; i<type->size; i++){ 
+      if(switch_types)
+        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, other_types, all_types, type->dw_type_id, type->size, check_ignore, pointer_level);
+      else
+        res = compare_heap_area_with_type((char *)real_area1 + (i*elm_size), (char *)real_area2 + (i*elm_size), (char *)area1 + (i*elm_size), (char *)area2 + (i*elm_size), previous, all_types, other_types, type->dw_type_id, type->size, check_ignore, pointer_level);
+      if(res == 1)
+        return res;
+    }
+    break;
+  case e_dw_pointer_type:
+    if(type->dw_type_id && ((dw_type_t)xbt_dict_get_or_null(all_types, type->dw_type_id))->type == e_dw_subroutine_type){
+      addr_pointed1 = *((void **)(area1)); 
+      addr_pointed2 = *((void **)(area2));
+      return (addr_pointed1 != addr_pointed2);;
+    }else{
+      pointer_level++;
+      if(pointer_level > 1){ /* Array of pointers */
+        for(i=0; i<(area_size/sizeof(void *)); i++){ 
+          addr_pointed1 = *((void **)((char *)area1 + (i*sizeof(void *)))); 
+          addr_pointed2 = *((void **)((char *)area2 + (i*sizeof(void *)))); 
+          if(addr_pointed1 > s_heap && (char *)addr_pointed1 < (char*) s_heap + STD_HEAP_SIZE && addr_pointed2 > s_heap && (char *)addr_pointed2 < (char*) s_heap + STD_HEAP_SIZE)
+            res =  compare_heap_area(addr_pointed1, addr_pointed2, previous, all_types, other_types, type->dw_type_id, pointer_level); 
+          else
+            res =  (addr_pointed1 != addr_pointed2);
+          if(res == 1)
+            return res;
+        }
+      }else{
+        addr_pointed1 = *((void **)(area1)); 
+        addr_pointed2 = *((void **)(area2));
+        if(addr_pointed1 > s_heap && (char *)addr_pointed1 < (char*) s_heap + STD_HEAP_SIZE && addr_pointed2 > s_heap && (char *)addr_pointed2 < (char*) s_heap + STD_HEAP_SIZE)
+          return compare_heap_area(addr_pointed1, addr_pointed2, previous, all_types, other_types, type->dw_type_id, pointer_level); 
+        else
+          return  (addr_pointed1 != addr_pointed2);
+      }
+    }
+    break;
+  case e_dw_structure_type:
+    if(type->size == 0){ /*declaration of the structure, need the complete description */
+      type_desc = get_type_description(all_types, type->name);
+      if(type_desc){
+        type = xbt_dict_get_or_null(all_types, type_desc);
+      }else{
+        type = xbt_dict_get_or_null(other_types, get_type_description(other_types, type->name));
+        switch_types = 1;
+      }
+    }
+    if(area_size != -1 && type->size != area_size){
+      if(area_size>type->size && area_size%type->size == 0){
+        for(i=0; i<(area_size/type->size); i++){ 
+          if(switch_types)
+            res = compare_heap_area_with_type((char *)real_area1 + (i*type->size), (char *)real_area2 + (i*type->size), (char *)area1 + (i*type->size), (char *)area2 + (i*type->size), previous, other_types, all_types, type_id, -1, check_ignore, 0); 
+          else
+            res = compare_heap_area_with_type((char *)real_area1 + (i*type->size), (char *)real_area2 + (i*type->size), (char *)area1 + (i*type->size), (char *)area2 + (i*type->size), previous, all_types, other_types, type_id, -1, check_ignore, 0); 
+          if(res == 1)
+            return res;
+        }
+      }else{
+        return -1;
+      }
+    }else{
+      cursor = 0;
+      xbt_dynar_foreach(type->members, cursor, member){ 
+        if(switch_types)
+          res = compare_heap_area_with_type((char *)real_area1 + member->offset, (char *)real_area2 + member->offset, (char *)area1 + member->offset, (char *)area2 + member->offset, previous, other_types, all_types, member->dw_type_id, -1, check_ignore, 0);
+        else
+          res = compare_heap_area_with_type((char *)real_area1 + member->offset, (char *)real_area2 + member->offset, (char *)area1 + member->offset, (char *)area2 + member->offset, previous, all_types, other_types, member->dw_type_id, -1, check_ignore, 0);  
+        if(res == 1){
+          return res;
+        }
+      }
+    }
+    break;
+  case e_dw_union_type:
+    return compare_heap_area_without_type(real_area1, real_area2, area1, area2, previous, all_types, other_types, type->size, check_ignore);
+    break;
+  case e_dw_volatile_type:
+    return compare_heap_area_with_type(real_area1, real_area2, area1, area2, previous, all_types, other_types, type->dw_type_id, area_size, check_ignore, pointer_level);
+    break;
+  default:
+    break;
   }
 
   return 0;
+
 }
 
+static char* get_offset_type(char* type_id, int offset, xbt_dict_t all_types, xbt_dict_t other_types, int area_size, int *switch_type){
+  dw_type_t type = xbt_dict_get_or_null(all_types, type_id);
+  if(type == NULL){
+    type = xbt_dict_get_or_null(other_types, type_id);
+    *switch_type = 1;
+  }
+  char* type_desc;
+  switch(type->type){
+  case e_dw_structure_type :
+    if(type->size == 0){ /*declaration of the structure, need the complete description */
+      if(*switch_type == 0){
+        type_desc = get_type_description(all_types, type->name);
+        if(type_desc){
+          type = xbt_dict_get_or_null(all_types, type_desc);
+        }else{
+          type = xbt_dict_get_or_null(other_types, get_type_description(other_types, type->name));
+          *switch_type = 1;
+        }
+      }else{
+        type_desc = get_type_description(other_types, type->name);
+        if(type_desc){
+          type = xbt_dict_get_or_null(other_types, type_desc);
+        }else{
+          type = xbt_dict_get_or_null(all_types, get_type_description(other_types, type->name));
+          *switch_type = 0;
+        }
+      }
+    
+    }
+    if(area_size != -1 && type->size != area_size){
+      if(area_size>type->size && area_size%type->size == 0)
+        return type_id;
+      else
+        return NULL;
+    }else{
+      unsigned int cursor = 0;
+      dw_type_t member;
+      xbt_dynar_foreach(type->members, cursor, member){ 
+        if(member->offset == offset)
+          return member->dw_type_id;
+      }
+      return NULL;
+    }
+    break;
+  default:
+    /* FIXME : other cases ? */
+    return NULL;
+    break;
+  }
+}
 
-int compare_area(void *area1, void* area2, xbt_dynar_t previous){
+int compare_heap_area(void *area1, void* area2, xbt_dynar_t previous, xbt_dict_t all_types, xbt_dict_t other_types, char *type_id, int pointer_level){
 
-  size_t i = 0, pointer_align = 0, ignore1 = 0, ignore2 = 0;
-  void *addr_pointed1, *addr_pointed2;
   int res_compare;
   ssize_t block1, frag1, block2, frag2;
   ssize_t size;
   int check_ignore = 0;
 
-  void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;
+  void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2, *real_addr_block1, *real_addr_block2,  *real_addr_frag1, *real_addr_frag2;
   void *area1_to_compare, *area2_to_compare;
+  dw_type_t type = NULL;
+  char *type_desc;
+  int type_size = -1;
+  int offset1 =0, offset2 = 0;
+  int new_size1 = -1, new_size2 = -1;
+  char *new_type_id1 = NULL, *new_type_id2 = NULL;
+  int switch_type = 0;
 
   int match_pairs = 0;
 
@@ -566,126 +1023,228 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){
 
   addr_block1 = ((void*) (((ADDR2UINT(block1)) - 1) * BLOCKSIZE + (char*)heapbase1));
   addr_block2 = ((void*) (((ADDR2UINT(block2)) - 1) * BLOCKSIZE + (char*)heapbase2));
-  
-  if(heapinfo1[block1].type == heapinfo2[block2].type){
-    
-    if(heapinfo1[block1].type == -1){ /* Free block */
-      if(match_pairs){
-        match_equals(previous);
-        xbt_dynar_free(&previous);
+
+  real_addr_block1 = ((void*) (((ADDR2UINT(block1)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+  real_addr_block2 = ((void*) (((ADDR2UINT(block2)) - 1) * BLOCKSIZE + (char*)((xbt_mheap_t)s_heap)->heapbase));
+
+  if(type_id){
+    type = xbt_dict_get_or_null(all_types, type_id);
+    if(type->size == 0){
+      if(type->dw_type_id == NULL){
+        type_desc = get_type_description(all_types, type->name);
+        if(type_desc)
+          type = xbt_dict_get_or_null(all_types, type_desc);
+        else
+          type = xbt_dict_get_or_null(other_types, get_type_description(other_types, type->name));
+      }else{
+        type = xbt_dict_get_or_null(all_types, type->dw_type_id);
       }
-      return 0;
+    }
+    if((type->type == e_dw_pointer_type) || ((type->type == e_dw_base_type) && (!strcmp(type->name, "char"))))
+      type_size = -1;
+    else
+      type_size = type->size;
+  }
+  
+  if((heapinfo1[block1].type == -1) && (heapinfo2[block2].type == -1)){  /* Free block */
 
-    }else if(heapinfo1[block1].type == 0){ /* Complete block */
+    if(match_pairs){
+      match_equals(previous);
+      xbt_dynar_free(&previous);
+    }
+    return 0;
 
-      if(heapinfo1[block1].busy_block.equal_to != NULL && heapinfo2[block2].busy_block.equal_to != NULL){
-        if(equal_blocks(block1, block2)){
-          if(match_pairs){
-            match_equals(previous);
-            xbt_dynar_free(&previous);
-          }
-          return 0;
+  }else if((heapinfo1[block1].type == 0) && (heapinfo2[block2].type == 0)){ /* Complete block */ 
+    
+    if(equals_to1[block1][0] != NULL && equals_to2[block2][0] != NULL){
+      if(equal_blocks(block1, block2)){
+        if(match_pairs){
+          match_equals(previous);
+          xbt_dynar_free(&previous);
         }
+        return 0;
       }
+    }
 
-      if(heapinfo1[block1].busy_block.size != heapinfo2[block2].busy_block.size){
+    if(type_size != -1){
+      if(type_size != heapinfo1[block1].busy_block.busy_size && type_size != heapinfo2[block2].busy_block.busy_size && !strcmp(type->name, "s_smx_context")){
         if(match_pairs){
+          match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 1;
+        return -1;
+      }
+    }
+
+    if(heapinfo1[block1].busy_block.size != heapinfo2[block2].busy_block.size){
+      if(match_pairs){
+        xbt_dynar_free(&previous);
       }
+      return 1;
+    }
 
-      if(heapinfo1[block1].busy_block.busy_size != heapinfo2[block2].busy_block.busy_size){
+    if(heapinfo1[block1].busy_block.busy_size != heapinfo2[block2].busy_block.busy_size){
+      if(match_pairs){
+        xbt_dynar_free(&previous);
+      }
+      return 1;
+    }
+
+    if(!add_heap_area_pair(previous, block1, -1, block2, -1)){
+      if(match_pairs){
+        match_equals(previous);
+        xbt_dynar_free(&previous);
+      }
+      return 0;
+    }
+    size = heapinfo1[block1].busy_block.busy_size;
+    
+    if(type_id != NULL){
+      xbt_free(types1[block1][0]);
+      xbt_free(types2[block2][0]);
+      types1[block1][0] = strdup(type_id);
+      types2[block2][0] = strdup(type_id);
+    }
+
+    if(size <= 0){
+      if(match_pairs){
+        match_equals(previous);
+        xbt_dynar_free(&previous);
+      }
+      return 0;
+    }
+
+    frag1 = -1;
+    frag2 = -1;
+
+    area1_to_compare = addr_block1;
+    area2_to_compare = addr_block2;
+
+    if((heapinfo1[block1].busy_block.ignore > 0) && (heapinfo2[block2].busy_block.ignore == heapinfo1[block1].busy_block.ignore))
+      check_ignore = heapinfo1[block1].busy_block.ignore;
+      
+  }else if((heapinfo1[block1].type > 0) && (heapinfo2[block2].type > 0)){ /* Fragmented block */
+
+    frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
+    frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
+
+    addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
+    addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
+
+    real_addr_frag1 = (void*) ((char *)real_addr_block1 + (frag1 << ((xbt_mheap_t)s_heap)->heapinfo[block1].type));
+    real_addr_frag2 = (void*) ((char *)real_addr_block2 + (frag2 << ((xbt_mheap_t)s_heap)->heapinfo[block2].type));
+
+    if(type_size != -1){
+      if(heapinfo1[block1].busy_frag.frag_size[frag1] == -1 || heapinfo2[block2].busy_frag.frag_size[frag2] == -1){
         if(match_pairs){
+          match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 1;
+        return -1;
       }
-
-      if(!add_heap_area_pair(previous, block1, -1, block2, -1)){
+      if(type_size != heapinfo1[block1].busy_frag.frag_size[frag1] || type_size !=  heapinfo2[block2].busy_frag.frag_size[frag2]){
         if(match_pairs){
           match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 0;
+        return -1;
       }
-      size = heapinfo1[block1].busy_block.busy_size;
+    }
 
-      if(size <= 0){
+    if(equals_to1[block1][frag1] != NULL && equals_to2[block2][frag2] != NULL){
+      if(equal_fragments(block1, frag1, block2, frag2)){
         if(match_pairs){
           match_equals(previous);
           xbt_dynar_free(&previous);
         }
         return 0;
       }
+    }
 
-      frag1 = -1;
-      frag2 = -1;
-
-      area1_to_compare = addr_block1;
-      area2_to_compare = addr_block2;
-
-      if((heapinfo1[block1].busy_block.ignore > 0) && (heapinfo2[block2].busy_block.ignore == heapinfo1[block1].busy_block.ignore))
-        check_ignore = heapinfo1[block1].busy_block.ignore;
-      
-    }else{
-      frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
-      frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
-      
-      addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
-      addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
-      
-      area1_to_compare = addr_frag1;
-      area2_to_compare = addr_frag2;
-
-      if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL && heapinfo2[block2].busy_frag.equal_to[frag2] != NULL){
-        if(equal_fragments(block1, frag1, block2, frag2)){
-          if(match_pairs){
-            match_equals(previous);
-            xbt_dynar_free(&previous);
-          }
-          return 0;
+    if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2]){
+      if(type_size == -1){
+         if(match_pairs){
+          match_equals(previous);
+          xbt_dynar_free(&previous);
         }
-      }
-
-      if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2]){
+        return -1;
+      }else{
         if(match_pairs){
           xbt_dynar_free(&previous);
         }
-        return 1;  
+        return 1;
       }
+    }
       
-      if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
+    size = heapinfo1[block1].busy_frag.frag_size[frag1];
+
+    if(type_id != NULL){
+      xbt_free(types1[block1][frag1]);
+      xbt_free(types2[block2][frag2]);
+      types1[block1][frag1] = strdup(type_id);
+      types2[block2][frag2] = strdup(type_id);
+    }
+
+    if(real_addr_frag1 != area1 || real_addr_frag2 != area2){
+      offset1 = (char *)area1 - (char *)real_addr_frag1;
+      offset2 = (char *)area2 - (char *)real_addr_frag2;
+      if(types1[block1][frag1] != NULL && types2[block2][frag2] != NULL){
+        new_type_id1 = get_offset_type(types1[block1][frag1], offset1, all_types, other_types, size, &switch_type);
+        new_type_id2 = get_offset_type(types2[block2][frag2], offset1, all_types, other_types, size, &switch_type);
+      }else if(types1[block1][frag1] != NULL){
+        new_type_id1 = get_offset_type(types1[block1][frag1], offset1, all_types, other_types, size, &switch_type);
+        new_type_id2 = get_offset_type(types1[block1][frag1], offset2, all_types, other_types, size, &switch_type);       
+      }else if(types2[block2][frag2] != NULL){
+        new_type_id1 = get_offset_type(types2[block2][frag2], offset1, all_types, other_types, size, &switch_type);
+        new_type_id2 = get_offset_type(types2[block2][frag2], offset2, all_types, other_types, size, &switch_type);
+      }else{
         if(match_pairs){
           match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 0;
-      }
-
-      size = heapinfo1[block1].busy_frag.frag_size[frag1];
-
-      if(size <= 0){
+        return -1;
+      }   
+
+      if(new_type_id1 !=  NULL && new_type_id2 !=  NULL && !strcmp(new_type_id1, new_type_id2)){
+        if(switch_type){
+          type = xbt_dict_get_or_null(other_types, new_type_id1);
+          while(type->size == 0 && type->dw_type_id != NULL)
+            type = xbt_dict_get_or_null(other_types, type->dw_type_id);
+          new_size1 = type->size;
+          type = xbt_dict_get_or_null(other_types, new_type_id2);
+          while(type->size == 0 && type->dw_type_id != NULL)
+            type = xbt_dict_get_or_null(other_types, type->dw_type_id);
+          new_size2 = type->size;
+        }else{
+          type = xbt_dict_get_or_null(all_types, new_type_id1);
+          while(type->size == 0 && type->dw_type_id != NULL)
+            type = xbt_dict_get_or_null(all_types, type->dw_type_id);
+          new_size1 = type->size;
+          type = xbt_dict_get_or_null(all_types, new_type_id2);
+          while(type->size == 0 && type->dw_type_id != NULL)
+            type = xbt_dict_get_or_null(all_types, type->dw_type_id);
+          new_size2 = type->size;
+        }
+      }else{
         if(match_pairs){
           match_equals(previous);
           xbt_dynar_free(&previous);
         }
-        return 0;
+        return -1;
       }
-      
-      if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && ( heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
-        check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];
-      
     }
 
-  }else if((heapinfo1[block1].type > 0) && (heapinfo2[block2].type > 0)){
-
-    frag1 = ((uintptr_t) (ADDR2UINT (area1) % (BLOCKSIZE))) >> heapinfo1[block1].type;
-    frag2 = ((uintptr_t) (ADDR2UINT (area2) % (BLOCKSIZE))) >> heapinfo2[block2].type;
+    area1_to_compare = (char *)addr_frag1 + offset1;
+    area2_to_compare = (char *)addr_frag2 + offset2;
+    
+    if(new_size1 > 0 && new_size1 == new_size2){
+      type_id = new_type_id1;
+      size = new_size1;
+    }
 
-    if(heapinfo1[block1].busy_frag.equal_to[frag1] != NULL || heapinfo2[block2].busy_frag.equal_to[frag2] != NULL){
-      if(equal_fragments(block1, frag1, block2, frag2)){
+    if(offset1 == 0 && offset2 == 0){
+      if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
         if(match_pairs){
           match_equals(previous);
           xbt_dynar_free(&previous);
@@ -694,29 +1253,6 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){
       }
     }
 
-    if(heapinfo1[block1].busy_frag.frag_size[frag1] != heapinfo2[block2].busy_frag.frag_size[frag2]){
-      if(match_pairs){
-        xbt_dynar_free(&previous);
-      }
-      return 1;
-    }
-    
-    if(!add_heap_area_pair(previous, block1, frag1, block2, frag2)){
-      if(match_pairs){
-        match_equals(previous);
-        xbt_dynar_free(&previous);
-      }
-      return 0;
-    }
-
-    addr_frag1 = (void*) ((char *)addr_block1 + (frag1 << heapinfo1[block1].type));
-    addr_frag2 = (void*) ((char *)addr_block2 + (frag2 << heapinfo2[block2].type));
-
-    area1_to_compare = addr_frag1;
-    area2_to_compare = addr_frag2;
-      
-    size = heapinfo1[block1].busy_frag.frag_size[frag1];
-
     if(size <= 0){
       if(match_pairs){
         match_equals(previous);
@@ -724,58 +1260,41 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){
       }
       return 0;
     }
-
-    if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && (heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
-      check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];   
+      
+    if((heapinfo1[block1].busy_frag.ignore[frag1] > 0) && ( heapinfo2[block2].busy_frag.ignore[frag2] == heapinfo1[block1].busy_frag.ignore[frag1]))
+      check_ignore = heapinfo1[block1].busy_frag.ignore[frag1];
     
   }else{
+
     if(match_pairs){
       xbt_dynar_free(&previous);
     }
     return 1;
+
   }
   
-  while(i<size){
 
-    if(check_ignore > 0){
-      if((ignore1 = heap_comparison_ignore_size(to_ignore1, (char *)area1 + i)) > 0){
-        if((ignore2 = heap_comparison_ignore_size(to_ignore2, (char *)area2 + i))  == ignore1){
-          i = i + ignore2;
-          check_ignore--;
-          continue;
-        }
-      }
+  /* Start comparison*/
+  if(type_id != NULL){
+    if(switch_type)
+      res_compare = compare_heap_area_with_type(area1, area2, area1_to_compare, area2_to_compare, previous, other_types, all_types, type_id, size, check_ignore, pointer_level);
+    else
+      res_compare = compare_heap_area_with_type(area1, area2, area1_to_compare, area2_to_compare, previous, all_types, other_types, type_id, size, check_ignore, pointer_level);
+    if(res_compare == 1){
+      if(match_pairs)
+        xbt_dynar_free(&previous);
+      return res_compare;
     }
-
-    if(memcmp(((char *)area1_to_compare) + i, ((char *)area2_to_compare) + i, 1) != 0){
-
-      pointer_align = (i / sizeof(void*)) * sizeof(void*);
-      addr_pointed1 = *((void **)((char *)area1_to_compare + pointer_align));
-      addr_pointed2 = *((void **)((char *)area2_to_compare + pointer_align));
-      
-      if(addr_pointed1 > maestro_stack_start && addr_pointed1 < maestro_stack_end && addr_pointed2 > maestro_stack_start && addr_pointed2 < maestro_stack_end){
-        i = pointer_align + sizeof(void *);
-        continue;
-      }else if((addr_pointed1 > s_heap) && ((char *)addr_pointed1 < (char *)s_heap + STD_HEAP_SIZE) 
-           && (addr_pointed2 > s_heap) && ((char *)addr_pointed2 < (char *)s_heap + STD_HEAP_SIZE)){
-        res_compare = compare_area(addr_pointed1, addr_pointed2, previous);
-        if(res_compare != 0){
-          if(match_pairs)
-            xbt_dynar_free(&previous);
-          return res_compare;
-        }
-        i = pointer_align + sizeof(void *);
-        continue;
-      }else{
-        if(match_pairs)
-          xbt_dynar_free(&previous);
-        return 1;
-      }
-      
+  }else{
+    if(switch_type)
+      res_compare = compare_heap_area_without_type(area1, area2, area1_to_compare, area2_to_compare, previous, other_types, all_types, size, check_ignore);
+    else
+      res_compare = compare_heap_area_without_type(area1, area2, area1_to_compare, area2_to_compare, previous, all_types, other_types, size, check_ignore);
+    if(res_compare == 1){
+      if(match_pairs)
+        xbt_dynar_free(&previous);
+      return res_compare;
     }
-    
-    i++;
-
   }
 
   if(match_pairs){
@@ -784,101 +1303,56 @@ int compare_area(void *area1, void* area2, xbt_dynar_t previous){
   }
 
   return 0;
-  
-
 }
 
-static void heap_area_pair_free(heap_area_pair_t pair){
-  xbt_free(pair);
-  pair = NULL;
-}
+/*********************************************** Miscellaneous ***************************************************/
+/****************************************************************************************************************/
 
-static void heap_area_pair_free_voidp(void *d)
-{
-  heap_area_pair_free((heap_area_pair_t) * (void **) d);
-}
 
-static int add_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2){
-
-  if(is_new_heap_area_pair(list, block1, fragment1, block2, fragment2)){
-    heap_area_pair_t pair = NULL;
-    pair = xbt_new0(s_heap_area_pair_t, 1);
-    pair->block1 = block1;
-    pair->fragment1 = fragment1;
-    pair->block2 = block2;
-    pair->fragment2 = fragment2;
-    
-    xbt_dynar_push(list, &pair); 
-
-    return 1;
-  }
-
-  return 0;
-}
-static int is_new_heap_area_pair(xbt_dynar_t list, int block1, int fragment1, int block2, int fragment2){
-  
-  unsigned int cursor = 0;
-  heap_area_pair_t current_pair;
+int get_pointed_area_size(void *area, int heap){
 
-  xbt_dynar_foreach(list, cursor, current_pair){
-    if(current_pair->block1 == block1 && current_pair->block2 == block2 && current_pair->fragment1 == fragment1 && current_pair->fragment2 == fragment2)
-      return 0; 
-  }
-  
-  return 1;
-}
-
-
-void match_equals(xbt_dynar_t list){
+  int block, frag;
+  malloc_info *heapinfo;
 
-  unsigned int cursor = 0;
-  heap_area_pair_t current_pair;
-  heap_area_t previous_area;
+  if(heap == 1)
+    heapinfo = heapinfo1;
+  else
+    heapinfo = heapinfo2;
 
-  xbt_dynar_foreach(list, cursor, current_pair){
+  block = ((char*)area - (char*)((xbt_mheap_t)s_heap)->heapbase) / BLOCKSIZE + 1;
 
-    if(current_pair->fragment1 != -1){
-      
-      if(heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1] != NULL){    
-        previous_area = heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1];
-        xbt_free(heapinfo2[previous_area->block].busy_frag.equal_to[previous_area->fragment]);
-        heapinfo2[previous_area->block].busy_frag.equal_to[previous_area->fragment] = NULL;
-        xbt_free(previous_area); 
-      }
-      if(heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2] != NULL){        
-        previous_area = heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2];
-        xbt_free(heapinfo1[previous_area->block].busy_frag.equal_to[previous_area->fragment]);
-        heapinfo1[previous_area->block].busy_frag.equal_to[previous_area->fragment] = NULL;
-        xbt_free(previous_area);
-      }
+  if(((char *)area < (char*)((xbt_mheap_t)s_heap)->heapbase)  || (block > heapsize1) || (block < 1))
+    return -1;
 
-      heapinfo1[current_pair->block1].busy_frag.equal_to[current_pair->fragment1] = new_heap_area(current_pair->block2, current_pair->fragment2);
-      heapinfo2[current_pair->block2].busy_frag.equal_to[current_pair->fragment2] = new_heap_area(current_pair->block1, current_pair->fragment1);
+  if(heapinfo[block].type == -1){ /* Free block */
+    return -1;  
+  }else if(heapinfo[block].type == 0){ /* Complete block */
+    return (int)heapinfo[block].busy_block.busy_size;
+  }else{
+    frag = ((uintptr_t) (ADDR2UINT (area) % (BLOCKSIZE))) >> heapinfo[block].type;
+    return (int)heapinfo[block].busy_frag.frag_size[frag];
+  }
 
-    }else{
+}
 
-      if(heapinfo1[current_pair->block1].busy_block.equal_to != NULL){
-        previous_area = heapinfo1[current_pair->block1].busy_block.equal_to;
-        xbt_free(heapinfo2[previous_area->block].busy_block.equal_to);
-        heapinfo2[previous_area->block].busy_block.equal_to = NULL; 
-        xbt_free(previous_area);
-      }
-      if(heapinfo2[current_pair->block2].busy_block.equal_to != NULL){
-        previous_area = heapinfo2[current_pair->block2].busy_block.equal_to;
-        xbt_free(heapinfo1[previous_area->block].busy_block.equal_to);
-        heapinfo1[previous_area->block].busy_block.equal_to = NULL;
-        xbt_free(previous_area);
-      }
+char *get_type_description(xbt_dict_t types, char *type_name){
 
-      heapinfo1[current_pair->block1].busy_block.equal_to = new_heap_area(current_pair->block2, current_pair->fragment2);
-      heapinfo2[current_pair->block2].busy_block.equal_to = new_heap_area(current_pair->block1, current_pair->fragment1);
+  xbt_dict_cursor_t dict_cursor;
+  char *type_origin;
+  dw_type_t type;
 
+  xbt_dict_foreach(types, dict_cursor, type_origin, type){
+    if(type->name && (strcmp(type->name, type_name) == 0) && type->size > 0){
+      xbt_dict_cursor_free(&dict_cursor);
+      return type_origin;
     }
   }
 
+  xbt_dict_cursor_free(&dict_cursor);
+  return NULL;
 }
 
+
 #ifndef max
 #define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
 #endif
@@ -1007,165 +1481,3 @@ int mmalloc_linear_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2){
   
 }
 
-static int is_stack(void *address){
-  unsigned int cursor = 0;
-  stack_region_t stack;
-
-  xbt_dynar_foreach(stacks_areas, cursor, stack){
-    if(address == stack->address)
-      return 1;
-  }
-
-  return 0;
-}
-
-static int is_block_stack(int block){
-  unsigned int cursor = 0;
-  stack_region_t stack;
-
-  xbt_dynar_foreach(stacks_areas, cursor, stack){
-    if(block == stack->block)
-      return 1;
-  }
-
-  return 0;
-}
-
-static void add_heap_equality(xbt_dynar_t equals, void *a1, void *a2){
-  
-  if(xbt_dynar_is_empty(equals)){
-
-    heap_equality_t he = xbt_new0(s_heap_equality_t, 1);
-    he->address1 = a1;
-    he->address2 = a2;
-
-    xbt_dynar_insert_at(equals, 0, &he);
-  
-  }else{
-
-    unsigned int cursor = 0;
-    int start = 0;
-    int end = xbt_dynar_length(equals) - 1;
-    heap_equality_t current_equality = NULL;
-
-    while(start <= end){
-      cursor = (start + end) / 2;
-      current_equality = (heap_equality_t)xbt_dynar_get_as(equals, cursor, heap_equality_t);
-      if(current_equality->address1 == a1){
-        if(current_equality->address2 == a2)
-          return;
-        if(current_equality->address2 < a2)
-          start = cursor + 1;
-        if(current_equality->address2 > a2)
-          end = cursor - 1;
-      }
-      if(current_equality->address1 < a1)
-        start = cursor + 1;
-      if(current_equality->address1 > a1)
-        end = cursor - 1; 
-    }
-
-    heap_equality_t he = xbt_new0(s_heap_equality_t, 1);
-    he->address1 = a1;
-    he->address2 = a2;
-  
-    if(current_equality->address1 < a1)
-      xbt_dynar_insert_at(equals, cursor + 1 , &he);
-    else
-       xbt_dynar_insert_at(equals, cursor, &he); 
-
-  }
-
-}
-
-static void remove_heap_equality(xbt_dynar_t equals, int address, void *a){
-  
-  unsigned int cursor = 0;
-  heap_equality_t current_equality;
-  int found = 0;
-
-  if(address == 1){
-
-    int start = 0;
-    int end = xbt_dynar_length(equals) - 1;
-
-
-    while(start <= end && found == 0){
-      cursor = (start + end) / 2;
-      current_equality = (heap_equality_t)xbt_dynar_get_as(equals, cursor, heap_equality_t);
-      if(current_equality->address1 == a)
-        found = 1;
-      if(current_equality->address1 < a)
-        start = cursor + 1;
-      if(current_equality->address1 > a)
-        end = cursor - 1; 
-    }
-
-    if(found == 1)
-      xbt_dynar_remove_at(equals, cursor, NULL);
-  
-  }else{
-
-    xbt_dynar_foreach(equals, cursor, current_equality){
-      if(current_equality->address2 == a){
-        found = 1;
-        break;
-      }
-    }
-
-    if(found == 1)
-      xbt_dynar_remove_at(equals, cursor, NULL);
-
-  }
-  
-}
-
-int is_free_area(void *area, xbt_mheap_t heap){
-
-  void *sheap = (char *)mmalloc_get_current_heap() - STD_HEAP_SIZE - getpagesize();
-  malloc_info *heapinfo = (malloc_info *)((char *)heap + ((uintptr_t)((char *)heap->heapinfo - (char *)sheap)));
-  size_t heapsize = heap->heapsize;
-
-  /* Get block number */ 
-  size_t block = ((char*)area - (char*)((xbt_mheap_t)sheap)->heapbase) / BLOCKSIZE + 1;
-  size_t fragment;
-
-  /* Check if valid block number */
-  if((char *)area < (char*)((xbt_mheap_t)sheap)->heapbase || block > heapsize || block < 1)
-    return 0;
-
-  if(heapinfo[block].type < 0)
-    return 1;
-
-  if(heapinfo[block].type == 0)
-    return 0;
-
-  if(heapinfo[block].type > 0){
-    fragment = ((uintptr_t) (ADDR2UINT(area) % (BLOCKSIZE))) >> heapinfo[block].type;
-    if(heapinfo[block].busy_frag.frag_size[fragment] == 0)
-      return 1;  
-  }
-
-  return 0;
-}
-
-static int equal_blocks(int b1, int b2){
-  if(heapinfo1[b1].busy_block.equal_to != NULL){
-    if(heapinfo2[b2].busy_block.equal_to != NULL){
-      if(((heap_area_t)(heapinfo1[b1].busy_block.equal_to))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_block.equal_to))->block == b1)
-        return 1;
-    }
-  }
-  return 0;
-}
-
-static int equal_fragments(int b1, int f1, int b2, int f2){
-  if(heapinfo1[b1].busy_frag.equal_to[f1] != NULL){
-    if(heapinfo2[b2].busy_frag.equal_to[f2] != NULL){
-      if(((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->block == b2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->block == b1 && ((heap_area_t)(heapinfo1[b1].busy_frag.equal_to[f1]))->fragment == f2 && ((heap_area_t)(heapinfo2[b2].busy_frag.equal_to[f2]))->fragment == f1)
-        return 1;
-    }
-  }
-  return 0;
-}
index e92b122..b202c9b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0dfd027..01c0bce 100644 (file)
@@ -365,3 +365,16 @@ size_t mmalloc_get_bytes_used(xbt_mheap_t heap){
   return bytes;
 }
 
+ssize_t mmalloc_get_busy_size(xbt_mheap_t heap, void *ptr){
+
+  ssize_t block = ((char*)ptr - (char*)(heap->heapbase)) / BLOCKSIZE + 1;
+  if(heap->heapinfo[block].type == -1)
+    return -1;
+  else if(heap->heapinfo[block].type == 0)
+    return heap->heapinfo[block].busy_block.busy_size;
+  else{
+    ssize_t frag = ((uintptr_t) (ADDR2UINT (ptr) % (BLOCKSIZE))) >> heap->heapinfo[block].type;
+    return heap->heapinfo[block].busy_frag.frag_size[frag];
+  }
+    
+}
index 42845de..fd71075 100644 (file)
@@ -4,7 +4,7 @@
    Written May 1989 by Mike Haertel.
    Heavily modified Mar 1992 by Fred Fish for mmap'd version. */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -117,13 +117,13 @@ static void *register_morecore(struct mdesc *mdp, size_t size)
 
     /* mark the space previously occupied by the block info as free by first marking it
      * as occupied in the regular way, and then freing it */
-    for (it=0; it<BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); it++)
+    for (it=0; it<BLOCKIFY(mdp->heapsize * sizeof(malloc_info)); it++){
       newinfo[BLOCK(oldinfo)+it].type = 0;
+      newinfo[BLOCK(oldinfo)+it].busy_block.ignore = 0;
+    }
 
     newinfo[BLOCK(oldinfo)].busy_block.size = BLOCKIFY(mdp->heapsize * sizeof(malloc_info));
     newinfo[BLOCK(oldinfo)].busy_block.busy_size = size;
-    newinfo[BLOCK(oldinfo)].busy_block.ignore = 0;
-    //newinfo[BLOCK(oldinfo)].busy_block.bt_size = 0;// FIXME setup the backtrace
     mfree(mdp, (void *) oldinfo);
     mdp->heapsize = newsize;
   }
index e1175a7..197341d 100644 (file)
@@ -3,7 +3,8 @@
 
    Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com */
 
-/* Copyright (c) 2010-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 0623bff..aad689e 100644 (file)
@@ -4,7 +4,7 @@
    Written May 1989 by Mike Haertel.
    Heavily modified Mar 1992 by Fred Fish. (fnf@cygnus.com) */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -157,7 +157,6 @@ typedef struct {
       ssize_t frag_size[MAX_FRAGMENT_PER_BLOCK];
       //void *bt[MAX_FRAGMENT_PER_BLOCK][XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */
       int ignore[MAX_FRAGMENT_PER_BLOCK];
-      heap_area_t equal_to[MAX_FRAGMENT_PER_BLOCK];
     } busy_frag;
     struct {
       size_t size; /* Size (in blocks) of a large cluster.  */
@@ -165,7 +164,6 @@ typedef struct {
       //void *bt[XBT_BACKTRACE_SIZE]; /* Where it was malloced (or realloced lastly) */
       //int bt_size;
       int ignore;
-      heap_area_t equal_to;
     } busy_block;
     /* Heap information for a free block (that may be the first of a free cluster).  */
     struct {
index 40d8c72..3569c14 100644 (file)
@@ -2,7 +2,7 @@
    Copyright 1990, 1991 Free Software Foundation
    Written May 1989 by Mike Haertel. */
 
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -82,8 +82,10 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       int it;
       /* The new size is smaller; return excess memory to the free list. */
       //printf("(%s) return excess memory...",xbt_thread_self_name());
-      for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++)
+      for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++){
         mdp->heapinfo[it].type = 0; // FIXME that should be useless, type should already be 0 here
+        mdp->heapinfo[it].busy_block.ignore = 0;
+      }
 
       mdp->heapinfo[block + blocks].busy_block.size
         = mdp->heapinfo[block].busy_block.size - blocks;
index c7592a0..3e56435 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -53,6 +53,10 @@ static void xbt_parmap_busy_worker_signal(xbt_parmap_t parmap);
 static void xbt_parmap_busy_master_signal(xbt_parmap_t parmap);
 static void xbt_parmap_busy_worker_wait(xbt_parmap_t parmap, unsigned round);
 
+#ifdef HAVE_MC
+static void xbt_parmap_mc_work(xbt_parmap_t parmap, int worker_id);
+static void *xbt_parmap_mc_worker_main(void *arg);
+#endif
 
 /**
  * \brief Parallel map structure
@@ -63,10 +67,19 @@ typedef struct s_xbt_parmap {
   unsigned thread_counter;         /**< number of workers that have done the work */
 
   unsigned int num_workers;        /**< total number of worker threads including the controller */
+  xbt_os_thread_t *workers;        /**< worker thread handlers */
   void_f_pvoid_t fun;              /**< function to run in parallel on each element of data */
   xbt_dynar_t data;                /**< parameters to pass to fun in parallel */
   unsigned int index;              /**< index of the next element of data to pick */
 
+#ifdef HAVE_MC
+  int finish;
+  void* ref_snapshot;
+  int_f_pvoid_pvoid_t snapshot_compare;
+  unsigned int length;
+  void* mc_data;
+#endif
+
   /* posix only */
   xbt_os_cond_t ready_cond;
   xbt_os_mutex_t ready_mutex;
@@ -100,12 +113,12 @@ typedef s_xbt_parmap_thread_data_t *xbt_parmap_thread_data_t;
 xbt_parmap_t xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
 {
   unsigned int i;
-  xbt_os_thread_t worker = NULL;
 
   XBT_DEBUG("Create new parmap (%u workers)", num_workers);
 
   /* Initialize the thread pool data structure */
   xbt_parmap_t parmap = xbt_new0(s_xbt_parmap_t, 1);
+  parmap->workers = xbt_new(xbt_os_thread_t, num_workers);
 
   parmap->num_workers = num_workers;
   parmap->status = XBT_PARMAP_WORK;
@@ -113,16 +126,52 @@ xbt_parmap_t xbt_parmap_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
 
   /* Create the pool of worker threads */
   xbt_parmap_thread_data_t data;
+  parmap->workers[0] = NULL;
   for (i = 1; i < num_workers; i++) {
     data = xbt_new0(s_xbt_parmap_thread_data_t, 1);
     data->parmap = parmap;
     data->worker_id = i;
-    worker = xbt_os_thread_create(NULL, xbt_parmap_worker_main, data, NULL);
-    xbt_os_thread_detach(worker);
+    parmap->workers[i] = xbt_os_thread_create(NULL, xbt_parmap_worker_main,
+                                              data, NULL);
   }
   return parmap;
 }
 
+#ifdef HAVE_MC
+/**
+ * \brief Creates a parallel map object
+ * \param num_workers number of worker threads to create
+ * \param mode how to synchronize the worker threads
+ * \return the parmap created
+ */
+xbt_parmap_t xbt_parmap_mc_new(unsigned int num_workers, e_xbt_parmap_mode_t mode)
+{
+  unsigned int i;
+
+  XBT_DEBUG("Create new parmap (%u workers)", num_workers);
+
+  /* Initialize the thread pool data structure */
+  xbt_parmap_t parmap = xbt_new0(s_xbt_parmap_t, 1);
+  parmap->workers = xbt_new(xbt_os_thread_t, num_workers);
+
+  parmap->num_workers = num_workers;
+  parmap->status = XBT_PARMAP_WORK;
+  xbt_parmap_set_mode(parmap, mode);
+
+  /* Create the pool of worker threads */
+  xbt_parmap_thread_data_t data;
+  parmap->workers[0] = NULL;
+  for (i = 1; i < num_workers; i++) {
+    data = xbt_new0(s_xbt_parmap_thread_data_t, 1);
+    data->parmap = parmap;
+    data->worker_id = i;
+    parmap->workers[i] = xbt_os_thread_create(NULL, xbt_parmap_mc_worker_main,
+                                              data, NULL);
+  }
+  return parmap;
+}
+#endif
+
 /**
  * \brief Destroys a parmap
  * \param parmap the parmap to destroy
@@ -135,13 +184,17 @@ void xbt_parmap_destroy(xbt_parmap_t parmap)
 
   parmap->status = XBT_PARMAP_DESTROY;
   parmap->master_signal_f(parmap);
-  parmap->master_wait_f(parmap);
+
+  unsigned int i;
+  for (i = 1; i < parmap->num_workers; i++)
+    xbt_os_thread_join(parmap->workers[i], NULL);
 
   xbt_os_cond_destroy(parmap->ready_cond);
   xbt_os_mutex_destroy(parmap->ready_mutex);
   xbt_os_cond_destroy(parmap->done_cond);
   xbt_os_mutex_destroy(parmap->done_mutex);
 
+  xbt_free(parmap->workers);
   xbt_free(parmap);
 }
 
@@ -280,12 +333,94 @@ static void *xbt_parmap_worker_main(void *arg)
 
     /* We are destroying the parmap */
     } else {
+      SIMIX_context_free(context);
       xbt_free(data);
+      return NULL;
+    }
+  }
+}
+
+#ifdef HAVE_MC
+
+/**
+ * \brief Applies a list of tasks in parallel.
+ * \param parmap a parallel map object
+ * \param fun the function to call in parallel
+ * \param data each element of this dynar will be passed as an argument to fun
+ */
+int xbt_parmap_mc_apply(xbt_parmap_t parmap, int_f_pvoid_pvoid_t fun, 
+                         void* data, unsigned int length,  void* ref_snapshot)
+{
+  /* Assign resources to worker threads */
+  parmap->snapshot_compare = fun;
+  parmap->mc_data = data;
+  parmap->index = 0;
+  parmap->finish = -1;
+  parmap->length = length;
+  parmap->ref_snapshot = ref_snapshot;
+  parmap->master_signal_f(parmap);
+  xbt_parmap_mc_work(parmap, 0);
+  parmap->master_wait_f(parmap);
+  XBT_DEBUG("Job done");
+  return parmap->finish;
+}
+
+static void xbt_parmap_mc_work(xbt_parmap_t parmap, int worker_id)
+{
+  unsigned int data_size = (parmap->length / parmap->num_workers) +
+    ((parmap->length % parmap->num_workers) ? 1 :0);
+  void* start = (char*)parmap->mc_data + (data_size*worker_id*sizeof(void*));
+  void* end = MIN((char *)start + data_size* sizeof(void*), (char*)parmap->mc_data + parmap->length*sizeof(void*));
+  
+  //XBT_CRITICAL("Worker %d : %p -> %p (%d)", worker_id, start, end, data_size);
+
+  while ( start < end && parmap->finish == -1) {
+    //XBT_CRITICAL("Starting with %p", start);
+    int res = parmap->snapshot_compare(*(void**)start, parmap->ref_snapshot);
+    start = (char *)start + sizeof(start);
+    if (!res){
+    
+      parmap->finish = ((char*)start - (char*)parmap->mc_data) / sizeof(void*);
+      //XBT_CRITICAL("Find good one %p (%p)", start, parmap->mc_data);
+      break;
+    }
+  }
+}
+
+/**
+ * \brief Main function of a worker thread.
+ * \param arg the parmap
+ */
+static void *xbt_parmap_mc_worker_main(void *arg)
+{
+  xbt_parmap_thread_data_t data = (xbt_parmap_thread_data_t) arg;
+  xbt_parmap_t parmap = data->parmap;
+  unsigned round = 0;
+  /* smx_context_t context = SIMIX_context_new(NULL, 0, NULL, NULL, NULL); */
+  /* SIMIX_context_set_current(context); */
+
+  XBT_DEBUG("New worker thread created");
+
+  /* Worker's main loop */
+  while (1) {
+    parmap->worker_wait_f(parmap, ++round);
+    if (parmap->status == XBT_PARMAP_WORK) {
+
+      XBT_DEBUG("Worker %d got a job", data->worker_id);
+
+      xbt_parmap_mc_work(parmap, data->worker_id);
       parmap->worker_signal_f(parmap);
+
+      XBT_DEBUG("Worker %d has finished", data->worker_id);
+
+    /* We are destroying the parmap */
+    } else {
+      xbt_free(data);
       return NULL;
     }
   }
 }
+#endif
 
 #ifdef HAVE_FUTEX_H
 static void futex_wait(unsigned *uaddr, unsigned val)
index eb09a35..27e767a 100644 (file)
@@ -1,6 +1,6 @@
 /* set - data container consisting in dict+dynar                            */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -420,7 +420,7 @@ static void traverse(xbt_set_t set)
     xbt_test_assert(elm, "Dude ! Got a null elm during traversal!");
     xbt_test_log("Id(%u):  %s->%s\n", elm->ID, elm->name, elm->data);
     xbt_test_assert(!strcmp(elm->name, elm->data),
-                     "Key(%s) != value(%s). Abording", elm->name,
+                     "Key(%s) != value(%s). Aborting", elm->name,
                      elm->data);
   }
 }
index 1c7d21a..a5430b2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6efbf64..f66389d 100644 (file)
@@ -1,6 +1,7 @@
 /* file_appender - a dumb log appender which simply prints to a file        */
 
-/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index bbe1cb1..9dc2426 100644 (file)
@@ -1,6 +1,6 @@
 /* layout_simple - a dumb log layout                                        */
 
-/* Copyright (c) 2007-2011. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index be6b390..80439e0 100644 (file)
@@ -1,6 +1,6 @@
 /* layout_simple - a dumb log layout                                        */
 
-/* Copyright (c) 2007-2011. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 773e3c5..141e329 100644 (file)
@@ -1,6 +1,7 @@
 /* module handling                                                          */
 
-/* Copyright (c) 2006-2012. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt_modinter.h"       /* prototype of other module's init/exit in XBT */
 
+#include "simgrid/sg_config.h"
+
+#include <stdio.h>
+
 XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 
@@ -28,6 +33,7 @@ char *xbt_binary_name = NULL;   /* Name of the system process containing us (man
 xbt_dynar_t xbt_cmdline = NULL; /* all we got in argv */
 
 int xbt_initialized = 0;
+int _sg_do_clean_atexit = 1;
 
 /* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library.
  * This is crude and rather compiler-specific, unfortunately.
@@ -80,6 +86,10 @@ static void xbt_preinit(void) {
 
 #ifdef MMALLOC_WANT_OVERRIDE_LEGACY
   mmalloc_preinit();
+#endif
+#ifdef _TWO_DIGIT_EXPONENT
+  /* Even printf behaves differently on Windows... */
+  _set_output_format(_TWO_DIGIT_EXPONENT);
 #endif
   xbt_log_preinit();
   xbt_backtrace_preinit();
@@ -88,13 +98,16 @@ static void xbt_preinit(void) {
   xbt_dict_preinit();
    
   srand(seed);
+#ifndef _WIN32
   srand48(seed);
+#endif
 
-  atexit(xbt_postexit);   
+  atexit(xbt_postexit);
 }
 
 static void xbt_postexit(void)
 {
+  if(!_sg_do_clean_atexit) return;
   xbt_backtrace_postexit();
   xbt_fifo_postexit();
   xbt_dict_postexit();
index 58941b7..574e2b9 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_matrix_t management functions                                        */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f435231..93fee90 100644 (file)
@@ -2,7 +2,7 @@
 /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD     */
 /* in SG, when using CONTEXT_UCONTEXT, xbt_os_thread_stub is used instead   */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -1234,7 +1234,8 @@ void xbt_os_thread_set_extra_data(void *data)
 
 void *xbt_os_thread_get_extra_data(void)
 {
-  return xbt_os_thread_self()->extra_data;
+  xbt_os_thread_t self = xbt_os_thread_self();
+  return self? self->extra_data : NULL;
 }
 
 xbt_os_rmutex_t xbt_os_rmutex_init(void)
index 4e0f331..f378ca1 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_os_time.c -- portable interface to time-related functions            */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -92,13 +92,17 @@ void xbt_os_sleep(double sec)
 struct s_xbt_os_timer {
 #ifdef HAVE_POSIX_GETTIME
   struct timespec start, stop, elapse;
-#elif defined(HAVE_GETTIMEOFDAY)
+#elif defined(HAVE_GETTIMEOFDAY) || defined(_XBT_WIN32)
   struct timeval start, stop, elapse;
 #else
   unsigned long int start, stop, elapse;
 #endif
 };
 
+size_t xbt_os_timer_size(void){
+  return sizeof(struct s_xbt_os_timer);
+}
+
 xbt_os_timer_t xbt_os_timer_new(void)
 {
   return xbt_new0(struct s_xbt_os_timer, 1);
@@ -249,7 +253,7 @@ void xbt_os_cputimer_start(xbt_os_timer_t timer)
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec = 0;
-  timer->elapse.tv_nsec = 0;
+  timer->elapse.tv_usec = 0;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
@@ -277,7 +281,7 @@ void xbt_os_cputimer_resume(xbt_os_timer_t timer)
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
-  timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
+  timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
@@ -357,7 +361,7 @@ void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
 #elif defined(_XBT_WIN32)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
-  timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
+  timer->elapse.tv_usec += timer->stop.tv_usec - timer->start.tv_usec;
 #  if defined(WIN32_WCE) || (_WIN32_WINNT < 0x0400)
   THROW_UNIMPLEMENTED;
 #  else
index 919f51d..8af65f8 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_peer_t management functions                                          */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 78e578c..ee98e0d 100644 (file)
@@ -1,7 +1,7 @@
 /* A (synchronized) message queue.                                          */
 /* Popping an empty queue is blocking, as well as pushing a full one        */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index dd5bda1..f539ed1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index dccc235..bd85f59 100644 (file)
@@ -2,14 +2,14 @@
 
 /* This is always part of SG, never of RL. Content:                         */
 /*  - a bunch of stub functions of the thread related function that we need */
-/*    to add to the lib to please the linker when using ucontextes.         */
+/*    to add to the lib to please the linker when using ucontexts.          */
 /*  - a bunch of stub functions of the java related function when we don't  */
 /*    compile java bindings.                                                */
 
 /* In RL, java is useless, and threads are always part of the picture,      */
 /*  ucontext never */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ae49355..d9e3d59 100644 (file)
@@ -3,7 +3,7 @@
 
 /* This is the simulation implementation, using simix.                      */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index de3522f..d03cd89 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /* Later adapted to fit into SimGrid. Distributed under LGPL v2.1, Feb 1999.*/
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ static void xbt_sha_finalize(xbt_sha_t sha)
 /** @brief returns the sha hash into a newly allocated buffer (+ reset sha object) */
 char *xbt_sha_read(xbt_sha_t sha)
 {
-  char *res = xbt_malloc(40);
+  char *res = xbt_malloc(41);
   xbt_sha_print(sha, res);
   return res;
 }
index 9247f2d..01a4052 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_str.c - various helping functions to deal with strings               */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 70a08ac..f066ef7 100644 (file)
@@ -1,6 +1,6 @@
 /* strbuff -- string buffers                                                */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 664d87b..e8ff9d7 100644 (file)
@@ -1,6 +1,6 @@
 /* virtu - virtualization layer for XBT to choose between GRAS and MSG implementation */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8e86bf8..1f88a67 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt_modinter - How to init/exit the XBT modules                          */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/teshsuite/CMakeLists.txt b/teshsuite/CMakeLists.txt
deleted file mode 100644 (file)
index 4412acb..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-set(tesh_files
-  ${tesh_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/SimGrid.tesh
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(teshsuite_src
-  ${teshsuite_src}
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/SimGrid.tesh b/teshsuite/SimGrid.tesh
deleted file mode 100644 (file)
index 7260650..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-D Tesh tests of SimGrid library.
-p Command line tesh --directory=%teshsuite_dir% --include-dir=simdag --include-dir=xbt --file=SimGrid.tesh --log="log.thresh:info tesh.fmt:%m%n"
-
-$ cd ${TESHSUITE_DIR:=.}
-
-# XBT
-
-! include log_large_test.tesh
-
-# SimDag Tests
-
-# Basic Tests
-! include basic0.tesh
-! include basic1.tesh
-! include basic2.tesh
-! include basic3.tesh
-! include basic4.tesh
-! include basic5.tesh
-! include basic6.tesh
-! include incomplete.tesh
-
-# Network Tests
-! include network/test_reinit_costs.tesh
-
-# MXN Tests
-! include network/mxn/test_intra_scatter.tesh
-! include network/mxn/test_intra_independent_comm.tesh
-! include network/mxn/test_intra_all2all.tesh
-
-# P2P Tests
-! include network/p2p/test_latency1.tesh
-! include network/p2p/test_latency2.tesh
-! include network/p2p/test_latency3.tesh
-! include network/p2p/test_latency_bound.tesh
-
-# Parallel task
-! include partask/test_comp_only_par.tesh
-! include partask/test_comp_only_seq.tesh
-
-# Platforms
-! include platforms/basic_parsing_test.tesh
-! include platforms/flatifier.tesh
index c6237bd..0f8270c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 54c8901..e5b8ac7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/teshsuite/msg/storage/CMakeLists.txt b/teshsuite/msg/storage/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8f2c3fc
--- /dev/null
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(storage storage.c)
+
+### Add definitions for compile
+if(NOT WIN32)
+  target_link_libraries(storage simgrid m pthread )
+else()
+  target_link_libraries(storage simgrid)
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/storage.tesh
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml
+  ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml
+  PARENT_SCOPE
+  )
+set(teshsuite_src
+  ${teshsuite_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/storage.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_c.txt
+  ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_s1.txt
+  ${CMAKE_CURRENT_SOURCE_DIR}/storage_content_s2.txt
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/msg/storage/deployment.xml b/teshsuite/msg/storage/deployment.xml
new file mode 100644 (file)
index 0000000..dab6a8c
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+  <process host="server" function="server" />
+  <process host="client" function="client" />
+</platform>
\ No newline at end of file
diff --git a/teshsuite/msg/storage/platform.xml b/teshsuite/msg/storage/platform.xml
new file mode 100644 (file)
index 0000000..caec3da
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+
+<platform version="3">
+       <AS id="AS0" routing="Full">
+               <!-- STORAGE TYPES -->
+               <storage_type id="crucial" model="SSD" size="500">
+                       <prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
+                       <prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
+                       <prop id="Bconnection" value="150000000" /> <!-- 150Mo/s -->
+               </storage_type>
+
+               <storage_type id="single_HDD" model="linear_no_lat" size="500GiB" content_type="txt_unix">
+                       <prop id="Bwrite" value="30MBps" />
+                       <prop id="Bread" value="100MBps" />
+                       <prop id="Bconnection" value="150MBps" />
+               </storage_type>
+
+               <storage_type id="single_SSD" model="linear_no_lat"
+                       content="content/storage_content.txt" size="500GiB">
+                       <prop id="Bwrite" value="30MBps" />
+                       <prop id="Bread" value="100MBps" />
+                       <prop id="Bconnection" value="150MBps" />
+               </storage_type>
+
+               <!-- DISKS -->
+               <storage id="cdisk" typeId="single_HDD" content="msg/storage/storage_content_c.txt">
+                  <prop id="filename" value="prop.xml"/>
+                  <prop id="date" value="31-08-12"/>
+           <prop id="author" value="pnavarro"/>
+               </storage>
+               <storage id="sdisk1" typeId="single_SSD" content="msg/storage/storage_content_s1.txt" />
+               <storage id="sdisk2" typeId="single_HDD" content="msg/storage/storage_content_s2.txt" />
+
+               <!-- HOSTS -->
+               <host id="client" power="1000000000">
+                       <mount storageId="cdisk" name="/sd1" />
+               </host>
+
+               <host id="server" power="1000000000">
+                       <mount storageId="sdisk1" name="/sd1" />
+                       <mount storageId="sdisk2" name="/sd2" />
+                       <prop id="ip adress" value="127.0.0.5"/>
+               </host>
+
+               <!-- LINKS & ROUTES -->
+               <link id="link" bandwidth="125MBps" latency="50us" />
+
+               <route src="client" dst="server" symmetrical="YES">
+                       <link_ctn id="link" />
+               </route>
+       </AS>
+</platform>
diff --git a/teshsuite/msg/storage/storage.c b/teshsuite/msg/storage/storage.c
new file mode 100644 (file)
index 0000000..a9d1ebc
--- /dev/null
@@ -0,0 +1,227 @@
+#include "msg/msg.h"
+#include "xbt/log.h"
+#include "inttypes.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(storage,"Messages specific for this simulation");
+
+void storage_info(msg_host_t host);
+void display_storage_properties(msg_storage_t storage);
+int hsm_put(const char *remote_host, const char *src, const char *dest);
+sg_storage_size_t write_local_file(char *dest, sg_storage_size_t file_size);
+sg_storage_size_t read_local_file(const char *src);
+void display_storage_info(msg_host_t host);
+void dump_storage_by_name(char *name);
+void display_storage_content(msg_storage_t storage);
+void get_set_storage_data(const char *storage_name);
+int client(int argc, char *argv[]);
+int server(int argc, char *argv[]);
+
+void storage_info(msg_host_t host)
+{
+  const char* host_name = MSG_host_get_name(host);
+  XBT_INFO("*** Storage info on %s ***:", host_name);
+
+  xbt_dict_cursor_t cursor = NULL;
+  char* mount_name;
+  char* storage_name;
+  msg_storage_t storage;
+
+  xbt_dict_t storage_list = MSG_host_get_storage_list(MSG_host_self());
+
+  xbt_dict_foreach(storage_list,cursor,mount_name,storage_name)
+  {
+    XBT_INFO("Storage name: %s, mount name: %s", storage_name, mount_name);
+
+    sg_storage_size_t free_size = MSG_storage_get_free_size(mount_name);
+    sg_storage_size_t used_size = MSG_storage_get_used_size(mount_name);
+
+    XBT_INFO("Free size: %" PRIu64 " bytes", free_size);
+    XBT_INFO("Used size: %" PRIu64 " bytes", used_size);
+
+    storage = MSG_storage_get_by_name(storage_name);
+    display_storage_properties(storage);
+  }
+  xbt_dict_free(&storage_list);
+}
+
+void display_storage_properties(msg_storage_t storage){
+  xbt_dict_cursor_t cursor = NULL;
+  char *key, *data;
+  xbt_dict_t props = MSG_storage_get_properties(storage);
+  if (props){
+    XBT_INFO("Properties of mounted storage: %s", MSG_storage_get_name(storage));
+    xbt_dict_foreach(props, cursor, key, data)
+         XBT_INFO("'%s' -> '%s'", key, data);
+  }else{
+       XBT_INFO("No property attached.");
+  }
+}
+
+// Read src file on local disk and send a put message to remote host (size of message = size of src file)
+int hsm_put(const char *remote_host, const char *src, const char *dest){
+
+  // Read local src file, and return the size that was actually read
+  sg_storage_size_t read_size = read_local_file(src);
+
+  // Send file
+  XBT_INFO("%s sends %" PRIu64 " to %s",MSG_host_get_name(MSG_host_self()),read_size,remote_host);
+  msg_task_t to_execute = MSG_task_create((const char*)"hsm_put", 0, (double) read_size, (void*)dest);
+  MSG_task_send(to_execute, remote_host);
+
+  return 1;
+}
+
+sg_storage_size_t write_local_file(char *dest, sg_storage_size_t file_size)
+{
+  sg_storage_size_t write;
+  msg_file_t file = MSG_file_open("/sd1",dest, NULL);
+  write = MSG_file_write(file, file_size);
+  MSG_file_close(file);
+  return write;
+}
+
+sg_storage_size_t read_local_file(const char *src)
+{
+  sg_storage_size_t read, file_size;
+  msg_file_t file = MSG_file_open("/sd1",src, NULL);
+  file_size = MSG_file_get_size(file);
+
+  read = MSG_file_read(file, file_size);
+  XBT_INFO("%s has read %" PRIu64 " on %s",MSG_host_get_name(MSG_host_self()),read,src);
+  MSG_file_close(file);
+
+  return read;
+}
+
+void display_storage_info(msg_host_t host)
+{
+  const char* host_name = MSG_host_get_name(host);
+  XBT_INFO("*** Storage info of: %s ***", host_name);
+
+  xbt_dict_cursor_t cursor = NULL;
+  char* mount_name;
+  char* storage_name;
+
+  xbt_dict_t storage_list = MSG_host_get_storage_list(host);
+
+  xbt_dict_foreach(storage_list,cursor,mount_name,storage_name)
+  {
+    dump_storage_by_name(storage_name);
+  }
+  xbt_dict_free(&storage_list);
+}
+
+void dump_storage_by_name(char *name){
+  XBT_INFO("*** Dump a storage element ***");
+  msg_storage_t storage = MSG_storage_get_by_name(name);
+
+  if(storage){
+    display_storage_content(storage);
+  }
+  else{
+    XBT_INFO("Unable to retrieve storage element by its name: %s.", name);
+  }
+}
+
+void display_storage_content(msg_storage_t storage){
+  XBT_INFO("Print the content of the storage element: %s",MSG_storage_get_name(storage));
+  xbt_dict_cursor_t cursor = NULL;
+  char *file;
+  sg_storage_size_t *psize;
+  xbt_dict_t content = MSG_storage_get_content(storage);
+  if (content){
+    xbt_dict_foreach(content, cursor, file, psize)
+    XBT_INFO("%s size: %" PRIu64 " bytes", file, *psize);
+  } else {
+    XBT_INFO("No content.");
+  }
+  xbt_dict_free(&content);
+}
+
+void get_set_storage_data(const char *storage_name){
+  XBT_INFO("*** GET/SET DATA for storage element: %s ***",storage_name);
+  msg_storage_t storage = MSG_storage_get_by_name(storage_name);
+  char *data = MSG_storage_get_data(storage);
+  XBT_INFO("Get data: '%s'", data);
+
+  MSG_storage_set_data(storage,strdup("Some data"));
+  data = MSG_storage_get_data(storage);
+  XBT_INFO("Set and get data: '%s'", data);
+}
+
+int client(int argc, char *argv[])
+{
+  hsm_put("server","./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx","./scratch/toto.xml");
+  hsm_put("server","./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml","./scratch/titi.cxx");
+  hsm_put("server","./doc/simgrid/examples/cxx/autoDestination/Slave.cxx","./scratch/tata.cxx");
+
+  msg_task_t finalize = MSG_task_create("finalize", 0, 0, NULL);
+  MSG_task_send(finalize, "server");
+
+  get_set_storage_data("cdisk");
+  display_storage_info(MSG_host_self());
+
+  return 1;
+}
+
+int server(int argc, char *argv[])
+{
+  msg_task_t to_execute = NULL;
+  _XBT_GNUC_UNUSED int res;
+
+  display_storage_info(MSG_host_self());
+
+  XBT_INFO("Server waiting for transfers");
+  while(1){
+    res = MSG_task_receive(&(to_execute), MSG_host_get_name(MSG_host_self()));
+    xbt_assert(res == MSG_OK, "MSG_task_get failed");
+
+    const char *task_name;
+    task_name = MSG_task_get_name(to_execute);
+
+    if (!strcmp(task_name, "finalize")) { // Shutdown ...
+      MSG_task_destroy(to_execute);
+      break;
+    }
+    else if(!strcmp(task_name,"hsm_put")){// Receive file to save
+      // Write file on local disk
+      char *dest = MSG_task_get_data(to_execute);
+      sg_storage_size_t size_to_write = (sg_storage_size_t)MSG_task_get_data_size(to_execute);
+      write_local_file(dest, size_to_write);
+       }
+
+    MSG_task_destroy(to_execute);
+    to_execute = NULL;
+  }
+
+  display_storage_info(MSG_host_self());
+  return 1;
+}
+
+int main(int argc, char *argv[])
+{
+  MSG_init(&argc, argv);
+
+  /* Check the arguments */
+  if (argc < 3) {
+    printf("Usage: %s platform_file deployment_file \n", argv[0]);
+    return -1;
+  }
+
+  const char *platform_file = argv[1];
+  const char *deployment_file = argv[2];
+
+  MSG_create_environment(platform_file);
+
+  MSG_function_register("client", client);
+  MSG_function_register("server", server);
+  MSG_launch_application(deployment_file);
+
+  msg_error_t res = MSG_main();
+  XBT_INFO("Simulated time: %g", MSG_get_clock());
+
+  if (res == MSG_OK)
+    return 0;
+  else
+    return 1;
+}
diff --git a/teshsuite/msg/storage/storage.tesh b/teshsuite/msg/storage/storage.tesh
new file mode 100644 (file)
index 0000000..11c12a9
--- /dev/null
@@ -0,0 +1,45 @@
+$ msg/storage/storage --cfg=path:${srcdir:=.} ${srcdir:=.}/msg/storage/platform.xml ${srcdir:=.}/msg/storage/deployment.xml 0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:server@server) *** Storage info of: server ***
+> [  0.000000] (1:server@server) *** Dump a storage element ***
+> [  0.000000] (1:server@server) Print the content of the storage element: sdisk1
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml size: 21339320000 bytes
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx size: 113700000 bytes
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/Master.cxx size: 18910000 bytes
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/basic/FinalizeTask.cxx size: 710000000 bytes
+> [  0.000000] (1:server@server) *** Dump a storage element ***
+> [  0.000000] (1:server@server) Print the content of the storage element: sdisk2
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/basic/Slave.cxx size: 69300000 bytes
+> [  0.000000] (1:server@server) ./doc/simgrid/examples/cxx/basic/Main.cxx size: 14800000 bytes
+> [  0.000000] (1:server@server) Server waiting for transfers
+> [  0.000710] (2:client@client) client has read 71000 on ./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx
+> [  0.000710] (2:client@client) client sends 71000 to server
+> [  0.014595] (2:client@client) client has read 1262000 on ./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml
+> [  0.014595] (2:client@client) client sends 1262000 to server
+> [  0.896175] (2:client@client) client has read 87000000 on ./doc/simgrid/examples/cxx/autoDestination/Slave.cxx
+> [  0.896175] (2:client@client) client sends 87000000 to server
+> [  4.550878] (2:client@client) *** GET/SET DATA for storage element: cdisk ***
+> [  4.550878] (2:client@client) Get data: '(null)'
+> [  4.550878] (2:client@client) Set and get data: 'Some data'
+> [  4.550878] (2:client@client) *** Storage info of: client ***
+> [  4.550878] (1:server@server) *** Storage info of: server ***
+> [  4.550878] (2:client@client) *** Dump a storage element ***
+> [  4.550878] (2:client@client) Print the content of the storage element: cdisk
+> [  4.550878] (2:client@client) ./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx size: 71000 bytes
+> [  4.550878] (2:client@client) ./doc/simgrid/examples/cxx/autoDestination/BasicTask.cxx size: 6500000 bytes
+> [  4.550878] (2:client@client) ./doc/simgrid/examples/cxx/autoDestination/Main.cxx size: 1480000 bytes
+> [  4.550878] (2:client@client) ./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml size: 1262000 bytes
+> [  4.550878] (2:client@client) ./doc/simgrid/examples/cxx/autoDestination/Slave.cxx size: 87000000 bytes
+> [  4.550878] (1:server@server) *** Dump a storage element ***
+> [  4.550878] (1:server@server) Print the content of the storage element: sdisk1
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml size: 21339320000 bytes
+> [  4.550878] (1:server@server) ./scratch/toto.xml size: 71000 bytes
+> [  4.550878] (1:server@server) ./scratch/tata.cxx size: 87000000 bytes
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx size: 113700000 bytes
+> [  4.550878] (1:server@server) ./scratch/titi.cxx size: 1262000 bytes
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/autoDestination/Master.cxx size: 18910000 bytes
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/basic/FinalizeTask.cxx size: 710000000 bytes
+> [  4.550878] (1:server@server) *** Dump a storage element ***
+> [  4.550878] (1:server@server) Print the content of the storage element: sdisk2
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/basic/Slave.cxx size: 69300000 bytes
+> [  4.550878] (1:server@server) ./doc/simgrid/examples/cxx/basic/Main.cxx size: 14800000 bytes
+> [  4.550878] (0:@) Simulated time: 4.55088
diff --git a/teshsuite/msg/storage/storage_content_c.txt b/teshsuite/msg/storage/storage_content_c.txt
new file mode 100644 (file)
index 0000000..fef7c55
--- /dev/null
@@ -0,0 +1,5 @@
+./doc/simgrid/examples/cxx/autoDestination/FinalizeTask.cxx 71000         
+./doc/simgrid/examples/cxx/autoDestination/autoDestination_deployment.xml 1262000         
+./doc/simgrid/examples/cxx/autoDestination/Main.cxx 1480000       
+./doc/simgrid/examples/cxx/autoDestination/Slave.cxx 87000000     
+./doc/simgrid/examples/cxx/autoDestination/BasicTask.cxx 6500000        
diff --git a/teshsuite/msg/storage/storage_content_s1.txt b/teshsuite/msg/storage/storage_content_s1.txt
new file mode 100644 (file)
index 0000000..55968d0
--- /dev/null
@@ -0,0 +1,4 @@
+./doc/simgrid/examples/cxx/autoDestination/Master.cxx 18910000            
+./doc/simgrid/examples/cxx/autoDestination/autoDestination_platform.xml 21339320000   
+./doc/simgrid/examples/cxx/autoDestination/Forwarder.cxx 113700000        
+./doc/simgrid/examples/cxx/basic/FinalizeTask.cxx 710000000          
diff --git a/teshsuite/msg/storage/storage_content_s2.txt b/teshsuite/msg/storage/storage_content_s2.txt
new file mode 100644 (file)
index 0000000..0721dbf
--- /dev/null
@@ -0,0 +1,2 @@
+./doc/simgrid/examples/cxx/basic/Main.cxx 14800000
+./doc/simgrid/examples/cxx/basic/Slave.cxx 69300000   
\ No newline at end of file
index 49ed7a0..d09b5c5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,8 +32,8 @@ int test_trace(int argc, char *argv[])
   task_prio = atof(argv[2]);
 
   XBT_INFO("Testing the trace integration cpu model: CpuTI");
-  XBT_INFO("Task size: %lf", task_comp_size);
-  XBT_INFO("Task prio: %lf", task_prio);
+  XBT_INFO("Task size: %f", task_comp_size);
+  XBT_INFO("Task prio: %f", task_prio);
 
   /* Create and execute a single task. */
   task = MSG_task_create("proc 0", task_comp_size, 0, NULL);
index 160c156..14d1b9f 100644 (file)
@@ -1,3 +1,5 @@
+! output sort
+
 $ simdag/availability/availability_test ${srcdir:=.}/simdag/availability/simulacrum_7_hosts.xml --cfg=path:${srcdir:=.}/simdag/availability/ ${srcdir:=.}/../examples/simdag/scheduling/Montage_25.xml --cfg=network/TCP_gamma:4194304 --log=sd_daxparse.thresh:critical
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
index 6bbce82..5c74d67 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 79003d9..c76dc6f 100644 (file)
@@ -1,5 +1,6 @@
 
 p all 2 all test, only fat pipe switch is used concurrently
+! output sort
 
 $ simdag/network/mxn/test_intra_all2all ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --cfg=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
index fc23249..adc6b77 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 7063943..581123e 100644 (file)
@@ -1,5 +1,6 @@
 
 p sending on different paths test
+! output sort
 
 $ simdag/network/mxn/test_intra_independent_comm ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --cfg=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
index d944745..f32dea6 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index fe13de3..c03d955 100644 (file)
@@ -1,5 +1,6 @@
 
 p scatter test
+! output sort
 
 $ simdag/network/mxn/test_intra_scatter ${srcdir:=.}/simdag/network/mxn/platform_4p_1switch.xml --cfg=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
index 8005d04..1b52f07 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 27b8b2c..56a8f75 100644 (file)
@@ -1,17 +1,20 @@
 
 p latency check, 1 byte, shared link
+! output sort
 
 $ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency1 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --cfg=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
index d78935d..19024ce 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 07787cc..5f9718b 100644 (file)
@@ -1,17 +1,20 @@
 
 p latency check, 2 x 1 byte, same direction, shared link
+! output sort
 
 $ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency2 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --cfg=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
index bf69383..277ac2c 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index f083ac2..a601017 100644 (file)
@@ -1,17 +1,20 @@
 
 p latency check, 2 x 1 byte, opposite direction, shared link
+! output sort
 
 $ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1sl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1fl.xml --cfg=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
+! output sort
 
 $ simdag/network/p2p/test_latency3 ${srcdir:=.}/simdag/network/p2p/platform_2p_1switch.xml --cfg=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
index 8f947bc..63c1a67 100644 (file)
@@ -1,6 +1,6 @@
 /* Latency tests                                                            */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index bcce3ba..97b6970 100644 (file)
@@ -1,5 +1,6 @@
 
 p latency bounded by large latency link
+! output sort
 
 $ simdag/network/p2p/test_latency_bound ${srcdir:=.}/simdag/network/p2p/platform_2p_1bb.xml --cfg=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
index 58b54de..a85311b 100644 (file)
@@ -1,6 +1,6 @@
 /* Computation tests                                                        */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 305e4b9..a074913 100644 (file)
@@ -1,5 +1,6 @@
 
 p Reinitialization test
+! output sort
 
 $ simdag/network/test_reinit_costs ${srcdir:=.}/simdag/network/platform_2p_1sl.xml --cfg=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
index 073f791..665f6d1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 3467eb8..6dfdff3 100644 (file)
@@ -1,12 +1,12 @@
 
 p par task comp only, no comm, homogeneous
-
+! output sort
 $ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --cfg=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
-
+! output sort
 $ simdag/partask/test_comp_only_par ${srcdir:=.}/simdag/partask/platform_2p_1sl_hetero.xml --cfg=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 fd67aa1..1ad0f28 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007, 2009-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 85c429e..7c40625 100644 (file)
@@ -1,6 +1,7 @@
 
 p seq task comp only, no comm
 
+! output sort
 $ simdag/partask/test_comp_only_seq ${srcdir:=.}/simdag/partask/platform_2p_1sl.xml --cfg=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 db7782c..14905f2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
   SD_route_get_list(w1, w2);
   xbt_os_cputimer_stop(timer);
 
-  printf("%lf\n", xbt_os_timer_elapsed(timer) );
+  printf("%f\n", xbt_os_timer_elapsed(timer) );
 
   SD_exit();
 
index 09726fb..e93d972 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
   xbt_os_cputimer_stop(timer);
 
   /* Display the result and exit after cleanup */
-  printf( "%lf\n", xbt_os_timer_elapsed(timer) );
+  printf( "%f\n", xbt_os_timer_elapsed(timer) );
     printf("Workstation number: %d, link number: %d\n",
            SD_workstation_get_number(), SD_link_get_number());
   if(argv[2]){
index 2fb8c6f..5b0cfc6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c01e31e..aaffd2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -23,7 +23,12 @@ int main(int argc, char **argv)
   int route_size, i, j, k;
   int list_size;
 
+#ifdef _XBT_WIN32
+  setbuf(stderr, NULL);
+  setbuf(stdout, NULL);
+#else
   setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
 
   SD_init(&argc, argv);
 
index 2d7dbcf..2445d02 100644 (file)
@@ -1,3 +1,5 @@
+! output sort
+
 $ ${bindir:=.}/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: 12
index 8c8eb2e..b7436ea 100644 (file)
@@ -1,7 +1,7 @@
 #! ./tesh
 
 p Testing a bypass ASroute
-
+! output sort
 $ ${bindir:=.}/basic_parsing_test ${srcdir:=.}/examples/platforms/bypassASroute.xml FULL_LINK
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
 > Workstation number: 3, link number: 11
index d9a3e38..d1b8aa5 100644 (file)
@@ -1,4 +1,6 @@
 #! ./tesh
+! output sort
+
 $ ${bindir:=.}/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: 12
index 73153ef..5220a03 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e2bd77c..0b735e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -104,7 +104,12 @@ int main(int argc, char **argv)
   const SD_link_t *links;
   xbt_os_timer_t parse_time = xbt_os_timer_new();
 
+#ifdef _XBT_WIN32
+  setbuf(stderr, NULL);
+  setbuf(stdout, NULL);
+#else
   setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
 
   SD_init(&argc, argv);
 
index 7695da7..4ffe91a 100644 (file)
@@ -1,5 +1,7 @@
 #! ./tesh
 
+! output sort
+
 $ ${bindir:=.}/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'?>
index a8456f1..f7dfaa5 100644 (file)
@@ -1,4 +1,5 @@
 #! ./tesh
+! output sort
 
 $ ${bindir:=.}/basic_parsing_test ./four_hosts_floyd.xml FULL_LINK
 > [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07
index d6bf9b1..10bf464 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,10 +15,16 @@ int main(int argc, char **argv)
 {
   /* initialisation of SD */
   int size;
-  SD_init(&argc, argv);
   xbt_lib_cursor_t cursor = NULL;
   char *key, *data;
 
+#ifdef _XBT_WIN32
+  setbuf(stderr, NULL);
+  setbuf(stdout, NULL);
+#endif
+
+  SD_init(&argc, argv);
+
   /* creation of the environment */
   SD_create_environment(argv[1]);
 
diff --git a/teshsuite/simix/CMakeLists.txt b/teshsuite/simix/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4c78962
--- /dev/null
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(check_defaults check_defaults.c)
+target_link_libraries(check_defaults simgrid)
+
+set(tesh_files
+  ${tesh_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/factory_raw.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/factory_thread.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/factory_ucontext.tesh
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(teshsuite_src
+  ${teshsuite_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/check_defaults.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/simix/check_defaults.c b/teshsuite/simix/check_defaults.c
new file mode 100644 (file)
index 0000000..f1af007
--- /dev/null
@@ -0,0 +1,18 @@
+/* check_defaults -- simple program displaying its context factory          */
+
+/* Copyright (c) 2013. 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 "simgrid/simix.h"
+#include "xbt/log.h"
+
+int main(int argc, char *argv[])
+{
+  xbt_log_control_set("root.fmt:[%c/%p]%e%m%n");
+  xbt_log_control_set("simix_context.threshold:verbose");
+  SIMIX_global_init(&argc, argv);
+  return 0;
+}
diff --git a/teshsuite/simix/factory_raw.tesh b/teshsuite/simix/factory_raw.tesh
new file mode 100644 (file)
index 0000000..7fc2525
--- /dev/null
@@ -0,0 +1,2 @@
+$ ./simix/check_defaults
+> [simix_context/VERBOSE] Using raw contexts. Because the glibc is just not good enough for us.
diff --git a/teshsuite/simix/factory_thread.tesh b/teshsuite/simix/factory_thread.tesh
new file mode 100644 (file)
index 0000000..fdb9520
--- /dev/null
@@ -0,0 +1,2 @@
+$ ./simix/check_defaults
+> [simix_context/VERBOSE] Activating thread context factory
diff --git a/teshsuite/simix/factory_ucontext.tesh b/teshsuite/simix/factory_ucontext.tesh
new file mode 100644 (file)
index 0000000..bf4130a
--- /dev/null
@@ -0,0 +1,2 @@
+$ ./simix/check_defaults
+> [simix_context/VERBOSE] Activating SYSV context factory
index 34f483c..a43a67d 100644 (file)
@@ -6,9 +6,9 @@ if(enable_smpi)
   else()
     set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
   endif()
-  
+
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  
+
   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
   add_executable(gather_coll gather_coll.c)
   add_executable(allgather_coll allgather_coll.c)
@@ -18,9 +18,9 @@ if(enable_smpi)
   add_executable(alltoall_coll alltoall_coll.c)
   add_executable(alltoallv_coll alltoallv_coll.c)
   add_executable(allreduce allreduce.c)
-  add_executable(allreduce_coll allreduce_coll.c)  
+  add_executable(allreduce_coll allreduce_coll.c)
   add_executable(bcast bcast.c)
-  add_executable(bcast_coll bcast_coll.c) 
+  add_executable(bcast_coll bcast_coll.c)
   add_executable(barrier_coll barrier.c )
   add_executable(compute compute.c)
   add_executable(compute2 compute2.c)
@@ -37,6 +37,7 @@ if(enable_smpi)
   add_executable(hvector_test hvector_test.c)
   add_executable(indexed_test indexed_test.c)
   add_executable(struct_test struct_test.c)
+  add_executable(dsend dsend.c)
 
   target_link_libraries(gather_coll simgrid)
   target_link_libraries(allgather_coll simgrid)
@@ -46,9 +47,9 @@ if(enable_smpi)
   target_link_libraries(alltoall_coll simgrid)
   target_link_libraries(alltoallv_coll simgrid)
   target_link_libraries(allreduce simgrid)
-  target_link_libraries(allreduce_coll simgrid)      
+  target_link_libraries(allreduce_coll simgrid)
   target_link_libraries(bcast simgrid)
-  target_link_libraries(bcast_coll simgrid)      
+  target_link_libraries(bcast_coll simgrid)
   target_link_libraries(barrier_coll simgrid)
   target_link_libraries(compute simgrid)
   target_link_libraries(compute2 simgrid)
@@ -56,8 +57,8 @@ if(enable_smpi)
   target_link_libraries(pingpong simgrid)
   target_link_libraries(scatter simgrid)
   target_link_libraries(reduce simgrid)
-  target_link_libraries(reduce_coll simgrid)      
-  target_link_libraries(reduce_scatter_coll simgrid)      
+  target_link_libraries(reduce_coll simgrid)
+  target_link_libraries(reduce_scatter_coll simgrid)
   target_link_libraries(split simgrid)
   target_link_libraries(smpi_sendrecv simgrid)
   target_link_libraries(ttest01 simgrid)
@@ -65,12 +66,13 @@ if(enable_smpi)
   target_link_libraries(hvector_test simgrid)
   target_link_libraries(indexed_test simgrid)
   target_link_libraries(struct_test simgrid)
+  target_link_libraries(dsend simgrid)
 
   set_target_properties(smpi_sendrecv PROPERTIES RENAME sendrecv)
 
   if(NOT WIN32)
-    add_executable(dsend dsend.c)
-    target_link_libraries(dsend m simgrid)
+    add_executable(shared shared.c)
+    target_link_libraries(shared simgrid)
   endif()
 
 endif()
@@ -80,23 +82,25 @@ set(tesh_files
   ${tesh_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.tesh  
+  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll_large.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/scatter_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/barrier_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/bcast.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.tesh  
+  ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/compute.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/shared.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/hvector.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/indexed.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/reduce.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.tesh  
-  ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.tesh  
+  ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.tesh
+  ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.tesh
   ${CMAKE_CURRENT_SOURCE_DIR}/struct.tesh
-  ${CMAKE_CURRENT_SOURCE_DIR}/vector.tesh  
+  ${CMAKE_CURRENT_SOURCE_DIR}/vector.tesh
   PARENT_SCOPE
   )
 set(xml_files
@@ -107,10 +111,10 @@ set(examples_src
   ${examples_src}
   ${CMAKE_CURRENT_SOURCE_DIR}/gather_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/allgather_coll.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.c  
+  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/allreduce_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/alltoall_coll.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c  
+  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/bcast_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/reduce_coll.c
   ${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter_coll.c
@@ -123,6 +127,7 @@ set(examples_src
   ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv.c
   ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c
   ${CMAKE_CURRENT_SOURCE_DIR}/compute2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/shared.c
   ${CMAKE_CURRENT_SOURCE_DIR}/split.c
   ${CMAKE_CURRENT_SOURCE_DIR}/dsend.c
   ${CMAKE_CURRENT_SOURCE_DIR}/ttest01.c
@@ -145,6 +150,6 @@ set(bin_files
   )
 set(txt_files
   ${txt_files}
-  
+
   PARENT_SCOPE
   )
index dfc7769..e0132ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2ff7d58..fd076cb 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgather_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgather_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index 2d8c87f..f55f311 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -69,6 +69,8 @@ int main(int argc, char *argv[])
   }
   free(sb);
   free(rb);
+  free(recv_counts);
+  free(recv_disps);
   MPI_Finalize();
   return (EXIT_SUCCESS);
 }
index 520004a..8497a1f 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test allgatherv
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgatherv_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allgatherv_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index a2c9921..00024b7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,8 @@
 #define EXIT_FAILURE 1
 #endif
 
+//define MAXLEN  300000
+
 int main(int argc, char *argv[])
 {
   int rank, size;
@@ -22,28 +24,31 @@ int main(int argc, char *argv[])
   int *sb;
   int *rb;
   int status;
+  int mult=1;
 
   MPI_Init(&argc, &argv);
+  int maxlen = argc >= 2 ? atoi(argv[1]) : 1;
+
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-  sb = (int *) xbt_malloc(size * sizeof(int));
-  rb = (int *) xbt_malloc(size * sizeof(int));
+  if (maxlen>1)mult=size;
+  sb = (int *) xbt_malloc(size *maxlen * sizeof(int));
+  rb = (int *) xbt_malloc(size *maxlen * sizeof(int));
   
-  for (i = 0; i < size; ++i) {
+  for (i = 0; i < size *maxlen; ++i) {
     sb[i] = rank*size + i;
     rb[i] = 0;
   }
 
   printf("[%d] sndbuf=[", rank);
-  for (i = 0; i < size; i++)
+  for (i = 0; i < size *mult; i++)
     printf("%d ", sb[i]);
   printf("]\n");
 
-  status = MPI_Allreduce(sb, rb, size, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+  status = MPI_Allreduce(sb, rb, size *maxlen, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
 
   printf("[%d] rcvbuf=[", rank);
-  for (i = 0; i < size; i++)
+  for (i =  0; i < size *mult; i++)//do not print everything
     printf("%d ", rb[i]);
   printf("]\n");
 
index 8cde55d..a1ba6ea 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test allreduce
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allreduce_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allreduce_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
diff --git a/teshsuite/smpi/allreduce_coll_large.tesh b/teshsuite/smpi/allreduce_coll_large.tesh
new file mode 100644 (file)
index 0000000..663e552
--- /dev/null
@@ -0,0 +1,58 @@
+# Smpi Allreduce collectives tests
+! setenv LD_LIBRARY_PATH=../../lib
+! output sort
+
+! timeout 20
+p Test allreduce
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./allreduce_coll 300000
+> You requested to use 16 processes, but there is only 5 processes in your hostfile...
+> [rank 0] -> Tremblay
+> [rank 1] -> Jupiter
+> [rank 2] -> Fafard
+> [rank 3] -> Ginette
+> [rank 4] -> Bourassa
+> [rank 5] -> Tremblay
+> [rank 6] -> Jupiter
+> [rank 7] -> Fafard
+> [rank 8] -> Ginette
+> [rank 9] -> Bourassa
+> [rank 10] -> Tremblay
+> [rank 11] -> Jupiter
+> [rank 12] -> Fafard
+> [rank 13] -> Ginette
+> [rank 14] -> Bourassa
+> [rank 15] -> Tremblay
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ]
+> [10] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 ]
+> [11] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 ]
+> [12] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 ]
+> [13] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 ]
+> [14] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 ]
+> [15] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 ]
+> [1] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [1] sndbuf=[16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 ]
+> [2] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [2] sndbuf=[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 ]
+> [3] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [3] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 ]
+> [4] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [4] sndbuf=[64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 ]
+> [5] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [5] sndbuf=[80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 ]
+> [6] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [6] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 ]
+> [7] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [7] sndbuf=[112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 ]
+> [8] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [8] sndbuf=[128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 ]
+> [9] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 2176 2192 2208 2224 2240 2256 2272 2288 2304 2320 2336 2352 2368 2384 2400 2416 2432 2448 2464 2480 2496 2512 2528 2544 2560 2576 2592 2608 2624 2640 2656 2672 2688 2704 2720 2736 2752 2768 2784 2800 2816 2832 2848 2864 2880 2896 2912 2928 2944 2960 2976 2992 3008 3024 3040 3056 3072 3088 3104 3120 3136 3152 3168 3184 3200 3216 3232 3248 3264 3280 3296 3312 3328 3344 3360 3376 3392 3408 3424 3440 3456 3472 3488 3504 3520 3536 3552 3568 3584 3600 3616 3632 3648 3664 3680 3696 3712 3728 3744 3760 3776 3792 3808 3824 3840 3856 3872 3888 3904 3920 3936 3952 3968 3984 4000 4016 4032 4048 4064 4080 4096 4112 4128 4144 4160 4176 4192 4208 4224 4240 4256 4272 4288 4304 4320 4336 4352 4368 4384 4400 4416 4432 4448 4464 4480 4496 4512 4528 4544 4560 4576 4592 4608 4624 4640 4656 4672 4688 4704 4720 4736 4752 4768 4784 4800 4816 4832 4848 4864 4880 4896 4912 4928 4944 4960 4976 4992 5008 5024 5040 5056 5072 5088 5104 5120 5136 5152 5168 5184 5200 5216 5232 5248 5264 5280 5296 5312 5328 5344 5360 5376 5392 5408 5424 5440 5456 5472 5488 5504 5520 5536 5552 5568 5584 5600 5616 5632 5648 5664 5680 5696 5712 5728 5744 5760 5776 5792 5808 5824 5840 5856 5872 5888 5904 5920 5936 5952 5968 5984 6000 ]
+> [9] sndbuf=[144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 ]
+
index 869dd7c..90cc4aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 4c95ba3..a8cb7ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0cab7ea..5a4f095 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoall_coll -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoall_coll -q
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index 9b432f1..5a56594 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test all to all
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoallv_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./alltoallv_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index 7fb9a0c..1a680de 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009. The SimGrid Team.
+/* Copyright (c) 2009, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
   MPI_Barrier(MPI_COMM_WORLD);
   if (0 == rank) {
     printf("... Barrier ....\n");
-    //printf("Elapsed=%lf s\n", MPI_Wtime() - start_timer);
+    //printf("Elapsed=%f s\n", MPI_Wtime() - start_timer);
   }
 
   MPI_Finalize();
index f5d2c79..6e5a74a 100644 (file)
@@ -2,42 +2,9 @@
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
-p Test scatter
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./scatter 
->      [0] ok.
->      [0] ok.
->      [10] ok.
->      [10] ok.
->      [11] ok.
->      [11] ok.
->      [12] ok.
->      [12] ok.
->      [13] ok.
->      [13] ok.
->      [14] ok.
->      [14] ok.
->      [15] ok.
->      [15] ok.
->      [1] ok.
->      [1] ok.
->      [2] ok.
->      [2] ok.
->      [3] ok.
->      [3] ok.
->      [4] ok.
->      [4] ok.
->      [5] ok.
->      [5] ok.
->      [6] ok.
->      [6] ok.
->      [7] ok.
->      [7] ok.
->      [8] ok.
->      [8] ok.
->      [9] ok.
->      [9] ok.
-> ** IBM Test Result: ... 
-> ** Small Test Result: ... 
+p Test barrier
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./barrier_coll
+> ... Barrier ....
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [rank 0] -> Tremblay
index 72ad419..0743d23 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009. The SimGrid Team.
+/* Copyright (c) 2009, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
 
   MPI_Barrier(MPI_COMM_WORLD);
   if (0 == rank && !quiet)
-    printf("Elapsed time on rank %d: %lf s\n", rank,
+    printf("Elapsed time on rank %d: %f s\n", rank,
            MPI_Wtime() - start_timer);
   MPI_Finalize();
   return 0;
index dc7a796..9fb3059 100644 (file)
@@ -2,7 +2,7 @@
 # (since we want to pass it to the child, it has to be redefined before each command)
 # Go for the first test
 p Test Broadcast with less processes than hosts
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./bcast -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./bcast -q
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
@@ -14,7 +14,7 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 # second test
 p Test Broadcast with as much processes than hosts
 ! setenv LD_LIBRARY_PATH=../../lib
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./bcast -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./bcast -q
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
@@ -28,7 +28,7 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 # Another test
 p Test Broadcast with more processes than hosts
 ! setenv LD_LIBRARY_PATH=../../lib
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./bcast -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./bcast -q
 > You requested to use 12 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index 9bb6a04..a78bd5d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009. The SimGrid Team.
+/* Copyright (c) 2009, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -31,14 +31,31 @@ int main(int argc, char **argv)
   printf("[%d] number of values equals to 17: %d\n", rank, good);
 
   MPI_Barrier(MPI_COMM_WORLD);
+  xbt_free(values);
 
+  count = 4096;
+  values = (int *) xbt_malloc(count * sizeof(int));  
+
+  for (i = 0; i < count; i++)
+    values[i] = (size -1 == rank) ? 17 : 3;
+
+  status = MPI_Bcast(values, count, MPI_INT, size-1, MPI_COMM_WORLD);
+
+  good = 0;
+  for (i = 0; i < count; i++)
+    if (values[i]==17) good++;
+  printf("[%d] number of values equals to 17: %d\n", rank, good);
+
+
+  
+  
   if (rank == 0) {
     if (status != MPI_SUCCESS) {
       printf("bcast returned %d\n", status);
       fflush(stdout);
     }
   }
-
+  xbt_free(values);
   MPI_Finalize();
   return 0;
 }
index 7dc08a5..dc5c70a 100644 (file)
@@ -2,7 +2,7 @@ p Test Broadcast with more processes than hosts
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./bcast_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./bcast_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
@@ -22,18 +22,35 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 > [rank 15] -> Tremblay
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0] number of values equals to 17: 2048
+> [0] number of values equals to 17: 4096
+> [10] number of values equals to 17: 2048
+> [10] number of values equals to 17: 4096
+> [11] number of values equals to 17: 2048
+> [11] number of values equals to 17: 4096
+> [12] number of values equals to 17: 2048
+> [12] number of values equals to 17: 4096
+> [13] number of values equals to 17: 2048
+> [13] number of values equals to 17: 4096
+> [14] number of values equals to 17: 2048
+> [14] number of values equals to 17: 4096
+> [15] number of values equals to 17: 2048
+> [15] number of values equals to 17: 4096
 > [1] number of values equals to 17: 2048
+> [1] number of values equals to 17: 4096
 > [2] number of values equals to 17: 2048
+> [2] number of values equals to 17: 4096
 > [3] number of values equals to 17: 2048
+> [3] number of values equals to 17: 4096
 > [4] number of values equals to 17: 2048
+> [4] number of values equals to 17: 4096
 > [5] number of values equals to 17: 2048
+> [5] number of values equals to 17: 4096
 > [6] number of values equals to 17: 2048
+> [6] number of values equals to 17: 4096
 > [7] number of values equals to 17: 2048
+> [7] number of values equals to 17: 4096
 > [8] number of values equals to 17: 2048
+> [8] number of values equals to 17: 4096
 > [9] number of values equals to 17: 2048
-> [10] number of values equals to 17: 2048
-> [11] number of values equals to 17: 2048
-> [12] number of values equals to 17: 2048
-> [13] number of values equals to 17: 2048
-> [14] number of values equals to 17: 2048
-> [15] number of values equals to 17: 2048
+> [9] number of values equals to 17: 4096
+
index 24607cb..e67315e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 37439ba..aec5db3 100644 (file)
@@ -2,7 +2,7 @@ p Test compute
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 5
-$ ../../bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute 0
+$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute 0
 > 0 2.000000
 > 0 2.000000
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
@@ -14,7 +14,7 @@ p Test compute and bench
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
 ! timeout 45
-$ ../../bin/smpirun  -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute3
+$ ../../smpi_script/bin/smpirun  -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 2 ./compute3
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
index 8f82144..1720d84 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 23452c4..f0445ba 100644 (file)
@@ -1,11 +1,12 @@
-/* Copyright (c) 2009-2012. The SimGrid Team. All rights reserved.          */
-
-/* This example should be instructive to learn about SMPI_SAMPLE_LOCAL and 
-   SMPI_SAMPLE_GLOBAL macros for execution sampling */
+/* Copyright (c) 2009-2012. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+/* This example should be instructive to learn about SMPI_SAMPLE_LOCAL and 
+   SMPI_SAMPLE_GLOBAL macros for execution sampling */
+
 #include <stdio.h>
 #include <mpi.h>
 
index 1853fa0..8043e5b 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 2011. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2011-2013. 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. */
index a6111b4..d3944e7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index c4b40fe..2faa727 100644 (file)
@@ -1,9 +1,10 @@
 # Smpi Alltoall collectives tests
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
+! timeout 30
 
 p Test all to all
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./gather_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./gather_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index 05a2616..5601e71 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010. The SimGrid Team.
+/* Copyright (c) 2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index a4ea550..c0a66fe 100644 (file)
@@ -1,7 +1,7 @@
 p Test hvector
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./hvector_test -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./hvector_test -q
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
index 2fffcea..6e1d458 100644 (file)
@@ -1,7 +1,7 @@
 p Test indexed
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./indexed_test -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./indexed_test -q
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
diff --git a/teshsuite/smpi/mpich-test/README b/teshsuite/smpi/mpich-test/README
deleted file mode 100644 (file)
index dcb011a..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-This directory contains a variety of different test codes 
-of different types. This directory and many of the files in
-it are still undergoing active development and change. Please
-forgive (and report) any problems you have with these programs.
-
-These tests may be used with any MPI implementation.  In a few cases, 
-differences in error messages may be reported; these are not errors, of
-course.  However, the accuracy and detail of the messages should be evaluated.
-
-To build and run the tests, execute configure followed by make testing.  
-The options to configure for some MPI implementations follow:
-
-SGI:
-      ./configure -cc=cc -fc=f77
-IBM:
-      ./configure -cc=mpcc -fc=mpxlf 
-      (You also need a script called "mpirun" that takes a -np number-of-procs
-      argument, since there are so many different ways to run parallel 
-      programs on IBM systems)
-MPICH:
-      ./configure -mpichpath=<path to MPICH build bin directory>
-
-The directories are as follows:
-
-pt2pt  -       Test cases that generally cover various point to point
-               routines, such as send, isend, probe, etc... The
-               README in this directory contains some additional 
-               useful information about running the tests. The tests
-               in this directory are most complete.
-
-
-coll   -       Test programs for various collective operations
-
-context -       Test programs for context operations
-
-env     -       Test programs for the environment routines
-
-profile -       Test program(s) for MPI_Pcontrol
-
-topol   -       Test programs for the topology routines
-
-lederman-      A series of tests of various types written by Steve
-               Lederman
-
-
-Other directories and additional tests will be added in the future.
-
-To run the test, but not leave the executables around, do (in this directory)
-
-  make TESTARGS=-small testing >& testing.out
-
-If your MPI requires a boot step before running programs, use the target
-testing-boot instead of testint:
-
-  make TESTARGS=-small testing-boot >& testing.out
-
-This will boot any MPI startup demons, and it will stop them at the end of the 
-test.
-
-If you are NOT using the MPICH implementation, then you can run the configure
-script in this directory.  If you need to view the configure options, then type
-       configure -help
-and a list of configure options will be provided.
-
-You will probably also have to provide an "mpirun" program or script.
-This has roughly the form
-
-     mpirun -mvhome -np n -mvback "string" programname programargs
-
-The options -mvhome and -mvback "string" can be ignored; they are needed only
-on systems that do not share file systems with the system running the runtests
-script (yes, there is one such system).  The option "-np n" specifies that
-"n" processes are needed.  Note that this is not always a power of 2; systems
-must be prepared to accept any (small) value of n.
-
diff --git a/teshsuite/smpi/mpich-test/coll/CMakeLists.txt b/teshsuite/smpi/mpich-test/coll/CMakeLists.txt
deleted file mode 100644 (file)
index 3fa64ff..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-
-  if(WIN32)
-    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
-  endif()
-
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  
-  add_executable(coll1 coll1.c test.c)
-  add_executable(coll2 coll2.c test.c)
-  add_executable(coll3 coll3.c test.c)
-  add_executable(coll4 coll4.c test.c)
-  add_executable(coll5 coll5.c test.c)
-  add_executable(coll6 coll6.c test.c)
-  add_executable(coll7 coll7.c test.c)
-  add_executable(coll8 coll8.c test.c)
-  add_executable(coll9 coll9.c test.c)
-  add_executable(coll10 coll10.c test.c)
-  add_executable(coll11 coll11.c test.c)
-  add_executable(coll12 coll12.c test.c)
-  add_executable(coll13 coll13.c)
-  add_executable(allredmany allredmany.c)
-  add_executable(bcastbug2 bcastbug2.c test.c) 
-  add_executable(bcastbug bcastbug.c test.c)
-  add_executable(bcastvec bcastvec.c test.c )
-  add_executable(grouptest grouptest.c test.c)
-  add_executable(redtst redtst.c test.c)
-  add_executable(barrier barrier.c test.c)
-  add_executable(bcast_mpich bcast.c test.c)
-  add_executable(allred allred.c ../pt2pt/gcomm.c)
-  add_executable(allred2 allred2.c ../pt2pt/gcomm.c)
-  add_executable(scatterv scatterv.c)
-  add_executable(scattern scattern.c)
-  add_executable(redscat redscat.c)
-  add_executable(alltoallv_mpich alltoallv.c)
-  add_executable(scantst scantst.c test.c)
-  add_executable(longuser longuser.c test.c)
-
-  if(SMPI_F2C)
-    add_executable(allredf allredf.f)
-    add_executable(assocf assocf.f)
-    add_executable(allgatherf allgatherf.f)
-    add_executable(bcastlog bcastlog.f)
-  endif()
-
-  target_link_libraries(coll1  simgrid)
-  target_link_libraries(coll2 simgrid)
-  target_link_libraries(coll3 simgrid)
-  target_link_libraries(coll4 simgrid)
-  target_link_libraries(coll5 simgrid)
-  target_link_libraries(coll6 simgrid)
-  target_link_libraries(coll7 simgrid)
-  target_link_libraries(coll8 simgrid)
-  target_link_libraries(coll9 simgrid)
-  target_link_libraries(coll10 simgrid)
-  target_link_libraries(coll11 simgrid)
-  target_link_libraries(coll12  simgrid)
-  target_link_libraries(coll13 simgrid)
-  target_link_libraries(allredmany simgrid)
-  target_link_libraries(bcastbug simgrid)
-  target_link_libraries(bcastbug2 simgrid)
-  target_link_libraries(bcastvec simgrid)
-  target_link_libraries(grouptest simgrid)
-  target_link_libraries(redtst simgrid)
-  target_link_libraries(barrier simgrid)
-  target_link_libraries(bcast_mpich simgrid)
-  target_link_libraries(allred simgrid)
-  target_link_libraries(allred2 simgrid)
-  target_link_libraries(scatterv simgrid)
-  target_link_libraries(scattern simgrid)
-  target_link_libraries(redscat simgrid)
-  target_link_libraries(longuser simgrid)
-  target_link_libraries(alltoallv_mpich simgrid)
-  target_link_libraries(scantst simgrid)
-  if(SMPI_F2C)
-    target_link_libraries(allredf simgrid)
-    target_link_libraries(assocf simgrid)
-    target_link_libraries(allgatherf simgrid)
-    target_link_libraries(bcastlog simgrid)
-  endif()
-
-  set_target_properties(coll1 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll4 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll5 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll6 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll7 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll8 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll9 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll10 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll11 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll12 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(coll13 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(allredmany PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(bcastbug PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(bcastbug2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(bcastvec PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(grouptest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(redtst PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(barrier PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(bcast_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(allred PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(allred2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(scatterv PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(scattern PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(redscat PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(longuser PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(alltoallv_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(scantst PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  if(SMPI_F2C)
-    set_target_properties(allredf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(assocf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(allgatherf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(bcastlog PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  endif()
-
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll4.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll5.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll6.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll7.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll8.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll9.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll10.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll11.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll12.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll13.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcastbug.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcastbug2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcastvec.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/grouptest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/redtst.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/barrier.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcast.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/allred.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/allred2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/scatterv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/scattern.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/redscat.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/longuser.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/scantst.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/allredf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/allredf.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/assocf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/bcastlog.f
-
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
-  ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/allred.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/allredf.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/coll13.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/scatterv.std
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/smpi/mpich-test/coll/allgatherf.f b/teshsuite/smpi/mpich-test/coll/allgatherf.f
deleted file mode 100644 (file)
index 462d3e0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-c
-c This test looks at sending some data with a count of zero.
-c
-      program testmpi
-      integer           mnprocs, lcwk1
-      parameter         ( mnprocs = 2, lcwk1 = 6 )
-      integer           comm, rc, myid, nprocs, ierr, i,
-     &                  recvts(0:mnprocs-1), displs(0:mnprocs-1)
-      double precision  wrkbuf(3), cwk1(lcwk1)
-      include           'mpif.h'
-c
-      call MPI_INIT( ierr )
-      comm = MPI_COMM_WORLD
-      call MPI_COMM_RANK( comm, myid, ierr )
-      call MPI_COMM_SIZE( comm, nprocs, ierr )
-c
-      do i = 1, lcwk1
-         cwk1(i) = -10
-      end do
-      do i=1,3
-         wrkbuf(i) = myid
-      end do
-      do i = 0, mnprocs-1
-         recvts(i) = 3
-         displs(i) = 3 * i
-      end do
-      recvts(mnprocs-1) = 0
-      displs(mnprocs-1) = 0
-c
-      call MPI_ALLGATHERV( wrkbuf, recvts(myid), 
-     &                     MPI_DOUBLE_PRECISION, cwk1, recvts, 
-     &                     displs, MPI_DOUBLE_PRECISION, comm, ierr )
-c 
-      do i = 1, lcwk1
-         print *, myid, i, cwk1(i)
-      end do
-c
-      call MPI_FINALIZE(rc)
-c
-      end
-c
diff --git a/teshsuite/smpi/mpich-test/coll/allred.c b/teshsuite/smpi/mpich-test/coll/allred.c
deleted file mode 100644 (file)
index 792565c..0000000
+++ /dev/null
@@ -1,2464 +0,0 @@
-
-#include <math.h>
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-#include "../pt2pt/gcomm.h"
-
-int verbose = 1;
-int main( int argc, char **argv )
-{
-int count, errcnt = 0, gerr = 0, toterr, size, rank;
-MPI_Comm comm;
-
-int       world_rank;
-
-MPI_Init( &argc, &argv );
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-
-/* First tests */
-//MakeComms( comms, 10, &ncomm, 0 );
-//for (ii=0; ii<ncomm; ii++) {
-comm = MPI_COMM_WORLD;
-
-
-MPI_Comm_size( comm, &size );
-MPI_Comm_rank( comm, &rank );
-count = 10;
-
-/* Test sum */
-if (world_rank == 0 && verbose) printf( "Testing MPI_SUM...\n" );
-
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-float *in, *out, *sol;
-int  i, fnderr=0;
-in = (float *)malloc( count * sizeof(float) );
-out = (float *)malloc( count * sizeof(float) );
-sol = (float *)malloc( count * sizeof(float) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_FLOAT, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-double *in, *out, *sol;
-int  i, fnderr=0;
-in = (double *)malloc( count * sizeof(double) );
-out = (double *)malloc( count * sizeof(double) );
-sol = (double *)malloc( count * sizeof(double) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = i*size; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE, MPI_SUM, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE and op MPI_SUM\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_SUM\n", errcnt, rank );
-errcnt = 0;
-
-/* Test product */
-if (world_rank == 0 && verbose) printf( "Testing MPI_PROD...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-float *in, *out, *sol;
-int  i, fnderr=0;
-in = (float *)malloc( count * sizeof(float) );
-out = (float *)malloc( count * sizeof(float) );
-sol = (float *)malloc( count * sizeof(float) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_FLOAT, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-double *in, *out, *sol;
-int  i, fnderr=0;
-in = (double *)malloc( count * sizeof(double) );
-out = (double *)malloc( count * sizeof(double) );
-sol = (double *)malloc( count * sizeof(double) );
-for (i=0; i<count; i++) { *(in + i) = i; *(sol + i) = (i > 0) ? (int)(pow((double)(i),(double)size)+0.1) : 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE, MPI_PROD, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE and op MPI_PROD\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_PROD\n", errcnt, rank );
-errcnt = 0;
-
-/* Test max */
-if (world_rank == 0 && verbose) printf( "Testing MPI_MAX...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-float *in, *out, *sol;
-int  i, fnderr=0;
-in = (float *)malloc( count * sizeof(float) );
-out = (float *)malloc( count * sizeof(float) );
-sol = (float *)malloc( count * sizeof(float) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_FLOAT, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-double *in, *out, *sol;
-int  i, fnderr=0;
-in = (double *)malloc( count * sizeof(double) );
-out = (double *)malloc( count * sizeof(double) );
-sol = (double *)malloc( count * sizeof(double) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = (size - 1 + i); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE, MPI_MAX, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE and op MPI_MAX\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_MAX\n", errcnt, rank );
-errcnt = 0;
-
-/* Test min */
-if (world_rank == 0 && verbose) printf( "Testing MPI_MIN...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-float *in, *out, *sol;
-int  i, fnderr=0;
-in = (float *)malloc( count * sizeof(float) );
-out = (float *)malloc( count * sizeof(float) );
-sol = (float *)malloc( count * sizeof(float) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_FLOAT, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-double *in, *out, *sol;
-int  i, fnderr=0;
-in = (double *)malloc( count * sizeof(double) );
-out = (double *)malloc( count * sizeof(double) );
-sol = (double *)malloc( count * sizeof(double) );
-for (i=0; i<count; i++) { *(in + i) = (rank + i); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE, MPI_MIN, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE and op MPI_MIN\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_MIN\n", errcnt, rank );
-errcnt = 0;
-
-/* Test LOR */
-if (world_rank == 0 && verbose) printf( "Testing MPI_LOR...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LOR(1)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LOR(0)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test LXOR */
-if (world_rank == 0 && verbose) printf( "Testing MPI_LXOR...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1); *(sol + i) = (size > 1); 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LXOR(1)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LXOR(0)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LXOR(1-0)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test LAND */
-if (world_rank == 0 && verbose) printf( "Testing MPI_LAND...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank & 0x1); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LAND(0)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = 1; *(sol + i) = 1; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_LAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_LAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_LAND(1)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test BOR */
-if (world_rank == 0 && verbose) printf( "Testing MPI_BOR...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned char *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned char *)malloc( count * sizeof(unsigned char) );
-out = (unsigned char *)malloc( count * sizeof(unsigned char) );
-sol = (unsigned char *)malloc( count * sizeof(unsigned char) );
-for (i=0; i<count; i++) { *(in + i) = rank & 0x3; *(sol + i) = (size < 3) ? size - 1 : 0x3; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_BYTE, MPI_BOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_BYTE and op MPI_BOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BOR(1)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test BAND */
-if (world_rank == 0 && verbose) printf( "Testing MPI_BAND...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned char *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned char *)malloc( count * sizeof(unsigned char) );
-out = (unsigned char *)malloc( count * sizeof(unsigned char) );
-sol = (unsigned char *)malloc( count * sizeof(unsigned char) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : ~0); *(sol + i) = i; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_BYTE, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_BYTE and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BAND(1)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == size-1 ? i : 0); *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BAND, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BAND\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BAND(0)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test BXOR */
-if (world_rank == 0 && verbose) printf( "Testing MPI_BXOR...\n" );
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = (rank == 1)*0xf0 ; *(sol + i) = (size > 1)*0xf0 ; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BXOR(1)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = 0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BXOR(0)\n", errcnt, rank );
-errcnt = 0;
-
-
-{
-int *in, *out, *sol;
-int  i, fnderr=0;
-in = (int *)malloc( count * sizeof(int) );
-out = (int *)malloc( count * sizeof(int) );
-sol = (int *)malloc( count * sizeof(int) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_INT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_INT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-long *in, *out, *sol;
-int  i, fnderr=0;
-in = (long *)malloc( count * sizeof(long) );
-out = (long *)malloc( count * sizeof(long) );
-sol = (long *)malloc( count * sizeof(long) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-short *in, *out, *sol;
-int  i, fnderr=0;
-in = (short *)malloc( count * sizeof(short) );
-out = (short *)malloc( count * sizeof(short) );
-sol = (short *)malloc( count * sizeof(short) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned short *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned short *)malloc( count * sizeof(unsigned short) );
-out = (unsigned short *)malloc( count * sizeof(unsigned short) );
-sol = (unsigned short *)malloc( count * sizeof(unsigned short) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_SHORT, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_SHORT and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned *)malloc( count * sizeof(unsigned) );
-out = (unsigned *)malloc( count * sizeof(unsigned) );
-sol = (unsigned *)malloc( count * sizeof(unsigned) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-unsigned long *in, *out, *sol;
-int  i, fnderr=0;
-in = (unsigned long *)malloc( count * sizeof(unsigned long) );
-out = (unsigned long *)malloc( count * sizeof(unsigned long) );
-sol = (unsigned long *)malloc( count * sizeof(unsigned long) );
-for (i=0; i<count; i++) { *(in + i) = ~0; *(sol + i) = 0; 
-       *(out + i) = 0; }
-MPI_Allreduce( in, out, count, MPI_UNSIGNED_LONG, MPI_BXOR, comm );
-for (i=0; i<count; i++) { if (*(out + i) != *(sol + i)) {errcnt++; fnderr++;}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_UNSIGNED_LONG and op MPI_BXOR\n", world_rank );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_BXOR(1-0)\n", errcnt, rank );
-errcnt = 0;
-
-/* Test Maxloc */
-if (world_rank == 0 && verbose) printf( "Testing MPI_MAXLOC...\n" );
-
-{
-struct int_test { int a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct int_test *)malloc( count * sizeof(struct int_test) );
-out = (struct int_test *)malloc( count * sizeof(struct int_test) );
-sol = (struct int_test *)malloc( count * sizeof(struct int_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = (size - 1 + i); (sol + i)->b = (size-1);
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_2INT, MPI_MAXLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_2INT and op MPI_MAXLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct long_test { long a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct long_test *)malloc( count * sizeof(struct long_test) );
-out = (struct long_test *)malloc( count * sizeof(struct long_test) );
-sol = (struct long_test *)malloc( count * sizeof(struct long_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = (size - 1 + i); (sol + i)->b = (size-1);
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_LONG_INT, MPI_MAXLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG_INT and op MPI_MAXLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct short_test { short a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct short_test *)malloc( count * sizeof(struct short_test) );
-out = (struct short_test *)malloc( count * sizeof(struct short_test) );
-sol = (struct short_test *)malloc( count * sizeof(struct short_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = (size - 1 + i); (sol + i)->b = (size-1);
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_SHORT_INT, MPI_MAXLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT_INT and op MPI_MAXLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct float_test { float a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct float_test *)malloc( count * sizeof(struct float_test) );
-out = (struct float_test *)malloc( count * sizeof(struct float_test) );
-sol = (struct float_test *)malloc( count * sizeof(struct float_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = (size - 1 + i); (sol + i)->b = (size-1);
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_FLOAT_INT, MPI_MAXLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT_INT and op MPI_MAXLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct double_test { double a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct double_test *)malloc( count * sizeof(struct double_test) );
-out = (struct double_test *)malloc( count * sizeof(struct double_test) );
-sol = (struct double_test *)malloc( count * sizeof(struct double_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = (size - 1 + i); (sol + i)->b = (size-1);
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE_INT, MPI_MAXLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE_INT and op MPI_MAXLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_MAXLOC\n", errcnt, rank );
-errcnt = 0;
-
-/* Test minloc */
-if (world_rank == 0 && verbose) printf( "Testing MPI_MINLOC...\n" );
-
-
-{
-struct int_test { int a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct int_test *)malloc( count * sizeof(struct int_test) );
-out = (struct int_test *)malloc( count * sizeof(struct int_test) );
-sol = (struct int_test *)malloc( count * sizeof(struct int_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = i; (sol + i)->b = 0;
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_2INT, MPI_MINLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_2INT and op MPI_MINLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct long_test { long a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct long_test *)malloc( count * sizeof(struct long_test) );
-out = (struct long_test *)malloc( count * sizeof(struct long_test) );
-sol = (struct long_test *)malloc( count * sizeof(struct long_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = i; (sol + i)->b = 0;
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_LONG_INT, MPI_MINLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_LONG_INT and op MPI_MINLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct short_test { short a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct short_test *)malloc( count * sizeof(struct short_test) );
-out = (struct short_test *)malloc( count * sizeof(struct short_test) );
-sol = (struct short_test *)malloc( count * sizeof(struct short_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = i; (sol + i)->b = 0;
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_SHORT_INT, MPI_MINLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_SHORT_INT and op MPI_MINLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct float_test { float a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct float_test *)malloc( count * sizeof(struct float_test) );
-out = (struct float_test *)malloc( count * sizeof(struct float_test) );
-sol = (struct float_test *)malloc( count * sizeof(struct float_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = i; (sol + i)->b = 0;
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_FLOAT_INT, MPI_MINLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_FLOAT_INT and op MPI_MINLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-}
-
-
-{
-struct double_test { double a; int b; } *in, *out, *sol;
-int  i,fnderr=0;
-in = (struct double_test *)malloc( count * sizeof(struct double_test) );
-out = (struct double_test *)malloc( count * sizeof(struct double_test) );
-sol = (struct double_test *)malloc( count * sizeof(struct double_test) );
-for (i=0; i<count; i++) { (in + i)->a = (rank + i); (in + i)->b = rank;
-        (sol + i)->a = i; (sol + i)->b = 0;
-       (out + i)->a = 0; (out + i)->b = -1; }
-MPI_Allreduce( in, out, count, MPI_DOUBLE_INT, MPI_MINLOC, comm );
-for (i=0; i<count; i++) { if ((out + i)->a != (sol + i)->a ||
-                             (out + i)->b != (sol + i)->b) {
-       errcnt++; fnderr++; 
-    fprintf( stderr, "(%d) Expected (%d,%d) got (%d,%d)\n", world_rank,
-       (int)((sol + i)->a),
-       (sol+i)->b, (int)((out+i)->a), (out+i)->b );
-}}
-if (fnderr) fprintf( stderr, 
-       "(%d) Error for type MPI_DOUBLE_INT and op MPI_MINLOC (%d of %d wrong)\n",
-                     world_rank, fnderr, count );
-free( in );
-free( out );
-free( sol );
-//}
-
-
-gerr += errcnt;
-if (errcnt > 0)
-       printf( "Found %d errors on %d for MPI_MINLOC\n", errcnt, rank );
-errcnt = 0;
-
-}
-if (gerr > 0) {
-       MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-       printf( "Found %d errors overall on %d\n", gerr, rank );
-       }
-MPI_Allreduce( &gerr, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-//FreeComms( comms, ncomm );
-MPI_Finalize( );
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/allred.std b/teshsuite/smpi/mpich-test/coll/allred.std
deleted file mode 100644 (file)
index 06d9e12..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Testing MPI_SUM...
-Testing MPI_PROD...
-Testing MPI_MAX...
-Testing MPI_MIN...
-Testing MPI_LOR...
-Testing MPI_LXOR...
-Testing MPI_LAND...
-Testing MPI_BOR...
-Testing MPI_BAND...
-Testing MPI_BXOR...
-Testing MPI_MAXLOC...
-Testing MPI_MINLOC...
- No Errors
diff --git a/teshsuite/smpi/mpich-test/coll/allred2.c b/teshsuite/smpi/mpich-test/coll/allred2.c
deleted file mode 100644 (file)
index a9dc98a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
-   This test checks for possible interference between 
-   successive calls to MPI_Allreduce.  Some users, on some MPI implementations
-   and platforms, have had to add MPI_Barrier before MPI_Allreduce calls.
-   */
-#include "mpi.h"
-#include <stdio.h>
-
-#define MAX_LOOP 1000
-
-int main( int argc, char *argv[] )
-{
-    int i, in_val, out_val;
-    int rank, size;
-    int errs = 0, toterrs;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    for (i=0; i<MAX_LOOP; i++) {
-       in_val = (i & 0x1) ? 10 : -10;
-       MPI_Allreduce( &in_val, &out_val, 1, MPI_INT, MPI_SUM, 
-                      MPI_COMM_WORLD );
-       if (i & 0x1) {
-           if (out_val != 10 * size) {
-               errs++;
-               printf( "[%d] Error in out_val = %d\n", rank, out_val );
-           }
-       }
-       else {
-           if (-out_val != 10 * size) {
-               errs++;
-               printf( "[%d] Error in out_val = %d\n", rank, out_val );
-           }
-       }
-    }
-    MPI_Barrier( MPI_COMM_WORLD );
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    
-    if (rank == 0) {
-       if (toterrs) 
-           printf( " Found %d errors\n", toterrs );
-       else
-           printf( " No Errors\n" );
-    }
-
-    MPI_Finalize( );
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/allredf.f b/teshsuite/smpi/mpich-test/coll/allredf.f
deleted file mode 100644 (file)
index 5ea0b27..0000000
+++ /dev/null
@@ -1,894 +0,0 @@
-
-        program main
-        include 'mpif.h'
-        integer count, errcnt, size, rank, ierr, i
-        integer comm
-        logical fnderr
-        integer max_size
-        integer world_rank
-        parameter (max_size=100)
-        integer intin(max_size), intout(max_size), intsol(max_size)
-        real    realin(max_size), realout(max_size), realsol(max_size)
-        double precision dblein(max_size), dbleout(max_size),
-     *                   dblesol(max_size)
-        complex cplxin(max_size), cplxout(max_size), cplxsol(max_size)
-        logical login(max_size), logout(max_size), logsol(max_size)
-C
-C
-C
-C       Declare work areas
-C
-        call MPI_INIT( ierr )
-
-        errcnt = 0
-        comm = MPI_COMM_WORLD
-        call MPI_COMM_RANK( comm, rank, ierr )
-        world_rank = rank
-        call MPI_COMM_SIZE( comm, size, ierr )
-        count = 10
-
-C Test sum 
-        if (world_rank .eq. 0) print *, ' MPI_SUM'
-
-       fnderr = .false.
-       do 23000 i=1,count
-        intin(i) = i
-        intsol(i) = i*size
-        intout(i) = 0
-23000   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_SUM, comm, ierr )
-              do 23001 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23001   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_SUM'
-        endif
-
-
-       fnderr = .false.
-       do 23002 i=1,count
-        realin(i) = i
-        realsol(i) = i*size
-        realout(i) = 0
-23002   continue
-       call MPI_Allreduce( realin, realout, count, 
-     *      MPI_REAL, MPI_SUM, comm, ierr )
-              do 23003 i=1,count
-        if (realout(i).ne.realsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23003   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_REAL and op MPI_SUM'
-        endif
-
-
-       fnderr = .false.
-       do 23004 i=1,count
-        dblein(i) = i
-        dblesol(i) = i*size
-        dbleout(i) = 0
-23004   continue
-       call MPI_Allreduce( dblein, dbleout, count, 
-     *      MPI_DOUBLE_PRECISION, MPI_SUM, comm, ierr )
-              do 23005 i=1,count
-        if (dbleout(i).ne.dblesol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23005   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_DOUBLE_PRECISION and op MPI_SUM'
-        endif
-
-
-       fnderr = .false.
-       do 23006 i=1,count
-        cplxin(i) = i
-        cplxsol(i) = i*size
-        cplxout(i) = 0
-23006   continue
-       call MPI_Allreduce( cplxin, cplxout, count, 
-     *      MPI_COMPLEX, MPI_SUM, comm, ierr )
-              do 23007 i=1,count
-        if (cplxout(i).ne.cplxsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23007   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_COMPLEX and op MPI_SUM'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, ' for MPI_SUM'
-        endif
-        errcnt = 0
-
-C Test product 
-        if (world_rank .eq. 0) print *, ' MPI_PROD'
-
-       fnderr = .false.
-       do 23008 i=1,count
-        intin(i) = i
-        intsol(i) = (i)**(size)
-        intout(i) = 0
-23008   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_PROD, comm, ierr )
-              do 23009 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23009   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_PROD'
-        endif
-
-
-       fnderr = .false.
-       do 23010 i=1,count
-        realin(i) = i
-        realsol(i) = (i)**(size)
-        realout(i) = 0
-23010   continue
-       call MPI_Allreduce( realin, realout, count, 
-     *      MPI_REAL, MPI_PROD, comm, ierr )
-              do 23011 i=1,count
-        if (realout(i).ne.realsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23011   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_REAL and op MPI_PROD'
-        endif
-
-
-       fnderr = .false.
-       do 23012 i=1,count
-        dblein(i) = i
-        dblesol(i) = (i)**(size)
-        dbleout(i) = 0
-23012   continue
-       call MPI_Allreduce( dblein, dbleout, count, 
-     *      MPI_DOUBLE_PRECISION, MPI_PROD, comm, ierr )
-              do 23013 i=1,count
-        if (dbleout(i).ne.dblesol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23013   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_DOUBLE_PRECISION and op MPI_PROD'
-        endif
-
-
-       fnderr = .false.
-       do 23014 i=1,count
-        cplxin(i) = i
-        cplxsol(i) = (i)**(size)
-        cplxout(i) = 0
-23014   continue
-       call MPI_Allreduce( cplxin, cplxout, count, 
-     *      MPI_COMPLEX, MPI_PROD, comm, ierr )
-              do 23015 i=1,count
-        if (cplxout(i).ne.cplxsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23015   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_COMPLEX and op MPI_PROD'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, ' for MPI_PROD'
-        endif
-        errcnt = 0
-
-C  Test max
-        if (world_rank .eq. 0) print *, ' MPI_MAX'
-
-       fnderr = .false.
-       do 23016 i=1,count
-        intin(i) = (rank + i)
-        intsol(i) = (size - 1 + i)
-        intout(i) = 0
-23016   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_MAX, comm, ierr )
-              do 23017 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23017   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_MAX'
-        endif
-
-
-       fnderr = .false.
-       do 23018 i=1,count
-        realin(i) = (rank + i)
-        realsol(i) = (size - 1 + i)
-        realout(i) = 0
-23018   continue
-       call MPI_Allreduce( realin, realout, count, 
-     *      MPI_REAL, MPI_MAX, comm, ierr )
-              do 23019 i=1,count
-        if (realout(i).ne.realsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23019   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_REAL and op MPI_MAX'
-        endif
-
-
-       fnderr = .false.
-       do 23020 i=1,count
-        dblein(i) = (rank + i)
-        dblesol(i) = (size - 1 + i)
-        dbleout(i) = 0
-23020   continue
-       call MPI_Allreduce( dblein, dbleout, count, 
-     *      MPI_DOUBLE_PRECISION, MPI_MAX, comm, ierr )
-              do 23021 i=1,count
-        if (dbleout(i).ne.dblesol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23021   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_DOUBLE_PRECISION and op MPI_MAX'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, ' for MPI_MAX'
-        endif
-        errcnt = 0
-
-C Test min 
-        if (world_rank .eq. 0) print *, ' MPI_MIN'
-
-       fnderr = .false.
-       do 23022 i=1,count
-        intin(i) = (rank + i)
-        intsol(i) = i
-        intout(i) = 0
-23022   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_MIN, comm, ierr )
-              do 23023 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23023   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_MIN'
-        endif
-
-
-       fnderr = .false.
-       do 23024 i=1,count
-        realin(i) = (rank + i)
-        realsol(i) = i
-        realout(i) = 0
-23024   continue
-       call MPI_Allreduce( realin, realout, count, 
-     *      MPI_REAL, MPI_MIN, comm, ierr )
-              do 23025 i=1,count
-        if (realout(i).ne.realsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23025   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_REAL and op MPI_MIN'
-        endif
-
-
-       fnderr = .false.
-       do 23026 i=1,count
-        dblein(i) = (rank + i)
-        dblesol(i) = i
-        dbleout(i) = 0
-23026   continue
-       call MPI_Allreduce( dblein, dbleout, count, 
-     *      MPI_DOUBLE_PRECISION, MPI_MIN, comm, ierr )
-              do 23027 i=1,count
-        if (dbleout(i).ne.dblesol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23027   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_DOUBLE_PRECISION and op MPI_MIN'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, ' for MPI_MIN'
-        endif
-        errcnt = 0
-
-C Test LOR
-        if (world_rank .eq. 0) print *, ' MPI_LOR'
-
-       fnderr = .false.
-       do 23028 i=1,count
-        login(i) = (mod(rank,2) .eq. 1)
-        logsol(i) = (size .gt. 1)
-        logout(i) = .FALSE.
-23028   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LOR, comm, ierr )
-              do 23029 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23029   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-           print *, 'Found ', errcnt, ' errors on ', rank,
-     *          ' for MPI_LOR(0)' 
-        endif
-        errcnt = 0
-
-
-
-       fnderr = .false.
-       do 23030 i=1,count
-        login(i) = .false.
-        logsol(i) = .false.
-        logout(i) = .FALSE.
-23030   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LOR, comm, ierr )
-              do 23031 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23031   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-           print *, 'Found ', errcnt, ' errors on ', rank,
-     *              ' for MPI_LOR(1)'
-        endif
-        errcnt = 0
-
-C Test LXOR 
-        if (world_rank .eq. 0) print *, ' MPI_LXOR'
-
-       fnderr = .false.
-       do 23032 i=1,count
-        login(i) = (rank .eq. 1)
-        logsol(i) = (size .gt. 1)
-        logout(i) = .FALSE.
-23032   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LXOR, comm, ierr )
-              do 23033 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23033   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ',errcnt,' errors on ', rank, ' for MPI_LXOR'
-        endif
-        errcnt = 0
-
-
-       fnderr = .false.
-       do 23034 i=1,count
-        login(i) = .false.
-        logsol(i) = .false.
-        logout(i) = .FALSE.
-23034   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LXOR, comm, ierr )
-              do 23035 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23035   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ',errcnt,' errors on ',rank,' for MPI_LXOR(0)'
-        endif
-        errcnt = 0
-
-
-       fnderr = .false.
-       do 23036 i=1,count
-        login(i) = .true.
-        logsol(i) = mod(size,2) .ne. 0 
-        logout(i) = .FALSE.
-23036   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LXOR, comm, ierr )
-              do 23037 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23037   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ',errcnt,' errors on ',rank,' for MPI_LXOR(1-0)'
-        endif
-        errcnt = 0
-
-C Test LAND 
-        if (world_rank .eq. 0) print *, ' MPI_LAND'
-
-       fnderr = .false.
-       do 23038 i=1,count
-        login(i) = (mod(rank,2) .eq. 1)
-        logsol(i) = .false.
-        logout(i) = .FALSE.
-23038   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LAND, comm, ierr )
-              do 23039 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23039   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LAND'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, ' for MPI_LAND'
-        endif
-        errcnt = 0
-
-
-
-
-       fnderr = .false.
-       do 23040 i=1,count
-        login(i) = .true.
-        logsol(i) = .true.
-        logout(i) = .FALSE.
-23040   continue
-       call MPI_Allreduce( login, logout, count, 
-     *      MPI_LOGICAL, MPI_LAND, comm, ierr )
-              do 23041 i=1,count
-        if (logout(i).neqv.logsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23041   continue
-        if (fnderr) then
-      print *, 'Error for type MPI_LOGICAL and op MPI_LAND'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ',errcnt,' errors on ',rank,
-     *      ' for MPI_LAND(true)'
-        endif
-        errcnt = 0
-        
-C Test BOR
-        if (world_rank .eq. 0) print *, ' MPI_BOR'
-        if (size .lt. 3) then
-
-       fnderr = .false.
-       do 23042 i=1,count
-        intin(i) = mod(rank,4)
-        intsol(i) = size - 1
-        intout(i) = 0
-23042   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BOR, comm, ierr )
-              do 23043 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23043   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BOR'
-        endif
-
-        else
-
-       fnderr = .false.
-       do 23044 i=1,count
-        intin(i) = mod(rank,4)
-        intsol(i) = 3
-        intout(i) = 0
-23044   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BOR, comm, ierr )
-              do 23045 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23045   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BOR'
-        endif
-
-        endif
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank,
-     *           ' for MPI_BOR(1)'
-        endif
-        errcnt = 0
-
-C Test BAND 
-        if (world_rank .eq. 0) print *, ' MPI_BAND'
-C See bottom for function definitions
-
-       fnderr = .false.
-       do 23046 i=1,count
-        intin(i) = ibxandval(rank,size,i)
-        intsol(i) = i
-        intout(i) = 0
-23046   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BAND, comm, ierr )
-              do 23047 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23047   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BAND'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_BAND(1)'
-        endif
-        errcnt = 0
-
-
-       fnderr = .false.
-       do 23048 i=1,count
-        intin(i) = ibxandval1(rank,size,i)
-        intsol(i) = 0
-        intout(i) = 0
-23048   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BAND, comm, ierr )
-              do 23049 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23049   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BAND'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_BAND(0)'
-        endif
-        errcnt = 0
-
-C Test BXOR 
-        if (world_rank .eq. 0) print *, ' MPI_BXOR'
-C See below for function definitions
-
-       fnderr = .false.
-       do 23050 i=1,count
-        intin(i) = ibxorval1(rank)
-        intsol(i) = ibxorsol1(size)
-        intout(i) = 0
-23050   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BXOR, comm, ierr )
-              do 23051 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23051   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_BXOR(1)'
-        endif
-        errcnt = 0
-
-
-       fnderr = .false.
-       do 23052 i=1,count
-        intin(i) = 0
-        intsol(i) = 0
-        intout(i) = 0
-23052   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BXOR, comm, ierr )
-              do 23053 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23053   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_BXOR(0)'
-        endif
-        errcnt = 0
-
-C Assumes -1 == all bits set
-
-       fnderr = .false.
-       do 23054 i=1,count
-        intin(i) = (-1)
-        if (mod(size,2) .eq. 0) then
-            intsol(i) = 0
-        else
-            intsol(i) = -1
-        endif
-        intout(i) = 0
-23054   continue
-       call MPI_Allreduce( intin, intout, count, 
-     *      MPI_INTEGER, MPI_BXOR, comm, ierr )
-              do 23055 i=1,count
-        if (intout(i).ne.intsol(i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23055   continue
-        if (fnderr) then
-          print *, 'Error for type MPI_INTEGER and op MPI_BXOR'
-        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_BXOR(1-0)'
-        endif
-        errcnt = 0
-
-C Test Maxloc 
-        if (world_rank .eq. 0) print *, ' MPI_MAXLOC'
-
-        fnderr = .false.
-        do 23056 i=1, count
-           intin(2*i-1) = (rank + i)
-           intin(2*i)   = rank
-           intsol(2*i-1) = (size - 1 + i)
-           intsol(2*i) = (size-1)
-           intout(2*i-1) = 0
-           intout(2*i)   = 0
-23056   continue
-                call MPI_Allreduce( intin, intout, count, 
-     *      MPI_2INTEGER, MPI_MAXLOC, comm, ierr )
-        do 23057 i=1, count
-        if (intout(2*i-1) .ne. intsol(2*i-1) .or.
-     *      intout(2*i) .ne. intsol(2*i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23057   continue
-        if (fnderr) then
-        print *, 'Error for type MPI_2INTEGER and op MPI_MAXLOC'
-        endif
-
-
-        fnderr = .false.
-        do 23058 i=1, count
-           realin(2*i-1) = (rank + i)
-           realin(2*i)   = rank
-           realsol(2*i-1) = (size - 1 + i)
-           realsol(2*i) = (size-1)
-           realout(2*i-1) = 0
-           realout(2*i)   = 0
-23058   continue
-                call MPI_Allreduce( realin, realout, count, 
-     *      MPI_2REAL, MPI_MAXLOC, comm, ierr )
-        do 23059 i=1, count
-        if (realout(2*i-1) .ne. realsol(2*i-1) .or.
-     *      realout(2*i) .ne. realsol(2*i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23059   continue
-        if (fnderr) then
-        print *, 'Error for type MPI_2REAL and op MPI_MAXLOC'
-        endif
-
-
-!        fnderr = .false.
-!        do 23060 i=1, count
-!           dblein(2*i-1) = (rank + i)
-!           dblein(2*i)   = rank
-!           dblesol(2*i-1) = (size - 1 + i)
-!           dblesol(2*i) = (size-1)
-!           dbleout(2*i-1) = 0
-!           dbleout(2*i)   = 0
-!23060   continue
-!                call MPI_Allreduce( dblein, dbleout, count, 
-!     *      MPI_2DOUBLE_PRECISION, MPI_MAXLOC, comm, ierr )
-!        do 23061 i=1, count
-!        if (dbleout(2*i-1) .ne. dblesol(2*i-1) .or.
-!     *      dbleout(2*i) .ne. dblesol(2*i)) then
-!            errcnt = errcnt + 1
-!            fnderr = .true. 
-!        endif
-!23061   continue
-!        if (fnderr) then
-!           print *,
-!     *     'Error for type MPI_2DOUBLE_PRECISION and op MPI_MAXLOC'
-
-!        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_MAXLOC'
-        endif
-        errcnt = 0
-
-C Test minloc 
-        if (world_rank .eq. 0) print *, ' MPI_MINLOC'
-
-
-        fnderr = .false.
-        do 23062 i=1, count
-           intin(2*i-1) = (rank + i)
-           intin(2*i)   = rank
-           intsol(2*i-1) = i
-           intsol(2*i) = 0
-           intout(2*i-1) = 0
-           intout(2*i)   = 0
-23062   continue
-                call MPI_Allreduce( intin, intout, count, 
-     *      MPI_2INTEGER, MPI_MINLOC, comm, ierr )
-        do 23063 i=1, count
-        if (intout(2*i-1) .ne. intsol(2*i-1) .or.
-     *      intout(2*i) .ne. intsol(2*i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23063   continue
-        if (fnderr) then
-        print *, 'Error for type MPI_2INTEGER and op MPI_MINLOC'
-        endif
-
-
-        fnderr = .false.
-        do 23064 i=1, count
-           realin(2*i-1) = (rank + i)
-           realin(2*i)   = rank
-           realsol(2*i-1) = i
-           realsol(2*i) = 0
-           realout(2*i-1) = 0
-           realout(2*i)   = 0
-23064   continue
-                call MPI_Allreduce( realin, realout, count, 
-     *      MPI_2REAL, MPI_MINLOC, comm, ierr )
-        do 23065 i=1, count
-        if (realout(2*i-1) .ne. realsol(2*i-1) .or.
-     *      realout(2*i) .ne. realsol(2*i)) then
-            errcnt = errcnt + 1
-            fnderr = .true. 
-        endif
-23065   continue
-        if (fnderr) then
-        print *, 'Error for type MPI_2REAL and op MPI_MINLOC'
-        endif
-
-
-!        fnderr = .false.
-!        do 23066 i=1, count
-!           dblein(2*i-1) = (rank + i)
-!           dblein(2*i)   = rank
-!           dblesol(2*i-1) = i
-!           dblesol(2*i) = 0
-!           dbleout(2*i-1) = 0
-!           dbleout(2*i)   = 0
-!23066   continue
-!                call MPI_Allreduce( dblein, dbleout, count, 
-!     *      MPI_2DOUBLE_PRECISION, MPI_MINLOC, comm, ierr )
-!        do 23067 i=1, count
-!        if (dbleout(2*i-1) .ne. dblesol(2*i-1) .or.
-!     *      dbleout(2*i) .ne. dblesol(2*i)) then
-!            errcnt = errcnt + 1
-!            fnderr = .true. 
-!        endif
-!23067   continue
-!        if (fnderr) then
-!           print *,
-!     *      'Error for type MPI_2DOUBLE_PRECISION and op MPI_MINLOC'
-!        endif
-
-
-        if (errcnt .gt. 0) then
-        print *, 'Found ', errcnt, ' errors on ', rank, 
-     *          ' for MPI_MINLOC'
-        endif
-        errcnt = 0
-
-        call MPI_Finalize( ierr )
-        end
-
-        integer function ibxorval1( ir )
-        ibxorval1 = 0
-        if (ir .eq. 1) ibxorval1 = 16+32+64+128
-        return
-        end
-
-        integer function ibxorsol1( is )
-        ibxorsol1 = 0
-        if (is .gt. 1) ibxorsol1 = 16+32+64+128
-        return
-        end
-
-C
-C       Assumes -1 == all bits set
-        integer function ibxandval( ir, is, i )
-        integer ir, is, i
-        ibxandval = -1
-        if (ir .eq. is - 1) ibxandval = i
-        return
-        end
-C
-        integer function ibxandval1( ir, is, i )
-        integer ir, is, i
-        ibxandval1 = 0
-        if (ir .eq. is - 1) ibxandval1 = i
-        return
-        end
diff --git a/teshsuite/smpi/mpich-test/coll/allredf.std b/teshsuite/smpi/mpich-test/coll/allredf.std
deleted file mode 100644 (file)
index 36bd81c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
- MPI_SUM
- MPI_PROD
- MPI_MAX
- MPI_MIN
- MPI_LOR
- MPI_LXOR
- MPI_LAND
- MPI_BOR
- MPI_BAND
- MPI_BXOR
- MPI_MAXLOC
- MPI_MINLOC
diff --git a/teshsuite/smpi/mpich-test/coll/allredmany.std b/teshsuite/smpi/mpich-test/coll/allredmany.std
deleted file mode 100644 (file)
index e7c3f62..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-*** allredmany ***
-*** allredmany run 0 ***
-*** allredmany run 1 ***
-*** allredmany run 2 ***
-*** allredmany run 3 ***
-*** allredmany run 4 ***
-*** allredmany run 5 ***
-*** allredmany run 6 ***
-*** allredmany run 7 ***
-*** allredmany run 8 ***
-*** allredmany run 9 ***
-*** allredmany run 10 ***
-*** allredmany run 11 ***
-*** allredmany run 12 ***
-*** allredmany run 13 ***
-*** allredmany run 14 ***
-*** allredmany run 15 ***
-*** allredmany run 16 ***
-*** allredmany run 17 ***
-*** allredmany run 18 ***
-*** allredmany run 19 ***
-*** allredmany ***
diff --git a/teshsuite/smpi/mpich-test/coll/alltoallv.c b/teshsuite/smpi/mpich-test/coll/alltoallv.c
deleted file mode 100644 (file)
index b08979b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "test.h"
-
-/*
-  This program tests MPI_Alltoallv by having processor i send different
-  amounts of data to each processor.
-
-  Because there are separate send and receive types to alltoallv,
-  there need to be tests to rearrange data on the fly.  Not done yet.
-  
-  The first test sends i items to processor i from all processors.
-
-  Currently, the test uses only MPI_INT; this is adequate for testing systems
-  that use point-to-point operations
- */
-
-int main( int argc, char **argv )
-{
-
-    MPI_Comm comm;
-    int      *sbuf, *rbuf;
-    int      rank, size;
-    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
-    int      i, j, *p, err, toterr;
-    
-    MPI_Init( &argc, &argv );
-    err = 0;
-    
-    comm = MPI_COMM_WORLD;
-
-    /* Create the buffer */
-    MPI_Comm_size( comm, &size );
-    MPI_Comm_rank( comm, &rank );
-    sbuf = (int *)malloc( size * size * sizeof(int) );
-    rbuf = (int *)malloc( size * size * sizeof(int) );
-    if (!sbuf || !rbuf) {
-       fprintf( stderr, "Could not allocated buffers!\n" );
-       MPI_Abort( comm, 1 );
-    }
-    
-    /* Load up the buffers */
-    for (i=0; i<size*size; i++) {
-       sbuf[i] = i + 100*rank;
-       rbuf[i] = -i;
-    }
-
-    /* Create and load the arguments to alltoallv */
-    sendcounts = (int *)malloc( size * sizeof(int) );
-    recvcounts = (int *)malloc( size * sizeof(int) );
-    rdispls    = (int *)malloc( size * sizeof(int) );
-    sdispls    = (int *)malloc( size * sizeof(int) );
-    if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
-       fprintf( stderr, "Could not allocate arg items!\n" );
-       MPI_Abort( comm, 1 );
-    }
-    for (i=0; i<size; i++) {
-       sendcounts[i] = i;
-       recvcounts[i] = rank;
-       rdispls[i]    = i * rank;
-       sdispls[i]    = (i * (i+1))/2;
-    }
-    MPI_Alltoallv( sbuf, sendcounts, sdispls, MPI_INT,
-                  rbuf, recvcounts, rdispls, MPI_INT, comm );
-
-    /* Check rbuf */
-    for (i=0; i<size; i++) {
-       p = rbuf + rdispls[i];
-       for (j=0; j<rank; j++) {
-           if (p[j] != i * 100 + (rank*(rank+1))/2 + j) {
-               fprintf( stderr, "[%d] got %d expected %d for %dth\n",
-                        rank, p[j],(i*(i+1))/2 + j, j );
-               err++;
-           }
-       }
-    }
-
-    free( sdispls );
-    free( rdispls );
-    free( recvcounts );
-    free( sendcounts );
-    free( rbuf );
-    free( sbuf );
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    if (rank == 0) {
-       if (toterr > 0) 
-           fprintf( stderr, "Test FAILED with %d errors\n", toterr );
-       else
-           fprintf( stderr, " No Errors\n" );
-    }
-       
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/assocf.f b/teshsuite/smpi/mpich-test/coll/assocf.f
deleted file mode 100644 (file)
index f39747c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-C
-C Thanks to zollweg@tc.cornell.edu (John A. Zollweg) for this test 
-C which detected a problem in one version of the IBM product 
-C implementation of MPI.  The source of the problem in that implementation
-C was assuming that floating point arithmetic was associative (it isn't
-C even commutative on IBM hardware).
-C
-C This program was designed for IEEE and may be uninteresting on other
-C systems.  Note that since it is testing that the same VALUE is
-C delivered at each system, it will run correctly on all systems.
-C
-      PROGRAM ALLREDUCE
-      include 'mpif.h'
-      real*8 myval(4), sum, recvbuf(4)
-      integer ier, me, size, tsize, dtype, i, errors, toterr
-      data myval /-12830196119319614d0,9154042893114674d0,
-     &2371516219785616d0,1304637006419324.8d0/
-      call MPI_INIT(ier)
-      call MPI_COMM_SIZE(MPI_COMM_WORLD,size,ier)
-      if (size.ne.4) then
-         print *,"This test case must be run as a four-way job"
-         call MPI_FINALIZE(ier)
-         stop
-      end if   
-      call MPI_TYPE_SIZE( MPI_REAL, tsize, ier )
-      if (tsize .eq. 8) then
-         dtype = MPI_REAL
-      else 
-         call MPI_TYPE_SIZE( MPI_DOUBLE_PRECISION, tsize, ier )
-         if (tsize .ne. 8) then
-            print *, " Can not test allreduce without an 8 byte"
-            print *, " floating double type."
-            call MPI_FINALIZE(ier)
-            stop
-         endif
-         dtype = MPI_DOUBLE_PRECISION
-      endif
-      call MPI_COMM_RANK(MPI_COMM_WORLD,me,ier)
-      call MPI_ALLREDUCE(myval(me+1),sum,1,dtype,MPI_SUM,
-     &MPI_COMM_WORLD,ier)
-C
-C     collect the values and make sure that they are all the same BITWISE
-C     We could use Gather, but this gives us an added test.
-C
-      do 5 i=1,4
-         recvbuf(i) = i
- 5    continue
-      call MPI_ALLGATHER( sum, 1, dtype, recvbuf, 1, dtype,
-     &                    MPI_COMM_WORLD, ier )
-      errors = 0
-      do 10 i=2,4
-C         print *, "recvbuf(",i,") = ", recvbuf(i), " on ", me
-         if (recvbuf(1) .ne. recvbuf(i)) then
-               errors = errors + 1
-               print *, "Inconsistent values for ", i, "th entry on ",
-     &                  me
-               print *, recvbuf(1), " not equal to ", recvbuf(i)
-          endif
- 10   continue
-      call MPI_ALLREDUCE( errors, toterr, 1, MPI_INTEGER, MPI_SUM,
-     &                    MPI_COMM_WORLD, ier )
-      if (me .eq. 0) then
-         if (toterr .gt. 0) then
-            print *, " FAILED with ", toterr, " errors."
-         else
-            print *, " No Errors"
-         endif
-      endif
-C      print *," The value of the sum on node ",me,"is",sum
-      call MPI_FINALIZE(ier)
-C     Calling stop can generate unwanted noise on some systems, and is not
-C     required.
-      end
diff --git a/teshsuite/smpi/mpich-test/coll/barrier.c b/teshsuite/smpi/mpich-test/coll/barrier.c
deleted file mode 100644 (file)
index 94fd362..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* This program provides some simple verification of the MPI_Barrier
- * program.  All of the clients send a message to indicate that they
- * are alive (a simple character string) and then the all of the
- * clients enter an MPI_Barrier.  The server then Iprobes for a while
- * to make sure that none of the "through barrier" messages that the
- * clients send after leaving the barrier arive before the server enters 
- * the barrier. The server then enters the barrier, and upon leaving,
- * waits for a message from each client.
- */
-
-#include "test.h"
-#include "mpi.h"
-
-#define WAIT_TIMES 500
-
-int
-main( int argc, char **argv)
-{
-    int rank, size, i, recv_flag, ret, passed;
-    MPI_Status Status;
-    char message[17];
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    if (rank == 0) {
-       Test_Init("barrier", rank);
-       /* Receive the startup messages from each of the 
-          other clients */
-       for (i = 0; i < size - 1; i++) {
-           MPI_Recv(message, 17, MPI_CHAR, MPI_ANY_SOURCE, 2000, 
-                    MPI_COMM_WORLD, &Status);
-       }
-
-       /* Now use Iprobe to make sure no more messages arive for a
-           while */
-       passed = 1;
-       for (i = 0; i < WAIT_TIMES; i++){
-           recv_flag = 0;
-           MPI_Iprobe(MPI_ANY_SOURCE, 2000, MPI_COMM_WORLD, 
-                      &recv_flag, &Status);
-           if (recv_flag)
-               passed = 0;
-       }
-
-       if (passed)
-           Test_Passed("Barrier Test 1");
-       else
-           Test_Failed("Barrier Test 1");
-
-       /* Now go into the barrier myself */
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       /* And get everyones message who came out */
-       for (i = 0; i < size - 1; i++) {
-           MPI_Recv(message, 13, MPI_CHAR, MPI_ANY_SOURCE, 2000, 
-                    MPI_COMM_WORLD, &Status);
-       }
-
-       /* Now use Iprobe to make sure no more messages arive for a
-           while */
-       passed = 1;
-       for (i = 0; i < WAIT_TIMES; i++){
-           recv_flag = 0;
-           MPI_Iprobe(MPI_ANY_SOURCE, 2000, MPI_COMM_WORLD, 
-                      &recv_flag, &Status);
-           if (recv_flag)
-               passed = 0;
-       }
-       if (passed)
-           Test_Passed("Barrier Test 2");
-       else
-           Test_Failed("Barrier Test 2");
-
-       Test_Waitforall( );
-       ret = Summarize_Test_Results();
-       Test_Finalize();
-       MPI_Finalize();
-       return ret;
-    } else {
-       MPI_Send((char*)"Entering Barrier", 17, MPI_CHAR, 0, 2000, MPI_COMM_WORLD);
-       MPI_Barrier(MPI_COMM_WORLD);
-       MPI_Send((char*)"Past Barrier", 13, MPI_CHAR, 0, 2000, MPI_COMM_WORLD);
-       Test_Waitforall( );
-       MPI_Finalize();
-       return 0;
-    }
-}
diff --git a/teshsuite/smpi/mpich-test/coll/bcast.c b/teshsuite/smpi/mpich-test/coll/bcast.c
deleted file mode 100644 (file)
index f8c983a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This program performs some simple tests of the MPI_Bcast broadcast
- * functionality.
- */
-
-#include "test.h"
-#include "mpi.h"
-#include <stdlib.h>
-
-int
-main( int argc, char **argv)
-{
-    int rank, size, ret, passed, i, *test_array;
-
-    /* Set up MPI */
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    /* Setup the tests */
-    Test_Init("bcast", rank);
-    test_array = (int *)malloc(size*sizeof(int));
-
-    /* Perform the test - this operation should really be done
-       with an allgather, but it makes a good test... */
-    passed = 1;
-    for (i=0; i < size; i++) {
-       if (i == rank)
-           test_array[i] = i;
-       MPI_Bcast(test_array, size, MPI_INT, i, MPI_COMM_WORLD);
-       if (test_array[i] != i)
-           passed = 0;
-    }
-    if (!passed)
-       Test_Failed("Simple Broadcast test");
-    else {
-       if (rank == 0)
-           Test_Passed("Simple Broadcast test");
-       }
-
-    /* Close down the tests */
-    free(test_array);
-    if (rank == 0)
-       ret = Summarize_Test_Results();
-    else
-       ret = 0;
-    Test_Finalize();
-
-    /* Close down MPI */
-    Test_Waitforall( );
-    MPI_Finalize();
-    return ret;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/bcast2.f b/teshsuite/smpi/mpich-test/coll/bcast2.f
deleted file mode 100644 (file)
index 25b6aa3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-      program test
-C
-C This program hangs when run with the version of MPICH (1.1.2) distributed
-C by Myricom using their ch_gm device.  I've added it to our collection
-C on general principle; note that it hasn't been put into a form usable
-C by our tests yet
-C
-      include 'mpif.h'
-      integer comm_size,comm_rank,status(mpi_status_size)
-      integer at_number,chunk
-      double precision T0,D
-      at_number=0
-      chunk=0
-      T0=3D3048.48883
-      D=3D3877.4888
-      call mpi_init(ierror)
-      call mpi_comm_size(mpi_comm_world,comm_size,ierror)
-      call mpi_comm_rank(mpi_comm_world,comm_rank,ierror)
-      CALL MPI_BCAST(at_number,1,mpi_integer,0,mpi_comm_world,ierr)
-      CALL MPI_BCAST(chunk,1,mpi_integer,0,mpi_comm_world,ierr)
-      CALL MPI_BCAST(T0,1,mpi_double_precision,0,mpi_comm_world,ierr)
-      CALL MPI_BCAST(D,1,mpi_double_precision,0,mpi_comm_world,ierr)
-
-      write(6,*) 'Rank=3D',comm_rank,' finished bcast'
-      do i=3D1,99999
-        T0=3Di*1.0d0
-        d=3Dt0**.987
-        do j=3D1,100
-           a=3Dj**.2
-        enddo
-      enddo
-      write(6,*) 'Rank=3D',comm_rank,' finished calculations'
-      call mpi_finalize(ierror)
-      end
-C 
-C Run with mpirun -np 16 test
diff --git a/teshsuite/smpi/mpich-test/coll/bcastbug.c b/teshsuite/smpi/mpich-test/coll/bcastbug.c
deleted file mode 100644 (file)
index dc2d81a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-  char *buf;
-  int rank, size, i;
-  MPI_Request req[10];
-  MPI_Status  stat[10];
-  MPI_Status  status;
-
-  buf = (char *)malloc(32*1024);
-  MPI_Init(&argc, &argv);
-  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
-  MPI_Comm_size ( MPI_COMM_WORLD, &size );
-
-  if (size > 10) return 1;
-  
-  if (rank == 0) {
-    for ( i = 1; i < size; i++ )
-      MPI_Isend(buf,1024,MPI_BYTE,i,0,MPI_COMM_WORLD,&req[i]);
-    MPI_Waitall(size-1, &req[1], &stat[1]); /* Core dumps here! */
-  }
-  else 
-    MPI_Recv(buf,1024,MPI_BYTE,0,0,MPI_COMM_WORLD,&status);
-
-    Test_Waitforall( );
-  MPI_Finalize();
-  return 0;
-}
-
-#if 0
-int MPIND_Waitall(count, array_of_requests, array_of_statuses )
-int         count;
-MPI_Request array_of_requests[];
-MPI_Status  array_of_statuses[];
-{
-  int i;
-  MPIR_BOOL completed;
-  
-  for (i = 0; i < count; i++) {
-    if (!array_of_requests[i]) continue;
-    MPID_complete_send(&array_of_requests[i]->shandle, 
-                       &(array_of_statuses[i]) );
-    
-    MPIND_Request_free( &array_of_requests[i] ); /* Core dumps here! */
-    array_of_requests[i]    = NULL;
-  }
-  return MPI_SUCCESS;
-}
-
-
-#define MPID_ND_free_send_handle( a )  if ((a)->buffer) {FREE((a)->buffer);}
-
-int MPIND_Request_free( request )
-MPI_Request *request;
-{
-  int errno = MPI_SUCCESS;
-  printf("Should be core dumping here (buffer = %d)...\n",
-         (&((*request)->shandle.dev_shandle))->buffer);
-  MPID_ND_free_send_handle(&((*request)->shandle.dev_shandle));
-  printf("and not reaching here!\n");
-  SBfree( MPIR_shandles, *request );
-
-  return MPI_SUCCESS;
-}
-#endif
diff --git a/teshsuite/smpi/mpich-test/coll/bcastbug2.c b/teshsuite/smpi/mpich-test/coll/bcastbug2.c
deleted file mode 100644 (file)
index 4870195..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "test.h"
-
-int main( int argc, char **argv)
-{
-   char *buf;
-   int i, iam;
-   MPI_Init(&argc, &argv);
-   MPI_Barrier(MPI_COMM_WORLD);
-   buf = (char *)malloc(32*1024);
-   MPI_Comm_rank(MPI_COMM_WORLD, &iam);
-   for(i=1; i<=32; i++){
-      if (iam == 0){
-         *buf=i;
-         printf("Broadcasting %d bytes\n", i*64);
-         }
-      MPI_Bcast(buf, i*64, MPI_BYTE, 0, MPI_COMM_WORLD);
-      if (*buf != i) printf("Sanity check error on node %d\n", iam);
-/*      gsync();
-*/
-      MPI_Barrier(MPI_COMM_WORLD);
-      }
-   Test_Waitforall( );
-   MPI_Finalize();
-
-   return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/bcastlog.f b/teshsuite/smpi/mpich-test/coll/bcastlog.f
deleted file mode 100644 (file)
index a36cc68..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-      program main
-c     test bcast of logical
-c     works on suns, needs mpich fix and heterogeneous test on alpha with PC
-      include 'mpif.h'
-      integer myid, numprocs, rc, ierr
-      integer errs, toterrs
-      logical boo
-
-      call MPI_INIT( ierr )
-      call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
-      call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
-C
-      errs = 0
-      boo = .true.
-      call MPI_BCAST(boo,1,MPI_LOGICAL,0,MPI_COMM_WORLD,ierr)
-      if (boo .neqv. .true.) then 
-         print *, 'Did not broadcast Fortran logical (true)'
-         errs = errs + 1
-      endif
-C
-      boo = .false.
-      call MPI_BCAST(boo,1,MPI_LOGICAL,0,MPI_COMM_WORLD,ierr)
-      if (boo .neqv. .false.) then 
-         print *, 'Did not broadcast Fortran logical (false)'
-         errs = errs + 1
-      endif
-      call MPI_Reduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, 
-     $                 0, MPI_COMM_WORLD, ierr )
-      if (myid .eq. 0) then
-         if (toterrs .eq. 0) then
-            print *, ' No Errors'
-         else
-            print *, ' Found ', toterrs, ' errors'
-         endif
-      endif
-      call MPI_FINALIZE(rc)
-C     stop
-C do not use stop with smpi, it causes errors, as does exit
-      end
diff --git a/teshsuite/smpi/mpich-test/coll/bcastvec.c b/teshsuite/smpi/mpich-test/coll/bcastvec.c
deleted file mode 100644 (file)
index b587174..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This program performs some simple tests of the MPI_Bcast broadcast
- * functionality.
- *
- * It checks the handling of different datatypes by different participants
- * (with matching type signatures, of course), as well as different
- * roots and communicators.
- */
-
-#include "test.h"
-#include "mpi.h"
-#include <stdlib.h>
-
-int main( int argc, char **argv )
-{
-    int rank, size, ret, passed, i, *test_array;
-    int stride, count, root;
-    MPI_Datatype newtype;
-    MPI_Comm     comm = MPI_COMM_WORLD;
-
-    /* Set up MPI */
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(comm, &rank);
-
-    /* Setup the tests */
-    Test_Init("bcastvec", rank);
-
-    /* Allow for additional communicators */
-    MPI_Comm_size(comm, &size);
-    /* MPI_Comm_rank(comm, &rank); */
-    stride = (rank + 1);
-    test_array = (int *)malloc(size*stride*sizeof(int));
-
-    /* Create the vector datatype EXCEPT for process 0 (vector of
-       stride 1 is contiguous) */
-    if (rank > 0) {
-       count = 1;
-        MPI_Type_vector( size, 1, stride, MPI_INT, &newtype);
-        MPI_Type_commit( &newtype );
-    }
-    else {
-       count = size;
-       newtype = MPI_INT;
-    }
-
-    /* Perform the test.  Each process in turn becomes the root.
-       After each operation, check that nothing has gone wrong */
-    passed = 1;
-    for (root = 0; root < size; root++) {
-       /* Fill the array with -1 for unset, rank + i * size for set */
-       for (i=0; i<size*stride; i++) test_array[i] = -1;
-       if (rank == root) 
-           for (i=0; i<size; i++) test_array[i*stride] = rank + i * size;
-       MPI_Bcast( test_array, count, newtype, root, comm );
-       for (i=0; i<size; i++) {
-           if (test_array[i*stride] != root + i * size) {
-               passed = 0;
-           }
-       }
-    }
-    free(test_array);
-    if (rank != 0) MPI_Type_free( &newtype );
-
-    if (!passed)
-       Test_Failed("Simple Broadcast test with datatypes");
-    else {
-       if (rank == 0)
-           Test_Passed("Simple Broadcast test with datatypes");
-       }
-
-    /* Close down the tests */
-    if (rank == 0)
-       ret = Summarize_Test_Results();
-    else {
-       ret = 0;
-    }
-    Test_Finalize();
-
-    /* Close down MPI */
-    Test_Waitforall( );
-    MPI_Finalize();
-    return ret;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/coll1.c b/teshsuite/smpi/mpich-test/coll/coll1.c
deleted file mode 100644 (file)
index a15f6c2..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "mpi.h"
-#include "test.h"
-#include <stdlib.h>
-#include <stdio.h>
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int             *table;
-    int              errors=0;
-    MPI_Aint         address;
-    MPI_Datatype     type, newtype;
-    int              lens;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Make data table */
-    table = (int *) calloc (size, sizeof(int));
-    table[rank] = rank + 1;
-
-    MPI_Barrier ( MPI_COMM_WORLD );
-    /* Broadcast the data */
-    for ( i=0; i<size; i++ ) 
-      MPI_Bcast( &table[i], 1, MPI_INT, i, MPI_COMM_WORLD );
-
-    /* See if we have the correct answers */
-    for ( i=0; i<size; i++ )
-      if (table[i] != i+1) errors++;
-
-    MPI_Barrier ( MPI_COMM_WORLD );
-
-    /* Try the same thing, but with a derived datatype */
-    for ( i=0; i<size; i++ ) 
-       table[i] = 0;
-    table[rank] = rank + 1;
-    for ( i=0; i<size; i++ ) {
-       //MPI_Address( &table[i], &address );
-       address=0;
-  type = MPI_INT;
-       lens = 1;
-       MPI_Type_struct( 1, &lens, &address, &type, &newtype );
-       MPI_Type_commit( &newtype );
-       MPI_Bcast( &table[i], 1, newtype, i, MPI_COMM_WORLD );
-       MPI_Type_free( &newtype );
-       }
-    /* See if we have the correct answers */
-    for ( i=0; i<size; i++ )
-      if (table[i] != i+1) errors++;
-
-    MPI_Barrier ( MPI_COMM_WORLD );
-
-    Test_Waitforall( );
-    MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS!\n", rank );
-    return errors;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/coll/coll13.c b/teshsuite/smpi/mpich-test/coll/coll13.c
deleted file mode 100644 (file)
index f2518d3..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#include "mpi.h"
-#include "test.h"
-
-/* 
-From: hook@nas.nasa.gov (Edward C. Hook)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <string.h>
-#include <errno.h>
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-#endif
-
-int main( int argc, char *argv[] )
-{
-    int rank, size;
-    int i,j;
-    int *sb;
-    int *rb;
-    int status, gstatus, endstatus;
-    endstatus=0;
-    MPI_Init(&argc,&argv);
-    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-    MPI_Comm_size(MPI_COMM_WORLD,&size);
-
-    for ( i=1 ; i < argc ; ++i ) {
-       if ( argv[i][0] != '-' )
-           continue;
-       switch(argv[i][1]) {
-       default:
-           fprintf(stderr,"Unrecognized argument %s\n",
-                   argv[i]);
-           MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
-       }
-    }
-     
-    
-    /*
-    SMPI addition: we want to test all three alltoall algorithms, thus we use
-    three different sizes.  This is the code that handles these cases:
-
-    if (sendsize < 200 && size > 12) {
-      retval =
-          smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
-                                         recvbuf, recvcount, recvtype,
-                                         comm);
-    } else if (sendsize < 3000) {
-      retval =
-          smpi_coll_tuned_alltoall_basic_linear(sendbuf, sendcount,
-                                                sendtype, recvbuf,
-                                                recvcount, recvtype, comm);
-    } else {
-      retval =
-          smpi_coll_tuned_alltoall_pairwise(sendbuf, sendcount, sendtype,
-                                            recvbuf, recvcount, recvtype,
-                                            comm);
-    }
-    */
-    
-    
-    int sizes [3] ={ 4096, 64, 32};
-    for ( j=0 ; j < 3 ; j++ ) {
-      sb = (int *)malloc(size*sizes[j]*sizeof(int));
-      if ( !sb ) {
-        perror( "can't allocate send buffer" );
-        MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
-      }
-      rb = (int *)malloc(size*sizes[j]*sizeof(int));
-      if ( !rb ) {
-        perror( "can't allocate recv buffer");
-        free(sb);
-        MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
-      }
-      for ( i=0 ; i < size*sizes[j] ; ++i ) {
-        sb[i] = rank + 1;
-        rb[i] = 0;
-      }
-
-      /* fputs("Before MPI_Alltoall\n",stdout); */
-      MPI_Barrier(MPI_COMM_WORLD );
-      /* This should really send MPI_CHAR, but since sb and rb were allocated
-       as chunk*size*sizeof(int), the buffers are large enough */
-      status = MPI_Alltoall(sb,sizes[j],MPI_INT,rb,sizes[j],MPI_INT,
-                            MPI_COMM_WORLD);
-
-      /* fputs("Before MPI_Allreduce\n",stdout); */
-      MPI_Allreduce( &status, &gstatus, 1, MPI_INT, MPI_SUM, 
-                    MPI_COMM_WORLD );
-
-      MPI_Barrier(MPI_COMM_WORLD );
-    /* fputs("After MPI_Allreduce\n",stdout); */
-      if (rank == 0 && gstatus != 0) endstatus ++;
-
-      free(sb);
-      free(rb);
-    }
-    
-    if (rank == 0) {
-      if (endstatus == 0) printf( " No Errors\n" );
-      else 
-        printf("all_to_all returned %d erros\n",endstatus);
-    }
-    MPI_Finalize();
-
-    return(EXIT_SUCCESS);
-}
-
diff --git a/teshsuite/smpi/mpich-test/coll/coll13.std b/teshsuite/smpi/mpich-test/coll/coll13.std
deleted file mode 100644 (file)
index 2d4993a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-You requested to use 14 processes, but there is only 5 processes in your hostfile...
- No Errors
diff --git a/teshsuite/smpi/mpich-test/coll/coll4.c b/teshsuite/smpi/mpich-test/coll/coll4.c
deleted file mode 100644 (file)
index e7a2290..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-#define MAX_PROCESSES 10
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i,j;
-    int              table[MAX_PROCESSES][MAX_PROCESSES];
-    int              row[MAX_PROCESSES];
-    int              errors=0;
-    int              participants;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* A maximum of MAX_PROCESSES processes can participate */
-    if ( size > MAX_PROCESSES ) participants = MAX_PROCESSES;
-    else              participants = size;
-    if ( (rank < participants) ) {
-      int send_count = MAX_PROCESSES;
-      int recv_count = MAX_PROCESSES;
-
-      /* If I'm the root (process 0), then fill out the big table */
-      if (rank == 0) 
-       for ( i=0; i<participants; i++) 
-         for ( j=0; j<MAX_PROCESSES; j++ ) 
-           table[i][j] = i+j;
-      
-      /* Scatter the big table to everybody's little table */
-      MPI_Scatter(&table[0][0], send_count, MPI_INT, 
-                 &row[0]     , recv_count, MPI_INT, 0, MPI_COMM_WORLD);
-
-      /* Now see if our row looks right */
-      for (i=0; i<MAX_PROCESSES; i++) 
-       if ( row[i] != i+rank ) errors++;
-    } 
-
-    Test_Waitforall( );
-    MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/grouptest.c b/teshsuite/smpi/mpich-test/coll/grouptest.c
deleted file mode 100644 (file)
index f943795..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*     $Id: grouptest.c,v 1.2 1998/11/28 04:04:56 gropp Exp $   */
-
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-    int rank, size, i;
-    MPI_Group group1, group2, group3, groupall, groupunion, newgroup;
-    MPI_Comm newcomm;
-    int ranks1[100], ranks2[100], ranks3[100];
-    int nranks1=0, nranks2=0, nranks3=0;
-
-    MPI_Init( &argc, &argv );
-    MPI_Barrier( MPI_COMM_WORLD );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_group( MPI_COMM_WORLD, &groupall );
-
-    /* Divide groups */
-    for (i=0; i<size; i++) 
-      if ( (i%3)==0 )
-       ranks1[nranks1++] = i;
-      else if ( (i%3)==1 )
-       ranks2[nranks2++] = i;
-      else
-       ranks3[nranks3++] = i;
-
-    MPI_Group_incl ( groupall, nranks1, ranks1, &group1 );
-    MPI_Group_incl ( groupall, nranks2, ranks2, &group2 );
-    MPI_Group_incl ( groupall, nranks3, ranks3, &group3 );
-
-    MPI_Group_difference ( groupall, group2, &groupunion );
-
-    MPI_Comm_create ( MPI_COMM_WORLD, group3, &newcomm );
-    newgroup = MPI_GROUP_NULL;
-    if (newcomm != MPI_COMM_NULL)
-    {
-       /* If we don't belong to group3, this would fail */
-       MPI_Comm_group ( newcomm, &newgroup );
-    }
-
-    /* Free the groups */
-   /* MPI_Group_free( &groupall );
-    MPI_Group_free( &group1 );
-    MPI_Group_free( &group2 );
-    MPI_Group_free( &group3 );
-    MPI_Group_free( &groupunion );*/
-    if (newgroup != MPI_GROUP_NULL)
-    {
-       //MPI_Group_free( &newgroup );
-    }
-
-    /* Free the communicator */
-    if (newcomm != MPI_COMM_NULL)
-       //MPI_Comm_free( &newcomm );
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/nbcoll.c b/teshsuite/smpi/mpich-test/coll/nbcoll.c
deleted file mode 100644 (file)
index aad92b6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-int main( int argc, char *argv[] )
-{
-    int rank, size;
-    MPI_Comm local_comm;
-    MPI_Request r;
-    MPI_Status status;
-    double t0;
-
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    if (size < 3) {
-       fprintf( stderr, "Need at least 3 processors\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_split( MPI_COMM_WORLD, rank < 2, rank, &local_comm );
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (rank == 0) {
-       /* First, ensure ssend works */
-       t0 = MPI_Wtime();
-       MPI_Ssend( MPI_BOTTOM, 0, MPI_INT, 1, 1, MPI_COMM_WORLD );
-       t0 = MPI_Wtime() - t0;
-       if (t0 < 1.0) {
-           fprintf( stderr, "Ssend does not wait for recv!\n" );
-           fflush( stderr );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       MPI_Barrier( MPI_COMM_WORLD );
-       /* Start the ssend after process 1 is well into its barrier */
-       t0 = MPI_Wtime();
-       while (MPI_Wtime() - t0 < 1.0) ;
-       MPI_Ssend( MPI_BOTTOM, 0, MPI_INT, 1, 0, MPI_COMM_WORLD );
-       MPI_Barrier( local_comm );
-       /* Send process 2 an alls well */
-       MPI_Send( MPI_BOTTOM, 0, MPI_INT, 2, 0, MPI_COMM_WORLD );
-    }
-    else if (rank == 1) {
-       t0 = MPI_Wtime();
-       while (MPI_Wtime() - t0 < 2.0) ;
-       MPI_Recv( MPI_BOTTOM, 0, MPI_INT, 0, 1, MPI_COMM_WORLD, &status );
-       MPI_Barrier( MPI_COMM_WORLD );
-       MPI_Irecv( MPI_BOTTOM, 0, MPI_INT, 0, 0, MPI_COMM_WORLD, &r );
-       MPI_Barrier( local_comm );
-       MPI_Wait( &r, &status );
-    }
-    else if (rank == 2) {
-       int flag;
-
-       MPI_Barrier( MPI_COMM_WORLD );
-       MPI_Irecv( MPI_BOTTOM, 0, MPI_INT, 0, 0, MPI_COMM_WORLD, &r );
-       t0 = MPI_Wtime();
-       while (MPI_Wtime() - t0 < 3.0) ;
-       MPI_Test( &r, &flag, &status );
-       if (!flag) {
-           fprintf( stderr, "Test failed!\n" );
-           fflush( stderr );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       else
-           fprintf( stderr, "Test succeeded\n" );
-    }
-    else {
-       MPI_Barrier( MPI_COMM_WORLD );
-    }
-
-    MPI_Comm_free( &local_comm );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/redtst.c b/teshsuite/smpi/mpich-test/coll/redtst.c
deleted file mode 100644 (file)
index b865e2a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-  int rank, value, result;
-
-  MPI_Init (&argc, &argv);
-  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
-
-  value = (rank == 0) ? 3 : 6;
-  MPI_Allreduce (&value, &result, 1, MPI_INT, MPI_BOR, MPI_COMM_WORLD);
-  if (rank == 0) printf ("Result of 3 BOR 6 is %d, result of 3|6 is %d\n", 
-                         result, 3|6);
-
-  Test_Waitforall( );
-  MPI_Finalize ();
-
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/runtests b/teshsuite/smpi/mpich-test/coll/runtests
deleted file mode 100755 (executable)
index 33a2703..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-#! /bin/sh
-# This version puts the output from each program into a separate file.
-# -mvhome is needed for the ANL SP, and is ignored by others
-args=
-device=
-MPICH_VERSION=
-STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
-
-MAKE="make --no-print-directory"
-MPIRUNMVBACK=''
-#
-
-# Set mpirun to the name/path of the mpirun program
-#FindMPIRUN
-#
-runtests=1
-makeeach=0
-writesummaryfile=no
-have_fortran=0
-quiet=0
-MAKE="make --no-print-directory"
-for arg in "$@" ; do
-    case $arg in
-    -basedir=* )
-       basedir=`echo $arg | sed 's/-basedir=//'`
-       ;; 
-    -srcdir=* )
-       srcdir=`echo $arg | sed 's/-srcdir=//'`
-       ;; 
-       -fort=* )
-       have_fortran=`echo $arg | sed 's/-fort=//'`
-       ;;
-       -checkonly )
-       runtests=0
-       ;;
-    -margs=*)
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -small)
-       shift
-       makeeach=1
-       ;;
-       -summaryfile=*)
-       writesummaryfile=yes
-       summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
-       ;;
-       -quiet)
-       shift
-       quiet=1
-       ;;
-       -help|-u)
-       echo "runtests [-checkonly] [-margs='...']"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "runtests: Unknown argument ($arg)"
-           exit 1
-        fi
-       ;;
-    esac
-done
-# Load basic procedures
-. ${srcdir}/../runbase
-#
-# If the programs are not available, run make.
-if [ ! -x coll1 -a $makeeach = 0 -a $runtests = 1 ] ; then
-    $MAKE
-fi
-
-mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
-testfiles=""
-if [ $runtests = 1 ] ; then
-echo '**** Testing MPI Collective routines ****'
-
-RunTest barrier 4 "*** Barrier Test ***" "" "barrier-0.out"
-
-RunTest bcast_mpich 4 "*** Broadcast Test ***" "" "bcast-0.out bcast-1.out bcast-2.out bcast-3.out"
-
-RunTest bcastvec 4 "*** Broadcast Datatype Test ***" "" "bcastvec-0.out bcastvec-1.out bcastvec-2.out bcastvec-3.out"
-
-
-#TODO : handle MPI_BOTTOM to allow som operations to use absolute addresses
-RunTest coll1 4
-
-RunTest coll2 5
-
-RunTest coll3 5
-
-RunTest coll4 4
-
-RunTest coll5 4
-
-RunTest coll6 5
-
-RunTest coll7 5
-
-RunTest coll8 4
-
-RunTest coll9 4
-
-#smpi does not handle non commutative operations, removed
-#RunTest coll10 4
-
-#smpi does not handle non commutative operations, removed
-RunTest coll11 4
-
-#weird manipulations of ranks in split, and comms -> deadlock, removed
-#RunTest scantst 4
-
-RunTest coll12 4
-
-# coll13 is very picky about arguments
-RunTest coll13 14
-
-RunTest longuser 4
-
-# Some implementations (e.g., IBM's) forget to handle the np = 1 case.
-#RunTest longuser 1 "*** longuser (np == 1) ***"
-MakeExe longuser
-cp longuser longuser1
-RunTest longuser1 1 '*** longuser (np == 1) ***'
-rm -f longuser1
-
-#OutTime
-#testfiles="$testfiles allredmany.out"
-#rm -f allredmany.out
-#MakeExe allredmany
-#echo '**** allredmany ****'
-#echo '*** allredmany ***' >> allredmany.out
-#cnt=0
-## Run several times to try and catch timing/race conditions in managing
-## the flood of one-way messages.
-#while [ $cnt -lt 20 ] ; do
-#    echo "*** allredmany run $cnt ***" >> allredmany.out
-#    $mpirun -np 2 $args allredmany >> allredmany.out 2>&1
-#    cnt=`expr $cnt + 1`
-#done
-#echo '*** allredmany ***' >> allredmany.out
-#CleanExe allredmany
-
-RunTest grouptest 4
-#uses MPI_Dims_create, MPI_Cart_create ... removed
-RunTest allred 4 "*** Allred ***"
-
-RunTest allred2 4 "*** Allred2 ***"
-#uses MPI_Dims_create, MPI_Cart_create ... removed
-#RunTest scatterv 4 "*** Scatterv ***"
-
-RunTest scattern 4 "*** Scattern ***"
-
-#fails, more debug needed to understand
-RunTest redscat 4 "*** Reduce_scatter ***"
-
-RunTest alltoallv_mpich 4 "*** Alltoallv ***"
-echo "runtests: fortran ($have_fortran)"
-#
-# Run Fortran tests ONLY if Fortran available
-if [ $have_fortran -eq "1" ] ; then 
-    echo "FORTRAN TESTS"
-
-    RunTest allredf 4 "*** Testing allreduce from Fortran ***"
-
-    RunTest assocf 4 "*** Testing allreduce from Fortran (2) ***"
-
-    RunTest bcastlog 4 "*** Testing logical datatype in BCAST ***"
-    #buggy test, not available in original test, removed
-    #RunTest allgatherf 2 "*** Testing allgather from Fortran ***"
-    echo "END OF FORTRAN TESTS"
-fi
-
-else
-    # Just run checks
-    testfiles=`echo *.out`
-    if test "$testfiles" = "*.out" ; then
-       echo "No output files remain from previous test!"
-       exit 1
-    fi
-fi
-
-echo '*** Checking for differences from expected output ***'
-CheckAllOutput coll.diff
-exit 0
diff --git a/teshsuite/smpi/mpich-test/coll/scantst.c b/teshsuite/smpi/mpich-test/coll/scantst.c
deleted file mode 100644 (file)
index 63561be..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-MPI_Comm GetNextComm( void );
-void addem ( int *, int *, int *, MPI_Datatype * );
-void assoc ( int *, int *, int *, MPI_Datatype * );
-
-void addem( int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
-{
-  int i;
-  for ( i=0; i<*len; i++ ) 
-    inoutvec[i] += invec[i];
-}
-
-#define BAD_ANSWER 100000
-
-/*
-    The operation is inoutvec[i] = invec[i] op inoutvec[i] 
-    (see 4.9.4).  The order is important.
-
-    Note that the computation is in process rank (in the communicator)
-    order, independant of the root.
- */
-void assoc( int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
-{
-  int i;
-  for ( i=0; i<*len; i++ )  {
-    if (inoutvec[i] <= invec[i] ) {
-      int rank;
-      MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-      fprintf( stderr, "[%d] inout[0] = %d, in[0] = %d\n", 
-             rank, inoutvec[0], invec[0] );
-      inoutvec[i] = BAD_ANSWER;
-      }
-    else 
-      inoutvec[i] = invec[i];
-  }
-}
-
-MPI_Comm GetNextComm( void )
-{
-    MPI_Comm comm = MPI_COMM_NULL;
-    static int idx = 0;
-    int size, rank;
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    switch (idx) {
-    case 0: 
-       MPI_Comm_dup( MPI_COMM_WORLD, &comm );
-       break;
-    case 1:
-       /* invert the rank order */
-       MPI_Comm_split( MPI_COMM_WORLD, 0, size - rank, &comm );
-       break;
-    case 2:
-       /* Divide into subsets */
-       MPI_Comm_split( MPI_COMM_WORLD, rank < (size/2), rank, &comm );
-       break;
-    case 3:
-       /* Another division */
-       MPI_Comm_split( MPI_COMM_WORLD, rank < (size/3), size-rank, &comm );
-       break;
-    case 4:
-       /* odd and even */
-       MPI_Comm_split( MPI_COMM_WORLD, (rank % 2) == 0, rank, &comm );
-       break;
-    case 5:
-       /* Last case: startover */
-       idx = -1;
-       break;
-    }
-    idx++;
-    return comm;
-}
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int              data;
-    int              errors=0;
-    int              result = -100;
-    int              correct_result;
-    MPI_Op           op_assoc, op_addem;
-    MPI_Comm         comm;
-
-    MPI_Init( &argc, &argv );
-    MPI_Op_create( (MPI_User_function *)assoc, 0, &op_assoc );
-    MPI_Op_create( (MPI_User_function *)addem, 1, &op_addem );
-
-    /* Run this for a variety of communicator sizes */
-    while ((comm = GetNextComm()) != MPI_COMM_NULL) {
-       MPI_Comm_rank( comm, &rank );
-       MPI_Comm_size( comm, &size );
-
-       data = rank;
-       
-       correct_result = 0;
-       for (i=0;i<=rank;i++)
-           correct_result += i;
-
-       MPI_Scan ( &data, &result, 1, MPI_INT, MPI_SUM, comm );
-       if (result != correct_result) {
-           fprintf( stderr, "[%d] Error suming ints with scan\n", rank );
-           errors++;
-       }
-
-       MPI_Scan ( &data, &result, 1, MPI_INT, MPI_SUM, comm );
-       if (result != correct_result) {
-           fprintf( stderr, "[%d] Error summing ints with scan (2)\n", rank );
-           errors++;
-       }
-
-       data = rank;
-       result = -100;
-       MPI_Scan ( &data, &result, 1, MPI_INT, op_addem, comm );
-       if (result != correct_result) {
-           fprintf( stderr, "[%d] Error summing ints with scan (userop)\n", 
-                    rank );
-           errors++;
-       }
-
-       MPI_Scan ( &data, &result, 1, MPI_INT, op_addem, comm );
-       if (result != correct_result) {
-           fprintf( stderr, "[%d] Error summing ints with scan (userop2)\n", 
-                    rank );
-           errors++;
-       }
-/*     result = -100;*/
-/*     data = rank;*/
-/*     MPI_Scan ( &data, &result, 1, MPI_INT, op_assoc, comm );*/
-/*     if (result == BAD_ANSWER) {*/
-/*         fprintf( stderr, "[%d] Error scanning with non-commutative op\n",*/
-/*                  rank );*/
-/*         errors++;*/
-/*     }*/
-       MPI_Comm_free( &comm );
-    }
-
-    MPI_Op_free( &op_assoc );
-    MPI_Op_free( &op_addem );
-
-    if (errors) {
-       MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-       printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    }
-
-    Test_Waitforall( );
-    MPI_Finalize();
-    return errors;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/scatterv.c b/teshsuite/smpi/mpich-test/coll/scatterv.c
deleted file mode 100644 (file)
index aefcb2e..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "test.h" 
-
-/* Prototypes for picky compilers */
-void SetData ( double *, double *, int, int, int, int, int, int );
-int CheckData ( double *, int, int, int, int, int );
-/* 
-   This is an example of using scatterv to send a matrix from one
-   process to all others, with the matrix stored in Fortran order.
-   Note the use of an explicit UB to enable the sources to overlap.
-
-   This tests scatterv to make sure that it uses the datatype size
-   and extent correctly.  It requires number of processors that
-   can be split with MPI_Dims_create.
-
- */
-
-void SetData( sendbuf, recvbuf, nx, ny, myrow, mycol, nrow, ncol )
-double *sendbuf, *recvbuf;
-int    nx, ny, myrow, mycol, nrow, ncol;
-{
-int coldim, i, j, m, k;
-double *p;
-
-if (myrow == 0 && mycol == 0) {
-    coldim = nx * nrow;
-    for (j=0; j<ncol; j++) 
-       for (i=0; i<nrow; i++) {
-           p = sendbuf + i * nx + j * (ny * coldim);
-           for (m=0; m<ny; m++) {
-               for (k=0; k<nx; k++) {
-                   p[k] = 1000 * j + 100 * i + m * nx + k;
-                   }
-               p += coldim;
-               }
-           }
-    }
-for (i=0; i<nx*ny; i++) 
-    recvbuf[i] = -1.0;
-}
-
-int CheckData( recvbuf, nx, ny, myrow, mycol, nrow )
-double *recvbuf;
-int    nx, ny, myrow, mycol, nrow;
-{
-int coldim, m, k;
-double *p, val;
-int errs = 0;
-
-coldim = nx;
-p      = recvbuf;
-for (m=0; m<ny; m++) {
-    for (k=0; k<nx; k++) {
-       val = 1000 * mycol + 100 * myrow + m * nx + k;
-       if (p[k] != val) {
-           errs++;
-           if (errs < 10) {
-               printf( 
-                  "Error in (%d,%d) [%d,%d] location, got %f expected %f\n", 
-                       m, k, myrow, mycol, p[k], val );
-               }
-           else if (errs == 10) {
-               printf( "Too many errors; suppressing printing\n" );
-               }
-           }
-       }
-    p += coldim;
-    }
-return errs;
-}
-
-int main( int argc, char **argv )
-{
-    int rank, size, myrow, mycol, nx, ny, stride, cnt, i, j, errs, tot_errs;
-    double    *sendbuf, *recvbuf;
-    MPI_Datatype vec, block, types[2];
-    MPI_Aint displs[2];
-    int      *scdispls;
-    int      blens[2];
-    MPI_Comm comm2d;
-    int dims[2], periods[2], coords[2], lcoords[2];
-    int *sendcounts;
-       
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Get a 2-d decomposition of the processes */
-    dims[0] = 0; dims[1] = 0;
-    MPI_Dims_create( size, 2, dims );
-    periods[0] = 0; periods[1] = 0;
-    MPI_Cart_create( MPI_COMM_WORLD, 2, dims, periods, 0, &comm2d );
-    MPI_Cart_get( comm2d, 2, dims, periods, coords );
-    myrow = coords[0];
-    mycol = coords[1];
-    if (rank == 0) 
-       printf( "Decomposition is [%d x %d]\n", dims[0], dims[1] );
-
-    /* Get the size of the matrix */
-    nx = 10;
-    ny = 8;
-    stride = nx * dims[0];
-
-    recvbuf = (double *)malloc( nx * ny * sizeof(double) );
-    if (!recvbuf) {
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-    sendbuf = 0;
-    if (myrow == 0 && mycol == 0) {
-       sendbuf = (double *)malloc( nx * ny * size * sizeof(double) );
-       if (!sendbuf) {
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-           }
-       }
-    sendcounts = (int *) malloc( size * sizeof(int) );
-    scdispls   = (int *)malloc( size * sizeof(int) );
-
-    MPI_Type_vector( ny, nx, stride, MPI_DOUBLE, &vec );
-    blens[0]  = 1;   blens[1] = 1;
-    types[0]  = vec; types[1] = MPI_UB;
-    displs[0] = 0;   displs[1] = nx * sizeof(double);
-    
-    MPI_Type_struct( 2, blens, displs, types, &block );
-    MPI_Type_free( &vec );
-    MPI_Type_commit( &block );
-
-    /* Set up the transfer */
-    cnt            = 0;
-    for (i=0; i<dims[1]; i++) {
-       for (j=0; j<dims[0]; j++) {
-           sendcounts[cnt] = 1;
-           /* Using Cart_coords makes sure that ranks (used by
-              sendrecv) matches the cartesian coordinates (used to
-              set data in the matrix) */
-           MPI_Cart_coords( comm2d, cnt, 2, lcoords );
-           scdispls[cnt++] = lcoords[0] + lcoords[1] * (dims[0] * ny);
-           }
-       }
-
-    SetData( sendbuf, recvbuf, nx, ny, myrow, mycol, dims[0], dims[1] );
-    MPI_Scatterv( sendbuf, sendcounts, scdispls, block, 
-                 recvbuf, nx * ny, MPI_DOUBLE, 0, comm2d );
-    if((errs = CheckData( recvbuf, nx, ny, myrow, mycol, dims[0] ))) {
-       fprintf( stdout, "Failed to transfer data\n" );
-       }
-    MPI_Allreduce( &errs, &tot_errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-       if (tot_errs == 0)
-           printf( "No errors\n" );
-       else
-           printf( "%d errors in use of MPI_SCATTERV\n", tot_errs );
-       }
-       
-    if (sendbuf) free( sendbuf );
-    free( recvbuf );
-    free( sendcounts );
-    free( scdispls );
-    MPI_Type_free( &block );
-    MPI_Comm_free( &comm2d );
-    MPI_Finalize();
-    return errs;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/coll/scatterv.std b/teshsuite/smpi/mpich-test/coll/scatterv.std
deleted file mode 100644 (file)
index 9abdbae..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*** Scatterv ***
-Decomposition is [2 x 2]
-No errors
-*** Scatterv ***
diff --git a/teshsuite/smpi/mpich-test/coll/shortint.c b/teshsuite/smpi/mpich-test/coll/shortint.c
deleted file mode 100644 (file)
index 02c7dce..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-typedef struct { short a; int b } s1;
-
-main( int argc, char **argv )
-{
-s1 s[10], sout[10];
-int i, rank;
-MPI_Status status;
-
-MPI_Init( &argc, &argv );
-MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-for (i=0; i<10; i++) {
-    s[i].a = rank + i;
-    s[i].b = rank;
-    sout[i].a = -1;
-    sout[i].b = -1;
-    }
-/* MPI_Allreduce( s, sout, 10, MPI_SHORT_INT, MPI_MINLOC, MPI_COMM_WORLD ); */
-/* if (rank == 1) 
-    for (i=0; i<10; i++) 
-       sout[i] = s[i];
- */
-MPI_Reduce( s, sout, 10, MPI_SHORT_INT, MPI_MINLOC, 1, MPI_COMM_WORLD );
-if (rank == 1)
-for (i=0; i<10; i++) {
-    printf( "[%d] (%x,%x)\n", rank, (int)sout[i].a, sout[i].b );
-    }
-if (rank == 1) 
-    MPI_Send( sout, 10, MPI_SHORT_INT, 0, 0, MPI_COMM_WORLD );
-else if (rank == 0)
-    MPI_Recv( sout, 10, MPI_SHORT_INT, 1, 0, MPI_COMM_WORLD, &status );
-/* MPI_Bcast( sout, 10, MPI_SHORT_INT, 1, MPI_COMM_WORLD ); */
-for (i=0; i<10; i++) {
-    printf( "[%d] (%x,%x)\n", rank, (int)sout[i].a, sout[i].b );
-    }
-MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/coll/temprun b/teshsuite/smpi/mpich-test/coll/temprun
deleted file mode 100755 (executable)
index 4bcd93c..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#!/bin/sh
-# This version puts the output from each program into a separate file.
-# -mvhome is needed for the ANL SP, and is ignored by others
-args="-pg -mvhome"
-#
-runtests=1
-makeeach=0
-for arg in "$@" ; do
-    case $arg in 
-       -checkonly )
-       runtests=0
-       ;;
-        -margs=*)
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -small)
-       makeeach=1
-       ;;
-       -help|-u)
-       echo "runtests [-checkonly] [-margs='...']"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "runtests: Unknown argument ($arg)"
-           exit 1
-        fi
-       ;;
-    esac
-done
-
-MakeExe() {
-    if [ $makeeach = 1 -o ! -x $1 ] ; then
-       make $1
-    fi
-}
-CleanExe() {
-    if [ $makeeach = 1 ] ; then
-       /bin/rm -f $1 $1.o
-    fi
-}
-
-# If the programs are not available, run make.
-if [ ! -x coll1 -a $makeeach = 0 ] ; then
-    make 
-fi
-
-testfiles=""
-if [ $runtests = 1 ] ; then
-echo '**** Testing MPI Collective routines ****'
-
-testfiles="$testfiles barrier.out"
-/bin/rm -f barrier.out barrier-0.out
-MakeExe barrier
-echo '*** Barrier Test ***' >> barrier.out
-echo '**** Barrier Test ****'
-mpirun $args -np 4 -mvback "barrier-0.out" barrier $* >> barrier.out
-cat barrier-0.out >> barrier.out
-/bin/rm -f barrier-[01234].out
-echo '*** Barrier Test ***' >> barrier.out
-CleanExe barrier
-
-testfiles="$testfiles bcast.out"
-/bin/rm -f bcast.out bcast-[0-3].out
-MakeExe bcast
-echo '**** Broadcast Test ****'
-echo '*** Broadcast Test ***' >> bcast.out
-mpirun $args -np 4 \
-   -mvback "bcast-0.out bcast-1.out bcast-2.out bcast-3.out" \
-       bcast $* >> bcast.out
-cat bcast-[0123].out >> bcast.out
-/bin/rm -f bcast-[0123].out
-echo '*** Broadcast Test ***' >> bcast.out
-CleanExe bcast
-
-testfiles="$testfiles coll1.out"
-/bin/rm -f coll1.out
-MakeExe coll1
-echo '**** coll1 ****'
-echo '*** coll1 ***' >> coll1.out
-mpirun $args -np 4 coll1 $* >> coll1.out
-echo '*** coll1 ***' >> coll1.out
-CleanExe coll1
-
-testfiles="$testfiles coll2.out"
-/bin/rm -f coll2.out
-MakeExe coll2
-echo '**** coll2 ****'
-echo '*** coll2 ***' >> coll2.out
-# mpirun $args -np 5 coll2 $* >> coll2.out
-echo '*** coll2 ***' >> coll2.out
-CleanExe coll2
-
-testfiles="$testfiles coll3.out"
-/bin/rm -f coll3.out
-MakeExe coll3
-echo '**** coll3 ****'
-echo '*** coll3 ***' >> coll3.out
-mpirun $args -np 5 coll3 $* >> coll3.out
-echo '*** coll3 ***' >> coll3.out
-CleanExe coll3
-
-testfiles="$testfiles coll4.out"
-/bin/rm -f coll4.out
-MakeExe coll4
-echo '**** coll4 ****'
-echo '*** coll4 ***' >> coll4.out
-mpirun $args -np 4 coll4 $* >> coll4.out
-echo '*** coll4 ***' >> coll4.out
-CleanExe coll4
-
-testfiles="$testfiles coll5.out"
-/bin/rm -f coll5.out
-MakeExe coll5
-echo '**** coll5 ****'
-echo '*** coll5 ***' >> coll5.out
-mpirun $args -np 4 coll5 $* >> coll5.out
-echo '*** coll5 ***' >> coll5.out
-CleanExe coll5
-
-testfiles="$testfiles coll6.out"
-/bin/rm -f coll6.out
-MakeExe coll6
-echo '**** coll6 ****'
-echo '*** coll6 ***' >> coll6.out
-mpirun $args -np 5 coll6 $* >> coll6.out
-echo '*** coll6 ***' >> coll6.out
-CleanExe coll6
-
-testfiles="$testfiles coll7.out"
-/bin/rm -f coll7.out
-MakeExe coll7
-echo '**** coll7 ****'
-echo '*** coll7 ***' >> coll7.out
-mpirun $args -np 5 coll7 $* >> coll7.out
-echo '*** coll7 ***' >> coll7.out
-CleanExe coll7
-
-testfiles="$testfiles coll8.out"
-/bin/rm -f coll8.out
-MakeExe coll8
-echo '**** coll8 ****'
-echo '*** coll8 ***' >> coll8.out
-mpirun $args -np 4 coll8 $* >> coll8.out
-echo '*** coll8 ***' >> coll8.out
-CleanExe coll8
-
-testfiles="$testfiles coll9.out"
-/bin/rm -f coll9.out
-MakeExe coll9
-echo '**** coll9 ****'
-echo '*** coll9 ***' >> coll9.out
-mpirun $args -np 4 coll9 $* >>  coll9.out
-echo '*** coll9 ***' >> coll9.out
-CleanExe coll9
-
-testfiles="$testfiles coll10.out"
-/bin/rm -f coll10.out
-MakeExe coll10
-echo '**** coll10 ****'
-echo '*** coll10 ***' >> coll10.out
-mpirun -np 4 $args coll10 $* >> coll10.out
-echo '*** coll10 ***' >> coll10.out
-CleanExe coll10
-
-testfiles="$testfiles coll11.out"
-/bin/rm -f coll11.out
-MakeExe coll11
-echo '**** coll11 ****'
-echo '*** coll11 ***' >> coll11.out
-mpirun -np 4 $args coll11 $* >> coll11.out
-echo '*** coll11 ***' >> coll11.out
-CleanExe coll11
-
-testfiles="$testfiles coll12.out"
-/bin/rm -f coll12.out
-MakeExe coll12
-echo '**** coll12 ****'
-echo '*** coll12 ***' >> coll12.out
-mpirun -np 4 $args coll12 $* >> coll12.out
-echo '*** coll12 ***' >> coll12.out
-CleanExe coll12
-
-testfiles="$testfiles coll13.out"
-/bin/rm -f coll13.out
-MakeExe coll13
-echo '**** coll13 ****'
-echo '*** coll13 ***' >> coll13.out
-mpirun -np 4 $args coll13 $* >> coll13.out
-echo '*** coll13 ***' >> coll13.out
-CleanExe coll13
-
-testfiles="$testfiles grouptest.out"
-/bin/rm -f grouptest.out
-MakeExe grouptest
-echo '*** Grouptest ***'
-echo '*** grouptest ***' >> grouptest.out
-mpirun $args -np 4 grouptest  $* >> grouptest.out
-echo '*** grouptest ***' >> grouptest.out
-CleanExe grouptest
-
-testfiles="$testfiles allred.out"
-/bin/rm -f allred.out
-MakeExe allred
-echo '*** Allred ***'
-echo '*** Allred ***' >> allred.out
-mpirun $args -np 4 allred  $* >> allred.out
-echo '*** Allred ***' >> allred.out
-CleanExe allred
-
-testfiles="$testfiles scatterv.out"
-/bin/rm -f scatterv.out
-MakeExe scatterv
-echo '*** Scatterv ***'
-echo '*** Scatterv ***' >> scatterv.out
-mpirun $args -np 4 scatterv  $* >> scatterv.out
-echo '*** Scatterv ***' >> scatterv.out
-CleanExe scatterv
-
-#
-# Run Fortran tests ONLY if Fortran available
-if [ 1 = 1 ] ; then 
-    echo "FORTRAN TESTS"
-    #
-    testfiles="$testfiles allredf.out"
-    /bin/rm -f allredf.out
-    MakeExe allredf
-    echo '*** Testing allreduce from Fortran ***'
-    echo '*** Testing allreduce from Fortran ***' >> allredf.out
-    mpirun $args -np 4 allredf "$@" >> allredf.out
-    echo '*** Testing allreduce from Fortran ***' >> allredf.out
-    CleanExe allredf
-    #
-    echo "END OF FORTRAN TESTS"
-fi
-
-else
-    # Just run checks
-    testfiles=`echo *.out`
-    if test "$testfiles" = "*.out" ; then
-       echo "No output files remain from previous test!"
-       exit 1
-    fi
-fi
-
-echo '*** Differences from expected output ***'
-/bin/rm -f coll.diff
-for file in $testfiles ; do
-    stdfile=`basename $file .out`.std
-    if [ -s $stdfile ] ; then
-        if diff -b $file `basename $file .out`.std > /dev/null ; then
-           true
-       else
-           echo "Differences in `basename $file .out`" >> coll.diff
-           diff -b $file `basename $file .out`.std >> coll.diff
-       fi
-    else
-        echo "Can not find file $stdfile to compare against for test `basename $file .out`"
-    fi
-done
-if [ -s coll.diff ] ; then
-   cat coll.diff
-fi
-exit 0
diff --git a/teshsuite/smpi/mpich-test/coll/test.c b/teshsuite/smpi/mpich-test/coll/test.c
deleted file mode 100644 (file)
index 5a8d6f2..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Procedures for recording and printing test results */
-
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-#include "mpi.h"
-
-static int tests_passed = 0;
-static int tests_failed = 0;
-static char failed_tests[255][81];
-static char suite_name[255];
-FILE *fileout = NULL;
-
-void Test_Init( const char *suite, int rank)
-{
-    char filename[512];
-
-    sprintf(filename, "%s-%d.out", suite, rank);
-    strncpy(suite_name, suite, 255);
-    fileout = fopen(filename, "w");
-    if (!fileout) {
-       fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-}
-
-void Test_Message( const char *mess)
-{
-    fprintf(fileout, "[%s]: %s\n", suite_name, mess);
-    if(fileout)fflush(fileout);
-}
-
-void Test_Failed(const char *test)
-{
-    fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
-    strncpy(failed_tests[tests_failed], test, 81);
-    if(fileout)fflush(fileout);
-    tests_failed++;
-}
-
-void Test_Passed(const char *test)
-{
-#ifdef VERBOSE
-    fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
-    if(fileout)fflush(fileout);
-#endif
-    tests_passed++;
-}
-
-int Summarize_Test_Results(void)
-{
-#ifdef VERBOSE
-    fprintf(fileout, "For test suite '%s':\n", suite_name);
-#else
-    if (tests_failed > 0)
-#endif
-    {
-       fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n", 
-               tests_passed + tests_failed, tests_passed, tests_failed);
-    }
-    if (tests_failed > 0) {
-       int i;
-
-       fprintf(fileout, "*** Tests Failed:\n");
-       for (i = 0; i < tests_failed; i++)
-           fprintf(fileout, "*** %s\n", failed_tests[i]);
-    }
-    return tests_failed;
-}
-
-void Test_Finalize(void)
-{
-    if(fileout)fflush(fileout);
-    //fclose(fileout);
-}
-
-#include "mpi.h"
-/* Wait for every process to pass through this point.  This test is used
-   to make sure that all processes complete, and that a test "passes" because
-   it executed, not because some process failed.  
- */
-void Test_Waitforall(void)
-{
-    int m, one, myrank, n;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-    MPI_Comm_size( MPI_COMM_WORLD, &n );
-    one = 1;
-    MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-    if (m != n) {
-       printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank, 
-           n, m );
-    }
-    if (myrank == 0) 
-       printf( " No Errors\n" );
-}
diff --git a/teshsuite/smpi/mpich-test/coll/test.h b/teshsuite/smpi/mpich-test/coll/test.h
deleted file mode 100644 (file)
index 7360323..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Header for testing procedures */
-
-#ifndef _INCLUDED_TEST_H_
-#define _INCLUDED_TEST_H_
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Test_Init (const char *, int);
-void Test_Message (const char *);
-void Test_Failed (const char *);
-void Test_Passed (const char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-
-#endif
diff --git a/teshsuite/smpi/mpich-test/context/CMakeLists.txt b/teshsuite/smpi/mpich-test/context/CMakeLists.txt
deleted file mode 100644 (file)
index fe255e0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-
-  if(WIN32)
-    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
-    set(CMAKE_Fortran_LINKER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-  endif()
-  
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  
-  add_executable(attrerr attrerr.c test.c)
- # add_executable(attrt attrt.c test.c)
- # add_executable(commnames commnames.c)
-  add_executable(groupcreate groupcreate.c)
-  add_executable(grouptest_mpich grouptest.c)
-  add_executable(icdup icdup.c)
-  add_executable(ictest ictest.c )
-  add_executable(ictest2 ictest2.c)
-  add_executable(ictest3 ictest3.c)
-  
-  if(SMPI_F2C)
-  #add_executable(attrtest_f attrtest.f)
-  #add_executable(commnames_f commnamesf.f)
-  endif()
-
-  target_link_libraries(attrerr simgrid)
- # target_link_libraries(attrt simgrid)
- # target_link_libraries(commnames simgrid)
-  target_link_libraries(groupcreate simgrid)
-  target_link_libraries(grouptest_mpich simgrid)
-  target_link_libraries(icdup simgrid)
-  target_link_libraries(ictest simgrid)
-  target_link_libraries(ictest2 simgrid)
-  target_link_libraries(ictest3 simgrid)
-
-  if(SMPI_F2C)
-  #target_link_libraries(attrtest_f simgrid f2c)
-  #target_link_libraries(commnames_f simgrid f2c)
-  endif()
-  
-  set_target_properties(attrerr PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
- # set_target_properties(attrt PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
- # set_target_properties(commnames PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(groupcreate PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(grouptest_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(icdup PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(ictest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(ictest2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(ictest3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-   if(SMPI_F2C)
-  #set_target_properties(commnames_f PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}" )
-  #set_target_properties(attrtest_f PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}"  )
-  endif()
-
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.c
- # ${CMAKE_CURRENT_SOURCE_DIR}/attrt.c
- # ${CMAKE_CURRENT_SOURCE_DIR}/commnames.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/groupcreate.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/grouptest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/icdup.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ictest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ictest2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ictest3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrtest.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/commnamesf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.h
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrt.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/context.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/commnames.std
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/smpi/mpich-test/context/attrerr.std b/teshsuite/smpi/mpich-test/context/attrerr.std
deleted file mode 100644 (file)
index 9db5ec9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*** Testing attributes (2) ***
-*** Attribute copy/delete return codes ***
-All processes completed test
-*** Testing attributes (2) ***
diff --git a/teshsuite/smpi/mpich-test/context/attrt.c b/teshsuite/smpi/mpich-test/context/attrt.c
deleted file mode 100644 (file)
index 858db14..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-
-  Exercise communicator routines.
-
-  This C version derived from a Fortran test program from ....
-
- */
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int test_communicators ( void );
-int copy_fn ( MPI_Comm, int, void *, void *, void *, int * );
-int delete_fn ( MPI_Comm, int, void *, void * );
-
-int main( int argc, char **argv )
-{
-    MPI_Init( &argc, &argv );
-    test_communicators();
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
-
-int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
-            void *attribute_val_in, void *attribute_val_out, 
-            int *flag)
-{
-/* Note that if (sizeof(int) < sizeof(void *), just setting the int
-   part of attribute_val_out may leave some dirty bits
- */
-*(MPI_Aint *)attribute_val_out = (MPI_Aint)attribute_val_in;
-*flag = 1;
-return MPI_SUCCESS;
-}
-
-int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
-              void *extra_state)
-{
-int world_rank;
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-if ((MPI_Aint)attribute_val != (MPI_Aint)world_rank) {
-    printf( "incorrect attribute value %d\n", *(int*)attribute_val );
-    MPI_Abort(MPI_COMM_WORLD, 1005 );
-    }
-return MPI_SUCCESS;
-}
-
-int test_communicators( void )
-{
-MPI_Comm dup_comm_world, lo_comm, rev_comm, dup_comm, split_comm, world_comm;
-MPI_Group world_group, lo_group, rev_group;
-void *vvalue;
-int ranges[1][3];
-int flag, world_rank, world_size, rank, size, n, key_1, key_3;
-int color, key, result;
-/*      integer n, ,
-     .        key_2
-
-  */
-MPI_Aint value;
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MPI_Comm_size( MPI_COMM_WORLD, &world_size );
-if (world_rank == 0) {
-    printf( "*** Communicators ***\n" );
-    }
-
-MPI_Comm_dup( MPI_COMM_WORLD, &dup_comm_world );
-
-/*
-     Exercise Comm_create by creating an equivalent to dup_comm_world
-     (sans attributes) and a half-world communicator.
- */
-
-if (world_rank == 0) 
-    printf( "    Comm_create\n" );
-
-MPI_Comm_group( dup_comm_world, &world_group );
-MPI_Comm_create( dup_comm_world, world_group, &world_comm );
-MPI_Comm_rank( world_comm, &rank );
-if (rank != world_rank) {
-    printf( "incorrect rank in world comm: %d\n", rank );
-    MPI_Abort(MPI_COMM_WORLD, 3001 );
-    }
-
-n = world_size / 2;
-
-ranges[0][0] = 0;
-ranges[0][1] = (world_size - n) - 1;
-ranges[0][2] = 1;
-
-MPI_Group_range_incl(world_group, 1, ranges, &lo_group );
-MPI_Comm_create(world_comm, lo_group, &lo_comm );
-MPI_Group_free( &lo_group );
-
-if (world_rank < (world_size - n)) {
-    MPI_Comm_rank(lo_comm, &rank );
-    if (rank == MPI_UNDEFINED) {
-       printf( "incorrect lo group rank: %d\n", rank );
-       MPI_Abort(MPI_COMM_WORLD, 3002 );
-       }
-    else {
-       MPI_Barrier(lo_comm );
-       }
-    }
-else {
-    if (lo_comm != MPI_COMM_NULL) {
-       printf( "incorrect lo comm:\n" );
-       MPI_Abort(MPI_COMM_WORLD, 3003 );
-       }
-    }
-      
-MPI_Barrier(world_comm);
-/*
-     Check Comm_dup by adding attributes to lo_comm & duplicating
- */
-if (world_rank == 0) 
-    printf( "    Comm_dup\n" );
-
-if (lo_comm != MPI_COMM_NULL) {
-    value = 9;
-    MPI_Keyval_create(copy_fn,     delete_fn,   &key_1, &value );
-    value = 8;
-/*     MPI_Keyval_create(MPI_DUP_FN,  MPI_NULL_DELETE_FN,
-                              &key_2, &value );  */
-    value = 7;
-    MPI_Keyval_create(MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
-                               &key_3, &value ); 
-
-    /* This may generate a compilation warning; it is, however, an
-       easy way to cache a value instead of a pointer */
-    MPI_Attr_put(lo_comm, key_1, (void *)world_rank );
-/*         MPI_Attr_put(lo_comm, key_2, world_size ) */
-    MPI_Attr_put(lo_comm, key_3, (void *)0 );
-
-    MPI_Comm_dup(lo_comm, &dup_comm );
-
-    /* Note that if sizeof(int) < sizeof(void *), we can't use
-       (void **)&value to get the value we passed into Attr_put.  To avoid 
-       problems (e.g., alignment errors), we recover the value into 
-       a (void *) and cast to int. Note that this may generate warning
-       messages from the compiler.  */
-    MPI_Attr_get(dup_comm, key_1, (void **)&vvalue, &flag );
-    value = (MPI_Aint)vvalue;
-
-    if (! flag) {
-       printf( "dup_comm key_1 not found on %d\n", world_rank );
-       MPI_Abort(MPI_COMM_WORLD, 3004 );
-       }
-
-    if (value != world_rank) {
-       printf( "dup_comm key_1 value incorrect: %ld\n", (long)value );
-       MPI_Abort(MPI_COMM_WORLD, 3005 );
-       }
-
-/*         MPI_Attr_get(dup_comm, key_2, (int *)&value, &flag ); */
-/*
-        if (! flag) {
-           printf( "dup_comm key_2 not found\n" );
-           MPI_Abort(MPI_COMM_WORLD, 3006 );
-           }
-
-       if (value != world_size) {
-           printf( "dup_comm key_2 value incorrect: %d\n", value );
-           MPI_Abort(MPI_COMM_WORLD, 3007 );
-          }
- */
-    MPI_Attr_get(dup_comm, key_3, (void **)&vvalue, &flag );
-    value = (int)vvalue;
-    if (flag) {
-        printf( "dup_comm key_3 found!\n" );
-       MPI_Abort(MPI_COMM_WORLD, 3008 );
-       }
-    MPI_Keyval_free(&key_1 );
-/* 
-c        MPI_Keyval_free(&key_2 )
- */
-    MPI_Keyval_free(&key_3 );
-    }
-/* 
-     Split the world into even & odd communicators with reversed ranks.
- */
-      if (world_rank == 0) 
-         printf( "    Comm_split\n" );
-
-      color = world_rank % 2;
-      key   = world_size - world_rank;
-
-      MPI_Comm_split(dup_comm_world, color, key, &split_comm );
-      MPI_Comm_size(split_comm, &size );
-      MPI_Comm_rank(split_comm, &rank );
-      if (rank != ((size - world_rank/2) - 1)) {
-         printf( "incorrect split rank: %d\n", rank );
-         MPI_Abort(MPI_COMM_WORLD, 3009 );
-         }
-
-      MPI_Barrier(split_comm );
-/*
-     Test each possible Comm_compare result
- */
-      if (world_rank == 0) 
-         printf( "    Comm_compare\n" );
-
-      MPI_Comm_compare(world_comm, world_comm, &result );
-      if (result != MPI_IDENT) {
-         printf( "incorrect ident result: %d\n", result );
-         MPI_Abort(MPI_COMM_WORLD, 3010 );
-        }
-
-      if (lo_comm != MPI_COMM_NULL) {
-         MPI_Comm_compare(lo_comm, dup_comm, &result );
-         if (result != MPI_CONGRUENT) {
-            printf( "incorrect congruent result: %d\n", result );
-            MPI_Abort(MPI_COMM_WORLD, 3011 );
-           }
-        }
-
-      ranges[0][0] = world_size - 1;
-      ranges[0][1] = 0;
-      ranges[0][2] = -1;
-
-      MPI_Group_range_incl(world_group, 1, ranges, &rev_group );
-      MPI_Comm_create(world_comm, rev_group, &rev_comm );
-      MPI_Comm_compare(world_comm, rev_comm, &result );
-      if (result != MPI_SIMILAR) {
-         printf( "incorrect similar result: %d\n", result );
-         MPI_Abort(MPI_COMM_WORLD, 3012 );
-        }
-
-      if (lo_comm != MPI_COMM_NULL) {
-         MPI_Comm_compare(world_comm, lo_comm, &result );
-         if (result != MPI_UNEQUAL) {
-             printf( "incorrect unequal result: %d\n", result );
-             MPI_Abort(MPI_COMM_WORLD, 3013 );
-             }
-         }
-/*
-     Free all communicators created
- */
-    if (world_rank == 0) 
-       printf( "    Comm_free\n" );
-
-     MPI_Comm_free( &world_comm );
-     MPI_Comm_free( &dup_comm_world );
-
-     MPI_Comm_free( &rev_comm );
-     MPI_Comm_free( &split_comm );
-
-     MPI_Group_free( &world_group );
-     MPI_Group_free( &rev_group );
-
-     if (lo_comm != MPI_COMM_NULL) {
-        MPI_Comm_free( &lo_comm );
-        MPI_Comm_free( &dup_comm );
-       }
-
-     return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/context/attrt.std b/teshsuite/smpi/mpich-test/context/attrt.std
deleted file mode 100644 (file)
index 4693c03..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-*** Testing attributes ***
-*** Communicators ***
-    Comm_create
-    Comm_dup
-    Comm_split
-    Comm_compare
-    Comm_free
-All processes completed test
-*** Testing attributes ***
diff --git a/teshsuite/smpi/mpich-test/context/attrtest.f b/teshsuite/smpi/mpich-test/context/attrtest.f
deleted file mode 100644 (file)
index 6e63bca..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-      PROGRAM MAIN
-
-      include 'mpif.h'
-
-C. Data layout
-C. Number of tests
-      integer PM_GLOBAL_ERROR, PM_NUM_NODES
-      integer PM_MAX_TESTS
-      parameter (PM_MAX_TESTS=3)
-C. Test data
-      integer PM_TEST_INTEGER, fuzzy, Error, FazAttr
-      integer PM_RANK_SELF
-      integer Faz_World, FazTag
-      integer errs
-      parameter (PM_TEST_INTEGER=12345)
-      logical FazFlag
-      external FazCreate, FazDelete
-C
-C. Initialize MPI
-      errs = 0
-      call MPI_INIT(PM_GLOBAL_ERROR)
-
-      PM_GLOBAL_ERROR = MPI_SUCCESS
-C. Find out the number of processes
-      call MPI_COMM_SIZE (MPI_COMM_WORLD,PM_NUM_NODES,PM_GLOBAL_ERROR)
-      call MPI_COMM_RANK (MPI_COMM_WORLD,PM_RANK_SELF,PM_GLOBAL_ERROR)
-
-      
-      call MPI_keyval_create ( FazCreate, FazDelete, FazTag,
-     &                         fuzzy, Error )
-
-C. Make sure that we can get an attribute that hasn't been set yet (flag
-C. is false)
-      call MPI_attr_get (MPI_COMM_WORLD, FazTag, FazAttr, 
-     &                   FazFlag, Error)
-
-      if (FazFlag) then
-         errs = errs + 1
-         print *, 'Did not get flag==false when attr_get of key that'
-         print *, 'had not had a value set with attr_put'
-      endif
-
-      FazAttr = 120
-      call MPI_attr_put (MPI_COMM_WORLD, FazTag, FazAttr, Error)
-
-C. Check that the put worked
-      call MPI_attr_get (MPI_COMM_WORLD, FazTag, FazAttr, 
-     &                   FazFlag, Error)
-
-      if (FazAttr .ne. 120) then
-         errs = errs + 1
-         print 1, ' Proc=',PM_Rank_self, ' ATTR=', FazAttr
-      endif
-C. Duplicate the Communicator and it's cached attributes
-
-      call MPI_Comm_Dup (MPI_COMM_WORLD, Faz_WORLD, Error)
-
-
-      call MPI_Attr_Get ( Faz_WORLD, FazTag, FazAttr, 
-     &                    FazFlag, Error)
-
-      if (FazFlag) then
-        if (FazAttr .ne. 121) then 
-           errs = errs + 1
-           print 1, ' T-Flag, Proc=',PM_Rank_self,' ATTR=', FazAttr
-        endif
-      else
-         errs = errs + 1
-         print 1, ' F-Flag, Proc=',PM_Rank_self,' ATTR=',FazAttr
-      end if
- 1    format( a, i5, a, i5 )
-
-C. Clean up MPI
-      if (PM_Rank_self .eq. 0) then
-         if (errs .eq. 0) then
-            print *, ' No Errors'
-         else
-            print *, ' Found ', errs, ' errors'
-         endif
-      endif
-      call MPI_Comm_free( Faz_WORLD, Error )
-      call MPI_FINALIZE (PM_GLOBAL_ERROR)
-
-      end
-C
-C MPI 1.1 changed these from functions to subroutines.
-C
-      SUBROUTINE FazCreate (comm, keyval, fuzzy, 
-     &                    attr_in, attr_out, flag, ierr )
-      INTEGER comm, keyval, fuzzy, attr_in, attr_out
-      LOGICAL flag
-      include 'mpif.h'
-      attr_out = attr_in + 1
-      flag = .true.
-      ierr = MPI_SUCCESS
-      END
-
-      SUBROUTINE FazDelete (comm, keyval, attr, extra, ierr )
-      INTEGER comm, keyval, attr, extra, ierr
-      include 'mpif.h'
-      ierr = MPI_SUCCESS
-      if (keyval .ne. MPI_KEYVAL_INVALID)then
-         attr = attr -  1
-      end if 
-      END
diff --git a/teshsuite/smpi/mpich-test/context/commnames.c b/teshsuite/smpi/mpich-test/context/commnames.c
deleted file mode 100644 (file)
index e552c23..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Check that we can put names on communicators and get them back.
- */
-
-#include <stdio.h>
-
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-  char commName [MPI_MAX_NAME_STRING+1];
-  int namelen;
-
-  MPI_Init( &argc, &argv );
-  
-  if (MPI_Comm_get_name(MPI_COMM_WORLD, commName, &namelen) != MPI_SUCCESS)
-    {
-      printf("Failed to get a name from COMM_WORLD\n");
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-
-  if (strcmp("MPI_COMM_WORLD", commName))
-    {
-      printf("Name on MPI_COMM_WORLD is \"%s\" should be \"MPI_COMM_WORLD\"\n", commName);
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-  
-  if (namelen != strlen (commName))
-    {
-      printf("Length of name on MPI_COMM_WORLD is %d should be %d\n", 
-            namelen, (int) strlen(commName)); 
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-
-  /* Check that we can replace it */
-  if (MPI_Comm_set_name(MPI_COMM_WORLD,"foobar") != MPI_SUCCESS)
-    {
-      printf("Failed to put a name onto COMM_WORLD\n");
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-
-  if (MPI_Comm_get_name(MPI_COMM_WORLD, commName, &namelen) != MPI_SUCCESS)
-    {
-      printf("Failed to get a name from COMM_WORLD after changing it\n");
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-
-  if (strcmp("foobar", commName))
-    {
-      printf("Name on MPI_COMM_WORLD is \"%s\" should be \"foobar\"\n", 
-            commName );
-      MPI_Abort(MPI_COMM_WORLD, -1);
-    }
-
-  printf("Name tests OK\n");
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/context/commnames.std b/teshsuite/smpi/mpich-test/context/commnames.std
deleted file mode 100644 (file)
index 819a2a6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*** Testing Communicator Names ***
-Name tests OK
-Name tests OK
-*** Testing Communicator Names ***
diff --git a/teshsuite/smpi/mpich-test/context/commnamesf.f b/teshsuite/smpi/mpich-test/context/commnamesf.f
deleted file mode 100644 (file)
index e816a8c..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-C
-C Check the communicator naming functions from Fortran
-C
-
-      include 'mpif.h'
-
-      integer error, namelen
-      integer errcnt, rank
-      character*40 the_name
-      character*40 other_name
-
-      call mpi_init (error)
-      
-      errcnt = 0
-      call xify(the_name)
-
-      call mpi_comm_get_name (MPI_COMM_WORLD, the_name, namelen, error)
-      if (error .ne. mpi_success) then
-         errcnt = errcnt + 1
-         print *,'Failed to get the name from MPI_COMM_WORLD'
-         call MPI_Abort( MPI_COMM_WORLD, 1, error )
-      end if
-
-      if (the_name .ne. 'MPI_COMM_WORLD') then
-         errcnt = errcnt + 1
-         print *,'The name on MPI_COMM_WORLD is not "MPI_COMM_WORLD"'
-         call MPI_Abort( MPI_COMM_WORLD, 1, error )
-      end if
-
-      other_name = 'foobarH'
-      call mpi_comm_set_name(MPI_COMM_WORLD, other_name(1:6), error)
-
-      if (error .ne. mpi_success) then
-         errcnt = errcnt + 1
-         print *,'Failed to put a name onto MPI_COMM_WORLD'
-         call MPI_Abort( MPI_COMM_WORLD, 1, error )
-      end if
-      
-      call xify(the_name)
-
-      call mpi_comm_get_name (MPI_COMM_WORLD, the_name, namelen, error)
-      if (error .ne. mpi_success) then
-         errcnt = errcnt + 1
-         print *,'Failed to get the name from MPI_COMM_WORLD ',
-     $        'after setting it'
-         call MPI_Abort( MPI_COMM_WORLD, 1, error )
-      end if
-
-      if (the_name .ne. 'foobar') then
-         errcnt = errcnt + 1
-         print *,'The name on MPI_COMM_WORLD is not "foobar"'
-         print *, 'Got ', the_name
-         call MPI_Abort( MPI_COMM_WORLD, 1, error )
-      end if
-
-      call mpi_comm_rank( MPI_COMM_WORLD, rank, error )
-      if (errcnt .eq. 0 .and. rank .eq. 0) then
-         print *, ' No Errors'
-      endif
-      call mpi_finalize(error)
-      end
-
-
-      subroutine xify( string )
-      character*(*) string
-
-      integer i
-
-      do i = 1,len(string)
-         string(i:i) = 'X'
-      end do
-
-      end
-
-      
diff --git a/teshsuite/smpi/mpich-test/context/context.std b/teshsuite/smpi/mpich-test/context/context.std
deleted file mode 100644 (file)
index 6ab43a2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-FORTRAN TESTS
-*** attrtest ***
-END OF FORTRAN TESTS
diff --git a/teshsuite/smpi/mpich-test/context/icdup.c b/teshsuite/smpi/mpich-test/context/icdup.c
deleted file mode 100644 (file)
index dff9942..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-/*
- * intended to be run with at least 3 procs
- */
-int main(int argc, char ** argv)
-{
-    MPI_Comm new_intercomm;
-    MPI_Comm new_comm;
-    int my_rank, my_size;
-    int rrank;
-    int procA, procB;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-    MPI_Comm_size( MPI_COMM_WORLD, &my_size );
-
-    if (my_size < 3) {
-       printf( "This test requires at least 3 processes: only %d provided\n",
-               my_size );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-#ifdef DBG
-       printf("%d: Entering main()\n", my_rank); fflush(stdout);
-#endif
-    /* pick one of the following two settings for procA,procB */
-
-       /* uncomment these and program will work */
-       /* procA = 0; procB = 2; */
-
-       /* uncomment these and program will hang */
-       procA = 1; procB = 2;
-    /* The SGI implementation of MPI fails this test */
-    if (my_rank == procA || my_rank == procB)
-    {
-       if (my_rank == procA)
-       {
-           rrank = procB;
-       }
-       else
-       {
-           rrank = procA;
-       }
-#ifdef DBG
-       printf("%d: Calling MPI_Intercomm_create()\n", my_rank); fflush(stdout);
-#endif
-       MPI_Intercomm_create(MPI_COMM_SELF, 0, 
-                           MPI_COMM_WORLD, rrank, 
-                           0, &new_intercomm);
-
-#ifdef DBG
-       printf("%d: Calling MPI_Comm_dup()\n", my_rank); fflush(stdout);
-#endif
-       MPI_Comm_dup(new_intercomm, &new_comm);
-
-       /* Free these new communicators */
-       MPI_Comm_free( &new_comm );
-       MPI_Comm_free( &new_intercomm );
-    }
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (my_rank == 0) {
-       printf( " No Errors\n" );
-    }
-#ifdef DBG
-    printf("%d: Calling MPI_Finalize()\n", my_rank); fflush(stdout);
-#endif
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/context/ictest.c b/teshsuite/smpi/mpich-test/context/ictest.c
deleted file mode 100644 (file)
index cba2522..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/* ictest.c */
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int verbose = 0;
-
-int main( int argc, char **argv )
-{
-  int size, rank, key, his_key, lrank, result;
-  MPI_Comm myComm;
-  MPI_Comm myFirstComm;
-  MPI_Comm mySecondComm;
-  int errors = 0, sum_errors;
-  MPI_Status status;
-  
-  /* Initialization */
-  MPI_Init ( &argc, &argv );
-  MPI_Comm_rank ( MPI_COMM_WORLD, &rank);
-  MPI_Comm_size ( MPI_COMM_WORLD, &size);
-
-  /* Only works for 2 or more processes */
-  if (size >= 2) {
-    MPI_Comm merge1, merge2, merge3, merge4;
-
-    /* Generate membership key in the range [0,1] */
-    key = rank % 2;
-    
-    MPI_Comm_split ( MPI_COMM_WORLD, key, rank, &myComm );
-    /* This creates an intercomm that is the size of comm world 
-       but has processes grouped by even and odd */
-    MPI_Intercomm_create (myComm, 0, MPI_COMM_WORLD, (key+1)%2, 1, 
-                          &myFirstComm );
-    /* Dup an intercomm */
-    MPI_Comm_dup ( myFirstComm, &mySecondComm );
-    MPI_Comm_rank( mySecondComm, &lrank );
-    his_key = -1;
-    
-    /* Leaders communicate with each other */
-    if (lrank == 0) {
-      MPI_Sendrecv (&key,     1, MPI_INT, 0, 0,
-                    &his_key, 1, MPI_INT, 0, 0, mySecondComm, &status);
-      if (key != (his_key+1)%2) {
-         printf( "Received %d but expected %d\n", his_key, (his_key+1)%2 );
-         errors++;
-      }
-    }
-    
-    if (errors)
-      printf("[%d] Failed!\n",rank);
-
-    if (verbose) printf( "About to merge intercommunicators\n" );
-    MPI_Intercomm_merge ( mySecondComm, key, &merge1 );
-    MPI_Intercomm_merge ( mySecondComm, (key+1)%2, &merge2 );
-    MPI_Intercomm_merge ( mySecondComm, 0, &merge3 );
-    MPI_Intercomm_merge ( mySecondComm, 1, &merge4 );
-
-    /* We should check that these are correct!  An easy test is that
-       the merged comms are all MPI_SIMILAR (unless 2 processes used, 
-       in which case MPI_CONGRUENT is ok */
-    MPI_Comm_compare( merge1, MPI_COMM_WORLD, &result );
-    if ((size > 2 && result != MPI_SIMILAR) ||
-       (size == 2 && result != MPI_CONGRUENT)) {
-       errors ++;
-       printf( "merge1 is not the same size as comm world\n" );
-    }
-    /* merge 2 isn't ordered the same way as the others, even for 2 processes */
-    MPI_Comm_compare( merge2, MPI_COMM_WORLD, &result );
-    if (result != MPI_SIMILAR) {
-       errors ++;
-       printf( "merge2 is not the same size as comm world\n" );
-    }
-    MPI_Comm_compare( merge3, MPI_COMM_WORLD, &result );
-    if ((size > 2 && result != MPI_SIMILAR) ||
-       (size == 2 && result != MPI_CONGRUENT)) {
-       errors ++;
-       printf( "merge3 is not the same size as comm world\n" );
-    }
-    MPI_Comm_compare( merge4, MPI_COMM_WORLD, &result );
-    if ((size > 2 && result != MPI_SIMILAR) ||
-       (size == 2 && result != MPI_CONGRUENT)) {
-       errors ++;
-       printf( "merge4 is not the same size as comm world\n" );
-    }
-
-    /* Free communicators */
-    if (verbose) printf( "About to free communicators\n" );
-    MPI_Comm_free( &myComm );
-    MPI_Comm_free( &myFirstComm );
-    MPI_Comm_free( &mySecondComm );
-    MPI_Comm_free( &merge1 );
-    MPI_Comm_free( &merge2 );
-    MPI_Comm_free( &merge3 );
-    MPI_Comm_free( &merge4 );
-  }
-  else {
-      errors ++;
-      printf("[%d] Failed - at least 2 nodes must be used\n",rank);
-  }
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  MPI_Allreduce( &errors, &sum_errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (sum_errors > 0) {
-      printf( "%d errors on process %d\n", errors, rank );
-      }
-  else if (rank == 0) {
-      printf( " No Errors\n" );
-      }
-  /* Finalize and end! */
-
-  MPI_Finalize();
-  return 0;
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/teshsuite/smpi/mpich-test/context/ictest2.c b/teshsuite/smpi/mpich-test/context/ictest2.c
deleted file mode 100644 (file)
index 4b615bc..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/* ictest2.c 
-   This is like ictest.c, but it creates communictors that are valid only
-   at the "leaders"; other members of the local communicator are NOT
-   in the remote communicator.  This is done by creating two communicators:
-   0, + odd rank and even rank.  Only 0 is in in both communicators.
-
-   This test originally tested the part of the standard that allowed the 
-   leader to be in both groups.  This has been disallowed.  This test was
-   recently changed to operate correctly under the new definition.
-
-   Note that it generates unordered printf output, and is not suitable for
-   automated testing.
- */
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-int verbose = 0;
-
-int main( int argc, char **argv )
-{
-  int size, rank, key, lrank, rsize, result, remLeader = 0;
-  MPI_Comm myComm;
-  MPI_Comm myFirstComm;
-  MPI_Comm mySecondComm;
-  MPI_Comm evenComm, oddComm, remComm;
-  int errors = 0, sum_errors;
-  MPI_Status status;
-  
-  /* Initialization */
-  MPI_Init ( &argc, &argv );
-  MPI_Comm_rank ( MPI_COMM_WORLD, &rank);
-  MPI_Comm_size ( MPI_COMM_WORLD, &size);
-
-  /* Only works for 2 or more processes */
-  if (size >= 2) {
-    MPI_Comm merge1, merge2, merge3, merge4;
-
-    /* Generate membership key in the range [0,1] */
-    key = rank % 2;
-    /* Create the even communicator */
-    MPI_Comm_split ( MPI_COMM_WORLD, key, rank, &evenComm );
-    if (key == 1) {
-       /* Odd rank communicator discarded */
-       MPI_Comm_free( &evenComm );
-    }
-    
-    /* Create the odd communicator */
-    MPI_Comm_split ( MPI_COMM_WORLD, key, rank, &oddComm );
-    if (key == 0) {
-       /* Even rank communicator discarded */
-       MPI_Comm_free( &oddComm );
-    }
-
-    /* Create the odd + 0 communicator */
-    if (rank == 0) key = 1;
-    MPI_Comm_split( MPI_COMM_WORLD, key, rank, &remComm );
-    if (key == 0) {
-       /* Even rank communicator discarded */
-       MPI_Comm_free( &remComm );
-    }
-    else {
-       MPI_Comm_rank( remComm, &lrank );
-       if (verbose) {
-           printf( "[%d] lrank in remComm is %d (color = %d, key=%d)\n", 
-                   rank, lrank, rank, key );
-       }
-       remLeader = (lrank == 0) ? 1 : 0;
-    }
-    /* Now, choose the local and remote communicators */
-    if (rank % 2) {
-       /* Odd */
-       myComm  = oddComm;
-    }
-    else {
-       myComm  = evenComm;
-    }
-
-    /* Check that the leader is who we think he is */
-    MPI_Comm_rank( myComm, &lrank );
-    if (verbose) {
-       printf( "[%d] local rank is %d\n", rank, lrank );
-    }
-    if (rank == 0) {
-       int trank;
-       MPI_Comm_rank( myComm, &trank );
-       if (trank != 0) {
-           printf( "[%d] Comm split improperly ordered group (myComm)\n",
-                   rank );
-           fflush(stdout);
-           errors++;
-       }
-       MPI_Comm_rank( remComm, &trank );
-       if (trank != 0) {
-           printf( "[%d] Comm split improperly ordered group (remComm)\n",
-                   rank );
-           fflush(stdout);
-           errors++;
-       }
-    }
-    /* Perform the intercomm create and test it */
-    /* local leader is first process in local_comm, i.e., has rank 0 */
-    /* remote leader is process 0 (if odd) or 1 (if even) in remComm */
-    MPI_Intercomm_create (myComm, 0, remComm, remLeader, 1, &myFirstComm );
-/* temp */
-    if (verbose) {
-       printf( "[%d] through intercom create\n", rank );
-       fflush( stdout );
-    }
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (verbose) {
-       printf( "[%d] through barrier at end of intercom create\n", rank );
-       fflush( stdout );
-    }
-/* temp */
-
-    /* Try to dup this communicator */
-    MPI_Comm_dup ( myFirstComm, &mySecondComm );
-
-/* temp */
-    if (verbose) {
-       printf( "[%d] through comm dup\n", rank );
-       fflush( stdout );
-    }
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (verbose) {
-       printf( "[%d] through barrier at end of comm dup\n", rank );
-       fflush( stdout );
-    }
-/* temp */
-
-    /* Each member shares data with his "partner".  Note that process 0 in
-       MPI_COMM_WORLD is sending to itself, since it is process 0 in both
-       remote groups */
-    MPI_Comm_rank( mySecondComm, &lrank );
-    MPI_Comm_remote_size( mySecondComm, &rsize );
-
-    if (verbose) {
-       printf( "[%d] lrank in secondcomm is %d and remote size is %d\n", 
-               rank, lrank, rsize );
-       fflush( stdout );
-    }
-
-    /* Send key * size + rank in communicator */
-    if (lrank < rsize) {
-      int myval, hisval;
-      key     = rank % 2;
-      myval   = key * size + lrank;
-      hisval  = -1;
-      if (verbose) {
-         printf( "[%d] exchanging %d with %d in intercomm\n", 
-                 rank, myval, lrank );
-         fflush( stdout );
-      }
-      MPI_Sendrecv (&myval,  1, MPI_INT, lrank, 0,
-                    &hisval, 1, MPI_INT, lrank, 0, mySecondComm, &status);
-      if (hisval != (lrank + (!key)*size)) {
-         printf( "[%d] expected %d but got %d\n", rank, lrank + (!key)*size,
-                 hisval );
-         errors++;
-         }
-      }
-    
-    if (errors) {
-       printf("[%d] Failed!\n",rank);
-       fflush(stdout);
-    }
-
-    /* Key is 1 for oddComm, 0 for evenComm (note both contain 0 in WORLD) */
-    MPI_Intercomm_merge ( mySecondComm, key, &merge1 );
-    MPI_Intercomm_merge ( mySecondComm, (key+1)%2, &merge2 );
-    MPI_Intercomm_merge ( mySecondComm, 0, &merge3 );
-    MPI_Intercomm_merge ( mySecondComm, 1, &merge4 );
-
-    MPI_Comm_compare( merge1, MPI_COMM_WORLD, &result );
-    if (result != MPI_SIMILAR && size > 2) {
-       printf( "[%d] comparision with merge1 failed\n", rank );
-       errors++;
-       }
-
-    /* Free communicators */
-    MPI_Comm_free( &myComm );
-    /* remComm may have been freed above */
-    if (remComm != MPI_COMM_NULL) 
-       MPI_Comm_free( &remComm );
-    MPI_Comm_free( &myFirstComm );
-    MPI_Comm_free( &mySecondComm );
-    MPI_Comm_free( &merge1 );
-    MPI_Comm_free( &merge2 );
-    MPI_Comm_free( &merge3 );
-    MPI_Comm_free( &merge4 );
-  }
-  else {
-      printf("[%d] Failed - at least 2 nodes must be used\n",rank);
-  }
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  MPI_Allreduce( &errors, &sum_errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (sum_errors > 0) {
-      printf( "%d errors on process %d\n", errors, rank );
-      }
-  else if (rank == 0) {
-      printf( " No Errors\n" );
-      }
-
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/context/ictest3.c b/teshsuite/smpi/mpich-test/context/ictest3.c
deleted file mode 100644 (file)
index 26b2d97..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/* ictest3.c 
-   This is like ictest2.c, but it creates communictors that are valid only
-   at the "leaders"; other members of the local communicator are NOT
-   in the remote communicator.  A peer communicator is constructed that
-   contains both leaders.
-
-   
- */
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-/* #define DEBUG */
-
-int verbose = 0;
-
-int main( int argc, char **argv )
-{
-  int size, rank, key, lrank, rsize, result;
-  MPI_Comm myFirstComm;
-  MPI_Comm mySecondComm;
-  MPI_Comm newComm, peerComm;
-  MPI_Group rgroup, lgroup, igroup;
-  int errors = 0, sum_errors;
-  int flag;
-  MPI_Status status;
-  
-  /* Initialization */
-  MPI_Init ( &argc, &argv );
-  MPI_Comm_rank ( MPI_COMM_WORLD, &rank);
-  MPI_Comm_size ( MPI_COMM_WORLD, &size);
-
-  /* Only works for 2 or more processes */
-  /* 
-     We create an even and odd communicator, then create an
-     intercommunicator out of them.  For this purpose, we use a 
-     "peer" communicator valid only at one member of each of the odd and
-     even communicators.
-   */
-  if (size >= 2) {
-    MPI_Comm merge1, merge2, merge3, merge4;
-
-    /* Generate membership key in the range [0,1] */
-    key = rank % 2;
-    /* Create the even communicator and odd communicators */
-    MPI_Comm_split ( MPI_COMM_WORLD, key, rank, &newComm );
-
-    MPI_Comm_test_inter( newComm, &flag );
-    if (flag) {
-       errors++;
-       printf( "[%d] got test_inter gave true for intra comm\n", rank );
-       }
-
-    /* Create the "peer" communicator */
-    key = 0;
-    if (rank < 2) key = 1;
-    MPI_Comm_split( MPI_COMM_WORLD, key, rank, &peerComm );
-    if (key == 0) {
-       MPI_Comm_free( &peerComm );
-       }
-#ifdef DEBUG
-    else {
-       MPI_Comm_rank( peerComm, &lrank );
-       printf( "[%d] lrank in peerComm is %d (color = %d, key=%d)\n", 
-               rank, lrank, key, rank );
-       }
-#endif
-
-    /* Check that the leader is who we think he is */
-    MPI_Comm_rank( newComm, &lrank );
-    /* printf( "[%d] local rank is %d\n", rank, lrank );
-    fflush(stdout); */
-    /* Perform the intercomm create and test it */
-    /* Local leader is always the one at rank 0.  */
-    /* If even, the remote leader is rank 1, if odd, the remote leader
-       is rank 0 in the peercomm */
-    MPI_Intercomm_create (newComm, 0, peerComm, !(rank % 2), 1, &myFirstComm );
-#ifdef DEBUG
-    printf( "[%d] through intercom create\n", rank );
-    fflush( stdout );
-    MPI_Barrier( MPI_COMM_WORLD );
-    printf( "[%d] through barrier at end of intercom create\n", rank );
-#endif
-    MPI_Comm_test_inter( myFirstComm, &flag );
-    if (!flag) {
-       errors++;
-       printf( "[%d] got test_inter gave false for inter comm\n", rank );
-       }
-
-    /* Try to dup this communicator */
-    MPI_Comm_dup ( myFirstComm, &mySecondComm );
-    MPI_Comm_test_inter( mySecondComm, &flag );
-    if (!flag) {
-       errors++;
-       printf( "[%d] got test_inter gave false for dup of inter comm\n", 
-               rank );
-       }
-
-#ifdef DEBUG
-    printf( "[%d] through comm dup\n", rank );
-    fflush( stdout );
-    MPI_Barrier( MPI_COMM_WORLD );
-    printf( "[%d] through barrier at end of comm dup\n", rank );
-#endif
-
-    /* Each member shares data with his "partner".  */
-    MPI_Comm_rank( mySecondComm, &lrank );
-    MPI_Comm_remote_size( mySecondComm, &rsize );
-
-#ifdef DEBUG
-    printf( "[%d] lrank in secondcomm is %d and remote size is %d\n", 
-          rank, lrank, rsize );
-    fflush( stdout ); 
-#endif
-
-    /* Check that the remote group is what we think */
-    MPI_Comm_remote_group( mySecondComm, &rgroup );
-    MPI_Comm_group( newComm, &lgroup );
-    MPI_Group_intersection( rgroup, lgroup, &igroup );
-    MPI_Group_compare( igroup, MPI_GROUP_EMPTY, &flag );
-    if (flag != MPI_IDENT) {
-       errors++;
-       printf( "[%d] intersection of remote and local group is not empty\n",
-               rank );
-       }
-    MPI_Group_free( &rgroup );
-    MPI_Group_free( &lgroup );
-    MPI_Group_free( &igroup );
-
-    /* Send key * size + rank in communicator */
-    if (lrank < rsize) {
-      int myval, hisval;
-      key = rank % 2;
-      myval   = key * size + lrank;
-      hisval  = -1;
-#ifdef DEBUG
-      printf( "[%d] exchanging %d with %d in intercomm\n", 
-            rank, myval, lrank );
-      fflush( stdout );
-#endif
-      MPI_Sendrecv (&myval,  1, MPI_INT, lrank, 0, 
-                    &hisval, 1, MPI_INT, lrank, 0, mySecondComm, &status);
-      if (hisval != (lrank + (!key)*size)) {
-         printf( "[%d] expected %d but got %d\n", rank, lrank + (!key)*size,
-                 hisval );
-         errors++;
-         }
-      }
-    
-    if (errors)
-      printf("[%d] Failed!\n",rank);
-
-    /* Key is 1 for oddComm, 0 for evenComm (note both contain 0 in WORLD) */
-#ifdef DEBUG
-    printf( "[%d] starting intercom merge\n", rank );
-    fflush( stdout );
-#endif
-    MPI_Intercomm_merge ( mySecondComm, key, &merge1 );
-    MPI_Intercomm_merge ( mySecondComm, (key+1)%2, &merge2 );
-    MPI_Intercomm_merge ( mySecondComm, 0, &merge3 );
-    MPI_Intercomm_merge ( mySecondComm, 1, &merge4 );
-
-    MPI_Comm_compare( merge1, MPI_COMM_WORLD, &result );
-    if (result != MPI_SIMILAR && size > 2) {
-       printf( "[%d] comparision with merge1 failed\n", rank );
-       errors++;
-       }
-
-    /* Free communicators */
-    if (verbose) printf( "about to free communicators\n" );
-    MPI_Comm_free( &newComm );
-    if (peerComm != MPI_COMM_NULL) MPI_Comm_free( &peerComm );
-    MPI_Comm_free( &myFirstComm );
-    MPI_Comm_free( &mySecondComm );
-    MPI_Comm_free( &merge1 );
-    MPI_Comm_free( &merge2 );
-    MPI_Comm_free( &merge3 );
-    MPI_Comm_free( &merge4 );
-  }
-  else 
-    printf("[%d] Failed - at least 2 nodes must be used\n",rank);
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  MPI_Allreduce( &errors, &sum_errors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (sum_errors > 0) {
-      printf( "%d errors on process %d\n", errors, rank );
-      }
-  else if (rank == 0) {
-      printf( " No Errors\n" );
-      }
-  /* Finalize and end! */
-
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/context/runtests b/teshsuite/smpi/mpich-test/context/runtests
deleted file mode 100755 (executable)
index a71d79c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#! /bin/sh
-#
-# Run some of the tests.  If any arguments are provided, pass them to the
-# test programs.
-#
-# -mvhome is needed for the ANL SP, and is ignored by others
-args=
-device=
-MPICH_VERSION=
-STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
-MAKE="make --no-print-directory"
-
-#
-# Set mpirun to the name/path of the mpirun program
-#FindMPIRUN
-#
-#
-test_mpi2=1
-runtests=1
-quiet=0
-makeeach=0
-have_fortran=0
-writesummaryfile=no
-MAKE="make --no-print-directory"
-for arg in "$@" ; do
-    case $arg in 
-    -basedir=* )
-       basedir=`echo $arg | sed 's/-basedir=//'`
-       ;; 
-    -srcdir=* )
-       srcdir=`echo $arg | sed 's/-srcdir=//'`
-       ;; 
-       -fort=* )
-       have_fortran=`echo $arg | sed 's/-fort=//'`
-       ;;
-       -checkonly )
-       runtests=0
-       ;;
-        -margs=*)
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -summaryfile=*)
-       writesummaryfile=yes
-       summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
-       ;;
-       -small)
-       makeeach=1
-       ;;
-       -quiet)
-       shift
-       quiet=1
-       ;;
-       -help|-u)
-       echo "runtests [-checkonly] [-margs='...']"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "runtests: Unknown argument ($arg)"
-           exit 1
-        fi
-       ;;
-    esac
-done
-
-#
-# Load basic procedures
-. ${srcdir}/../runbase
-
-# If the programs are not available, run make.
-if [ ! -x attrerr -a $makeeach = 0 -a $runtests = 1 ] ; then
-    $MAKE
-fi
-mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
-testfiles=""
-if [ $runtests = 1 ] ; then
-
-#
-# Run Fortran tests ONLY if Fortran available
-#no fortran tests compile with smpi at this time
-#if [ $have_fortran -eq "1" ] ; then 
-#    #RunTest attrtest 2 "*** Testing attributes from Fortran ***"
-
-#    if [ $test_mpi2 = 1 ] ; then
-#       RunTest commnamesf 1 "*** Testing Communicator Names from Fortran ***"
-#    fi
-#fi
-#uses attr, not implemented
-#RunTest attrt 2 "*** Testing attributes ***"
-#fails, uses MPI_Attr_get, et MPI_Attr_put
-#RunTest attrerr 1 "*** Testing attributes (2) ***"
-
-RunTest grouptest_mpich 4 "*** Testing Groups ***"
-
-RunTest groupcreate 4 "*** Testing Group creation ***"
-
-#uses MPI_Intercomm_create
-#RunTest ictest 4 "*** Testing Intercommunicators ***"
-
-RunTest icdup 3 "*** Testing dup of an intercommunicator ***"
-
-#
-# ictest2 relies on a inconsistency in the standard, to wit, that the
-# leader in both groups can be the same process.  This seems to be
-# essential in a dynamic setting, since the only process both groups can
-# access may be the single parent process (other than using client/server
-# intercommunicator creating routines, with the parent providing the common
-# information).
-#
-#testfiles="$testfiles ictest2.out"
-#rm -f ictest2.out
-#MakeExe ictest2
-#echo '*** Testing Intercommunicators (2) ***'
-#echo '*** Testing Intercommunicators (2) ***' >> ictest2.out
-#$mpirun $args -np 4 ictest2 $* >> ictest2.out 2>&1
-#echo '*** Testing Intercommunicators (2) ***' >> ictest2.out
-#CleanExe ictest2
-#uses MPI_Comm_test_inter and MPI_Intercomm_create
-#RunTest ictest3 4 "*** Testing Intercommunicators (3) ***"
-
-#if [ $have_fortran -eq "1" ]  ; then
-#    RunTest commnamesf 2 "*** Testing Communicator Names ***"
-#fi
-#else
-    # Just run checks
-#    testfiles=`echo *.out`
-fi
-
-echo '*** Checking for differences from expected output ***'
-CheckAllOutput context.diff
-exit 0
diff --git a/teshsuite/smpi/mpich-test/context/test.c b/teshsuite/smpi/mpich-test/context/test.c
deleted file mode 100644 (file)
index f276bb6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Procedures for recording and printing test results */
-
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-#include "mpi.h"
-
-static int tests_passed = 0;
-static int tests_failed = 0;
-static char failed_tests[255][81];
-static char suite_name[255];
-FILE *fileout = NULL;
-
-void Test_Init(suite, rank)
-const char *suite;
-int rank;
-{
-    char filename[512];
-
-    sprintf(filename, "%s-%d.out", suite, rank);
-    strncpy(suite_name, suite, 255);
-    fileout = fopen(filename, "w");
-    if (!fileout) {
-       fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-}
-
-void Test_Message(mess)
-const char *mess;
-{
-    fprintf(fileout, "[%s]: %s\n", suite_name, mess);
-    fflush(fileout);
-}
-
-void Test_Failed(test)
-const char *test;
-{
-    fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
-    strncpy(failed_tests[tests_failed], test, 81);
-    fflush(fileout);
-    tests_failed++;
-}
-
-void Test_Passed(test)
-const char *test;
-{
-    fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
-    fflush(fileout);
-    tests_passed++;
-}
-
-int Summarize_Test_Results()
-{
-    fprintf(fileout, "For test suite '%s':\n", suite_name);
-    fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n", 
-           tests_passed + tests_failed, tests_passed, tests_failed);
-    if (tests_failed > 0) {
-       int i;
-
-       fprintf(fileout, "*** Tests Failed:\n");
-       for (i = 0; i < tests_failed; i++)
-           fprintf(fileout, "*** %s\n", failed_tests[i]);
-    }
-    return tests_failed;
-}
-
-void Test_Finalize()
-{
-    fflush(fileout);
-    fclose(fileout);
-}
-
-#include "mpi.h"
-/* Wait for every process to pass through this point.  This test is used
-   to make sure that all processes complete, and that a test "passes" because
-   it executed, not because it some process failed.  
- */
-void Test_Waitforall( )
-{
-int m, one, myrank, n;
-
-MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-MPI_Comm_size( MPI_COMM_WORLD, &n );
-one = 1;
-MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-if (m != n) {
-    printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank, 
-           n, m );
-    }
-if (myrank == 0) 
-    printf( "All processes completed test\n" );
-}
diff --git a/teshsuite/smpi/mpich-test/context/test.h b/teshsuite/smpi/mpich-test/context/test.h
deleted file mode 100644 (file)
index 1eaf6fc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Header for testing procedures */
-
-#ifndef _INCLUDED_TEST_H_
-#define _INCLUDED_TEST_H_
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Test_Init (const char *, int);
-#ifdef USE_STDARG
-void Test_Printf (const char *, ...);
-#else
-/* No prototype */
-void Test_Printf();
-#endif
-void Test_Message (const char *);
-void Test_Failed (const char *);
-void Test_Passed (const char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-
-#endif
diff --git a/teshsuite/smpi/mpich-test/env/CMakeLists.txt b/teshsuite/smpi/mpich-test/env/CMakeLists.txt
deleted file mode 100644 (file)
index 65f9eba..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-  if(WIN32)
-    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
-  endif()
-
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  
-  add_executable(init init.c )
-  add_executable(timers timers.c test.c)
-  add_executable(timertest timertest.c test.c)
-  add_executable(baseattr baseattr.c test.c)
-  add_executable(gtime gtime.c test.c)
-  add_executable(errhand errhand.c test.c)
-  if(NOT WIN32)
-    add_executable(sigchk sigchk.c test.c)
-  endif()
-  add_executable(aborttest aborttest.c)
-  add_executable(testerr testerr.c)
-  add_executable(getproc getproc.c)
-  if(SMPI_F2C)
-#    add_executable(baseattrf baseattrf.f)
-#    add_executable(errhandf errhandf.f)
-#    add_executable(errstringsf errstringsf.f)
-    add_executable(getprocf getprocf.f)
-  endif()
-  target_link_libraries(init simgrid)
-  target_link_libraries(timers simgrid)
-  target_link_libraries(timertest simgrid)
-  target_link_libraries(baseattr simgrid)
-  target_link_libraries(gtime simgrid)
-  target_link_libraries(errhand simgrid)
-  if(NOT WIN32)
-    target_link_libraries(sigchk simgrid)
-  endif()
-       target_link_libraries(aborttest simgrid)
-  target_link_libraries(testerr simgrid)
-  target_link_libraries(getproc simgrid)
-  if(SMPI_F2C)
-#    target_link_libraries(baseattrf simgrid)
-#    target_link_libraries(errhandf simgrid)
-#    target_link_libraries(errstringsf simgrid)
-    target_link_libraries(getprocf simgrid)
-  endif()
-
-  set_target_properties(timers PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(timers PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(timertest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(baseattr PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(gtime PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(errhand PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  if(NOT WIN32)
-    set_target_properties(sigchk PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  endif()
-  set_target_properties(aborttest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(testerr PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(getproc PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  if(SMPI_F2C)
-#    set_target_properties(baseattrf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-#    set_target_properties(errhandf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-#    set_target_properties(errstringsf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(getprocf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  endif()
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/init.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/timers.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/timertest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/baseattr.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/gtime.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/errhand.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sigchk.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/aborttest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testerr.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/getproc.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/baseattrf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/errhandf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/errstringsf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/getprocf.f
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
-  ${CMAKE_CURRENT_SOURCE_DIR}/aborttest.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/errstringsf.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/env.std
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/smpi/mpich-test/env/aborttest.c b/teshsuite/smpi/mpich-test/env/aborttest.c
deleted file mode 100644 (file)
index 244cb9e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "mpi.h"
-/* This  simple test checks that MPI_Abort kills all processes 
- * There are two interesting cases:
- * masternode == 0
- * masternode != 0
- */
-int main( int argc, char **argv )
-{
-  int node, size, i;
-  int masternode = 0;
-
-  MPI_Init(&argc, &argv);
-
-  MPI_Comm_rank(MPI_COMM_WORLD, &node);
-  MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-  /* Check for -altmaster */
-  for (i=1; i<argc; i++) {
-      if (argv[i] && strcmp( "-altmaster", argv[i] ) == 0) {
-         masternode = size-1;
-      }
-  }
-
-  if(node == masternode) {
-    MPI_Abort(MPI_COMM_WORLD, 99);
-  }
-  else {
-    /* barrier will hang since masternode never calls */
-    MPI_Barrier(MPI_COMM_WORLD);
-  }
-
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/env/aborttest.std b/teshsuite/smpi/mpich-test/env/aborttest.std
deleted file mode 100644 (file)
index 1c27d13..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-*** Tests of MPI_Abort ***
-All processes aborted
-*** Tests of MPI_Abort ***
-*** Tests of MPI_Abort (alt) ***
-All processes aborted
-*** Tests of MPI_Abort (alt) ***
diff --git a/teshsuite/smpi/mpich-test/env/argstest.c b/teshsuite/smpi/mpich-test/env/argstest.c
deleted file mode 100644 (file)
index 649977d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-
-int main( int argc, char **argv )
-{
-    int i;
-
-    fprintf(stdout,"Before MPI_Init\n");
-    for (i = 0; i < argc; i++)
-       fprintf(stdout,"arg %d is %s\n", i, argv[i]);
-
-    MPI_Init( &argc, &argv );
-
-    fprintf(stdout,"After MPI_Init\n");
-    for (i = 0; i < argc; i++)
-       fprintf(stdout,"arg %d is %s\n", i, argv[i]);
-
-    MPI_Finalize( );
-}
diff --git a/teshsuite/smpi/mpich-test/env/baseattr.c b/teshsuite/smpi/mpich-test/env/baseattr.c
deleted file mode 100644 (file)
index 9555fb7..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv)
-{
-    int    err = 0;
-    void *v;
-    int  flag;
-    int  vval;
-    int  rank, size;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_TAG_UB, &v, &flag );
-    if (!flag || (vval = *(int*)v)< 32767) {
-       err++;
-       fprintf( stderr, "Could not get TAG_UB or got too-small value\n" );
-    }
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_HOST, &v, &flag );
-    vval = *(int*)v;
-    if (!flag || ((vval < 0 || vval >= size) && vval != MPI_PROC_NULL)) {
-       err++;
-       fprintf( stderr, "Could not get HOST or got invalid value\n" );
-    }
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_IO, &v, &flag );
-    vval = *(int*)v;
-    if (!flag || ((vval < 0 || vval >= size) && vval != MPI_ANY_SOURCE &&
-                 vval != MPI_PROC_NULL)) {
-       err++;
-       fprintf( stderr, "Could not get IO or got invalid value\n" );
-    }
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag );
-    if (flag) {
-       /* Wtime need not be set */
-       vval = *(int*)v;
-       if (vval < 0 || vval > 1) {
-           err++;
-           fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n", 
-                    vval );
-       }
-    }
-    Test_Waitforall( );
-    MPI_Finalize( );
-    
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/env/baseattrf.f b/teshsuite/smpi/mpich-test/env/baseattrf.f
deleted file mode 100644 (file)
index b07935c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-
-      program main
-      integer err, ierr
-      integer v
-      logical  flag
-      integer  rank, size
-      include 'mpif.h'
-
-      err = 0
-      call MPI_Init( ierr )
-      call MPI_Comm_size( MPI_COMM_WORLD, size, ierr )
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      call MPI_Attr_get( MPI_COMM_WORLD, MPI_TAG_UB, v, flag, ierr )
-      if (.not. flag .or. v .lt. 32767) then
-         err = err + 1
-         print *, 'Could not get TAG_UB or got too-small value', v
-      endif
-c
-      call MPI_Attr_get( MPI_COMM_WORLD, MPI_HOST, v, flag, ierr )
-      if (.not. flag .or. ((v .lt. 0 .or. v .ge. size) .and.
-     *                     v .ne. MPI_PROC_NULL)) then
-         err = err + 1
-         print *, 'Could not get HOST or got invalid value', v
-      endif
-c
-      call MPI_Attr_get( MPI_COMM_WORLD, MPI_IO, v, flag, ierr )
-      if (.not. flag .or. (( v .lt. 0 .or. v .gt. size) .and.
-     *                       v .ne. MPI_PROC_NULL .and.
-     *                       v .ne. MPI_ANY_SOURCE)) then
-         err = err + 1
-         print *, 'Could not get IO or got invalid value', v
-      endif
-      call MPI_Finalize( ierr )
-
-      end
diff --git a/teshsuite/smpi/mpich-test/env/cmdline.c b/teshsuite/smpi/mpich-test/env/cmdline.c
deleted file mode 100644 (file)
index 87f62ed..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-/* 
-   This is a test program to see if command line arguments are handled
-   well.  Note that MPI doesn't *require* anything here, so this is 
-   simply used to acess "quality of implementation"
-
-   run with arguments
-       a "b c" "d'e" 'f"g" h'
- */
-int main( int argc, char *argv[] )
-{
-    int i, rank, toterr, err = 0;
-    static char *eargv[5];
-
-    eargv[1] = "a";
-    eargv[2] = "b c";
-    eargv[3] = "d'e";
-    eargv[4] = "f\"g\" h";
-
-    MPI_Init( &argc, &argv );
-    
-    for (i=1; i<=4; i++) {
-       if (!argv[i]) {
-           printf( "Argument %d is null!\n", i );
-           err++;
-       }
-    }
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (toterr) {
-       MPI_Abort( 1, MPI_COMM_WORLD );
-       return 0;
-    }
-
-    /* a "b c" "d'e" 'f"g" h' */
-    for (i=1; i<=4; i++) {
-       if (strcmp( argv[i], eargv[i] ) != 0) {
-           err++;
-           printf( "Found %s but expected %s\n", argv[i], eargv[i] );
-       }
-    }
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    if (rank == 0) {
-       if (toterr) printf( "Found %d errors\n", toterr );
-       else        printf( " No Errors\n" );
-    }
-    
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/env/env.std b/teshsuite/smpi/mpich-test/env/env.std
deleted file mode 100644 (file)
index f421d7c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Timer tests
-Basic attributes test
-Error handling test
-*** Error Handling ***
-    Three error messages (from two errors) are expected
-which should both show an error class of 13
-(first) 13 : Invalid group passed to function
-(errhandler) 13 : Invalid group passed to function
-(second) 13 : Invalid group passed to function
-Signal test
diff --git a/teshsuite/smpi/mpich-test/env/errhand.c b/teshsuite/smpi/mpich-test/env/errhand.c
deleted file mode 100644 (file)
index fe7766c..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int verbose = 0;
-int global_errors = 0;
-int Test_errorhandling (void);
-/* This is complicated by the fact that not all systems correctly 
-   implement stdargs (for the ...) declarations).  MPICH uses USE_STDARG
-   as the choice here, instead of the cases 
- if defined(__STDC__) || defined(__cplusplus) || defined(HAVE_PROTOTYPES) 
- */
-#if defined(USE_STDARG)
-void handler_a( MPI_Comm *, int *, ...);
-void handler_b( MPI_Comm *, int *, ...);
-void error_handler(MPI_Comm *, int *, ...);
-#else
-void handler_a ( MPI_Comm *, int * );
-void handler_b ( MPI_Comm *, int * );
-void error_handler ( MPI_Comm *, int * );
-#endif
-
-/* 
-   Test the error handers (based on a Fortran test program)
- */
-int main( int argc, char **argv )
-{
-    MPI_Init( &argc, &argv );
-
-    Test_errorhandling();
-
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
-
-static int a_errors, b_errors;
-
-int Test_errorhandling( void )
-{
-    char errstring[MPI_MAX_ERROR_STRING];
-    MPI_Comm dup_comm_world, dummy;
-    MPI_Comm tempcomm;
-    MPI_Errhandler errhandler_a, errhandler_b, errhandler, old_handler;
-    int  err, world_rank, class, resultlen;
-
-#ifdef FOO
-    logical test_default, test_abort
-#endif
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-    MPI_Comm_dup( MPI_COMM_WORLD, &dup_comm_world );
-
-    if (world_rank == 0 && verbose) {
-       printf( "*** Error Handling ***\n" );
-    }
-
-/*
-     Exercise save/restore of user error handlers.
- */
-    a_errors = 0;
-    MPI_Errhandler_create(handler_a, &errhandler_a);
-
-    MPI_Errhandler_set(dup_comm_world, errhandler_a);
-    MPI_Errhandler_free(&errhandler_a);
-
-    if (verbose) printf( "create with null group 1\n" );
-    MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    if (a_errors != 1) {
-       Test_Failed( "    error handler A not invoked\n" );
-       global_errors ++;
-    }
-    b_errors = 0;
-    MPI_Errhandler_create(handler_b, &errhandler_b);
-    MPI_Errhandler_get(dup_comm_world, &old_handler);
-    /* The following is needed to preserve an old handler */
-    MPI_Comm_dup( MPI_COMM_SELF, &tempcomm );
-    MPI_Errhandler_set( tempcomm, old_handler );
-    MPI_Errhandler_set(dup_comm_world, errhandler_b);
-    MPI_Errhandler_free(&errhandler_b);
-    if (verbose) printf( "create with null group 2\n" );
-    MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    if (b_errors != 1) {
-       Test_Failed( "    error handler B not invoked\n" );
-       global_errors++;
-    }
-
-    MPI_Errhandler_set(dup_comm_world, old_handler);
-    MPI_Comm_free( &tempcomm );
-    /* MPI_Errhandler_free(&old_handler); */
-    if (verbose) printf( "create with null group 3\n" );
-    MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    if (a_errors != 2) {
-       Test_Failed( "    error handler A not re-invoked\n" );
-       global_errors++;
-    }
-/*
-      Exercise class & string interrogation.
- */
-    MPI_Errhandler_set(dup_comm_world, MPI_ERRORS_ARE_FATAL);
-
-    if (verbose) 
-       printf( "    Three error messages (from two errors) are expected\n\
-which should both show an error class of %d\n", MPI_ERR_GROUP );
-
-    MPI_Errhandler_set(dup_comm_world, MPI_ERRORS_RETURN);
-    if (verbose) printf( "create with null group 4\n" );
-    err = MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    if (err != MPI_SUCCESS) {
-       MPI_Error_class(err, &class);
-       MPI_Error_string(err, errstring, &resultlen);
-       if (verbose)
-           printf( "(first) %d : %s\n", class, errstring );
-       else if (class != MPI_ERR_GROUP) {
-           Test_Failed( "(first) Class is not MPI_ERR_GROUP\n" );
-           global_errors++;
-       }
-    }
-    else {
-       MPI_Comm_free( &dummy );
-       Test_Failed( "Did not detect error when building communicator\n" );
-       global_errors++;
-    }
-    MPI_Errhandler_create(error_handler, &errhandler);
-    MPI_Errhandler_set(dup_comm_world, errhandler);
-    MPI_Errhandler_free(&errhandler);
-    if (verbose) printf( "create with null group 5\n" );
-    err = MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    if (err != MPI_SUCCESS) {
-       MPI_Error_class(err, &class);
-       MPI_Error_string(err, errstring, &resultlen);
-       if (verbose) 
-           printf( "(second) %d : %s\n", class, errstring );
-       else if (class != MPI_ERR_GROUP) {
-           Test_Failed( "(second) class was not MPI_ERR_GROUP" );
-           global_errors++;
-       }
-    }
-    else {
-       MPI_Comm_free( &dummy );
-       Test_Failed( "Did not detect error in building communicator\n" );
-       global_errors++;
-    }
-    MPI_Errhandler_set(dup_comm_world, MPI_ERRORS_ARE_FATAL);
-
-#ifdef FOO
-    if (test_default) {
-       printf("Forcing error for default handler...\n");
-       MPI_Comm_create(dup_comm_world, MPI_GROUP_NULL, &dummy);
-    }
-    if (test_abort) {
-       printf( "Calling MPI_Abort...\n" );
-       MPI_Abort(MPI_COMM_WORLD, 123456768);
-    }
-#endif
-
-    MPI_Comm_free( &dup_comm_world );
-
-#if 0
-    errs = global_errors;
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterrs == 0) 
-           printf( " No Errors\n" );
-       else
-           printf( " Found %d errors\n", toterrs );
-    }
-#endif    
-    return 0;
-}
-
-
-/*
-
-  Trivial error handler.  Note that FORTRAN error handlers can't
-  deal with the varargs stuff the C handlers can.
- */
-#if defined(USE_STDARG)
-void error_handler(MPI_Comm *comm, int *err, ...)
-#else
-void error_handler(MPI_Comm *comm, int *err)
-#endif
-{
-    int class;
-    int resultlen;
-    char string[MPI_MAX_ERROR_STRING];
-    
-    MPI_Error_class(*err, &class);
-    MPI_Error_string(*err, string, &resultlen);
-    if (verbose) 
-       printf( "(errhandler) %d : %s\n", class, string );
-    else {
-       if (class != MPI_ERR_GROUP) {
-           printf( "(errhandler) class = %d, expected %d (MPI_ERR_GROUP)\n",
-                   class, MPI_ERR_GROUP );
-           printf( "   message %s\n", string );
-           global_errors++;
-       }
-    }
-}
-/* 
-  Error handler A, used for save/restore testing.
- */
-
-#if defined(USE_STDARG)
-void handler_a( MPI_Comm *comm, int *err, ...)
-#else
-void handler_a(MPI_Comm *comm, int err)
-#endif
-{
-    int class;
-
-    MPI_Error_class(*err, &class);
-    if (class != MPI_ERR_GROUP) {
-       printf( "handler_a: incorrect error class %d\n", class );
-    }
-    *err = MPI_SUCCESS;
-    a_errors++;
-}
-
-/* 
-  Error handler B, used for save/restore testing.
- */
-
-#if defined(USE_STDARG)
-void handler_b(MPI_Comm *comm, int *err, ...)
-#else
-void handler_b(comm, err)
-MPI_Comm *comm;
-int      *err;
-#endif
-{
-    int class;
-
-    MPI_Error_class(*err, &class);
-    if (class != MPI_ERR_GROUP) {
-       printf( "handler_b: incorrect error class %d\n", class );
-    }
-    *err = MPI_SUCCESS;
-    b_errors++;
-}
diff --git a/teshsuite/smpi/mpich-test/env/errhand2.c b/teshsuite/smpi/mpich-test/env/errhand2.c
deleted file mode 100644 (file)
index 7a9f4b9..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-#ifdef USE_STDARG
-void errfunc( MPI_Comm *, int *, ... );
-#else
-void errfunc( MPI_Comm *, int * );
-#endif
-
-/*
- * Test the reference count semantics of error handlers.
- */
-int main( int argc, char *argv[] )
-{
-    MPI_Errhandler errhandler, olderrhandler;
-    MPI_Comm       newcomm;
-    int            rc, errcnt = 0;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_dup( MPI_COMM_WORLD, &newcomm );
-    MPI_Errhandler_create( errfunc, &errhandler );
-    MPI_Errhandler_set( newcomm, errhandler );
-    /* Once you set it, you should be able to free it */
-    MPI_Errhandler_free( &errhandler );
-    if (errhandler != MPI_ERRHANDLER_NULL) {
-       printf( "Freed errhandler is not set to NULL\n" );
-       errcnt++;
-    }
-    MPI_Errhandler_get( newcomm, &olderrhandler );
-    MPI_Comm_free( &newcomm );
-
-    /* olderrhandler should now be invalid.  Is it? */
-    /* This test is based on an interpretation of the MPI standard that
-       was subsequently overturned.  See the MPI-1.1 errata.  
-       An Errhandler_get is similar to an MPI_Comm_group (having the 
-       effect of creating a copy to the object). */
-    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
-    rc = MPI_Errhandler_set( MPI_COMM_WORLD, olderrhandler );
-    /* In the old interpretation, the test is !rc */
-    if (rc) {
-       printf( "Olderrhandler invalid after get and comm freed!\n" );
-       errcnt ++;
-    }
-
-    if (errcnt) 
-       printf( "Found %d errors!\n", errcnt );
-    else
-       printf( " No Errors\n" );
-
-    MPI_Finalize( );
-    return 0;
-}
-
-#if defined(USE_STDARG)
-void errfunc( MPI_Comm *comm, int *err, ...)
-#else
-void errfunc( MPI_Comm *comm, int *err)
-#endif
-{
-}
diff --git a/teshsuite/smpi/mpich-test/env/errhandf.f b/teshsuite/smpi/mpich-test/env/errhandf.f
deleted file mode 100644 (file)
index ad82413..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-C
-C Test that error handlers can be applied and used through Fortran
-C
-      program main
-
-      include 'mpif.h'
-      integer ierr, errorclass
-      integer buf, errors, request
-C
-      call mpi_init(ierr)
-C 
-C  Try to set the errors-return handler
-C 
-      call mpi_errhandler_set(mpi_comm_world, mpi_errors_return, ierr)
-      errors = 0
-C
-C Activate the handler with a simple case
-C 
-      call mpi_send( buf, 1, MPI_INTEGER, -99, 0, MPI_COMM_WORLD, ierr )
-      if (IERR .eq. MPI_SUCCESS) then
-         errors = errors + 1
-         print *, 'MPI_Send of negative rank did not return error'
-      endif
-C
-C Check for a reasonable error message      
-      call mpi_error_class(ierr, errorclass, err)
-      if (errorclass .ne. MPI_ERR_RANK) then
-         errors = errors + 1
-         print *, 'Error class was not MPI_ERR_RANK, was ', errorclass
-      endif
-C
-C Activate the handler with a simple case
-C 
-      call mpi_irecv( buf, 1, MPI_INTEGER, -100, 2, MPI_COMM_WORLD, 
-     *                request, ierr )
-      if (IERR .eq. MPI_SUCCESS) then
-         errors = errors + 1
-         print *, 'MPI_Irecv of negative rank did not return error'
-      endif
-C
-C Check for a reasonable error message      
-      call mpi_error_class(ierr, errorclass, err)
-      if (errorclass .ne. MPI_ERR_RANK) then
-         errors = errors + 1
-         print *, 'Error class was not MPI_ERR_RANK, was ', errorclass
-      endif
-
-      if (errors .eq. 0) then
-         print *, ' No Errors'
-      else
-         print *, ' Found ', errors, ' errors'
-      endif
-C         
-      call mpi_finalize(ierr)
-C
-      end
diff --git a/teshsuite/smpi/mpich-test/env/errstringsf.f b/teshsuite/smpi/mpich-test/env/errstringsf.f
deleted file mode 100644 (file)
index 2f2167c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-c
-c Check the handling of error strings from Fortran
-c      
-
-      program errstringsf
-
-      include 'mpif.h'
-
-      character*(MPI_MAX_ERROR_STRING) errs
-      integer i, reslen, reserr, ierr
-
-c      
-c     Fill the string with 'x' to check that
-c     blank padding happens correctly.
-c
-      call MPI_Init( ierr )
-      do i = 1,MPI_MAX_ERROR_STRING
-         errs(i:i) = 'x'
-      end do
-
-      call mpi_error_string(mpi_err_buffer, errs, reslen, reserr)
-
-      if (errs(reslen+1:) .ne. ' ') then
-         print *,' Fortran strings are not correctly blank padded'
-         if (errs(reslen+1:reslen+1) .eq. char(0)) then
-c
-c           Very strictly interpreted, an since an error string must be 
-c           MPI_MAX_ERROR_STRING characters long, and the Fortran rules
-c           for such assignements is to blank pad them, there should not
-c           be a null character (C-like) in them.  However, the standard
-c           is ambiguous on this.  
-c
-            print *, ' Fortran strings have bogus null character'
-         end if
-      else
-         print *,' Fortran strings are assigned ok'
-      end if
-
-c     Check that the length was right
-      if (errs(reslen:reslen) .eq. ' ') then
-         print *,' Length of result is wrong'
-      else 
-         print *,' Length of result is correct'
-      end if
-
-      call MPI_Finalize( ierr )
-
-      end
diff --git a/teshsuite/smpi/mpich-test/env/errstringsf.std b/teshsuite/smpi/mpich-test/env/errstringsf.std
deleted file mode 100644 (file)
index 0b9177d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*** Tests of  Fortran error strings ***
- Fortran strings are assigned ok
- Length of result is correct
-*** Tests of  Fortran error strings ***
diff --git a/teshsuite/smpi/mpich-test/env/getproc.c b/teshsuite/smpi/mpich-test/env/getproc.c
deleted file mode 100644 (file)
index 0553323..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Test get processor name
- *
- */
-#include "mpi.h"
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-int main( int argc, char *argv[] )
-{
-    char name[MPI_MAX_PROCESSOR_NAME+10];
-    int  resultlen;
-    int  err = 0;
-
-    MPI_Init( &argc, &argv );
-
-    memset( name, 0xFF, MPI_MAX_PROCESSOR_NAME+10 );
-    resultlen = 0;
-
-    MPI_Get_processor_name( name, &resultlen );
-    /* Test that name has only printing characters */
-    if (resultlen > MPI_MAX_PROCESSOR_NAME || resultlen <= 0) {
-       fprintf( stderr, "resultlen (%d) invalid\n", resultlen );
-       err++;
-    }
-    if (!err) {
-       int i;
-       for (i=0; i<resultlen; i++) {
-           if (!isprint(name[i])) {
-               fprintf( stderr, "Character number %d is not printable\n", i );
-               err++;
-           }
-       }
-       if (name[resultlen]) {
-           fprintf( stderr, "No null at end of name\n" );
-           err++;
-       }
-       for (i=resultlen+1; i<MPI_MAX_PROCESSOR_NAME+10; i++) {
-           unsigned char *usname = (unsigned char*)name;
-           if ((int)(usname[i]) != 0xFF) {
-               fprintf( stderr, "Characters changed at end of name\n" );
-               err++;
-           }
-       }
-    }
-
-    if (err) {
-       printf( " Found %d errors\n", err );
-    }
-    else {
-       printf( " No Errors\n" );
-    }
-       
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/env/getprocf.f b/teshsuite/smpi/mpich-test/env/getprocf.f
deleted file mode 100644 (file)
index e7aaaa9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-      program main
-C
-C Test get processor name
-C
-      include 'mpif.h'
-      character*(MPI_MAX_PROCESSOR_NAME) name
-      integer  resultlen, ierr
-
-      call MPI_Init( ierr )
-      name = " "
-      call MPI_Get_processor_name( name, resultlen, ierr )
-C     Check that name contains only printing characters */
-C      do i=1, resultlen
-C      enddo
-      errs = 0
-      do i=resultlen+2, MPI_MAX_PROCESSOR_NAME
-         if (name(i:i) .ne. " ") then
-            print *, i
-            errs = errs + 1
-         endif
-      enddo
-      if (errs .gt. 0) then
-         print *, 'Non-blanks after name'
-      else
-         print *, ' No Errors'
-      endif
-      call MPI_Finalize( ierr )
-      end
diff --git a/teshsuite/smpi/mpich-test/env/gtime.c b/teshsuite/smpi/mpich-test/env/gtime.c
deleted file mode 100644 (file)
index 4e3d33f..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-#include <math.h>
-
-/* # define MPI_Wtime PMPI_Wtime */
-
-/*
- * This program tests that if MPI_WTIME_IS_GLOBAL is set, the timer
- * IS in fact global.  We have some suspicions about certain vendor systems
- */
-
-int CheckTime( void );
-
-/*
- * Check time tests that the timers are synchronized 
- */
-int CheckTime( void )
-{
-    int        rank, size, i;
-    double     wtick, t1, t2, t3, delta_t;
-    int        ntest=20;
-    MPI_Status status;
-    int        err = 0;
-    double     max_diff = 0.0;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    if (rank == 0) {
-       wtick = MPI_Wtick();
-#ifdef DEBUG
-       printf( "Wtick is %lf\n", wtick );
-#endif
-       while (ntest--) {
-           for (i=1; i<size; i++) {
-               MPI_Send( MPI_BOTTOM, 0, MPI_INT, i, 0, MPI_COMM_WORLD );
-               MPI_Recv( MPI_BOTTOM, 0, MPI_INT, i, 1, MPI_COMM_WORLD, 
-                         &status );
-               t1 = MPI_Wtime();
-               MPI_Send( &t1, 1, MPI_DOUBLE, i, 2, MPI_COMM_WORLD );
-               MPI_Recv( &t2, 1, MPI_DOUBLE, i, 3, MPI_COMM_WORLD, &status );
-               t3 = MPI_Wtime();
-#ifdef DEBUG
-               printf( "Process %d(%f) to 0(%f): diff= %f\n", 
-                       i, 0.5 * (t1 + t3), t2, 0.5*(t1+t3)-t2 );
-#endif
-               delta_t = fabs( 0.5 * (t1 + t3) - t2 );
-               if( delta_t > (t3 - t1 + wtick)) {
-                   err++;
-                   printf( "Process %d has %f; Process 0 has %f\n",
-                           i, t2, 0.5 * (t1 + t3) );
-               }
-               if (delta_t > max_diff) max_diff = delta_t;
-           }
-#ifdef DEBUG       
-           printf( "delta_t = %lf\n", delta_t );
-#endif
-           /* Release all process for the next pass */
-           for (i=1; i<size; i++) {
-               MPI_Send( MPI_BOTTOM, 0, MPI_INT, i, 3, MPI_COMM_WORLD );
-           }
-       }
-    }
-    else {
-       while (ntest--) {
-           MPI_Recv( MPI_BOTTOM, 0, MPI_INT, 0, 0, MPI_COMM_WORLD, &status );
-           MPI_Send( MPI_BOTTOM, 0, MPI_INT, 0, 1, MPI_COMM_WORLD );
-           /* Insure a symmetric transfer */
-           MPI_Recv( &t1, 1, MPI_DOUBLE, 0, 2, MPI_COMM_WORLD, &status );
-           t2 = MPI_Wtime();
-           MPI_Send( &t2, 1, MPI_DOUBLE, 0, 3, MPI_COMM_WORLD );
-           MPI_Recv( MPI_BOTTOM, 0, MPI_INT, 0, 3, MPI_COMM_WORLD, &status );
-       }
-    }
-    return err;
-}
-
-int main( int argc, char **argv )
-{
-    int    err = 0;
-    void *v;
-    int  flag=0;
-    int  vval;
-    int  rank;
-    double t1;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag );
-#ifdef DEBUG
-    if (v) vval = *(int*)v; else vval = 0;
-    printf( "WTIME flag = %d; val = %d\n", flag, vval );
-#endif
-    if (flag) {
-       /* Wtime need not be set */
-       vval = *(int*)v;
-       if (vval < 0 || vval > 1) {
-           err++;
-           fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n", 
-                    vval );
-       }
-    }
-    if (flag && vval) {
-       /* Wtime is global is true.  Check it */
-#ifdef DEBUG
-       printf( "WTIME_IS_GLOBAL\n" );
-#endif 
-       err += CheckTime();
-       
-       /* Wait for 10 seconds */
-       t1 = MPI_Wtime();
-       while (MPI_Wtime() - t1 < 10.0) ;
-       
-       err += CheckTime();
-    }
-    if (rank == 0) {
-       if (err > 0) {
-           printf( "Errors in MPI_WTIME_IS_GLOBAL\n" );
-       }
-       else {
-           printf( " No Errors\n" );
-       }
-    }
-    /* The SGI implementation of MPI sometimes fails to flush stdout 
-       properly.  This fflush will work around that bug.  */
-    /* fflush( stdout ); */
-    MPI_Finalize( );
-    
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/env/hang.c b/teshsuite/smpi/mpich-test/env/hang.c
deleted file mode 100644 (file)
index 36adc16..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-
-#include <stdio.h>
-#include "mpi.h"
-
-int main( int argc, char **args )
-{
-  int mytid;
-    printf("doing mpi_init\n");
-    MPI_Init(&argc,&args);
-
-    MPI_Comm_rank(MPI_COMM_WORLD,&mytid);
-    if (mytid < 2) MPI_Abort( MPI_COMM_WORLD, 1 );
-    MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/env/init.c b/teshsuite/smpi/mpich-test/env/init.c
deleted file mode 100644 (file)
index 477494c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-    int        flag;
-    MPI_Status status;
-    int        size, rank, partner, i;
-
-    for (i=0; i<2; i++ ) {
-       MPI_Initialized(&flag);
-       if(flag == 0)
-           MPI_Init(&argc,&argv);
-    }
-
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    if (size != 2) {
-       printf( "Test must be run with 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    partner = (rank + 1) % size;
-    MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                 MPI_BOTTOM, 0, MPI_INT, partner, 0, 
-                 MPI_COMM_WORLD, &status );
-    if (rank == 0) printf( " No Errors\n" );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/env/runtests b/teshsuite/smpi/mpich-test/env/runtests
deleted file mode 100755 (executable)
index 75a58bf..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-#! /bin/sh
-#
-# Run some of the tests.  If any arguments are provided, pass them to the
-# test programs.
-#
-# -mvhome is needed for the ANL SP, and is ignored by others
-
-device=
-MPICH_VERSION=
-STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
-MAKE="make --no-print-directory"
-
-#
-# Set mpirun to the name/path of the mpirun program
-#FindMPIRUN
-#
-quiet=0
-runtests=1
-makeeach=0
-have_fortran=0
-writesummaryfile=no
-MAKE="make --no-print-directory"
-for arg in "$@" ; do
-    case $arg in 
-    -basedir=* )
-       basedir=`echo $arg | sed 's/-basedir=//'`
-       ;; 
-    -srcdir=* )
-       srcdir=`echo $arg | sed 's/-srcdir=//'`
-       ;; 
-       -fort=* )
-       have_fortran=`echo $arg | sed 's/-fort=//'`
-       ;;
-       -checkonly )
-       runtests=0
-       ;;
-        -margs=*)
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -summaryfile=*)
-       writesummaryfile=yes
-       summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
-       ;;
-       -small)
-       makeeach=1
-       shift
-       ;;
-       -quiet)
-       shift
-       quiet=1
-       ;;
-       -help|-u)
-       echo "runtests [-checkonly] [-margs='...']"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "runtests: Unknown argument ($arg)"
-           exit 1
-        fi
-       ;;
-    esac
-done
-
-mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
-#
-# Load basic procedures
-. ${srcdir}/../runbase
-
-# If the programs are not available, run make.
-if [ ! -x timers -a $makeeach = 0 -a $runtests = 1 ] ; then
-    $MAKE
-fi
-#
-testfiles=""
-if [ $runtests = 1 ] ; then
-
-#RunTest timers 1 "*** Timer tests ***"
-
-RunTest init 2 "*** MPI_Initialized tests ***"
-# uses MPI_Attr_get
-#RunTest baseattr 1 "*** Basic attributes ***"
-
-RunTest gtime 1 "*** WTIME_IS_GLOBAL ***"
-#uses errhandlers
-#RunTest errhand 1 "*** Tests of error handling ***"
-
-#RunTest errhand2 1 "*** Tests of error handling reference counting ***"
-
-# Do not run sigchk by default because it generates warnings that are not
-# errors, and the basic test should be clean
-if [ "$MPICH_TESTS_SIGCHK" = yes ] ; then
-    RunTest sigchk 1 "*** Tests of signals used ***"
-fi
-
-RunTest getproc 1 "*** Test Get Processor Name ***"
-
-#OutTime
-#testfiles="$testfiles cmdline.out"
-#rm -f cmdline.out
-#MakeExe cmdline
-#echo "*** Tests of command line handling ***"
-#echo "*** Tests of command line handling ***" >> cmdline.out
-#$mpirun $args -np 2 ./cmdline a "b c" "d'e" 'f"g" h' $* </dev/null l>> cmdline.out 2>&1
-#echo "*** Tests of command line handling ***" >> cmdline.out
-#CleanExe cmdline
-#if [ ! -s cmdline.stdo ] ; then
-#    cat >cmdline.stdo <<EOF
-#*** Tests of command line handling ***
-# No Errors
-#*** Tests of command line handling ***
-#EOF
-#fi
-
-#
-# If there was a Unix standard interface to ps, we could check for orphaned
-# processes...
-if ps --version | grep procps > /dev/null 2>&1 ; then
-   # This is a try to be a better choice than ps -u because it
-   # restricts the list of processes to those of the current session.
-   # The options are known to work with the ps command from the procps
-   # package.
-   SESSION=`ps -o sess= $$`
-   PSPGM="ps -o pid,tname,command -s $SESSION"
-elif ps -fwu $LOGNAME > /dev/null 2>&1 ; then
-   # This is a better choice than ps aux because it restricts the list of 
-   # processes to those of the running user.  The w is needed on some
-   # systems to get a long output for the command
-   PSPGM="ps -fwu $LOGNAME"
-elif ps -fu $LOGNAME > /dev/null 2>&1 ; then
-   # This is a better choice than ps aux because it restricts the list of 
-   # processes to those of the running user.
-   PSPGM="ps -fu $LOGNAME"
-else
-   PSPGM="ps auxww"
-fi
-OutTime
-testfiles="$testfiles aborttest.out"
-rm -f aborttest.out aborttest.p1 aborttest.p2 aborttest.out2
-MakeExe aborttest
-echo "*** Tests of MPI_Abort ***"
-echo "*** Tests of MPI_Abort ***" >> aborttest.out
-# We also remove lines that look like build lines in case this system
-# is being used for other tests.  This is incomplete, but
-# it may help reduce false positives
-$PSPGM | grep $LOGNAME | grep -v grep | grep -v runtests | \
-    grep -v 'make ' | grep -v ' /ld' | grep -v 'gcc' | \
-    grep -v 'collect2' > aborttest.p1
-# Send the output of aborttest to a file in case there is a problem
-$mpirun $args -np 2 ./aborttest $* < /dev/null >> aborttest.out2 2>&1
-# allow some time for processes to exit
-sleep 5
-$PSPGM | grep $LOGNAME | grep -v grep | grep -v runtests | \
-    grep -v 'make ' | grep -v ' /ld' | grep -v 'gcc' | \
-    grep -v 'collect2' > aborttest.p2
-# If there was a consistant format, we could process it ...
-ndiff="`cat aborttest.p1 | wc -l` - `cat aborttest.p2 | wc -l`"
-ndiff=`expr $ndiff`
-if test "$ndiff" = 0 ; then
-    echo "All processes aborted" >> aborttest.out    
-else
-    echo "Suspicious processes remain" >> aborttest.out
-    #echo "Processes before" >> aborttest.out
-    #cat aborttest.p1 >> aborttest.out
-    #echo "Processes after" >> aborttest.out
-    #cat aborttest.p2 >> aborttest.out
-    echo "Differences are" >> aborttest.out
-    diff -b aborttest.p1 aborttest.p2 >> aborttest.out
-    if [ -s aborttest.out2 ] ; then
-        echo "Output from mpirun was"
-        cat aborttest.out2 >> aborttest.out
-    fi
-    # Try to kill them
-    $PSPGM | grep $LOGNAME | grep aborttest | awk '{ print "kill ", $2 }' | sh
-fi
-echo "*** Tests of MPI_Abort ***" >> aborttest.out
-rm -f aborttest.p1 aborttest.p2 aborttest.out2
-
-OutTime
-rm -f aborttest.p1 aborttest.p2 aborttest.out2
-echo "*** Tests of MPI_Abort (alt) ***"
-echo "*** Tests of MPI_Abort (alt) ***" >> aborttest.out
-$PSPGM | grep $LOGNAME | grep -v grep | grep -v runtests | \
-    grep -v 'make ' | grep -v ' /ld' | grep -v 'gcc' | \
-    grep -v 'collect2' > aborttest.p1
-$mpirun $args -np 2 ./aborttest -altmaster $* >aborttest.out2 2>&1
-sleep 5
-$PSPGM | grep $LOGNAME | grep -v grep | grep -v runtests | \
-    grep -v 'make ' | grep -v ' /ld' | grep -v 'gcc' | \
-    grep -v 'collect2' > aborttest.p2
-ndiff="`cat aborttest.p1 | wc -l` - `cat aborttest.p2 | wc -l`"
-ndiff=`expr $ndiff`
-if test "$ndiff" = 0 ; then
-    echo "All processes aborted" >> aborttest.out    
-else
-    echo "Suspicious processes remain" >> aborttest.out
-    #echo "Processes before" >> aborttest.out
-    #cat aborttest.p1 >> aborttest.out
-    #echo "Processes after" >> aborttest.out
-    #cat aborttest.p2 >> aborttest.out
-    echo "Differences are" >> aborttest.out
-    diff -b aborttest.p1 aborttest.p2 >> aborttest.out
-    if [ -s aborttest.out2 ] ; then
-        echo "Output from mpirun was"
-        cat aborttest.out2 >> aborttest.out
-    fi
-    # Try to kill them
-    $PSPGM | grep $LOGNAME | grep aborttest | awk '{ print "kill ", $2 }' | sh
-fi
-echo "*** Tests of MPI_Abort (alt) ***" >> aborttest.out
-rm -f aborttest.p1 aborttest.p2 aborttest.out2
-CleanExe aborttest
-
-#
-# Run Fortran tests ONLY if Fortran available
-if [ $have_fortran -eq "1" ] ; then 
-
-#    RunTest errstringsf 1 "*** Tests of Fortran error strings ***"
-
-    RunTest getprocf 1 "*** Test MPI_Get_processor_name in Fortran ***"
-
-#    RunTest errhandf 1 "*** Tests of error handling in Fortran ***"
-fi
-
-else
-    # Just run checks
-    testfiles=*.out
-    if test "$testfiles" eq "*.out" ; then
-       echo "No output files remain from previous test!"
-       exit 1
-    fi
-fi
-
-#
-echo '*** Checking for differences from expected output ***'
-CheckAllOutput env.diff
-exit 0
diff --git a/teshsuite/smpi/mpich-test/env/sigchk.c b/teshsuite/smpi/mpich-test/env/sigchk.c
deleted file mode 100644 (file)
index 9294a05..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/* This file provides routines to check for the use of signals by software */
-
-#include <stdio.h>
-#include <signal.h>
-#include "test.h"
-#include "mpi.h"
-
-/* In order to quiet noisy C compilers, we provide ANSI-style prototypes
-   where possible */
-int SYiCheckSig ( FILE *, int, const char * );
-int SYCheckSignals ( FILE * );
-
-#ifdef HAVE_SIGACTION
-int SYiCheckSig( fp, sig, signame )
-FILE *fp;
-int  sig;
-const char *signame;
-{
-static int firstmsg = 1;
-struct sigaction libsig;
-
-sigaction( sig, NULL, &libsig);
-if (libsig.sa_handler != SIG_IGN && libsig.sa_handler != SIG_DFL) {
-    if (firstmsg) {
-       firstmsg = 0;
-       fprintf( fp, "Some signals have been changed.  This is not an error\n\
-but rather is a warning that user programs should not redefine the signals\n\
-listed here\n" );
-       }
-    fprintf( fp, "Signal %s has been changed\n", signame );
-    return 1;
-    }
-return 0;
-}
-#else
-int SYiCheckSig( fp, sig, signame )
-FILE *fp;
-int  sig;
-const char *signame;
-{
-void (*oldsig)();
-static int firstmsg = 1;
-
-oldsig = signal(sig,SIG_IGN);
-if (oldsig != SIG_IGN && oldsig != SIG_DFL) {
-    if (firstmsg) {
-       firstmsg = 0;
-       fprintf( fp, "Some signals have been changed.  This is not an error\n\
-but rather is a warning that user programs should not redefine the signals\n\
-listed here\n" );
-       }
-    fprintf( fp, "Signal %s has been changed\n", signame );
-    return 1;
-    }
-signal(sig,oldsig);
-return 0;
-}
-#endif
-
-int SYCheckSignals( fp )
-FILE *fp;
-{
-int  ndiff = 0;
-
-#ifdef SIGHUP
-ndiff += SYiCheckSig( fp, SIGHUP, "SIGHUP" );
-#endif
-
-#ifdef SIGINT
-ndiff += SYiCheckSig( fp, SIGINT, "SIGINT" );
-#endif
-
-#ifdef SIGQUIT
-ndiff += SYiCheckSig( fp, SIGQUIT, "SIGQUIT" );
-#endif
-
-#ifdef SIGILL
-ndiff += SYiCheckSig( fp, SIGILL, "SIGILL" );
-#endif
-
-#ifdef SIGTRAP
-ndiff += SYiCheckSig( fp, SIGTRAP, "SIGTRAP" );
-#endif
-
-#ifdef SIGIOT
-ndiff += SYiCheckSig( fp, SIGIOT, "SIGIOT" );
-#endif
-
-#ifdef SIGABRT
-ndiff += SYiCheckSig( fp, SIGABRT, "SIGABRT" );
-#endif
-
-#ifdef SIGEMT
-ndiff += SYiCheckSig( fp, SIGEMT, "SIGEMT" );
-#endif
-
-#ifdef SIGFPE
-ndiff += SYiCheckSig( fp, SIGFPE, "SIGFPE" );
-#endif
-
-#ifdef SIGBUS
-ndiff += SYiCheckSig( fp, SIGBUS, "SIGBUS" );
-#endif
-
-#ifdef SIGSEGV
-ndiff += SYiCheckSig( fp, SIGSEGV, "SIGSEGV" );
-#endif
-
-#ifdef SIGSYS
-ndiff += SYiCheckSig( fp, SIGSYS, "SIGSYS" );
-#endif
-
-#ifdef SIGPIPE
-ndiff += SYiCheckSig( fp, SIGPIPE, "SIGPIPE" );
-#endif
-
-#ifdef SIGALRM
-ndiff += SYiCheckSig( fp, SIGALRM, "SIGALRM" );
-#endif
-
-#ifdef SIGTERM
-ndiff += SYiCheckSig( fp, SIGTERM, "SIGTERM" );
-#endif
-
-#ifdef SIGURG
-ndiff += SYiCheckSig( fp, SIGURG, "SIGURG" );
-#endif
-
-#ifdef SIGTSTP
-ndiff += SYiCheckSig( fp, SIGTSTP, "SIGTSTP" );
-#endif
-
-#ifdef SIGCONT
-ndiff += SYiCheckSig( fp, SIGCONT, "SIGCONT" );
-#endif
-
-#ifdef SIGCHLD
-ndiff += SYiCheckSig( fp, SIGCHLD, "SIGCHLD" );
-#endif
-
-#ifdef SIGTTIN
-ndiff += SYiCheckSig( fp, SIGTTIN, "SIGTTIN" );
-#endif
-
-#ifdef SIGTTOU
-ndiff += SYiCheckSig( fp, SIGTTOU, "SIGTTOU" );
-#endif
-
-#ifdef SIGIO
-ndiff += SYiCheckSig( fp, SIGIO, "SIGIO" );
-#endif
-
-#ifdef SIGPOLL
-ndiff += SYiCheckSig( fp, SIGPOLL, "SIGPOLL" );
-#endif
-
-#ifdef SIGXCPU
-ndiff += SYiCheckSig( fp, SIGXCPU, "SIGXCPU" );
-#endif
-
-#ifdef SIGXFSZ
-ndiff += SYiCheckSig( fp, SIGXFSZ, "SIGXFSZ" );
-#endif
-
-#ifdef SIGVTALRM
-ndiff += SYiCheckSig( fp, SIGVTALRM, "SIGVTALRM" );
-#endif
-
-#ifdef SIGPROF
-ndiff += SYiCheckSig( fp, SIGPROF, "SIGPROF" );
-#endif
-
-#ifdef SIGWINCH
-ndiff += SYiCheckSig( fp, SIGWINCH, "SIGWINCH" );
-#endif
-
-#ifdef SIGLOST
-ndiff += SYiCheckSig( fp, SIGLOST, "SIGLOST" );
-#endif
-
-#ifdef SIGUSR1
-ndiff += SYiCheckSig( fp, SIGUSR1, "SIGUSR1" );
-#endif
-
-#ifdef SIGUSR2
-ndiff += SYiCheckSig( fp, SIGUSR2, "SIGUSR2" );
-#endif
-
-return ndiff;
-}
-
-
-int main( int argc, char **argv )
-{
-    int err;
-    MPI_Init( &argc, &argv );
-    err = SYCheckSignals( stdout );
-    Test_Waitforall( );
-    MPI_Finalize();
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/env/test.c b/teshsuite/smpi/mpich-test/env/test.c
deleted file mode 100644 (file)
index e1b8925..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Procedures for recording and printing test results */
-
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-#include "mpi.h"
-
-#if defined(USE_STDARG)
-#include <stdarg.h>
-#endif
-
-static int tests_passed = 0;
-static int tests_failed = 0;
-static char failed_tests[255][81];
-static char suite_name[255];
-FILE *fileout = NULL;
-
-void Test_Init(suite, rank)
-char *suite;
-int rank;
-{
-    char filename[512];
-
-    sprintf(filename, "%s-%d.out", suite, rank);
-    strncpy(suite_name, suite, 255);
-    fileout = fopen(filename, "w");
-    if (!fileout) {
-       fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-}
-
-#ifdef USE_STDARG
-void Test_Printf(char *format, ...)
-{
-    va_list arglist;
-
-    va_start(arglist, format);
-    (void)vfprintf(fileout, format, arglist);
-    va_end(arglist);
-}
-#else
-void Test_Printf(va_alist)
-va_dcl
-{
-    char *format;
-    va_list arglist;
-
-    va_start(arglist);
-    format = va_arg(arglist, char *);
-    (void)vfprintf(fileout, format, arglist);
-    fflush(fileout);
-    va_end(arglist);
-}
-#endif
-
-void Test_Message(mess)
-const char *mess;
-{
-    fprintf(fileout, "[%s]: %s\n", suite_name, mess);
-    fflush(fileout);
-}
-
-void Test_Failed(test)
-const char *test;
-{
-    fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
-    strncpy(failed_tests[tests_failed], test, 81);
-    fflush(fileout);
-    tests_failed++;
-}
-
-void Test_Passed(test)
-const char *test;
-{
-#ifdef VERBOSE
-    fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
-    fflush(fileout);
-#endif
-    tests_passed++;
-}
-
-int Summarize_Test_Results()
-{
-#ifdef VERBOSE
-    fprintf(fileout, "For test suite '%s':\n", suite_name);
-#else
-    if (tests_failed > 0)
-#endif
-    {
-       fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n", 
-               tests_passed + tests_failed, tests_passed, tests_failed);
-    }
-    if (tests_failed > 0) {
-       int i;
-
-       fprintf(fileout, "*** Tests Failed:\n");
-       for (i = 0; i < tests_failed; i++)
-           fprintf(fileout, "*** %s\n", failed_tests[i]);
-    }
-    return tests_failed;
-}
-
-void Test_Finalize()
-{
-    fflush(fileout);
-    fclose(fileout);
-}
-
-#include "mpi.h"
-/* Wait for every process to pass through this point.  This test is used
-   to make sure that all processes complete, and that a test "passes" because
-   it executed, not because it some process failed.  
- */
-void Test_Waitforall( )
-{
-int m, one, myrank, n;
-
-MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-MPI_Comm_size( MPI_COMM_WORLD, &n );
-one = 1;
-MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-if (m != n) {
-    printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank, 
-           n, m );
-    }
-if (myrank == 0) 
-    printf( " No Errors\n" );
-}
diff --git a/teshsuite/smpi/mpich-test/env/test.h b/teshsuite/smpi/mpich-test/env/test.h
deleted file mode 100644 (file)
index 87bcde3..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Header for testing procedures */
-
-#ifndef _INCLUDED_TEST_H_
-#define _INCLUDED_TEST_H_
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Test_Init (char *, int);
-#ifdef USE_STDARG
-void Test_Printf (char *, ...);
-#else
-/* No prototype */
-void Test_Printf();
-#endif
-void Test_Message (const char *);
-void Test_Failed (const char *);
-void Test_Passed (const char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-
-#endif
diff --git a/teshsuite/smpi/mpich-test/env/testerr.c b/teshsuite/smpi/mpich-test/env/testerr.c
deleted file mode 100644 (file)
index fa6ead6..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-/* Test error handling.  This is MPICH specific */
-void Test_Send( void );
-void Test_Recv( void );
-void Test_Datatype( void );
-void Test_Errors_warn( MPI_Comm *comm, int *code, ... );
-void Test_Failed( const char * msg );
-void Test_Passed(const char * msg );
-
-void Test_Errors_warn( MPI_Comm *comm, int *code, ... )
-{  
-  char buf[MPI_MAX_ERROR_STRING+1];
-  int  result_len; 
-  static int in_handler = 0;
-
-  if (in_handler) return;
-  in_handler = 1;
-  /* Convert code to message and print */
-  MPI_Error_string( *code, buf, &result_len );
-  printf( "%s\n", buf );
-  in_handler = 0;
-}  
-
-static int errcount = 0;
-void Test_Failed( const char * msg )
-{
-    printf( "FAILED: %s\n", msg );
-    errcount++;
-}
-void Test_Passed(const char * msg )
-{
-    printf( "Passed: %s\n", msg );
-}
-
-int main( int argc, char *argv[] )
-{
-    MPI_Errhandler TEST_ERRORS_WARN;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Errhandler_create( Test_Errors_warn, &TEST_ERRORS_WARN );
-    MPI_Errhandler_set(MPI_COMM_WORLD, TEST_ERRORS_WARN);
-
-    Test_Send();
-
-    Test_Recv();
-
-    Test_Datatype();
-
-    MPI_Finalize();
-
-    return 0;
-}
-
-void Test_Send( void )
-{
-    int buffer[100];
-    int dest;
-    MPI_Datatype bogus_type = MPI_DATATYPE_NULL;
-    int myrank, size;
-    int large_tag, flag, small_tag;
-    int *tag_ubp;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    dest = size - 1;
-
-    if (MPI_Send(buffer, 20, MPI_INT, dest,
-                1, MPI_COMM_NULL) == MPI_SUCCESS){
-       Test_Failed("NULL Communicator Test");
-    }
-    else
-       Test_Passed("NULL Communicator Test");
-
-    if (MPI_Send(buffer, -1, MPI_INT, dest,
-                1, MPI_COMM_WORLD) == MPI_SUCCESS){
-       Test_Failed("Invalid Count Test");
-    }
-    else
-       Test_Passed("Invalid Count Test");
-
-    if (MPI_Send(buffer, 20, bogus_type, dest,
-                1, MPI_COMM_WORLD) == MPI_SUCCESS){
-       Test_Failed("Invalid Type Test");
-    }
-    else
-       Test_Passed("Invalid Type Test");
-
-    small_tag = -1;
-    if (small_tag == MPI_ANY_TAG) small_tag = -2;
-    if (MPI_Send(buffer, 20, MPI_INT, dest, 
-                small_tag, MPI_COMM_WORLD) == MPI_SUCCESS) {
-        Test_Failed("Invalid Tag Test");
-    }
-    else
-       Test_Passed("Invalid Tag Test");
-
-    /* Form a tag that is too large */
-    MPI_Attr_get( MPI_COMM_WORLD, MPI_TAG_UB, (void **)&tag_ubp, &flag );
-    if (!flag) Test_Failed("Could not get tag ub!" );
-    large_tag = *tag_ubp + 1;
-    if (large_tag > *tag_ubp) {
-       if (MPI_Send(buffer, 20, MPI_INT, dest, 
-                    -1, MPI_COMM_WORLD) == MPI_SUCCESS) {
-           Test_Failed("Invalid Tag Test");
-           }
-       else
-           Test_Passed("Invalid Tag Test");
-       }
-
-    if (MPI_Send(buffer, 20, MPI_INT, 300,
-                1, MPI_COMM_WORLD) == MPI_SUCCESS) {
-       Test_Failed("Invalid Destination Test");
-    }
-    else
-       Test_Passed("Invalid Destination Test");
-
-    if (MPI_Send((void *)0, 10, MPI_INT, dest,
-                1, MPI_COMM_WORLD) == MPI_SUCCESS){
-       Test_Failed("Invalid Buffer Test (send)");
-    }
-    else
-       Test_Passed("Invalid Buffer Test (send)");
-}
-
-void Test_Recv( void )
-{
-}
-
-void Test_Datatype( void )
-{
-}
-    
-#ifdef FOO
-void
-ReceiverTest3()
-{
-    int buffer[20];
-    MPI_Datatype bogus_type = MPI_DATATYPE_NULL;
-    MPI_Status status;
-    int myrank;
-    int *tag_ubp;
-    int large_tag, flag, small_tag;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-
-    if (myrank == 0) {
-       fprintf( stderr, 
-"There should be eight error messages about invalid communicator\n\
-count argument, datatype argument, tag, rank, buffer send and buffer recv\n" );
-       }
-
-    /* A receive test might not fail until it is triggered... */
-    if (MPI_Recv((void *)0, 10, MPI_INT, src,
-                15, MPI_COMM_WORLD, &status) == MPI_SUCCESS){
-       Test_Failed("Invalid Buffer Test (recv)");
-    }
-    else
-       Test_Passed("Invalid Buffer Test (recv)");
-
-    /* Just to keep things happy, see if there is a message to receive */
-    { int flag, ibuf[10];
-
-    MPI_Iprobe( src, 15, MPI_COMM_WORLD, &flag, &status );
-    if (flag) 
-       MPI_Recv( ibuf, 10, MPI_INT, src, 15, MPI_COMM_WORLD, &status );
-    }
-    return;
-#endif
diff --git a/teshsuite/smpi/mpich-test/env/timers.c b/teshsuite/smpi/mpich-test/env/timers.c
deleted file mode 100644 (file)
index 810cbfe..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-#include "test.h"
-#ifdef HAVE_WINDOWS_H
-#define sleep(a_) Sleep((a_)*1000)
-#include <windows.h>
-#endif
-
-int main( int argc, char **argv )
-{
-    int    err = 0;
-    double t1, t2;
-    double tick;
-    int    i;
-
-    MPI_Init( &argc, &argv );
-    t1 = MPI_Wtime();
-    t2 = MPI_Wtime();
-    if (t2 - t1 > 0.1 || t2 - t1 < 0.0) {
-       err++;
-       fprintf( stderr, 
-                "Two successive calls to MPI_Wtime gave strange results: (%f) (%f)\n", 
-                t1, t2 );
-    }
-/* Try several times to get a 1 second sleep */
-    for (i = 0; i<10; i++) {
-       t1 = MPI_Wtime();
-       sleep(1);
-       t2 = MPI_Wtime();
-       if (t2 - t1 >= (1.0 - 0.01) && t2 - t1 <= 5.0) break;
-       if (t2 - t1 > 5.0) i = 9;
-    }
-    if (i == 10) {
-       fprintf( stderr, 
-                "Timer around sleep(1) did not give 1 second; gave %f\n",
-             t2 - t1 );
-       fprintf( stderr, "If the sigchk check shows that SIGALRM is in use, \n\
-this indicates only that user programs must NOT use any system call or\n\
-library that uses SIGALRM.  SIGALRM is not used by MPICH but may be used\n\
-by the software the MPICH uses to implement communication to other \n\
-processes\n" );
-       err++;
-    } 
-    tick = MPI_Wtick();
-    if (tick > 1.0 || tick <= 0.0) {
-       err++;
-       fprintf( stderr, "MPI_Wtick gave a strange result: (%f)\n", tick );
-    }
-    Test_Waitforall( );
-    MPI_Finalize( );
-    
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/env/timertest.c b/teshsuite/smpi/mpich-test/env/timertest.c
deleted file mode 100644 (file)
index 04f49fc..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-#include "test.h"
-#ifdef HAVE_WINDOWS_H
-#define sleep(a_) Sleep((a_)*1000)
-#include <windows.h>
-#endif
-
-int main( int argc, char **argv )
-{
-    double t1, t2;
-    double tick;
-    int    i;
-
-    MPI_Init( &argc, &argv );
-    t1 = MPI_Wtime();
-    t2 = MPI_Wtime();
-    fprintf( stdout, "Two successive calls to MPI_Wtime gave: (%f) (%f)\n", 
-               t1, t2 );
-    fprintf( stdout, "Five approximations to one second:\n");
-    for (i = 0; i < 5; i++)
-    {
-       t1 = MPI_Wtime();
-       sleep(1);
-       t2 = MPI_Wtime();
-       fprintf( stdout, "%f seconds\n", t2 - t1 );
-    } 
-    tick = MPI_Wtick();
-    fprintf( stdout, "MPI_Wtick gave: (%10.8f)\n", tick );
-
-    MPI_Finalize( );
-
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/profile/CMakeLists.txt b/teshsuite/smpi/mpich-test/profile/CMakeLists.txt
deleted file mode 100644 (file)
index 7fae884..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-  if(WIN32)
-    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-  endif()
-
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  
-  add_executable(ptest ptest.c )
-  add_executable(colluses colluses.c )
-
-  target_link_libraries(ptest simgrid)
-  target_link_libraries(colluses simgrid)
-
-  set_target_properties(ptest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(colluses PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/ptest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/colluses.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
-  ${CMAKE_CURRENT_SOURCE_DIR}/ptest.std
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/smpi/mpich-test/profile/colluses.c b/teshsuite/smpi/mpich-test/profile/colluses.c
deleted file mode 100644 (file)
index a76604e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file checks to see if the collective routine MPI_Allreduce uses
- * MPI_Send or MPI_Isend to implement the operation.  It should use either
- * a PMPI routine or a non-MPI routine.  
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-static int used_send = 0,
-           used_isend = 0,
-           used_sendrecv = 0;
-int main( int argc, char *argv[] )
-{
-    int in, out;
-    int rank;
-    int in_sends[3], out_sends[3];
-
-    MPI_Init( &argc, &argv );
-    
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    in = 1;
-    MPI_Allreduce( &in, &out, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-    /* Now, see whether MPI routines were used */
-    in_sends[0] = used_send;
-    in_sends[1] = used_isend;
-    in_sends[2] = used_sendrecv;
-    MPI_Reduce( in_sends, out_sends, 3, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-    if (rank == 0) {
-       int errs = 0;
-       if (in_sends[0] > 0) {
-           printf( " Allreduce used MPI_SEND (%d)\n", in_sends[0] );
-           errs++;
-       }
-       if (in_sends[1] > 0) {
-           printf( " Allreduce used MPI_ISEND (%d)\n", in_sends[1] );
-           errs++;
-       }
-       if (in_sends[2] > 0) {
-           printf( " Allreduce used MPI_SENDRECV (%d)\n", in_sends[2] );
-           errs++;
-       }
-       if (!errs) {
-           printf( " No Errors\n" );
-       }
-    }
-
-    MPI_Finalize( );
-    return 0;
-}
-
-/* 
- * Replacements for MPI_Send, Isend, and Sendrecv that detect their use
- */
-
-int MPI_Send( void *buf, int count, MPI_Datatype datatype, int dest, 
-             int tag, MPI_Comm comm )
-{
-    used_send++;
-    return PMPI_Send( buf, count, datatype, dest, tag, comm );
-}
-
-int MPI_Sendrecv( void *sendbuf, int sendcount, MPI_Datatype sendtype, 
-                 int dest, int sendtag, 
-                  void *recvbuf, int recvcount, MPI_Datatype recvtype, 
-                 int source, int recvtag, MPI_Comm comm, MPI_Status *status )
-{
-    used_sendrecv++;
-    return PMPI_Sendrecv( sendbuf, sendcount, sendtype, dest, sendtag, 
-                         recvbuf, recvcount, recvtype, source, recvtag, 
-                         comm, status ); 
-}
-
-int MPI_Isend( void *buf, int count, MPI_Datatype datatype, int dest, int tag,
-              MPI_Comm comm, MPI_Request *request )
-{
-    used_isend++;
-    return PMPI_Isend( buf, count, datatype, dest, tag, comm, request );
-}
-
diff --git a/teshsuite/smpi/mpich-test/profile/ptest.c b/teshsuite/smpi/mpich-test/profile/ptest.c
deleted file mode 100644 (file)
index 672742c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-
-/* Header for testing procedures */
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- * This tests for the existence of MPI_Pcontrol; nothing more.
- */
-int main( int argc, char **argv )
-{
-    MPI_Init( &argc, &argv );
-    
-    MPI_Pcontrol( 0 );
-    printf( "Pcontrol test passed\n" );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/profile/ptest.std b/teshsuite/smpi/mpich-test/profile/ptest.std
deleted file mode 100644 (file)
index 1c13f91..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Pcontrol test passed
diff --git a/teshsuite/smpi/mpich-test/profile/runtests b/teshsuite/smpi/mpich-test/profile/runtests
deleted file mode 100755 (executable)
index 051cf5f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#! /bin/sh
-#
-# Run some of the tests.  If any arguments are provided, pass them to the
-# test programs.
-#
-# -mvhome is needed for the ANL SP, and is ignored by others
-args=
-device=
-MPICH_VERSION=
-STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
-
-MAKE="make --no-print-directory"
-MPIRUNMVBACK=""
-#
-
-#
-# Set mpirun to the name/path of the mpirun program
-#FindMPIRUN
-#if [ -z "$mpirun" ] ; then
-#    echo "No mpirun in path.  Testing cannot proceed."
-#    exit 1
-#fi
-#
-# If the programs are not available, run make.
-runtests=1
-makeeach=0
-writesummaryfile=no
-quiet=0
-have_fortran=0
-check_at_once=1
-MAKE="make --no-print-directory"
-for arg in "$@" ; do
-    case $arg in 
-    -basedir=* )
-       basedir=`echo $arg | sed 's/-basedir=//'`
-       ;; 
-    -srcdir=* )
-       srcdir=`echo $arg | sed 's/-srcdir=//'`
-       ;; 
-       -fort=* )
-       have_fortran=`echo $arg | sed 's/-fort=//'`
-       ;;
-       -checkonly)
-       runtests=0
-       ;;
-    -margs=*)
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -summaryfile=*)
-       writesummaryfile=yes
-       summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
-       ;;
-       -echo)
-       set -x
-       ;;
-       -small)
-       makeeach=1
-       ;;
-       -quiet)
-       shift
-       quiet=1
-       ;;
-       -atend)
-       check_at_once=0
-       ;;
-       -help|-u)
-       echo "runtests [-checkonly] [-margs='...'] [-atend]"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       echo "If -atend is used, the success of the tests is checked only"
-       echo "at the end of the test rather than also after each test."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "Passing remaining arguments to programs ($*)"
-           break
-        fi
-       ;;
-    esac
-done
-
-
-# Load basic procedures
-. ${srcdir}/../runbase
-
-mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
-# If the programs are not available, run make.
-#if [ ! -x sendrecv -a $makeeach = 0 -a $runtests = 1 ] ; then
-#    $MAKE default
-#fi
-
-testfiles=""
-if [ $runtests = 1 ] ; then
-echo '**** Testing MPI Profiling routines ****'
-#just a test for  MPI_Pcontrol, which is not implemented
-RunTest ptest 1 "**** Testing MPI_Pcontrol ****"
-
-RunTest colluses 4 "**** Testing for PMPI in Allreduce ****"
-
-else
-    # Just run checks
-    testfiles=`echo *.out`
-    if test "$testfiles" = "*.out" ; then
-       echo "No output files remain from previous test!"
-       exit 1
-    fi
-fi
-#
-echo '*** Checking for differences from expected output ***'
-CheckAllOutput profile.diff
-exit 0
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich-test/pt2pt/CMakeLists.txt
deleted file mode 100644 (file)
index 0503262..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
-  if(WIN32)
-    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
-  else()
-    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
-    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
-  endif()
-
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  add_executable(overtake overtake.c test.c)
-  add_executable(bsendtest bsendtest.c test.c)
-  add_executable(relrank relrank.c test.c)
-  add_executable(sendrecv_mpich sendrecv.c test.c)
-  add_executable(persistent persistent.c)
-  add_executable(flood flood.c test.c)
-  add_executable(flood2 flood2.c test.c)
-  add_executable(persist persist.c)
-  add_executable(persist2 persist2.c)
-  add_executable(sendrecv2 sendrecv2.c dtypes.c gcomm.c)
-  add_executable(sendrecv3 sendrecv3.c dtypes.c gcomm.c)
-  add_executable(sendrecv4 sendrecv4.c dtypes.c gcomm.c)
-  add_executable(irsend irsend.c dtypes.c gcomm.c)
-  add_executable(irsendinit irsendinit.c dtypes.c gcomm.c)
-  add_executable(longmsgs longmsgs.c)
-  add_executable(testsome testsome.c dtypes.c gcomm.c)
-  add_executable(testall_mpich testall.c dtypes.c gcomm.c)
-  add_executable(sndrcv sndrcv.c dtypes.c gcomm.c)
-  add_executable(sndrcvrep sndrcvrep.c)
-  add_executable(sndrcvrpl2 sndrcvrpl2.c)
-  add_executable(getelm getelm.c )
-  add_executable(self self.c test.c)
-  add_executable(typelb typelb.c test.c)
-  add_executable(structlb structlb.c test.c)
-  add_executable(typeub typeub.c test.c)
-  add_executable(typeub2 typeub2.c)
-  add_executable(typeub3 typeub3.c)
-  add_executable(typecreate typecreate.c)
-  add_executable(reqcreate reqcreate.c)
-  add_executable(reqfree reqfree.c)
-  add_executable(isndrcv isndrcv.c test.c)
-  add_executable(nullproc nullproc.c)
-  add_executable(nullproc2 nullproc2.c)
-  add_executable(trunc trunc.c)
-  add_executable(truncmult truncmult.c)
-  add_executable(typetest typetest.c test.c)
-  add_executable(typebase typebase.c)
-  add_executable(ssendtest ssendtest.c test.c)
-  add_executable(ssendtest2 ssendtest2.c)
-  add_executable(issendtest issendtest.c test.c)
-  add_executable(issend2 issend2.c)
-  add_executable(issendinit issendinit.c test.c)
-  add_executable(testtypes testtypes.c test.c)
-  add_executable(dataalign dataalign.c)
-  add_executable(dtyperecv dtyperecv.c)
-  add_executable(dtypelife dtypelife.c test.c)
-  add_executable(htmsg htmsg.c)
-  add_executable(isendtest isendtest.c)
-  add_executable(third third.c test.c)
-  add_executable(fourth fourth.c test.c)
-  add_executable(fifth fifth.c test.c)
-  add_executable(sixth sixth.c test.c)
-  add_executable(probe probe.c test.c)
-  add_executable(nblock nblock.c )
-  add_executable(sendmany sendmany.c) 
-  add_executable(order order.c)
-  add_executable(pack pack.c)
-  add_executable(probe1 probe1.c test.c)
-  add_executable(testtest1 testtest1.c test.c) 
-  add_executable(hvectest hvectest.c test.c)
-  add_executable(hvectest2 hvectest2.c test.c)
-  add_executable(hvec hvec.c)
-  add_executable(hindexed hindexed.c) 
-  add_executable(irecvtest irecvtest.c test.c)
-  add_executable(nbtest nbtest.c)
-  add_executable(waitany waitany.c)
-  add_executable(waitall waitall.c)
-  add_executable(waitall2 waitall2.c)
-  add_executable(waitall3 waitall3.c)
-  add_executable(waitall4 waitall4.c)
-  add_executable(commit commit.c)
-  add_executable(cancel cancel.c)
-  add_executable(cancel2 cancel2.c)
-  add_executable(cancel3 cancel3.c)
-  add_executable(cancelmessages cancelmessages.c)
-  add_executable(cancelibm cancelibm.c)
-  add_executable(cancelissend cancelissend.c)
-  add_executable(sendorder sendorder.c)
-  add_executable(exittest exittest.c)
-  add_executable(selfvsworld selfvsworld.c)
-  if(SMPI_F2C)
-    add_executable(secondf secondf.f)
-#    add_executable(allpair2 allpair2.f)
-#    add_executable(allpair allpair.f)
-    add_executable(isendf isendf.f)
-    add_executable(pingpong_f pingpong.f)
-    add_executable(send1 send1.f)
-    add_executable(sendcplx sendcplx.f)
-    add_executable(sendfort sendfort.f)
-#    add_executable(structf structf.f)
-    add_executable(typebasef typebasef.f)
-  endif()
-
-  target_link_libraries(overtake simgrid)
-  target_link_libraries(bsendtest simgrid)
-  target_link_libraries(relrank simgrid)
-  target_link_libraries(sendrecv_mpich simgrid)
-  target_link_libraries(persistent simgrid)
-  target_link_libraries(flood simgrid)
-  target_link_libraries(flood2 simgrid)
-  target_link_libraries(persist simgrid)
-  target_link_libraries(persist2 simgrid)
-  target_link_libraries(sendrecv2 simgrid)
-  target_link_libraries(sendrecv3 simgrid)
-  target_link_libraries(sendrecv4 simgrid)
-  target_link_libraries(irsend simgrid)
-  target_link_libraries(irsendinit simgrid)
-  target_link_libraries(longmsgs simgrid)
-  target_link_libraries(testsome simgrid)
-  target_link_libraries(testall_mpich simgrid)
-  target_link_libraries(sndrcv simgrid)
-  target_link_libraries(sndrcvrep simgrid)
-  target_link_libraries(sndrcvrpl2 simgrid)
-  target_link_libraries(getelm simgrid)
-  target_link_libraries(self simgrid)
-  target_link_libraries(typelb simgrid)
-  target_link_libraries(structlb simgrid)
-  target_link_libraries(typeub simgrid)
-  target_link_libraries(typeub2 simgrid)
-  target_link_libraries(typeub3 simgrid)
-  target_link_libraries(typecreate simgrid)
-  target_link_libraries(reqcreate simgrid)
-  target_link_libraries(reqfree simgrid)
-  target_link_libraries(isndrcv simgrid)
-  target_link_libraries(nullproc simgrid)
-  target_link_libraries(nullproc2 simgrid)
-  target_link_libraries(trunc simgrid)
-  target_link_libraries(truncmult simgrid)
-  target_link_libraries(typetest simgrid)
-  target_link_libraries(typebase simgrid)
-  target_link_libraries(ssendtest simgrid)
-  target_link_libraries(ssendtest2 simgrid)
-  target_link_libraries(issendtest simgrid)
-  target_link_libraries(issend2 simgrid)
-  target_link_libraries(issendinit simgrid)
-  target_link_libraries(testtypes simgrid)
-  target_link_libraries(dataalign simgrid)
-  target_link_libraries(dtyperecv simgrid)
-  target_link_libraries(dtypelife simgrid)
-  target_link_libraries(htmsg simgrid)
-  target_link_libraries(isendtest simgrid)
-  target_link_libraries(third simgrid)
-  target_link_libraries(fourth simgrid)
-  target_link_libraries(fifth simgrid)
-  target_link_libraries(sixth simgrid)
-  target_link_libraries(probe simgrid)
-  target_link_libraries(nblock simgrid)
-  target_link_libraries(sendmany simgrid)
-  target_link_libraries(order simgrid)
-  target_link_libraries(pack simgrid)
-  target_link_libraries(probe1 simgrid)
-  target_link_libraries(testtest1  simgrid)
-  target_link_libraries(hvectest simgrid)
-  target_link_libraries(hvectest2 simgrid)
-  target_link_libraries(hvec simgrid)
-  target_link_libraries(hindexed simgrid)
-  target_link_libraries(irecvtest simgrid)
-  target_link_libraries(nbtest simgrid)
-  target_link_libraries(waitany simgrid)
-  target_link_libraries(waitall simgrid)
-  target_link_libraries(waitall2 simgrid)
-  target_link_libraries(waitall3 simgrid)
-  target_link_libraries(waitall4 simgrid)
-  target_link_libraries(commit simgrid)
-  target_link_libraries(cancel simgrid)
-  target_link_libraries(cancel2 simgrid)
-  target_link_libraries(cancel3 simgrid)
-  target_link_libraries(cancelmessages simgrid)
-  target_link_libraries(cancelibm simgrid)
-  target_link_libraries(cancelissend simgrid)
-  target_link_libraries(sendorder simgrid)
-  target_link_libraries(exittest simgrid)
-  target_link_libraries(selfvsworld simgrid)
-  if(SMPI_F2C)
-    target_link_libraries(secondf simgrid f2c)
-#    target_link_libraries(allpair2 simgrid f2c)
-#    target_link_libraries(allpair simgrid f2c)
-    target_link_libraries(isendf simgrid f2c)
-    target_link_libraries(pingpong_f simgrid f2c)
-    target_link_libraries(send1 simgrid f2c)
-    target_link_libraries(sendcplx simgrid f2c)
-    target_link_libraries(sendfort simgrid f2c)
-#    target_link_libraries(structf simgrid f2c)
-    target_link_libraries(typebasef simgrid f2c)
-  endif()
-
-  set_target_properties(overtake PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(bsendtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(relrank PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendrecv_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(persistent PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(flood PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(flood2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(persist PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(persist2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendrecv2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendrecv3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendrecv4 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(irsend PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(irsendinit PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(longmsgs PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(testsome PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(testall_mpich PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sndrcv PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sndrcvrep PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sndrcvrpl2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(getelm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(self PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typelb PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(structlb PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typeub PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typeub2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typeub3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typecreate PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(reqcreate PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(reqfree PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(isndrcv PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(nullproc PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(nullproc2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(trunc PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(truncmult PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typetest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(typebase PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(ssendtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(ssendtest2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(issendtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(issend2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(issendinit PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(testtypes PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(dataalign PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(dtyperecv PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(dtypelife PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(htmsg PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(isendtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(third PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(fourth PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(fifth PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sixth PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(probe PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(nblock PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendmany PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(order PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(pack PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(probe1 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(testtest1  PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(hvectest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(hvectest2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(hvec PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(hindexed PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(irecvtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(nbtest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(waitany PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(waitall PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(waitall2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(waitall3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(waitall4 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(commit PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancel PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancel2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancel3 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancelmessages PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancelibm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(cancelissend PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(sendorder PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(exittest PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(selfvsworld PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  if(SMPI_F2C)
-    set_target_properties(secondf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-#    set_target_properties(allpair2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-#    set_target_properties(allpair PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(isendf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(pingpong_f PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(send1 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(sendcplx PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(sendfort PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-#    set_target_properties(structf PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-    set_target_properties(typebasef PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  endif()
-endif()
-
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/gcomm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/gcomm.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/dtypes.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/dtypes.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/overtake.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/bsendtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/relrank.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/persistent.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/flood.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/flood2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/persist.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/persist2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv4.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/irsend.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/irsendinit.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/longmsgs.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testsome.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testall.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sndrcv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sndrcvrep.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sndrcvrpl2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/getelm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/self.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typelb.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/structlb.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typeub.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typeub2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typeub3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typecreate.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/reqcreate.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/reqfree.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/isndrcv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/nullproc.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/nullproc2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/trunc.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/truncmult.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typetest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/typebase.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ssendtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/ssendtest2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/issendtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/issend2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/issendinit.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testtypes.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/dataalign.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/dtyperecv.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/dtypelife.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/htmsg.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/isendtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/third.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/fourth.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/fifth.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sixth.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/probe.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/nblock.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendmany.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/order.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/pack.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/probe1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/testtest1.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/hvectest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/hvectest2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/hvec.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/hindexed.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/irecvtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/nbtest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitany.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitall.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitall2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitall3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitall4.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/commit.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancel.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancel2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancel3.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancelmessages.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancelibm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/cancelissend.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendorder.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/exittest.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/selfvsworld.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/test.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/secondf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/allpair2.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/allpair.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/isendf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/pingpong.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/send1.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendcplx.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendfort.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/structf.f
-  ${CMAKE_CURRENT_SOURCE_DIR}/typebasef.f
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/README
-  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
-  ${CMAKE_CURRENT_SOURCE_DIR}/self.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/sndrcvrep.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitany.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/reqcreate.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/persistent.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/allpair2.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/typeub3.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/waitall.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/nullproc2.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/allpair.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/hindexed.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/ssendtest2.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendmany.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/nullproc.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/nbtest.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/sendcplx.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/hvec.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/typebase.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/typeub2.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/structf.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/typecreate.std
-  ${CMAKE_CURRENT_SOURCE_DIR}/nblock.std
-  PARENT_SCOPE
-  )
diff --git a/teshsuite/smpi/mpich-test/pt2pt/README b/teshsuite/smpi/mpich-test/pt2pt/README
deleted file mode 100644 (file)
index 9251e04..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-These files are meant to test the point-to-point layer of MPI.
-The runtests script is now setup to use mpirun (from the toplevel util
-directory. MPIRUN is installed in $PREFIX/bin if you make install). Of couse,
-mpirun is still being ported to various different machines.
-
-All of the following programs use 2 nodes :
-
-Their output is generally in <progname>-<rank>.out
-
-sendrecv - exercises sends and receives of all basic types with
-          large variations in sizes of the messages sent.
-
-isndrcv  - Same as sndrcv, but uses nonblocking pt2pt calls.
-
-overtake - tests that messages sent with send and isend are not
-          overtaking (the standard requires that they are not)
-          by sending a large message followed immediately by several small 
-          ones.
-
-testtypes - Tests the datatypes codes by making several hairy types
-           that should be compatible and trying them out.
-
-Other test programs (which may use more than 2 nodes...) -
-probe and probe1 do minor tests on MPI_probe.
-hvectest tests vector sends and receives (with derived vector datatypes)
-etc...
-
-If you need any help with these programs or find any bugs or make any 
-improvements, let me know. I have some improvements in mind for the testing
-harness (test.[ch]), because I'm not quite perfectly happy
-with it yet... :-) Enjoy.
-
-
-                                       Patrick Bridges
-                                       bridges@mcs.anl.gov
-                                       patrick@CS.MsState.Edu
diff --git a/teshsuite/smpi/mpich-test/pt2pt/allpair.f b/teshsuite/smpi/mpich-test/pt2pt/allpair.f
deleted file mode 100644 (file)
index dfd2df6..0000000
+++ /dev/null
@@ -1,767 +0,0 @@
-c
-c This program was inspired by a bug report from 
-c fsset@corelli.lerc.nasa.gov (Scott Townsend)
-c The original version of this program was submitted by email to 
-c mpi-bugs and is in the directory mpich/bugs/ssend (not distributed 
-c with the distribution).  This program was modified by William
-c Gropp (to correct a few errors and make more consistent with the
-c structure of the test programs in the examples/test/pt2pt directory.
-
-c A C version of this program is in allpairc.c
-c
-      program allpair
-      include 'mpif.h'
-      integer ierr
-
-      call MPI_Init(ierr)
-
-      call test_pair
-
-      call MPI_Finalize(ierr)
-
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Simple pair communication exercises.
-c
-c------------------------------------------------------------------------------
-      subroutine test_pair
-      include 'mpif.h'
-      integer TEST_SIZE
-      parameter (TEST_SIZE=2000)
-
-      integer ierr, prev, next, count, tag, index, i, outcount,
-     .        requests(2), indices(2), rank, size, 
-     .        status(MPI_STATUS_SIZE), statuses(MPI_STATUS_SIZE,2)
-      integer dupcom
-      logical flag
-      real send_buf( TEST_SIZE ), recv_buf ( TEST_SIZE )
-
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      call MPI_Comm_size( MPI_COMM_WORLD, size, ierr )
-      if (size .ne. 2) then
-         print *, 'Allpair test requires exactly 2 processes'
-         call MPI_Abort( MPI_COMM_WORLD, 1, ierr )
-      endif
-C      print *, ' about to do dup'
-      call MPI_Comm_dup( MPI_COMM_WORLD, dupcom, ierr )
-C      print *, ' did dup'
-      next = rank + 1
-      if (next .ge. size) next = 0
-
-      prev = rank - 1
-      if (prev .lt. 0) prev = size - 1
-c
-c     Normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Send'
-         end if
-
-      tag = 1123
-      count = TEST_SIZE / 5
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Send(send_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'send and recv' )
-      else
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'send and recv' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
-c
-c     Ready sends.  Note that we must insure that the receive is posted
-c     before the rsend; this requires using Irecv.
-c
-      if (rank .eq. 0) then
-         print *, '    Rsend'
-         end if
-
-      tag = 1456
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, status, ierr )
-
-         call MPI_Rsend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-
-         call MPI_Probe(MPI_ANY_SOURCE, tag,
-     .                  MPI_COMM_WORLD, status, ierr) 
-
-         if (status(MPI_SOURCE) .ne. prev) then
-            print *, 'Incorrect source, expected', prev,
-     .               ', got', status(MPI_SOURCE)
-            end if
-
-         if (status(MPI_TAG) .ne. tag) then
-            print *, 'Incorrect tag, expected', tag,
-     .               ', got', status(MPI_TAG)
-            end if
-
-         call MPI_Get_count(status, MPI_REAL, i, ierr)
-
-         if (i .ne. count) then
-            print *, 'Incorrect count, expected', count,
-     .               ', got', i
-            end if
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'rsend and recv' )
-
-      else
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 requests(1), ierr)
-         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, ierr )
-         call MPI_Wait( requests(1), status, ierr )
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'rsend and recv' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-         end if
-c
-c     Synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Ssend'
-         end if
-
-      tag = 1789
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Iprobe(MPI_ANY_SOURCE, tag,
-     .                   MPI_COMM_WORLD, flag, status, ierr) 
-
-         if (flag) then
-            print *, 'Iprobe succeeded! source', status(MPI_SOURCE),
-     .               ', tag', status(MPI_TAG)
-            end if
-
-         call MPI_Ssend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-
-         do while (.not. flag)
-            call MPI_Iprobe(MPI_ANY_SOURCE, tag,
-     .                      MPI_COMM_WORLD, flag, status, ierr) 
-            end do
-
-         if (status(MPI_SOURCE) .ne. prev) then
-            print *, 'Incorrect source, expected', prev,
-     .               ', got', status(MPI_SOURCE)
-            end if
-
-         if (status(MPI_TAG) .ne. tag) then
-            print *, 'Incorrect tag, expected', tag,
-     .               ', got', status(MPI_TAG)
-            end if
-
-         call MPI_Get_count(status, MPI_REAL, i, ierr)
-
-         if (i .ne. count) then
-            print *, 'Incorrect count, expected', count,
-     .               ', got', i
-            end if
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status,
-     $        TEST_SIZE, 'ssend and recv' ) 
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'ssend and recv' )
-
-         call MPI_Ssend(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-         end if
-c
-c     Nonblocking normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Isend'
-         end if
-
-      tag = 2123
-      count = TEST_SIZE / 5
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Isend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, requests(2), ierr) 
-
-         call MPI_Waitall(2, requests, statuses, ierr)
-
-         call rq_check( requests, 2, 'isend and irecv' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $        TEST_SIZE, 'isend and irecv' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'isend and irecv' )
-
-         call MPI_Isend(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, requests(1), ierr) 
-
-         call MPI_Wait(requests(1), status, ierr)
-
-         call rq_check( requests(1), 1, 'isend and irecv' )
-
-         end if
-c
-c     Nonblocking ready sends
-c
-      if (rank .eq. 0) then
-         print *, '    Irsend'
-         end if
-
-      tag = 2456
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-c
-c  This test needs work for comm_size > 2
-c
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      dupcom, status, ierr )
-
-         call MPI_Irsend(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(2), ierr) 
-
-         index = -1
-         do while (index .ne. 1)
-            call MPI_Waitany(2, requests, index, statuses, ierr)
-            end do
-
-         call rq_check( requests(1), 1, 'irsend and irecv' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses,
-     $           TEST_SIZE, 'irsend and irecv' )
-
-      else
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      dupcom, status, ierr )
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Test(requests(1), flag, status, ierr)
-            end do
-
-         call rq_check( requests, 1, 'irsend and irecv (test)' )
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'irsend and irecv' )
-
-         call MPI_Irsend(recv_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-         call MPI_Waitall(1, requests, statuses, ierr)
-
-         call rq_check( requests, 1, 'irsend and irecv' )
-
-         end if
-
-c
-c     Nonblocking synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Issend'
-         end if
-
-      tag = 2789
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Issend(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(2), ierr) 
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testall(2, requests, flag, statuses, ierr)
-C            print *, 'flag = ', flag
-            end do
-
-         call rq_check( requests, 2, 'issend and irecv (testall)' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $           TEST_SIZE, 'issend and recv (testall)' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'issend and recv' )
-
-         call MPI_Issend(recv_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testany(1, requests(1), index, flag,
-     .                       statuses(1,1), ierr)
-c            print *, 'flag = ', flag
-            end do
-
-         call rq_check( requests, 1, 'issend and recv (testany)' )
-
-         end if
-c
-c     Persistent normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Send_init' 
-         end if
-
-      tag = 3123
-      count = TEST_SIZE / 5
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      call MPI_Send_init(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(2), ierr)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Startall(2, requests, ierr) 
-         call MPI_Waitall(2, requests, statuses, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,2),
-     $        TEST_SIZE, 'persistent send/recv' )
-
-      else
-
-         call MPI_Start(requests(2), ierr) 
-         call MPI_Wait(requests(2), status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     *                   'persistent send/recv')
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(1), ierr) 
-         call MPI_Wait(requests(1), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
-c
-c     Persistent ready sends
-c
-      if (rank .eq. 0) then
-         print *, '    Rsend_init'
-         end if
-
-      tag = 3456
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      call MPI_Rsend_init(send_buf, count, MPI_REAL, next, tag,
-     .                    MPI_COMM_WORLD, requests(1), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(2), ierr)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, status, ierr )
-
-         call MPI_Startall(2, requests, ierr)
-
-         index = -1
-
-         do while (index .ne. 2)
-            call MPI_Waitsome(2, requests, outcount,
-     .                        indices, statuses, ierr)
-            do i = 1,outcount
-               if (indices(i) .eq. 2) then
-                  call msg_check( recv_buf, prev, tag, count,
-     $                 statuses(1,i), TEST_SIZE, 'waitsome' )
-                  index = 2
-                  end if
-               end do
-            end do
-
-      else
-
-         call MPI_Start(requests(2), ierr)
-
-         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, ierr )
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Test(requests(2), flag, status, ierr)
-            end do
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     *                   'test' )
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(1), ierr)
-         call MPI_Wait(requests(1), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
-c
-c     Persistent synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Ssend_init'
-         end if
-
-      tag = 3789
-      count = TEST_SIZE / 3
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      call MPI_Ssend_init(send_buf, count, MPI_REAL, next, tag,
-     .                    MPI_COMM_WORLD, requests(2), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(1), ierr)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Startall(2, requests, ierr)
-
-         index = -1
-         do while (index .ne. 1)
-            call MPI_Testsome(2, requests, outcount,
-     .                        indices, statuses, ierr)
-            do i = 1,outcount
-               if (indices(i) .eq. 1) then
-                  call msg_check( recv_buf, prev, tag, count,
-     $                 statuses(1,i), TEST_SIZE, 'testsome' )
-                  index = 1
-                  end if
-               end do
-            end do
-      else
-
-         call MPI_Start(requests(1), ierr)
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testany(1, requests(1), index, flag,
-     .                       statuses(1,1), ierr)
-            end do
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $           TEST_SIZE, 'testany' )
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(2), ierr)
-         call MPI_Wait(requests(2), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
-c
-c     Send/receive.
-c
-      if (rank .eq. 0) then
-         print *, '    Sendrecv'
-         end if
-
-      tag = 4123
-      count = TEST_SIZE / 5
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Sendrecv(send_buf, count, MPI_REAL, next, tag,
-     .                     recv_buf, count, MPI_REAL, prev, tag,
-     .                     MPI_COMM_WORLD, status, ierr) 
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'sendrecv' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'recv/send' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
-c
-c     Send/receive replace.
-c
-      if (rank .eq. 0) then
-         print *, '    Sendrecv_replace'
-         end if
-
-      tag = 4456
-      count = TEST_SIZE / 3
-
-      if (rank .eq. 0) then
-
-         call init_test_data(recv_buf, TEST_SIZE)
-
-         do 11 i = count+1,TEST_SIZE
-            recv_buf(i) = 0.0
- 11      continue
-
-         call MPI_Sendrecv_replace(recv_buf, count, MPI_REAL,
-     .                             next, tag, prev, tag,
-     .                             MPI_COMM_WORLD, status, ierr)  
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'sendrecvreplace' )
-
-      else
-
-         call clear_test_data(recv_buf,TEST_SIZE)
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'recv/send for replace' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
-
-      call MPI_Comm_free( dupcom, ierr )
-      return
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Check for correct source, tag, count, and data in test message.
-c
-c------------------------------------------------------------------------------
-      subroutine msg_check( recv_buf, source, tag, count, status, n, 
-     *                      name )
-      include 'mpif.h'
-      integer n
-      real    recv_buf(n)
-      integer source, tag, count, rank, status(MPI_STATUS_SIZE)
-      character*(*) name
-
-      integer ierr, recv_src, recv_tag, recv_count
-
-      recv_src = status(MPI_SOURCE)
-      recv_tag = status(MPI_TAG)
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      call MPI_Get_count(status, MPI_REAL, recv_count, ierr)
-
-      if (recv_src .ne. source) then
-         print *, '[', rank, '] Unexpected source:', recv_src, 
-     *            ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 101, ierr)
-         end if
-
-      if (recv_tag .ne. tag) then
-         print *, '[', rank, '] Unexpected tag:', recv_tag, ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 102, ierr)
-         end if
-
-      if (recv_count .ne. count) then
-         print *, '[', rank, '] Unexpected count:', recv_count,
-     *            ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 103, ierr)
-         end if
-
-      call verify_test_data(recv_buf, count, n, name )
-
-      end
-c------------------------------------------------------------------------------
-c
-c  Check that requests have been set to null
-c
-c------------------------------------------------------------------------------
-      subroutine rq_check( requests, n, msg )
-      include 'mpif.h'
-      integer n, requests(n)
-      character*(*) msg
-      integer i
-c
-      do 10 i=1, n
-         if (requests(i) .ne. MPI_REQUEST_NULL) then
-            print *, 'Nonnull request in ', msg
-         endif
- 10   continue
-c      
-      end
-c------------------------------------------------------------------------------
-c
-c  Initialize test data buffer with integral sequence.
-c
-c------------------------------------------------------------------------------
-      subroutine init_test_data(buf,n)
-      integer n
-      real buf(n)
-      integer i
-
-      do 10 i = 1, n
-         buf(i) = REAL(i)
- 10    continue
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Clear test data buffer
-c
-c------------------------------------------------------------------------------
-      subroutine clear_test_data(buf, n)
-      integer n
-      real buf(n)
-      integer i
-
-      do 10 i = 1, n
-         buf(i) = 0.
- 10   continue
-
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Verify test data buffer
-c
-c------------------------------------------------------------------------------
-      subroutine verify_test_data(buf, count, n, name)
-      include 'mpif.h'
-      integer n
-      real buf(n)
-      character *(*) name
-
-      integer count, ierr, i
-
-      do 10 i = 1, count
-         if (buf(i) .ne. REAL(i)) then
-            print 100, buf(i), i, count, name
-            call MPI_Abort(MPI_COMM_WORLD, 108, ierr)
-            endif
- 10       continue
-
-      do 20 i = count + 1, n
-         if (buf(i) .ne. 0.) then
-            print 100, buf(i), i, n, name
-            call MPI_Abort(MPI_COMM_WORLD, 109, ierr)
-            endif
- 20       continue
-
-100   format('Invalid data', f6.1, ' at ', i4, ' of ', i4, ' in ', a)
-
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/allpair.std b/teshsuite/smpi/mpich-test/pt2pt/allpair.std
deleted file mode 100644 (file)
index 31a1d07..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-*** Testing pt-2-pt from Fortran ***
-     Send
-     Rsend
-     Ssend
-     Isend
-     Irsend
-     Issend
-     Send_init
-     Rsend_init
-     Ssend_init
-     Sendrecv
-     Sendrecv_replace
-*** Testing pt-2-pt from Fortran ***
diff --git a/teshsuite/smpi/mpich-test/pt2pt/allpair2.f b/teshsuite/smpi/mpich-test/pt2pt/allpair2.f
deleted file mode 100644 (file)
index 12b91ba..0000000
+++ /dev/null
@@ -1,809 +0,0 @@
-c
-c This program was inspired by a bug report from 
-c fsset@corelli.lerc.nasa.gov (Scott Townsend)
-c The original version of this program was submitted by email to 
-c mpi-bugs and is in the directory mpich/bugs/ssend (not distributed 
-c with the distribution).  This program was modified by William
-c Gropp (to correct a few errors and make more consistent with the
-c structure of the test programs in the examples/test/pt2pt directory.
-
-c A C version of this program is in allpairc.c
-c
-c This version is intended to test for memory leaks; it runs each test
-c a number of times (TEST_COUNT + some in test_pair).
-c 
-      program allpair2
-      include 'mpif.h'
-      integer ierr
-
-      call MPI_Init(ierr)
-
-      call test_pair
-
-      call MPI_Finalize(ierr)
-
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Simple pair communication exercises.
-c
-c------------------------------------------------------------------------------
-      subroutine test_pair
-      include 'mpif.h'
-      integer TEST_SIZE, TEST_COUNT
-      parameter (TEST_SIZE=2000)
-      parameter (TEST_COUNT=100)
-
-      integer ierr, prev, next, count, tag, index, i, outcount,
-     .        requests(2), indices(2), rank, size, 
-     .        status(MPI_STATUS_SIZE), statuses(MPI_STATUS_SIZE,2)
-      integer dupcom
-      integer c
-      logical flag
-      real send_buf( TEST_SIZE ), recv_buf ( TEST_SIZE )
-
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      call MPI_Comm_size( MPI_COMM_WORLD, size, ierr )
-      call MPI_Comm_dup( MPI_COMM_WORLD, dupcom, ierr )
-      next = rank + 1
-      if (next .ge. size) next = 0
-
-      prev = rank - 1
-      if (prev .lt. 0) prev = size - 1
-c
-c     Normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Send'
-         end if
-
-      tag = 1123
-      count = TEST_SIZE / 5
-
-      do 111 c=1, TEST_COUNT+1
-
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Send(send_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'send and recv' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'send and recv' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
- 111  continue
-c
-c     Ready sends.  Note that we must ensure that the receive is posted
-c     before the rsend; this requires using Irecv.
-c
-      if (rank .eq. 0) then
-         print *, '    Rsend'
-         end if
-
-      tag = 1456
-      count = TEST_SIZE / 3
-
-      do 112 c = 1, TEST_COUNT+2
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, status, ierr )
-
-         call MPI_Rsend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-
-         call MPI_Probe(MPI_ANY_SOURCE, tag,
-     .                  MPI_COMM_WORLD, status, ierr) 
-
-         if (status(MPI_SOURCE) .ne. prev) then
-            print *, 'Incorrect source, expected', prev,
-     .               ', got', status(MPI_SOURCE)
-            end if
-
-         if (status(MPI_TAG) .ne. tag) then
-            print *, 'Incorrect tag, expected', tag,
-     .               ', got', status(MPI_TAG)
-            end if
-
-         call MPI_Get_count(status, MPI_REAL, i, ierr)
-
-         if (i .ne. count) then
-            print *, 'Incorrect count, expected', count,
-     .               ', got', i
-            end if
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'rsend and recv' )
-
-      else
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 requests(1), ierr)
-         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
-     .                  MPI_COMM_WORLD, ierr )
-         call MPI_Wait( requests(1), status, ierr )
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'rsend and recv' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-         end if
- 112  continue
-c
-c     Synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Ssend'
-         end if
-
-      tag = 1789
-      count = TEST_SIZE / 3
-
-      do 113 c = 1, TEST_COUNT+3
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Iprobe(MPI_ANY_SOURCE, tag,
-     .                   MPI_COMM_WORLD, flag, status, ierr) 
-
-         if (flag) then
-            print *, 'Iprobe succeeded! source', status(MPI_SOURCE),
-     .               ', tag', status(MPI_TAG)
-            end if
-
-         call MPI_Ssend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-
-         do while (.not. flag)
-            call MPI_Iprobe(MPI_ANY_SOURCE, tag,
-     .                      MPI_COMM_WORLD, flag, status, ierr) 
-            end do
-
-         if (status(MPI_SOURCE) .ne. prev) then
-            print *, 'Incorrect source, expected', prev,
-     .               ', got', status(MPI_SOURCE)
-            end if
-
-         if (status(MPI_TAG) .ne. tag) then
-            print *, 'Incorrect tag, expected', tag,
-     .               ', got', status(MPI_TAG)
-            end if
-
-         call MPI_Get_count(status, MPI_REAL, i, ierr)
-
-         if (i .ne. count) then
-            print *, 'Incorrect count, expected', count,
-     .               ', got', i
-            end if
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status,
-     $        TEST_SIZE, 'ssend and recv' ) 
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'ssend and recv' )
-
-         call MPI_Ssend(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, ierr) 
-         end if
- 113  continue
-c
-c     Nonblocking normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Isend'
-         end if
-
-      tag = 2123
-      count = TEST_SIZE / 5
-
-      do 114 c = 1, TEST_COUNT+4
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Isend(send_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, requests(2), ierr) 
-
-         call MPI_Waitall(2, requests, statuses, ierr)
-
-         call rq_check( requests, 2, 'isend and irecv' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $        TEST_SIZE, 'isend and irecv' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'isend and irecv' )
-
-         call MPI_Isend(recv_buf, count, MPI_REAL, next, tag,
-     .                  MPI_COMM_WORLD, requests(1), ierr) 
-
-         call MPI_Wait(requests(1), status, ierr)
-
-         call rq_check( requests(1), 1, 'isend and irecv' )
-
-         end if
- 114  continue
-c
-c     Nonblocking ready sends
-c
-      if (rank .eq. 0) then
-         print *, '    Irsend'
-         end if
-
-      tag = 2456
-      count = TEST_SIZE / 3
-
-      do 115 c = 1, TEST_COUNT+5
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      dupcom, status, ierr )
-
-         call MPI_Irsend(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(2), ierr) 
-
-         index = -1
-         do while (index .ne. 1)
-            call MPI_Waitany(2, requests, index, statuses, ierr)
-            end do
-
-         call rq_check( requests(1), 1, 'irsend and irecv' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses,
-     $           TEST_SIZE, 'irsend and irecv' )
-
-C
-C        In case the send didn't complete yet.
-         call MPI_Waitall( 2, requests, statuses, ierr )
-
-      else
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
-     .                      dupcom, status, ierr )
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Test(requests(1), flag, status, ierr)
-            end do
-
-         call rq_check( requests, 1, 'irsend and irecv (test)' )
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'irsend and irecv' )
-
-         call MPI_Irsend(recv_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-         call MPI_Waitall(1, requests, statuses, ierr)
-
-         call rq_check( requests, 1, 'irsend and irecv' )
-
-         end if
- 115  continue
-c
-c     Nonblocking synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Issend'
-         end if
-
-      tag = 2789
-      count = TEST_SIZE / 3
-
-      do 116 c = 1, TEST_COUNT+6
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                  requests(1), ierr)
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Issend(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(2), ierr) 
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testall(2, requests, flag, statuses, ierr)
-C            print *, 'flag = ', flag
-            end do
-
-         call rq_check( requests, 2, 'issend and irecv (testall)' )
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $           TEST_SIZE, 'issend and recv (testall)' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'issend and recv' )
-
-         call MPI_Issend(recv_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testany(1, requests(1), index, flag,
-     .                       statuses(1,1), ierr)
-c            print *, 'flag = ', flag
-            end do
-
-         call rq_check( requests, 1, 'issend and recv (testany)' )
-
-         end if
- 116  continue
-c
-c     Persistent normal sends
-c
-      if (rank .eq. 0) then
-         print *, '    Send_init' 
-         end if
-
-      tag = 3123
-      count = TEST_SIZE / 5
-
-      do 117 c = 1, TEST_COUNT+7
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      call MPI_Send_init(send_buf, count, MPI_REAL, next, tag,
-     .                   MPI_COMM_WORLD, requests(1), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(2), ierr)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Startall(2, requests, ierr) 
-         call MPI_Waitall(2, requests, statuses, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,2),
-     $        TEST_SIZE, 'persistent send/recv' )
-
-      else
-
-         call MPI_Start(requests(2), ierr) 
-         call MPI_Wait(requests(2), status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     *                   'persistent send/recv')
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(1), ierr) 
-         call MPI_Wait(requests(1), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
- 117  continue
-c
-c     Persistent ready sends
-c     Like the ready send, we must ensure that the receive is posted
-c     before the ready send is started.
-c
-      if (rank .eq. 0) then
-         print *, '    Rsend_init'
-         end if
-
-      tag = 3456
-      count = TEST_SIZE / 3
-
-      do 118 c = 1, TEST_COUNT+8
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      call MPI_Rsend_init(send_buf, count, MPI_REAL, next, tag,
-     .                    MPI_COMM_WORLD, requests(1), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(2), ierr)
-
-c
-c receive a clear-to-go from the destination, so that the ready send
-c will find the matching receive when it arrives
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, 1, 321, 
-     $                  MPI_COMM_WORLD, status, ierr ) 
-         call MPI_Startall(2, requests, ierr)
-
-         index = -1
-         do while (index .ne. 2)
-            call MPI_Waitsome(2, requests, outcount,
-     .                        indices, statuses, ierr)
-            do i = 1,outcount
-               if (indices(i) .eq. 2) then
-                  call msg_check( recv_buf, prev, tag, count,
-     $                 statuses(1,i), TEST_SIZE, 'waitsome' )
-                  index = 2
-                  end if
-               end do
-            end do
-
-      else
-
-         call MPI_Start(requests(2), ierr)
-
-c Let the target know that is may begin the ready send
-         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, 0, 321, 
-     $                  MPI_COMM_WORLD, ierr ) 
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Test(requests(2), flag, status, ierr)
-            end do
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     *                   'test' )
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(1), ierr)
-         call MPI_Wait(requests(1), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
- 118  continue
-c
-c     Persistent synchronous sends
-c
-      if (rank .eq. 0) then
-         print *, '    Ssend_init'
-         end if
-
-      tag = 3789
-      count = TEST_SIZE / 3
-
-      do 119 c = 1, TEST_COUNT+9
-      call clear_test_data(recv_buf,TEST_SIZE)
-      
-      call MPI_Ssend_init(send_buf, count, MPI_REAL, next, tag,
-     .                    MPI_COMM_WORLD, requests(2), ierr) 
-
-      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
-     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                   requests(1), ierr)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Startall(2, requests, ierr)
-
-         index = -1
-         do while (index .ne. 1)
-            call MPI_Testsome(2, requests, outcount,
-     .                        indices, statuses, ierr)
-            do i = 1,outcount
-               if (indices(i) .eq. 1) then
-                  call msg_check( recv_buf, prev, tag, count,
-     $                 statuses(1,i), TEST_SIZE, 'testsome' )
-                  index = 1
-                  end if
-               end do
-            end do
-
-      else
-
-         call MPI_Start(requests(1), ierr)
-
-         flag = .FALSE.
-         do while (.not. flag)
-            call MPI_Testany(1, requests(1), index, flag,
-     .                       statuses(1,1), ierr)
-            end do
-
-         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
-     $           TEST_SIZE, 'testany' )
-
-         do i = 1,count
-            send_buf(i) = recv_buf(i)
-            end do
-
-         call MPI_Start(requests(2), ierr)
-         call MPI_Wait(requests(2), status, ierr)
-
-         end if
-
-      call MPI_Request_free(requests(1), ierr)
-      call MPI_Request_free(requests(2), ierr)
- 119  continue
-c
-c     Send/receive.
-c
-      if (rank .eq. 0) then
-         print *, '    Sendrecv'
-         end if
-
-      tag = 4123
-      count = TEST_SIZE / 5
-
-      do 120 c = 1, TEST_COUNT+10
-      call clear_test_data(recv_buf,TEST_SIZE)
-
-      if (rank .eq. 0) then
-
-         call init_test_data(send_buf,TEST_SIZE)
-
-         call MPI_Sendrecv(send_buf, count, MPI_REAL, next, tag,
-     .                     recv_buf, count, MPI_REAL, prev, tag,
-     .                     MPI_COMM_WORLD, status, ierr) 
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'sendrecv' )
-
-      else
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'recv/send' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
- 120  continue
-c
-c     Send/receive replace.
-c
-      if (rank .eq. 0) then
-         print *, '    Sendrecv_replace'
-         end if
-
-      tag = 4456
-      count = TEST_SIZE / 3
-
-      do 121 c = 1, TEST_COUNT+11
-      if (rank .eq. 0) then
-
-         call init_test_data(recv_buf, TEST_SIZE)
-
-         do 11 i = count+1,TEST_SIZE
-            recv_buf(i) = 0.0
- 11      continue
-
-         call MPI_Sendrecv_replace(recv_buf, count, MPI_REAL,
-     .                             next, tag, prev, tag,
-     .                             MPI_COMM_WORLD, status, ierr)  
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'sendrecvreplace' )
-
-      else
-
-         call clear_test_data(recv_buf,TEST_SIZE)
-
-         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
-     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     .                 status, ierr)
-
-         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
-     .                   'recv/send for replace' )
-
-         call MPI_Send(recv_buf, count, MPI_REAL, next, tag,
-     .                 MPI_COMM_WORLD, ierr) 
-         end if
-
- 121  continue
-
-      call MPI_Comm_free( dupcom, ierr )
-      return
-      
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Check for correct source, tag, count, and data in test message.
-c
-c------------------------------------------------------------------------------
-      subroutine msg_check( recv_buf, source, tag, count, status, n, 
-     *                      name )
-      include 'mpif.h'
-      integer n
-      real    recv_buf(n)
-      integer source, tag, count, rank, status(MPI_STATUS_SIZE)
-      character*(*) name
-
-      integer ierr, recv_src, recv_tag, recv_count
-
-      recv_src = status(MPI_SOURCE)
-      recv_tag = status(MPI_TAG)
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      call MPI_Get_count(status, MPI_REAL, recv_count, ierr)
-
-C     Check for null status
-      if (recv_src .eq. MPI_ANY_SOURCE .and. 
-     *    recv_tag .eq. MPI_ANY_TAG .and. 
-     *    status(MPI_ERROR) .eq. MPI_SUCCESS) then
-         print *, '[', rank, '] Unexpected NULL status in ', name
-         call MPI_Abort( MPI_COMM_WORLD, 104, ierr )
-      end if
-      if (recv_src .ne. source) then
-         print *, '[', rank, '] Unexpected source:', recv_src, 
-     *            ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 101, ierr)
-         end if
-
-      if (recv_tag .ne. tag) then
-         print *, '[', rank, '] Unexpected tag:', recv_tag, ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 102, ierr)
-         end if
-
-      if (recv_count .ne. count) then
-         print *, '[', rank, '] Unexpected count:', recv_count,
-     *            ' in ', name
-         call MPI_Abort(MPI_COMM_WORLD, 103, ierr)
-         end if
-
-      call verify_test_data(recv_buf, count, n, name )
-
-      end
-c------------------------------------------------------------------------------
-c
-c  Check that requests have been set to null
-c
-c------------------------------------------------------------------------------
-      subroutine rq_check( requests, n, msg )
-      include 'mpif.h'
-      integer n, requests(n)
-      character*(*) msg
-      integer i
-c
-      do 10 i=1, n
-         if (requests(i) .ne. MPI_REQUEST_NULL) then
-            print *, 'Nonnull request in ', msg
-         endif
- 10   continue
-c      
-      end
-c------------------------------------------------------------------------------
-c
-c  Initialize test data buffer with integral sequence.
-c
-c------------------------------------------------------------------------------
-      subroutine init_test_data(buf,n)
-      integer n
-      real buf(n)
-      integer i
-
-      do 10 i = 1, n
-         buf(i) = REAL(i)
- 10    continue
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Clear test data buffer
-c
-c------------------------------------------------------------------------------
-      subroutine clear_test_data(buf, n)
-      integer n
-      real buf(n)
-      integer i
-
-      do 10 i = 1, n
-         buf(i) = 0.
- 10   continue
-
-      end
-
-c------------------------------------------------------------------------------
-c
-c  Verify test data buffer
-c
-c------------------------------------------------------------------------------
-      subroutine verify_test_data(buf, count, n, name)
-      include 'mpif.h'
-      integer n
-      real buf(n)
-      character *(*) name
-
-      integer count, ierr, i
-
-      do 10 i = 1, count
-         if (buf(i) .ne. REAL(i)) then
-            print 100, buf(i), i, count, name
-            call MPI_Abort(MPI_COMM_WORLD, 108, ierr)
-            endif
- 10       continue
-
-      do 20 i = count + 1, n
-         if (buf(i) .ne. 0.) then
-            print 100, buf(i), i, n, name
-            call MPI_Abort(MPI_COMM_WORLD, 109, ierr)
-            endif
- 20       continue
-
-100   format('Invalid data', f6.1, ' at ', i4, ' of ', i4, ' in ', a)
-
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/allpair2.std b/teshsuite/smpi/mpich-test/pt2pt/allpair2.std
deleted file mode 100644 (file)
index f1c4b3c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-*** Testing pt-2-pt from Fortran  (many calls) ***
-     Send
-     Rsend
-     Ssend
-     Isend
-     Irsend
-     Issend
-     Send_init
-     Rsend_init
-     Ssend_init
-     Sendrecv
-     Sendrecv_replace
-*** Testing pt-2-pt from Fortran  (many calls) ***
diff --git a/teshsuite/smpi/mpich-test/pt2pt/bsendtest.c b/teshsuite/smpi/mpich-test/pt2pt/bsendtest.c
deleted file mode 100644 (file)
index afd2eef..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Program to test that the "no overtaking messages" semantics
- * of point to point communications in MPI is satisfied. 
- * A long message is sent using MPI_BSend and received using MPI_Recv,
- * followed by lots of short messages sent the same way.
- *
- *                             Patrick Bridges
- *                             bridges@mcs.anl.gov
- *                             patrick@CS.MsState.Edu
- */
-
-#include <stdio.h>
-/* Needed for malloc declaration */
-#include <stdlib.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-
-static int src  = 0;
-static int dest = 1;
-
-/* Which tests to perform (not yet implemented) */
-/* static int Do_Buffer = 1; */
-/* static int Do_Standard = 1; */
-
-/* Prototypes for picky compilers */
-void Generate_Data ( double *, int );
-void Normal_Test_Recv ( double *, int );
-void Buffered_Test_Send ( double *, int );
-void Buffered_Test_Ibsend ( double *, int );
-int Check_Data ( double *, int );
-void Clear_Buffer ( double *, int );
-
-void Generate_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = (double)i+1;
-}
-
-void Normal_Test_Recv(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-    MPI_Status Stat;
-    double     *b;
-
-    b = buffer;
-    for (j = 0; j < 2; j++) {
-       /* Receive a long message */
-       MPI_Recv(b, (buff_size/2 - 10), MPI_DOUBLE, src, 
-                2000, MPI_COMM_WORLD, &Stat);
-       b += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++) {
-           MPI_Recv(b++, 1, MPI_DOUBLE, src, 2000, MPI_COMM_WORLD, &Stat);
-       }
-    }
-}
-
-void Buffered_Test_Send(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-    void *bbuffer;
-    int  size;
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       MPI_Bsend(buffer, (buff_size/2 - 10), MPI_DOUBLE, dest, 2000, 
-                MPI_COMM_WORLD);
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Bsend(buffer++, 1, MPI_DOUBLE, 
-                     dest, 2000, MPI_COMM_WORLD);
-        /* Force this set of Bsends to complete */
-        MPI_Buffer_detach( &bbuffer, &size );
-        MPI_Buffer_attach( bbuffer, size );
-    }
-}
-
-void Buffered_Test_Ibsend(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-    void *bbuffer;
-    int  size;
-    int  cnt;
-    MPI_Request req[20];
-    MPI_Status  statuses[20];
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       cnt = 0;
-       MPI_Ibsend(buffer, (buff_size/2 - 10), MPI_DOUBLE, dest, 2000, 
-                MPI_COMM_WORLD, &req[cnt++]);
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Ibsend(buffer++, 1, MPI_DOUBLE, 
-                     dest, 2000, MPI_COMM_WORLD, &req[cnt++]);
-       /* Wait for these to finish (should finish immediately) */
-       MPI_Waitall( cnt, req, statuses );
-
-        /* Force this set of Bsends to complete; this may take longer than
-          the Waitall */
-        MPI_Buffer_detach( &bbuffer, &size );
-        MPI_Buffer_attach( bbuffer, size );
-    }
-}
-
-int Check_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    int err = 0;
-
-    for (i = 0; i < buff_size; i++)
-       if (buffer[i] != (i + 1)) {
-           err++;
-           fprintf( stderr, "Value at %d is %f, should be %f\n", i, 
-                   buffer[i], (double)(i+1) );
-           if (err > 10) return 1;
-           }
-    return err;
-}
-
-void Clear_Buffer(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = -1;
-}
-
-
-int main(int argc, char **argv)
-{
-    int rank; /* My Rank (0 or 1) */
-    double buffer[SIZE], *tmpbuffer, *tmpbuf;
-    int tsize, bsize;
-    char *Current_Test = NULL;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    if (rank == src) { 
-       Generate_Data(buffer, SIZE);
-       MPI_Pack_size( SIZE, MPI_DOUBLE, MPI_COMM_WORLD, &bsize );
-       tmpbuffer = (double *) malloc( bsize + 22*MPI_BSEND_OVERHEAD );
-       if (!tmpbuffer) {
-           fprintf( stderr, "Could not allocate bsend buffer of size %d\n",
-                    bsize );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-           }
-        MPI_Buffer_attach( tmpbuffer, bsize + 22*MPI_BSEND_OVERHEAD );
-       Buffered_Test_Send(buffer, SIZE);
-       Buffered_Test_Ibsend(buffer, SIZE);
-       MPI_Buffer_detach( &tmpbuf, &tsize );
-       Test_Waitforall( );
-       MPI_Finalize();
-
-    } else if (rank == dest) {
-       Test_Init("bsendtest", rank);
-       /* Test 3 */
-       Current_Test = (char*)"Overtaking Test (Buffered Send -> Normal Receive)";
-       Clear_Buffer(buffer, SIZE);
-       /* For Bsend */
-       Normal_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-       /* For Ibsend */
-       Current_Test = (char*)"Overtaking Test (Buffered Isend -> Normal Receive)";
-       Clear_Buffer(buffer, SIZE);
-       Normal_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-       Test_Waitforall( );
-       {
-           int rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           MPI_Finalize();
-           return rval;
-       }
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-        MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancel.c b/teshsuite/smpi/mpich-test/pt2pt/cancel.c
deleted file mode 100644 (file)
index e1ca0f3..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * This file shows a typical use of MPI_Cancel to free IRecv's that
- * are not wanted.  We check for both successful and unsuccessful 
- * cancels
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    MPI_Request r1;
-    int         size, rank;
-    int         err = 0;
-    int         partner, buf[10], flag;
-    MPI_Status  status;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    
-    if (size < 2) {
-       printf( "Cancel test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* 
-     * Here is the test.  First, we ensure an unsatisfied Irecv:
-     *       process 0             process size-1
-     *       Sendrecv              Sendrecv
-     *       Irecv                    ----
-     *       Cancel                   ----
-     *       Sendrecv              Sendrecv
-     * Next, we confirm receipt before canceling
-     *       Irecv                 Send
-     *       Sendrecv              Sendrecv
-     *       Cancel
-     */
-    if (rank == 0) {
-       partner = size - 1;
-       /* Cancel succeeds */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Irecv( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Wait( &r1, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++;
-           printf( "Cancel of a receive failed where it should succeed.\n" );
-       }
-
-       /* Cancel fails */
-       MPI_Irecv( buf, 10, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Test( &r1, &flag, &status );
-       MPI_Test_cancelled( &status, &flag );
-       /* It is technically possible for the cancel to succeed, even though
-          the message was (at least partially) delivered.  I'm leaving
-          this test in since most of the MPICH devices provide this
-          behavior. */
-       if (flag) {
-           err++;
-           printf( "Cancel of a receive succeeded where it shouldn't.\n" );
-       }
-
-       if (err) {
-           printf( "Test failed with %d errors.\n", err );
-       }
-       else {
-           printf( " No Errors\n" );
-       }
-    }
-    else if (rank == size - 1) {
-       partner = 0;
-       /* Cancel succeeds */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails */
-       MPI_Send( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-    }
-
-    /* 
-       Next test - check that a cancel for a request receive from
-       MPI_PROC_NULL succeeds (there is some suspicion that some
-       systems can't handle this - also, MPI_REQUEST_NULL 
-
-       Note that a null request is invalid (see the various NULL comments)
-    r1 = MPI_REQUEST_NULL;
-    MPI_Cancel( &r1 );
-    */
-    MPI_Irecv( buf, 10, MPI_INT, MPI_PROC_NULL, 0, MPI_COMM_WORLD, &r1 );
-    MPI_Cancel( &r1 );
-
-    MPI_Request_free( &r1 );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancel2.c b/teshsuite/smpi/mpich-test/pt2pt/cancel2.c
deleted file mode 100644 (file)
index 664c20a..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * This file shows a typical use of MPI_Cancel to free Persistent Recv's that
- * are not wanted.  We check for both successful and unsuccessful 
- * cancels
- */
-
-/* On 10/27/99, a test for MPI_Waitsome/MPI_Testsome was added */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    MPI_Request r1;
-    int         size, rank;
-    int         err = 0;
-    int         partner, buf[10], flag, idx, index;
-    MPI_Status  status;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    
-    if (size < 2) {
-       printf( "Cancel test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* 
-     * Here is the test.  First, we ensure an unsatisfied Irecv:
-     *       process 0             process size-1
-     *       Sendrecv              Sendrecv
-     *       Irecv                    ----
-     *       Cancel                   ----
-     *       Sendrecv              Sendrecv
-     * Next, we confirm receipt before canceling
-     *       Irecv                 Send
-     *       Sendrecv              Sendrecv
-     *       Cancel
-     */
-    if (rank == 0) {
-       partner = size - 1;
-       /* Cancel succeeds for wait/waitall */
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Wait( &r1, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++; 
-           printf( "Cancel of a receive failed where it should succeed (Wait).\n" );
-       }
-
-       MPI_Request_free( &r1 );
-
-       /* Cancel fails for test/testall */
-       buf[0] = -1;
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Test( &r1, &flag, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a receive succeeded where it shouldn't (Test).\n" );
-           if (buf[0] != -1) {
-               printf( "Receive buffer changed even though cancel suceeded! (Test).\n" );
-           }
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel succeeds for waitany */
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Waitany( 1, &r1, &idx, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++;
-           printf( "Cancel of a receive failed where it should succeed (Waitany).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel fails for testany */
-        buf[0] = -1;
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Testany( 1, &r1, &idx, &flag, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a receive succeeded where it shouldn't (Testany).\n" );
-           if (buf[0] != -1) {
-               printf( "Receive buffer changed even though cancel suceeded! (Test).\n" );
-           }
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel succeeds for waitsome */
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Waitsome( 1, &r1, &idx, &index, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++;
-           printf( "Cancel of a receive failed where it should succeed (Waitsome).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel fails for testsome*/
-        buf[0] = -1;
-       MPI_Recv_init( buf, 10, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Testsome( 1, &r1, &idx, &index, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a receive succeeded where it shouldn't (Testsome).\n" );
-           if (buf[0] != -1) {
-               printf( "Receive buffer changed even though cancel suceeded! (Testsome).\n" );
-           }
-       }
-       MPI_Request_free( &r1 );
-
-       if (err) {
-           printf( "Test failed with %d errors.\n", err );
-       }
-       else {
-           printf( " No Errors\n" );
-       }
-    }
-
-    else if (rank == size - 1) {
-       partner = 0;
-       /* Cancel succeeds for wait/waitall */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails for test/testall */
-       buf[0] = 3;
-       MPI_Send( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-       /* Cancel succeeds for waitany */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails  for testany */
-       MPI_Send( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-       /* Cancel succeeds for waitsome */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails  for waitsome */
-       MPI_Send( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-    /* 
-       Next test - check that a cancel for a request receive from
-       MPI_PROC_NULL succeeds (there is some suspicion that some
-       systems can't handle this - also, MPI_REQUEST_NULL 
-     */
-    /* A null request is an error. (null objects are errors unless otherwise
-       allowed)
-    r1 = MPI_REQUEST_NULL;
-    MPI_Cancel( &r1 );
-    */
-       MPI_Recv_init( buf, 10, MPI_INT, MPI_PROC_NULL, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Request_free( &r1 );    /* Must complete cancel.  We know that it 
-                                      won't complete, so we don't need to do
-                                      anything else */
-    }
-
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancel3.c b/teshsuite/smpi/mpich-test/pt2pt/cancel3.c
deleted file mode 100644 (file)
index c6a84e7..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * This file shows a typical use of MPI_Cancel to free Persistent Send's that
- * are not wanted.  We check for both successful and unsuccessful 
- * cancels
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    MPI_Request r1;
-    int         size, rank;
-    int         err = 0;
-    int         partner, buf[10], flag, idx, index;
-    MPI_Status  status;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    
-    if (size < 2) {
-       printf( "Cancel test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* 
-     * Here is the test.  First, we ensure an unsatisfied Irecv:
-     *       process 0             process size-1
-     *       Sendrecv              Sendrecv
-     *       Irecv                    ----
-     *       Cancel                   ----
-     *       Sendrecv              Sendrecv
-     * Next, we confirm receipt before canceling
-     *       Irecv                 Send
-     *       Sendrecv              Sendrecv
-     *       Cancel
-     */
-    if (rank == 0) {
-       partner = size - 1;
-       /* Cancel succeeds for wait/waitall */
-       MPI_Send_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Wait( &r1, &status );
-       MPI_Test_cancelled( &status, &flag ); 
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++; 
-           printf( "Cancel of a send failed where it should succeed (Wait).\n" );
-       }
-       MPI_Request_free( &r1 ); 
-
-       /* Cancel fails for test/testall */
-       buf[0] = 3;
-       MPI_Send_init( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Test( &r1, &flag, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a send succeeded where it shouldn't (Test).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel succeeds for waitany */
-       MPI_Send_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Waitany( 1, &r1, &idx, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++;
-           printf( "Cancel of a send failed where it should succeed (Waitany).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel fails for testany */
-        buf[0] = 3;
-       MPI_Send_init( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Testany( 1, &r1, &idx, &flag, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a send succeeded where it shouldn't (Testany).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel succeeds for waitsome */
-       MPI_Send_init( buf, 10, MPI_INT, partner, 0, MPI_COMM_WORLD, &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Start( &r1 );
-       MPI_Cancel( &r1 );
-       MPI_Waitsome( 1, &r1, &idx, &index, &status );
-       MPI_Test_cancelled( &status, &flag );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (!flag) {
-           err++;
-           printf( "Cancel of a send failed where it should succeed (Waitsome).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       /* Cancel fails for testsome*/
-        buf[0] = 3;
-       MPI_Send_init( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &r1 );
-       MPI_Start( &r1 );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Cancel( &r1 );
-       MPI_Testsome( 1, &r1, &idx, &index, &status );
-       MPI_Test_cancelled( &status, &flag );
-       if (flag) {
-           err++;
-           printf( "Cancel of a send succeeded where it shouldn't (Testsome).\n" );
-       }
-       MPI_Request_free( &r1 );
-
-       if (err) {
-           printf( "Test failed with %d errors.\n", err );
-       }
-       else {
-           printf( " No Errors\n" );
-       }
-    }
-    else if (rank == size - 1) {
-       partner = 0;
-       /* Cancel succeeds for wait/waitall */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-       /* Cancel fails for test/testall */
-       buf[0] = -1;
-       MPI_Recv( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-       if (buf[0] == -1) {
-           printf( "Receive buffer did not change even though cancel should not have suceeded! (Test).\n" );
-           }
-
-       /* Cancel succeeds for waitany */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails  for testany */
-       buf[0] = -1;
-       MPI_Recv( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       if (buf[0] == -1) {
-           printf( "Receive buffer did not change even though cancel should not have suceeded! (Testany).\n" );
-           }
-
-       /* Cancel succeeds for waitsome */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-       /* Cancel fails for testsome */
-       buf[0] = -1;
-       MPI_Recv( buf, 3, MPI_INT, partner, 2, MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 1,
-                     MPI_COMM_WORLD, &status );
-
-       if (buf[0] == -1) {
-           printf( "Receive buffer did not change even though cancel should not have suceeded! (Test).\n" );
-           }
-
-    }
-
-    MPI_Finalize();
-    return 0;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancelibm.c b/teshsuite/smpi/mpich-test/pt2pt/cancelibm.c
deleted file mode 100644 (file)
index 3f83a52..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/****************************************************************************
-
-  MESSAGE PASSING INTERFACE TEST CASE SUITE
-  
-  Copyright IBM Corp. 1995
-       
-  IBM Corp. hereby grants a non-exclusive license to use, copy, modify, and
-  distribute this software for any purpose and without fee provided that the
-  above copyright notice and the following paragraphs appear in all copies.
-         
-  IBM Corp. makes no representation that the test cases comprising this
-  suite are correct or are an accurate representation of any standard.
-               
-  In no event shall IBM be liable to any party for direct, indirect, special
-  incidental, or consequential damage arising out of the use of this software
-  even if IBM Corp. has been advised of the possibility of such damage.
-                 
-  IBM CORP. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED
-  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-  PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS AND IBM
-  CORP. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
-  ENHANCEMENTS, OR MODIFICATIONS.
-                       
-  ****************************************************************************
-                         
-  These test cases reflect an interpretation of the MPI Standard.  They are
-  are, in most cases, unit tests of specific MPI behaviors.  If a user of any
-  test case from this set believes that the MPI Standard requires behavior
-  different than that implied by the test case we would appreciate feedback.
-  
-  Comments may be sent to:
-  Richard Treumann
-  treumann@kgn.ibm.com
-                                 
-  ****************************************************************************
-*/
-#include <stdio.h>
-#include "mpi.h"
-
-int main(int argc, char *argv[])
-{
-       int me, tasks, data, flag;
-       int err0 = 0;
-       int err1 = 0;
-       int errs, toterrs;
-       MPI_Request request;
-       MPI_Status status;
-
-       MPI_Init(&argc,&argv);
-       MPI_Comm_rank(MPI_COMM_WORLD,&me);
-       MPI_Comm_size(MPI_COMM_WORLD,&tasks);
-
-       if (tasks < 2) {
-           printf( "Cancel test requires at least 2 processes\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       
-       { int data[100000]; if (me == 0)  
-       {
-               MPI_Irecv(data, 1, MPI_INT, 1, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Receive request not cancelled!\n", me);
-               }
-
-               MPI_Issend(data, 100000, MPI_INT, 1, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               for (flag = 0;; )  
-               {
-                       MPI_Test(&request,&flag,&status);
-                       if (flag) break;
-               }
-               
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request not cancelled! (1)\n", me);
-               }
-       }}
-       
-       if (me == 0)  
-       {
-               data = 5;
-               MPI_Isend(&data, 1, MPI_INT, 1, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request not cancelled! (2)\n", me);
-               }
-               MPI_Barrier(MPI_COMM_WORLD);
-               status.MPI_TAG=MPI_SUCCESS;
-               data = 6;
-               MPI_Send(&data, 1, MPI_INT, 1, 5, MPI_COMM_WORLD);
-               
-               data = 7;
-               MPI_Isend(&data, 1, MPI_INT, 1, 1, MPI_COMM_WORLD,&request);
-               MPI_Barrier(MPI_COMM_WORLD);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request cancelled!\n", me);
-               }
-       } 
-       else if (me == 1) 
-       {
-           MPI_Barrier(MPI_COMM_WORLD);
-           data = 0;
-           MPI_Recv(&data, 1, MPI_INT, 0, 1, MPI_COMM_WORLD,&status);
-           if (data != 7) {
-               err1++;
-               printf("task %d ERROR: Send request not cancelled!\n", me);
-           }
-           
-           MPI_Recv(&data, 1, MPI_INT, 0, 5, MPI_COMM_WORLD,&status);
-           if (data != 6) {
-               err1++;
-               printf("task %d ERROR: Send request not cancelled!\n", me);
-           }
-           MPI_Barrier(MPI_COMM_WORLD);
-       }
-       else {
-           /* These are needed when the size of MPI_COMM_WORLD > 2 */
-           MPI_Barrier( MPI_COMM_WORLD );
-           MPI_Barrier( MPI_COMM_WORLD );
-       }
-       
-       errs = err0 + err1;
-       MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-           
-       if ( errs ) {
-           printf( "Test failed with %d errors.\n", errs );
-       }
-       if (me == 0 && toterrs == 0) {
-           printf( " No Errors\n" );
-       }
-             
-       MPI_Finalize();
-       return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancelissend.c b/teshsuite/smpi/mpich-test/pt2pt/cancelissend.c
deleted file mode 100644 (file)
index 277fb73..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/****************************************************************************
-
-  MESSAGE PASSING INTERFACE TEST CASE SUITE
-  
-  Copyright IBM Corp. 1995
-       
-  IBM Corp. hereby grants a non-exclusive license to use, copy, modify, and
-  distribute this software for any purpose and without fee provided that the
-  above copyright notice and the following paragraphs appear in all copies.
-         
-  IBM Corp. makes no representation that the test cases comprising this
-  suite are correct or are an accurate representation of any standard.
-               
-  In no event shall IBM be liable to any party for direct, indirect, special
-  incidental, or consequential damage arising out of the use of this software
-  even if IBM Corp. has been advised of the possibility of such damage.
-                 
-  IBM CORP. SPECIFICALLY DISCLAIMS ANY WARRANTIES INCLUDING, BUT NOT LIMITED
-  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-  PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS AND IBM
-  CORP. HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
-  ENHANCEMENTS, OR MODIFICATIONS.
-                       
-  ****************************************************************************
-                         
-  These test cases reflect an interpretation of the MPI Standard.  They are
-  are, in most cases, unit tests of specific MPI behaviors.  If a user of any
-  test case from this set believes that the MPI Standard requires behavior
-  different than that implied by the test case we would appreciate feedback.
-  
-  Comments may be sent to:
-  Richard Treumann
-  treumann@kgn.ibm.com
-                                 
-  ****************************************************************************
-*/
-/* 
- * WDG - July 6, 2004
- *
- * This is a modified version that:
- *  Uses a shorter message (in case the implementation uses eager delivery
- *  even with synchronous send)
- *  Allows control of which process is executing the Issend and which the
- *  receive (to simplify debugging)
- */
-#include <stdio.h>
-#include "mpi.h"
-
-int main(int argc, char *argv[])
-{
-       int me, tasks, data, flag;
-       int err0 = 0;
-       int err1 = 0;
-       int errs, toterrs;
-       int master = 1, worker = 0;
-       MPI_Request request;
-       MPI_Status status;
-
-       MPI_Init(&argc,&argv);
-       MPI_Comm_rank(MPI_COMM_WORLD,&me);
-       MPI_Comm_size(MPI_COMM_WORLD,&tasks);
-
-       if (tasks < 2) {
-           printf( "Cancel test requires at least 2 processes\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-
-       /* The original test sent 10000 elements with Issend.  This
-          one uses less data but keeps the array the same size */
-       { int data[100000]; if (me == master)  
-       {
-               MPI_Irecv(data, 1, MPI_INT, worker, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Receive request not cancelled!\n", me);
-               }
-
-               /* This is short enough to use eager but because it is
-                  a Synchronous send, it must still be possible to 
-                  cancel it, even when it is a short message */
-               MPI_Issend(data, 100, MPI_INT, worker, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               for (flag = 0;; )  
-               {
-                       MPI_Test(&request,&flag,&status);
-                       if (flag) break;
-               }
-               
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request not cancelled! (1)\n", me);
-               }
-       }}
-       
-       if (me == master)  
-       {
-               data = 5;
-               MPI_Isend(&data, 1, MPI_INT, worker, 1, MPI_COMM_WORLD,&request);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (!flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request not cancelled! (2)\n", me);
-               }
-               MPI_Barrier(MPI_COMM_WORLD);
-               status.MPI_TAG=MPI_SUCCESS;
-               data = 6;
-               MPI_Send(&data, 1, MPI_INT, worker, 5, MPI_COMM_WORLD);
-               
-               MPI_Isend(&data, 1, MPI_INT, worker, 1, MPI_COMM_WORLD,&request);
-               MPI_Barrier(MPI_COMM_WORLD);
-               MPI_Cancel(&request);
-               MPI_Wait(&request,&status);
-               MPI_Test_cancelled(&status,&flag);
-               if (flag) {
-                   err0++;
-                   printf("task %d ERROR: Send request cancelled!\n", me);
-               }
-       } 
-       else if (me == worker) 
-       {
-           MPI_Barrier(MPI_COMM_WORLD);
-           data = 0;
-           MPI_Recv(&data, 1, MPI_INT, master, 1, MPI_COMM_WORLD,&status);
-           if (data != 6) {
-               err1++;
-               printf("task %d ERROR: Send request not cancelled!\n", me);
-           }
-           
-           MPI_Recv(&data, 1, MPI_INT, master, 5, MPI_COMM_WORLD,&status);
-           if (data != 6) {
-               err1++;
-               printf("task %d ERROR: Send request not cancelled!\n", me);
-           }
-           MPI_Barrier(MPI_COMM_WORLD);
-       }
-       else {
-           /* These are needed when the size of MPI_COMM_WORLD > 2 */
-           MPI_Barrier( MPI_COMM_WORLD );
-           MPI_Barrier( MPI_COMM_WORLD );
-       }
-       
-       errs = err0 + err1;
-       MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-           
-       if ( errs ) {
-           printf( "Test failed with %d errors.\n", errs );
-       }
-       if (me == 0 && toterrs == 0) {
-           printf( " No Errors\n" );
-       }
-             
-       MPI_Finalize();
-       return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/cancelmessages.c b/teshsuite/smpi/mpich-test/pt2pt/cancelmessages.c
deleted file mode 100644 (file)
index 6ca255b..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * This file tests to see if short,eager,and rndv messages can all be 
- * successfully cancelled.  If they cannot be cancelled, then the 
- * program still must successfully complete.
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char *argv[] )
-{
-
-    double       sbuf[20000];
-#ifdef FOO
-    double rbuf[20000];
-#endif
-    int          rank;
-    int          n, flag, size;
-    int          err = 0;
-    int          verbose = 0;
-    MPI_Status   status;
-    MPI_Request  req;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    if (size < 2) {
-       printf( "Cancel test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* Short Message Test */
-    n = 200;
-
-    if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req); 
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag) {
-           err++;
-           printf( "Cancelling a short message failed where it should succeed.\n" );
-       }
-       else if (verbose)
-       {
-           printf("Cancelling a short message succeeded.\n");
-       }
-    }  /* end if rank == 1 */
-
-#ifdef FOO
-/* Note that MPI-2 specifies that status.MPI_ERROR is only set by
-   multiple completion (e.g., MPI_Waitsome) and not by test_cancelled.
-*/
-    MPI_Barrier(MPI_COMM_WORLD); 
-
-    if (rank == 0) {  /* begin if rank == 0 */
-       MPI_Recv( rbuf, n, MPI_DOUBLE, 1, 1, MPI_COMM_WORLD, &status);
-    }  /* end if rank = 0 */
-    else if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req); 
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag && status.MPI_ERROR != MPI_SUCCESS) {
-           err++;
-           printf( "Cancel of a send returned an error in the status field.\n" );
-       }
-         /* end if status.MPI_ERROR */
-    }  /* end if rank == 1 */
-#endif
-
-    MPI_Barrier(MPI_COMM_WORLD);
-
-    /* Eager Message Test */
-    n = 3000;
-
-    if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req);
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag) {
-           err++;
-           printf( "Cancelling an eager message (3000 doubles) failed where it should succeed.\n" );
-       }
-       else if (verbose)
-       {
-           printf("Cancelling an eager message (3000 doubles) succeeded.\n");
-       }
-    }  /* end if rank == 1 */
-
-#ifdef FOO
-    MPI_Barrier(MPI_COMM_WORLD); 
-
-    if (rank == 0) {  /* begin if rank == 0 */
-       MPI_Irecv(rbuf, n, MPI_DOUBLE, 1, 1, MPI_COMM_WORLD, &req );
-       MPI_Wait( &req, &status);
-    }  /* end if rank = 0 */
-    else if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req);
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag && status.MPI_ERROR != MPI_SUCCESS) {
-           err++;
-           printf( "Cancel of a send returned an error in the status field.\n" );
-       }
-       /* end if status.MPI_ERROR */
-    }  /* end if rank == 1 */
-#endif
-
-    MPI_Barrier(MPI_COMM_WORLD);
-
-    /* Rndv Message Test */
-    n = 20000;
-
-    if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req);
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag) {
-           err++;
-           printf( "Cancelling a rendezvous message failed (20000 doubles) where it should succeed.\n" );
-       }
-       else if (verbose)
-       {
-           printf("Cancelling an rendezvous message (20000 doubles) succeeded.\n");
-       }
-    }  /* end if rank == 1 */
-
-#ifdef FOO
-    MPI_Barrier(MPI_COMM_WORLD); 
-
-    if (rank == 0) {  /* begin if rank == 0 */
-       MPI_Irecv(rbuf, n, MPI_DOUBLE, 1, 1, MPI_COMM_WORLD, &req );
-       MPI_Wait( &req, &status); 
-    }  /* end if rank = 0 */
-    else if (rank == 1) { /* begin if rank = 1 */
-       MPI_Isend( sbuf, n, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD, &req );
-       MPI_Cancel(&req);
-       MPI_Wait(&req, &status);
-       MPI_Test_cancelled(&status, &flag);
-       if (!flag && status.MPI_ERROR != MPI_SUCCESS) {
-           err++;
-           printf( "Cancel of a send returned an error in the status field.\n" );
-       }
-       /* end if status.MPI_ERROR */
-    }  /* end if rank == 1 */
-#endif
-
-    MPI_Barrier(MPI_COMM_WORLD); 
-
-    if (rank == 1) {  /* begin if rank = 1 */
-       if (err) {
-           printf( "Test failed with %d errors.\n", err );
-       }
-       else {
-           printf( " No Errors\n" );
-       }
-    }
-
-    MPI_Finalize( );
-
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/commit.c b/teshsuite/smpi/mpich-test/pt2pt/commit.c
deleted file mode 100644 (file)
index 09570f0..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This is a test of Type_commit.  This checks to see if Type_commit
- * (or Type_struct) replaces a struct with a contiguous type, and
- * that that type is constructed correctly.
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    int          nsize, n2size;
-    MPI_Aint     nlb, nub, n2lb, n2ub;
-    MPI_Datatype ntype, n2type;
-    MPI_Aint     displs[2];
-    MPI_Datatype types[2];
-    int          blockcounts[2];
-    double       myarray[10];
-    int          err = 0;
-
-    MPI_Init( &argc, &argv );
-    
-    MPI_Address( &myarray[0], &displs[0] );
-    MPI_Address( &myarray[3], &displs[1] );
-    blockcounts[0] = 3;
-    blockcounts[1] = 1;
-    displs[1] = displs[1] - displs[0];
-    displs[0] = 0;
-    types[0] = MPI_DOUBLE;
-    types[1] = MPI_DOUBLE;
-    MPI_Type_struct( 2, blockcounts, displs, types, &ntype );
-    MPI_Type_commit( &ntype );
-
-    MPI_Type_size( ntype, &nsize );
-    MPI_Type_lb( ntype, &nlb );
-    MPI_Type_ub( ntype, &nub );
-
-    if (nlb != 0) {
-       err++;
-       printf( "LB for struct is %d\n", (int)nlb );
-    }
-    if (nub != 4 * sizeof(double)) {
-       err++;
-       printf( "UB for struct is %d != %d\n", (int)nub, 
-               4 * (int)sizeof(double) );
-    }
-    if (nsize != 4 * sizeof(double)) {
-       err++;
-       printf( "Size for struct %d != %d\n", nsize, 4 * (int)sizeof(double) );
-    }
-
-    MPI_Type_contiguous( 3, ntype, &n2type );
-    MPI_Type_commit( &n2type );
-
-    MPI_Type_size( n2type, &n2size );
-    MPI_Type_lb( n2type, &n2lb );
-    MPI_Type_ub( n2type, &n2ub );
-
-    if (n2size != 3 * nsize) {
-       err++;
-       printf( "Size of contig type %d != %d\n", n2size, 3*nsize );
-    }
-    if (n2lb != 0) {
-       err++;
-       printf( "LB for contig is %d\n", (int)n2lb );
-    }
-    if (n2ub != 3 * nub) {
-       err++;
-       printf( "UB for contig %d != %d\n", (int)n2ub, 3 * (int)nub );
-    }
-
-    if (err) {
-       printf( "Found %d errors\n", err );
-    }
-    else {
-       printf( " No Errors\n" );
-    }
-    MPI_Type_free( &ntype );
-    MPI_Type_free( &n2type );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/dataalign.c b/teshsuite/smpi/mpich-test/pt2pt/dataalign.c
deleted file mode 100644 (file)
index a04bd9a..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#include "test.h"
-#include <stdio.h>
-#include "mpi.h"
-#include <ctype.h>
-
-
-int main( int argc, char *argv[])
-{
-       struct a {      int     i;
-                       char    c;
-               } s[10], s1[10];
-       int j;
-       int errs = 0, toterrs;
-       int rank, size, tsize;
-       MPI_Aint text;
-       int blens[2]; 
-       MPI_Aint disps[2];
-       MPI_Datatype bases[2];
-       MPI_Datatype str, con;
-       MPI_Status status;
-
-       MPI_Init( &argc, &argv );
-
-       MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-       MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-       for( j = 0; j < 10; j ++ ) {
-               s[j].i = j + rank;
-               s[j].c = j + rank + 'a';
-       }
-
-       blens[0] = blens[1] = 1;
-       disps[0] = 0; disps[1] = sizeof(int);
-       bases[0] = MPI_INT; bases[1] = MPI_CHAR;
-       MPI_Type_struct( 2, blens, disps, bases, &str );
-       MPI_Type_commit( &str );
-       MPI_Type_contiguous( 10, str, &con );
-       MPI_Type_commit( &con );
-       MPI_Type_size( con, &tsize );
-       MPI_Type_extent( con, &text );
-
-#ifdef DEBUG
-       printf("Size of MPI array is %d, extent is %d\n", tsize, text );
-#endif
-
-#ifdef DEBUG
-        {
-       void * p1, *p2;
-       p1 = s;
-       p2 = &(s[10].i);  /* This statement may fail on some systems */
-       printf("C array starts at %p and ends at %p for a length of %d\n",
-               s, &(s[9].c), (char *)p2-(char *)p1 );
-        }
-#endif
-       MPI_Type_extent( str, &text );
-#ifdef DEBUG
-       MPI_Type_size( str, &tsize );
-       printf("Size of MPI struct is %d, extent is %d\n", tsize, (int)text );
-       printf("Size of C struct is %d\n", sizeof(struct a) );
-#endif
-       if (text != sizeof(struct a)) {
-           printf( "Extent of struct a (%d) does not match sizeof (%d)\n",
-                   (int)text, (int)sizeof(struct a) );
-           errs++;
-       }
-
-       MPI_Send( s, 1, con, rank ^ 1, 0, MPI_COMM_WORLD );
-       MPI_Recv( s1, 1, con, rank ^ 1, 0, MPI_COMM_WORLD, &status );
-
-       for( j = 0; j < 10; j++ ) {
-#ifdef DEBUG       
-               printf("%d Sent: %d %c, Got: %d %c\n", rank,
-                       s[j].i, s[j].c, s1[j].i, s1[j].c );
-#endif
-               if ( s1[j].i != j + status.MPI_SOURCE ) {
-                   errs++;
-                   printf( "Got s[%d].i = %d; expected %d\n", j, s1[j].i,
-                           j + status.MPI_SOURCE );
-               }
-               if ( s1[j].c != 'a' + j + status.MPI_SOURCE ) {
-                   errs++;
-                   /* If the character is not a printing character, 
-                      this can generate an file that diff, for example,
-                      believes is a binary file */
-                   if (isprint( (int)(s1[j].c) )) {
-                       printf( "Got s[%d].c = %c; expected %c\n", j, s1[j].c,
-                               j + status.MPI_SOURCE + 'a');
-                   }
-                   else {
-                       printf( "Got s[%d].c = %x; expected %c\n", j, (int)s1[j].c,
-                               j + status.MPI_SOURCE + 'a');
-                   }
-               }
-       }
-
-       MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-       if (rank == 0) {
-           if (toterrs > 0) printf( "Found %d errors\n", toterrs );
-           else             printf( " No Errors\n" );
-       }
-       MPI_Type_free( &str );
-       MPI_Type_free( &con );
-       MPI_Finalize();
-       return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/dtypelife.c b/teshsuite/smpi/mpich-test/pt2pt/dtypelife.c
deleted file mode 100644 (file)
index baa3d11..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Program to test that datatypes that are freed with MPI_TYPE_FREE
- * are not actually deleted until communication that they are a part of
- * has completed.
- *
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-static int src  = 1;
-static int dest = 0;
-
-/* Prototypes for picky compilers */
-void Generate_Data ( int *, int );
-
-void Generate_Data(buffer, buff_size)
-int *buffer;
-int buff_size;
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = i+1;
-}
-
-int main( int argc, char **argv)
-{
-    int rank; /* My Rank (0 or 1) */
-    int tag, count, i, errcnt = 0;
-    MPI_Request handle;
-    double data[100];
-    MPI_Status status;
-    MPI_Datatype rowtype;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    tag    = 2001;
-    count  = 1;
-    for (i = 0; i < 100; i++)
-       data[i] = i;
-    MPI_Type_vector( 10, 1, 10, MPI_DOUBLE, &rowtype );
-    MPI_Type_commit( &rowtype );
-    if (rank == src) { 
-       MPI_Irecv(data, count, rowtype, dest, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Type_free( &rowtype );
-       MPI_Recv( (void *)0, 0, MPI_INT, dest, tag+1, 
-                 MPI_COMM_WORLD, &status );
-       MPI_Wait( &handle, &status );
-       /* Check for correct data */
-       for (i = 0; i < 10; i++) if (data[i*10] != i*10) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv row-row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 10.0*i );
-           }
-
-    } else if (rank == dest) {
-       MPI_Send( (void *)0, 0, MPI_INT, src, tag+1, MPI_COMM_WORLD );
-       /* By using an Ssend first, we make sure that the Irecv doesn't
-          match until after the type has been freed */
-       MPI_Isend( data, count, rowtype, src, tag, MPI_COMM_WORLD, 
-                 &handle );
-       MPI_Type_free( &rowtype );
-       MPI_Wait( &handle, &status );
-       }
-
-    i = errcnt;
-    MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (errcnt > 0) {
-       printf( "Found %d errors in the run\n", errcnt );
-       }
-    Test_Waitforall( );
-    MPI_Finalize();
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/dtyperecv.c b/teshsuite/smpi/mpich-test/pt2pt/dtyperecv.c
deleted file mode 100644 (file)
index a65e484..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
-> so, my second question:
-> 
->   2. what is the output of that MPI program?
-> 
-> i think it should be 42 -1 42 -1.
-> 
-> but compiling with mpich-1.1.0 an running on solaris machines
-> (ch_p4) writes : 42 -1 42 0.
-> 
-> thanks,
->     Holger
-> 
-> MPI code:
-> -------------------------------------------------------
-*/
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-int main( int argc, char **argv )
-{
-  int my_rank, i, data[6];
-  MPI_Status  status;
-  MPI_Datatype  my_type;
-  int errs = 0, toterrs;
-
-  MPI_Init(&argc, &argv);
-  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-
-  MPI_Type_vector(2, 1, 2, MPI_INT, &my_type);
-  MPI_Type_commit(&my_type);
-
-  if (my_rank == 0) {
-    data[0]=42;data[1]=42;
-    MPI_Send(&(data[0]), 2, MPI_INT, 1, 42, MPI_COMM_WORLD);
-  } else {
-    for (i=0; i<6; i++)
-      data[i] = -1;
-    MPI_Recv(&(data[0]), 2, my_type, 0, 42, MPI_COMM_WORLD, &status);
-    /* Check for correct receipt */
-    if (data[0] != 42 || data[1] != -1 || data[2] != 42 || data[3] != -1 
-       || data[4] != -1 || data[5] != -1) {
-       errs++;
-       for (i=0; i<4; i++)
-           printf("%i ",data[i]);
-       printf("\n");
-    }
-  }
-  MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (my_rank == 0) {
-      if (toterrs > 0) printf( "Found %d errors\n", toterrs );
-      else             printf( " No Errors\n" );
-  }
-
-  MPI_Type_free( &my_type );
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/dtypes.c b/teshsuite/smpi/mpich-test/pt2pt/dtypes.c
deleted file mode 100644 (file)
index efcd4a0..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-/* This file contains code to generate a variety of MPI datatypes for testing
-   the various MPI routines. 
-
- To simplify the test code, this generates an array of datatypes, buffers with
- data and buffers with no data (0 bits) for use in send and receive 
- routines of various types.
-
-  In addition, this doesn't even test all of the possibilities.  For example,
-  there is currently no test of sending more than one item defined with 
-  MPI_Type_contiguous .
-
-  This routine should be extended as time permits.
-
-  Note also that this test assumes that the sending and receive types are
-  the same.  MPI requires only that the type signatures match, which is
-  a weaker requirement.
-
-  THIS CODE IS FROM mpich/tsuite AND SHOULD BE CHANGED THERE ONLY
- */
-
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "dtypes.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/* Change this to test only the basic, predefined types */
-static int basic_only = 0;
-
-/* 
-   Arrays types, inbufs, outbufs, and counts are allocated by the
-   CALLER.  n on input is the maximum number; on output, it is the
-   number defined .
-   names contains a string identifying the test
-
-   See AllocateForData below for a routine to allocate these arrays.
-
-   We may want to add a routine to call to check that the proper data
-   has been received.
- */
-/* TYPECNT is the number of instances of each type in a test */
-#define TYPECNT 10
-#define SETUPBASICTYPE(mpi,c,name) { int i; c *a; \
-if (cnt > *n) {*n = cnt; return; }\
-types[cnt] = mpi; \
-inbufs[cnt] = (void *)calloc( TYPECNT,sizeof(c) ); \
-outbufs[cnt] = (void *)malloc( sizeof(c) * TYPECNT ); \
-a = (c *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = i; \
-a = (c *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = 0; \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Basic type %s", name );\
-counts[cnt]  = TYPECNT; bytesize[cnt] = sizeof(c) * TYPECNT; cnt++; }
-
-#define SETUPCONTIGTYPE(mpi,c,name) { int i; c *a; \
-if (cnt > *n) {*n = cnt; return; }\
-MPI_Type_contiguous( TYPECNT, mpi, types + cnt );\
-MPI_Type_commit( types + cnt );\
-inbufs[cnt] = (void *)calloc( TYPECNT, sizeof(c) ); \
-outbufs[cnt] = (void *)malloc( sizeof(c) * TYPECNT ); \
-a = (c *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = i; \
-a = (c *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = 0; \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Contig type %s", name );\
-counts[cnt]  = 1;  bytesize[cnt] = sizeof(c) * TYPECNT; cnt++; }
-
-/* These are vectors of block length one.  */
-#define STRIDE 9
-#define SETUPVECTORTYPE(mpi,c,name) { int i; c *a; \
-if (cnt > *n) {*n = cnt; return; }\
-MPI_Type_vector( TYPECNT, 1, STRIDE, mpi, types + cnt );\
-MPI_Type_commit( types + cnt );\
-inbufs[cnt] = (void *)calloc( sizeof(c) * TYPECNT * STRIDE,1); \
-outbufs[cnt] = (void *)calloc( sizeof(c) * TYPECNT * STRIDE,1); \
-a = (c *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i*STRIDE] = i; \
-a = (c *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i*STRIDE] = 0; \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Vector type %s", name );\
-counts[cnt]  = 1;  bytesize[cnt] = sizeof(c) * TYPECNT * STRIDE ;cnt++; }
-
-/* This indexed type is setup like a contiguous type .
-   Note that systems may try to convert this to contiguous, so we'll
-   eventually need a test that has holes in it */
-#define SETUPINDEXTYPE(mpi,c,name) { int i; int *lens, *disp; c *a; \
-if (cnt > *n) {*n = cnt; return; }\
-lens = (int *)malloc( TYPECNT * sizeof(int) ); \
-disp = (int *)malloc( TYPECNT * sizeof(int) ); \
-for (i=0; i<TYPECNT; i++) { lens[i] = 1; disp[i] = i; } \
-MPI_Type_indexed( TYPECNT, lens, disp, mpi, types + cnt );\
-free( lens ); free( disp ); \
-MPI_Type_commit( types + cnt );\
-inbufs[cnt] = (void *)calloc( TYPECNT, sizeof(c) ); \
-outbufs[cnt] = (void *)malloc( sizeof(c) * TYPECNT ); \
-a = (c *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = i; \
-a = (c *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i] = 0; \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Index type %s", name );\
-counts[cnt]  = 1;  bytesize[cnt] = sizeof(c) * TYPECNT; cnt++; }
-
-/* This defines a structure of two basic members; by chosing things like
-   (char, double), various packing and alignment tests can be made */
-#define SETUPSTRUCT2TYPE(mpi1,c1,mpi2,c2,name,tname) { int i; \
-MPI_Datatype b[3]; int cnts[3]; \
-struct name { c1 a1; c2 a2; } *a, samp; \
-MPI_Aint disp[3]; \
-b[0] = mpi1; b[1] = mpi2; b[2] = MPI_UB;\
-cnts[0] = 1; cnts[1] = 1; cnts[2] = 1;\
-MPI_Address( &(samp.a2), &disp[1] ); \
-MPI_Address( &(samp.a1), &disp[0] ); \
-MPI_Address( &(samp) + 1, &disp[2] ); \
-disp[1] = disp[1] - disp[0]; disp[2] = disp[2] - disp[0]; disp[0] = 0; \
-if (cnt > *n) {*n = cnt; return; }\
-MPI_Type_struct( 3, cnts, disp, b, types + cnt );\
-MPI_Type_commit( types + cnt );\
-inbufs[cnt] = (void *)calloc( sizeof(struct name) * TYPECNT,1); \
-outbufs[cnt] = (void *)calloc( sizeof(struct name) * TYPECNT,1); \
-a = (struct name *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) { a[i].a1 = i; \
- a[i].a2 = i; } \
-a = (struct name *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) { a[i].a1 = 0; \
- a[i].a2 = 0; } \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Struct type %s", tname );\
-counts[cnt]  = TYPECNT;  bytesize[cnt] = sizeof(struct name) * TYPECNT;cnt++; }
-
-/* This accomplished the same effect as VECTOR, but allow a count of > 1 */
-#define SETUPSTRUCTTYPEUB(mpi,c,name) { int i; c *a; \
-int blens[2];  MPI_Aint disps[2]; MPI_Datatype mtypes[2]; \
-if (cnt > *n) {*n = cnt; return; }\
-blens[0] = 1; blens[1] = 1; disps[0] = 0; disps[1] = STRIDE * sizeof(c); \
-mtypes[0] = mpi; mtypes[1] = MPI_UB; \
-MPI_Type_struct( 2, blens, disps, mtypes, types + cnt );\
-MPI_Type_commit( types + cnt );\
-inbufs[cnt] = (void *)calloc( sizeof(c) * TYPECNT * STRIDE,1); \
-outbufs[cnt] = (void *)calloc( sizeof(c) * TYPECNT * STRIDE,1); \
-a = (c *)inbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i*STRIDE] = i; \
-a = (c *)outbufs[cnt]; for (i=0; i<TYPECNT; i++) a[i*STRIDE] = 0; \
-names[cnt] = (char *)malloc(100);\
-sprintf( names[cnt], "Struct (MPI_UB) type %s", name );\
-counts[cnt]  = TYPECNT;  bytesize[cnt] = sizeof(c) * TYPECNT * STRIDE;cnt++; }
-
-/* 
- * Set whether only the basic types should be generated
- */
-void BasicDatatypesOnly( void )
-{
-    basic_only = 1;
-}
-
-static int nbasic_types = 0;
-/* On input, n is the size of the various buffers.  On output, 
-   it is the number available types 
- */
-void GenerateData( MPI_Datatype *types, void **inbufs, void **outbufs, 
-                  int *counts, int *bytesize, char **names, int *n )
-{
-int cnt = 0;   /* Number of defined types */
-
-/* First, generate an element of each basic type */
-SETUPBASICTYPE(MPI_CHAR,char,"MPI_CHAR");
-SETUPBASICTYPE(MPI_SHORT,short,"MPI_SHORT");
-SETUPBASICTYPE(MPI_INT,int,"MPI_INT");
-SETUPBASICTYPE(MPI_LONG,long,"MPI_LONG");
-SETUPBASICTYPE(MPI_UNSIGNED_CHAR,unsigned char,"MPI_UNSIGNED_CHAR");
-SETUPBASICTYPE(MPI_UNSIGNED_SHORT,unsigned short,"MPI_UNSIGNED_SHORT");
-SETUPBASICTYPE(MPI_UNSIGNED,unsigned,"MPI_UNSIGNED");
-SETUPBASICTYPE(MPI_UNSIGNED_LONG,unsigned long,"MPI_UNSIGNED_LONG");
-SETUPBASICTYPE(MPI_FLOAT,float,"MPI_FLOAT");
-SETUPBASICTYPE(MPI_DOUBLE,double,"MPI_DOUBLE");
-SETUPBASICTYPE(MPI_BYTE,char,"MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-SETUPBASICTYPE(MPI_LONG_LONG_INT,long long,"MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-SETUPBASICTYPE(MPI_LONG_DOUBLE,long double,"MPI_LONG_DOUBLE");
-#endif
-nbasic_types = cnt;
-
- if (basic_only) {
-     *n = cnt;
-     return;
- }
-/* Generate contiguous data items */
-SETUPCONTIGTYPE(MPI_CHAR,char,"MPI_CHAR");
-SETUPCONTIGTYPE(MPI_SHORT,short,"MPI_SHORT");
-SETUPCONTIGTYPE(MPI_INT,int,"MPI_INT");
-SETUPCONTIGTYPE(MPI_LONG,long,"MPI_LONG");
-SETUPCONTIGTYPE(MPI_UNSIGNED_CHAR,unsigned char,"MPI_UNSIGNED_CHAR");
-SETUPCONTIGTYPE(MPI_UNSIGNED_SHORT,unsigned short,"MPI_UNSIGNED_SHORT");
-SETUPCONTIGTYPE(MPI_UNSIGNED,unsigned,"MPI_UNSIGNED");
-SETUPCONTIGTYPE(MPI_UNSIGNED_LONG,unsigned long,"MPI_UNSIGNED_LONG");
-SETUPCONTIGTYPE(MPI_FLOAT,float,"MPI_FLOAT");
-SETUPCONTIGTYPE(MPI_DOUBLE,double,"MPI_DOUBLE");
-SETUPCONTIGTYPE(MPI_BYTE,char,"MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-SETUPCONTIGTYPE(MPI_LONG_LONG_INT,long long,"MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-SETUPCONTIGTYPE(MPI_LONG_DOUBLE,long double,"MPI_LONG_DOUBLE");
-#endif
-
-/* Generate vector items */
-SETUPVECTORTYPE(MPI_CHAR,char,"MPI_CHAR");
-SETUPVECTORTYPE(MPI_SHORT,short,"MPI_SHORT");
-SETUPVECTORTYPE(MPI_INT,int,"MPI_INT");
-SETUPVECTORTYPE(MPI_LONG,long,"MPI_LONG");
-SETUPVECTORTYPE(MPI_UNSIGNED_CHAR,unsigned char,"MPI_UNSIGNED_CHAR");
-SETUPVECTORTYPE(MPI_UNSIGNED_SHORT,unsigned short,"MPI_UNSIGNED_SHORT");
-SETUPVECTORTYPE(MPI_UNSIGNED,unsigned,"MPI_UNSIGNED");
-SETUPVECTORTYPE(MPI_UNSIGNED_LONG,unsigned long,"MPI_UNSIGNED_LONG");
-SETUPVECTORTYPE(MPI_FLOAT,float,"MPI_FLOAT");
-SETUPVECTORTYPE(MPI_DOUBLE,double,"MPI_DOUBLE");
-SETUPVECTORTYPE(MPI_BYTE,char,"MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-SETUPVECTORTYPE(MPI_LONG_LONG_INT,long long,"MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-SETUPVECTORTYPE(MPI_LONG_DOUBLE,long double,"MPI_LONG_DOUBLE");
-#endif
-
-/* Generate indexed items */
-SETUPINDEXTYPE(MPI_CHAR,char,"MPI_CHAR");
-SETUPINDEXTYPE(MPI_SHORT,short,"MPI_SHORT");
-SETUPINDEXTYPE(MPI_INT,int,"MPI_INT");
-SETUPINDEXTYPE(MPI_LONG,long,"MPI_LONG");
-SETUPINDEXTYPE(MPI_UNSIGNED_CHAR,unsigned char,"MPI_UNSIGNED_CHAR");
-SETUPINDEXTYPE(MPI_UNSIGNED_SHORT,unsigned short,"MPI_UNSIGNED_SHORT");
-SETUPINDEXTYPE(MPI_UNSIGNED,unsigned,"MPI_UNSIGNED");
-SETUPINDEXTYPE(MPI_UNSIGNED_LONG,unsigned long,"MPI_UNSIGNED_LONG");
-SETUPINDEXTYPE(MPI_FLOAT,float,"MPI_FLOAT");
-SETUPINDEXTYPE(MPI_DOUBLE,double,"MPI_DOUBLE");
-SETUPINDEXTYPE(MPI_BYTE,char,"MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-SETUPINDEXTYPE(MPI_LONG_LONG_INT,long long,"MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-SETUPINDEXTYPE(MPI_LONG_DOUBLE,long double,"MPI_LONG_DOUBLE");
-#endif
-
-/* Generate struct items */ 
-SETUPSTRUCT2TYPE(MPI_CHAR,char,MPI_DOUBLE,double,d1,"char-double")
-SETUPSTRUCT2TYPE(MPI_DOUBLE,double,MPI_CHAR,char,d2,"double-char")
-SETUPSTRUCT2TYPE(MPI_UNSIGNED,unsigned,MPI_DOUBLE,double,d3,"unsigned-double")
-SETUPSTRUCT2TYPE(MPI_FLOAT,float,MPI_LONG,long,d4,"float-long")
-SETUPSTRUCT2TYPE(MPI_UNSIGNED_CHAR,unsigned char,MPI_CHAR,char,d5,
-  "unsigned char-char")
-SETUPSTRUCT2TYPE(MPI_UNSIGNED_SHORT,unsigned short,MPI_DOUBLE,double,d6,
-  "unsigned short-double")
-
-/* Generate struct using MPI_UB */
-SETUPSTRUCTTYPEUB(MPI_CHAR,char,"MPI_CHAR");
-SETUPSTRUCTTYPEUB(MPI_SHORT,short,"MPI_SHORT");
-SETUPSTRUCTTYPEUB(MPI_INT,int,"MPI_INT");
-SETUPSTRUCTTYPEUB(MPI_LONG,long,"MPI_LONG");
-SETUPSTRUCTTYPEUB(MPI_UNSIGNED_CHAR,unsigned char,"MPI_UNSIGNED_CHAR");
-SETUPSTRUCTTYPEUB(MPI_UNSIGNED_SHORT,unsigned short,"MPI_UNSIGNED_SHORT");
-SETUPSTRUCTTYPEUB(MPI_UNSIGNED,unsigned,"MPI_UNSIGNED");
-SETUPSTRUCTTYPEUB(MPI_UNSIGNED_LONG,unsigned long,"MPI_UNSIGNED_LONG");
-SETUPSTRUCTTYPEUB(MPI_FLOAT,float,"MPI_FLOAT");
-SETUPSTRUCTTYPEUB(MPI_DOUBLE,double,"MPI_DOUBLE");
-SETUPSTRUCTTYPEUB(MPI_BYTE,char,"MPI_BYTE");
-
-/* 60 different entries to this point + 4 for long long and 
-   4 for long double */
-*n = cnt;
-}
-
-/* 
-   MAX_TEST should be 1 + actual max (allows us to check that it was, 
-   indeed, large enough) 
- */
-#define MAX_TEST 70
-void AllocateForData( MPI_Datatype **types, void ***inbufs, void ***outbufs, 
-                     int **counts, int **bytesize, char ***names, int *n )
-{
-    *types    = (MPI_Datatype *)malloc( MAX_TEST * sizeof(MPI_Datatype) );
-    *inbufs   = (void **) malloc( MAX_TEST * sizeof(void *) );
-    *outbufs  = (void **) malloc( MAX_TEST * sizeof(void *) );
-    *names    = (char **) malloc( MAX_TEST * sizeof(char *) );
-    *counts   = (int *)   malloc( MAX_TEST * sizeof(int) );
-    *bytesize = (int *)   malloc( MAX_TEST * sizeof(int) );
-    *n       = MAX_TEST;
-}
-
-int CheckData( void *inbuf, void *outbuf, int size_bytes )
-{
-    char *in = (char *)inbuf, *out = (char *)outbuf;
-    int  i;
-    for (i=0; i<size_bytes; i++) {
-       if (in[i] != out[i]) {
-           return i + 1;
-       }
-    }
-    return 0;
-}
-
-/* 
- * This is a version of CheckData that prints error messages
- */
-int CheckDataAndPrint( void *inbuf, void *outbuf, int size_bytes, 
-                      char *typename, int typenum )
-{
-    int errloc, world_rank;
-    
-    if ((errloc = CheckData( inbuf, outbuf, size_bytes ))) {
-       char *p1, *p2;
-       MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-       fprintf( stderr, 
-        "Error in data with type %s (type %d on %d) at byte %d of %d\n", 
-                typename, typenum, world_rank, errloc - 1, size_bytes );
-       p1 = (char *)inbuf;
-       p2 = (char *)outbuf;
-       fprintf( stderr, 
-                "Got %x expected %x\n", p2[errloc-1], p1[errloc-1] );
-#if 0
-       MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                 0, 0 );
-#endif
-    }
-    return errloc;
-}
-
-void FreeDatatypes( MPI_Datatype *types, void **inbufs, void **outbufs, 
-                   int *counts, int *bytesize, char **names, int n )
-{
-    int i;
-    for (i=0; i<n; i++) {
-       if (inbufs[i]) 
-           free( inbufs[i] );
-       if (outbufs[i]) 
-           free( outbufs[i] );
-       free( names[i] );
-       /* Only if not basic ... */
-       if (i >= nbasic_types) 
-           MPI_Type_free( types + i );
-    }
-    free( inbufs );
-    free( outbufs );
-    free( names );
-    free( counts );
-    free( bytesize );
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/dtypes.h b/teshsuite/smpi/mpich-test/pt2pt/dtypes.h
deleted file mode 100644 (file)
index 7aabe29..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef MPITEST_DTYPES
-#define MPITEST_DTYPES
-
-void GenerateData ( MPI_Datatype *, void **, void **, int *, int *,
-                             char **, int * );
-void AllocateForData ( MPI_Datatype **, void ***, void ***, 
-                                int **, int **, char ***, int * );
-int CheckData ( void *, void *, int );
-int CheckDataAndPrint ( void *, void *, int, char *, int );
-void FreeDatatypes ( MPI_Datatype *, void **, void **, 
-                              int *, int *, char **, int );
-void BasicDatatypesOnly( void );
-#endif
diff --git a/teshsuite/smpi/mpich-test/pt2pt/exittest.c b/teshsuite/smpi/mpich-test/pt2pt/exittest.c
deleted file mode 100644 (file)
index 09f4c92..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/*
-  A report was made that this program hung on a 2 processor LINUX cluster.
-  We haven't seen that problem, but since this does test whether process 0
-  waits for the other processes to complete before exiting, it is a good
-  test to have.
- */
-#include <stdio.h>
-#include "mpi.h"
-#define MAX_NUM_PROCS 10
-
-int main( int argc, char *argv[])
-{
-  int idx;
-  int num_procs,my_id;
-  int s;
-  int r;
-  MPI_Status status;
-
-  MPI_Init(&argc,&argv);
-  MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
-  MPI_Comm_rank(MPI_COMM_WORLD,&my_id);
-  
-  if (num_procs < 3)
-    {
-    fprintf(stderr, "Need at least 3 processes for this bug\n");
-    MPI_Finalize();
-    return 0;
-    }
-
-#ifdef DEBUG  
-  fprintf(stderr, "%d Starting ....\n", my_id);
-  fflush(stderr);
-#endif
-  
-  if (my_id == 1)
-    {
-    idx = 2;
-    s = 333;
-#ifdef DEBUG
-    fprintf(stdout, "%d start send (%d) to %d\n", my_id, s, idx);
-    fflush(stdout);
-#endif
-    MPI_Send(&s, 1, MPI_INT, idx, 0, MPI_COMM_WORLD);
-#ifdef DEBUG
-    fprintf(stdout, "%d finished send to %d\n", my_id, idx);
-    fflush(stdout);
-#endif
-    }
-  
-  if (my_id == 2)
-    {
-    idx = 1;
-#ifdef DEBUG
-    fprintf(stdout, "%d start recv from %d\n", my_id, idx);
-    fflush(stdout);
-#endif
-    MPI_Recv (&r, 1, MPI_INT, idx, 0, MPI_COMM_WORLD, &status );
-#ifdef DEBUG
-    fprintf(stdout, "%d finished recv (%d) from %d\n", my_id, r, idx);
-    fflush(stdout);
-#endif
-    }
-
-#ifdef DBUG  
-  fprintf(stdout, "%d Done ....\n",my_id);
-  fflush(stdout);
-#endif  
-  MPI_Barrier( MPI_COMM_WORLD );
-  if (my_id == 0) {
-      /* If we reach here, we're done */
-      printf( " No Errors\n" );
-  }
-
-  MPI_Finalize();
-  return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/README b/teshsuite/smpi/mpich-test/pt2pt/fairness/README
deleted file mode 100644 (file)
index 61bb15e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-These are programs to test the fairness of mpi.
-On some underlying devices, you don't want to know the
-results...
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness-euih.c b/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness-euih.c
deleted file mode 100644 (file)
index 332cc05..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* 
- * Program to test the fairness of the MPI implementation over source.
- * All of the programs wait on a barrier, then node 0 starts receiving
- * small messages using ANY_SOURCE from all of the other nodes who
- * send as much as they can.  Node 0 collects statistics on the rate
- * messages are received from each source. (Every N messages it
- * prints out what percentage of the last N received were from each
- * source. It does this for <size-1> times.
- *
- * This program should be run with at least 8 nodes just to be (un)fair
- *
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- */
-
-#include <stdio.h>
-#include "test.h"
-#define MPG 200
-#define MSZ 1
-
-int 
-main(argc, argv)
-int argc;
-char **argv;
-{
-    int rank, size, an_int[MSZ]; 
-    int dummy[4], d1, d2;
-    char *Current_Test = NULL;
-    int *num_array, i, j;
-    int dontcare, allgrp;
-    
-    /* Initialize the environment */
-    mp_environ(&size,&rank);
-
-    /* Get allgrp from the task */
-    d1 = 4; d2 = 3;
-    mp_task_query(dummy,&d1,&d2);
-    allgrp = dummy[3];
-    dontcare = dummy[0];
-
-    Test_Init("fairness", rank);
-
-    /* Wait for everyone to be ready */
-    if (rank == 0) { 
-       /* Initialize an array to keep statistics in */
-       num_array = (int *)malloc((size - 1) * sizeof(int));
-
-       mp_sync(&allgrp);
-       
-       for (i = 0; i < size - 1; i++) {
-           /* Clear the buffer of counts */
-           memset(num_array, 0, (size - 1) * sizeof(int));
-           for (j = 0; j < MPG; j++) {
-               d1 = sizeof(int)*MSZ;
-               d2 = 2000;
-               mp_brecv(an_int, &d1, &dontcare, &d2);
-               num_array[d1 - 1]++;
-           }
-           Test_Printf("Statistics for message group %d:\n", i + 1);
-           for (j = 0; j < size -1 ; j++)
-               Test_Printf("%f%% of last %d messages received \
-were from source %d.\n",
-                           num_array[j]*100.0/MPG, MPG, j + 1);
-       }
-       free(num_array);
-       (void)Summarize_Test_Results();
-    } else {
-       mp_sync(&allgrp);
-       for (i = 0; i < MPG; i++) {
-           int d3, d4;
-
-           d1 = MSZ*sizeof(int);
-           d2 = 0;
-           d3 = 2000;
-           d4 = 0;
-           mp_bend(an_int, &d1, &d2, &d3, &d4);
-       }
-    }
-
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness.c b/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness.c
deleted file mode 100644 (file)
index 804162e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* 
- * Program to test the fairness of the MPI implementation over source.
- * All of the programs wait on a barrier, then node 0 starts receiving
- * small messages using ANY_SOURCE from all of the other nodes who
- * send as much as they can.  Node 0 collects statistics on the rate
- * messages are received from each source. (Every N messages it
- * prints out what percentage of the last N received were from each
- * source. It does this for <size-1> times.
- *
- * This program should be run with at least 8 nodes just to be (un)fair
- *
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-#define MPG 200
-#define MSZ 1
-int main(argc, argv)
-int argc;
-char **argv;
-{
-    int rank, size, an_int[MSZ]; 
-    char *Current_Test = NULL;
-    int *num_array, i, j;
-    MPI_Status Status;
-    
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-    Test_Init("fairness", rank);
-
-    /* Wait for everyone to be ready */
-    
-    if (rank == 0) { 
-       /* Initialize an array to keep statistics in */
-       num_array = (int *)malloc((size - 1) * sizeof(int));
-
-       MPI_Barrier(MPI_COMM_WORLD);
-       
-       for (i = 0; i < size - 1; i++) {
-           /* Clear the buffer of counts */
-           memset(num_array, 0, (size - 1) * sizeof(int));
-           for (j = 0; j < MPG; j++) {
-               MPI_Recv(an_int, MSZ, MPI_INT, MPI_ANY_SOURCE, 2000, 
-                        MPI_COMM_WORLD, &Status);
-               num_array[Status.MPI_SOURCE - 1]++;
-           }
-           Test_Printf("Statistics for message group %d:\n", i + 1);
-           for (j = 0; j < size -1 ; j++)
-               Test_Printf("%f%% of last %d messages received \
-were from source %d.\n",
-                           num_array[j]*100.0/MPG, MPG, j + 1);
-       }
-       free(num_array);
-       (void)Summarize_Test_Results();
-       MPI_Finalize();
-
-    } else {
-       MPI_Barrier(MPI_COMM_WORLD);
-       for (i = 0; i < MPG; i++) {
-           MPI_Send(an_int, MSZ, MPI_INT, 0, 2000, MPI_COMM_WORLD);
-       }
-       MPI_Finalize();
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2.c b/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2.c
deleted file mode 100644 (file)
index 5e295d5..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * This program should be run with at least 8 nodes just to (un)fair
- *
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
-    int rank, size, an_int; 
-    char *Current_Test = NULL;
-    int *num_array, i, j;
-    MPI_Status Status;
-    
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-    Test_Init("fairness2", rank);
-
-    /* Wait for everyone to be ready */
-    
-    if (rank == 0) { 
-       /* Initialize an array to keep statistics in */
-       num_array = (int *)malloc((size - 1) * sizeof(int));
-
-       /* Make sure everyone is ready */
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       /* Wait for all of the senders to send all of their messages */
-       Test_Message("Waiting for all of the senders to say they're through.");
-       for (i = 0 ; i < size - 1; i++)
-           MPI_Recv(&an_int, 1, MPI_INT, MPI_ANY_SOURCE, 5000,
-                    MPI_COMM_WORLD, &Status);
-       
-       Test_Message("Starting to dequeue messages...");
-       /* Now start dequeuing messages */
-       for (i = 0; i < size - 1; i++) {
-           /* Clear the buffer of counts */
-           memset(num_array, 0, (size - 1) * sizeof(int));
-           for (j = 0; j < 200; j++) {
-               MPI_Recv(&an_int, 1, MPI_INT, MPI_ANY_SOURCE, 2000, 
-                        MPI_COMM_WORLD, &Status);
-               num_array[Status.MPI_SOURCE - 1]++;
-           }
-           Test_Printf("Statistics for message group %d:\n", i + 1);
-           for (j = 0; j < size -1 ; j++)
-               Test_Printf("%f%% of last 200 messages received \
-were from source %d.\n",
-                           num_array[j]/2.0, j + 1);
-       }
-
-       free(num_array);
-       (void)Summarize_Test_Results();
-       MPI_Finalize();
-
-    } else {
-       MPI_Request ReqArray[200];
-       MPI_Status StatArray[200];
-       
-       MPI_Barrier(MPI_COMM_WORLD);
-       an_int = rank;
-       
-       Test_Message("About to send all of the little messages.");
-       /* Send 200 tiny messages - nonblocking so we don't deadlock */
-       for (i = 0; i < 200; i++)
-           MPI_Isend(&an_int, 1, MPI_INT, 0, 2000, MPI_COMM_WORLD, 
-                     &ReqArray[i]);
-
-       Test_Message("Sending the final message.");
-       /* Tell receiver we've sent all of our messages */
-       MPI_Send(&an_int, 1, MPI_INT, 0, 5000, MPI_COMM_WORLD);
-       Test_Message("Waiting on the nonblocking requests.");
-       MPI_Waitall(200,ReqArray,StatArray);
-       (void)Summarize_Test_Results();
-       MPI_Finalize();
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2m.c b/teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2m.c
deleted file mode 100644 (file)
index 706a95d..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * This program should be run with at least 8 nodes just to (un)fair
- *
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-#include "mpe.h"
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
-    int rank, size, an_int; 
-    char *Current_Test = NULL;
-    int *num_array, i, j;
-    MPI_Status Status;
-    
-    MPI_Init(&argc, &argv);
-    MPE_Init_log();
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-    Test_Init("fairness2m", rank);
-
-    /* Wait for everyone to be ready */
-    
-    if (rank == 0) { 
-       /* Initialize an array to keep statistics in */
-       num_array = (int *)malloc((size - 1) * sizeof(int));
-
-       /* Make sure everyone is ready */
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       /* Wait for all of the senders to send all of their messages */
-       Test_Message("Waiting for all of the senders to say they're through.");
-       for (i = 0 ; i < size - 1; i++) {
-           MPI_Recv(&an_int, 1, MPI_INT, MPI_ANY_SOURCE, 5000,
-                    MPI_COMM_WORLD, &Status);
-           MPE_Log_receive(Status.MPI_SOURCE, 5000, sizeof(int));
-       }
-       Test_Message("Starting to dequeue messages...");
-       /* Now start dequeuing messages */
-       for (i = 0; i < size - 1; i++) {
-           /* Clear the buffer of counts */
-           memset(num_array, 0, (size - 1) * sizeof(int));
-           for (j = 0; j < 200; j++) {
-               MPI_Recv(&an_int, 1, MPI_INT, MPI_ANY_SOURCE, 2000, 
-                        MPI_COMM_WORLD, &Status);
-               MPE_Log_receive(Status.MPI_SOURCE, 2000, sizeof(int));
-               num_array[Status.MPI_SOURCE - 1]++;
-           }
-           Test_Printf("Statistics for message group %d:\n", i + 1);
-           for (j = 0; j < size -1 ; j++)
-               Test_Printf("%f%% of last 200 messages received \
-were from source %d.\n",
-                           num_array[j]/2.0, j + 1);
-       }
-
-       free(num_array);
-       (void)Summarize_Test_Results();
-
-       MPE_Finish_log("/home/bridges/fairness2.log");
-       MPI_Finalize();
-
-    } else {
-       MPI_Request ReqArray[200];
-       MPI_Status StatArray[200];
-       
-       MPI_Barrier(MPI_COMM_WORLD);
-       an_int = rank;
-       
-       Test_Message("About to send all of the little messages.");
-       /* Send 200 tiny messages - nonblocking so we don't deadlock */
-       for (i = 0; i < 200; i++) {
-           MPI_Isend(&an_int, 1, MPI_INT, 0, 2000, MPI_COMM_WORLD, 
-                     &ReqArray[i]);
-           MPE_Log_send(0, 2000, sizeof(int));
-       }
-       Test_Message("Sending the final message.");
-       /* Tell receiver we've sent all of our messages */
-       MPI_Send(&an_int, 1, MPI_INT, 0, 5000, MPI_COMM_WORLD);
-       MPE_Log_send(0, 5000, sizeof(int));
-
-       Test_Message("Waiting on the nonblocking requests.");
-       MPI_Waitall(200,ReqArray,StatArray);
-       (void)Summarize_Test_Results();
-
-       MPE_Finish_log("/home/bridges/fairness2.log");
-       MPI_Finalize();
-    }
-
-    return 0;
-}
-
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fairness/fairnessm.c b/teshsuite/smpi/mpich-test/pt2pt/fairness/fairnessm.c
deleted file mode 100644 (file)
index 709d08a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 
- * Program to test the fairness of the MPI implementation over source.
- * All of the programs wait on a barrier, then node 0 starts receiving
- * small messages using ANY_SOURCE from all of the other nodes who
- * send as much as they can.  Node 0 collects statistics on the rate
- * messages are received from each source. (Every N messages it
- * prints out what percentage of the last N received were from each
- * source. It does this for <size-1> times.
- *
- * This program should be run with at least 8 nodes just to be (un)fair
- *
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-#include "mpe.h"
-#define MPG 25
-#define MSZ 1
-
-int main(argc, argv)
-int argc;
-char **argv;
-{
-    int rank, size, an_int[MSZ]; 
-    char *Current_Test = NULL;
-    int *num_array, i, j;
-    MPI_Status Status;
-    
-    MPI_Init(&argc, &argv);
-    MPE_Init_log();
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-    Test_Init("fairnessm", rank);
-
-    /* Wait for everyone to be ready */
-    
-    if (rank == 0) { 
-       /* Initialize an array to keep statistics in */
-       num_array = (int *)malloc((size - 1) * sizeof(int));
-       MPID_SetRecvDebugFlag(1);
-       MPI_Barrier(MPI_COMM_WORLD);
-       
-       for (i = 0; i < size - 1; i++) {
-           /* Clear the buffer of counts */
-           memset(num_array, 0, (size - 1) * sizeof(int));
-           for (j = 0; j < MPG; j++) {
-               MPI_Recv(an_int, MSZ, MPI_INT, MPI_ANY_SOURCE, 2000, 
-                        MPI_COMM_WORLD, &Status);
-               MPE_Log_receive(Status.MPI_SOURCE, 2000, MSZ * sizeof(int));
-               num_array[Status.MPI_SOURCE - 1]++;
-           }
-           Test_Printf("Statistics for message group %d:\n", i + 1);
-           for (j = 0; j < size -1 ; j++)
-               Test_Printf("%f%% of last %d messages received \
-were from source %d.\n",
-                           num_array[j]/2.0, MPG, j + 1);
-       }
-       free(num_array);
-       (void)Summarize_Test_Results();
-       MPE_Finish_log("/home/bridges/fairness.log");
-       MPI_Finalize();
-
-    } else {
-       MPI_Barrier(MPI_COMM_WORLD);
-       for (i = 0; i < MPG; i++) {
-           MPI_Send(an_int, MSZ, MPI_INT, 0, 2000, MPI_COMM_WORLD);
-           MPE_Log_send(0, 2000, MSZ * sizeof(int));
-       }
-       MPE_Finish_log("/home/bridges/fairness.log");
-       MPI_Finalize();
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fifth.c b/teshsuite/smpi/mpich-test/pt2pt/fifth.c
deleted file mode 100644 (file)
index d06c907..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-    int rank, np, data = 777;
-    MPI_Request handle[4];
-    MPI_Status status[4];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-    if (np < 4) {
-      MPI_Finalize();
-      printf( "4 processors or more required, %d done\n", rank );
-      return(1);
-    }
-
-    if (rank == 0) {
-      MPI_Isend( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle[0] );
-      MPI_Irecv( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle[1] );
-      MPI_Isend( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle[2] );
-      MPI_Irecv( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle[3] );
-      MPI_Waitall ( 4, handle, status );
-    }
-    else if (rank == 1) {
-      MPI_Irecv( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle[0] );
-      MPI_Isend( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle[1] );
-      MPI_Isend( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle[2] );
-      MPI_Irecv( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle[3] );
-      MPI_Waitall ( 4, handle, status );
-    }
-    else if (rank == 2) {
-      MPI_Isend( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle[0] );
-      MPI_Irecv( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle[1] );
-      MPI_Irecv( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle[2] );
-      MPI_Isend( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle[3] );
-      MPI_Waitall ( 4, handle, status );
-    }
-    else if (rank == 3) {
-      MPI_Irecv( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle[0] );
-      MPI_Isend( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle[1] );
-      MPI_Irecv( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle[2] );
-      MPI_Isend( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle[3] );
-      MPI_Waitall ( 4, handle, status );
-    }
-    Test_Waitforall( );
-    MPI_Finalize();
-    return(0);
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/flood.c b/teshsuite/smpi/mpich-test/pt2pt/flood.c
deleted file mode 100644 (file)
index 684ac73..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-
-#define MAX_REQ 16
-#define DEF_MAX_MSG 2000000
-/* 
-   This program tests a flood of data for both unexpected and expected messages   to test any internal message fragmentation or protocol shifts
-
-   An optional argument can change the maximum message size.  For example, use
-      flood 9000000
-   to stress the memory system (the size is the number of ints, not bytes)
- */
-
-void SetupData ( int *, int, int );
-void SetupRdata ( int *, int );
-int  CheckData ( int *, int, int, MPI_Status * );
-
-#ifdef VERBOSE
-static int verbose = 1;
-#else
-static int verbose = 0;
-#endif
-
-int main( int argc, char **argv )
-{
-    MPI_Comm comm;
-    MPI_Request r[MAX_REQ];
-    MPI_Status  s[MAX_REQ];
-    int msgsize, maxmsg, root, i, size, rank, err = 0, toterr;
-    int max_msg_size = DEF_MAX_MSG;
-    int *sbuf, *rbuf;
-
-    MPI_Init( &argc, &argv );
-
-    comm = MPI_COMM_WORLD;
-
-    MPI_Comm_size( comm, &size );
-    MPI_Comm_rank( comm, &rank );
-
-    if (size < 2) {
-       printf( "This test requires at least 2 processors\n" );
-       MPI_Abort( comm, 1 );
-    }
-
-    /* Check for a max message argument */
-    if (rank == 0) {
-       if (argc > 1) {
-           max_msg_size = atoi( argv[1] );
-           /* Correct if unrecognized argument */
-           if (max_msg_size <= 0) max_msg_size = DEF_MAX_MSG;
-       }
-    }
-    MPI_Bcast( &max_msg_size, 1, MPI_INT, 0, MPI_COMM_WORLD );
-
-    /* First, try large blocking sends to root */
-    root = 0;
-    
-    msgsize = 128;
-    maxmsg  = max_msg_size;
-    if (rank == root && verbose) printf( "Blocking sends: " );
-    while (msgsize < maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               SetupRdata( rbuf, msgsize );
-               MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-               err += CheckData( rbuf, msgsize, 2*i, s );
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           MPI_Ssend( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    /* Next, try unexpected messages with Isends */
-    msgsize = 128;
-    maxmsg  = max_msg_size;
-    if (rank == root && verbose) printf( "Unexpected recvs: " );
-    while (msgsize < maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           MPI_Barrier( comm );
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               SetupRdata( rbuf, msgsize );
-               MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-               err += CheckData( rbuf, msgsize, 2*i, s );
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           MPI_Isend( sbuf, msgsize, MPI_INT, root, 2*rank, comm, r );
-           MPI_Barrier( comm );
-           MPI_Wait( r, s );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    /* Try large synchronous blocking sends to root */
-    root = 0;
-    
-    msgsize = 128;
-    maxmsg  = max_msg_size;
-    if (rank == root && verbose) printf( "Synchronous sends: " );
-    while (msgsize < maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               SetupRdata( rbuf, msgsize );
-               MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-               err += CheckData( rbuf, msgsize, 2*i, s );
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           MPI_Send( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    /* Next, try expected messages with Rsend */
-    msgsize = 128;
-    maxmsg  = max_msg_size;
-    if (rank == root && verbose) printf( "Expected recvs and Rsend: " );
-    while (msgsize < maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               SetupRdata( rbuf, msgsize );
-               MPI_Irecv( rbuf, msgsize, MPI_INT, i, 2*i, comm, r );
-               MPI_Send( MPI_BOTTOM, 0, MPI_INT, i, 2*i+1, comm );
-               MPI_Wait( r, s );
-               err += CheckData( rbuf, msgsize, 2*i, s );
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           MPI_Recv( MPI_BOTTOM, 0, MPI_INT, root, 2*rank+1, comm, s );
-           MPI_Send( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    
-    if (rank == 0) {
-       if (toterr == 0) printf( " No Errors\n" );
-       else printf( "!! found %d errors\n", toterr );
-    }
-    if (toterr) {
-       printf( "!! found %d errors on processor %d\n", err, rank );
-    }
-
-    MPI_Finalize( );
-    return 0;
-}
-
-void SetupData( sbuf, n, tag )
-int *sbuf, n, tag;
-{
-    int i;
-
-    for (i=0; i<n; i++) 
-       sbuf[i] = i;
-}
-
-int CheckData( rbuf, n, tag, s )
-int *rbuf, n, tag;
-MPI_Status *s;
-{
-    int act_n, i;
-
-    MPI_Get_count( s, MPI_INT, &act_n );
-    if (act_n != n) {
-       printf( "Received %d instead of %d ints\n", act_n, n );
-       return 1;
-    }
-    for (i=0; i<n; i++) {
-       if (rbuf[i] != i) {
-           printf( "rbuf[%d] is %d, should be %d\n", i, rbuf[i], i );
-           printf( "rbuf[%d] is 0x%x, should be 0x%x\n", i, rbuf[i], i );
-           return 1;
-       }
-    }
-    return 0;
-}
-
-void SetupRdata( rbuf, n )
-int *rbuf, n;
-{
-    int i;
-    
-    for (i=0; i<n; i++) rbuf[i] = -(i+1);
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/flood2.c b/teshsuite/smpi/mpich-test/pt2pt/flood2.c
deleted file mode 100644 (file)
index 855d38e..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-
-#define MAX_REQ 32
-#define MAX_MSG_CNT 32000
-#define MAX_MSG 2048
-/* 
-   This program tests a flood of data of short messages to test handling
-   of both incoming messages and internal message queues
- */
-
-void SetupData ( int *, int, int );
-void SetupRdata ( int *, int );
-int  CheckData ( int *, int, int, MPI_Status * );
-
-#ifdef VERBOSE
-static int verbose = 1;
-#else
-static int verbose = 0;
-#endif
-
-
-int main( int argc, char **argv )
-{
-    MPI_Comm comm;
-    MPI_Request r[MAX_REQ];
-    MPI_Status  s[MAX_REQ];
-    int msgsize, maxmsg, root, i, j, size, rank, err = 0, msgcnt, toterr;
-    int *sbuf, *rbuf;
-
-    MPI_Init( &argc, &argv );
-    
-    comm = MPI_COMM_WORLD;
-
-    MPI_Comm_size( comm, &size );
-    MPI_Comm_rank( comm, &rank );
-
-    if (size < 2) {
-       printf( "This test requires at least 2 processors\n" );
-       MPI_Abort( comm, 1 );
-    }
-
-    /* First, try large blocking sends to root */
-    root = 0;
-    
-    maxmsg =  MAX_MSG;
-    msgsize = 128;
-    msgcnt  = MAX_MSG_CNT;
-    if (rank == root && verbose) printf( "Blocking sends: " );
-    while (msgsize <= maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               for (j=0; j<msgcnt; j++) {
-                   SetupRdata( rbuf, msgsize );
-                   MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-                   err += CheckData( rbuf, msgsize, 2*i, s );
-               }
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           for (j=0; j<msgcnt; j++) 
-               MPI_Ssend( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    /* Next, try unexpected messages with Isends */
-    msgsize = 128;
-    maxmsg  = MAX_MSG;
-    msgcnt  = MAX_REQ;
-    if (rank == root && verbose) printf( "Unexpected recvs: " );
-    while (msgsize <= maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           MPI_Barrier( comm );
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               for (j=0; j<msgcnt; j++) {
-                   SetupRdata( rbuf, msgsize );
-                   MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-                   err += CheckData( rbuf, msgsize, 2*i, s );
-               }
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           for (j=0; j<msgcnt; j++) {
-               MPI_Isend( sbuf, msgsize, MPI_INT, root, 2*rank, comm, &r[j] );
-           }
-           MPI_Barrier( comm );
-           MPI_Waitall( msgcnt, r, s );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    /* Try large synchronous blocking sends to root */
-    root = 0;
-    
-    msgsize = 128;
-    maxmsg  = MAX_MSG;
-    if (rank == root && verbose) printf( "Synchronous sends: " );
-    while (msgsize <= maxmsg) {
-       if (rank == root) {
-           if (verbose) { printf( "%d ", msgsize ); fflush( stdout ); }
-           rbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!rbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           for (i=0; i<size; i++) {
-               if (i == rank) continue;
-               for (j=0; j<msgcnt; j++) {
-                   SetupRdata( rbuf, msgsize );
-                   MPI_Recv( rbuf, msgsize, MPI_INT, i, 2*i, comm, s );
-                   err += CheckData( rbuf, msgsize, 2*i, s );
-               }
-           }
-           free( rbuf );
-       }
-       else {
-           sbuf = (int *)malloc( msgsize * sizeof(int) );
-           if (!sbuf) {
-               printf( "Could not allocate %d words\n", msgsize );
-               MPI_Abort( comm, 1 );
-           }
-           SetupData( sbuf, msgsize, 2*rank );
-           for (j=0; j<msgcnt; j++) 
-               MPI_Ssend( sbuf, msgsize, MPI_INT, root, 2*rank, comm );
-           free( sbuf );
-       }
-       msgsize *= 4;
-    }
-    if (rank == 0 && verbose) { printf( "\n" ); fflush( stdout ); }
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    
-    if (rank == 0) {
-       if (toterr == 0) printf( " No Errors\n" );
-       else printf( "!! found %d errors\n", toterr );
-    }
-    if (toterr) {
-       printf( "!! found %d errors on processor %d\n", err, rank );
-    }
-
-    MPI_Finalize( );
-    return 0;
-}
-
-void SetupData( sbuf, n, tag )
-int *sbuf, n, tag;
-{
-    int i;
-
-    for (i=0; i<n; i++) 
-       sbuf[i] = i;
-}
-
-int CheckData( rbuf, n, tag, s )
-int *rbuf, n, tag;
-MPI_Status *s;
-{
-    int act_n, i;
-
-    MPI_Get_count( s, MPI_INT, &act_n );
-    if (act_n != n) {
-       printf( "Received %d instead of %d ints\n", act_n, n );
-       return 1;
-    }
-    for (i=0; i<n; i++) {
-       if (rbuf[i] != i) {
-           printf( "rbuf[%d] is %d, should be %d\n", i, rbuf[i], i );
-           return 1;
-       }
-    }
-    return 0;
-}
-
-void SetupRdata( rbuf, n )
-int *rbuf, n;
-{
-    int i;
-    
-    for (i=0; i<n; i++) rbuf[i] = -(i+1);
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/fourth.c b/teshsuite/smpi/mpich-test/pt2pt/fourth.c
deleted file mode 100644 (file)
index 84c30a5..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-    int rank, np, data = 777;
-    MPI_Request handle;
-    MPI_Status status;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-    if (np < 4) {
-      MPI_Finalize();
-      printf( "4 processors or more required, %d done\n", rank );
-      return(1);
-    }
-
-    if (rank == 0) {
-      MPI_Isend( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-    }
-    else if (rank == 1) {
-      MPI_Irecv( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-    }
-    else if (rank == 2) {
-      MPI_Isend( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 3, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-    }
-    else if (rank == 3) {
-      MPI_Irecv( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 2, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Irecv( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-      MPI_Isend( &data, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &handle );
-      MPI_Wait( &handle, &status );
-    }
-    Test_Waitforall( );
-    MPI_Finalize();
-    return(0);
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/gcomm.c b/teshsuite/smpi/mpich-test/pt2pt/gcomm.c
deleted file mode 100644 (file)
index 3bbb3dd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* 
-    This file generates a few communicators for use in the test suite
-
-    THIS CODE IS FROM mpich/tsuite AND SHOULD BE CHANGED THERE ONLY
- */
-
-#include "mpi.h"
-
-#include "gcomm.h"
-
-void MakeComms( comms, maxn, n, make_intercomm )
-MPI_Comm *comms;
-int      *n, maxn, make_intercomm;
-{
-int cnt = 0;
-int rank, size;
-int dims[2];
-int periods[2], range[1][3];
-MPI_Group group, newgroup;
-
-MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-comms[cnt++] = MPI_COMM_WORLD;
-if (cnt == maxn) {*n = cnt; return; }
-
-/* Construct a communicator with the ranks reversed */
-MPI_Comm_group( MPI_COMM_WORLD, &group );
-range[0][0] = size-1;
-range[0][1] = 0;
-range[0][2] = -1;
-MPI_Group_range_incl( group, 1, range, &newgroup );
-MPI_Comm_create( MPI_COMM_WORLD, newgroup, &comms[cnt] );
-cnt++;
-//MPI_Group_free( &group );
-//MPI_Group_free( &newgroup );
-if (cnt == maxn) {*n = cnt; return; }
-
-if (size > 3) {
-    /* Divide into odd and even processes */
-    MPI_Comm_split( MPI_COMM_WORLD, rank & 0x1, rank, comms + cnt );
-    cnt ++;
-
-    /* Use the cartesian constructors */
-    dims[0] = 0; dims[1] = 0;
-    MPI_Dims_create( size, 2, dims );
-    periods[0] = 0; periods[1] = 0;
-    MPI_Cart_create( MPI_COMM_WORLD, 2, dims, periods, 0, comms + cnt );
-    cnt ++;
-    if (cnt == maxn) {*n = cnt; return; }
-
-    /* Create an intercommunicator (point-to-point operations only)
-       Note that in this case, codes need to use MPI_Comm_remote_size to
-       (added to MPI_Comm_size) to get the size of the full group */
-    if (make_intercomm) {
-       /* The remote_leader is rank 1 in MPI_COMM_WORLD if we are even
-          and 0 if we are odd (the remote_leader rank is relative to the
-          peer communicator) 
-        */
-       MPI_Intercomm_create( comms[2], 0, MPI_COMM_WORLD, !(rank&0x1), 
-                             37, comms + cnt );
-       cnt ++;
-       if (cnt == maxn) {*n = cnt; return; }
-       }
-    }
-*n = cnt;
-}
-
-void FreeComms( comms, n )
-MPI_Comm *comms;
-int      n;
-{
-int i;
-for (i=1; i<n; i++) {
-    if (comms[i] != MPI_COMM_NULL) 
-       MPI_Comm_free( comms + i );
-    }
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/gcomm.h b/teshsuite/smpi/mpich-test/pt2pt/gcomm.h
deleted file mode 100644 (file)
index 9eee1df..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef MPITEST_GCOMMS
-#define MPITEST_GCOMMS
-
-void MakeComms ( MPI_Comm *, int, int *, int );
-void FreeComms ( MPI_Comm *, int );
-#endif
diff --git a/teshsuite/smpi/mpich-test/pt2pt/getelm.c b/teshsuite/smpi/mpich-test/pt2pt/getelm.c
deleted file mode 100644 (file)
index 517c07a..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * This is a test of getting the number of basic elements
- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-typedef struct { 
-    int len;
-    double data[1000];
-    } buf_t;
-
-int main( int argc, char **argv )
-{
-    int err = 0, toterr;
-    MPI_Datatype contig1, varstruct1, oldtypes[2], varstruct2;
-    MPI_Aint     displs[2];
-    int          blens[2];
-    MPI_Comm     comm;
-    MPI_Status   status;
-    int          world_rank;
-    int          rank, size, partner, count, i;
-    int          send_ibuf[4], recv_ibuf[4];
-    buf_t        send_buf, recv_buf;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-
-/* Form the datatypes */
-    MPI_Type_contiguous( 4, MPI_INT, &contig1 );
-    MPI_Type_commit( &contig1 );
-    blens[0] = 1;
-    blens[1] = 1000;
-    oldtypes[0] = MPI_INT;
-    oldtypes[1] = MPI_DOUBLE;
-/* Note that the displacement for the data is probably double aligned */
-    MPI_Address( &send_buf.len, &displs[0] );
-    MPI_Address( &send_buf.data[0], &displs[1] );
-/* Make relative */
-    displs[1] = displs[1] - displs[0];
-    displs[0] = 0;
-    MPI_Type_struct( 2, blens, displs, oldtypes, &varstruct1 );
-    MPI_Type_commit( &varstruct1 );
-
-    comm = MPI_COMM_WORLD;
-
-    MPI_Comm_size( comm, &size );
-    MPI_Comm_rank( comm, &rank );
-
-    if (size < 2) {
-       fprintf( stderr, "This test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    if (rank == size - 1) {
-       partner = 0;
-       /* Send contiguous data */
-       for (i=0; i<4; i++) 
-           send_ibuf[i] = i;
-       MPI_Send( send_ibuf, 1, contig1, partner, 0, comm );
-
-       /* Send partial structure */
-       blens[1] = 23;
-       MPI_Type_struct( 2, blens, displs, oldtypes, &varstruct2 );
-       MPI_Type_commit( &varstruct2 );
-
-       MPI_Send( &send_buf, 1, varstruct2, partner, 1, comm );
-       MPI_Type_free( &varstruct2 );
-
-       /* Send NO data */
-       MPI_Send( MPI_BOTTOM, 0, MPI_INT, partner, 2, comm );
-    }
-    else if (rank == 0) {
-       partner = size - 1;
-       MPI_Recv( recv_ibuf, 1, contig1, partner, 0, comm, &status );
-       MPI_Get_count( &status, MPI_INT, &count );
-       if (count != 4) {
-           err++;
-           fprintf( stderr, 
-                    "Wrong count for contig recv MPI_INT; got %d expected %d\n",
-                    count, 4 );
-       }
-       MPI_Get_count( &status, contig1, &count );
-       if (count != 1) {
-           err++;
-           fprintf( stderr, 
-                    "Wrong count for contig recv (contig); got %d expected %d\n",
-                    count, 1 );
-       }
-       MPI_Get_elements( &status, contig1, &count );
-       if (count != 4) {
-           err++;
-           fprintf( stderr, 
-                    "Wrong elements for contig recv contig; got %d expected %d\n",
-                    count, 4 );
-       }
-
-       /* Now, try the partial structure */
-       MPI_Recv( &recv_buf, 1, varstruct1, partner, 1, comm, &status );
-       MPI_Get_elements( &status, varstruct1, &count );
-       if (count != 24) {
-           err++;
-           fprintf( stderr, 
-                    "Wrong number of elements for struct recv; got %d expected %d\n", 
-                    count, 24 );
-       }
-
-       {
-           /* Receive nothing using a 0-sized type */
-           MPI_Datatype ztype;
-           MPI_Type_contiguous( 0, MPI_INT, &ztype );
-           MPI_Type_commit( &ztype );
-           MPI_Recv( &recv_buf, 10, ztype, partner, 2, comm, &status );
-           /* Current clarification requires 0 for the result */
-           MPI_Get_elements( &status, ztype, &count );
-           if (count != 0) {
-               err++;
-               fprintf( stderr, 
-                        "Wrong number of elements for 0-size datatype; got %d\n",
-                        count );
-           }
-           MPI_Get_count( &status, ztype, &count );
-           if (count != 0) {
-               err++;
-               fprintf( stderr, 
-                        "Wrong count for 0-size datatype; got %d\n",
-                        count );
-           }
-           MPI_Type_free( &ztype );
-       }
-    }
-    MPI_Type_free( &contig1 );
-    MPI_Type_free( &varstruct1 );
-    
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-           if (toterr == 0) 
-               printf( " No Errors\n" );
-           else
-               printf( "Found %d errors in MPI_Get_elements\n", toterr );
-    }
-    MPI_Finalize( );
-    return toterr;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hindexed.c b/teshsuite/smpi/mpich-test/pt2pt/hindexed.c
deleted file mode 100644 (file)
index 24df469..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-/* stdlib.h needed for malloc declaration */
-#include <stdlib.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- * This file tests MPI_Type_hindexed by describing parts of a triangular
- * matrix, stored in a square matrix, and sending sending it.
- * 
- * The matrix is stored in column-major, and the tests use
- * MPI_Type_vector or MPI_Type_struct to define the elements that are sent
- */
-
-int main( int argc, char **argv )
-{
-    MPI_Datatype rowtype, mattype;
-    int          *sbuf, *rbuf;
-    int          rank, mat_n;
-    static int   blens[2] = { 1, 1 };
-    MPI_Datatype types[2] = { MPI_INT, MPI_UB };
-    int          *mat_blens, i ;
-    MPI_Aint     *mat_displs;
-    MPI_Aint     displs[2];
-    MPI_Status   status;
-    int          err, row, col;
-
-    MPI_Init( &argc, &argv );
-
-    err = 0;
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    mat_n = 10;
-    sbuf = (int *) malloc( mat_n * mat_n * sizeof(int) );
-    rbuf = (int *) malloc( mat_n * mat_n * sizeof(int) );
-    if (!sbuf || !rbuf) {
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* Define a row type based on a strided struct type */
-    displs[0] = 0;
-    displs[1] = mat_n*sizeof(int);
-    MPI_Type_struct( 2, blens, displs, types, &rowtype );
-     MPI_Type_commit( &rowtype ); 
-
-    /* Define an hindexed type that defines all of the rows of the
-       triangular part of sbuf */
-    
-    mat_blens = (int *)malloc( mat_n * sizeof(int) );
-    mat_displs = (MPI_Aint *)malloc( mat_n * sizeof(MPI_Aint) );
-    for (i=0; i<mat_n; i++) {
-       mat_blens[i] = mat_n - i;
-       MPI_Address( &sbuf[i + i * mat_n], &mat_displs[i] );
-       if (i != 0)
-           mat_displs[i] = mat_displs[i] - mat_displs[0];
-    }
-    mat_displs[0] = 0;
-    MPI_Type_hindexed( mat_n, mat_blens, mat_displs, rowtype, &mattype );
-    MPI_Type_commit( &mattype );
-   // MPI_Type_free( &rowtype );
-
-    /* Load up the data */
-    for (i=0; i<mat_n * mat_n; i++) {
-       sbuf[i] = i;
-       rbuf[i] = -i;
-    }
-    
-    /* Send it and receive it in the same order */
-    MPI_Sendrecv( sbuf, 1, mattype, rank, 0, rbuf, 1, mattype, rank, 0, 
-                 MPI_COMM_WORLD, &status );
-
-    for (row = 0; row<mat_n; row++) {
-       for (col = row; col<mat_n; col++) {
-           if (rbuf[row + col*mat_n] != sbuf[row + col*mat_n]) {
-               err++;
-               fprintf( stderr, "mat(%d,%d) = %d, not %d\n",
-                        row, col, rbuf[row+col*mat_n], sbuf[row+col*mat_n] );
-           }
-       }
-    }
-
-    /* Send hindexed and receive contiguous */
-    MPI_Sendrecv( sbuf, 1, mattype, rank, 1, 
-                 rbuf, (mat_n * (mat_n + 1))/2, MPI_INT, rank, 1, 
-                 MPI_COMM_WORLD, &status );
-    i = 0;
-    for (row = 0; row<mat_n; row++) {
-       for (col = row; col<mat_n; col++) {
-           if (rbuf[i] != sbuf[row + col*mat_n]) {
-               err++;
-               fprintf( stderr, "rbuf(%d,%d) = %d, not %d\n",
-                        row, col, rbuf[i], sbuf[row+col*mat_n] );
-           }
-           i++;
-       }
-    }
-
-    MPI_Type_free( &mattype );
-    if (err == 0) printf( "Test passed\n" );
-    else          printf( "Test failed with %d errors\n", err );
-
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hindexed.std b/teshsuite/smpi/mpich-test/pt2pt/hindexed.std
deleted file mode 100644 (file)
index 386f3d2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Test passed
diff --git a/teshsuite/smpi/mpich-test/pt2pt/htmsg.c b/teshsuite/smpi/mpich-test/pt2pt/htmsg.c
deleted file mode 100644 (file)
index 46986c9..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <string.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/* 
-   This is a very simple MPI program which can be used to check things
-   like the behavior of the ADI or heterogeneous code
- */
-int main( int argc, char **argv )
-{
-char msg[10];
-char smsg[10];
-int  rank, size;
-int  src, dest;
-int  count;
-MPI_Status status;
-
-MPI_Init( &argc, &argv );
-MPI_Comm_size( MPI_COMM_WORLD, &size );
-MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-if (size != 2) {
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-    return 1;
-    }
-src  = 1;
-dest = 0;
-if (rank == src) {
-    strcpy( msg, "MPICH!" );
-    MPI_Send( msg, 7, MPI_CHAR, dest, 10, MPI_COMM_WORLD );
-    }
-else {
-    MPI_Recv( smsg, 10, MPI_CHAR, src, 10, MPI_COMM_WORLD, &status );
-    if (status.MPI_TAG != 10) {
-       fprintf( stderr, "Error in status tag!\n" );
-       }
-    if (status.MPI_SOURCE != src) {
-       fprintf( stderr, "Error in status source!\n" );
-       }
-    MPI_Get_count( &status, MPI_CHAR, &count );
-    if (count != 7) {
-       fprintf( stderr, "Error in count, got %d expected 7\n", count );
-       }
-    if (strcmp( smsg, "MPICH!" )) {
-       fprintf( stderr, "Got wrong msg (%s), expected \"MPICH!\"\n", smsg );
-       }
-    }
-
-MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hvec.c b/teshsuite/smpi/mpich-test/pt2pt/hvec.c
deleted file mode 100644 (file)
index 5539b18..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include "mpi.h"
-#include "test.h"
-#include <stdio.h>
-
-/* The original version of this was sent by  
-   empierce@tribble.llnl.gov (Elsie M. Pierce) 
-   I've modified it to fit the automated tests requirements
- */
-/* Prototypes for picky compilers */
-int iinit ( int *, int, int );
-int ilist1 ( int *, int, int, int );
-void Build_vect ( MPI_Datatype * );
-void Build_ctg ( int, MPI_Datatype *, MPI_Datatype * );
-void Get_d5 ( int );
-
-int iinit(a, value, l)
-int *a, value, l;
-{
-  int i;
-  
-  for (i=0; i<l; i++)
-    a[i] = value;
-  return(0);
-}
-
-
-int ilist1(a, mype, pe_out, l)
-int *a, mype, pe_out, l;
-{
-  int i;
-  
-  if (mype == pe_out){
-    for (i=0; i<l; i++)
-      printf("%d ",a[i]);
-    printf("\n");
-  }
-  return(0);
-}
-
-
-void Build_vect(mess_ptr) 
-MPI_Datatype* mess_ptr;
-{
-  int count, bllen, gap, str;
-  
-/*   Define an MPI type with two blocks of 3 integers each, separated */
-/*   by one integer. */
-  count        = 2;
-  bllen        = 3;
-  gap  = 1;
-  str  = bllen + gap;
-
-  MPI_Type_vector(count, bllen, str, MPI_INT, mess_ptr);
-  MPI_Type_commit(mess_ptr);
-  
-}
-
-
-void   Build_ctg(big_offset,messtyp, messtyp2)
-int big_offset;
-MPI_Datatype *messtyp, *messtyp2;
-{
-  int count;
-  MPI_Aint ext;
-    
-  count=3;
-  MPI_Type_extent(*messtyp, &ext);
-  MPI_Type_hvector(count, 1, ext+big_offset, *messtyp, messtyp2);
-  MPI_Type_commit(messtyp2);
-  /*printf( "pack is:\n" );
-  MPIR_PrintDatatypePack( stdout, 1, *messtyp2, 0, 0 );
-  printf( "unpack is:\n" );
-  MPIR_PrintDatatypeUnpack( stdout, 1, *messtyp2, 0, 0 ); */
-}
-  
-
-
-void Get_d5(my_rank)
-int my_rank;
-{
-  MPI_Datatype messtyp, messtyp2;
-  int root=0;
-  int count=1;
-  int big_offset;
-  int intlen;
-#define DL 32
-  
-  int dar[DL];
-     
-  iinit(dar, my_rank, DL);
-  Build_vect(&messtyp);
-  MPI_Bcast(dar, count, messtyp, root, MPI_COMM_WORLD);
-  if (my_rank==1)
-    printf("  0 = Sent, 1 = Not Sent \n%s",
-          "  Vector Type with Gap : \n");
-  ilist1(dar, my_rank, 1, DL);
-
-  intlen = sizeof(int);
-  for (big_offset = -intlen; big_offset<=2*intlen; 
-       big_offset += intlen){
-    if (my_rank==1)
-     printf("\n Three of above vector types combined, with offset = %i ints\n",
-            big_offset/(int)sizeof(int));
-    iinit(dar, my_rank, DL);
-    Build_ctg(big_offset, &messtyp, &messtyp2);
-    MPI_Bcast(dar, count, messtyp2, root, MPI_COMM_WORLD);
-    MPI_Barrier(MPI_COMM_WORLD);
-    MPI_Type_free(&messtyp2);
-    ilist1(dar, my_rank, 1, DL);
-  }
-  MPI_Type_free( &messtyp );
-}
-
-
-
-int main( int argc, char *argv[]) 
-{
-  int my_rank;
-    
-  MPI_Init (&argc, &argv);
-  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
-
-  Get_d5(my_rank);
-  
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hvec.std b/teshsuite/smpi/mpich-test/pt2pt/hvec.std
deleted file mode 100644 (file)
index 93fb40f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-  0 = Sent, 1 = Not Sent 
-  Vector Type with Gap : 
-0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
-
- Three of above vector types combined, with offset = -1 ints
-0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 
-
- Three of above vector types combined, with offset = 0 ints
-0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 
-
- Three of above vector types combined, with offset = 1 ints
-0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 
-
- Three of above vector types combined, with offset = 2 ints
-0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 1 1 1 1 1 
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hvectest.c b/teshsuite/smpi/mpich-test/pt2pt/hvectest.c
deleted file mode 100644 (file)
index 178ef56..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
-    hvectest - test program that sends an array of floats from the first 
-             process of a group to the last, using send and recv and the
-            vector datatype.
-*/
-
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-/* #define SHOWMSG */
-
-#ifdef VERBOSE
-static int verbose = 1;
-#else
-static int verbose = 0;
-#endif
-int main( int argc, char **argv )
-{
-    int rank, size, to, from, tag, count, i;
-    int src, dest;
-    int st_source, st_tag, st_count;
-    int errcnt = 0;
-    MPI_Request handle;
-    MPI_Status status;
-    double data[100];
-    MPI_Datatype rowtype;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    src  = size - 1;
-    dest = 0;
-/*
-    dest  = size - 1;
-    src = 0;
- */
-    MPI_Type_vector( 10, 1, 10, MPI_DOUBLE, &rowtype );
-    MPI_Type_commit( &rowtype );
-    /* First test: send a row */
-    if (rank == src) {
-       to     = dest;
-       count  = 1;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Send( data, count, rowtype, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-
-    if (rank == dest) {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       MPI_Recv(data, count, MPI_DOUBLE, from, tag, MPI_COMM_WORLD,
-                &status ); 
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i]); printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i] != 10*i) { 
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv double) %d'th element = %f, should be %f\n",
-                    rank, i, data[i], 10.0*i );
-           }
-    }
-
-    /* Second test: receive a column into row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Send( data, count, MPI_DOUBLE, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 1;              
-       from  = MPI_ANY_SOURCE;
-       MPI_Recv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &status ); 
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-               st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 1.0*i );
-           }
-    }
-
-    /* Third test: send AND receive a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 1;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Send( data, count, rowtype, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 1;              
-       from  = MPI_ANY_SOURCE;
-       MPI_Recv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &status ); 
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i*10) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv row-row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 10.0*i );
-           }
-    }
-
-    /* Second Set of Tests: Use Isend and Irecv instead of Send and Recv */
-    /* First test: send a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 1;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Isend( data, count, rowtype, to, tag, MPI_COMM_WORLD, &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       MPI_Irecv(data, count, MPI_DOUBLE, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i]); printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i] != 10*i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv double) %d'th element = %f, should be %f\n",
-                    rank, i, data[i], 10.0*i );
-           }
-    }
-
-    /* Second test: receive a column into row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Isend( data, count, MPI_DOUBLE, to, tag, MPI_COMM_WORLD, 
-                  &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 1;              
-       from  = MPI_ANY_SOURCE;
-       MPI_Irecv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 1.0*i );
-           }
-    }
-
-    /* Third test: send AND receive a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 1;
-       tag    = 2001;
-       for (i = 0; i < 100; i++)
-           data[i] = i;
-       /* Send a row */
-       MPI_Isend( data, count, rowtype, to, tag, MPI_COMM_WORLD, &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 1;              
-       from  = MPI_ANY_SOURCE;
-       MPI_Irecv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i*10) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv row-row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 10.0*i );
-           }
-    }
-
-    i = errcnt;
-    MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (errcnt > 0) {
-       printf( "Found %d errors in the run \n", errcnt );
-       }
-    MPI_Type_free( &rowtype );
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/hvectest2.c b/teshsuite/smpi/mpich-test/pt2pt/hvectest2.c
deleted file mode 100644 (file)
index 0414b3d..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
-    hvectest2 - test program that sends an array of floats from the first 
-                process of a group to the last, using send and recv and the
-               struct datatype for variable length vectors
-*/
-
-#include "mpi.h"
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-/* #define SHOWMSG */
-
-/* Prototypes for picky compilers */
-void ClearArray ( double *, int, double );
-void SetArray ( double *, int );
-
-#ifdef VERBOSE
-static int verbose = 1;
-#else
-static int verbose = 0;
-#endif
-
-void ClearArray( a, n, v )
-double *a, v;
-int    n;
-{
-    int i;
-    for (i=0; i<n; i++) a[i] = v;
-}
-
-void SetArray( a, n )
-double *a;
-int    n;
-{
-    int i;
-    for (i=0; i<n; i++) a[i] = (double)i;
-}
-
-/* 
-   This test requires that the MPI implementation support predefined 
-   MPI_Datatypes in static initializers (i.e., they must be compile time
-   constants).  This was voted as a clarification on 4/26/95.
- */
-int main( int argc, char **argv )
-{
-    int rank, size, to, from, tag, count, i;
-    int src, dest;
-    int st_source, st_tag, st_count;
-    int errcnt = 0;
-    MPI_Request handle;
-    MPI_Status status;
-    double data[100];
-    MPI_Datatype rowtype;
-    static int blens[2] = { 1, 1 };
-    MPI_Datatype types[2] = { MPI_DOUBLE, MPI_UB };
-    MPI_Aint displs[2];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* dest writes out the received stats; for the output to be
-       consistant (with the final check), it should be procees 0 */
-    if (argc > 1 && argv[1] && strcmp( "-alt", argv[1] ) == 0) {
-       dest = size - 1;
-       src  = 0;
-       }
-    else {
-       src  = size - 1;
-       dest = 0;
-       }
-
-    displs[0] = 0;
-    displs[1] = 10*sizeof(double);
-/*
-    blens[0]  = 1;
-    blens[1]  = 1;
-    types[0]  = MPI_DOUBLE;
-    types[1]  = MPI_UB;
- */
-    MPI_Type_struct( 2, blens, displs, types, &rowtype );
-    MPI_Type_commit( &rowtype );
-    /* First test: send a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       MPI_Send( data, count, rowtype, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       
-       ClearArray( data, 100, -1.0 );
-       MPI_Recv(data, count, MPI_DOUBLE, from, tag, MPI_COMM_WORLD,
-                &status ); 
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i]); printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i] != 10*i) { 
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv double) %d'th element = %f, should be %f\n",
-                    rank, i, data[i], 10.0*i );
-           }
-    }
-
-    /* Second test: receive a column into row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       /* MPE_Print_datatype_pack_action( stdout, count, 
-                                          MPI_DOUBLE, 0, 0 ); */
-       MPI_Send( data, count, MPI_DOUBLE, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       ClearArray( data, 100, -1.0 );
-       MPI_Recv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &status ); 
-       /* MPE_Print_datatype_unpack_action( stdout, count, rowtype, 0, 0 ); */
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-               st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 1.0*i );
-           }
-    }
-
-    /* Third test: send AND receive a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       MPI_Send( data, count, rowtype, to, tag, MPI_COMM_WORLD );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       ClearArray( data, 100, -1.0 );
-       MPI_Recv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &status ); 
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i*10) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](rcv row-row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 10.0*i );
-           }
-    }
-
-    /* Second Set of Tests: Use Isend and Irecv instead of Send and Recv */
-    /* First test: send a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       MPI_Isend( data, count, rowtype, to, tag, MPI_COMM_WORLD, &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       ClearArray( data, 100, -1.0 );
-       MPI_Irecv(data, count, MPI_DOUBLE, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i]); printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i] != 10*i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv double) %d'th element = %f, should be %f\n",
-                    rank, i, data[i], 10.0*i );
-           }
-    }
-
-    /* Second test: receive a column into row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       MPI_Isend( data, count, MPI_DOUBLE, to, tag, MPI_COMM_WORLD, 
-                  &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       ClearArray( data, 100, -1.0 );
-       MPI_Irecv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 1.0*i );
-           }
-    }
-
-    /* Third test: send AND receive a row */
-    if (rank == src)
-    {
-       to     = dest;
-       count  = 10;
-       tag    = 2001;
-       SetArray( data, 100 );
-       /* Send a row */
-       MPI_Isend( data, count, rowtype, to, tag, MPI_COMM_WORLD, &handle );
-       MPI_Wait( &handle, &status );
-#ifdef SHOWMSG
-       printf("%d sent", rank );
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-    }
-    if (rank == dest)
-    {
-       tag   = MPI_ANY_TAG;
-       count = 10;             
-       from  = MPI_ANY_SOURCE;
-       ClearArray( data, 100, -1.0 );
-       MPI_Irecv(data, count, rowtype, from, tag, MPI_COMM_WORLD,
-                &handle ); 
-       MPI_Wait( &handle, &status );
-
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       MPI_Get_count( &status, MPI_DOUBLE, &st_count );
-
-       if (st_source != src || st_tag != 2001 || st_count != 10 || verbose) {
-           printf( "Status info: source = %d, tag = %d, count = %d\n",
-                   st_source, st_tag, st_count );
-       }
-#ifdef SHOWMSG
-       printf( "%d received", rank);
-       for (i = 0; i < 10; i++) printf(" %f",data[i*10]);printf("\n");
-#endif
-       for (i = 0; i < 10; i++) if (data[i*10] != i*10) {
-           errcnt++;
-           fprintf( stderr, 
-                   "[%d](ircv row-row) %d'th element = %f, should be %f\n",
-                    rank, i, data[i*10], 10.0*i );
-           }
-    }
-
-    i = errcnt;
-    MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (errcnt > 0) {
-       printf( "Found %d errors in the run \n", errcnt );
-       }
-    MPI_Type_free( &rowtype );
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/irecvtest.c b/teshsuite/smpi/mpich-test/pt2pt/irecvtest.c
deleted file mode 100644 (file)
index 446059e..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Program to test that the "no overtaking messages" semantics
- * of point to point communications in MPI is satisfied, 
- * for a simple send/irecv operation.
- *
- * Derived from a program written by 
- *                             Patrick Bridges
- *                             bridges@mcs.anl.gov
- *                             patrick@CS.MsState.Edu
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-
-static int src  = 0;
-static int dest = 1;
-
-/* Which tests to perform (not yet implemented) */
-/* static int Do_Buffer = 1; */
-/* static int Do_Standard = 1; */
-
-/* Prototypes for picky compilers */
-void Generate_Data ( double *, int );
-void Normal_Test_Send ( double *, int );
-void Async_Test_Recv ( double *, int );
-int Check_Data ( double *, int );
-void Clear_Buffer ( double *, int );
-
-void Generate_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = (double)i+1;
-}
-
-#define NSHORT 10
-void Normal_Test_Send(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       MPI_Send(buffer, (buff_size/2 - NSHORT), MPI_DOUBLE, dest, 2000, 
-                MPI_COMM_WORLD);
-       buffer += buff_size/2 - NSHORT;
-       /* Followed by NSHORT short ones */
-       for (i = 0; i < NSHORT; i++)
-           MPI_Send(buffer++, 1, MPI_DOUBLE, dest, 2000, MPI_COMM_WORLD);
-    }
-}
-
-void Async_Test_Recv(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j, req = 0;
-    MPI_Status Stat[22];
-    MPI_Request Hand[22];
-    
-    for (j = 0; j < 2; j++) {
-       /* Receive a long message */
-       MPI_Irecv(buffer, (buff_size/2 - NSHORT), MPI_DOUBLE, src, 
-                2000, MPI_COMM_WORLD, &(Hand[req++]));
-       buffer += buff_size/2 - NSHORT;
-       /* Followed by NSHORT short ones */
-       for (i = 0; i < NSHORT; i++)
-           MPI_Irecv(buffer++, 1, MPI_DOUBLE, src, 2000, 
-                     MPI_COMM_WORLD, &(Hand[req++]));
-    }
-    MPI_Waitall(req, Hand, Stat);
-}
-
-int Check_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    int err = 0;
-
-    for (i = 0; i < buff_size; i++)
-       if (buffer[i] != (i + 1)) {
-           err++;
-           fprintf( stderr, "Value at %d is %f, should be %f\n", i, 
-                   buffer[i], (double)(i+1) );
-           fflush( stderr );
-           if (err > 10) return 1;
-           }
-    return err;
-}
-
-void Clear_Buffer(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = -1;
-}
-
-
-int main( int argc, char **argv)
-{
-    int rank; /* My Rank (0 or 1) */
-    double buffer[SIZE];
-    char *Current_Test = NULL;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    if (rank == src) { 
-       Generate_Data(buffer, SIZE);
-       Normal_Test_Send(buffer, SIZE);
-       Test_Waitforall( );
-       MPI_Finalize();
-
-    } else if (rank == dest) {
-       Test_Init("irecvtest", rank);
-       /* Test 2 */
-       Clear_Buffer(buffer, SIZE);
-       Current_Test = (char*)"Overtaking Test (Normal Send   ->  Async Receive)";
-       Async_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-       Test_Waitforall( );
-
-       MPI_Finalize();
-       {
-           int rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           return rval;
-       }
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/irsend.c b/teshsuite/smpi/mpich-test/pt2pt/irsend.c
deleted file mode 100644 (file)
index 9b690de..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/* Nonblocking ready sends 
-   
-   This is similar to a test in allpair.f, but with an expanded range of
-   datatypes and communicators.
- */
-
-int main( int argc, char **argv )
-{
-    MPI_Datatype *types;
-    void         **inbufs, **outbufs;
-    char         **names;
-    int          *counts, *bytesize, ntype;
-    MPI_Comm     comms[20];
-    int          ncomm = 20, rank, np, partner, tag;
-    int          i, j, k, err, toterr, world_rank, errloc;
-    MPI_Status   status, statuses[2];
-    int          flag, index;
-    char         *obuf;
-    MPI_Request  requests[2];
-
-
-    MPI_Init( &argc, &argv );
-
-    AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                    &names, &ntype );
-    GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-    MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-    err = 0;
-    for (i=0; i<ncomm; i++) {
-       MPI_Comm_rank( comms[i], &rank );
-       MPI_Comm_size( comms[i], &np );
-       if (np < 2) continue;
-       tag = i;
-       for (j=0; j<ntype; j++) {
-           if (world_rank == 0 && verbose) 
-               fprintf( stdout, "Testing type %s\n", names[j] );
-           /* This test does an irsend between both partners, with 
-              a sendrecv after the irecv used to guarentee that the
-              irsend has a matching receive
-              */
-           if (rank == 0) {
-               partner = np - 1;
-#if 0
-               MPIR_PrintDatatypePack( stdout, counts[j], types[j], 0, 0 );
-#endif
-               obuf = outbufs[j];
-               for (k=0; k<bytesize[j]; k++) 
-                   obuf[k] = 0;
-           
-               MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                         comms[i], &requests[0] );
-
-               MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                             MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                             comms[i], &status );
-
-               MPI_Irsend( inbufs[j], counts[j], types[j], partner, tag, 
-                           comms[i], &requests[1] );
-           
-               do {
-                   MPI_Waitany( 2, requests, &index, &status );
-               } while (index != 0);
-
-               /* Always the possiblity that the Irsend is still waiting */
-               MPI_Waitall( 2, requests, statuses );
-               if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-                   char *p1, *p2;
-                   fprintf( stderr, 
-                            "Error in data with type %s (type %d on %d) at byte %d\n", 
-                            names[j], j, world_rank, errloc - 1 );
-                   p1 = (char *)inbufs[j];
-                   p2 = (char *)outbufs[j];
-                   fprintf( stderr, 
-                            "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                   err++;
-#if 0
-                   MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                             0, 0 );
-#endif
-               }
-           }
-           else if (rank == np - 1) {
-               partner = 0;
-               obuf = outbufs[j];
-               for (k=0; k<bytesize[j]; k++) 
-                   obuf[k] = 0;
-           
-               MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                         comms[i], &requests[0] );
-
-               MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                             MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                             comms[i], &status );
-
-               /* Wait for irecv to complete */
-               do {
-                   MPI_Test( &requests[0], &flag, &status );
-               } while (!flag);
-               if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-                   char *p1, *p2;
-                   fprintf( stderr, 
-                            "Error in data with type %s (type %d on %d) at byte %d\n", 
-                            names[j], j, world_rank, errloc - 1 );
-                   p1 = (char *)inbufs[j];
-                   p2 = (char *)outbufs[j];
-                   fprintf( stderr, 
-                            "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                   err++;
-#if 0
-                   MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                             0, 0 );
-#endif
-               }
-
-               MPI_Irsend( inbufs[j], counts[j], types[j], partner, tag, 
-                           comms[i], &requests[1] );
-           
-               MPI_Waitall(1, &requests[1], &status );
-           }
-       }
-    }
-
-    if (err > 0) {
-       fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterr == 0) {
-           printf( " No Errors\n" );
-       }
-       else {
-           printf (" Found %d errors\n", toterr );
-       }
-    }
-    FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-    FreeComms( comms, ncomm );
-    MPI_Finalize();
-
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/irsendinit.c b/teshsuite/smpi/mpich-test/pt2pt/irsendinit.c
deleted file mode 100644 (file)
index d80cf5a..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/* Nonblocking ready persistent sends 
-   
-   This is similar to a test in allpair.f, but with an expanded range of
-   datatypes and communicators.
-
-   This is like irsend.c, but with multiple starts of the same persistent
-   request.
- */
-
-int main( int argc, char **argv )
-{
-    MPI_Datatype *types;
-    void         **inbufs, **outbufs;
-    char         **names;
-    int          *counts, *bytesize, ntype;
-    MPI_Comm     comms[20];
-    int          ncomm = 20, rank, np, partner, tag;
-    int          i, j, k, err, toterr, world_rank, errloc;
-    MPI_Status   status;
-    int          flag, index;
-    char         *obuf;
-    MPI_Request  requests[2];
-    int          mcnt;
-
-
-    MPI_Init( &argc, &argv );
-
-    AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                    &names, &ntype );
-    GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-    MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-    err = 0;
-    for (i=0; i<ncomm; i++) {
-       MPI_Comm_rank( comms[i], &rank );
-       MPI_Comm_size( comms[i], &np );
-       if (np < 2) continue;
-       tag = i;
-       for (j=0; j<ntype; j++) {
-           if (world_rank == 0 && verbose) 
-               fprintf( stdout, "Testing type %s\n", names[j] );
-           /* This test does an irsend between both partners, with 
-              a sendrecv after the irecv used to guarentee that the
-              irsend has a matching receive
-              */
-           if (rank == 0) {
-               partner = np - 1;
-#if 0
-               MPIR_PrintDatatypePack( stdout, counts[j], types[j], 0, 0 );
-#endif
-               obuf = outbufs[j];
-               for (k=0; k<bytesize[j]; k++) 
-                   obuf[k] = 0;
-           
-               MPI_Recv_init(outbufs[j], counts[j], types[j], partner, tag, 
-                             comms[i], &requests[0] );
-               MPI_Rsend_init( inbufs[j], counts[j], types[j], partner, tag, 
-                               comms[i], &requests[1] );
-           
-               for (mcnt=0; mcnt<10; mcnt++) {
-                   MPI_Start( &requests[0] );
-                   MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                                 MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                                 comms[i], &status );
-                   MPI_Start( &requests[1] );
-                   do {
-                       MPI_Waitany( 2, requests, &index, &status );
-                   } while (index != 0);
-                   
-                   if ((errloc = CheckData( inbufs[j], outbufs[j], 
-                                            bytesize[j] ))) {
-                       char *p1, *p2;
-                       fprintf( stderr, 
-    "Error in data with type %s (type %d on %d) at byte %d in %dth test\n", 
-                                names[j], j, world_rank, errloc - 1, mcnt );
-                       p1 = (char *)inbufs[j];
-                       p2 = (char *)outbufs[j];
-                       fprintf( stderr, 
-                       "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                       err++;
-#if 0
-                       MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                                 0, 0 );
-#endif
-                   }
-                   MPI_Waitall(1, &requests[1], &status );
-               }
-               MPI_Request_free( &requests[0] );
-               MPI_Request_free( &requests[1] );
-           }
-           else if (rank == np - 1) {
-               partner = 0;
-               obuf = outbufs[j];
-               for (k=0; k<bytesize[j]; k++) 
-                   obuf[k] = 0;
-           
-               MPI_Recv_init(outbufs[j], counts[j], types[j], partner, tag, 
-                             comms[i], &requests[0] );
-               MPI_Rsend_init( inbufs[j], counts[j], types[j], partner, tag, 
-                               comms[i], &requests[1] );
-               for (mcnt=0; mcnt<10; mcnt++) {
-                   MPI_Start( &requests[0] );
-                   MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                                 MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                                 comms[i], &status );
-                   MPI_Start( &requests[1] );
-                   /* Wait for irecv to complete */
-                   do {
-                       MPI_Test( &requests[0], &flag, &status );
-                   } while (!flag);
-                   if ((errloc = CheckData( inbufs[j], outbufs[j], 
-                                            bytesize[j] ))) {
-                       char *p1, *p2;
-                       fprintf( stderr, 
-                   "Error in data with type %s (type %d on %d) at byte %d\n", 
-                                names[j], j, world_rank, errloc - 1 );
-                       p1 = (char *)inbufs[j];
-                       p2 = (char *)outbufs[j];
-                       fprintf( stderr, 
-                       "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                       err++;
-#if 0
-                       MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                             0, 0 );
-#endif
-                   }
-
-                   MPI_Waitall(1, &requests[1], &status );
-               }
-               MPI_Request_free( &requests[0] );
-               MPI_Request_free( &requests[1] );
-           }
-       }
-    }
-
-    if (err > 0) {
-       fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterr == 0) {
-           printf( " No Errors\n" );
-       }
-       else {
-           printf (" Found %d errors\n", toterr );
-       }
-    }
-    FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-    FreeComms( comms, ncomm );
-    MPI_Finalize();
-
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/isendf.f b/teshsuite/smpi/mpich-test/pt2pt/isendf.f
deleted file mode 100644 (file)
index 1880724..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-      program main
-      include 'mpif.h'
-      integer ierr, errs, toterrs
-      integer request
-      integer status(MPI_STATUS_SIZE)
-      integer rank, size, buf(10)
-      logical flag
-C
-      call MPI_Init( ierr )
-      errs = 0
-C
-      call MPI_Comm_size( MPI_COMM_WORLD, size, ierr )
-      if (size .lt. 2) then
-         print *, 'Must have at least two processes'
-         call MPI_Abort( MPI_COMM_WORLD, 1, ierr )
-      endif
-      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
-      if (rank .eq. 0) then
-         do i = 1, 10
-            buf(i) = i
-         enddo
-         call MPI_Isend( buf, 10, MPI_INTEGER, size - 1, 1,
-     $        MPI_COMM_WORLD, request, ierr )
-         call MPI_Wait( request, status, ierr )
-      endif
-      if (rank .eq. size - 1) then
-         call MPI_Irecv( buf, 10, MPI_INTEGER, 0, 1, MPI_COMM_WORLD,
-     $        request, ierr )
-C         call MPI_Wait( request, status, ierr )
-         flag = .FALSE.
-         do while (.not. flag) 
-            call MPI_Test( request, flag, status, ierr )
-         enddo
-C     
-C     Check the results
-         do i = 1, 10
-            if (buf(i) .ne. i) then
-               errs = errs + 1
-            endif
-         enddo
-      endif
-C
-      call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,
-     $     MPI_COMM_WORLD, ierr )
-      if (rank .eq. 0) then
-         if (toterrs .gt. 0) then
-            print *, "Found ", toterrs, " Errors"
-         else
-            PRINT *, " No Errors"
-         endif
-      endif
-      call MPI_Finalize( ierr )
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/isendtest.c b/teshsuite/smpi/mpich-test/pt2pt/isendtest.c
deleted file mode 100644 (file)
index 0a92010..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-   MPICH 1.0.8 on Intel Paragons is alleged to have failed this test.
-   (Original code from 
-    From: weber@zam212.zam.kfa-juelich.de (M.Weber)
-    Reply-To: M.Weber@kfa-juelich.de
-   modified slightly to meet our test rules.)
- */
-#include <stdio.h>
-#include "mpi.h"
-#define SIZE 100
-/* SIZE 16 worked on Paragon */
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char *argv[])
-{
-  int num_procs,my_id,flag;
-  int buf[SIZE][SIZE];
-  MPI_Status status;
-  MPI_Request handle;
-
-  MPI_Init(&argc,&argv);
-  MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
-  MPI_Comm_rank(MPI_COMM_WORLD,&my_id);
-  
-  if ( my_id == 1 ) {
-     MPI_Isend (buf, SIZE*SIZE, MPI_INT, 0, 0, MPI_COMM_WORLD, &handle );
-
-     flag = 0;
-     while (flag == 0) {
-        MPI_Test (&handle, &flag, &status);
-        printf("%d Wait for completition flag = %d handle = %ld ....\n",
-               my_id, flag, (long) handle);
-     }
-  }
-  else if (my_id == 0 ) {
-     MPI_Recv (buf, SIZE*SIZE, MPI_INT, 1, 0, MPI_COMM_WORLD, &status );
-  }
-
-  printf("%d Done ....\n",my_id);
-
-  MPI_Finalize();
-  return 0;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/isndrcv.c b/teshsuite/smpi/mpich-test/pt2pt/isndrcv.c
deleted file mode 100644 (file)
index d15c58a..0000000
+++ /dev/null
@@ -1,507 +0,0 @@
-/* 
- * Program to test all of the features of MPI_Send and MPI_Recv
- *
- * *** What is tested? ***
- * 1. Sending and receiving all basic types and many sizes - check
- * 2. Tag selectivity - check
- * 3. Error return codes for
- *    a. Invalid Communicator
- *    b. Invalid destination or source
- *    c. Count out of range
- *    d. Invalid type
- */
-
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "mpi.h"
-
-#ifdef HAVE_MPICHCONF_H
-#include "mpichconf.h"
-#endif
-
-static int src = 1;
-static int dest = 0;
-
-static int verbose = 0;
-
-#define MAX_TYPES 12
-static MPI_Datatype BasicTypes[MAX_TYPES];
-#if defined(HAVE_LONG_DOUBLE) && (!defined HAS_XDR)
-static int ntypes = 12;
-#else
-static int ntypes = 11;
-#endif
-
-static int maxbufferlen = 10000;
-static int stdbufferlen = 300;
-
-/* Prototypes to keep compilers quiet */
-void AllocateBuffers ( void **, MPI_Datatype *, int, int );
-void FreeBuffers ( void **, int );
-void FillBuffers ( void **, MPI_Datatype *, int, int );
-int CheckBuffer ( void *, MPI_Datatype, int );
-void SetupBasicTypes (void);
-void SenderTest1 (void);
-void ReceiverTest1 (void);
-void SenderTest2 (void);
-void ReceiverTest2 (void);
-void SenderTest3 (void);
-void ReceiverTest3 (void);
-
-void 
-AllocateBuffers(void **bufferspace, MPI_Datatype *buffertypes, int num_types, 
-               int bufferlen)
-{
-    int i;
-    for (i = 0; i < ntypes; i++) {
-       if (buffertypes[i] == MPI_CHAR)
-           bufferspace[i] = malloc(bufferlen * sizeof(char));
-       else if (buffertypes[i] == MPI_SHORT)
-           bufferspace[i] = malloc(bufferlen * sizeof(short));
-       else if (buffertypes[i] == MPI_INT)
-           bufferspace[i] = malloc(bufferlen * sizeof(int));
-       else if (buffertypes[i] == MPI_LONG)
-           bufferspace[i] = malloc(bufferlen * sizeof(long));
-       else if (buffertypes[i] == MPI_UNSIGNED_CHAR)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned char));
-       else if (buffertypes[i] == MPI_UNSIGNED_SHORT)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned short));
-       else if (buffertypes[i] == MPI_UNSIGNED)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned int));
-       else if (buffertypes[i] == MPI_UNSIGNED_LONG)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned long));
-       else if (buffertypes[i] == MPI_FLOAT)
-           bufferspace[i] = malloc(bufferlen * sizeof(float));
-       else if (buffertypes[i] == MPI_DOUBLE)
-           bufferspace[i] = malloc(bufferlen * sizeof(double));
-#if defined(HAVE_LONG_DOUBLE)  && (!defined HAS_XDR)
-       else if (MPI_LONG_DOUBLE && buffertypes[i] == MPI_LONG_DOUBLE) {
-           int dlen;
-           MPI_Type_size( MPI_LONG_DOUBLE, &dlen );
-           bufferspace[i] = malloc(bufferlen * dlen);
-       }
-#endif
-       else if (buffertypes[i] == MPI_BYTE)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned char));
-    }
-}
-
-void 
-FreeBuffers(void **buffers, int nbuffers)
-{
-    int i;
-    for (i = 0; i < nbuffers; i++)
-       free(buffers[i]);
-}
-
-void 
-FillBuffers(void **bufferspace, MPI_Datatype *buffertypes, int num_types, 
-           int bufferlen)
-{
-    int i, j;
-    for (i = 0; i < ntypes; i++) {
-       for (j = 0; j < bufferlen; j++) {
-           if (buffertypes[i] == MPI_CHAR)
-               ((char *)bufferspace[i])[j] = (char)(j & 0x7f);
-           else if (buffertypes[i] == MPI_SHORT)
-               ((short *)bufferspace[i])[j] = (short)j;
-           else if (buffertypes[i] == MPI_INT)
-               ((int *)bufferspace[i])[j] = (int)j;
-           else if (buffertypes[i] == MPI_LONG)
-               ((long *)bufferspace[i])[j] = (long)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_CHAR)
-               ((unsigned char *)bufferspace[i])[j] = (unsigned char)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_SHORT)
-               ((unsigned short *)bufferspace[i])[j] = (unsigned short)j;
-           else if (buffertypes[i] == MPI_UNSIGNED)
-               ((unsigned int *)bufferspace[i])[j] = (unsigned int)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_LONG)
-               ((unsigned long *)bufferspace[i])[j] = (unsigned long)j;
-           else if (buffertypes[i] == MPI_FLOAT)
-               ((float *)bufferspace[i])[j] = (float)j;
-           else if (buffertypes[i] == MPI_DOUBLE)
-               ((double *)bufferspace[i])[j] = (double)j;
-#if defined(HAVE_LONG_DOUBLE)  && (!defined HAS_XDR)
-           else if (MPI_LONG_DOUBLE && buffertypes[i] == MPI_LONG_DOUBLE)
-               ((long double *)bufferspace[i])[j] = (long double)j;
-#endif
-           else if (buffertypes[i] == MPI_BYTE)
-               ((unsigned char *)bufferspace[i])[j] = (unsigned char)j;
-       }
-    }
-}
-
-int
-CheckBuffer(bufferspace, buffertype, bufferlen)
-void *bufferspace; 
-MPI_Datatype buffertype; 
-int bufferlen;
-{
-    int j;
-    for (j = 0; j < bufferlen; j++) {
-       if (buffertype == MPI_CHAR) {
-           if (((char *)bufferspace)[j] != (char)(j & 0x7f))
-               return 1;
-       } else if (buffertype == MPI_SHORT) {
-           if (((short *)bufferspace)[j] != (short)j)
-               return 1;
-       } else if (buffertype == MPI_INT) {
-           if (((int *)bufferspace)[j] != (int)j)
-               return 1;
-       } else if (buffertype == MPI_LONG) {
-           if (((long *)bufferspace)[j] != (long)j)
-               return 1;
-       } else if (buffertype == MPI_UNSIGNED_CHAR) {
-           if (((unsigned char *)bufferspace)[j] != (unsigned char)j)
-               return 1;
-       } else if (buffertype == MPI_UNSIGNED_SHORT) {
-                   if (((unsigned short *)bufferspace)[j] != (unsigned short)j)
-               return 1;
-       } else if (buffertype == MPI_UNSIGNED) {
-           if (((unsigned int *)bufferspace)[j] != (unsigned int)j)
-               return 1;
-       } else if (buffertype == MPI_UNSIGNED_LONG) {
-           if (((unsigned long *)bufferspace)[j] != (unsigned long)j)
-               return 1;
-       } else if (buffertype == MPI_FLOAT) {
-           if (((float *)bufferspace)[j] != (float)j)
-               return 1;
-       } else if (buffertype == MPI_DOUBLE) {
-           if (((double *)bufferspace)[j] != (double)j)
-               return 1;
-#if defined(HAVE_LONG_DOUBLE)  && (!defined HAS_XDR)
-       } else if (MPI_LONG_DOUBLE && buffertype == MPI_LONG_DOUBLE) {
-           if (((long double *)bufferspace)[j] != (long double)j)
-               return 1;
-#endif
-       } else if (buffertype == MPI_BYTE) {
-           if (((unsigned char *)bufferspace)[j] != (unsigned char)j)
-               return 1;
-       }
-    }
-    return 0;
-}
-
-void SetupBasicTypes( void )
-{
-    BasicTypes[0] = MPI_CHAR;
-    BasicTypes[1] = MPI_SHORT;
-    BasicTypes[2] = MPI_INT;
-    BasicTypes[3] = MPI_LONG;
-    BasicTypes[4] = MPI_UNSIGNED_CHAR;
-    BasicTypes[5] = MPI_UNSIGNED_SHORT;
-    BasicTypes[6] = MPI_UNSIGNED;
-    BasicTypes[7] = MPI_UNSIGNED_LONG;
-    BasicTypes[8] = MPI_FLOAT;
-    BasicTypes[9] = MPI_DOUBLE;
-
-    /* Define the last few elements as null just in case */
-    BasicTypes[11] = MPI_DATATYPE_NULL;
-#if defined (HAVE_LONG_DOUBLE) && (!defined HAS_XDR)
-    if (MPI_LONG_DOUBLE) {
-       BasicTypes[10] = MPI_LONG_DOUBLE;
-       BasicTypes[11] = MPI_BYTE;
-       }
-    else {
-       ntypes = 11;
-       BasicTypes[10] = MPI_BYTE;
-       }
-#else
-    BasicTypes[10] = MPI_BYTE;
-#endif
-}
-
-void 
-SenderTest1( void )
-{
-    void *bufferspace[MAX_TYPES];
-    int i, j;
-    int act_send;
-    MPI_Request *requests = 
-       (MPI_Request *)malloc(sizeof(MPI_Request) * ntypes * 
-                             maxbufferlen/500);
-    MPI_Status *statuses = 
-       (MPI_Status *)malloc(sizeof(MPI_Status) * ntypes * 
-                            maxbufferlen/500);
-
-    AllocateBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-    FillBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-    act_send = 0;
-    for (i = 0; i < ntypes; i++) {
-       for (j = 0; j < maxbufferlen; j += 500) {
-           if (BasicTypes[i] == MPI_DATATYPE_NULL) continue;
-           MPI_Isend(bufferspace[i], j, BasicTypes[i], dest, 
-                     2000, MPI_COMM_WORLD, 
-                     &(requests[act_send++]));
-           }
-    }
-    MPI_Waitall( act_send, requests, statuses);
-    free(requests);
-    free(statuses);
-    FreeBuffers(bufferspace, ntypes);
-}
-
-void
-ReceiverTest1( void )
-{
-    void *bufferspace[MAX_TYPES];
-    int i, j;
-    char message[81];
-    MPI_Status Stat;
-    MPI_Request Req;
-    int dummy, passed;
-
-    AllocateBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-    for (i = 0; i < ntypes; i++) {
-       passed = 1;
-       /* Try different sized messages */
-       for (j = 0; j < maxbufferlen; j += 500) {
-           /* Skip null datatypes */
-           if (!BasicTypes[i]) continue;
-           MPI_Irecv(bufferspace[i], j, BasicTypes[i], src, 
-                    2000, MPI_COMM_WORLD, &Req);
-           sprintf(message, "Send-Receive Test, Type %d, Count %d",
-                   i, j);
-           MPI_Wait(&Req, &Stat);
-           if (Stat.MPI_SOURCE != src) {
-               fprintf(stderr, "*** Incorrect Source returned. ***\n");
-               Test_Failed(message);
-               passed = 0;
-           } else if (Stat.MPI_TAG != 2000) {  
-               fprintf(stderr, "*** Incorrect Tag returned. ***\n");       
-               Test_Failed(message);
-               passed = 0;
-           } else if (MPI_Get_count(&Stat, BasicTypes[i], &dummy) ||
-                      dummy != j) {
-               fprintf(stderr, 
-                       "*** Incorrect Count returned, Count = %d. ***\n", 
-                       dummy);
-               Test_Failed(message);
-               passed = 0;
-           } else if(CheckBuffer(bufferspace[i], BasicTypes[i], j)) {
-               fprintf(stderr, "*** Incorrect Message received. ***\n");
-               Test_Failed(message);
-               passed = 0;
-           } 
-       }
-       sprintf(message, "Send-Receive Test, Type %d",
-               i);
-       if (passed) 
-           Test_Passed(message);
-       else 
-           Test_Failed(message);
-    }
-    FreeBuffers(bufferspace, ntypes);
-}
-
-/* Test Tag Selectivity */
-void 
-SenderTest2( void )
-{
-    int *buffer;
-    int i;
-    MPI_Request requests[10];
-    MPI_Status statuses[10];
-
-    buffer = (int *)malloc(stdbufferlen * sizeof(int));
-
-    for (i = 0; i < stdbufferlen; i++)
-       buffer[i] = i;
-    
-    for (i = 1; i <= 10; i++)
-       MPI_Isend(buffer, stdbufferlen, MPI_INT, dest,
-                2000+i, MPI_COMM_WORLD, &(requests[i-1]));
-    MPI_Waitall(10, requests, statuses);
-    free(buffer);
-    
-    return;
-}
-
-void
-ReceiverTest2( void )
-{
-    int *buffer;
-    int i, j;
-    char message[81];
-    MPI_Status Stat;
-    int dummy, passed;
-
-    MPI_Request Req;
-
-    buffer = (int *)malloc(stdbufferlen * sizeof(int));
-    passed = 1;
-
-    for (i = 2010; i >= 2001; i--) {
-       MPI_Irecv(buffer, stdbufferlen, MPI_INT, src, 
-                i, MPI_COMM_WORLD, &Req);
-       sprintf(message, "Tag Selectivity Test, Tag %d",
-               i);
-       MPI_Wait(&Req, &Stat);
-       if (Stat.MPI_SOURCE != src) {
-           fprintf(stderr, "*** Incorrect Source returned. ***\n");
-           Test_Failed(message);
-       } else if (Stat.MPI_TAG != i) { 
-           fprintf(stderr, "*** Incorrect Tag returned. ***\n");           
-           Test_Failed(message);
-       } else if (MPI_Get_count(&Stat, MPI_INT, &dummy) ||
-                  dummy != stdbufferlen) {
-           fprintf(stderr, 
-                   "*** Incorrect Count returned, Count = %d. ***\n", 
-                   dummy);
-           Test_Failed(message);
-       } else if(CheckBuffer( (void *)buffer, MPI_INT, stdbufferlen)) {
-           fprintf(stderr, "*** Incorrect Message received. ***\n");
-           Test_Failed(message);
-           passed = 0;
-       }
-       /* Clear out the buffer */
-       for (j = 0; j < stdbufferlen; j++)
-           buffer[j] = -1;
-    }
-    strncpy(message, "Tag Selectivity Test", 81);
-    if (passed)
-       Test_Passed(message);
-    else
-       Test_Failed(message);
-    free(buffer);
-    return;
-}
-
-void
-SenderTest3( void )
-{
-    return;
-}
-
-void
-ReceiverTest3( void )
-{
-    int buffer[20];
-    MPI_Datatype bogus_type = MPI_DATATYPE_NULL;
-    MPI_Request Req;
-#if 0
-    MPI_Status Stat;
-    int err_code;
-#endif
-    if (verbose)
-       MPI_Errhandler_set(MPI_COMM_WORLD, TEST_ERRORS_WARN);
-    else
-       MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-
-    if (MPI_Isend(buffer, 20, MPI_INT, dest,
-                1, MPI_COMM_NULL, &Req) == MPI_SUCCESS){
-       Test_Failed("NULL Communicator Test");
-    }
-    else {
-       Test_Passed("NULL Communicator Test");
-#if 0
-       /* If test passed (i.e. send failed, try waiting on the
-          request... */
-       Test_Message("About to wait on failed request.");
-       if (MPI_Wait(&Req, &Stat) == MPI_SUCCESS) {;
-           Test_Failed("Wait on failed isend Test");
-        }
-        else 
-           Test_Passed("Wait on failed isend Test");
-       Test_Message("Done waiting on failed request.");
-#endif
-    }
-/*
-    if (MPI_Isend(NULL, 10, MPI_INT, dest,
-                1, MPI_COMM_WORLD, &Req) == MPI_SUCCESS){
-       Test_Failed("Invalid Buffer Test");
-    }
-    else
-       Test_Passed("Invalid Buffer Test");
-*/
-   if (MPI_Isend(buffer, -1, MPI_INT, dest,
-                1, MPI_COMM_WORLD, &Req) == MPI_SUCCESS){
-       Test_Failed("Invalid Count Test");
-    }
-    else
-       Test_Passed("Invalid Count Test");
-
-   if (MPI_Isend(buffer, 20, bogus_type, dest,
-                1, MPI_COMM_WORLD, &Req) == MPI_SUCCESS){
-       Test_Failed("Invalid Type Test");
-    }
-    else
-       Test_Passed("Invalid Type Test");
-
-   if (MPI_Isend(buffer, 20, MPI_INT, dest, 
-                -1000, MPI_COMM_WORLD, &Req) == MPI_SUCCESS) {
-        Test_Failed("Invalid Tag Test");
-    }
-    else
-       Test_Passed("Invalid Tag Test");
-
-   if (MPI_Isend(buffer, 20, MPI_INT, 300,
-                1, MPI_COMM_WORLD, &Req) == MPI_SUCCESS) {
-       Test_Failed("Invalid Destination Test");
-    }
-    else
-       Test_Passed("Invalid Destination Test");
-    return;
-}
-
-int 
-main( int argc, char **argv )
-{
-    int myrank, mysize;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-    MPI_Comm_size(MPI_COMM_WORLD, &mysize);
-
-    /* dest writes out the received stats; for the output to be
-       consistant (with the final check), it should be procees 0 */
-    if (argc > 1 && argv[1] && strcmp( "-alt", argv[1] ) == 0) {
-       dest = 1;
-       src  = 0;
-       }
-    else {
-       src  = 1;
-       dest = 0;
-       }
-
-    Test_Init("isndrcv", myrank);
-    SetupBasicTypes();
-
-    if (mysize != 2) {
-       fprintf(stderr, 
-               "*** This test program requires exactly 2 processes.\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    
-    /* Turn stdout's buffering to line buffered so it mixes right with
-       stderr in output files. (hopefully) */
-    setvbuf(stdout, NULL, _IOLBF, 0);
-
-    if (myrank == src) {
-       SenderTest1();
-       SenderTest2();
-       SenderTest3();  
-    } else if (myrank == dest) {
-       ReceiverTest1();
-       ReceiverTest2();
-       ReceiverTest3(); 
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-       exit(-1);
-    }
-    Test_Waitforall( );
-    if (myrank == dest) {
-       int rval;
-       rval = Summarize_Test_Results();
-       Test_Finalize();
-       MPI_Finalize();
-       return rval;
-    }
-    else {
-       Test_Finalize();
-       MPI_Finalize();
-       return 0;
-    }
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/isndrcv2.c b/teshsuite/smpi/mpich-test/pt2pt/isndrcv2.c
deleted file mode 100644 (file)
index 9538887..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-
-int main( int argc, char **argv )
-{
-  int rank, size;
-  MPI_Request r1, r2;
-  MPI_Status  s;
-  int         buf[10000], buf2[10000], count, tag1, tag2;
-
-  count = 10000;
-  tag1  = 100;
-  tag2  = 1000;
-
-  MPI_Init( &argc, &argv );
-  MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-  MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-  if (rank == 0) {
-    MPI_Isend( buf, count, MPI_INT, 1, tag1, MPI_COMM_WORLD, &r1 );
-    MPI_Isend( buf2, count, MPI_INT, 1, tag2, MPI_COMM_WORLD, &r2 );
-    MPI_Wait( &r1, &s );
-    MPI_Wait( &r2, &s );
-  }
-  else if (rank == 1) {
-    MPI_Irecv( buf2, count, MPI_INT, 0, tag2, MPI_COMM_WORLD, &r2 );
-    MPI_Irecv( buf,  count, MPI_INT, 0, tag1, MPI_COMM_WORLD, &r1 );
-    MPI_Wait( &r2, &s );
-    if (s.MPI_TAG != tag2) {
-           printf( "Error in receive order\n" );
-    }
-    MPI_Wait( &r1, &s );
-  }
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  if (rank == 0) {
-    printf( "Test completed\n" );
-  }
-  MPI_Finalize( );
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/issend2.c b/teshsuite/smpi/mpich-test/pt2pt/issend2.c
deleted file mode 100644 (file)
index 0ff413a..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/* This program comes from Bert Still, bert@h4p.llnl.gov 
-   It caused problems for the T3D implementation.
- */
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-#define MESSAGE_TAG 8
-#define MESSAGE_VALUE 6
-#define MESSAGE_TYPE MPI_BYTE
-#define MESSAGE_CTYPE char
-static MESSAGE_CTYPE recv_msg[8];
-static MESSAGE_CTYPE send_msg[8];
-
-static MPI_Status recv_status;
-static MPI_Status send_status[2];
-static MPI_Request request[2];
-static int complete[2];
-
-/*------------------------------------------------------------------------*/
-
-void fatal ( int,const char * );
-
-void fatal(rank, msg)
-int rank;
-const char *msg;
-{
-  printf("***FATAL** rank %d: %s\n", rank, msg);
-  MPI_Abort(MPI_COMM_WORLD, 1);
-  exit(1);
-}
-
-int verbose = 0;
-int main( int argc, char *argv[] )
-{
-  int size, rank;
-  int err=0, toterr;
-
-  if (MPI_Init(&argc, &argv)!=MPI_SUCCESS) fatal(-1, "MPI_Init failed");
-
-  if (MPI_Comm_size(MPI_COMM_WORLD, &size)!=MPI_SUCCESS)
-    fatal(-1, "MPI_Comm_size failed");
-  if (MPI_Comm_rank(MPI_COMM_WORLD, &rank)!=MPI_SUCCESS)
-    fatal(-1, "MPI_Comm_rank failed");
-  if (size!=2) fatal(rank, "issend2 test requires -np 2\n");
-
-  if (rank) {
-    if (MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-                  &recv_status)!=MPI_SUCCESS)
-      fatal(rank, "MPI_Probe failed");
-    if (recv_status.MPI_SOURCE!=0 || recv_status.MPI_TAG!=MESSAGE_TAG)
-      fatal(rank, "message source or tag wrong");
-    if (MPI_Recv(recv_msg, 8, MESSAGE_TYPE,
-                 recv_status.MPI_SOURCE, recv_status.MPI_TAG, MPI_COMM_WORLD,
-                 &recv_status)!=MPI_SUCCESS)
-      fatal(rank, "MPI_Recv failed");
-    if (recv_msg[0] == MESSAGE_VALUE) {
-       if (verbose) printf( "test completed successfully\n" );
-    }
-    else {
-       printf("test failed: rank %d: got %d but expected %d\n", 
-              rank, recv_msg[0], MESSAGE_VALUE );
-       err++;
-    }
-
-    fflush(stdout);
-
-    if (recv_msg[0]!=MESSAGE_VALUE)
-      fatal(rank, "received message doesn't match sent message");
-
-  } else {
-    int n_complete;
-
-    send_msg[0]= MESSAGE_VALUE;
-
-    if (MPI_Issend(send_msg, 1, MESSAGE_TYPE, /*rank*/1, MESSAGE_TAG,
-                   MPI_COMM_WORLD, request) != MPI_SUCCESS)
-          fatal(rank, "MPI_Issend failed");
-    if (MPI_Waitsome(1, request, &n_complete, complete,send_status) != 
-        MPI_SUCCESS) 
-       fatal(rank, "MPI_Waitsome failed");
-    if (request[0]!=MPI_REQUEST_NULL || n_complete!=1 || complete[0]!=0) 
-       fatal(rank, "Waitsome result is wrong");
-  }
-
-  MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (rank == 0) {
-      if (toterr == 0) {
-         printf( " No Errors\n" );
-      }
-      else {
-         printf (" Found %d errors\n", toterr );
-      }
-  }
-  /* printf("rank %d: about to finalize\n", rank); */
-  fflush(stdout);
-  MPI_Finalize();
-  /*  printf("rank %d: finalize completed\n", rank); */
-  fflush(stdout);
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/issendinit.c b/teshsuite/smpi/mpich-test/pt2pt/issendinit.c
deleted file mode 100644 (file)
index 42588d2..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Program to test that the "synchronous send" semantics
- * of point to point communications in MPI is (probably) satisfied. 
- * This is done by starting two synchronous sends and then testing that
- * they do not complete until the matchine receives are issued.
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-/* Amount of time in seconds to wait for the receipt of the second Ssend
-   message */
-#define MAX_TIME 20
-static int src  = 1;
-static int dest = 0;
-
-/* Prototypes for picky compilers */
-void Generate_Data ( int *, int );
-
-void Generate_Data(buffer, buff_size)
-int *buffer;
-int buff_size;
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = i+1;
-}
-
-int main( int argc, char **argv )
-{
-    int rank; /* My Rank (0 or 1) */
-    int act_size = 1000;
-    int flag;
-    int buffer[SIZE];
-    double t0;
-    char *Current_Test = NULL;
-    MPI_Status status;
-    MPI_Request r[2];
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    if (rank == src) { 
-       Test_Init("issendinit", rank);
-       Generate_Data(buffer, SIZE);
-       Current_Test = (char*)"Ssend_init waits for recv";
-       MPI_Recv( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, &status );
-       MPI_Send( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD );
-       MPI_Ssend_init( buffer, act_size, MPI_INT, dest, 1, MPI_COMM_WORLD, 
-                       &r[0] );
-       MPI_Ssend_init( buffer, act_size, MPI_INT, dest, 2, MPI_COMM_WORLD, 
-                       &r[1] );
-       MPI_Startall( 2, r );
-       t0 = MPI_Wtime();
-       flag = 0;
-       while (MPI_Wtime() - t0 < MAX_TIME) {
-           MPI_Test( &r[0], &flag, &status );
-           if (flag) {
-               Test_Failed(Current_Test);
-               break;
-               }
-           }
-       if (!flag) 
-           Test_Passed(Current_Test);
-       MPI_Wait( &r[1], &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, dest, 13,
-                     MPI_BOTTOM, 0, MPI_INT, dest, 13,
-                     MPI_COMM_WORLD, &status );
-       MPI_Wait( &r[0], &status );
-       MPI_Request_free( &r[0] );
-       MPI_Request_free( &r[1] );
-       Test_Waitforall( );
-       {
-           int rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           MPI_Finalize();
-           return rval;
-       }
-
-    } else if (rank == dest) {
-       MPI_Send( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD );
-       MPI_Recv( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD, &status );
-       MPI_Recv( buffer, act_size, MPI_INT, src, 2, MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, src, 13,
-                     MPI_BOTTOM, 0, MPI_INT, src, 13,
-                     MPI_COMM_WORLD, &status );
-       MPI_Recv( buffer, act_size, MPI_INT, src, 1, MPI_COMM_WORLD, &status );
-       /* Test 1 */
-       Test_Waitforall( );
-       MPI_Finalize();
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/issendtest.c b/teshsuite/smpi/mpich-test/pt2pt/issendtest.c
deleted file mode 100644 (file)
index 1bbf88a..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Program to test that the "synchronous send" semantics
- * of point to point communications in MPI is (probably) satisfied. 
- * This uses tests on the completions of the SENDS (unlike the MPI_Ssend
- * test) since the Issends return "immediately" but can not complete
- * until the matching receive begins.
- *
- * This program has been patterned off of "overtake.c"
- *
- *                             William Gropp
- *                             gropp@mcs.anl.gov
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-/* Amount of time in seconds to wait for the receipt of the second Ssend
-   message */
-#define MAX_TIME 20
-static int src  = 1;
-static int dest = 0;
-
-/* Prototypes for picky compilers */
-void Generate_Data ( int *, int );
-
-void Generate_Data( int *buffer, int buff_size)
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = i+1;
-}
-
-int main( int argc, char **argv)
-{
-    int rank; /* My Rank (0 or 1) */
-    int act_size = 1000;
-/*    int flag;*/
-    int buffer[SIZE];
-    double t0;
-    char *Current_Test = NULL;
-    MPI_Status status;
-    MPI_Request r1, r2;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    /* This test depends on a working wtime.  Make a simple check */
-    Current_Test = (char*)"Testing timer";
-    t0 = MPI_Wtime();
-    if (t0 == 0 && MPI_Wtime() == 0) {
-       int loopcount = 1000000;
-       /* This test is too severe (systems with fast 
-          processors and large MPI_Wtick values can 
-          fail.  Try harder to test MPI_Wtime */
-       while (loopcount-- && MPI_Wtime() == 0) ;
-       if (loopcount <= 0) {
-           fprintf( stderr, 
-                    "MPI_WTIME is returning 0; a working value is needed\n\
-for this test.\n" );
-           Test_Failed(Current_Test);
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       t0 = MPI_Wtime();
-    }
-    /* Test that the timer increases */
-/*    Current_Test = (char*)"Testing timer increases";*/
-/*    for (flag=0; flag<1000000; flag++) {*/
-/*     if (MPI_Wtime() > t0) break;*/
-/*    }*/
-/*    if (flag >= 1000000) {*/
-/*     fprintf( stderr, "MPI_WTIME is not returning increasing values!\n" );*/
-/*     Test_Failed(Current_Test);*/
-/*     MPI_Abort( MPI_COMM_WORLD, 1 );*/
-/*    }*/
-
-    Current_Test = (char*)"Issend waits for recv";
-    if (rank == src) { 
-       Test_Init("issendtest", rank);
-       Generate_Data(buffer, SIZE);
-       MPI_Recv( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, &status );
-       MPI_Send( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD );
-       MPI_Issend( buffer, act_size, MPI_INT, dest, 1, MPI_COMM_WORLD, &r1 );
-       MPI_Issend( buffer, act_size, MPI_INT, dest, 2, MPI_COMM_WORLD, &r2 );
-       t0 = MPI_Wtime();
-/*     flag = 0;*/
-/*     while ( (MPI_Wtime() - t0) < MAX_TIME) {*/
-/*         MPI_Test( &r1, &flag, &status );*/
-/*         if (flag) {*/
-/*             Test_Failed(Current_Test);*/
-/*             break;*/
-/*             }*/
-/*         }*/
-/*     if (!flag) */
-/*         Test_Passed(Current_Test);*/
-       MPI_Wait( &r2, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, dest, 13,
-                     MPI_BOTTOM, 0, MPI_INT, dest, 13,
-                     MPI_COMM_WORLD, &status );
-       MPI_Wait( &r1, &status );
-       Test_Waitforall( );
-       {
-           int rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           MPI_Finalize();
-           return rval;
-       }
-
-    } else if (rank == dest) {
-       /* Test 1 */
-       MPI_Send( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD );
-       MPI_Recv( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD, &status );
-       MPI_Recv( buffer, act_size, MPI_INT, src, 2, MPI_COMM_WORLD, &status );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, src, 13,
-                     MPI_BOTTOM, 0, MPI_INT, src, 13,
-                     MPI_COMM_WORLD, &status );
-       MPI_Recv( buffer, act_size, MPI_INT, src, 1, MPI_COMM_WORLD, &status );
-
-       Test_Waitforall( );
-       Test_Finalize();
-       MPI_Finalize();
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/longmsgs.c b/teshsuite/smpi/mpich-test/pt2pt/longmsgs.c
deleted file mode 100644 (file)
index 44fc223..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#include "test.h"
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#define MIN_MESSAGE_LENGTH 256
-#define MAX_MESSAGE_LENGTH (16*1024*1024)
-#define TAG1 1
-#define TAG2 2
-#define TAG3 3
-#define TAG4 4
-#define TAGSR 101
-
-int verbose = 0;
-
-void Resetbuf( char *, int );
-void Checkbuf( char *, int, MPI_Status * );
-
-void Resetbuf( char *buf, int len )
-{
-    int i;
-    for (i=0; i<len; i++) 
-       buf[i] = 0;
-}
-
-void Checkbuf( char *buf, int len, MPI_Status *status )
-{
-    int count, i;
-    int err = 0;
-    char ival;
-    
-    MPI_Get_count( status, MPI_CHAR, &count );
-    if (count != len) {
-       fprintf( stderr, "Got len of %d but expected %d\n", count, len );
-       err++;
-    }
-    ival = 0;
-    for (i=0; i<len; i++) {
-       if (buf[i] != ival) {
-           err++;
-           fprintf( stderr, 
-                    "Found wrong value in buffer[%d] = %d, expected %d\n",
-                    i, buf[i], ival );
-           if (err > 10) break;
-       }
-       ival++;
-    }
-    if (err) MPI_Abort( MPI_COMM_WORLD, 1 );
-}
-
-int main( int argc, char *argv[] )
-{
-    int msglen, i;
-    int msglen_min = MIN_MESSAGE_LENGTH;
-    int msglen_max = MAX_MESSAGE_LENGTH;
-    int rank,poolsize,Master;
-    char *sendbuf,*recvbuf;
-    char ival;
-    MPI_Request request;
-    MPI_Status status;
-       
-    MPI_Init(&argc,&argv);
-    MPI_Comm_size(MPI_COMM_WORLD,&poolsize);
-    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-
-    if(poolsize != 2) {
-       printf("Expected exactly 2 MPI processes\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-/* 
-   The following test allows this test to run on small-memory systems
-   that support the sysconf call interface.  This test keeps the test from
-   becoming swap-bound.  For example, on an old Linux system or a
-   Sony Playstation 2 (really!) 
- */
-#if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
-    { 
-       long n_pages, pagesize;
-       int  actmsglen_max;
-       n_pages  = sysconf( _SC_PHYS_PAGES );
-       pagesize = sysconf( _SC_PAGESIZE );
-       /* We want to avoid integer overflow in the size calculation.
-          The best way is to avoid computing any products (such
-          as total memory = n_pages * pagesize) and instead
-          compute a msglen_max that fits within 1/4 of the available 
-          pages */
-       if (n_pages > 0 && pagesize > 0) {
-           /* Recompute msglen_max */
-           int msgpages = 4 * ((msglen_max + pagesize - 1)/ pagesize);
-           while (n_pages < msgpages) { msglen_max /= 2; msgpages /= 2; }
-       }
-       /* printf ( "before = %d\n", msglen_max ); */
-       MPI_Allreduce( &msglen_max, &actmsglen_max, 1, MPI_INT, 
-                      MPI_MIN, MPI_COMM_WORLD );
-       msglen_max = actmsglen_max;
-       /* printf ( "after = %d\n", msglen_max ); */
-    }
-#endif
-
-    Master = (rank == 0);      
-
-    if(Master && verbose)
-       printf("Size (bytes)\n------------\n");
-    for(msglen = msglen_min; msglen <= msglen_max; msglen *= 2) {
-
-       sendbuf = malloc(msglen);
-       recvbuf = malloc(msglen);
-       if(sendbuf == NULL || recvbuf == NULL) {
-           printf("Can't allocate %d bytes\n",msglen);
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-
-       ival = 0;
-       for (i=0; i<msglen; i++) {
-           sendbuf[i] = ival++;
-           recvbuf[i] = 0;
-       }
-
-
-       if(Master && verbose) 
-           printf("%d\n",msglen);
-       fflush(stdout);
-
-       MPI_Barrier(MPI_COMM_WORLD);
-               
-       /* Send/Recv */
-       if(Master) 
-           MPI_Send(sendbuf,msglen,MPI_CHAR,1,TAG1,MPI_COMM_WORLD);
-       else {
-           Resetbuf( recvbuf, msglen );
-           MPI_Recv(recvbuf,msglen,MPI_CHAR,0,TAG1,MPI_COMM_WORLD,&status);
-           Checkbuf( recvbuf, msglen, &status );
-       }
-
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       /* Ssend/Recv */
-       if(Master) 
-           MPI_Ssend(sendbuf,msglen,MPI_CHAR,1,TAG2,MPI_COMM_WORLD);
-       else {
-           Resetbuf( recvbuf, msglen );
-           MPI_Recv(recvbuf,msglen,MPI_CHAR,0,TAG2,MPI_COMM_WORLD,&status);
-           Checkbuf( recvbuf, msglen, &status );
-       }
-
-       MPI_Barrier(MPI_COMM_WORLD);
-               
-       /* Rsend/Recv */
-/*     if (Master) {*/
-/*         MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, 1, TAGSR,*/
-/*                       MPI_BOTTOM, 0, MPI_INT, 1, TAGSR,*/
-/*                       MPI_COMM_WORLD, &status );*/
-/*         MPI_Rsend( sendbuf,msglen,MPI_CHAR,1,TAG3,MPI_COMM_WORLD );*/
-/*     }*/
-/*     else {*/
-/*         Resetbuf( recvbuf, msglen );*/
-/*         MPI_Irecv( recvbuf,msglen,MPI_CHAR,0,TAG3,MPI_COMM_WORLD,&request);*/
-/*         MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, 0, TAGSR,*/
-/*                       MPI_BOTTOM, 0, MPI_INT, 0, TAGSR,*/
-/*                       MPI_COMM_WORLD, &status );*/
-/*         MPI_Wait( &request, &status );*/
-/*         Checkbuf( recvbuf, msglen, &status );*/
-/*     }*/
-/*         */
-/*     MPI_Barrier(MPI_COMM_WORLD);*/
-
-       /* Isend/Recv - receive not ready */
-       if(Master) {
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, 1, TAGSR,
-                         MPI_BOTTOM, 0, MPI_INT, 1, TAGSR,
-                         MPI_COMM_WORLD, &status );
-           MPI_Isend(sendbuf,msglen,MPI_CHAR,1,TAG4,MPI_COMM_WORLD, &request);
-           MPI_Wait( &request, &status );
-       }
-       else {
-           Resetbuf( recvbuf, msglen );
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, 0, TAGSR,
-                         MPI_BOTTOM, 0, MPI_INT, 0, TAGSR,
-                         MPI_COMM_WORLD, &status );
-           MPI_Recv(recvbuf,msglen,MPI_CHAR,0,TAG4,MPI_COMM_WORLD,&status);
-           Checkbuf( recvbuf, msglen, &status );
-       }
-
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       free(sendbuf);
-       free(recvbuf);
-    }
-
-    if (rank == 0) {
-       /* If we do not abort, we saw no errors */
-       printf( " No Errors\n" );
-    }
-
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/mpitest.h b/teshsuite/smpi/mpich-test/pt2pt/mpitest.h
deleted file mode 100644 (file)
index a14b2c9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef MPITEST_TEST
-#define MPITEST_TEST
-
-void Test_Init ( char *, int );
-void Test_Message (char *);
-void Test_Failed (char *);
-void Test_Passed (char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-#endif
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nblock.c b/teshsuite/smpi/mpich-test/pt2pt/nblock.c
deleted file mode 100644 (file)
index a489013..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-#ifndef MAXNP
-#define MAXNP 16
-#endif
-
-/*
-   Test to make sure that nonblocking routines actually work.  This
-   stresses them by sending large numbers of requests and receiving them
-   piecemeal.
- */
-int main( int argc, char **argv )
-{
-    int count, tag, nsend, myid, np, rcnt, scnt, i, j;
-    int *(sbuf[MAXNP]), *(rbuf[MAXNP]);
-    MPI_Status status;
-    MPI_Request *rsend, *rrecv;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-    if (np > MAXNP) {
-       fprintf( stderr, 
-                "This test must run with at most %d processes\n", MAXNP );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    nsend = 3 * np;
-    rsend = (MPI_Request *) malloc ( nsend * sizeof(MPI_Request) );
-    rrecv = (MPI_Request *) malloc ( nsend * sizeof(MPI_Request) );
-    if (!rsend || !rrecv) {
-       fprintf( stderr, "Failed to allocate space for requests\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    for (count = 1; count < 10000; count *= 2) {
-       for (i=0; i<nsend; i++) {
-           sbuf[i] = (int *)calloc( count, sizeof(int) );
-           rbuf[i] = (int *)malloc( count * sizeof(int) );
-           if (!sbuf[i] || !rbuf[i]) {
-               fprintf( stderr, "Unable to allocate %d ints\n", count );
-               MPI_Abort( MPI_COMM_WORLD, 1 );
-           }
-       }
-       
-       /* We'll send/recv from everyone */
-       scnt = 0;
-       rcnt = 0;
-       /* The MPI standard requires that active buffers be distinct
-          in nonblocking calls */
-       for (j=0; j<3; j++) {
-           tag = j;
-           for (i=0; i<np; i++) {
-               if (i != myid) {
-                   MPI_Isend( sbuf[scnt], count, MPI_INT, i, 
-                              tag, MPI_COMM_WORLD, &rsend[scnt] );
-                   scnt++;
-               }
-               
-           }
-           for (i=0; i<np; i++) {
-               if (i != myid) {
-                   MPI_Irecv( rbuf[rcnt], count, MPI_INT, i, 
-                              tag, MPI_COMM_WORLD, &rrecv[rcnt] );
-                   rcnt++;
-               }
-           }
-       }
-       /* In general, it would be better to use MPI_Waitall, but this should
-          work as well */
-       for (i=0; i<rcnt; i++) {
-           MPI_Wait( &rrecv[i], &status );
-       }
-       for (i=0; i<scnt; i++) {
-           MPI_Wait( &rsend[i], &status );
-       }
-
-       for (i=0; i<nsend; i++) {
-           free( sbuf[i] );
-           free( rbuf[i] );
-       }
-
-       MPI_Barrier( MPI_COMM_WORLD );
-       if (myid == 0 && (count % 64) == 0) {
-           printf( "All processes completed for count = %ld ints of data\n", 
-                   (long)count );
-           fflush(stdout);
-       }
-    }
-    MPI_Finalize();
-    return 0;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nblock.std b/teshsuite/smpi/mpich-test/pt2pt/nblock.std
deleted file mode 100644 (file)
index 7af1fd7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-All processes completed for count = 64 ints of data
-All processes completed for count = 128 ints of data
-All processes completed for count = 256 ints of data
-All processes completed for count = 512 ints of data
-All processes completed for count = 1024 ints of data
-All processes completed for count = 2048 ints of data
-All processes completed for count = 4096 ints of data
-All processes completed for count = 8192 ints of data
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nbtest.c b/teshsuite/smpi/mpich-test/pt2pt/nbtest.c
deleted file mode 100644 (file)
index 3e62023..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
-   Test to make sure that nonblocking routines actually work
-   In this example, we assume that we do not know the message
-   sizes ahead of time.
-
-   Just like nblock, but with the probe test.
-*/
-
-int main( int argc, char **argv )
-{
-    int count, tag, nsend, myid, np, rcnt, scnt, i, j, *send_buf;
-    int length, finished;
-    int baselen = 1;
-    int **recv_buf;
-    MPI_Status status, rtn_status;
-    MPI_Request *rsend, *rrecv;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-/*
-  MPE_Errors_call_dbx_in_xterm( (argv)[0], (char *)0 ); 
-  MPE_Signals_call_debugger();
-  */
-    if (argc > 2 && argv[1] && strcmp( argv[1], "-first" ) == 0) 
-       baselen = atoi(argv[2]);
-
-/* malloc buffers */
-    nsend = 3 * np;
-    rsend = (MPI_Request *) malloc ( nsend * sizeof(MPI_Request) );
-    rrecv = (MPI_Request *) malloc ( nsend * sizeof(MPI_Request) );
-    recv_buf = (int **) malloc ( nsend * sizeof(int *) );
-    if (!rsend || !rrecv) {
-       fprintf( stderr, "Failed to allocate space for requests\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    for (count = baselen; count < 10000; count *= 2) {
-       /* We'll send/recv from everyone */
-       scnt = 0;
-       rcnt = 0;
-
-       /* do sends */
-       send_buf   = (int *)malloc( count * sizeof(int) );
-       for (j=0; j<3; j++) {
-           tag = j;
-           for (i=0; i<np; i++) {
-               if (i != myid) 
-                   MPI_Isend( send_buf, count, MPI_INT, i, tag, 
-                              MPI_COMM_WORLD, &rsend[scnt++] );
-           }
-           /* Check sends, one could free memory here if they are done */
-           for (i=0; i<scnt; i++) {
-               MPI_Test( &rsend[i], &finished, &status );
-           }
-       }
-
-       /* do recvs */
-       for (j=0; j<3; j++) {
-           tag = j;
-           for (i=0; i<np; i++) {
-               if (i != myid)  {
-                   MPI_Probe(MPI_ANY_SOURCE,tag,MPI_COMM_WORLD,&status);
-                   MPI_Get_count(&status,MPI_INT,&length); 
-                   /* printf("[%d] length = %d\n",myid,length); 
-                      fflush(stdout); */
-                   recv_buf[rcnt] = (int *)malloc(length * sizeof(int));
-                   MPI_Recv(recv_buf[rcnt],length,MPI_INT,status.MPI_SOURCE, 
-                            status.MPI_TAG,MPI_COMM_WORLD,&rtn_status);
-                   rcnt++;
-               }
-           }
-       }
-
-       /* Wait on sends */
-       for (i=0; i<scnt; i++) {
-           MPI_Wait( &rsend[i], &status );
-       }
-
-       /* free buffers */
-       for (i=0; i<rcnt; i++) free(recv_buf[i]);
-       free( send_buf );
-       
-       MPI_Barrier( MPI_COMM_WORLD );
-       if (myid == 0 && (count % 64) == 0) {
-           printf( "All processes completed for count = %ld ints of data\n", 
-                   (long)count ); fflush(stdout);
-       }
-    }
-
-    MPI_Finalize();
-    return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nbtest.std b/teshsuite/smpi/mpich-test/pt2pt/nbtest.std
deleted file mode 100644 (file)
index 567a3c1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-*** Testing Isend/Probe/Recv (large numbers) ***
-All processes completed for count = 64 ints of data
-All processes completed for count = 128 ints of data
-All processes completed for count = 256 ints of data
-All processes completed for count = 512 ints of data
-All processes completed for count = 1024 ints of data
-All processes completed for count = 2048 ints of data
-All processes completed for count = 4096 ints of data
-All processes completed for count = 8192 ints of data
-*** Testing Isend/Probe/Recv (large numbers) ***
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nullproc.c b/teshsuite/smpi/mpich-test/pt2pt/nullproc.c
deleted file mode 100644 (file)
index d9d547f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *  Test for null proc handling with non-blocking routines
- */
-
-
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char *argv[] )
-{
-   int             a[4];
-   int             i, nproc;
-   int             rank, right, left;
-   MPI_Status      status;
-   MPI_Request     req[4];
-   int             index, it, count, errcnt = 0;
-
-   /* start up */
-   MPI_Init(&argc, &argv);
-   MPI_Comm_size(MPI_COMM_WORLD, &nproc);
-   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-   /* set up processor chain (Apps should use Cart_create/shift) */
-   left = (rank == 0) ? MPI_PROC_NULL : rank - 1;
-   right = (rank == nproc - 1) ? MPI_PROC_NULL : rank + 1;
-
-   /* initialize local matrix */
-   /* globally: a[i] = i, i = 1 .. 2*nproc */
-   /* locally : a[i] = 2*rank+i, i=1,2 */
-   a[0] = -1;
-   a[1] = 2*rank + 1; 
-   a[2] = 2*rank + 2; 
-   a[3] = -1;
-
-   /* start all receives and sends */
-   MPI_Irecv(&a[0], 1, MPI_INT, left,  1, MPI_COMM_WORLD, &req[0]);
-   MPI_Irecv(&a[3], 1, MPI_INT, right, 0, MPI_COMM_WORLD, &req[3]);
-   MPI_Isend(&a[1], 1, MPI_INT, left, 0, MPI_COMM_WORLD, &req[1]);
-   MPI_Isend(&a[2], 1, MPI_INT, right,  1, MPI_COMM_WORLD, &req[2]);
-
-   for (it=0; it<4; it++) {
-       status.MPI_SOURCE = nproc;
-       status.MPI_TAG = nproc;
-       MPI_Waitany( 4, req, &index, &status );
-       if (index == 0 && left == MPI_PROC_NULL) {
-          if (status.MPI_TAG != MPI_ANY_TAG ||
-              status.MPI_SOURCE != MPI_PROC_NULL) {
-              errcnt ++;
-              fprintf( stderr, "Incorrect null status for left\n" );
-          }
-          MPI_Get_count( &status, MPI_INT, &count );
-          if (count != 0) {
-              errcnt ++;
-              fprintf( stderr, "Incorrect null status for left (count)\n" );
-          }
-       }
-       else if (index == 3 && right == MPI_PROC_NULL) {
-          if (status.MPI_TAG != MPI_ANY_TAG ||
-              status.MPI_SOURCE != MPI_PROC_NULL) {
-              errcnt ++;
-              fprintf( stderr, "Incorrect null status for right\n" );
-          }
-          MPI_Get_count( &status, MPI_INT, &count );
-          if (count != 0) {
-              errcnt ++;
-              fprintf( stderr, "Incorrect null status for right (count)\n" );
-          }
-       }
-   }
-   
-   /* Test results */
-   if (left == MPI_PROC_NULL) {
-       if (a[0] != -1) {
-          fprintf( stderr, "Expected -1, found %d in left partner\n", a[0] );
-          errcnt ++;
-       }
-   }
-   else {
-       if (a[0] != 2 * left + 2) {
-          fprintf( stderr, "Expected %d, found %d in left partner\n", 
-                   2 * left + 2, a[0] );
-          errcnt ++;
-       }
-   }
-
-   if (right == MPI_PROC_NULL) {
-       if (a[3] != -1) {
-          fprintf( stderr, "Expected -1, found %d in right partner\n", a[3] );
-          errcnt ++;
-       }
-   }
-   else {
-       if (a[3] != 2 * right + 1) {
-          fprintf( stderr, "Expected %d, found %d in right partner\n", 
-                   2 * right + 1, a[3] );
-          errcnt ++;
-       }
-   }
-
-   
-   i = errcnt;
-   MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-   if (rank == 0) {
-       if (errcnt > 0) {
-          printf( "Found %d errors in the run \n", errcnt );
-       }
-       else
-          printf( "No errors in handling MPI_PROC_NULL\n" );
-   }
-   
-   /* clean up */
-   MPI_Finalize();
-   return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nullproc.std b/teshsuite/smpi/mpich-test/pt2pt/nullproc.std
deleted file mode 100644 (file)
index a9124d5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-No errors in handling MPI_PROC_NULL
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nullproc2.c b/teshsuite/smpi/mpich-test/pt2pt/nullproc2.c
deleted file mode 100644 (file)
index fcffd5a..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *  Test for null proc handling with blocking routines
- */
-
-
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char *argv[] )
-{
-   int             a[4];
-   int             i, nproc;
-   int             rank, right, left;
-   MPI_Status      st[2], sts[2];
-   MPI_Request     req[2];
-   int             count, errcnt = 0;
-
-   /* start up */
-   MPI_Init(&argc, &argv);
-   MPI_Comm_size(MPI_COMM_WORLD, &nproc);
-   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-   /* set up processor chain (Apps should use Cart_create/shift) */
-   left = (rank == 0) ? MPI_PROC_NULL : rank - 1;
-   right = (rank == nproc - 1) ? MPI_PROC_NULL : rank + 1;
-
-   /* initialize local matrix */
-   /* globally: a[i] = i, i = 1 .. 2*nproc */
-   /* locally : a[i] = 2*rank+i, i=1,2 */
-   a[0] = -1;
-   a[1] = 2*rank + 1; 
-   a[2] = 2*rank + 2; 
-   a[3] = -1;
-
-   /* start all receives and sends */
-   MPI_Isend(&a[1], 1, MPI_INT, left, 0, MPI_COMM_WORLD, &req[0]);
-   MPI_Isend(&a[2], 1, MPI_INT, right,  1, MPI_COMM_WORLD, &req[1]);
-   st[0].MPI_SOURCE = nproc;
-   st[0].MPI_TAG = -1;
-   st[1].MPI_SOURCE = nproc;
-   st[1].MPI_TAG = -1;
-   MPI_Recv(&a[0], 1, MPI_INT, left,  1, MPI_COMM_WORLD, &st[0]);
-   MPI_Recv(&a[3], 1, MPI_INT, right, 0, MPI_COMM_WORLD, &st[1]);
-   MPI_Waitall( 2, req, sts );
-
-   /* Test the end points */
-   if (left == MPI_PROC_NULL) {
-       if (st[0].MPI_TAG != MPI_ANY_TAG ||
-          st[0].MPI_SOURCE != MPI_PROC_NULL) {
-          errcnt ++;
-          fprintf( stderr, "Incorrect null status for left\n" );
-          if (st[0].MPI_SOURCE != MPI_PROC_NULL) {
-              fprintf( stderr, "Source returned was %d but should be %d\n",
-                       st[0].MPI_SOURCE, MPI_PROC_NULL );
-          }
-       }
-       MPI_Get_count( &st[0], MPI_INT, &count );
-       if (count != 0) {
-          errcnt ++;
-          fprintf( stderr, "Incorrect null status for left (count)\n" );
-          fprintf( stderr, "Count was %d but should be 0\n", count );
-       }
-   }
-   else if (right == MPI_PROC_NULL) {
-       if (st[1].MPI_TAG != MPI_ANY_TAG ||
-          st[1].MPI_SOURCE != MPI_PROC_NULL) {
-          errcnt ++;
-          fprintf( stderr, "Incorrect null status for right\n" );
-          if (st[1].MPI_SOURCE != MPI_PROC_NULL) {
-              fprintf( stderr, "Source returned was %d but should be %d\n",
-                       st[1].MPI_SOURCE, MPI_PROC_NULL );
-          }
-       }
-       MPI_Get_count( &st[1], MPI_INT, &count );
-       if (count != 0) {
-          errcnt ++;
-          fprintf( stderr, "Incorrect null status for right (count)\n" );
-          fprintf( stderr, "Count was %d but should be 0\n", count );
-       }
-   }
-   
-   /* Test results */
-   if (left == MPI_PROC_NULL) {
-       if (a[0] != -1) {
-          fprintf( stderr, "Expected -1, found %d in left partner\n", a[0] );
-          errcnt ++;
-       }
-   }
-   else {
-       if (a[0] != 2 * left + 2) {
-          fprintf( stderr, "Expected %d, found %d in left partner\n", 
-                   2 * left + 2, a[0] );
-          errcnt ++;
-       }
-   }
-
-   if (right == MPI_PROC_NULL) {
-       if (a[3] != -1) {
-          fprintf( stderr, "Expected -1, found %d in right partner\n", a[3] );
-          errcnt ++;
-       }
-   }
-   else {
-       if (a[3] != 2 * right + 1) {
-          fprintf( stderr, "Expected %d, found %d in right partner\n", 
-                   2 * right + 1, a[3] );
-          errcnt ++;
-       }
-   }
-
-   
-   i = errcnt;
-   MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-   if (rank == 0) {
-       if (errcnt > 0) {
-          printf( "Found %d errors in the run \n", errcnt );
-       }
-       else
-          printf( "No errors in handling MPI_PROC_NULL\n" );
-   }
-   
-   /* clean up */
-   MPI_Finalize();
-   return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/nullproc2.std b/teshsuite/smpi/mpich-test/pt2pt/nullproc2.std
deleted file mode 100644 (file)
index a9124d5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-No errors in handling MPI_PROC_NULL
diff --git a/teshsuite/smpi/mpich-test/pt2pt/order.c b/teshsuite/smpi/mpich-test/pt2pt/order.c
deleted file mode 100644 (file)
index 1b8f3a9..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-
-int main( int argc, char *argv[] )
-{
-    int easy;
-    int rank;
-    int size;
-    int a;
-    int b;
-    MPI_Request request;
-    MPI_Status  status;
-    double t0;
-    
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    /* This test depends on a working wtime.  Make a simple check */
-    t0 = MPI_Wtime();
-    if (t0 == 0 && MPI_Wtime() == 0) {
-       int loopcount = 1000000;
-       /* This test is too severe (systems with fast 
-          processors and large MPI_Wtick values can 
-          fail.  Try harder to test MPI_Wtime */
-       while (loopcount-- && MPI_Wtime() == 0) ;
-       if (loopcount <= 0) {
-           fprintf( stderr, 
-                    "MPI_WTIME is returning 0; a working value is needed\n\
-for this test.\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       t0 = MPI_Wtime();
-    }
-
-    easy = 1;
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (rank == 0)
-    {
-       MPI_Irecv(&a, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &request);
-       MPI_Recv(&b, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &status);
-       MPI_Wait(&request, &status);
-       /* Check for correct values: */
-       if (a == 1 && b == 2) {
-           printf( " No Errors\n" );
-       }
-       else {
-           printf("rank = %d, a = %d, b = %d\n", rank, a, b);
-       }
-    }
-    else
-    {
-       MPI_Wtime();
-       sleep(easy);
-  //while (MPI_Wtime() - t1 < easy) ;
-       a = 1;
-       b = 2;
-       MPI_Send(&a, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
-       MPI_Send(&b, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
-    }
-    
-
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/overtake.c b/teshsuite/smpi/mpich-test/pt2pt/overtake.c
deleted file mode 100644 (file)
index 3662918..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Program to test that the "no overtaking messages" semantics
- * of point to point communications in MPI is satisfied. 
- * A long message is sent using MPI_Send and received using MPI_Recv,
- * followed by lots of short messages sent the same way.
- * Then Send -> Irecv, Bsend -> Recv, Bsend -> Irecv, 
- * Isend -> Recv, and Isend -> Irecv are all tried in the
- * same way.
- *
- *                             Patrick Bridges
- *                             bridges@mcs.anl.gov
- *                             patrick@CS.MsState.Edu
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-
-static int src  = 0;
-static int dest = 1;
-
-/* Which tests to perform (not yet implemented) */
-/* static int Do_Buffer = 1; */
-/* static int Do_Standard = 1; */
-/* In order to quiet noisy C compilers, we provide ANSI-style prototypes
-   where possible */
-void Generate_Data ( double *, int );
-void Normal_Test_Send ( double *, int );
-void Normal_Test_Recv ( double *, int );
-void Buffered_Test_Send ( double *, int );
-/* void Buffered_Test_Recv ( double *, int ); */
-void Async_Test_Send ( double *, int );
-void Async_Test_Recv ( double *, int );
-int Check_Data ( double *, int );
-void Clear_Buffer ( double *, int );
-
-
-void Generate_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = (double)i+1;
-}
-
-void Normal_Test_Send(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       MPI_Send(buffer, (buff_size/2 - 10), MPI_DOUBLE, dest, 2000, 
-                MPI_COMM_WORLD);
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Send(buffer++, 1, MPI_DOUBLE, dest, 2000, MPI_COMM_WORLD);
-    }
-}
-
-void Normal_Test_Recv(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-    MPI_Status Stat;
-
-    for (j = 0; j < 2; j++) {
-       /* Receive a long message */
-       MPI_Recv(buffer, (buff_size/2 - 10), MPI_DOUBLE, src, 
-                2000, MPI_COMM_WORLD, &Stat);
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Recv(buffer++, 1, MPI_DOUBLE, src, 2000, MPI_COMM_WORLD, &Stat);
-    }
-}
-
-void Buffered_Test_Send(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j;
-    void *bbuffer;
-    int size;
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       MPI_Bsend(buffer, (buff_size/2 - 10), MPI_DOUBLE, dest, 2000, 
-                MPI_COMM_WORLD);
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Bsend(buffer++, 1, MPI_DOUBLE, 
-                     dest, 2000, MPI_COMM_WORLD);
-        /* Force this set of Bsends to complete */
-        MPI_Buffer_detach( &bbuffer, &size );
-        MPI_Buffer_attach( bbuffer, size );
-    }
-}
-
-void Async_Test_Send(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j, req = 0;
-    MPI_Status Stat[22];
-    MPI_Request Hand[22];
-
-    for (j = 0; j < 2; j++) {
-       /* send a long message */
-       MPI_Isend(buffer, (buff_size/2 - 10), MPI_DOUBLE, 
-                 dest, 2000, MPI_COMM_WORLD, &(Hand[req++]));
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Isend(buffer++, 1, MPI_DOUBLE, dest, 2000, 
-                     MPI_COMM_WORLD, &(Hand[req++]));
-    }
-    MPI_Waitall(req, Hand, Stat);
-}
-
-void Async_Test_Recv(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i, j, req = 0;
-    MPI_Status Stat[22];
-    MPI_Request Hand[22];
-    
-    for (j = 0; j < 2; j++) {
-       /* Receive a long message */
-       MPI_Irecv(buffer, (buff_size/2 - 10), MPI_DOUBLE, src, 
-                2000, MPI_COMM_WORLD, &(Hand[req++]));
-       buffer += buff_size/2 - 10;
-       /* Followed by 10 short ones */
-       for (i = 0; i < 10; i++)
-           MPI_Irecv(buffer++, 1, MPI_DOUBLE, src, 2000, 
-                     MPI_COMM_WORLD, &(Hand[req++]));
-    }
-    MPI_Waitall(req, Hand, Stat);
-}
-
-int Check_Data(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    int err = 0;
-
-    for (i = 0; i < buff_size; i++)
-       if (buffer[i] != (i + 1)) {
-           err++;
-           fprintf( stderr, "Value at %d is %f, should be %f\n", i, 
-                   buffer[i], (double)(i+1) );
-           if (err > 10) return 1;
-           }
-    return err;
-}
-
-void Clear_Buffer(buffer, buff_size)
-double *buffer;
-int buff_size;
-{
-    int i;
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = -1;
-}
-
-
-int main( int argc, char **argv )
-{
-    int rank; /* My Rank (0 or 1) */
-    double buffer[SIZE], *tmpbuffer, *tmpbuf;
-    int tsize, bsize;
-    char *Current_Test = NULL;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-    if (rank == src) { 
-       Generate_Data(buffer, SIZE);
-       Normal_Test_Send(buffer, SIZE);
-       Normal_Test_Send(buffer, SIZE);
-#if !defined(SIMPLE_SENDS) && !defined(NO_BUFFERED_SENDS)
-       MPI_Pack_size( SIZE, MPI_DOUBLE, MPI_COMM_WORLD, &bsize );
-       tmpbuffer = (double *) malloc( bsize + MPI_BSEND_OVERHEAD );
-       if (!tmpbuffer) {
-           fprintf( stderr, "Could not allocate bsend buffer of size %d\n",
-                    bsize );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-           }
-        MPI_Buffer_attach( tmpbuffer, bsize + MPI_BSEND_OVERHEAD );
-       Buffered_Test_Send(buffer, SIZE);
-       Buffered_Test_Send(buffer, SIZE);
-       MPI_Buffer_detach( &tmpbuf, &tsize );
-#endif
-#if !defined(SIMPLE_SENDS) && !defined(NO_ASYNC_SENDS)
-       Async_Test_Send(buffer, SIZE);
-       Async_Test_Send(buffer, SIZE);
-#endif
-       Test_Waitforall( );
-
-    } else if (rank == dest) {
-       Test_Init("overtake", rank);
-       /* Test 1 */
-       Current_Test = (char*)"Overtaking Test (Normal Send   -> Normal Recieve)";
-       Normal_Test_Recv(buffer, SIZE);
-
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-       /* Test 2 */
-       Clear_Buffer(buffer, SIZE);
-       Current_Test = (char*)"Overtaking Test (Normal Send   ->  Async Receive)";
-       Async_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-#if !defined(SIMPLE_SENDS) && !defined(NO_BUFFERED_SENDS)
-       /* Test 3 */
-       Current_Test = (char*)"Overtaking Test (Buffered Send -> Normal Recieve)";
-       Clear_Buffer(buffer, SIZE);
-       Normal_Test_Recv(buffer, SIZE);
-
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-       /* Test 4 */
-       Clear_Buffer(buffer, SIZE);
-       Current_Test = (char*)"Overtaking Test (Buffered Send ->  Async Receive)";
-       Async_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-#endif
-
-#if !defined(SIMPLE_SENDS) && !defined(NO_ASYNC_SENDS)
-       /* Test 5 */
-       Current_Test = (char*)"Overtaking Test (Async Send    -> Normal Receive)";
-       Clear_Buffer(buffer, SIZE);
-       Normal_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-
-           /* Test 6 */
-       Clear_Buffer(buffer, SIZE);
-       Current_Test = (char*)"Overtaking Test (Async Send    ->  Async Receive)";
-       Async_Test_Recv(buffer, SIZE);
-       if (Check_Data(buffer, SIZE))
-           Test_Failed(Current_Test);
-       else
-           Test_Passed(Current_Test);
-#endif
-
-       Test_Waitforall( );
-       {
-           int rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           MPI_Finalize();
-           return rval;
-       }
-    } else {
-       fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    MPI_Finalize();
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/pack.c b/teshsuite/smpi/mpich-test/pt2pt/pack.c
deleted file mode 100644 (file)
index ee9a2dd..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
-   Check pack/unpack of mixed datatypes.
- */
-#define BUF_SIZE 100
-int main( int argc, char **argv )
-{
-    int myrank;
-    char buffer[BUF_SIZE];
-    int n, size, src, dest, errcnt, errs;
-    double a,b;
-    int pos;
-
-    MPI_Status status;
-    MPI_Init(&argc, &argv);
-    
-    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-
-    src           = 0;
-    dest   = 1;
-
-    src           = 1;
-    dest   = 0;
-
-    errcnt = 0;
-    if (myrank == src)
-       {
-           pos = 0;
-           n   = 10;
-           a   = 1.1;
-           b   = 2.2;
-           MPI_Pack(&n, 1, MPI_INT, buffer, BUF_SIZE, &pos, MPI_COMM_WORLD);
-           MPI_Pack(&a, 1, MPI_DOUBLE, buffer, BUF_SIZE, &pos, 
-                    MPI_COMM_WORLD);
-           MPI_Pack(&b, 1, MPI_DOUBLE, buffer, BUF_SIZE, &pos, 
-                    MPI_COMM_WORLD);
-           /* printf( "%d\n", pos ); */
-           MPI_Send(&pos, 1, MPI_INT, dest, 999, MPI_COMM_WORLD);
-           MPI_Send(buffer, pos, MPI_PACKED, dest, 99, MPI_COMM_WORLD);
-       }
-    else
-       {
-           MPI_Recv(&size, 1, MPI_INT, src, 999, MPI_COMM_WORLD, &status);
-           MPI_Recv(buffer, size, MPI_PACKED, src, 99, 
-                    MPI_COMM_WORLD, &status);
-           pos = 0;
-           MPI_Unpack(buffer, size, &pos, &n, 1, MPI_INT, MPI_COMM_WORLD);
-           MPI_Unpack(buffer, size, &pos, &a, 1, MPI_DOUBLE, MPI_COMM_WORLD);
-           MPI_Unpack(buffer, size, &pos, &b, 1, MPI_DOUBLE, MPI_COMM_WORLD);
-           /* Check results */
-           if (n != 10) { 
-               errcnt++;
-               printf( "Wrong value for n; got %d expected %d\n", n, 10 );
-               }
-           if (a != 1.1) { 
-               errcnt++;
-               printf( "Wrong value for a; got %f expected %f\n", a, 1.1 );
-               }
-           if (b != 2.2) { 
-               errcnt++;
-               printf( "Wrong value for b; got %f expected %f\n", b, 2.2 );
-               }
-       }
-    MPI_Allreduce( &errcnt, &errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (myrank == 0) {
-       if (errs == 0) printf( "No errors\n" );
-       else           printf( "%d errors\n", errs );
-       }
-    MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/persist.c b/teshsuite/smpi/mpich-test/pt2pt/persist.c
deleted file mode 100644 (file)
index 7e17762..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- * This example causes the IBM SP2 MPI version to generate the message
- * ERROR: 0032-158 Persistent request already active  (2) in MPI_Startall, task 0
- * in the SECOND set of MPI_Startall (after the MPI_Request_free).
- */
-int main( int argc, char **argv )
-{
-    MPI_Request r[4];
-    MPI_Status  statuses[4];
-    double sbuf1[10], sbuf2[10];
-    double rbuf1[10], rbuf2[10];
-    int size, rank, up_nbr, down_nbr, i;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    up_nbr = (rank + 1) % size;
-    down_nbr = (size + rank - 1) % size;
-
-    MPI_Recv_init( rbuf1, 10, MPI_DOUBLE, down_nbr, 0, MPI_COMM_WORLD, &r[0] );
-    MPI_Recv_init( rbuf2, 10, MPI_DOUBLE, up_nbr, 1, MPI_COMM_WORLD, &r[1] );
-    MPI_Send_init( sbuf1, 10, MPI_DOUBLE, up_nbr, 0, MPI_COMM_WORLD, &r[2] );
-    MPI_Send_init( sbuf2, 10, MPI_DOUBLE, down_nbr, 1, MPI_COMM_WORLD, &r[3] );
-    MPI_Startall( 4, r );
-    MPI_Waitall( 4, r, statuses );
-
-    for (i=0; i<4; i++) {
-       MPI_Request_free( &r[i] );
-       }
-
-    MPI_Recv_init( rbuf1, 10, MPI_DOUBLE, down_nbr, 0, MPI_COMM_WORLD, &r[0] );
-    MPI_Recv_init( rbuf2, 10, MPI_DOUBLE, up_nbr, 1, MPI_COMM_WORLD, &r[1] );
-    MPI_Send_init( sbuf1, 10, MPI_DOUBLE, up_nbr, 0, MPI_COMM_WORLD, &r[2] );
-    MPI_Send_init( sbuf2, 10, MPI_DOUBLE, down_nbr, 1, MPI_COMM_WORLD, &r[3] );
-    MPI_Startall( 4, r );
-    MPI_Waitall( 4, r, statuses );
-
-    for (i=0; i<4; i++) {
-       MPI_Request_free( &r[i] );
-       }
-
-    if (rank == 0) printf( " No Errors\n" );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/persist2.c b/teshsuite/smpi/mpich-test/pt2pt/persist2.c
deleted file mode 100644 (file)
index 7bdfeaf..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- */
-int main( int argc, char **argv )
-{
-    MPI_Request r[4];
-    MPI_Status  statuses[4];
-    double sbuf1[10], sbuf2[10];
-    double rbuf1[10], rbuf2[10];
-    double userbuf[40+4*MPI_BSEND_OVERHEAD];
-    int size, rank, up_nbr, down_nbr, i, err, toterr;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    up_nbr = (rank + 1) % size;
-    down_nbr = (size + rank - 1) % size;
-
-    for (i=0; i<10; i++) {
-       sbuf1[i] = (double)i;
-       sbuf2[i] = (double)(i+20);
-    }
-    MPI_Buffer_attach( userbuf, 40*sizeof(double) + 4 * MPI_BSEND_OVERHEAD );
-
-    MPI_Recv_init( rbuf1, 10, MPI_DOUBLE, down_nbr, 0, MPI_COMM_WORLD, &r[0] );
-    MPI_Recv_init( rbuf2, 10, MPI_DOUBLE, up_nbr, 1, MPI_COMM_WORLD, &r[1] );
-    MPI_Bsend_init( sbuf1, 10, MPI_DOUBLE, up_nbr, 0, MPI_COMM_WORLD, &r[2] );
-    MPI_Bsend_init( sbuf2, 10, MPI_DOUBLE, down_nbr, 1, MPI_COMM_WORLD, &r[3] );
-    MPI_Startall( 4, r );
-    MPI_Waitall( 4, r, statuses );
-
-    for (i=0; i<4; i++) {
-       MPI_Request_free( &r[i] );
-       }
-
-    MPI_Recv_init( rbuf1, 10, MPI_DOUBLE, down_nbr, 0, MPI_COMM_WORLD, &r[0] );
-    MPI_Recv_init( rbuf2, 10, MPI_DOUBLE, up_nbr, 1, MPI_COMM_WORLD, &r[1] );
-    MPI_Bsend_init( sbuf1, 10, MPI_DOUBLE, up_nbr, 0, MPI_COMM_WORLD, &r[2] );
-    MPI_Bsend_init( sbuf2, 10, MPI_DOUBLE, down_nbr, 1, MPI_COMM_WORLD, &r[3] );
-    MPI_Startall( 4, r );
-    MPI_Waitall( 4, r, statuses );
-
-    for (i=0; i<4; i++) {
-       MPI_Request_free( &r[i] );
-       }
-
-    /* Check data */
-    err = 0;
-    for (i=0; i<10;i++) {
-       if (rbuf1[i] != i) {
-           err++;
-           if (err < 10) 
-               fprintf( stderr, "Expected %d, rbuf1[%d] = %f\n", i, i, 
-                        rbuf1[i] );
-       }
-       if (rbuf2[i] != i+20) {
-           err++;
-           if (err < 10) 
-               fprintf( stderr, "Expected %d, rbuf2[%d] = %f\n", i+20, i, 
-                        rbuf2[i] );
-       }
-    }
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-       if (toterr == 0) printf( "No errors\n" );
-       else             printf( "Found %d errors\n", toterr );
-    }
-
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/persistent.c b/teshsuite/smpi/mpich-test/pt2pt/persistent.c
deleted file mode 100644 (file)
index 7c8e213..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    int rank, size, i, len, actlen, expected_len;
-    MPI_Request rq;
-    MPI_Status status;
-    double data[100];
-
-    len = 100;
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    if (size < 3 ) {
-       fprintf( stderr, "This test requires more than 2 proceses\n" );
-       MPI_Finalize();
-       return 1;
-       }
-
-    if (rank == 0) {
-       MPI_Recv_init( data, len, MPI_DOUBLE, MPI_ANY_SOURCE, MPI_ANY_TAG, 
-                      MPI_COMM_WORLD, &rq );
-       for (i=1; i<size; i++) {
-           printf( "Receiving message %d\n", i );
-           MPI_Start( &rq );
-           MPI_Wait( &rq, &status );
-           if (status.MPI_SOURCE != status.MPI_TAG) {
-               printf( "Error in received message (source and tag)\n" );
-               printf( "Source was %d and tag was %d\n",
-                       status.MPI_SOURCE, status.MPI_TAG );
-               }
-           MPI_Get_count( &status, MPI_DOUBLE, &actlen );
-           expected_len = (status.MPI_SOURCE < 10) ? status.MPI_SOURCE * 10 :
-               100;
-           if (actlen != expected_len) {
-               printf( "Got %d words, expected %d words\n", actlen, 
-                      expected_len );
-               }
-           printf( "Received message %d\n", i );
-           }
-       MPI_Request_free( &rq );
-       printf( "Completed all receives\n" );
-       }
-    else {
-       MPI_Send( data, (rank < 10) ? rank * 10 : 100, 
-                 MPI_DOUBLE, 0, rank, MPI_COMM_WORLD );
-       }
-MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/persistent.std b/teshsuite/smpi/mpich-test/pt2pt/persistent.std
deleted file mode 100644 (file)
index 5a25fc0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Receiving message 1
-Received message 1
-Receiving message 2
-Received message 2
-Receiving message 3
-Received message 3
-Completed all receives
diff --git a/teshsuite/smpi/mpich-test/pt2pt/pingpong.f b/teshsuite/smpi/mpich-test/pt2pt/pingpong.f
deleted file mode 100644 (file)
index 53adf21..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-c PING_PONG two-node message exchanges benchmark program
-C 
-C Contributed by Richard Frost <frost@SDSC.EDU>, caused problems
-C on t3d with -device=t3d -arch=cray_t3d -no_short_longs -nodevdebug
-C 
-C
-C This is a very time-consuming program on a workstation cluster.
-C For this reason, I've modified it to do fewer tests (1/10 as many)
-C
-c
-c This is a simple benchmark designed to measure the latency and bandwidth
-c of a message-passing MIMD computer.  It is currently set up to run with
-c MPI.
-c
-c Compile (MPI mpich version 1.0.11 or later) with
-c     % mpif77 -o pong pong.f
-c
-c (mpif77 is a script that hides details about libraries from the user)
-c
-c Execute as
-c     % mpirun -np 2 pong
-c
-c Make sure that ~mpi/bin is in your path.
-c
-c Note that the MPI-specific calls are:
-c
-c      MPI_INIT
-c      MPI_COMM_RANK
-c      MPI_COMM_SIZE
-c
-c      MPI_Wtime
-c      MPI_Wtick
-c
-c      MPI_SEND
-c      MPI_RECV
-c
-c      MPI_FINALIZE
-c
-c Some care needs to be taken in using the
-c appropriate timing routine.  Check the value of MPI_Wtick() to see if
-c the clock resolution is reasonable for your tests.
-c
-c The benchmark measures
-c the time to send a message of length N bytes from node 0 to node 1 and
-c receive an acknowledging copy of that message which node 1 sends back to 
-c node 0.  Note that node 1 waits for the completion of its receive before
-c sending the message back to node 0. Note also that the program is not
-c necessarily optimal any given system, but is intended
-c to provide a reasonably transparent baseline measurement. 
-c 
-c For message lengths len (= num of doubles * sizedouble),
-c a total of msgspersample ping-pong message exchanges are made,       
-c and half of the average round-trip time (i.e. the one-way message
-c time) is then fit by a linear function y(N) = a + b*N via a least squares
-c linear regression.  The coefficient a is then interpreted as the latency
-c (time to send a 0-length message) and b as the inverse bandwidth (i.e. 1/b =
-c bandwidth in bytes/sec)
-c
-c The entire procedure is repeated twice, with the bandwidth, latency, and
-c measured and fitted values of the message times reported for each instance.
-c
-c The underlying message passing performance characteristics of a 
-c particular system may not necessarily be accurately modeled by the simple
-c linear function assumed here.  This may be reflected in a dependency of
-c the observed latency and bandwidth on the range of message sizes used.
-c
-c Original author:
-c R. Leary, San Diego Supercomputer Center
-c leary@sdsc.edu        9/20/94
-c
-c Modified for MPI     10/27/95
-c frost@sdsc.edu
-
-c
-c =========================== program header =========================== 
-c
-
-      program pong
-      implicit none
-      include 'mpif.h'
-
-c sizedouble = size in bytes of double precision element
-      integer sizedouble
-      parameter(sizedouble=8)
-
-c Note: set these parameters to one of 3 cases:
-c  1. size (each sample) < packetization length of architecture
-c  2. size (each sample) > packetization length of architecture
-c  3. size (1st sample) < packetization length of architecture
-c   & size (all others) > packetization length of architecture
-c
-c  Some known packetization lengths:
-c    Paragon            ~1500    bytes
-c    Cray T3D           ~1500    bytes
-c    TCP/IP networks    256-1024 bytes
-c
-c samples = the number of data points collected
-      integer samples
-      parameter(samples=40)
-c initsamplesize = # of elements transmitted in 1st sample
-      integer initsamplesize
-      parameter(initsamplesize=125)
-c samplesizeinc = sample size increase per iteration (linear rate)
-      integer samplesizeinc
-      parameter(samplesizeinc=125)
-c     parameter(samplesizeinc=1)
-c msgspersample = the number of messages
-      integer msgspersample
-c      parameter(msgspersample=1000)
-       parameter(msgspersample=100)
-
-c The buffer array contains the message , while x(i) is the message size 
-c and y(i) the corresponding measured one-way average time. 
-c Note that buffer is a double precision array
-c
-c ibufcount = total number of elements in buffer
-      integer ibufcount
-      parameter(ibufcount=(initsamplesize+((samples-1)*samplesizeinc)))
-c
-      double precision buffer(ibufcount)
-      double precision x(samples), y(samples)
-      double precision t1, t2
-      double precision a, b, bandw
-      double precision sumx, sumy, sumxx, sumxy
-      double precision det, fit
-
-      integer stat(MPI_STATUS_SIZE)
-      integer ierr, ierr1, ierr2
-      integer nodenum, numprocs
-      integer idest
-      integer i, iter, sample
-      integer num
-
-c
-c =========================== begin =========================== 
-c
-
-      call MPI_INIT( ierr )
-      call MPI_COMM_RANK( MPI_COMM_WORLD, nodenum, ierr )
-      call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
-
-      if (numprocs .ne. 2) then
-         write (6,*) 'This program is only valid for 2 processors'
-         write (6,*) 'numprocs = ', numprocs
-         stop
-      endif
-
-c Put something into array
-      do 2 i=1,ibufcount
-        buffer(i) = dfloat(i)
-    2 continue
-
-      if (nodenum .eq. 0) then
-         write (6,*) ' MPI pong test'
-         write (6,*) ' samples = ', samples
-         write (6,*) ' initsamplesize = ', initsamplesize
-         write (6,*) ' samplesizeinc = ', samplesizeinc
-         write (6,*) ' msgspersample = ', msgspersample
-         write (6,*) ' ibufcount = ', ibufcount
-         write (6,98) MPI_Wtick()
-         write (6,*) 
-      endif
-   98 format (' clock resolution = ',e10.5)
-
-      call MPI_BARRIER(MPI_COMM_WORLD, ierr)
-
-c
-c =========================== main loop =========================== 
-c
-
-c Start main loop - iterate twice to generate two complete sets of timings
-      do 60 iter = 1,2
-      do 40 sample = 1,samples
-      num = initsamplesize + ((sample-1)*samplesizeinc)
-
-c debug
-      write (6,99) nodenum, iter, sample, num
-      call MPI_BARRIER(MPI_COMM_WORLD, ierr)
-   99 format ( 1x, 'PE = ', i1, ', iter = ',i1,
-     +             ', sample = ', i3, ', num = ', i5 )
-
-c Find initial elapsed time in seconds
-
-      if(nodenum.eq.0) then
-c Send message from node 0 to 1 and receive message from 1
-        idest = 1
-        t1 = MPI_Wtime()
-        do 20 i = 1,msgspersample
-           call MPI_SEND(buffer, num, MPI_DOUBLE_PRECISION, 
-     +              idest, 0, MPI_COMM_WORLD, ierr1)
-           call MPI_RECV(buffer, num, MPI_DOUBLE_PRECISION, 
-     +              MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     +              stat, ierr2)
-   20   continue
-        t2 = MPI_Wtime()
-      else
-c Send message from node 1 to 0 and receive message from 0
-        idest = 0
-        t1 = MPI_Wtime()
-        do 21 i = 1,msgspersample
-           call MPI_RECV(buffer, num, MPI_DOUBLE_PRECISION, 
-     +              MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
-     +              stat, ierr2)
-           call MPI_SEND(buffer, num, MPI_DOUBLE_PRECISION, 
-     +              idest, 0, MPI_COMM_WORLD, ierr1)
-   21   continue
-        t2 = MPI_Wtime()
-      endif
-
-c independent variable is message length:
-      x(sample) = dfloat(num * sizedouble)
-
-c dependent variable is average one-way transit time:
-      y(sample) = ((t2 - t1) * 0.5) /
-     +            dfloat(msgspersample)
-
-   40 continue
-
-c now do linear least squares fit to data
-c time = a + b*x
-
-      if (nodenum .eq. 0) then
-      sumy = 0.d0
-      sumx = 0.d0
-      sumxy = 0.d0
-      sumxx = 0. d0
-      do 45 i=1,samples
-         sumx = sumx + x(i)
-         sumy = sumy + y(i)
-         sumxy = sumxy + ( x(i) * y(i) )
-         sumxx = sumxx + ( x(i) * x(i) )
-   45 continue
-
-      det = (dfloat(samples) * sumxx) - (sumx * sumx)
-      a = (1.d6 * ((sumxx * sumy) - (sumx * sumxy))) / det
-      b = (1.d6 * ((dfloat(samples) * sumxy) - (sumx * sumy))) / det
-
-      write(6,*)
-      write(6,*) ' iter = ', iter
-      write(6,*)
-      write(6,*) ' least squares fit:  time = a + b * (msg length)'
-      write(6,200) a
-      write(6,300) b
-      bandw = 1./b
-      write(6,400) bandw
-      write(6,*)
-      write(6,*) '    message         observed          fitted'
-      write(6,*) ' length(bytes)     time(usec)       time(usec)'
-      write(6,*)
-      do 50 i=1,samples
-         fit = a + b*x(i) 
-         y(i) = y(i)*1.d6
-         write(6,100) x(i),y(i),fit
-   50 continue
-      endif
-
-   60 continue
-
-c
-c =========================== end loop =========================== 
-c
-
-  100 format(3x,f8.0,5x,f12.2,5x,f12.2)
-  200 format(5x,'a = latency = ',f8.2,' microseconds')
-  300 format(5x,'b = inverse bandwidth = ' , f8.5,' secs/Mbyte')     
-  400 format(5x,'1/b = bandwidth = ',f8.2,' Mbytes/sec')
-
-c
-c =========================== end program =========================== 
-c
-
-      call MPI_FINALIZE(ierr)
-      
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/probe.c b/teshsuite/smpi/mpich-test/pt2pt/probe.c
deleted file mode 100644 (file)
index 6d55b48..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
-   This is a test of probe to receive a message of unknown length
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv ) 
-{
-int data, to, from, tag, maxlen, np, myid, src, dest;
-MPI_Status status;
-
-MPI_Init( &argc, &argv );
-MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-/* dest writes out the received stats; for the output to be
-   consistant (with the final check), it should be procees 0 */
-if (argc > 1 && argv[1] && strcmp( "-alt", argv[1] ) == 0) {
-    dest = np - 1;
-    src  = 0;
-    }
-else {
-    src  = np - 1;
-    dest = 0;
-    }
-
-if (myid == src) {
-    to   = dest;
-    tag  = 2000;
-#ifdef VERBOSE    
-    printf( "About to send\n" );
-#endif
-    MPI_Send( &data, 1, MPI_INT, to, tag, MPI_COMM_WORLD );
-    }
-else {
-    tag    = 2000;
-    from   = MPI_ANY_SOURCE;
-    MPI_Probe( from, tag, MPI_COMM_WORLD, &status );
-    MPI_Get_count( &status, MPI_INT, &maxlen );
-    /* Here I'd normally allocate space; I'll just check that it is ok */
-    if (maxlen > 1)
-       printf( "Error; size = %d\n", maxlen );
-#ifdef VERBOSE
-    printf( "About to receive\n" );
-#endif
-    MPI_Recv( &data, 1, MPI_INT, status.MPI_SOURCE, status.MPI_TAG, 
-             MPI_COMM_WORLD, &status );
-    }
-MPI_Barrier( MPI_COMM_WORLD );
-Test_Waitforall( );
-MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/probe1.c b/teshsuite/smpi/mpich-test/pt2pt/probe1.c
deleted file mode 100644 (file)
index 389283c..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* 
-   This is a test of probe to receive a message of unknown type (used as a
-   server)
- */
-#include <stdio.h>
-#include <string.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv ) 
-{
-int data, to, from, tag, maxlen, np, myid, flag, dest, src;
-MPI_Status status, status1;
-
-MPI_Init( &argc, &argv );
-MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-/* dest writes out the received stats; for the output to be
-   consistant (with the final check), it should be procees 0 */
-if (argc > 1 && argv[1] && strcmp( "-alt", argv[1] ) == 0) {
-    dest = np - 1;
-    src  = 0;
-    }
-else {
-    src  = np - 1;
-    dest = 0;
-    }
-
-if (myid == src) {
-    to   = dest;
-    tag = 2000;
-#ifdef VERBOSE
-    printf( "About to send\n" );
-#endif
-    MPI_Send( &data, 1, MPI_INT, to, tag, MPI_COMM_WORLD );
-    tag = 2001;
-#ifdef VERBOSE
-    printf( "About to send 'done'\n" );
-#endif
-    MPI_Send( &data, 1, MPI_INT, to, tag, MPI_COMM_WORLD );
-    }
-else {
-    /* Server loop */
-    while (1) {
-       tag    = MPI_ANY_TAG;
-       from   = MPI_ANY_SOURCE;
-       /* Should really use MPI_Probe, but functionally this will work
-          (it is less efficient, however) */
-       do {            
-           MPI_Iprobe( from, tag, MPI_COMM_WORLD, &flag, &status );
-           } while (!flag);
-       if (status.MPI_TAG == 2001) {
-#ifdef VERBOSE
-           printf( "Received terminate message\n" );
-#endif
-           /* Actually need to receive it ... */
-           MPI_Recv( &data, 1, MPI_INT, status.MPI_SOURCE, 
-                     status.MPI_TAG, MPI_COMM_WORLD, &status1 );
-           break;
-           }
-       if (status.MPI_TAG == 2000) {
-           MPI_Get_count( &status, MPI_INT, &maxlen );
-           if (maxlen > 1)
-               printf( "Error; size = %d\n", maxlen );
-#ifdef VERBOSE
-           printf( "About to receive\n" );
-#endif
-           MPI_Recv( &data, 1, MPI_INT, status.MPI_SOURCE, 
-                     status.MPI_TAG, MPI_COMM_WORLD, &status1 );
-           }
-       }
-    }
-MPI_Barrier( MPI_COMM_WORLD );
-Test_Waitforall( );
-MPI_Finalize();
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/relrank.c b/teshsuite/smpi/mpich-test/pt2pt/relrank.c
deleted file mode 100644 (file)
index 6becaf7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-/* 
- * Test that receives are done by relative rank, and that the status value
- * contains the relative rank
- */
-int main( int argc, char **argv )
-{
-    int rank, new_world_rank, size, order, errcnt = 0, i;
-    int tmpint = 0;
-    MPI_Comm new_world;
-    MPI_Status s;
-
-    MPI_Init(&argc,&argv);
-
-    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
-    MPI_Comm_size(MPI_COMM_WORLD,&size);
-
-    order = size - rank - 1;
-    MPI_Comm_split(MPI_COMM_WORLD, 0, order, &new_world);
-       
-    MPI_Comm_rank ( new_world, &new_world_rank );
-
-    /* Make sure that the split worked correctly */
-    if (new_world_rank != order) {
-       errcnt ++;
-       fprintf( stderr, "Comm split did not properly order ranks!\n" );
-    }
-    if (new_world_rank==0) {
-       MPI_Send(&tmpint, 1, MPI_INT, 1, 0, new_world);
-       /* printf("%d(%d): Sent message to: %d\n", new_world_rank, rank, 1); */
-    }
-    else if (new_world_rank == 1) {
-       MPI_Recv(&tmpint, 1, MPI_INT, 0, 0, new_world,&s);
-       if (s.MPI_SOURCE != 0) {
-           errcnt++;
-           fprintf( stderr, 
-                    "Source incorrect in recv status (%d should be %d)\n",
-                    s.MPI_SOURCE, 0 );
-       }
-       /*
-         printf("%d(%d): Recv message from: -> %d(%d) <- these 2 should equal\n", 
-         new_world_rank, rank, 0, s.MPI_SOURCE); 
-         */
-    }
-
-    MPI_Comm_free( &new_world );
-    i = errcnt;
-    MPI_Allreduce( &i, &errcnt, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (errcnt > 0) {
-       printf( "Found %d errors in the run\n", errcnt );
-    }
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/reqcreate.c b/teshsuite/smpi/mpich-test/pt2pt/reqcreate.c
deleted file mode 100644 (file)
index 16646cb..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include <stdlib.h>
-#include "test.h"
-
-/* Test request creation */
-
-int main( int argc, char **argv )
-{
-    int i, n, n_goal = 2048, rc, len, buf[1];
-    MPI_Request *req_array;
-    MPI_Status status;
-    char msg[MPI_MAX_ERROR_STRING];
-
-    MPI_Init( &argc, &argv );
-    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
-
-    n = n_goal;
-
-    req_array = (MPI_Request *)malloc( n * sizeof(MPI_Request) );
-    
-    for (i=0; i<n; i++) {
-       rc = MPI_Irecv( buf, 1, MPI_INT, 0, i, MPI_COMM_WORLD, req_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when creating request number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-    }
-    for (i=0; i<n; i++) {
-       rc = MPI_Cancel( req_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when canceling request number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-       rc = MPI_Request_free( req_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when freeing request number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-    }
-
-    printf( "Completed test of %d request creations (with cancel)\n", n );
-
-    for (i=0; i<n; i++) {
-       rc = MPI_Irecv( buf, 1, MPI_INT, MPI_PROC_NULL, i, MPI_COMM_WORLD, 
-                       req_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when creating request number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-    }
-    for (i=0; i<n; i++) {
-       rc = MPI_Wait( req_array + i, &status );
-       if (rc) {
-           fprintf( stderr, "Error when waiting on request number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-    }
-
-    printf( "Completed test of %d request creations (with wait)\n", n );
-    if (n != n_goal) {
-       printf (
-"This MPI implementation limits the number of request that can be created\n\
-This is allowed by the standard and is not a bug, but is a limit on the\n\
-implementation\n" );
-    }
-    free( req_array );
-    MPI_Finalize( );
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/reqcreate.std b/teshsuite/smpi/mpich-test/pt2pt/reqcreate.std
deleted file mode 100644 (file)
index 08ddff5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-**** Checking the request creation routines ****
-Completed test of 2048 request creations (with cancel)
-Completed test of 2048 request creations (with wait)
-**** Checking the request creation routines ****
diff --git a/teshsuite/smpi/mpich-test/pt2pt/reqfree.c b/teshsuite/smpi/mpich-test/pt2pt/reqfree.c
deleted file mode 100644 (file)
index 0b4eb44..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include "mpi.h"
-
-#define MAX_REQ 10000
-
-#define DEFAULT_REQ 100
-#define DEFAULT_LEN 20000
-#define DEFAULT_LOOP 10
-
-int main( int argc, char **argv )
-{
-    int rank, size, loop, max_loop = DEFAULT_LOOP, max_req = DEFAULT_REQ;
-    int buf_len = DEFAULT_LEN;
-    int i, j, errs = 0, toterrs;
-    MPI_Request r;
-    MPI_Status  status;
-    int *(b[MAX_REQ]);
-    MPI_Datatype dtype;
-    int sendrank = 0, recvrank = 1;
-
-    MPI_Init( &argc, &argv );
-
-    dtype = MPI_INT;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-/* 
-   The following test allows this test to run on small-memory systems
-   that support the sysconf call interface.  This test keeps the test from
-   becoming swap-bound.  For example, on an old Linux system or a
-   Sony Playstation 2 (really!) 
- */
-#if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE)
-    if (rank == sendrank) 
-    { 
-       long n_pages, pagesize;
-       int  msglen_max = max_req * buf_len * sizeof(int);
-       n_pages  = sysconf( _SC_PHYS_PAGES );
-       pagesize = sysconf( _SC_PAGESIZE );
-       /* printf( "Total mem = %ld\n", n_pages * pagesize ); */
-       /* We want to avoid integer overflow in the size calculation.
-          The best way is to avoid computing any products (such
-          as total memory = n_pages * pagesize) and instead
-          compute a msglen_max that fits within 1/4 of the available 
-          pages */
-       if (n_pages > 0 && pagesize > 0) {
-           /* Recompute msglen_max */
-           int msgpages = 4 * ((msglen_max + pagesize - 1)/ pagesize);
-           while (n_pages < msgpages) { 
-               msglen_max /= 2; msgpages /= 2; buf_len /= 2; 
-           }
-       }
-    }
-#else
-    /* printf( "No sysconf\n" ); */
-#endif
-
-    /* Check command line args (allow usage even with one processor */
-    argv++;
-    argc--;
-    while (argc--) {
-       if (strcmp( "-loop" , *argv ) == 0) {
-           argv++; argc--;
-           max_loop = atoi( *argv );
-       }
-       else if (strcmp( "-req", *argv ) == 0) {
-           argv++; argc--;
-           max_req = atoi( *argv );
-       }
-       else if (strcmp( "-len", *argv ) == 0) {
-           argv++; argc--;
-           buf_len = atoi( *argv );
-       }
-       else {
-           fprintf( stderr, 
-                    "Usage: reqfree [ -loop n ] [ -req n ] [ -len n ]\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       argv++;
-    }
-    
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    if (size != 2) {
-       fprintf( stderr, "This program requires two processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* Assume only processor 0 has the command line */
-    MPI_Bcast( &max_loop, 1, MPI_INT, 0, MPI_COMM_WORLD );
-    MPI_Bcast( &max_req, 1, MPI_INT, 0, MPI_COMM_WORLD );
-    MPI_Bcast( &buf_len, 1, MPI_INT, 0, MPI_COMM_WORLD );
-
-    /* Allocate buffers */
-    for (i=0; i<max_req; i++) {
-       b[i] = (int *) malloc(buf_len * sizeof(int) );
-       if (!b[i]) {
-           fprintf( stderr, "Could not allocate %dth block of %d ints\n", 
-                    i, buf_len );
-           MPI_Abort( MPI_COMM_WORLD, 2 );
-       }
-       if (rank != sendrank) break;
-       for (j=0; j<buf_len; j++) {
-           b[i][j] = i * buf_len + j;
-       }
-    }
-
-    /* Loop several times to capture resource leaks */
-    for (loop=0; loop<max_loop; loop++) {
-       if (rank == sendrank) {
-           for (i=0; i<max_req; i++) {
-               MPI_Isend( b[i], buf_len, dtype, recvrank, 0, 
-                          MPI_COMM_WORLD, &r );
-               MPI_Request_free( &r ); 
-           }
-           MPI_Barrier( MPI_COMM_WORLD );
-           MPI_Barrier( MPI_COMM_WORLD );
-       }
-       else {
-           MPI_Barrier( MPI_COMM_WORLD );
-           for (i=0; i<max_req; i++) {
-               MPI_Recv( b[0], buf_len, dtype, sendrank, 0, MPI_COMM_WORLD, 
-                         &status );
-               for (j=0; j<buf_len; j++) {
-                   if (b[0][j] != i * buf_len + j) {
-                       errs++;
-                       fprintf( stdout, 
-                                "at %d in %dth message, got %d expected %d\n",
-                                j, i, b[0][j], i * buf_len + j );
-                       break;
-                   }
-               }
-           }
-           MPI_Barrier( MPI_COMM_WORLD );
-       }
-    }
-
-    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-       if (toterrs == 0) printf( " No Errors\n" );
-       else              printf( "Found %d errors\n", toterrs );
-    }
-
-    MPI_Finalize( );
-    return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/runtests b/teshsuite/smpi/mpich-test/pt2pt/runtests
deleted file mode 100755 (executable)
index 879cfcb..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-#! /bin/sh
-#
-# Run some of the tests.  If any arguments are provided, pass them to the
-# test programs.
-#
-# -mvhome is needed for the ANL SP, and is ignored by others
-args=
-device=
-MPICH_VERSION=
-STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
-MAKE="make --no-print-directory"
-MPIRUNMVBACK=""
-#
-# Load basic procedures
-
-#
-# Set mpirun to the name/path of the mpirun program
-#FindMPIRUN
-#
-# If the programs are not available, run make.
-runtests=1
-makeeach=0
-writesummaryfile=no
-check_at_once=1
-quiet=0
-check_canrun=0
-have_fortran=0
-CheckOutputWhileRunning="yes"
-# Using shifts should  remove args from the list.
-for arg in "$@" ; do
-    case $arg in 
-    -basedir=* )
-       basedir=`echo $arg | sed 's/-basedir=//'`
-       ;; 
-    -srcdir=* )
-       srcdir=`echo $arg | sed 's/-srcdir=//'`
-       ;; 
-       -fort=* )
-       have_fortran=`echo $arg | sed 's/-fort=//'`
-       ;;
-       -checkonly)
-       shift
-       runtests=0
-       ;;
-        -margs=*)
-       shift
-       margs=`echo $arg | sed 's/-margs=//'`
-       args="$args $margs"
-       ;;
-       -summaryfile=*)
-       writesummaryfile=yes
-       summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
-       ;;
-       -echo)
-       shift
-       set -x
-       ;;
-       -check)
-       check_canrun=1
-       ;;
-       -quiet)
-       shift
-       quiet=1
-       ;;
-       -small)
-       shift
-       makeeach=1
-       ;;
-       -atend)
-       shift
-       check_at_once=0
-       ;;
-       -help|-u)
-       shift
-       echo "runtests [-checkonly] [-margs='...'] [-atend] [-check]"
-       echo "run tests in this directory.  If -checkonly set, just run"
-       echo "the differences check (do NO rerun the test programs)."
-       echo "If -margs is used, these options are passed to mpirun."
-       echo "If -small is used, the examples are built, run, and deleted."
-       echo "If -atend is used, the success of the tests is checked only"
-       echo "at the end of the test rather than also after each test."
-       echo "If -check is used, only a single simple test is run; this"
-       echo "is used to check that mpirun can run an MPI program."
-       exit 1
-       ;;
-       *)
-       if test -n "$arg" ; then
-           echo "Passing remaining arguments to programs ($*)"
-           break
-        fi
-       ;;
-    esac
-done
-
-#
-# Load basic procedures
-. ${srcdir}/../runbase
-
-# Do this because we're writing the output while running
-savewritesummaryfile=$writesummaryfile
-writesummaryfile=no
-
-mpirun=" ${basedir}/bin/smpirun --cfg=smpi/running_power:108095000 -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
-
-# If cannot run test, do that and exit
-if [ $check_canrun = 1 ] ; then
-    # Make sure that we don't have an old file lying around
-    rm -f third third.o third.exe
-    MakeExe third
-    rm -f third.out
-    echo '*** Testing Unexpected messages ***' >> third.out
-    $mpirun $args -np 2 ./third </dev/null >> third.out 2>&1
-    echo '*** Testing Unexpected messages ***' >> third.out
-    rm -f third.stdo
-    cat >>third.stdo <<EOF
-*** Testing Unexpected messages ***
- No Errors
-*** Testing Unexpected messages ***
-EOF
-#    if diff -b third.out third.stdo > /dev/null ; then
-       rc=0
-#    else
-#      echo "Failed to run simple program!"
-#      echo "Output from run attempt was"
-#      cat third.out
-#        echo "mpirun program was $mpirun"
-#      echo "mpirun command was "
-#      echo "$mpirun $args -np 2 ./third </dev/null >>third.out 2>&1"
-#      rc=1
-#    fi
-#    CleanExe third
-#    rm -f third.out 
-#    exit $rc
-fi
-
-# If the programs are not available, run make.
-#if [ ! -x sendrecv_mpich -a $makeeach = 0 -a $runtests = 1 ] ; then
-#    $MAKE
-#fi
-
-testfiles=""
-if [ $runtests = 1 ] ; then
-echo '**** Testing MPI Point-to-point routines ****'
-
-RunTest sendrecv_mpich 2 "**** Testing MPI_Send and MPI_Recv ****" "" "sendrecv-0.out sendrecv-1.out"
-
-RunTest sendrecv2 2 "**** Testing MPI_Send and MPI_Recv (2) ****"
-
-
-#Uses MPI_Pack and Unpack
-#RunTest sendrecv3 2 "**** Testing MPI_Send and MPI_Recv (3) ****"
-#Uses MPI_BOTTOM
-#RunTest sendrecv4 2 "**** Testing MPI_Send and MPI_Recv (4) ****"
-
-#not supported
-#RunTest bsendtest 2 "**** Testing MPI_Bsend and MPI_Recv (4) ****" "" "bsendtest-0.out bsendtest-1.out"
-
-RunTest isndrcv 2 "**** Testing MPI_Isend and MPI_Irecv ****" "" "isndrcv-0.out isndrcv-1.out"
-
-#RunTest irsend 2 "**** Testing MPI_Irsend ****"
-
-#RunTest irsendinit 2 "**** Testing MPI_Rsend_init ****"
-
-
-#rsend and ssend to implement, removed for now
-RunTest longmsgs 2 "**** Testing long messages ****"
-
-RunTest testsome 2 "**** Testing MPI_Testsome/Testany/Waitsome ****"
-
-#fails
-#RunTest testall_mpich 2 "**** Testing MPI_Testall ****"
-
-#MPI_Cancel, not yet implemented
-#RunTest cancel 2 "**** Checking MPI_Cancel (Irecv's) ****"
-
-#RunTest cancel2 2 "**** Checking MPI_Cancel (Persistent Recv's) ****"
-
-#RunTest cancel3 2 "**** Checking MPI_Cancel (Persistent Send's) ****"
-
-#RunTest cancelmessages 2 "**** Checking MPI_Cancel (short/eager/rndv) ****"
-
-#RunTest cancelibm 2 "**** Checking MPI_Cancel (successful/nonsuccessful) ****"
-
-# This test exposes a SEGV in the MPICH1 code.  However, this is an
-# uncommon situtation.  Users who need this feature should switch to 
-# MPICH2 (www.mcs.anl.gov/mpi/mpich2)
-#RunTest cancelissend 2 "**** Checking MPI_Cancel and MPI_Issend (short msgs) ****"
-
-RunTest sndrcv 2 "**** Testing MPI_Sendrecv ****"
-
-RunTest sndrcvrep 2 "**** Testing MPI_Sendrecv_replace ****"
-
-RunTest sndrcvrpl2 2 "**** Testing MPI_Sendrecv_replace (long) ****"
-
-#not implemented :TODO, should be simple, add a nbelements parameter to the datatype, compute it at creation time, then multiply status->count by this number
-#RunTest getelm 2 "**** Testing MPI_Get_elements ****"
-
-#uses Pack_size, Buffer_attach, Bsend, Buffer_detach
-#RunTest overtake 2 "**** Verifying that messages are non-overtaking ****" "" "overtake-0.out overtake-1.out"
-
-RunTest ssendtest 2 "**** Verifying ssend ****"
-
-RunTest ssendtest2 2 "**** Verifying ssend (2) ****"
-
-RunTest issendtest 2 "**** Verifying Issend ****" "" "issendtest-1.out"
-
-RunTest issend2 2 "**** Verifying Issend (2) ****"
-
-#uses MPI_Cancel, lets a lot of orphan comms.
-#RunTest reqcreate 1 "**** Checking the request creation routines ****"
-
-
-#free does really free the request, without waiting for completion, leading to bugs.
-#RunTest reqfree 2 "**** Checking request free ****" "-req 2048"
-
-RunTest typebase 1 "**** Checking the type (sizes) routines ****"
-
-RunTest typecreate 1 "**** Checking the type creation routines ****"
-
-RunTest typetest 2 "**** Checking the type routines ****" "" "typetest-0.out typetest-1.out"
-
-#weird error, because comment says smpi returned value is same as expected from mpich .. modified to handle this value as correct
-RunTest typeub 2 "**** Checking the type routines: MPI_UB ****"
-
-RunTest typeub2 1 "**** Checking the type routines: MPI_UB(2) ****"
-
-RunTest typeub3 1 "**** Checking the type routines: MPI_UB(3) ****"
-
-RunTest typelb 1 "**** Checking the type routines: MPI_LB ****"
-
-RunTest structlb 1 "**** Checking Type_struct routines: MPI_LB ****"
-
-#ssend, replaced by send
-RunTest dtypelife 2 "**** Checking the type routines: MPI_Type_free ****"
-
-#TODO: handle alignment for extent values 
-#RunTest dataalign 2 "**** Checking the type alignment ****"
-
-RunTest dtyperecv 2 "**** Checking the type recv ****"
-
-RunTest commit 1 "**** Checking the type routines: MPI_Type_commit ****"
-
-RunTest third 2 "*** Testing Unexpected messages ***"
-
-RunTest fourth 4 "*** Testing Irecv/Isend/Wait ***"
-
-RunTest fifth 4 "*** Testing Irecv/Isend/Waitall ***"
-
-#uses MPI_keyval_create, Attr_put, Attr_get, Attr_delete, Keyval_free
-#RunTest sixth 2 "*** Testing attribute manipulation ***"
-
-RunTest nblock 4 "*** Testing Isend/Irecv (large numbers) ***"
-
-#TODO : unlock probing ...
-#RunTest nbtest 4 "*** Testing Isend/Probe/Recv (large numbers) ***"
-
-RunTest sendmany 8 "*** Testing Send (many procs) ***"
-
-RunTest order 2 "*** Testing Recv ordering ***"
-
-RunTest sendorder 2 "**** Checking Message Ordering ****"
-
-RunTest exittest 3 "**** Checking Exit Processing ****"
-
-#uses MPI_Errors
-#RunTest trunc 2 "*** Testing Message truncation ***"
-
-RunTest truncmult 2 '*** Testing Message trunction in multiple completions ***'
-
-RunTest nullproc 2 "*** Testing handling of MPI_PROC_NULL ***"
-
-RunTest nullproc2 2 "*** Testing handling of MPI_PROC_NULL in blocking Recv ***"
-
-RunTest relrank 2 "*** Testing handling of relative rank ***"
-
-RunTest hvectest 2 "*** Testing Vector type ***"
-
-RunTest hvectest2 2 "*** Testing struct type for vectors (MPI_UB) ***"
-
-RunTest hvec 2 "*** Testing Type_Hvector ***"
-
-RunTest hindexed 1 "*** Testing Type_Hindexed ***"
-
-RunTest probe 2 "*** Testing Probe and Get_count ***"
-
-RunTest probe1 2 "*** Testing Iprobe and Get_count ***"
-
-RunTest self 1 "*** Testing send to self ***"
-#TODO : handle COMM_SELF
-#RunTest selfvsworld 2 "*** Testing COMM_SELF and COMM_WORLD ***"
-
-RunTest testtest1 2 "*** Testing MPI_Test ***"
-
-RunTest persistent 4 "*** Testing MPI_Recv_init ***"
-
-RunTest persist 4 "*** Testing MPI_Startall/Request_free ***"
-#used MPI_Buffers and Bsends
-#RunTest persist2 4 "*** Testing MPI_Startall(Bsend)/Request_free ***"
-
-RunTest waitall 4 "*** Testing MPI_Waitall ***"
-
-RunTest waitall2 2 "*** Testing MPI_Waitall (order) ***"
-
-#RunTest waitall3 4 "*** Testing MPI_Waitall (order-irecv) ***"
-
-#RunTest waitall4 4 "*** Testing MPI_Waitall (order-isend) ***"
-#put a big value for the message size, because it failed as a detached send (isend was used instead of issend)
-RunTest waitany 4 "*** Testing MPI_Waitany ***"
-
-#RunTest pack 2 "*** Testing MPI_Pack ***"
-
-RunTest flood 2 "**** Testing large messages ****"
-
-#very long
-#RunTest flood2 2 "**** Testing large numbers of messages ****"
-#
-# Run Fortran tests ONLY if Fortran available
-if [ $have_fortran -eq "1" ] ; then 
-    echo "FORTRAN TESTS"
-    #
-    #echo "*** secondf ***" >> pt2pt.out
-    #$mpirun $args -np 2 ./secondf "$@" >> pt2pt.out 2>&1
-    #
-    RunTest isendf 2 "*** Testing isend from Fortran ***"
-
-    RunTest sendcplx 2 "*** Testing Fortran send ***"
-    #RunTest allpair 2 "*** Testing pt-2-pt from Fortran ***"
-
-    #RunTest allpair2 2 "*** Testing pt-2-pt from Fortran (many calls) ***"
-    #
-#    OutTime
-#    testfiles="$testfiles structf.out"
-#    rm -f structf.out
-#    MakeExe structf
-#    echo '*** Testing Type_struct from Fortran ***'
-#    echo '*** Testing Type_struct from Fortran ***' >> structf.out
-    # This is tricky.  Because of a bug in IRIX64, we need to direct 
-    # input from /dev/null (so that we can know that we need a new process
-    # group).  This should be ok for everyone, but SunOS 4.1.4 tends to
-    # panic (!!) in this case.  Since both behaviors represent broken
-    # operating systems, we test for ARCH=IRIX64 
-#    if [ "LINUX" = "IRIX64" ] ; then 
-#      $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1 < /dev/null
-#    else
-#      $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1
-#    fi
-#    echo '*** Testing Type_struct from Fortran ***' >> structf.out
-#    CheckOutput structf
-#    CleanExe structf
-    #
-    RunTest send1 2 "*** Testing pt-2-pt from Fortran (2) ***"
-
-    RunTest sendfort 2 "*** Testing Fortran logical datatype ***"
-
-    #
-    testfiles="$testfiles pingpong.out"
-    rm -f pingpong.out
-    #MakeExe pingpong
-
-    echo '*** Testing pt-2-pt from Fortran (3) ***' 
-    $mpirun $args -np 2 ./pingpong_f "$@" >> /dev/null 
-    CheckOutput pingpong
-    #CleanExe pingpong
-    #
-    echo "END OF FORTRAN TESTS"
-fi
-#
-else
-    # Just run checks
-    testfiles=`echo *.out`
-    if test "$testfiles" = "*.out" ; then
-       echo "No output files remain from previous test!"
-       exit 1
-    fi
-fi
-#
-writesummaryfile=$savewritesummaryfile
-echo '*** Checking for differences from expected output ***'
-CheckAllOutput pt2pt.diff
-exit 0
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/secondf.f b/teshsuite/smpi/mpich-test/pt2pt/secondf.f
deleted file mode 100644 (file)
index af3d2ef..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-C
-C    second - test program that sends an array of floats from the first process
-C             of a group to the last, using send and recv
-C
-C
-      program main
-      include 'mpif.h'
-C
-      integer rank, size, to, from, tag, count, i, ierr
-      integer src, dest
-      integer st_source, st_tag, st_count
-C      MPI_Status status
-      integer status(MPI_STATUS_SIZE)
-      double precision data(100)
-
-      call MPI_INIT( ierr )
-C      print *, 'about to call comm rank'
-      call MPI_COMM_RANK( MPI_COMM_WORLD, rank, ierr )
-C      print *, rank, 'about to call comm size'
-      call MPI_COMM_SIZE( MPI_COMM_WORLD, size, ierr )
-      print *, 'Process ', rank, ' of ', size, ' is alive'
-C
-C      src = size - 1
-C      dest = 0
-      dest = size - 1
-      src = 0
-C      
-      if (rank .eq. src) then
-         to     = dest
-         count  = 10
-         tag    = 2001
-         do 10 i=1, 10
-            data(i) = i
- 10      continue
-         call MPI_SEND( data, count, MPI_DOUBLE_PRECISION, to, tag, 
-     &                  MPI_COMM_WORLD, ierr )
-         print *, rank, ' sent'
-         print *, (data(i),i=1,10)
-      elseif (rank .eq. dest) then
-         tag   = MPI_ANY_TAG
-         count = 10            
-         from  = MPI_ANY_SOURCE
-         call MPI_RECV(data, count, MPI_DOUBLE_PRECISION, from, tag, 
-     &                 MPI_COMM_WORLD, status, ierr ) 
-            
-         call MPI_GET_COUNT( status, MPI_DOUBLE_PRECISION, 
-     &                       st_count, ierr )
-         st_source = status(MPI_SOURCE)
-         st_tag    = status(MPI_TAG)
-c         
-         print *, 'Status info: source = ', st_source, 
-     &             ' tag = ', st_tag, ' count = ', st_count
-         print *, rank, ' received', (data(i),i=1,10)
-      endif
-        
-        call MPI_FINALIZE( ierr )
-        print *, 'Process ', rank, ' exiting'
-        end
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/self.c b/teshsuite/smpi/mpich-test/pt2pt/self.c
deleted file mode 100644 (file)
index 1cad66f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- * This needs to test long messages as well as short ones.
- * The most likely failure mode for this program is that it will
- * hang.  Sorry about that....
- *
- */
-int main( int argc, char **argv )
-{
-int           sendbuf[10];
-int           sendcount = 10;
-int           recvbuf[10];
-int           recvcount = 10;
-int           source = 0, recvtag = 2;
-int           dest = 0, sendtag = 2;
-int           i, *longsend, *longrecv;
-
-    int               mpi_errno = MPI_SUCCESS;
-    MPI_Status        status_array[2];
-    MPI_Request       req[2];
-
-    MPI_Init( &argc, &argv );
-    if ((mpi_errno = MPI_Irecv ( recvbuf, recvcount, MPI_INT,
-                           source, recvtag, MPI_COMM_WORLD, &req[1] ))) 
-       return mpi_errno;
-    if ((mpi_errno = MPI_Isend ( sendbuf, sendcount, MPI_INT, dest,   
-                           sendtag, MPI_COMM_WORLD, &req[0] ))) 
-       return mpi_errno;
-
-    fprintf( stdout, "[%d] Starting waitall\n", 0 );
-    mpi_errno = MPI_Waitall ( 2, req, status_array );
-    fprintf( stdout, "[%d] Ending waitall\n", 0 );
-
-    for (i=16; i<257000; i *= 2) {
-       longsend = (int *)malloc( i * sizeof(int) );
-       longrecv = (int *)malloc( i * sizeof(int) );
-       if (!longsend || !longrecv) {
-       }
-       if ((mpi_errno = MPI_Irecv ( longrecv, i, MPI_INT, source, recvtag, 
-                                    MPI_COMM_WORLD, &req[1] ))) 
-           return mpi_errno;
-       if ((mpi_errno = MPI_Isend ( longsend, i, MPI_INT, dest,  sendtag, 
-                                    MPI_COMM_WORLD, &req[0] ))) 
-       return mpi_errno;
-       
-       fprintf( stdout, "[%d] Starting waitall (%d)\n", 0, i );
-       mpi_errno = MPI_Waitall ( 2, req, status_array );
-       fprintf( stdout, "[%d] Ending waitall\n", 0 );
-
-       free( longsend );
-       free( longrecv );
-    }
-
-    MPI_Finalize();
-    return (mpi_errno);
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/self.std b/teshsuite/smpi/mpich-test/pt2pt/self.std
deleted file mode 100644 (file)
index 2abdf2f..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-[0] Starting waitall
-[0] Ending waitall
-[0] Starting waitall (16)
-[0] Ending waitall
-[0] Starting waitall (32)
-[0] Ending waitall
-[0] Starting waitall (64)
-[0] Ending waitall
-[0] Starting waitall (128)
-[0] Ending waitall
-[0] Starting waitall (256)
-[0] Ending waitall
-[0] Starting waitall (512)
-[0] Ending waitall
-[0] Starting waitall (1024)
-[0] Ending waitall
-[0] Starting waitall (2048)
-[0] Ending waitall
-[0] Starting waitall (4096)
-[0] Ending waitall
-[0] Starting waitall (8192)
-[0] Ending waitall
-[0] Starting waitall (16384)
-[0] Ending waitall
-[0] Starting waitall (32768)
-[0] Ending waitall
-[0] Starting waitall (65536)
-[0] Ending waitall
-[0] Starting waitall (131072)
-[0] Ending waitall
diff --git a/teshsuite/smpi/mpich-test/pt2pt/selfvsworld.c b/teshsuite/smpi/mpich-test/pt2pt/selfvsworld.c
deleted file mode 100644 (file)
index 621b99d..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -----------------------------------------------------------------------
- * Code:   mismatch.c
- * Lab:    Parallel Processing Performance Tools
- * Usage:  mismatch
- *         Run on two nodes
- *         You will need to stop the deadlocked program with <ctrl>\
- * Author: Roslyn Leibensperger  Last revised: 3/19/97 RYL
- *
- * Modified by Bill Gropp (ANL) to use Iprobe to detect the message and 
- * always produce output (no need to abort a deadlocked program).  
- * Unfortunately(?), the version of POE that had this bug is no longer
- * available, so we can't test whether using Iprobe would show the same
- * problem.
- * ------------------------------------------------------------------------ */
-#include <stdio.h>
-#include "mpi.h"
-#define MSGLEN 100            /* length of message in elements */
-#define TAG_A 100
-#define TAG_B 200
-
-int main( int argc, char *argv[] ) 
-{
-  float message1 [MSGLEN],    /* message buffers                      */
-        message2 [MSGLEN],
-        message3 [MSGLEN];
-  int rank,                   /* rank of task in communicator         */
-      dest=0, source=0,       /* rank in communicator of destination  */
-                              /* and source tasks                     */
-      send_tag=0, recv_tag=0, /* message tags                         */
-      flag, size, i;
-  int errs = 0, toterrs;
-  MPI_Status status;          /* status of communication              */
-  MPI_Status statuses[2];
-  MPI_Request requests[2];
-
-  MPI_Init( &argc, &argv );
-  MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-  MPI_Comm_size( MPI_COMM_WORLD, &size );
-  if (size != 2) {
-      printf( "Must run with exactly 2 processes\n" );
-      MPI_Abort( MPI_COMM_WORLD, 1 );
-  }
-  /* printf ( " Task %d initialized\n", rank ); */
-
-  /* initialize message buffers */
-  for ( i=0; i<MSGLEN; i++ )  
-    {
-      message1[i] = 100;
-      message2[i] = -100;
-    }
-
-  /* ---------------------------------------------------------------
-   * each task sets its message tags for the send and receive, plus
-   * the destination for the send, and the source for the receive 
-   * --------------------------------------------------------------- */
-  if ( rank == 0 )  
-    {
-      dest = 1;
-      source = 1;
-      send_tag = TAG_B;
-      recv_tag = TAG_A;
-  }
-  else if ( rank == 1)  
-    {
-      dest = 0;
-      source = 0;
-      send_tag = TAG_B;
-      recv_tag = TAG_A;
-    }
-
-  /* ---------------------------------------------------------------
-   * send and receive messages 
-   * --------------------------------------------------------------- */
-  /*  printf ( " Task %d has sent the message\n", rank ); */
-  MPI_Isend ( message1, MSGLEN, MPI_FLOAT, dest, send_tag, MPI_COMM_WORLD, &requests[0] );
-  MPI_Irecv ( message2, MSGLEN, MPI_FLOAT, source, recv_tag, MPI_COMM_WORLD, &requests[1] );
-
-  /* See if we can receive the message on COMM_SELF...
-   * This should *never* be possible, but if TV is to be believed may happen
-   * with POE 2.4
-   */
-  MPI_Iprobe( MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_SELF, &flag, &status );
-  if (flag) {
-      errs++;
-      printf ( " Task %d has received the message on COMM_SELF !\n", rank );
-  }
-
-  MPI_Recv( message3, MSGLEN, MPI_FLOAT, source, send_tag, MPI_COMM_WORLD, 
-           &status );
-  MPI_Send( message3, MSGLEN, MPI_FLOAT, dest, recv_tag, MPI_COMM_WORLD );
-  MPI_Waitall( 2, requests, statuses );
-  MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-  if (rank == 0) {
-      if (toterrs == 0) 
-         printf( "No errors\n" );
-      else
-         printf( "Error in handling MPI_COMM_SELF\n" );
-  }
-
-  MPI_Finalize();
-  return 0;
-}
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/send1.f b/teshsuite/smpi/mpich-test/pt2pt/send1.f
deleted file mode 100644 (file)
index 141f2d2..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-C
-C Test program from Kevin Maguire (K.Maguire@dl.ac.uk); hung earlier
-C T3D verions.  Modified by WDG to be Fortran 77
-C
-      PROGRAM TEST
-      IMPLICIT NONE
-      
-      INCLUDE 'mpif.h'
-      
-      INTEGER STRT,STOP,STEP
-      PARAMETER ( STRT = 1 , STOP = 1000 , STEP = 10 )
-      
-      INTEGER MAX_MESS
-      PARAMETER (MAX_MESS = STOP)
-      
-      INTEGER NUM_LOOPS
-      PARAMETER (NUM_LOOPS = 5)
-
-      LOGICAL VERBOSE
-      PARAMETER (VERBOSE = .FALSE.)
-
-      REAL MESSAGE1(MAX_MESS),MESSAGE2(MAX_MESS)
-
-      INTEGER MES_SIZE,MES_NUM,ID,IERR
-      INTEGER TO1,FROM1,MES_ID1
-      INTEGER TO2,FROM2,MES_ID2
-      INTEGER INODE,ITOTNODE
-      INTEGER STATUS(MPI_STATUS_SIZE)
-      
-      INTEGER TAG_UP_BD
-      
-      CALL MPI_INIT(IERR)
-      CALL MPI_COMM_RANK
-     $     (MPI_COMM_WORLD,INODE,IERR)
-      CALL MPI_COMM_SIZE
-     $     (MPI_COMM_WORLD,ITOTNODE,IERR)
-C      CALL MPI_ATTR_GET
-C     $     (MPI_COMM_WORLD,MPI_TAG_UB,TAG_UP_BD,FLAG,IERR)
-      TAG_UP_BD=1000000
-      
-      CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
-      
-      ID = 0
-
-      DO 10 MES_SIZE=STRT,STOP,STEP
-
-         DO 20 MES_NUM=1,NUM_LOOPS
-
-            MESSAGE1(1) =  1.
-            MESSAGE2(1) =  2.
-
-            MES_ID1 = ID
-            ID = ID + 100
-            IF (ID.GE.TAG_UP_BD) ID = 0
-            FROM1   = 0
-            TO1     = ITOTNODE-1
-            
-            MES_ID2 = ID
-            ID = ID + 100
-            IF (ID.GE.TAG_UP_BD) ID = 0
-            FROM2   = ITOTNODE-1
-            TO2     = 0
-
-            IF (INODE.EQ.0) THEN
-
-               CALL MPI_SEND(
-     $              MESSAGE1,MES_SIZE,MPI_REAL,
-     $              TO1,MES_ID1,MPI_COMM_WORLD,
-     $              IERR)
-
-               CALL MPI_RECV(
-     $              MESSAGE2,MES_SIZE,MPI_REAL,
-     $              FROM2,MES_ID2,MPI_COMM_WORLD,
-     $              STATUS,IERR)
-
-            ENDIF
-
-            IF (INODE.EQ.(ITOTNODE-1)) THEN
-
-               CALL MPI_RECV(
-     $              MESSAGE1,MES_SIZE,MPI_REAL,
-     $              FROM1,MES_ID1,MPI_COMM_WORLD,
-     $              STATUS,IERR)
-               
-               CALL MPI_SEND(
-     $              MESSAGE2,MES_SIZE,MPI_REAL,
-     $              TO2,MES_ID2,MPI_COMM_WORLD,
-     $              IERR)
-
-            ENDIF
-
-            CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
-
-            IF (INODE.EQ.0 .AND. VERBOSE) THEN 
-               WRITE (*,'(5I10)')
-     $              MES_SIZE,MES_NUM,TO1,FROM1,MES_ID1
-               WRITE (*,'(5I10)')
-     $              MES_SIZE,MES_NUM,TO2,FROM2,MES_ID2
-               WRITE (*,'(5I10)')
-            ENDIF
-
- 20      CONTINUE
-
- 10   CONTINUE
-      IF (INODE.EQ.0) THEN 
-C        If we get here at all, we're ok
-         PRINT *, ' No Errors'
-      ENDIF
-      CALL MPI_FINALIZE(IERR)
-
-      END
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendcplx.f b/teshsuite/smpi/mpich-test/pt2pt/sendcplx.f
deleted file mode 100644 (file)
index b316959..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-      PROGRAM MAIN
-      INCLUDE 'mpif.h'
-      
-      INTEGER LDA
-      PARAMETER (LDA=2)
-      INTEGER myid,IERR,NPROCS, stat(MPI_STATUS_SIZE)
-      COMPLEX A(2,2)
-
-      CALL MPI_INIT(IERR)
-      CALL MPI_COMM_RANK(MPI_COMM_WORLD,myid,IERR)
-      CALL MPI_COMM_SIZE(MPI_COMM_WORLD,NPROCS,IERR)
-      
-      J0 = 1
-      J1 = 2
-      
-      IF (myid .EQ. 0) THEN
-         A(1,1) = CMPLX(1,1)
-         A(2,1) = CMPLX(2,1)
-         A(1,2) = CMPLX(1,2)
-         A(2,2) = CMPLX(2,2)
-         CALL MPI_SEND(A(1,1),LDA*(J1-J0+1),MPI_COMPLEX,1,
-     +                 0,MPI_COMM_WORLD,IERR)
-      ELSE      
-         CALL MPI_RECV(A(1,1),LDA*(J1-J0+1),MPI_COMPLEX,
-     +             0,MPI_ANY_TAG,MPI_COMM_WORLD,stat,IERR)
-         PRINT *,'Received A'
-         PRINT *,'A(1,1) = ',A(1,1),' A(1,2) = ',A(1,2)
-         PRINT *,'A(2,1) = ',A(2,1),' A(2,2) = ',A(2,2)
-      ENDIF
-      CALL MPI_FINALIZE(IERR) 
-      END
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendcplx.std b/teshsuite/smpi/mpich-test/pt2pt/sendcplx.std
deleted file mode 100644 (file)
index 3f5bbcc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
- Received A
- A(1,1) =  (1.,1.) A(1,2) =  (1.,2.)
- A(2,1) =  (2.,1.) A(2,2) =  (2.,2.)
\ No newline at end of file
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendfort.f b/teshsuite/smpi/mpich-test/pt2pt/sendfort.f
deleted file mode 100644 (file)
index 4e54486..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-      program main
-C
-C     Test Fortran logical data
-C
-      implicit none
-      include 'mpif.h'
-      integer ierr, n, tag, status(MPI_STATUS_SIZE), size, rank, i
-      integer errs, nrecv
-      logical l(1000)
-C
-      call mpi_init( ierr )
-      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
-      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
-C
-      n = 100
-      do i=1, n
-         l(i) = i .lt. n/2
-      enddo
-      tag = 27
-      if (rank .eq. 1) then
-         call MPI_Send( l, n, MPI_LOGICAL, 0, tag, MPI_COMM_WORLD, ierr
-     $        )
-      else if (rank .eq. 0) then
-         call MPI_Recv( l, n, MPI_LOGICAL, 1, tag, MPI_COMM_WORLD,
-     $        status, ierr )
-C         Check results
-         call MPI_Get_count( status, MPI_LOGICAL, nrecv, ierr )
-         if (nrecv .ne. n) then
-            print *, 'Wrong count for logical data'
-         endif
-         errs = 0
-         do i=1, n
-            if (l(i) .neqv. (i .lt. n/2)) then
-               errs = errs + 1
-               print *, 'Error in logical entry ', i
-            endif
-         enddo
-         if (errs .gt. 0) then
-            print *, ' Found ', errs, ' errors'
-         else
-            print *, ' No Errors'
-         endif
-      endif
-C
-      call mpi_finalize( ierr )
-C
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendmany.c b/teshsuite/smpi/mpich-test/pt2pt/sendmany.c
deleted file mode 100644 (file)
index 7d6c6a8..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-#include <assert.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-#define MAXPES 16
-#define MYBUFSIZE 8*1024
-static int buffer[MAXPES][MYBUFSIZE];
-
-#define NUM_RUNS 10
-
-
-int main ( int argc, char *argv[] )
-{
-  int i;
-  int count, size;
-  int self, npes;
-  double secs;
-  MPI_Request request[MAXPES];
-  MPI_Status status;
-
-
-  MPI_Init (&argc, &argv);
-  MPI_Comm_rank (MPI_COMM_WORLD, &self);
-  MPI_Comm_size (MPI_COMM_WORLD, &npes);
-
-  assert (npes <= MAXPES);
-
-  for (size = 1; size  <= MYBUFSIZE ; size += size)
-    {
-
-      secs = -MPI_Wtime ();
-      for (count = 0; count < NUM_RUNS; count++)
-       {
-         MPI_Barrier (MPI_COMM_WORLD);
-
-         for (i = 0; i < npes; i++)
-           {
-             if (i == self)
-               continue;
-             MPI_Irecv (buffer[i], size, MPI_INT, i,
-                        MPI_ANY_TAG, MPI_COMM_WORLD, &request[i]);
-           }
-
-         for (i = 0; i < npes; i++)
-           {
-             if (i == self)
-               continue;
-             MPI_Send (buffer[self], size, MPI_INT, i, 0, MPI_COMM_WORLD);
-           }
-
-         for (i = 0; i < npes; i++)
-           {
-             if (i == self)
-               continue;
-             MPI_Wait (&request[i], &status);
-           }
-
-       }
-      MPI_Barrier (MPI_COMM_WORLD);
-      secs += MPI_Wtime ();
-
-      if (self == 0)
-       {
-         secs = secs / (double) NUM_RUNS;
-         printf ( "length = %d ints\n", size );
-         fflush(stdout);
-/*
-         printf ("%f\n",
-                 (double) (size * sizeof (int) * (npes - 1)) /
-                   (secs * 1024.0 * 1024.0));
- */
-       }
-    }
-  MPI_Finalize();
-  return (0);
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendmany.std b/teshsuite/smpi/mpich-test/pt2pt/sendmany.std
deleted file mode 100644 (file)
index 87eabe0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-You requested to use 8 processes, but there is only 5 processes in your hostfile...
-length = 1 ints
-length = 2 ints
-length = 4 ints
-length = 8 ints
-length = 16 ints
-length = 32 ints
-length = 64 ints
-length = 128 ints
-length = 256 ints
-length = 512 ints
-length = 1024 ints
-length = 2048 ints
-length = 4096 ints
-length = 8192 ints
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendorder.c b/teshsuite/smpi/mpich-test/pt2pt/sendorder.c
deleted file mode 100644 (file)
index e6e3f08..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/* 
-   Test ordering of messages that differ only in data
-
-   sendorder [ -n number-of-sends ] [ -m length-of-long-sends ]
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "mpi.h"
-
-/* Prototypes */
-void delay( int );
-void CheckStatus( MPI_Status *, int, int, int, int * );
-
-/* 
-   This is a delay to make sure that several messages are in the queue when 
-   the MPI_Recv is called
-
-   10ms delay for now.
-*/
-void delay( int ms )
-{
-  double  deltat = ms * 0.001;
-  MPI_Wtime();
-  //while (MPI_Wtime() - t < deltat) ;
-  sleep(deltat);
-}
-
-void CheckStatus( MPI_Status *status, int tag, int src, int cnt, int *err )
-{
-  int n;
-  
-  if (status->MPI_TAG != tag && status->MPI_SOURCE != src) { 
-    if (*err < 10) {
-      fprintf( stdout, 
-       "Error in message status! tag = %d and source = %d\n", status->MPI_TAG, 
-                  status->MPI_SOURCE );
-       }
-    (void)*err++;
-  }
-  MPI_Get_count( status, MPI_INT, &n );
-  if (n != cnt) {
-    if (*err < 10) {
-      fprintf( stdout, 
-       "Error in message status!  length is %d and should be %d\n", n, cnt );
-    }
-    (void)*err++;
-  }
-}
-
-int main( int argc, char *argv[] )
-{
-  int i, n, m, val, *buf;
-  MPI_Status status;
-  int src, dest, tag, err = 0, toterr;
-  int rank, size;
-  MPI_Comm comm;
-
-  MPI_Init( &argc, &argv );
-
-  n    = 1000;    /* Number of tests */
-  comm = MPI_COMM_WORLD;
-  tag  = 3;
-  m    = 1000;    /* Size in ints of longer buffer */
-
-  /* Check for options
-   */
-  argc--; argv++;
-  while (argc > 0) {
-    if (argv[0] && strcmp( argv[0], "-n" ) == 0) {
-      argc++;
-      n = atoi( argv[0] );
-    }
-    else if (argv[0] && strcmp( argv[0], "-m" ) == 0) {
-      argc++;
-      m = atoi( argv[0] );
-    }
-    argc--; argv++;
-  }
-  /* Ensure that everyone has the values */
-  MPI_Bcast( &n, 1, MPI_INT, 0, MPI_COMM_WORLD );
-  MPI_Bcast( &m, 1, MPI_INT, 0, MPI_COMM_WORLD );
-
-  MPI_Comm_rank( comm, &rank );
-  MPI_Comm_size( comm, &size );
-  if (size < 2) {
-    fprintf( stderr, "This program requires at least 2 processes\n" );
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-  }
-  src  = 0;
-  dest = size - 1;
-
-  /* Single Int */
-  MPI_Barrier( comm );
-  if (rank == src) {
-    for (i=0; i<n; i++) {
-      MPI_Send( &i, 1, MPI_INT, dest, tag, comm );
-    }
-  }
-  else if (rank == dest) {
-    for (i=0; i<n; i++) {
-      delay( 10 );
-      MPI_Recv( &val, 1, MPI_INT, src, tag, comm, &status );
-      /* The messages are sent in order that matches the value of i; 
-        if they are not received in order, this will show up in the
-        value here */
-      if (val != i) { 
-       if (err < 10) {
-         fprintf( stdout, 
-   "Error in message order (single int): message %d received when %d expected\n", val, i );
-       }
-       err++;
-      }
-      CheckStatus( &status, tag, src, 1, &err );
-    }
-  }
-
-  /* Alternating message sizes */
-  buf = (int *)malloc( m * sizeof(int) );
-  if (!buf) {
-    fprintf( stdout, "Could not allocate %d ints\n", m );
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-  }
-  for (i=0; i<m; i++) buf[i] = - i;
-
-  MPI_Barrier( comm );
-  if (rank == src) {
-    for (i=0; i<n; i++) {
-      buf[0] = i;
-      MPI_Send( &i, 1, MPI_INT, dest, tag, comm );
-      MPI_Send( buf, m, MPI_INT, dest, tag, comm );
-    }
-  }
-  else if (rank == dest) {
-    for (i=0; i<n; i++) {
-      delay( 10 );
-      MPI_Recv( &val, 1, MPI_INT, src, tag, comm, &status );
-      if (val != i) { 
-       if (err < 10) {
-         fprintf( stdout, 
-   "Error in message order: message %d received when %d expected\n", val, i );
-       }
-       err++;
-      }
-      CheckStatus( &status, tag, src, 1, &err );
-
-      MPI_Recv( buf, m, MPI_INT, src, tag, comm, &status );
-      if (buf[0] != i) { 
-       if (err < 10) {
-         fprintf( stdout, 
-   "Error in message order: message buf[] %d received when %d expected\n", 
-                  buf[0], i );
-       }
-       err++;
-      }
-      CheckStatus( &status, tag, src, m, &err );
-    }
-  }
-  
-  /* Finally error reporting: make sure that rank 0 reports the message */
-  MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-  if (rank == 0) {
-    if (toterr) printf( "Found %d errors\n", toterr );
-    else        printf( " No Errors\n" );
-  }
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  MPI_Finalize();
-  return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendrecv.c b/teshsuite/smpi/mpich-test/pt2pt/sendrecv.c
deleted file mode 100644 (file)
index 833880f..0000000
+++ /dev/null
@@ -1,635 +0,0 @@
-/* 
- * Program to test all of the features of MPI_Send and MPI_Recv
- *
- * *** What is tested? ***
- * 1. Sending and receiving all basic types and many sizes - check
- * 2. Tag selectivity - check
- * 3. Error return codes for
- *    a. Invalid Communicator
- *    b. Invalid destination or source
- *    c. Count out of range
- *    d. Invalid type
- *
- * Define VERBOSE to get noisier output
- */
-
-#include "test.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "mpi.h"
-
-#ifdef HAVE_MPICHCONF_H
-#include "mpichconf.h"
-#endif
-
-static int src = 1;
-static int dest = 0;
-
-static int do_test1 = 1;
-static int do_test2 = 1;
-static int do_test3 = 1;
-
-static int verbose = 0;
-
-#define MAX_TYPES 13
-static int ntypes = 0;
-static int nolongdouble = 0;
-static MPI_Datatype BasicTypes[MAX_TYPES];
-
-static int maxbufferlen = 10000;
-static char *(BasicNames[MAX_TYPES]);
-
-/* In order to quiet noisy C compilers, we provide ANSI-style prototypes
-   where possible */
-
-void AllocateBuffers ( void **, MPI_Datatype *, int, int );
-void FreeBuffers ( void **, int );
-void FillBuffers ( void **, MPI_Datatype *, int, int );
-int CheckBuffer ( void *, MPI_Datatype, int );
-void SetupBasicTypes (void);
-void SenderTest1 (void);
-void ReceiverTest1 (void);
-void SenderTest2 (void);
-void ReceiverTest2 (void);
-void SenderTest3 (void);
-void ReceiverTest3 (void);
-
-void 
-AllocateBuffers(bufferspace, buffertypes, num_types, bufferlen)
-     void **bufferspace;
-     MPI_Datatype *buffertypes;
-     int num_types;
-     int bufferlen;
-{
-  int i;
-  for (i = 0; i < ntypes; i++) {
-    if (buffertypes[i] == MPI_CHAR)
-           bufferspace[i] = malloc(bufferlen * sizeof(char));
-    else if (buffertypes[i] == MPI_SHORT)
-           bufferspace[i] = malloc(bufferlen * sizeof(short));
-    else if (buffertypes[i] == MPI_INT)
-           bufferspace[i] = malloc(bufferlen * sizeof(int));
-    else if (buffertypes[i] == MPI_LONG)
-           bufferspace[i] = malloc(bufferlen * sizeof(long));
-    else if (buffertypes[i] == MPI_UNSIGNED_CHAR)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned char));
-    else if (buffertypes[i] == MPI_UNSIGNED_SHORT)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned short));
-    else if (buffertypes[i] == MPI_UNSIGNED)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned int));
-    else if (buffertypes[i] == MPI_UNSIGNED_LONG)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned long));
-    else if (buffertypes[i] == MPI_FLOAT)
-           bufferspace[i] = malloc(bufferlen * sizeof(float));
-    else if (buffertypes[i] == MPI_DOUBLE)
-           bufferspace[i] = malloc(bufferlen * sizeof(double));
-#if defined(HAVE_LONG_DOUBLE) && !defined(HAS_XDR) 
-    else if (buffertypes[i] == MPI_LONG_DOUBLE) {
-           int dlen;
-           MPI_Type_size( MPI_LONG_DOUBLE, &dlen );
-           bufferspace[i] = malloc(bufferlen * dlen);
-    }
-#endif
-#if defined(HAVE_LONG_LONG_INT) && !defined(HAS_XDR)
-    else if (buffertypes[i] == MPI_LONG_LONG_INT) 
-           bufferspace[i] = malloc(bufferlen * sizeof(long long) );
-#endif
-    else if (buffertypes[i] == MPI_BYTE)
-           bufferspace[i] = malloc(bufferlen * sizeof(unsigned char));
-  }
-}
-
-void FreeBuffers(void **buffers, int nbuffers)
-{
-  int i;
-  for (i = 0; i < nbuffers; i++)
-    free(buffers[i]);
-}
-
-void FillBuffers(bufferspace, buffertypes, num_types, bufferlen)
-     void **bufferspace; 
-     MPI_Datatype *buffertypes;
-     int num_types;
-     int bufferlen;
-{
-  int i, j;
-  for (i = 0; i < ntypes; i++) {
-    for (j = 0; j < bufferlen; j++) {
-           if (buffertypes[i] == MPI_CHAR)
-        ((char *)bufferspace[i])[j] = (char)(j & 0x7f);
-           else if (buffertypes[i] == MPI_SHORT)
-        ((short *)bufferspace[i])[j] = (short)j;
-           else if (buffertypes[i] == MPI_INT)
-        ((int *)bufferspace[i])[j] = (int)j;
-           else if (buffertypes[i] == MPI_LONG)
-        ((long *)bufferspace[i])[j] = (long)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_CHAR)
-        ((unsigned char *)bufferspace[i])[j] = (unsigned char)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_SHORT)
-        ((unsigned short *)bufferspace[i])[j] = (unsigned short)j;
-           else if (buffertypes[i] == MPI_UNSIGNED)
-        ((unsigned int *)bufferspace[i])[j] = (unsigned int)j;
-           else if (buffertypes[i] == MPI_UNSIGNED_LONG)
-        ((unsigned long *)bufferspace[i])[j] = (unsigned long)j;
-           else if (buffertypes[i] == MPI_FLOAT)
-        ((float *)bufferspace[i])[j] = (float)j;
-           else if (buffertypes[i] == MPI_DOUBLE)
-        ((double *)bufferspace[i])[j] = (double)j;
-#if defined(HAVE_LONG_DOUBLE) && !defined(HAS_XDR) 
-           else if (buffertypes[i] == MPI_LONG_DOUBLE)
-        ((long double *)bufferspace[i])[j] = (long double)j;
-#endif
-#if defined(HAVE_LONG_LONG_INT) && !defined(HAS_XDR) 
-           else if (buffertypes[i] == MPI_LONG_LONG_INT)
-        ((long long *)bufferspace[i])[j] = (long long)j;
-#endif
-           else if (buffertypes[i] == MPI_BYTE)
-        ((unsigned char *)bufferspace[i])[j] = (unsigned char)j;
-    }
-  }
-}
-
-int
-CheckBuffer(bufferspace, buffertype, bufferlen)
-     void *bufferspace; 
-     MPI_Datatype buffertype; 
-     int bufferlen;
-{
-  int j;
-  char valerr[256];
-  valerr[0] = 0;
-  for (j = 0; j < bufferlen; j++) {
-    if (buffertype == MPI_CHAR) {
-           if (((char *)bufferspace)[j] != (char)(j & 0x7f)) {
-        sprintf( valerr, "%x != %x", 
-                 ((char *)bufferspace)[j], (char)(j&0x7f) );
-        break;
-      }
-    } else if (buffertype == MPI_SHORT) {
-           if (((short *)bufferspace)[j] != (short)j) {
-        sprintf( valerr, "%d != %d", 
-                 ((short *)bufferspace)[j], (short)j );
-        break;
-      }
-    } else if (buffertype == MPI_INT) {
-           if (((int *)bufferspace)[j] != (int)j) {
-        sprintf( valerr, "%d != %d", 
-                 ((int *)bufferspace)[j], (int)j );
-        break;
-      }
-    } else if (buffertype == MPI_LONG) {
-           if (((long *)bufferspace)[j] != (long)j) {
-        break;
-      }
-    } else if (buffertype == MPI_UNSIGNED_CHAR) {
-           if (((unsigned char *)bufferspace)[j] != (unsigned char)j) {
-        break;
-      }
-    } else if (buffertype == MPI_UNSIGNED_SHORT) {
-           if (((unsigned short *)bufferspace)[j] != (unsigned short)j) {
-        break;
-      }
-    } else if (buffertype == MPI_UNSIGNED) {
-           if (((unsigned int *)bufferspace)[j] != (unsigned int)j) {
-        break;
-      }
-    } else if (buffertype == MPI_UNSIGNED_LONG) {
-           if (((unsigned long *)bufferspace)[j] != (unsigned long)j) {
-        break;
-      }
-    } else if (buffertype == MPI_FLOAT) {
-           if (((float *)bufferspace)[j] != (float)j) {
-        break;
-      }
-    } else if (buffertype == MPI_DOUBLE) {
-           if (((double *)bufferspace)[j] != (double)j) {
-        break;
-      }
-#if defined(HAVE_LONG_DOUBLE) && !defined(HAS_XDR) 
-    } else if (buffertype == MPI_LONG_DOUBLE) {
-           if (((long double *)bufferspace)[j] != (long double)j) {
-        break;
-      }
-#endif
-#if defined(HAVE_LONG_LONG_INT) && !defined(HAS_XDR) 
-    } else if (buffertype == MPI_LONG_LONG_INT) {
-           if (((long long *)bufferspace)[j] != (long long)j) {
-        break;
-      }
-#endif
-    } else if (buffertype == MPI_BYTE) {
-           if (((unsigned char *)bufferspace)[j] != (unsigned char)j) {
-        break;
-      }
-    }
-  }
-  /* Return +1 so an error in the first location is > 0 */
-  if (j < bufferlen) {
-    if (valerr[0]) fprintf( stderr, "Different value[%d] = %s\n", 
-                            j, valerr );
-    else
-           fprintf( stderr, "Different value[%d]\n", j );
-    return j+1;
-       }
-  return 0;
-}
-
-void 
-SetupBasicTypes()
-{
-  BasicTypes[0] = MPI_CHAR;        BasicNames[0] = (char*)"MPI_CHAR" ;
-  BasicTypes[1] = MPI_SHORT;       BasicNames[1] = (char*)"MPI_SHORT";
-  BasicTypes[2] = MPI_INT;         BasicNames[2] = (char*)"MPI_INT"  ;
-  BasicTypes[3] = MPI_LONG;        BasicNames[3] = (char*)"MPI_LONG" ;
-  BasicTypes[4] = MPI_UNSIGNED_CHAR; BasicNames[4] = (char*)"MPI_UNSIGNED_CHAR";
-  BasicTypes[5] = MPI_UNSIGNED_SHORT; BasicNames[5] = (char*)"MPI_UNSIGNED_SHORT";
-  BasicTypes[6] = MPI_UNSIGNED;    BasicNames[6] = (char*)"MPI_UNSIGNED";
-  BasicTypes[7] = MPI_UNSIGNED_LONG; BasicNames[7] = (char*)"MPI_UNSIGNED_LONG";
-  BasicTypes[8] = MPI_FLOAT;       BasicNames[8] = (char*)"MPI_FLOAT";
-  BasicTypes[9] = MPI_DOUBLE;      BasicNames[9] = (char*)"MPI_DOUBLE";
-  BasicTypes[10] = MPI_BYTE;       BasicNames[10] = (char*)"MPI_BYTE";
-  /* By making the BYTE type LAST, we make it easier to handle heterogeneous
-     systems that may not support all of the types */
-  ntypes = 11;
-#if defined (HAVE_LONG_DOUBLE) && !defined(HAS_XDR) 
-  /* This test allows us to use MPI_LONG_DOUBLE, but rely on size > 0 
-     for "actually implemented" */
-  if (!nolongdouble) { 
-    int l;
-    MPI_Type_size( MPI_LONG_DOUBLE, &l );
-    if (l > 0) {
-           BasicTypes[ntypes] = MPI_LONG_DOUBLE; 
-           BasicNames[ntypes] = (char*)"MPI_LONG_DOUBLE";
-           ntypes++;
-    }
-  }
-#endif
-#if defined(HAVE_LONG_LONG_INT) && !defined(HAS_XDR)
-  BasicTypes[ntypes] = MPI_LONG_LONG_INT;
-  BasicNames[ntypes] = (char*)"MPI_LONG_LONG_INT";
-  ntypes++;
-#endif
-}
-
-void 
-SenderTest1()
-{
-  void *bufferspace[MAX_TYPES];
-  int i, j;
-
-  AllocateBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-  FillBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-  for (i = 0; i < ntypes; i++) {
-    MPI_Send( (void *)0, 0, BasicTypes[i], dest, 2000, MPI_COMM_WORLD );
-    for (j = 0; j < maxbufferlen; j += 500)
-           MPI_Send(bufferspace[i], j, BasicTypes[i], dest, 
-               2000, MPI_COMM_WORLD);
-  }
-  FreeBuffers(bufferspace, ntypes);
-}
-
-void
-ReceiverTest1()
-{
-  void *bufferspace[MAX_TYPES];
-  int i, j;
-  char message[81];
-  MPI_Status Stat;
-  int dummy, passed;
-
-  AllocateBuffers(bufferspace, BasicTypes, ntypes, maxbufferlen);
-  for (i = 0; i < ntypes; i++) {
-    passed = 1;
-    MPI_Recv( (void *)0, 0, BasicTypes[i], src, 
-              2000, MPI_COMM_WORLD, &Stat);
-    if (Stat.MPI_SOURCE != src) {
-           fprintf(stderr, "*** Incorrect Source returned. ***\n");
-           Test_Failed(message);
-           passed = 0;
-    } else if (Stat.MPI_TAG != 2000) { 
-           fprintf(stderr, "*** Incorrect Tag returned. ***\n");           
-           Test_Failed(message);
-           passed = 0;
-    } else if (MPI_Get_count(&Stat, BasicTypes[i], &dummy) ||
-               dummy != 0) {
-           fprintf(stderr, 
-              "*** Incorrect Count returned, Count = %d. ***\n", 
-              dummy);
-           Test_Failed(message);
-           passed = 0;
-    }
-    /* Try different sized messages */
-    for (j = 0; j < maxbufferlen; j += 500) {
-           MPI_Recv(bufferspace[i], j, BasicTypes[i], src, 
-               2000, MPI_COMM_WORLD, &Stat);
-           sprintf(message, "Send-Receive Test, Type %d, Count %d",
-              i, j);
-           if (Stat.MPI_SOURCE != src) {
-        fprintf(stderr, "*** Incorrect Source returned. ***\n");
-        Test_Failed(message);
-        passed = 0;
-           } else if (Stat.MPI_TAG != 2000) {  
-        fprintf(stderr, "*** Incorrect Tag returned. ***\n");      
-        Test_Failed(message);
-        passed = 0;
-           } else if (MPI_Get_count(&Stat, BasicTypes[i], &dummy) ||
-                 dummy != j) {
-        fprintf(stderr, 
-                "*** Incorrect Count returned, Count = %d (should be %d). ***\n", 
-                dummy, j);
-        Test_Failed(message);
-        passed = 0;
-           } else if(CheckBuffer(bufferspace[i], BasicTypes[i], j)) {
-        fprintf(stderr, 
-                "*** Incorrect Message received (type = %d (%s), count = %d). ***\n",
-                i, BasicNames[i], j );
-        Test_Failed(message);
-        passed = 0;
-           } 
-#ifdef VERBOSE         
-           else {
-        fprintf(stderr, 
-                "Message of count %d, type %d received correctly.\n", 
-                j, i );
-           }
-#endif
-    }
-    sprintf(message, "Send-Receive Test, Type %d (%s)",
-            i, BasicNames[i] );
-    if (passed) 
-           Test_Passed(message);
-    else 
-           Test_Failed(message);
-  }
-  FreeBuffers(bufferspace, ntypes);
-}
-
-#define MAX_ORDER_TAG 2010
-/* Test Tag Selectivity.
-   Note that we must use non-blocking sends here, since otherwise we could 
-   deadlock waiting to receive/send the first message
-*/
-void 
-SenderTest2()
-{
-  int *buffer;
-  int i;
-  MPI_Request r[10];
-  MPI_Status  s[10];
-
-  buffer = (int *)malloc(maxbufferlen * sizeof(int));
-  for (i = 0; i < maxbufferlen; i++)
-    buffer[i] = i;
-    
-  for (i = 2001; i <= MAX_ORDER_TAG; i++)
-    MPI_Isend(buffer, maxbufferlen, MPI_INT, dest,
-              i, MPI_COMM_WORLD, &r[i-2001] );
-    
-  MPI_Waitall( MAX_ORDER_TAG-2001+1, r, s );
-  free(buffer);
-    
-  return;
-}
-
-void
-ReceiverTest2()
-{
-  int *buffer;
-  int i, j;
-  char message[81];
-  MPI_Status Stat;
-  int dummy, passed;
-  int errloc;
-
-  buffer = (int *)calloc(maxbufferlen,sizeof(int));
-  passed = 1;
-
-  for (i = MAX_ORDER_TAG; i >= 2001; i--) {
-    MPI_Recv(buffer, maxbufferlen, MPI_INT, src, 
-             i, MPI_COMM_WORLD, &Stat);
-    sprintf(message, "Tag Selectivity Test, Tag %d",
-            i);
-    if (Stat.MPI_SOURCE != src) {
-           fprintf(stderr, "*** Incorrect Source returned. ***\n");
-           Test_Failed(message);
-    } else if (Stat.MPI_TAG != i) {    
-           fprintf(stderr, "*** Incorrect Tag returned. ***\n");           
-           Test_Failed(message);
-    } else if (MPI_Get_count(&Stat, MPI_INT, &dummy) ||
-               dummy != maxbufferlen) {
-           fprintf(stderr, 
-              "*** Incorrect Count returned, Count = %d. ***\n", 
-              dummy);
-           Test_Failed(message);
-    } else if((errloc = 
-               CheckBuffer((void*)buffer, MPI_INT, maxbufferlen))) {
-           fprintf(stderr, 
-              "*** Incorrect Message received at %d (tag=%d). ***\n",
-              errloc-1, i);
-           Test_Failed(message);
-           passed = 0;
-    }
-    /* Clear out the buffer */
-    for (j = 0; j < maxbufferlen; j++)
-           buffer[j] = -1;
-  }
-  strncpy(message, "Tag Selectivity Test", 81);
-  if (passed)
-    Test_Passed(message);
-  else
-    Test_Failed(message);
-  free(buffer);
-  return;
-}
-
-void
-SenderTest3()
-{
-  int ibuf[10];
-
-  /* A receive test might not fail until it is triggered... */
-  MPI_Send( ibuf, 10, MPI_INT, dest, 15, MPI_COMM_WORLD);
-
-  return;
-}
-
-void
-ReceiverTest3( void )
-{
-  int buffer[20];
-  MPI_Datatype bogus_type = MPI_DATATYPE_NULL;
-  MPI_Status status;
-  int myrank;
-  int small_tag;
-  /*
-    if (verbose) 
-    MPI_Errhandler_set(MPI_COMM_WORLD, TEST_ERRORS_WARN);
-    else 
-    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN );
-  */
-  MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-
-  if (myrank == 0 && verbose) {
-    fprintf( stderr, 
-             "There should be eight error messages about invalid communicator\n\
-count argument, datatype argument, tag, rank, buffer send and buffer recv\n" );
-       }
-  if (MPI_Send(buffer, 20, MPI_INT, dest,
-               1, MPI_COMM_NULL) == MPI_SUCCESS){
-    Test_Failed("NULL Communicator Test");
-  }
-  else
-    Test_Passed("NULL Communicator Test");
-
-  if (MPI_Send(buffer, -1, MPI_INT, dest,
-               1, MPI_COMM_WORLD) == MPI_SUCCESS){
-    Test_Failed("Invalid Count Test");
-  }
-  else
-    Test_Passed("Invalid Count Test");
-
-  if (MPI_Send(buffer, 20, bogus_type, dest,
-               1, MPI_COMM_WORLD) == MPI_SUCCESS){
-    Test_Failed("Invalid Type Test");
-  }
-  else
-    Test_Passed("Invalid Type Test");
-
-  small_tag = -1;
-  if (small_tag == MPI_ANY_TAG) small_tag = -2;
-  if (MPI_Send(buffer, 20, MPI_INT, dest, 
-               small_tag, MPI_COMM_WORLD) == MPI_SUCCESS) {
-    Test_Failed("Invalid Tag Test");
-  }
-  else
-    Test_Passed("Invalid Tag Test");
-
-  /* Form a tag that is too large */
-  /*MPI_Attr_get( MPI_COMM_WORLD, MPI_TAG_UB, (void **)&tag_ubp, &flag );
-    if (!flag) Test_Failed("Could not get tag ub!" );
-    large_tag = *tag_ubp + 1;
-    if (large_tag > *tag_ubp) {
-    if (MPI_Send(buffer, 20, MPI_INT, dest, 
-    large_tag, MPI_COMM_WORLD) == MPI_SUCCESS) {
-    Test_Failed("Invalid Tag Test");
-    }
-    else
-    Test_Passed("Invalid Tag Test");
-    }
-  */
-  if (MPI_Send(buffer, 20, MPI_INT, 300,
-               1, MPI_COMM_WORLD) == MPI_SUCCESS) {
-    Test_Failed("Invalid Destination Test");
-  }
-  else
-    Test_Passed("Invalid Destination Test");
-
-  if (MPI_Send((void *)0, 10, MPI_INT, dest,
-               1, MPI_COMM_WORLD) == MPI_SUCCESS){
-    Test_Failed("Invalid Buffer Test (send)");
-  }
-  else
-    Test_Passed("Invalid Buffer Test (send)");
-
-  /* A receive test might not fail until it is triggered... */
-  if (MPI_Recv((void *)0, 10, MPI_INT, src,
-               15, MPI_COMM_WORLD, &status) == MPI_SUCCESS){
-    Test_Failed("Invalid Buffer Test (recv)");
-  }
-  else
-    Test_Passed("Invalid Buffer Test (recv)");
-
-  /* Just to keep things happy, see if there is a message to receive */
-  { //int flag, 
-    int ibuf[10];
-
-    //MPI_Iprobe( src, 15, MPI_COMM_WORLD, &flag, &status );
-    //if (flag) 
-    MPI_Recv( ibuf, 10, MPI_INT, src, 15, MPI_COMM_WORLD, &status );
-  }
-  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
-  return;
-}
-
-/* Allow -nolongdouble to suppress long double testing */
-int main( int argc, char **argv )
-{
-  int myrank, mysize;
-  int rc, itemp, i;
-
-  MPI_Init(&argc, &argv);
-  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
-  MPI_Comm_size(MPI_COMM_WORLD, &mysize);
-  Test_Init("sendrecv", myrank);
-  SetupBasicTypes();
-
-  if (mysize != 2) {
-    fprintf(stderr, 
-            "*** This test program requires exactly 2 processes.\n");
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-  }
-
-  /* Get the min of the basic types */
-  itemp = ntypes;
-  MPI_Allreduce( &itemp, &ntypes, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD );
-
-  /* dest writes out the received stats; for the output to be
-     consistant (with the final check), it should be procees 0 */
-  for (i=1; i<argc; i++) {
-    if (argv[i] && strcmp( "-alt", argv[i] ) == 0) {
-           dest = 1;
-           src  = 0;
-    } 
-    else if (argv[i] && strcmp( "-nolongdouble", argv[i] ) == 0) {
-           nolongdouble = 1;
-    }
-    else if (argv[i] && strcmp( "-test1", argv[i] ) == 0) {
-           do_test2 = do_test3 = 0;
-    }
-    else if (argv[i] && strcmp( "-test2", argv[i] ) == 0) {
-           do_test1 = do_test3 = 0;
-    }
-    else if (argv[i] && strcmp( "-test3", argv[i] ) == 0) {
-           do_test2 = do_test1 = 0;
-    }
-    else {
-           printf( "Unrecognized argument %s\n", argv[i] );
-    }
-  }
-
-  /* Turn stdout's buffering to line buffered so it mixes right with
-     stderr in output files. (hopefully) */
-  setvbuf(stdout, NULL, _IOLBF, 0);
-  setvbuf(stderr, NULL, _IOLBF, 0);
-
-  if (myrank == src) {
-    if (do_test1)
-           SenderTest1();
-    if (do_test2)
-           SenderTest2();
-    if (do_test3)
-           SenderTest3(); 
-  } else if (myrank == dest) {
-    if (do_test1)
-           ReceiverTest1();
-    if (do_test2)
-           ReceiverTest2();
-    if (do_test3) 
-           ReceiverTest3();
-  } else {
-    fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-  }
-  if (myrank == dest) {
-    rc = Summarize_Test_Results();
-  }
-  else {
-    rc = 0;
-  }
-  Test_Finalize();
-  Test_Waitforall( );
-  MPI_Finalize();
-  return rc;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendrecv2.c b/teshsuite/smpi/mpich-test/pt2pt/sendrecv2.c
deleted file mode 100644 (file)
index afd29cb..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "dtypes.h"
-#include "gcomm.h"
-#include "test.h"
-
-int verbose = 0;
-/*
-   This program is from mpich/tsuite/pt2pt and should be changed there only.
-   It needs gcomm and dtype from mpich/tsuite, and can be run with 
-   any number of processes > 1.
- */
-int main( int argc, char **argv)
-{
-    MPI_Datatype *types;
-    void         **inbufs, **outbufs;
-    char         **names;
-    int          *counts, *bytesize, ntype;
-    MPI_Comm     comms[20];
-    int          ncomm = 20, rank, np, partner, tag, count;
-    int          i, j, k, err, toterr, world_rank, errloc;
-    MPI_Status   status;
-    char         *obuf;
-
-    MPI_Init( &argc, &argv );
-    
-    /* 
-     * Check for -basiconly to select only the simple datatypes
-     */
-    for (i=1; i<argc; i++) {
-       if (!argv[i]) break;
-       if (strcmp( argv[i], "-basiconly" ) == 0) {
-           BasicDatatypesOnly();
-       }
-       else if (strcmp( argv[i], "-verbose" ) == 0) {
-           verbose = 1;
-       }
-    }
-    
-    AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                    &names, &ntype );
-    GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-    
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-    MakeComms( comms, 20, &ncomm, 0 );
-    
- /* Test over a wide range of datatypes and communicators */
-    err = 0;
-    for (i=0; i<ncomm; i++) {
-       if (comms[i] == MPI_COMM_NULL) continue;
-       MPI_Comm_rank( comms[i], &rank );
-       MPI_Comm_size( comms[i], &np );
-       if (np < 2) continue;
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing communicator number %d\n", i );
-       
-       tag = i;
-       for (j=0; j<ntype; j++) {
-           if (world_rank == 0 && verbose) 
-               fprintf( stdout, "Testing type %s\n", names[j] );
-           if (rank == 0) {
-               partner = np - 1;
-#if 0
-               MPIR_PrintDatatypePack( stdout, counts[j], types[j], 0, 0 );
-#endif
-               MPI_Send( inbufs[j], counts[j], types[j], partner, tag, comms[i] );
-            }
-           else if (rank == np-1) {
-               partner = 0;
-               obuf = outbufs[j];
-               for (k=0; k<bytesize[j]; k++) 
-                   obuf[k] = 0;
-               MPI_Recv( outbufs[j], counts[j], types[j], partner, tag, 
-                         comms[i], &status );
-               /* Test correct */
-               MPI_Get_count( &status, types[j], &count );
-               if (count != counts[j]) {
-                   fprintf( stderr, 
-                    "Error in counts (got %d expected %d) with type %s\n",
-                        count, counts[j], names[j] );
-                   err++;
-                }
-               if (status.MPI_SOURCE != partner) {
-                   fprintf( stderr, 
-                       "Error in source (got %d expected %d) with type %s\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                   err++;
-                }
-               if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-                   char *p1, *p2;
-                   fprintf( stderr, 
-                   "Error in data with type %s (type %d on %d) at byte %d\n", 
-                            names[j], j, world_rank, errloc - 1 );
-                   p1 = (char *)inbufs[j];
-                   p2 = (char *)outbufs[j];
-                   fprintf( stderr, 
-                       "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                   err++;
-#if 0
-                   MPIR_PrintDatatypeUnpack( stderr, counts[j], types[j], 
-                                             0, 0 );
-#endif
-                }
-            }
-       }
-    }
-    if (err > 0) {
-       fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterr == 0) {
-           printf( " No Errors\n" );
-       }
-       else {
-           printf (" Found %d errors\n", toterr );
-       }
-    }
-    FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-    FreeComms( comms, ncomm );
-    MPI_Finalize();
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendrecv3.c b/teshsuite/smpi/mpich-test/pt2pt/sendrecv3.c
deleted file mode 100644 (file)
index 9664a63..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#include "mpi.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/*
-   This program is from mpich/tsuite/pt2pt and should be changed there only.
-   It needs gcomm and dtype from mpich/tsuite, and can be run with 
-   any number of processes > 1.
-
-   This version uses Pack to send a message and Unpack OR the datatype 
-   to receive it.
- */
-int main( int argc, char **argv )
-{
-MPI_Datatype *types;
-void         **inbufs, **outbufs;
-char         **names;
-char         *packbuf, *unpackbuf;
-int          packsize, unpacksize, position;
-int          *counts, *bytesize, ntype;
-MPI_Comm     comms[20];
-int          ncomm = 20, rank, np, partner, tag, count;
-int          i, j, k, err, toterr, world_rank;
-int          errloc;
-MPI_Status   status;
-char         *obuf;
-
-MPI_Init( &argc, &argv );
-
-AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                &names, &ntype );
-GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-err = 0;
-for (i=0; i<ncomm; i++) {
-    MPI_Comm_rank( comms[i], &rank );
-    MPI_Comm_size( comms[i], &np );
-    if (np < 2) continue;
-    if (world_rank == 0 && verbose) {
-       fprintf( stdout, "Testing with communicator with %d members\n", np );
-       }
-    tag = i;
-    for (j=0; j<ntype; j++) {
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing type %s\n", names[j] );
-        if (rank == 0) {
-           partner = np - 1;
-           MPI_Pack_size( counts[j], types[j], comms[i], &packsize );
-           packbuf = (char *)malloc( packsize );
-           if (!packbuf) 
-               MPI_Abort( MPI_COMM_WORLD, 1 );
-           position = 0;
-           MPI_Pack( inbufs[j], counts[j], types[j], packbuf, packsize, 
-                     &position, comms[i] );
-           /* Send twice */
-            MPI_Send( packbuf, position, MPI_PACKED, partner, tag, comms[i] );
-            MPI_Send( packbuf, position, MPI_PACKED, partner, tag, comms[i] );
-           free( packbuf );
-            }
-        else if (rank == np-1) {
-           partner = 0;
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           /* Receive directly */
-            MPI_Recv( outbufs[j], counts[j], types[j], partner, tag, comms[i],
-                      &status );
-            /* Test correct */
-            MPI_Get_count( &status, types[j], &count );
-            if (count != counts[j]) {
-               fprintf( stderr, 
-                       "Error in counts (got %d expected %d) with type %s\n",
-                        count, counts[j], names[j] );
-                err++;
-                }
-            if (status.MPI_SOURCE != partner) {
-               fprintf( stderr, 
-                       "Error in source (got %d expected %d) with type %s\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                err++;
-                }
-            if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-               fprintf( stderr, 
-                    "Error in data at byte %d with type %s (type %d on %d)\n", 
-                        errloc - 1, names[j], j, world_rank );
-                err++;
-                }
-           /* Receive packed, then unpack */
-           MPI_Pack_size( counts[j], types[j], comms[i], &unpacksize ); 
-           unpackbuf = (char *)malloc( unpacksize );
-           if (!unpackbuf) 
-               MPI_Abort( MPI_COMM_WORLD, 1 );
-            MPI_Recv( unpackbuf, unpacksize, MPI_PACKED, partner, tag, 
-                     comms[i], &status );
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           position = 0;
-            MPI_Get_count( &status, MPI_PACKED, &unpacksize );
-           MPI_Unpack( unpackbuf, unpacksize, &position, 
-                       outbufs[j], counts[j], types[j], comms[i] );
-           free( unpackbuf );
-            /* Test correct */
-#ifdef FOO
-           /* Length is tricky; a correct code will have signaled an error 
-              in MPI_Unpack */
-           count = position;
-            if (count != counts[j]) {
-               fprintf( stderr, 
-               "Error in counts (got %d expected %d) with type %s (Unpack)\n",
-                        count, counts[j], names[j] );
-                err++;
-                }
-#endif
-            if (status.MPI_SOURCE != partner) {
-               fprintf( stderr, 
-               "Error in source (got %d expected %d) with type %s (Unpack)\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                err++;
-                }
-            if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-               fprintf( stderr, 
-            "Error in data at byte %d with type %s (type %d on %d, Unpack)\n", 
-                       errloc - 1, names[j], j, world_rank );
-                err++;
-                }
-            }
-       }
-    }
-if (err > 0) {
-    fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-FreeComms( comms, ncomm );
-MPI_Barrier( MPI_COMM_WORLD );
-MPI_Finalize();
-return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sendrecv4.c b/teshsuite/smpi/mpich-test/pt2pt/sendrecv4.c
deleted file mode 100644 (file)
index a4e5a05..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/*
-   This program is from mpich/tsuite/pt2pt and should be changed there only.
-   It needs gcomm and dtype from mpich/tsuite, and can be run with 
-   any number of processes > 1.
-
-   This version sends and receives EVERYTHING from MPI_BOTTOM, by putting
-   the data into a structure.
-
-   This code isn't quite correct, since the MPI_Type_struct that is 
-   created for the type may not have the correct extent.  
-   One possible change is to make the struct type include the count, and
-   send/receive one instance of the data item.  
-
-   The GenerateData call should return extents; when the extent of the 
-   created structure doesn't match, we can at least issue an error message.
- */
-int main( int argc, char **argv )
-{
-MPI_Datatype *types;
-void         **inbufs, **outbufs;
-char         **names;
-int          *counts, *bytesize, ntype;
-MPI_Comm     comms[20];
-int          ncomm = 20, rank, np, partner, tag, count;
-int          i, j, k, err, toterr, world_rank, errloc;
-MPI_Status   status;
-char         *obuf;
-MPI_Datatype offsettype;
-int          blen;
-MPI_Aint     displ, extent, natural_extent;
-
-MPI_Init( &argc, &argv );
-
-AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                &names, &ntype );
-GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-err = 0;
-for (i=0; i<ncomm; i++) {
-    MPI_Comm_rank( comms[i], &rank );
-    MPI_Comm_size( comms[i], &np );
-    if (np < 2) continue;
-    tag = i;
-    for (j=0; j<ntype; j++) {
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing type %s\n", names[j] );
-        if (rank == 0) {
-           MPI_Address( inbufs[j], &displ );
-           blen = 1;
-           MPI_Type_struct( 1, &blen, &displ, types + j, &offsettype );
-           MPI_Type_commit( &offsettype );
-           /* Warning: if the type has an explicit MPI_UB, then using a
-              simple shift of the offset won't work.  For now, we skip
-              types whose extents are negative; the correct solution is
-              to add, where required, an explicit MPI_UB */
-           MPI_Type_extent( offsettype, &extent );
-           if (extent < 0) {
-               if (world_rank == 0) 
-                   fprintf( stdout, 
-                       "... skipping (appears to have explicit MPI_UB\n" );
-               MPI_Type_free( &offsettype );
-               continue;
-               }
-           MPI_Type_extent( types[j], &natural_extent );
-           if (natural_extent != extent) {
-               MPI_Type_free( &offsettype );
-               continue;
-           }
-           partner = np - 1;
-#if 0
-               MPIR_PrintDatatypePack( stdout, counts[j], offsettype, 
-                                         0, 0 );
-#endif
-            MPI_Send( MPI_BOTTOM, counts[j], offsettype, partner, tag, 
-                     comms[i] );
-           MPI_Type_free( &offsettype );
-            }
-        else if (rank == np-1) {
-           partner = 0;
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           MPI_Address( outbufs[j], &displ );
-           blen = 1;
-           MPI_Type_struct( 1, &blen, &displ, types + j, &offsettype );
-           MPI_Type_commit( &offsettype );
-           /* Warning: if the type has an explicit MPI_UB, then using a
-              simple shift of the offset won't work.  For now, we skip
-              types whose extents are negative; the correct solution is
-              to add, where required, an explicit MPI_UB */
-           MPI_Type_extent( offsettype, &extent );
-           if (extent < 0) {
-               MPI_Type_free( &offsettype );
-               continue;
-               }
-           MPI_Type_extent( types[j], &natural_extent );
-           if (natural_extent != extent) {
-               MPI_Type_free( &offsettype );
-               continue;
-           }
-            MPI_Recv( MPI_BOTTOM, counts[j], offsettype, 
-                    partner, tag, comms[i], &status );
-            /* Test correct */
-            MPI_Get_count( &status, types[j], &count );
-            if (count != counts[j]) {
-               fprintf( stderr, 
-                       "Error in counts (got %d expected %d) with type %s\n",
-                        count, counts[j], names[j] );
-                err++;
-                }
-            if (status.MPI_SOURCE != partner) {
-               fprintf( stderr, 
-                       "Error in source (got %d expected %d) with type %s\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                err++;
-                }
-            if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-               fprintf( stderr, 
-                  "Error in data with type %s (type %d on %d) at byte %d\n", 
-                        names[j], j, world_rank, errloc - 1 );
-               if (err < 10) {
-                   /* Give details on only the first 10 errors */
-                   unsigned char *in_p = (unsigned char *)inbufs[j],
-                       *out_p = (unsigned char *)outbufs[j];
-                   int jj;
-                   jj = errloc - 1;
-                   jj &= 0xfffffffc; /* lop off a few bits */ 
-                   in_p += jj;
-                   out_p += jj;
-                   fprintf( stderr, "%02x%02x%02x%02x should be %02x%02x%02x%02x\n",
-                            out_p[0], out_p[1], out_p[2], out_p[3],
-                            in_p[0], in_p[1], in_p[2], in_p[3] );
-               }
-                err++;
-#if 0
-               MPIR_PrintDatatypeUnpack( stdout, counts[j], offsettype, 
-                                         0, 0 );
-#endif
-                }
-           MPI_Type_free( &offsettype );
-            }
-       }
-    }
-if (err > 0) {
-    fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-
-FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-FreeComms( comms, ncomm );
-MPI_Finalize();
-return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sixth.c b/teshsuite/smpi/mpich-test/pt2pt/sixth.c
deleted file mode 100644 (file)
index 5f56e6e..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#else
-extern char *malloc();
-#endif
-#include "test.h"
-
-typedef struct _table {
-  int references;
-  int length;
-  int *value;
-} Table;
-
-/* Prototypes for picky compilers */
-int copy_table ( MPI_Comm, int, void *, void *, void *, int * );
-void create_table ( int, int *, Table ** );
-int delete_table ( MPI_Comm, int, void *, void * );
-
-/* These are incorrect...*/
-int copy_table ( MPI_Comm oldcomm, int keyval, void *extra_state, 
-                void *attr_in, void *attr_out, int *flag)
-{
-  Table *table = (Table *)attr_in;;
-
-  table->references++;
-  (*(void **)attr_out) = attr_in;
-  (*flag) = 1;
-  (*(int *)extra_state)++;
-  return (MPI_SUCCESS);
-}
-
-void create_table ( int num, int *values, Table **table_out )
-{
-  int i;
-  (*table_out) = (Table *)malloc(sizeof(Table));
-  (*table_out)->references = 1;
-  (*table_out)->length = num;
-  (*table_out)->value = (int *)malloc(sizeof(int)*num);
-  for (i=0;i<num;i++) 
-    (*table_out)->value[i] = values[i];
-}
-
-int delete_table ( MPI_Comm comm, int keyval, 
-                  void *attr_val, void *extra_state)
-{
-  Table *table = (Table *)attr_val;
-
-  if ( table->references == 1 )
-       free(table);
-  else
-       table->references--;
-  (*(int *)extra_state)--;
-  return MPI_SUCCESS;
-}
-
-int main ( int argc, char **argv )
-{
-  int rank, size;
-  Table *table;
-  MPI_Comm new_comm;
-  int table_key;
-  int values[3]; 
-  int table_copies = 1;
-  int found;
-  int errors = 0;
-
-  MPI_Init ( &argc, &argv );
-  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
-  MPI_Comm_size ( MPI_COMM_WORLD, &size );
-
-  values[0] = 1; values[1] = 2; values[2] = 3;
-  create_table(3,values,&table);
-  
-  MPI_Keyval_create ( copy_table, delete_table, &table_key, 
-                     (void *)&table_copies );
-  MPI_Attr_put ( MPI_COMM_WORLD, table_key, (void *)table );
-  MPI_Comm_dup ( MPI_COMM_WORLD, &new_comm );
-  MPI_Attr_get ( new_comm, table_key, (void **)&table, &found );
-
-  if (!found) {
-      printf( "did not find attribute on new comm\n" );
-      errors++;
-  }
-
-  if ((table_copies != 2) && (table->references != 2)) {
-      printf( "table_copies != 2 (=%d) and table->references != 2 (=%d)\n",
-             table_copies, table->references );
-      errors++;
-  }
-
-  MPI_Comm_free ( &new_comm );
-
-  if ((table_copies != 1) && (table->references != 1)) {
-      printf( "table_copies != 1 (=%d) and table->references != 1 (=%d)\n",
-             table_copies, table->references );
-      errors++;
-  }
-
-  MPI_Attr_delete ( MPI_COMM_WORLD, table_key );
-
-  if ( table_copies != 0 ) {
-      printf( "table_copies != 0 (=%d)\n", table_copies );
-      errors++;
-  }
-  if (errors)
-    printf("[%d] OOPS.  %d errors!\n",rank,errors);
-
-  MPI_Keyval_free ( &table_key );
-  Test_Waitforall( );
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sndrcv.c b/teshsuite/smpi/mpich-test/pt2pt/sndrcv.c
deleted file mode 100644 (file)
index 10b418a..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/*
-   This program is from mpich/tsuite/pt2pt and should be changed there only.
-   It needs gcomm and dtype from mpich/tsuite, and can be run with 
-   any number of processes > 1.
-
-   This version uses sendrecv and sendrecv_replace (but only in the
-   head-to-head mode).
- */
-int main( int argc, char **argv )
-{
-MPI_Datatype *types;
-void         **inbufs, **outbufs;
-char         **names;
-int          *counts, *bytesize, ntype;
-MPI_Comm     comms[20];
-int          ncomm = 20, rank, np, partner=0, tag, count;
-int          i, j, k, err, toterr, world_rank, errloc;
-MPI_Status   status;
-char         *obuf, *ibuf;
-
-MPI_Init( &argc, &argv );
-
-AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                &names, &ntype );
-GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-err = 0;
-for (i=0; i<ncomm; i++) {
-    MPI_Comm_rank( comms[i], &rank );
-    MPI_Comm_size( comms[i], &np );
-    if (np < 2) continue;
-    tag = i;
-    if (rank == 0) 
-       partner = np - 1;
-    if (rank == np - 1)
-       partner = 0;
-    for (j=0; j<ntype; j++) {
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing type %s\n", names[j] );
-        if (rank == 0 || rank == np - 1) {
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           MPI_Sendrecv( inbufs[j], counts[j], types[j], partner, tag, 
-                         outbufs[j], counts[j], types[j], partner, tag, 
-                         comms[i], &status );
-            /* Test correct */
-            MPI_Get_count( &status, types[j], &count );
-            if (count != counts[j]) {
-               fprintf( stderr, 
-                       "Error in counts (got %d expected %d) with type %s\n",
-                        count, counts[j], names[j] );
-                err++;
-                }
-            if (status.MPI_SOURCE != partner) {
-               fprintf( stderr, 
-                       "Error in source (got %d expected %d) with type %s\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                err++;
-                }
-            if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-               char *p1, *p2;
-               fprintf( stderr, 
-                  "Error in data with type %s (type %d on %d) at byte %d\n", 
-                        names[j], j, world_rank, errloc - 1 );
-               p1 = (char *)inbufs[j];
-               p2 = (char *)outbufs[j];
-               fprintf( stderr, 
-                       "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                err++;
-                }
-           /* Now do sendrecv_replace */
-           obuf = outbufs[j];
-           ibuf = inbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = ibuf[k];
-           /* This would be a better test if the data was different... */
-           MPI_Sendrecv_replace( obuf, counts[j], types[j], partner, tag, 
-                                 partner, tag, comms[i], &status );
-            /* Test correct */
-            MPI_Get_count( &status, types[j], &count );
-            if (count != counts[j]) {
-               fprintf( stderr, 
-                       "Sendrecv_replace Error in counts (got %d expected %d) with type %s\n",
-                        count, counts[j], names[j] );
-                err++;
-                }
-            if (status.MPI_SOURCE != partner) {
-               fprintf( stderr, 
-                       "Sendrecv_replace Error in source (got %d expected %d) with type %s\n",
-                        status.MPI_SOURCE, partner, names[j] );
-                err++;
-                }
-            if ((errloc = CheckData( inbufs[j], outbufs[j], bytesize[j] ))) {
-               char *p1, *p2;
-               fprintf( stderr, 
-                  "Sendrecv_replace Error in data with type %s (type %d on %d) at byte %d\n", 
-                        names[j], j, world_rank, errloc - 1 );
-               p1 = (char *)inbufs[j];
-               p2 = (char *)outbufs[j];
-               fprintf( stderr, 
-                       "Got %x expected %x\n", p1[errloc-1], p2[errloc-1] );
-                err++;
-                }
-            }
-       }
-    }
-if (err > 0) {
-    fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-FreeComms( comms, ncomm );
-MPI_Finalize();
-return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.c b/teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.c
deleted file mode 100644 (file)
index b4955aa..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int main( int argc, char **argv )
-{
-    MPI_Status   status;
-    int          count, dest, source, sendtag, recvtag, len, rc;
-    int          rank, size, errcnt = 0;
-    MPI_Comm     comm;
-    int          *buf;
-    MPI_Datatype dtype;
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_dup( MPI_COMM_WORLD, &comm );
-    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    /* Check recoverable errors */
-    if (rank == 0) {
-       rc = MPI_Sendrecv_replace( (char *)0, 1, MPI_INT, 0, 0,
-                                  0, 0, comm, &status );
-       if (!rc) {
-           errcnt++;
-           fprintf( stderr, "Failed to detect null buffer\n" );
-       }
-       buf = 0; /* Give buf a value before use */
-       rc = MPI_Sendrecv_replace( buf, 1, MPI_DATATYPE_NULL, 0,
-                                  0, 0, 0, comm, &status );
-       if (!rc) {
-           errcnt++;
-           fprintf( stderr, "Failed to detect null datatype\n" );
-       }
-       /* Could be others */
-    }
-
-    /* Check non-contiguous datatypes */
-    MPI_Type_vector( 1, 1, 10, MPI_INT, &dtype );
-    MPI_Type_commit( &dtype );
-
-    buf    = (int *)malloc( 10 * 10 * sizeof(int) );
-    dest   = (rank + 1) % size;
-    source = (rank + size - 1) % size;
-
-    count   = 0;
-    sendtag = 1;
-    recvtag = 1;
-    rc = MPI_Sendrecv_replace( buf, count, dtype, dest,
-                              sendtag, source, recvtag, MPI_COMM_WORLD, &status );
-    if (rc) {
-       errcnt++;
-       fprintf( stderr, "Failed with non-contiguous datatype (error = %d)\n", rc);
-    } else {
-       MPI_Get_count( &status, dtype, &len );
-       if (len != 0) {
-           errcnt ++;
-           fprintf( stderr, "Computed %d for count, should be %d\n", len, 0 );
-       }
-    }
-    
-    MPI_Type_free( &dtype );
-    MPI_Comm_free( &comm );
-    if (rank == 0) {
-       printf( "Completed test of MPI_Sendrecv_replace\n" );
-    }
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.std b/teshsuite/smpi/mpich-test/pt2pt/sndrcvrep.std
deleted file mode 100644 (file)
index b001334..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Completed test of MPI_Sendrecv_replace
diff --git a/teshsuite/smpi/mpich-test/pt2pt/sndrcvrpl2.c b/teshsuite/smpi/mpich-test/pt2pt/sndrcvrpl2.c
deleted file mode 100644 (file)
index fdb5c81..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/* 
- * Based on a program from James Clippinger (james@cs.dartmouth.edu), 
- * http://www.cs.dartmouth.edu/~james/.
- *
- */
-#include "test.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include "mpi.h"
-
-int main( int argc, char **argv )
-{
-    MPI_Status status;
-    int count, rank, size,  dest, source, i, err = 0, toterr;
-    long *buf;
-
-    /* Initialize MPI and get my rank and total number of
-       processors */
-    
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    /* Send-receive-replace the buffer */
-    count  = 1 << 14;
-    buf    = (long *)malloc( count * sizeof(long) );
-    for (i=0; i<count; i++)
-       buf[i] = rank + size*i;
-    dest   = (rank + 1) % size;
-    source = (rank + size - 1) % size;
-
-/*
-    fprintf(stderr, "Proc %d: About to SRR, dest proc %d, source proc 
-%d\n",
-           rank, dest, source);
- */
-    MPI_Sendrecv_replace( buf, count, MPI_LONG, dest, 
-                          1, source, 1, MPI_COMM_WORLD, &status );
-
-    for (i=0; i<count; i++) {
-       if (buf[i] != source + size*i) {
-           if (err++ > 10) break;
-           printf( "Received %ld in buf[%d]; expected %d\n",
-                   buf[i], i, source + size*i );
-       }
-    }
-/*
-    fprintf(stderr, "Done with SRR on proc %d\n", rank);
- */
-
-    /* Finalize everything */
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0) {
-       if (toterr == 0) 
-           printf( " No Errors\n" );
-       else
-           printf( "Test failed with %d errors!\n", toterr );
-    }
-    free( buf );
-    
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/ssendtest.c b/teshsuite/smpi/mpich-test/pt2pt/ssendtest.c
deleted file mode 100644 (file)
index b85a036..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Program to test that the "synchronous send" semantics
- * of point to point communications in MPI is (probably) satisfied. 
- * Two messages are send in one order; the destination uses MPI_Iprobe
- * to look for the SECOND message before doing a receive on the first.
- * To give a finite-termination, a fixed amount of time is used for
- * the Iprobe test.
- *
- * This program has been patterned off of "overtake.c"
- *
- *                             William Gropp
- *                             gropp@mcs.anl.gov
- */
-
-#include <stdio.h>
-#include "test.h"
-#include "mpi.h"
-
-#define SIZE 10000
-/* Amount of time in seconds to wait for the receipt of the second Ssend
-   message */
-#define MAX_TIME 10
-static int src  = 0;
-static int dest = 1;
-
-/* Prototypes for picky compilers */
-void Generate_Data ( int *, int );
-
-void Generate_Data( int *buffer, int buff_size)
-{
-    int i;
-
-    for (i = 0; i < buff_size; i++)
-       buffer[i] = i+1;
-}
-
-int main( int argc, char **argv)
-{
-    int rank; /* My Rank (0 or 1) */
-    int act_size = 0;
-    int flag, np, rval, i;
-    int buffer[SIZE];
-    double t0;
-    char *Current_Test = NULL;
-    MPI_Status status, status1, status2;
-    int count1, count2;
-    int sizes[4];
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-    if (np != 2) {
-        fprintf(stderr, "*** This program uses exactly 2 processes! ***\n");
-        MPI_Abort( MPI_COMM_WORLD, 1 );
-        }
-
-    sizes[0] = 0;
-    sizes[1] = 1;
-    sizes[2] = 1000;
-    sizes[3] = SIZE;
-/*    for (i = 0; i < 4; i++ ) { */
-    for (i = 1; i < 2; i++ ) {
-       act_size = sizes[i];
-        if (rank == src) { 
-            Generate_Data(buffer, SIZE);
-            MPI_Recv( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, &status );
-            MPI_Send( buffer, 0, MPI_INT, dest, 0, MPI_COMM_WORLD );
-            MPI_Ssend( buffer, act_size, MPI_INT, dest, 1, MPI_COMM_WORLD );
-            MPI_Ssend( buffer, act_size, MPI_INT, dest, 2, MPI_COMM_WORLD );
-            
-        } else if (rank == dest) {
-            Test_Init("ssendtest", rank);
-            /* Test 1 */
-            Current_Test = (char*)"Ssend Test (Synchronous Send -> Normal Recieve)";
-            MPI_Send( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD );
-            MPI_Recv( buffer, 0, MPI_INT, src, 0, MPI_COMM_WORLD, &status );
-            t0 = MPI_Wtime();
-            flag = 0;
-           /* This test depends on a working wtime.  Make a simple check */
-           if (t0 == 0 && MPI_Wtime() == 0) {
-               int loopcount = 1000000;
-               /* This test is too severe (systems with fast 
-                  processors and large MPI_Wtick values can 
-                  fail.  Try harder to test MPI_Wtime */
-               while (loopcount-- && MPI_Wtime() == 0) ;
-               if (loopcount <= 0) {
-                   fprintf( stderr, 
-                            "MPI_WTIME is returning 0; a working value is needed\n\
-for this test.\n" );
-                   Test_Failed(Current_Test);
-                   MPI_Abort( MPI_COMM_WORLD, 1 );
-               }
-               t0 = MPI_Wtime();
-           }
-            /*while (MPI_Wtime() - t0 < MAX_TIME) {
-                MPI_Iprobe( src, 2, MPI_COMM_WORLD, &flag, &status );
-                if (flag) {
-                    Test_Failed(Current_Test);
-                    break;
-                    }
-                }*/
-            if (!flag) 
-                Test_Passed(Current_Test);
-            MPI_Recv( buffer, act_size, MPI_INT, src, 1, MPI_COMM_WORLD, 
-                     &status1 );
-            MPI_Recv( buffer, act_size, MPI_INT, src, 2, MPI_COMM_WORLD, 
-                     &status2 );
-            
-            MPI_Get_count( &status1, MPI_INT, &count1 );
-            MPI_Get_count( &status2, MPI_INT, &count2 );
-            if (count1 != act_size) {
-                fprintf( stdout, 
-                        "(1) Wrong count from recv of ssend: got %d (%d)\n", 
-                        count1, act_size );
-                }
-            if (status1.MPI_TAG != 1) {
-                fprintf( stdout, "(1) Wrong tag from recv of ssend: got %d\n", 
-                        status1.MPI_TAG );
-                }
-            if (count2 != act_size) {
-                fprintf( stdout, 
-                        "(2) Wrong count from recv of ssend: got %d (%d)\n", 
-                        count1, act_size );
-                }
-            if (status2.MPI_TAG != 2) {
-                fprintf( stdout, "(2) Wrong tag from recv of ssend: got %d\n", 
-                        status2.MPI_TAG );
-                }
-
-            }
-        }
-
-    Test_Waitforall( );
-    rval = 0;
-    if (rank == dest) {
-           rval = Summarize_Test_Results(); /* Returns number of tests;
-                                                   that failed */
-           Test_Finalize();
-           }
-    MPI_Finalize();
-    return rval;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/ssendtest2.c b/teshsuite/smpi/mpich-test/pt2pt/ssendtest2.c
deleted file mode 100644 (file)
index 0bc65a8..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Test from oertel@ZIB-Berlin.DE 
- */
-
-/*
- * Test of MPI_Ssend on MPI implementation on Cray T3D
- *
- * Process dest should receive numbers 1,...,10 but
- * receives 274878030344 instead !!!
- *
- * Test program works correctly with MPI_Ssend replaced by MPI_Send!
- *
- *
- * Compiler options: /mpp/bin/cc -Tcray-t3d -g -X2 -I"directory of mpi.h"
- *
- * Output of run with option -mpiversion:
-
-ssendt3d -mpiversion
-MPI model implementation 1.00.11., T3D Device Driver, Version 0.0
-MPI model implementation 1.00.11., T3D Device Driver, Version 0.0
-Configured with -arch=cray_t3d -device=t3d -opt=-g -ar_nolocal -make=gmake
-Configured with -arch=cray_t3d -device=t3d -opt=-g -ar_nolocal -make=gmake
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-Received 274878008072
-
- */
-
-#include <stdio.h>
-#include "mpi.h"
-
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-#define SIZE 10
-
-static int src  = 0;
-static int dest = 1;
-
-int main( int argc, char **argv )
-{
-    int rank; /* My Rank (0 or 1) */
-    int i, ivalue;
-    MPI_Status Stat;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank);
-
-    if (rank == src) {
-
-        for (i=1; i<=SIZE; i++)
-        {
-            MPI_Ssend( &i, 1, MPI_INT, dest, 2000, MPI_COMM_WORLD);
-        }
-
-    } else if (rank == dest) {
-        for (i=1; i<=SIZE; i++)
-        {
-            MPI_Recv( &ivalue, 1, MPI_INT, src, 2000, MPI_COMM_WORLD, &Stat);
-            printf("Received %d\n", ivalue); fflush(stdout);
-        }
-    }
-    MPI_Barrier( MPI_COMM_WORLD);
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/ssendtest2.std b/teshsuite/smpi/mpich-test/pt2pt/ssendtest2.std
deleted file mode 100644 (file)
index 7fb27f6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Received 1
-Received 2
-Received 3
-Received 4
-Received 5
-Received 6
-Received 7
-Received 8
-Received 9
-Received 10
diff --git a/teshsuite/smpi/mpich-test/pt2pt/structf.f b/teshsuite/smpi/mpich-test/pt2pt/structf.f
deleted file mode 100644 (file)
index efb555b..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-C Thanks to 
-C William R. Magro
-C for this test
-C
-C It has been modifiedly slightly to work with the automated MPI
-C tests.
-C  WDG.
-C
-      program bustit
-      implicit none
-
-      include 'mpif.h'
-
-      integer ierr
-      integer comm
-      integer newtype
-      integer me
-      integer position
-      integer type(5)
-      integer length(5)
-      integer disp(5)
-      integer bufsize
-      parameter (bufsize=100)
-      character buf(bufsize)
-      character name*(10)
-      integer status(MPI_STATUS_SIZE)
-      integer i, size
-      double precision x
-      integer src, dest
-
-C     Enroll in MPI
-      call mpi_init(ierr)
-
-C     get my rank
-      call mpi_comm_rank(MPI_COMM_WORLD, me, ierr)
-      call mpi_comm_size(MPI_COMM_WORLD, size, ierr )
-      if (size .lt. 2) then
-         print *, "Must have at least 2 processes"
-         call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
-      endif
-
-      comm = MPI_COMM_WORLD
-      src = 0
-      dest = 1
-
-      if(me.eq.src) then
-          i=5
-          x=5.1234d0
-          name="hello"
-
-          type(1)=MPI_CHARACTER
-          length(1)=5
-          call mpi_address(name,disp(1),ierr)
-
-          type(2)=MPI_DOUBLE_PRECISION
-          length(2)=1
-          call mpi_address(x,disp(2),ierr)
-
-          call mpi_type_struct(2,length,disp,type,newtype,ierr)
-          call mpi_type_commit(newtype,ierr)
-          call mpi_barrier( MPI_COMM_WORLD, ierr )
-          call mpi_send(MPI_BOTTOM,1,newtype,dest,1,comm,ierr)
-          call mpi_type_free(newtype,ierr)
-C         write(*,*) "Sent ",name(1:5),x
-      else 
-C         Everyone calls barrier incase size > 2
-          call mpi_barrier( MPI_COMM_WORLD, ierr )
-          if (me.eq.dest) then
-             position=0
-
-             name = " "
-             x    = 0.0d0
-             call mpi_recv(buf,bufsize,MPI_PACKED, src,
-     .            1, comm, status, ierr)
-             
-             call mpi_unpack(buf,bufsize,position,
-     .            name,5,MPI_CHARACTER, comm,ierr)
-             call mpi_unpack(buf,bufsize,position,
-     .            x,1,MPI_DOUBLE_PRECISION, comm,ierr)
-             print 1, name, x
- 1           format( " Received ", a, f7.4 )
-          endif
-      endif
-
-      call mpi_finalize(ierr)
-
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/structf.std b/teshsuite/smpi/mpich-test/pt2pt/structf.std
deleted file mode 100644 (file)
index fa328ce..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*** Testing Type_struct from Fortran ***
- Received hello         5.1234
-*** Testing Type_struct from Fortran ***
diff --git a/teshsuite/smpi/mpich-test/pt2pt/structlb.c b/teshsuite/smpi/mpich-test/pt2pt/structlb.c
deleted file mode 100644 (file)
index 4e54094..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-int main( int argc, char **argv)
-{
-    int blockcnt[2], size;
-    MPI_Datatype tmptype, newtype, oldtypes[2];
-    MPI_Aint offsets[2], extent, lb, ub;
-
-    MPI_Init(&argc, &argv);
-
-    blockcnt[0] = 1;
-    offsets[0] = 1;
-    oldtypes[0] = MPI_BYTE;
-    blockcnt[1] = 1;   /* set upper bound to avoid padding */
-    offsets[1] = 2;
-    oldtypes[1] = MPI_UB;
-    MPI_Type_struct(2, blockcnt, offsets, oldtypes, &tmptype);
-    MPI_Type_commit(&tmptype);
-
-    MPI_Type_size(tmptype, &size);
-    MPI_Type_lb(tmptype, &lb);
-    MPI_Type_ub(tmptype, &ub);
-    MPI_Type_extent(tmptype, &extent);
-#ifdef DEBUG
-    printf("tmptype: size: %d lb: %ld ub: %ld ex: %ld\n",
-           size, (long)lb, (long)ub, (long)extent);
-#endif
-       
-    blockcnt[0] = 1;
-    offsets[0] = 1;
-    oldtypes[0] = tmptype;
-    MPI_Type_struct(1, blockcnt, offsets, oldtypes, &newtype);
-    MPI_Type_commit(&newtype);
-
-    MPI_Type_size(newtype, &size);
-    MPI_Type_lb(newtype, &lb);
-    MPI_Type_ub(newtype, &ub);
-    MPI_Type_extent(newtype, &extent);
-#ifdef DEBUG
-    printf("newtype: size: %d lb: %ld ub: %ld ex: %ld\n",
-           size, (long)lb, (long)ub, (long)extent);
-#endif 
-    if (size != 1 || lb != 2 || ub != 3 || extent != 1) {
-        printf("lb = %ld (should be 2), ub = %ld (should be 3) extent = %ld should be 1, size = %d (should be 1)\n",
-               (long)lb, (long)ub, (long)extent, size);
-    } else {
-       printf( " No Errors\n" );
-    }
-    MPI_Type_free(&tmptype);
-    MPI_Type_free(&newtype);
-    MPI_Finalize();
-
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/systest.c b/teshsuite/smpi/mpich-test/pt2pt/systest.c
deleted file mode 100644 (file)
index af5fbb8..0000000
+++ /dev/null
@@ -1,433 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-#define MAX2(a,b) (((a)>(b)) ? (a) : (b))
-
-int  GlobalReadInteger();
-void Hello();
-/*
-void Ring();
-void Stress();
-void Globals();
-*/
-
-int main( int argc, char **argv )
-{
-
-    int me, option;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD,&me);
-
-    fprintf(stderr,"Process %d is alive\n",me);
-
-    while (1) {
-
-       MPI_Barrier(MPI_COMM_WORLD);
-
-      again:
-       if (me == 0) {
-           /* Read user input for action */
-           (void) printf("\nOptions: 0=quit, 1=Hello, 2=Ring, 3=Stress, ");
-           (void) printf("4=Globals : ");
-           (void) fflush(stdout);
-       }
-       option = GlobalReadInteger();
-       if ( (option < 0) || (option > 4) )
-           goto again;
-
-       switch (option) {
-         case 0:
-           MPI_Finalize();
-           return;
-         case 1:
-           Hello();     break;
-         case 2:
-           Ring();      break;
-/*
-         case 3:
-           Stress();    break;
-         case 4:
-           Globals();   break;
-*/
-         default:
-           fprintf(stderr,"systest: invalid option %d\n", option);   break;
-       }
-    }
-}
-
-int GlobalReadInteger()
-/*
-  Process zero reads an integer from stdin and broadcasts
-  to everyone else
-*/
-{
-    int me, value, *msg, msg_len, type=999 ,zero=0;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &me);
-    if (me == 0) {
-       if (scanf("%d", &value) != 1)
-           fprintf(stderr,"failed reading integer value from stdin\n");
-    }
-    MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
-    return value;
-}
-
-static void Hello()
-/*
-  Everyone exchanges a hello message with everyone else.
-  The hello message just comprises the sending and target nodes.
-*/
-{
-    int nproc, me;
-    int type = 1;
-    int buffer[2], node, length;
-    MPI_Status status;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &me);
-    MPI_Comm_size(MPI_COMM_WORLD, &nproc);
-
-    if (me == 0) {
-       printf("\nHello test ... show network integrity\n----------\n\n");
-       fflush(stdout);
-    }
-
-    for (node = 0; node<nproc; node++) {
-       if (node != me) {
-           buffer[0] = me;
-           buffer[1] = node;
-           MPI_Send(buffer, 2, MPI_INT, node, type, MPI_COMM_WORLD);
-           MPI_Recv(buffer, 2, MPI_INT, node, type, MPI_COMM_WORLD, &status);
-
-           if ( (buffer[0] != node) || (buffer[1] != me) ) {
-               (void) fprintf(stderr, "Hello: %d!=%d or %d!=%d\n",
-                              buffer[0], node, buffer[1], me);
-               printf("Mismatch on hello process ids; node = %d\n", node);
-           }
-
-           printf("Hello from %d to %d\n", me, node);
-           fflush(stdout);
-       }
-    }
-}
-
-static void Ring()       /* Time passing a message round a ring */
-{
-    int nproc, me;
-    MPI_Status status;
-    int nproc = p4_num_total_ids();
-    int type = 4;
-    int left = (me + nproc - 1) % nproc;
-    int right = (me + 1) % nproc;
-    char *buffer, *msg;
-    int start, lenbuf, used, max_len,  msg_len;
-    double rate, us_rate;
-    double start_ustime, end_ustime, used_ustime;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &me);
-    MPI_Comm_size(MPI_COMM_WORLD, &nproc);
-    left = (me + nproc - 1) % nproc;
-    right = (me + 1) % nproc;
-
-    /* Find out how big a message to use */
-
-    if (me == 0) {
-       (void) printf("\nRing test...time network performance\n---------\n\n");
-       (void) printf("Input maximum message size: ");
-       (void) fflush(stdout);
-    }
-    max_len = GlobalReadInteger();
-    if ( (max_len <= 0) || (max_len >= 4*1024*1024) )
-       max_len = 512*1024;
-    if ( (buffer = malloc((unsigned) max_len)) == (char *) NULL) {
-       printf("process %d could not allocate buffer of size %d\n",me,max_len);
-       MPI_Abort(MPI_COMM_WORLD,7777);
-    }
-
-    lenbuf = 1;
-    while (lenbuf <= max_len) {
-       start_ustime = MPI_Wtime();
-       if (me == 0) {
-           MPI_Send(buffer,lenbuf,MPI_CHAR,left, type,MPI_COMM_WORLD);
-           MPI_Recv(buffer,lenbuf,MPI_CHAR,right,type,MPI_COMM_WORLD,&status);
-       }
-       else {
-           MPI_Recv(buffer,lenbuf,MPI_CHAR,right,type,MPI_COMM_WORLD,&status);
-           MPI_Send(buffer,lenbuf,MPI_CHAR,left, type,MPI_COMM_WORLD);
-       }
-       used_ustime = MPI_Wtime() - start_ustime;
-
-       if (used_ustime > 0)
-           us_rate = 1.0 * (double) (nproc * lenbuf) / (double) used_ustime;
-       else
-           us_rate = 0.0;
-       if (me == 0)
-           printf("len=%d bytes, used= %d us, rate=%f Mbytes/sec\n",
-                  lenbuf, used_ustime, us_rate);
-    
-       lenbuf *= 2;
-    }
-    free(buffer);
-}
-
-double ranf()
-/* Returns ran # uniform in (0,1) ... probably rather bad statistics. */
-{
-  static unsigned long seed = 54321;
-
-  seed = seed * 1812433253 + 12345;
-  return (seed & 0x7fffffff) * 4.6566128752458e-10;
-}
-
-static void RandList(lo, hi, list, n)
-     int lo, hi, *list, n;
-/*
-  Fill list with n random integers between lo & hi inclusively
-*/
-{
-  int i, ran;
-  double dran;
-
-  for (i=0; i<n; i++) {
-    dran = ranf();
-    ran = lo + (int) (dran * (double) (hi-lo+1));
-    if (ran < lo)
-      ran = lo;
-    if (ran > hi)
-      ran = hi;
-    list[i] = ran;
-  }
-}
-
-static void Stress()
-/*
-  Stress the system by passing messages between a randomly selected
-  list of nodes
-*/
-{
-#define N_LEN 10
-#ifdef NCUBE
-  /* ncube does not handle msgs larger than 
-     32K at present (see nwrite) */
-  static int len[N_LEN] = {0,1,2,4,8,4096,8192,16384,32768,32768};
-#else
-  static int len[N_LEN] = {0,1,2,4,8,4096,8192,16384,32768,65536};
-#endif
-  int me = p4_get_my_id();
-  int nproc = p4_num_total_ids();
-  int zero = 0;
-  int type, lenbuf, i, j, from, to;
-  int *list_i, *list_j, *list_n;
-  char *buffer;
-  int n_stress, mod, *msg, msg_len;
-
-
-  type = 6;
-  if (me == 0) {
-    (void) printf("\nStress test ... randomly exchange messages\n-----------");
-    (void) printf("\n\nInput no. of messages: ");
-    (void) fflush(stdout);
-  }
-  n_stress = GlobalReadInteger();
-  if ( (n_stress <= 0) || (n_stress > 100000) )
-    n_stress = 1000;
-  p4_dprintfl(00,"n_stress=%d\n",n_stress);
-
-  lenbuf = n_stress * sizeof(int);
-
-  if (!(buffer = p4_shmalloc((unsigned) len[N_LEN-1])))
-    p4_error("Stress: failed to allocate buffer", len[N_LEN-1]);
-
-  type = 7;
-  if (me == 0) { /* Make random list of pairs and message lengths */
-    if (!(list_i = (int *) p4_shmalloc((unsigned) lenbuf)))
-      p4_error("Stress: failed to allocate list_i",lenbuf);
-    if (!(list_j = (int *) p4_shmalloc((unsigned) lenbuf)))
-      p4_error("Stress: failed to allocate list_j",lenbuf);
-    if (!(list_n = (int *) p4_shmalloc((unsigned) lenbuf)))
-      p4_error("Stress: failed to allocate list_n",lenbuf);
-
-    RandList((int) 0, nproc-1, list_i, n_stress);
-    RandList((int) 0, nproc-1, list_j, n_stress);
-    RandList((int) 0, N_LEN-1, list_n, n_stress);
-    for (i=0; i<n_stress; i++)
-      list_n[i] = len[list_n[i]];
-    p4_broadcastx(type, (char *) list_i, lenbuf, P4INT);
-    p4_broadcastx(type, (char *) list_j, lenbuf, P4INT);
-    p4_broadcastx(type, (char *) list_n, lenbuf, P4INT);
-  }
-  else {
-    list_i = (int *) NULL;
-    (void) p4_recv(&type, &zero, (char **) &list_i, &msg_len);
-    list_j = (int *) NULL;
-    (void) p4_recv(&type, &zero, (char **) &list_j, &msg_len);
-    list_n = (int *) NULL;
-    (void) p4_recv(&type, &zero, (char **) &list_n, &msg_len);
-  }
-
-  type = 8;
-
-  j = 0;
-  mod = (n_stress-1)/10 + 1;
-  for (i=0; i < n_stress; i++) {
-
-    from   = list_i[i];
-    to     = list_j[i];
-    lenbuf = list_n[i];
-
-    /* P4 can send to self 
-    if (from == to)
-      continue; */
-
-    if ( (me == 0) && (j%mod == 0) ) {
-      (void) printf("Stress: test=%ld: from=%ld, to=%ld, len=%ld\n",
-                   i, from, to, lenbuf);
-      (void) fflush(stdout);
-    }
-
-    j++;  /* Needed when skipping send to self */
-
-    if (from == me)
-      (void) p4_send(type, to, buffer, lenbuf);
-
-    if (to == me) {
-      msg = (int *) NULL;
-      (void) p4_recv(&type, &from, (char **) &msg, &msg_len);
-      p4_msg_free((char *) msg);
-      if (msg_len != lenbuf)
-       p4_error("Stress: invalid message length on receive",lenbuf);
-    }
-  }
-
-  (void) p4_shfree(buffer);
-  if (me == 0) {
-    (void) p4_shfree((char *) list_n);
-    (void) p4_shfree((char *) list_j);
-    (void) p4_shfree((char *) list_i);
-  }
-  else {
-    (void) p4_msg_free((char *) list_n);
-    (void) p4_msg_free((char *) list_j);
-    (void) p4_msg_free((char *) list_i);
-  }
-}
-
-static int CompareVectors(n, a, b)
-     int n;
-     double *a, *b;
-/*
-  Return the no. of differences in two vectors allowing for
-  numerical roundoff.
-*/
-{
-#define ABS(a)   (((a)>=0 ) ? (a) : -(a))
-  int nerrs = 0;
-  double diff;
-
-  while (n--) {
-    diff = *a++ - *b++;
-    if (ABS(diff) > 1.0e-8)
-      nerrs++;
-  }
-  
-  return nerrs;
-}
-
-static void Globals()
-/*
-  Test out functioning of the global operations.
-*/
-{
-  int nproc = p4_num_total_ids();
-  int me = p4_get_my_id();
-  int n, i, start, used, nerrs;
-  double *a, *b, rate;
-
-#define DO(string, op) \
-  start = p4_clock(); \
-  if (p4_global_op(33, (char *) a, n, sizeof(double), op, P4DBL)) \
-    p4_error("p4_global_op failed",n); \
-  used = p4_clock()-start; \
-  rate = (used>0) ? n/(1.0e+3 * used) : 0.0; \
-  nerrs = CompareVectors(n, a, b); \
-  if (me == 0) \
-    (void) printf("%s, len=%d, used=%d ms, rate=%f Mop/sec, nerrs=%d\n",\
-                   string, n, used, rate, nerrs);
-
-  if (me == 0) {
-    (void) printf("\nGlobal operations test\n----------------------");
-    (void) printf("\n\nInput vector length ");
-    (void) fflush(stdout);
-  }
-  n = GlobalReadInteger();
-  if ( (n < 0) || (n > 1000000) )
-    n = 1000;
-
-  if (!(a = (double *) p4_shmalloc((unsigned) (n*sizeof(double)))))
-    p4_error("failed to create work space (a)",n);
-  if (!(b = (double *) p4_shmalloc((unsigned) (n*sizeof(double)))))
-    p4_error("failed to create work space (b)",n);
-
-  /* Summation */
-
-  for (i=0; i<n; i++) {
-    a[i] = i+me;
-    b[i] = nproc*i + (nproc*(nproc-1))/2;
-  }
-  DO("Summation", p4_dbl_sum_op);
-
-  /* Maximum */
-
-  for (i=0; i<n; i++) {
-    a[i] = i+me;
-    b[i] = i+nproc-1;
-  }
-  DO("Maximum", p4_dbl_max_op);
-
-  /* Abs Maximum */
-
-  for (i=0; i<n; i++) {
-    a[i] = i+me - n/2;
-    b[i] = MAX2(n/2-i, i+nproc-1-n/2);
-  }
-  DO("Abs Maximum", p4_dbl_absmax_op);
-
-  /* Tidy up */
-
-  p4_shfree((char *) b);
-  p4_shfree((char *) a);
-}
-
-
-void synchronize(type)
-     int type;
-/*
-  Processes block until all have checked in with process 0
-  with a message of specified type .. a barrier.
-*/
-{
-  int me = p4_get_my_id();
-  int nproc = p4_num_total_ids();
-  int zero = 0;
-  int *msg;
-  int msg_len, node, dummy = type;
-
-  if (me == zero) {
-    for (node=1; node<nproc; node++){       /* Check in */
-      msg = (int *) NULL;
-      if (p4_recv(&type, &node, (char **) &msg, &msg_len))
-       p4_error("synchronize: recv 1 failed", (int) msg);
-      p4_msg_free((char *) msg);
-    }
-    if (p4_broadcast(type, (char *) &dummy, sizeof dummy))
-      p4_error("synchronize: broadcast failed",type);
-  }
-  else {
-    if (p4_send(type, zero, (char *) &me, sizeof me))
-      p4_error("synchronize: send failed", type);
-    msg = (int *) NULL;
-    if (p4_recv(&type, &zero, (char **) &msg, &msg_len))
-      p4_error("synchronize: recv 2 failed", (int) msg);
-    p4_msg_free((char *) msg);
-  }
-}    
diff --git a/teshsuite/smpi/mpich-test/pt2pt/systest1.c b/teshsuite/smpi/mpich-test/pt2pt/systest1.c
deleted file mode 100644 (file)
index 2ca9812..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-#define MAX2(a,b) (((a)>(b)) ? (a) : (b))
-
-int  GlobalReadInteger();
-void Hello();
-/*
-void Ring();
-void Stress();
-void Globals();
-*/
-
-int main(argc,argv)
-int argc;
-char **argv;
-{
-
-    int me, option;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD,&me);
-
-    fprintf(stderr,"Process %d is alive\n",me);
-
-    while (1) {
-
-       MPI_Barrier(MPI_COMM_WORLD);
-
-      again:
-       if (me == 0) {
-           /* Read user input for action */
-           (void) printf("\nOptions: 0=quit, 1=Hello, 2=Ring, 3=Stress, ");
-           (void) printf("4=Globals : ");
-           (void) fflush(stdout);
-       }
-       option = GlobalReadInteger();
-       if ( (option < 0) || (option > 4) )
-           goto again;
-
-       switch (option) {
-         case 0:
-           MPI_Finalize();
-           return;
-         case 1:
-           Hello();     break;
-/*
-         case 2:
-           Ring();      break;
-         case 3:
-           Stress();    break;
-         case 4:
-           Globals();   break;
-*/
-         default:
-           fprintf(stderr,"systest: invalid option %d\n", option);   break;
-       }
-    }
-}
-
-int GlobalReadInteger()
-/*
-  Process zero reads an integer from stdin and broadcasts
-  to everyone else
-*/
-{
-    int me, value, *msg, msg_len, type=999 ,zero=0;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &me);
-    if (me == 0) {
-       if (scanf("%d", &value) != 1)
-           fprintf(stderr,"failed reading integer value from stdin\n");
-    }
-    MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD);
-    return value;
-}
-
-static void Hello()
-/*
-  Everyone exchanges a hello message with everyone else.
-  The hello message just comprises the sending and target nodes.
-*/
-{
-    int nproc, me;
-    int type = 1;
-    int buffer[2], node, length;
-    MPI_Status status;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &me);
-    MPI_Comm_size(MPI_COMM_WORLD, &nproc);
-
-    if (me == 0) {
-       printf("\nHello test ... show network integrity\n----------\n\n");
-       fflush(stdout);
-    }
-
-    for (node = 0; node<nproc; node++) {
-       if (node != me) {
-           buffer[0] = me;
-           buffer[1] = node;
-           MPI_Send(buffer, 2, MPI_INT, node, type, MPI_COMM_WORLD);
-           buffer[0] = buffer[1] = 7777;
-           MPI_Recv(buffer, 2, MPI_INT, node, type, MPI_COMM_WORLD, &status);
-
-           if ( (buffer[0] != node) || (buffer[1] != me) ) {
-               (void) fprintf(stderr, "Hello: %d!=%d or %d!=%d\n",
-                              buffer[0], node, buffer[1], me);
-               printf("Mismatch on hello process ids; node = %d\n", node);
-           }
-
-           printf("Hello from %d to %d\n", me, node);
-           fflush(stdout);
-       }
-    }
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/test.c b/teshsuite/smpi/mpich-test/pt2pt/test.c
deleted file mode 100644 (file)
index c9d7f28..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/* Procedures for recording and printing test results */
-
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-
-#if defined(USE_STDARG)
-#include <stdarg.h>
-#endif
-
-static int tests_passed = 0;
-static int tests_failed = 0;
-static char failed_tests[255][81];
-static char suite_name[255];
-FILE *fileout = NULL;
-
-void Test_Init(const char *suite, int rank)
-{
-    char filename[512];
-
-    sprintf(filename, "%s-%d.out", suite, rank);
-    strncpy(suite_name, suite, 255);
-    fileout = fopen(filename, "w");
-    if (!fileout) {
-       fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    //MPI_Errhandler_create( Test_Errors_warn, &TEST_ERRORS_WARN );
-}
-
-void Test_Message(const char *mess)
-{
-    fprintf(fileout, "[%s]: %s\n", suite_name, mess);
-    fflush(fileout);
-}
-
-void Test_Failed(const char *test)
-{
-    fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
-    strncpy(failed_tests[tests_failed], test, 81);
-    fflush(fileout);
-    tests_failed++;
-}
-
-void Test_Passed(const char *test)
-{
-#ifdef VERBOSE
-    fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
-    fflush(fileout);
-#endif
-    tests_passed++;
-}
-
-int Summarize_Test_Results()
-{
-#ifdef VERBOSE
-    fprintf(fileout, "For test suite '%s':\n", suite_name);
-#else
-    if (tests_failed > 0)
-#endif
-    {
-       fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n", 
-               tests_passed + tests_failed, tests_passed, tests_failed);
-    }
-    if (tests_failed > 0) {
-       int i;
-
-       fprintf(fileout, "*** Tests Failed:\n");
-       for (i = 0; i < tests_failed; i++)
-           fprintf(fileout, "*** %s\n", failed_tests[i]);
-    }
-    return tests_failed;
-}
-
-void Test_Finalize( void )
-{
-    //if (TEST_ERRORS_WARN != MPI_ERRHANDLER_NULL) 
-       //MPI_Errhandler_free( &TEST_ERRORS_WARN );
-    if (fileout) {
-       fflush(fileout);
-       //fclose(fileout);
-    }
-}
-
-#include "mpi.h"
-/* Wait for every process to pass through this point.  This test is used
-   to make sure that all processes complete, and that a test "passes" because
-   it executed, not because it some process failed.  
- */
-void Test_Waitforall( void )
-{
-    int m, one, myrank, n;
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-    MPI_Comm_size( MPI_COMM_WORLD, &n );
-    one = 1;
-    MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-    if (m != n) {
-       printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank, 
-               n, m );
-    }
-    if (myrank == 0) 
-       printf( " No Errors\n" );
-}
-
-/*
-   Handler prints warning messsage and returns.  Internal.  Not
-   a part of the standard.
- */
-MPI_Errhandler TEST_ERRORS_WARN ;
-
-#ifdef USE_STDARG
-void Test_Errors_warn(  MPI_Comm *comm, int *code, ... )
-{  
-  char buf[MPI_MAX_ERROR_STRING];
-  int  myid; 
-  char *string;
-#ifdef MPIR_DEBUG
-  char *file;
-  int  *line;
-#endif
-  static int in_handler = 0;
-  va_list Argp;
-
-#ifdef USE_OLDSTYLE_STDARG
-  va_start( Argp );
-#else
-  va_start( Argp, code );
-#endif
-  string = va_arg(Argp,char *);
-#ifdef MPIR_DEBUG
-  /* These are only needed for debugging output */
-  file   = va_arg(Argp,char *);
-  line   = va_arg(Argp,int *);
-#endif
-  va_end( Argp );
-#else
-void Test_Errors_warn( MPI_Comm *comm, int *code, char *string, char *file, 
-                      int *line )
-{
-  char buf[MPI_MAX_ERROR_STRING];
-  int  myid, result_len; 
-  static int in_handler = 0;
-#endif
-
-  if (in_handler) return;
-  in_handler = 1;
-
-  MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-  //MPI_Error_string( *code, buf, &result_len );
-#ifdef MPIR_DEBUG
-  /* Generate this information ONLY when debugging MPIR */
-  fprintf( stderr, "%d -  File: %s   Line: %d\n", myid, 
-                  file, *line );
-#endif
-  fprintf( stderr, "%d - %s : %s\n", myid, 
-          string ? string : "<NO ERROR MESSAGE>", buf );
-  fflush( stderr );
-  in_handler = 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/test.h b/teshsuite/smpi/mpich-test/pt2pt/test.h
deleted file mode 100644 (file)
index fb83d22..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Header for testing procedures */
-
-#ifndef _INCLUDED_TEST_H_
-#define _INCLUDED_TEST_H_
-
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Test_Init (const char *, int);
-#ifdef USE_STDARG
-void Test_Printf (const char *, ...);
-void Test_Errors_warn ( MPI_Comm *, int *, ... );
-#else
-/* No prototype */
-void Test_Printf();
-void Test_Errors_warn();
-#endif
-void Test_Message (const char *);
-void Test_Failed (const char *);
-void Test_Passed (const char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-
-extern MPI_Errhandler TEST_ERRORS_WARN;
-#endif
diff --git a/teshsuite/smpi/mpich-test/pt2pt/testall.c b/teshsuite/smpi/mpich-test/pt2pt/testall.c
deleted file mode 100644 (file)
index 22f471b..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/* 
-   Multiple completions
-   
-   This is similar to a test in allpair.f, but with an expanded range of
-   datatypes and communicators.
- */
-
-int main( int argc, char **argv )
-{
-MPI_Datatype *types;
-void         **inbufs, **outbufs;
-char         **names;
-int          *counts, *bytesize, ntype;
-MPI_Comm     comms[20];
-int          ncomm = 20, rank, np, partner, tag;
-int          i, j, k, err, toterr, world_rank;
-MPI_Status   status, statuses[2];
-int          flag;
-char         *obuf;
-MPI_Request  requests[2];
-
-
-MPI_Init( &argc, &argv );
-
-AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                &names, &ntype );
-GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-err = 0;
-for (i=0; i<ncomm; i++) {
-    MPI_Comm_rank( comms[i], &rank );
-    MPI_Comm_size( comms[i], &np );
-    if (np < 2) continue;
-    tag = i;
-    /* This is the test.  
-       master:                               worker:
-       irecv                                 send
-       isend
-       testall  (fail)
-       sendrecv                              sendrecv
-                                             irecv
-       sendrecv                              sendrecv
-                                             wait
-       sendrecv                              sendrecv
-       testall  (should succeed)                  
-     */
-    for (j=0; j<ntype; j++) {
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing type %s\n", names[j] );
-        if (rank == 0) {
-           /* Master */
-           partner = np - 1;
-#if 0
-           MPIR_PrintDatatypePack( stdout, counts[j], types[j], 0, 0 );
-#endif
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           
-           MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                     comms[i], &requests[0] );
-           
-           /* Use issend to ensure that the test cannot complete */
-           MPI_Isend( inbufs[j], counts[j], types[j], partner, tag, 
-                       comms[i], &requests[1] );
-
-           /* Note that the send may have completed */
-           MPI_Testall( 2, &requests[0], &flag, statuses );
-           if (flag) {
-               err++;
-               fprintf( stderr, "MPI_Testall returned flag == true!\n" );
-               }
-           if (requests[1] == MPI_REQUEST_NULL) {
-               err++;
-               fprintf( stderr, "MPI_Testall freed a request\n" );
-               }
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           /* This should succeed, but may fail if the wait below is 
-              still waiting */
-           MPI_Testall( 2, requests, &flag, statuses );
-           if (!flag) {
-               err++;
-               fprintf( stderr, "MPI_Testall returned flag == false!\n" );
-               }
-           if (requests[0] != MPI_REQUEST_NULL || 
-               requests[1] != MPI_REQUEST_NULL) {
-               err++;
-               fprintf( stderr, "MPI_Testall failed to free requests (test %d)\n", j );
-               if (requests[0] != MPI_REQUEST_NULL) {
-                   fprintf( stderr, "Failed to free Irecv request\n" );
-               }
-               if (requests[1] != MPI_REQUEST_NULL) {
-                   fprintf( stderr, "Failed to free Isend request\n" );
-               }
-           }
-           /* Check the received data */
-            if (CheckDataAndPrint( inbufs[j], outbufs[j], bytesize[j],
-                                  names[j], j )) {
-               err++;
-               }
-           }
-       else if (rank == np - 1) {
-           /* receiver */
-           partner = 0;
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           
-           MPI_Send( inbufs[j], counts[j], types[j], partner, tag, 
-                       comms[i] );
-           
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-
-           MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                     comms[i], &requests[0] );
-
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-
-           MPI_Wait( requests, statuses );
-            if (CheckDataAndPrint( inbufs[j], outbufs[j], bytesize[j],
-                                  names[j], j )) {
-                err++;
-               }
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           }
-       }
-    }
-
-if (err > 0) {
-    fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
-MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-FreeComms( comms, ncomm );
-MPI_Finalize();
-
-return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/testhetero b/teshsuite/smpi/mpich-test/pt2pt/testhetero
deleted file mode 100755 (executable)
index 5f32e12..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /bin/sh
-#
-# This is a simple heterogeneous test which exploits the mpicc command and
-# mpirun.  This is an example of how heterogeneous programs may be built and
-# run
-#
-#
-# Parameters for all programs and systems
-set -x
-device=ch_p4
-mpihome=../../..
-rshcmd=rsh
-programs="sendrecv sendrecv2 sendrecv3 sendrecv4 getelm"
-# Extra files needed for each program.
-sendrecvfiles="test.c"
-sendrecvargs="-nolongdouble"
-sendrecv2files="dtypes.c gcomm.c"
-sendrecv3files="dtypes.c gcomm.c"
-sendrecv4files="dtypes.c gcomm.c"
-getelmfiles=""
-#
-#
-# arch1 is local, arch2 is remote
-arch1=sun4
-arch2=freebsd
-name2=dogbert
-#
-debug_args=""
-fail_hard=1
-rebuild=0
-mpirun_args=""
-for arg in "$@" ; do
-    case "$arg" in 
-       -echo) set -x ;;
-       -noclean) noclean=1 ;;
-       -debug) debug_args="-p4dbg 99 -p4rdbg 99" ;;
-       -mpichdebug) debug_args="$debug_args -mpichdebug" ;;
-       -xxgdb) mpirun_args="-xxgdb" ;;
-        -soft) fail_hard=0 ;;
-       -force | -rebuild) rebuild=1 ;;
-       -alpha) arch2=alpha ; name2=ptera ;;
-       -help) 
-       echo "Test heterogeneous operation of MPICH with ch_p4 using"
-       echo "the versions of MPICH built in the current tree."
-       echo "Should be run on a sun4; it rsh's to other machines as"
-       echo "necessary."
-       exit 1
-       ;;
-       *) echo "Unrecognized argument $arg"
-       exit 1
-       ;;
-    esac
-done
-#
-arches="$arch1 $arch2"
-#
-mypwd=`pwd`
-# Fixup for brain-dead automounters
-mypwd=`echo $mypwd | sed s%/tmp_mnt%%g`
-#
-# Build local versions
-if [ 1 = 1 ] ; then
-    for pgm in $programs ; do
-        eval extrafiles=$"${pgm}files"
-        $mpihome/lib/$arch1/$device/mpicc -o $pgm.$arch1 $pgm.c $extrafiles
-    done
-fi
-#
-# Build remote versions
-for pgm in $programs ; do 
-    eval extrafiles=$"${pgm}files"
-    $rshcmd -n $name2 "(cd $mypwd ; $mpihome/lib/$arch2/$device/mpicc \
-       -o $pgm.$arch2 $pgm.c $extrafiles)"
-done
-#
-# Run the programs
-for pgm in $programs ; do
-    echo "Running $pgm..."
-    eval extraargs=$"${pgm}args"
-    $mpihome/lib/$arch1/$device/mpirun $mpirun_args \
-               -arch $arch1 -np 1 -arch $arch2 -np 1 $pgm.%a $debug_args \
-               $extraargs
-done
-#
-# Remove the executables
-if [ -z "$noclean" ] ; then 
-    for arch in $arches ; do
-        for pgm in $programs ; do
-           rm -f $pgm.$arch
-        done
-    done
-fi
diff --git a/teshsuite/smpi/mpich-test/pt2pt/testsome.c b/teshsuite/smpi/mpich-test/pt2pt/testsome.c
deleted file mode 100644 (file)
index 955e503..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "dtypes.h"
-#include "gcomm.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-int verbose = 0;
-/* 
-   Multiple completions
-   
-   This is similar to a test in allpair.f, but with an expanded range of
-   datatypes and communicators.
- */
-
-int main( int argc, char **argv )
-{
-MPI_Datatype *types;
-void         **inbufs, **outbufs;
-char         **names;
-int          *counts, *bytesize, ntype;
-MPI_Comm     comms[20];
-int          ncomm = 20, rank, np, partner, tag;
-int          i, j, k, err, toterr, world_rank;
-MPI_Status   status, statuses[2];
-int          flag, index, outcount, indices[2];
-char         *obuf;
-MPI_Request  requests[2];
-
-
-MPI_Init( &argc, &argv );
-
-AllocateForData( &types, &inbufs, &outbufs, &counts, &bytesize, 
-                &names, &ntype );
-GenerateData( types, inbufs, outbufs, counts, bytesize, names, &ntype );
-
-MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-MakeComms( comms, 20, &ncomm, 0 );
-
-/* Test over a wide range of datatypes and communicators */
-err = 0;
-for (i=0; i<ncomm; i++) {
-    MPI_Comm_rank( comms[i], &rank );
-    MPI_Comm_size( comms[i], &np );
-    if (np < 2) continue;
-    tag = i;
-    /* This is the test.  
-       sender:                               receiver:
-       irecv                                 irecv
-       isend
-       testsome (all fail)
-       testany  (all fail)
-       sendrecv                              sendrecv
-                                             isend
-       sendrecv                              sendrecv
-       testsome (both may)                   waitsome (both may)
-       waitall                               waitsome (must get other, if any)
-                                             waitsome (outcount = undefined)
-       This test DEPENDS on the handling of null requests, since the several
-       waits/tests may complete everything "early".
-     */
-    for (j=0; j<ntype; j++) {
-       if (world_rank == 0 && verbose) 
-           fprintf( stdout, "Testing type %s\n", names[j] );
-       /* This test does an irsend between both partners, with 
-          a sendrecv after the irecv used to guarentee that the
-          irsend has a matching receive
-        */
-        if (rank == 0) {
-           /* Sender */
-           partner = np - 1;
-#if 0
-           MPIR_PrintDatatypePack( stdout, counts[j], types[j], 0, 0 );
-#endif
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           
-           MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                     comms[i], &requests[0] );
-
-           MPI_Isend( inbufs[j], counts[j], types[j], partner, tag, 
-                       comms[i], &requests[1] );
-
-           /* Note that the send may have completed */
-           MPI_Testsome( 1, &requests[0], &outcount, indices, statuses );
-           if (outcount != 0) {
-               fprintf( stderr, "MPI_Testsome returned outcount = %d\n",
-                        outcount );
-               err++;
-               }
-           MPI_Testany( 1, &requests[0], &index, &flag, &status );
-           if (flag) {
-               fprintf( stderr, "MPI_Testany returned flag = true\n" );
-               err++;
-               }
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-           /* We EXPECT both to succeed, but they may not */
-           MPI_Testsome( 2, requests, &outcount, indices, statuses );
-           MPI_Waitall( 2, requests, statuses );
-           
-           /* Check the received data */
-            if (CheckDataAndPrint( inbufs[j], outbufs[j], bytesize[j],
-                                  names[j], j )) {
-               err++;
-               }
-           }
-       else if (rank == np - 1) {
-           /* receiver */
-           partner = 0;
-           obuf = outbufs[j];
-           for (k=0; k<bytesize[j]; k++) 
-               obuf[k] = 0;
-           
-           MPI_Irecv(outbufs[j], counts[j], types[j], partner, tag, 
-                     comms[i], &requests[0] );
-
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-
-           MPI_Isend( inbufs[j], counts[j], types[j], partner, tag, 
-                       comms[i], &requests[1] );
-           
-           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         MPI_BOTTOM, 0, MPI_INT, partner, ncomm+i, 
-                         comms[i], &status );
-
-           MPI_Waitsome( 2, requests, &outcount, indices, statuses );
-           MPI_Waitsome( 2, requests, &outcount, indices, statuses );
-           MPI_Waitsome( 2, requests, &outcount, indices, statuses );
-           if (outcount != MPI_UNDEFINED) {
-               err++;
-               fprintf( stderr, 
-               "MPI_Waitsome did not return outcount = MPI_UNDEFINED\n" );
-               }
-
-            if (CheckDataAndPrint( inbufs[j], outbufs[j], bytesize[j],
-                                  names[j], j )) {
-                err++;
-               }
-
-           MPI_Waitall(1, &requests[1], &status );
-           }
-       }
-    }
-
-if (err > 0) {
-    fprintf( stderr, "%d errors on %d\n", err, rank );
-    }
- MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
- if (world_rank == 0) {
-     if (toterr == 0) {
-        printf( " No Errors\n" );
-     }
-     else {
-        printf (" Found %d errors\n", toterr );
-     }
- }
-FreeDatatypes( types, inbufs, outbufs, counts, bytesize, names, ntype );
-FreeComms( comms, ncomm );
-MPI_Finalize();
-
-return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/testtest1.c b/teshsuite/smpi/mpich-test/pt2pt/testtest1.c
deleted file mode 100644 (file)
index e087567..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
-   This is a test of MPI_Test to receive a message of known length (used as a
-   server)
- */
-#include "mpi.h"
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-
-int main( int argc, char **argv ) 
-{
-    int data, to, from, tag, maxlen, np, myid, flag, dest, src;
-    MPI_Status status;
-    MPI_Request request;
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &myid );
-    MPI_Comm_size( MPI_COMM_WORLD, &np );
-
-/* dest writes out the received stats; for the output to be
-   consistant (with the final check), it should be procees 0 */
-    if (argc > 1 && argv[1] && strcmp( "-alt", argv[1] ) == 0) {
-       dest = np - 1;
-       src  = 0;
-    }
-    else {
-       src  = np - 1;
-       dest = 0;
-    }
-
-    if (myid == src) {
-       to   = dest;
-       tag = 2000;
-       data = 100;
-#ifdef VERBOSE
-       printf( "About to send\n" );
-#endif
-       MPI_Send( &data, 1, MPI_INT, to, tag, MPI_COMM_WORLD );
-       tag = 2001;
-       data = 0;
-#ifdef VERBOSE
-       printf( "About to send 'done'\n" );
-#endif
-       MPI_Send( &data, 1, MPI_INT, to, tag, MPI_COMM_WORLD );
-    }
-    else {
-       /* Server loop */
-       while (1) {
-           tag    = MPI_ANY_TAG;
-           from   = MPI_ANY_SOURCE;
-           MPI_Irecv( &data, 1, MPI_INT, from, tag, MPI_COMM_WORLD,
-                      &request );
-           /* Should really use MPI_Wait, but functionally this will work
-              (it is less efficient, however) */
-           do {                
-               MPI_Test( &request, &flag, &status );
-           } while (!flag);
-           if (status.MPI_TAG == 2001) {
-#ifdef VERBOSE
-               printf( "Received terminate message\n" );
-#endif
-               break;
-           }
-           if (status.MPI_TAG == 2000) {
-               MPI_Get_count( &status, MPI_INT, &maxlen );
-               if (maxlen != 1) {
-                   fprintf( stderr, "Should have received one integer; got %d\n",
-                            maxlen );
-               }
-               /* Check data: */
-               if (data != 100) {
-                   fprintf( stderr, 
-                            "Did not receive correct data: %d instead of %d\n", 
-                            data, 100 );
-               }
-           }
-       }
-    }
-    MPI_Barrier( MPI_COMM_WORLD );
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/testtypes.c b/teshsuite/smpi/mpich-test/pt2pt/testtypes.c
deleted file mode 100644 (file)
index c87788e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-
-int main( int argc, char **argv )
-{
-  int i_size;
-  MPI_Aint i_extent;
-    
-  MPI_Init(&argc, &argv);
-
-
-  MPI_Type_extent(MPI_INT, &i_extent);
-  printf("MPI_Type_extent (MPI_INT) = %ld\n", (long)i_extent);
-
-  MPI_Type_size(MPI_INT, &i_size);
-  printf("MPI_Type_size (MPI_INT) = %d\n", i_size);
-
-
-  MPI_Type_extent(MPI_UNSIGNED, &i_extent);
-  printf("MPI_Type_extent (MPI_UNSIGNED) = %ld\n", (long)i_extent);
-
-  MPI_Type_size(MPI_UNSIGNED, &i_size);
-  printf("MPI_Type_size (MPI_UNSIGNED) = %d\n", i_size);
-
-#if defined(HAVE_LONG_DOUBLE)
-  MPI_Type_extent(MPI_LONG_DOUBLE, &i_extent);
-  printf("MPI_Type_extent (MPI_LONG_DOUBLE) = %ld\n", (long)i_extent);
-
-  MPI_Type_size(MPI_LONG_DOUBLE, &i_size);
-  printf("MPI_Type_size (MPI_LONG_DOUBLE) = %d\n", i_size);
-#endif
-
-  Test_Waitforall( );
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/third.c b/teshsuite/smpi/mpich-test/pt2pt/third.c
deleted file mode 100644 (file)
index f8a2f24..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-    third - test program that tests queueing by sending messages with various
-            tags, receiving them in particular order.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "mpi.h"
-#include "test.h"
-#ifdef HAVE_UNISTD_H
-/* For sleep */
-#include <unistd.h>
-#endif
-
-#ifndef HAVE_SLEEP
-void sleep( int secs )
-{
-#ifdef VX_WORKS
-    /* Also needs include <time.h>? */
-    struct timespec rqtp = { 10, 0 };
-    nanosleep(&rqtp, NULL);
-#else
-    double t;
-    t = MPI_Wtime();
-    while (MPI_Wtime() - t < (double)secs) ;
-#endif
-}
-#endif
-
-/* Define VERBOSE to get printed output */
-int main( int argc, char **argv )
-{
-    int rank, size, to, from, tag, count;
-    int src, dest, waiter;
-    int st_count;
-#ifdef VERBOSE
-    int st_source, st_tag;
-#endif
-    MPI_Status status;
-    char data[100];
-    MPI_Request rq[2];
-    MPI_Status statuses[2];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-/*
-    src  = size - 1;
-    dest = 0;
- */
-    src = 0;
-    dest = size - 1;
-    /* waiter = dest; */       /* Receiver delays, so msgs unexpected */
-    /* waiter = src;  */       /* Sender delays, so recvs posted      */
-    waiter = 10000;            /* nobody waits */
-
-    if (rank == src)
-    {
-       if (waiter == src)
-           sleep(10);
-       to     = dest;
-       tag    = 2001;
-       sprintf(data,"First message, type 2001");
-       count = strlen(data) + 1;
-       MPI_Isend( data, count, MPI_CHAR, to, tag, MPI_COMM_WORLD, &rq[0] );
-#ifdef VERBOSE 
-       printf("%d sent :%s:\n", rank, data );
-#endif
-       tag    = 2002;
-       sprintf(data,"Second message, type 2002");
-       count = strlen(data) + 1;
-       MPI_Isend( data, count, MPI_CHAR, to, tag, MPI_COMM_WORLD, &rq[1] );
-       MPI_Waitall( 2, rq, statuses );
-#ifdef VERBOSE 
-       printf("%d sent :%s:\n", rank, data );
-#endif
-    }
-    else
-    if (rank == dest)
-    {
-       if (waiter == dest)
-           sleep(10);
-       from  = MPI_ANY_SOURCE;
-       count = 100;            
-
-       tag   = 2002;
-       MPI_Recv(data, count, MPI_CHAR, from, tag, MPI_COMM_WORLD, &status ); 
-
-       MPI_Get_count( &status, MPI_CHAR, &st_count );
-       if (st_count != strlen("Second message, type 2002") + 1) {
-           printf( "Received wrong length!\n" );
-           }
-#ifdef VERBOSE 
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;
-       printf( "Status info: source = %d, tag = %d, count = %d\n",
-               st_source, st_tag, st_count );
-       printf( "%d received :%s:\n", rank, data);
-#endif
-       tag   = 2001;
-       MPI_Recv(data, count, MPI_CHAR, from, tag, MPI_COMM_WORLD, &status ); 
-
-       MPI_Get_count( &status, MPI_CHAR, &st_count );
-       if (st_count != strlen("First message, type 2001") + 1) {
-           printf( "Received wrong length!\n" );
-           }
-#ifdef VERBOSE 
-       st_source = status.MPI_SOURCE;
-       st_tag    = status.MPI_TAG;\
-       printf( "Status info: source = %d, tag = %d, count = %d\n",
-               st_source, st_tag, st_count );
-       printf( "%d received :%s:\n", rank, data);
-#endif
-    }
-#ifdef VERBOSE 
-    printf( "Process %d exiting\n", rank );
-#endif
-    Test_Waitforall( );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/trunc.c b/teshsuite/smpi/mpich-test/pt2pt/trunc.c
deleted file mode 100644 (file)
index d07993a..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * This file tests that message truncation errors are properly detected and
- * handled (in particular, that data is NOT overwritten).
- */
-
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-/* Prototypes for picky compilers */
-int SetupRecvBuf ( int * );
-int CheckRecvErr ( int, MPI_Status *, int *, const char * );
-
-int main( int argc, char **argv )
-{
-    int         err = 0, toterr;
-    int         world_rank;
-    MPI_Comm    comm, dupcomm;
-    int         rank, size;
-    int         partner, merr, flag;
-    MPI_Status  status;
-    MPI_Request request;
-    int         i, sendbuf[10], recvbuf[10];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-
-    comm = MPI_COMM_WORLD;
-    MPI_Comm_dup( comm, &dupcomm );
-    MPI_Comm_rank( comm, &rank );
-    MPI_Comm_size( comm, &size );
-
-/* We'll RECEIVE into rank 0, just to simplify any debugging.  The tests are
-   sender                                     receiver
-   send( count = 10 )                         recv(count = 1)
-   isend( count = 10 )
-   sendrecv                                   sendrecv
-   wait                                       recv(count=1) (unexpected recv)
-                                              irecv( count = 1)
-   sendrecv                                   sendrecv               
-   send( count = 10)                          wait (expected/err trunc)
-                                              irecv( count = 1)
-   sendrecv                                   sendrecv
-   send( count = 10)                          test (expected/err trunc)
- */
-   
-    if (size < 2) {
-       fprintf( stderr, "This test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    if (rank == 0) {
-       /* Only return on the RECEIVERS side */
-       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
-       partner = size - 1;
-       SetupRecvBuf( recvbuf );
-       merr = MPI_Recv( recvbuf, 1, MPI_INT, partner, 1, comm, &status );
-       err += CheckRecvErr( merr, &status, recvbuf, "Recv" );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-
-       SetupRecvBuf( recvbuf );
-       merr = MPI_Recv( recvbuf, 1, MPI_INT, partner, 2, comm, &status );
-       err += CheckRecvErr( merr, &status, recvbuf, "Unexpected Recv" );
-
-       SetupRecvBuf( recvbuf );
-       merr = MPI_Irecv( recvbuf, 1, MPI_INT, partner, 3, comm, &request );
-    
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       merr = MPI_Wait( &request, &status );
-       err += CheckRecvErr( merr, &status, recvbuf, "Irecv/Wait" );
-
-       SetupRecvBuf( recvbuf );
-       merr = MPI_Irecv( recvbuf, 1, MPI_INT, partner, 4, comm, &request );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       do { 
-           merr = MPI_Test( &request, &flag, &status );
-       } while (merr == 0 && flag == 0);
-       err += CheckRecvErr( merr, &status, recvbuf, "Irecv/Test" );
-    }
-    else if (rank == size - 1) {
-       partner = 0;
-       for (i=0; i<10; i++) 
-           sendbuf[i] = 100 + i;
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 1, comm );
-       MPI_Isend( sendbuf, 10, MPI_INT, partner, 2, comm, &request );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       MPI_Wait( &request, &status );
-
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 3, comm );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 4, comm );
-    }
-    MPI_Comm_free( &dupcomm );
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterr == 0) 
-           printf( " No Errors\n" );
-       else
-           printf( "Found %d errors in Truncated Message test\n", toterr );
-    }
-    MPI_Finalize( );
-    return toterr;
-}
-
-int SetupRecvBuf( recvbuf )
-int *recvbuf;
-{
-    int i;
-    for (i=0; i<10; i++) 
-       recvbuf[i] = i+1;
-    return 0;
-}
-
-int CheckRecvErr( merr, status, recvbuf, msg )
-int        merr, *recvbuf;
-MPI_Status *status;
-const char       *msg;
-{
-    int  class;
-    int  err = 0, rlen;
-    char buf[MPI_MAX_ERROR_STRING];
-
-/* Get the MPI Error class from merr */
-    MPI_Error_class( merr, &class );
-    switch (class) {
-    case MPI_ERR_TRUNCATE:
-       /* Check that data buf is ok */
-       if (recvbuf[1] != 2) {
-           err++;
-           fprintf( stderr, 
-                    "Receive buffer overwritten!  Found %d in 2nd pos.\n",
-                    recvbuf[1] );
-       }
-       break;
-
-    case MPI_ERR_IN_STATUS:
-       /* Check for correct message */
-       /* ERR IN STATUS is correct ONLY for multiple completion routines */
-/*     if (status->MPI_ERROR == MPI_ERR_TRUNCATE) 
-           break; */
-       /* Else, fall through into default... */
-    default:
-       /* Wrong error; get message and print */
-       MPI_Error_string( merr, buf, &rlen );
-       fprintf( stderr, 
-                "Got unexpected error message from %s: %s\n", msg, buf );
-       err++;
-    }
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/truncmult.c b/teshsuite/smpi/mpich-test/pt2pt/truncmult.c
deleted file mode 100644 (file)
index 7f1e68b..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * This file tests that message truncation errors are properly detected and
- * handled (in particular, that data is NOT overwritten).
- * 
- * This version checks the multiple completion routines
- */
-
-#include "mpi.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-/* Prototypes for picky compilers */
-int SetupRecvBuf ( int * );
-int CheckRecvErr ( int, MPI_Status *, int *, const char * );
-int CheckRecvOk  ( MPI_Status *, int *, int, const char * );
-
-int main( int argc, char **argv )
-{
-    int         err = 0, toterr;
-    int         world_rank;
-    MPI_Comm    comm, dupcomm;
-    int         rank, size;
-    int         partner, merr;
-    MPI_Status  statuses[4], status;
-    MPI_Request requests[4];
-    int         i, sendbuf[10],
-               recvbuf1[10], recvbuf2[10], recvbuf3[10], recvbuf4[10];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
-
-    comm = MPI_COMM_WORLD;
-    MPI_Comm_dup( comm, &dupcomm );
-    MPI_Comm_rank( comm, &rank );
-    MPI_Comm_size( comm, &size );
-
-/* We'll RECEIVE into rank 0, just to simplify any debugging.  Just in 
-   case the MPI implementation tests for errors when the irecv is issued,
-   we make sure that the matching sends don't occur until the receives
-   are posted.
-
-   sender                                     receiver
-                                              irecv(tag=1,count=1)
-                                             irecv(tag=2,count=1)
-   sendrecv                                   sendrecv
-   send(tag=1,count=1)                        
-   send(tag=2,count=10)
-                                              waitall()
-                                                error in status, err trunc
-                                                wait for tag = 1 if necessary
-   sendrecv                                   sendrecv
-   Ditto, but with 2 truncated messages
-   Ditto, but with testall. (not done yet)
-   All of the above, but with waitsome/testsome (not done yet)
- */
-   
-    if (rank == 0) {
-       /* Only return on the RECEIVERS side */
-       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
-       partner = size - 1;
-
-       SetupRecvBuf( recvbuf1 );
-       SetupRecvBuf( recvbuf2 );
-       merr = MPI_Irecv( recvbuf1, 1, MPI_INT, partner, 1, comm, 
-                         &requests[0] );  /* this will succeed */
-       merr = MPI_Irecv( recvbuf2, 1, MPI_INT, partner, 2, comm, 
-                         &requests[1] );  /* this will fail */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       merr = MPI_Waitall( 2, requests, statuses );
-       if (merr != MPI_ERR_IN_STATUS) {
-           err++;
-           fprintf( stderr, "Did not return MPI_ERR_IN_STATUS\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       if (statuses[0].MPI_ERROR == MPI_ERR_PENDING) {
-           /* information - first send is not yet complete */
-           if ((statuses[0].MPI_ERROR = MPI_Wait( &requests[0], &statuses[0] )) == MPI_SUCCESS) {
-               err++;
-               fprintf( stderr, "failed to complete legal request (1)\n" );
-           }
-       }
-       if (statuses[0].MPI_ERROR != MPI_SUCCESS) {
-           err ++;
-           fprintf( stderr, "Could not complete legal send-receive\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       err += CheckRecvErr( merr, &statuses[1], recvbuf2, "Irecv" );
-
-       SetupRecvBuf( recvbuf1 );
-       SetupRecvBuf( recvbuf2 );
-       SetupRecvBuf( recvbuf3 );
-       SetupRecvBuf( recvbuf4 );
-       merr = MPI_Irecv( recvbuf1, 1, MPI_INT, partner, 1, comm, 
-                         &requests[0] );  /* this will succeed */
-       merr = MPI_Irecv( recvbuf2, 1, MPI_INT, partner, 2, comm, 
-                         &requests[1] );  /* this will fail */
-       merr = MPI_Irecv( recvbuf3, 1, MPI_INT, partner, 3, comm, 
-                         &requests[2] );  /* this will fail */
-       merr = MPI_Irecv( recvbuf4, 1, MPI_INT, partner, 4, comm, 
-                         &requests[3] );  /* this will succeed */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       merr = MPI_Waitall( 4, requests, statuses );
-       if (merr != MPI_ERR_IN_STATUS) {
-           err++;
-           fprintf( stderr, "Did not return MPI_ERR_IN_STATUS (4)\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       if (statuses[0].MPI_ERROR == MPI_ERR_PENDING) {
-           /* information - first send is not yet complete */
-           if ((statuses[0].MPI_ERROR = MPI_Wait( &requests[0], &statuses[0] )) != MPI_SUCCESS) {
-               err++;
-               fprintf( stderr, "failed to complete legal request (1a)\n" );
-           }
-       }
-       /* Check for correct completion */
-       err += CheckRecvOk( &statuses[0], recvbuf1, 1, "4-1" );
-
-       if (statuses[3].MPI_ERROR == MPI_ERR_PENDING) {
-           /* information - first send is not yet complete */
-           if ((statuses[3].MPI_ERROR = MPI_Wait( &requests[3], &statuses[3] )) != MPI_SUCCESS) {
-               err++;
-               fprintf( stderr, "failed to complete legal request (3a)\n" );
-           }
-       }
-       /* Check for correct completion */
-       err += CheckRecvOk( &statuses[3], recvbuf4, 4, "4-4" );
-
-       if (statuses[0].MPI_ERROR != MPI_SUCCESS) {
-           err ++;
-           fprintf( stderr, "Could not complete legal send-receive-0\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       if (statuses[3].MPI_ERROR != MPI_SUCCESS) {
-           err ++;
-           fprintf( stderr, "Could not complete legal send-receive-3\n" );
-           MPI_Abort( MPI_COMM_WORLD, 1 );
-       }
-       
-       if (statuses[1].MPI_ERROR == MPI_ERR_PENDING) {
-           statuses[1].MPI_ERROR = MPI_Wait( &requests[1], &statuses[1] );
-       }
-       err += CheckRecvErr( merr, &statuses[1], recvbuf2, "Irecv-2" );
-       if (statuses[2].MPI_ERROR == MPI_ERR_PENDING) {
-           statuses[2].MPI_ERROR = MPI_Wait( &requests[2], &statuses[2] );
-       }
-       err += CheckRecvErr( merr, &statuses[2], recvbuf3, "Irecv-3" );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-    }
-    else if (rank == size - 1) {
-       partner = 0;
-       for (i=0; i<10; i++) 
-           sendbuf[i] = 100 + i;
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       MPI_Send( sendbuf, 1, MPI_INT, partner, 1, comm );
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 2, comm );
-
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-       MPI_Send( sendbuf, 1, MPI_INT, partner, 1, comm );
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 2, comm );
-       MPI_Send( sendbuf, 10, MPI_INT, partner, 3, comm );
-       MPI_Send( sendbuf, 1, MPI_INT, partner, 4, comm );
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     MPI_BOTTOM, 0, MPI_INT, partner, 0,
-                     dupcomm, &status );
-    }
-    MPI_Comm_free( &dupcomm );
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (world_rank == 0) {
-       if (toterr == 0) 
-           printf( " No Errors\n" );
-       else
-           printf( "Found %d errors in Truncated Message Multiple Completion test\n", toterr );
-    }
-    MPI_Finalize( );
-    return toterr;
-}
-
-int SetupRecvBuf( recvbuf )
-int *recvbuf;
-{
-    int i;
-    for (i=0; i<10; i++) 
-       recvbuf[i] = i+1;
-    return 0;
-}
-
-int CheckRecvOk( status, recvbuf, tag, msg )
-int        *recvbuf, tag;
-MPI_Status *status;
-const char       *msg;
-{
-    int err = 0, count;
-
-    if (status->MPI_TAG != tag) {
-       err++;
-       fprintf( stderr, "Wrong tag; was %d should be %d (%s)\n", 
-                status->MPI_TAG, tag, msg );
-    }
-    MPI_Get_count( status, MPI_INT, &count );
-    if (count != 1) {
-       err++;
-       fprintf( stderr, "Wrong count; was %d expected 1 (%s)\n", count, msg );
-    }
-    return err;
-}
-
-int CheckRecvErr( merr, status, recvbuf, msg )
-int        merr, *recvbuf;
-MPI_Status *status;
-const char       *msg;
-{
-    int  class;
-    int  err = 0, rlen;
-    char buf[MPI_MAX_ERROR_STRING];
-
-/* Get the MPI Error class from merr */
-    MPI_Error_class( merr, &class );
-    switch (class) {
-    case MPI_ERR_TRUNCATE:
-       /* Check that data buf is ok */
-       if (recvbuf[1] != 2) {
-           err++;
-           fprintf( stderr, 
-                    "Receive buffer overwritten!  Found %d in 2nd pos.\n",
-                    recvbuf[1] );
-       }
-       break;
-
-    case MPI_ERR_IN_STATUS:
-       /* Check for correct message */
-        MPI_Error_class(status->MPI_ERROR, &class);
-       if (class != MPI_ERR_TRUNCATE) {
-           MPI_Error_string( status->MPI_ERROR, buf, &rlen );
-           fprintf( stderr, 
-                "Unexpected error message for err in status for %s: %s\n", 
-                msg, buf );
-       }
-       break;
-    default:
-       /* Wrong error; get message and print */
-       MPI_Error_string( merr, buf, &rlen );
-       fprintf( stderr, 
-                "Got unexpected error message from %s: %s\n", msg, buf );
-       err++;
-    }
-    return err;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typebase.c b/teshsuite/smpi/mpich-test/pt2pt/typebase.c
deleted file mode 100644 (file)
index bdd784a..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- */
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-/* 
- * This program checks that the type inquiry routines work with the 
- * basic types
- */
-
-#define MAX_TYPES 14
-static int ntypes;
-static MPI_Datatype BasicTypes[MAX_TYPES];
-static char         *(BasicTypesName[MAX_TYPES]);
-static int          BasicSizes[MAX_TYPES];
-
-/* Prototypes for picky compilers */
-void SetupBasicTypes (void);
-
-void 
-SetupBasicTypes()
-{
-    BasicTypes[0] = MPI_CHAR;
-    BasicTypes[1] = MPI_SHORT;
-    BasicTypes[2] = MPI_INT;
-    BasicTypes[3] = MPI_LONG;
-    BasicTypes[4] = MPI_UNSIGNED_CHAR;
-    BasicTypes[5] = MPI_UNSIGNED_SHORT;
-    BasicTypes[6] = MPI_UNSIGNED;
-    BasicTypes[7] = MPI_UNSIGNED_LONG;
-    BasicTypes[8] = MPI_FLOAT;
-    BasicTypes[9] = MPI_DOUBLE;
-
-    BasicTypesName[0] = (char*)"MPI_CHAR";
-    BasicTypesName[1] = (char*)"MPI_SHORT";
-    BasicTypesName[2] = (char*)"MPI_INT";
-    BasicTypesName[3] = (char*)"MPI_LONG";
-    BasicTypesName[4] = (char*)"MPI_UNSIGNED_CHAR";
-    BasicTypesName[5] = (char*)"MPI_UNSIGNED_SHORT";
-    BasicTypesName[6] = (char*)"MPI_UNSIGNED";
-    BasicTypesName[7] = (char*)"MPI_UNSIGNED_LONG";
-    BasicTypesName[8] = (char*)"MPI_FLOAT";
-    BasicTypesName[9] = (char*)"MPI_DOUBLE";
-
-    BasicSizes[0] = sizeof(char);
-    BasicSizes[1] = sizeof(short);
-    BasicSizes[2] = sizeof(int);
-    BasicSizes[3] = sizeof(long);
-    BasicSizes[4] = sizeof(unsigned char);
-    BasicSizes[5] = sizeof(unsigned short);
-    BasicSizes[6] = sizeof(unsigned);
-    BasicSizes[7] = sizeof(unsigned long);
-    BasicSizes[8] = sizeof(float);
-    BasicSizes[9] = sizeof(double);
-
-    ntypes = 10;
-#ifdef HAVE_LONG_DOUBLE
-    BasicTypes[ntypes] = MPI_LONG_DOUBLE;
-    BasicSizes[ntypes] = sizeof(long double);
-    BasicTypesName[ntypes] = (char*)"MPI_LONG_DOUBLE";
-    ntypes++;
-#endif
-    BasicTypes[ntypes] = MPI_BYTE;
-    BasicSizes[ntypes] = sizeof(unsigned char);
-    BasicTypesName[ntypes] = (char*)"MPI_BYTE";
-    ntypes++;
-
-#ifdef HAVE_LONG_LONG_INT
-    BasicTypes[ntypes] = MPI_LONG_LONG_INT;
-    BasicSizes[ntypes] = sizeof(long long);
-    BasicTypesName[ntypes] = "MPI_LONG_LONG_INT";
-    ntypes++;
-#endif
-    }
-
-int main( int argc, char **argv )
-{
-int      i, errs;
-int      size;
-MPI_Aint extent, lb, ub;
-MPI_Init( &argc, &argv );
-
-/* This should be run by a single process */
-
-SetupBasicTypes();
-
-errs = 0;
-for (i=0; i<ntypes; i++) {
-    MPI_Type_size( BasicTypes[i], &size );
-    MPI_Type_extent( BasicTypes[i], &extent );
-    MPI_Type_lb( BasicTypes[i], &lb );
-    MPI_Type_ub( BasicTypes[i], &ub );
-    if (size != extent) {
-       errs++;
-       printf( "size (%d) != extent (%ld) for basic type %s\n", size, 
-               (long) extent, BasicTypesName[i] );
-       }
-    if (size != BasicSizes[i]) {
-       errs++;
-       printf( "size(%d) != C size (%d) for basic type %s\n", size, 
-              BasicSizes[i], BasicTypesName[i] );
-       }
-    if (lb != 0) {
-       errs++;
-       printf( "Lowerbound of %s was %d instead of 0\n", 
-               BasicTypesName[i], (int)lb );
-       }
-    if (ub != extent) {
-       errs++;
-       printf( "Upperbound of %s was %d instead of %d\n", 
-               BasicTypesName[i], (int)ub, (int)extent );
-       }
-    }
-
-if (errs) {
-    printf( "Found %d errors in testing C types\n", errs );
-    }
-else {
-    printf( "Found no errors in basic C types\n" );
-    }
-
-MPI_Finalize( );
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typebase.std b/teshsuite/smpi/mpich-test/pt2pt/typebase.std
deleted file mode 100644 (file)
index 409e123..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Found no errors in basic C types
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typebasef.f b/teshsuite/smpi/mpich-test/pt2pt/typebasef.f
deleted file mode 100644 (file)
index 3bb6a24..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-C
-C Fortran program to test the basic Fortran types
-C 
-      subroutine SetupBasicTypes( basictypes, basicnames )
-      include 'mpif.h'
-      integer basictypes(*)
-      character*40 basicnames(*)
-C
-      basictypes(1) = MPI_INTEGER
-      basictypes(2) = MPI_REAL
-      basictypes(3) = MPI_DOUBLE_PRECISION
-      basictypes(4) = MPI_COMPLEX
-      basictypes(5) = MPI_LOGICAL
-      basictypes(6) = MPI_CHARACTER
-      basictypes(7) = MPI_BYTE
-      basictypes(8) = MPI_PACKED
-C      
-      basicnames(1) = 'INTEGER'
-      basicnames(2) = 'REAL'
-      basicnames(3) = 'DOUBLE PRECISION'
-      basicnames(4) = 'COMPLEX'
-      basicnames(5) = 'LOGICAL'
-      basicnames(6) = 'CHARACTER'
-      basicnames(7) = 'BYTE'
-      basicnames(8) = 'PACKED'
-C
-      return
-      end
-C
-      program main
-      include 'mpif.h'
-      integer basictypes(8)
-      character*40 basicnames(8)
-      integer i, errcnt, ierr
-      integer size, extent, ub, lb
-C
-      call mpi_init(ierr)
-C
-      call SetupBasicTypes( basictypes, basicnames )
-C
-      errcnt = 0
-      do 10 i=1,8 
-         call MPI_Type_size( BasicTypes(i), size, ierr )
-         call MPI_Type_extent( BasicTypes(i), extent, ierr )
-         call MPI_Type_lb( BasicTypes(i), lb, ierr )
-         call MPI_Type_ub( BasicTypes(i), ub, ierr )
-         if (size .ne. extent) then
-           errcnt = errcnt + 1
-            print *, "size (", size, ") != extent (", extent, 
-     *         ") for basic type ", basicnames(i)
-        endif
-         if (lb .ne. 0) then
-            errcnt = errcnt + 1
-            print *, "Lowerbound of ", basicnames(i), " was ", lb, 
-     *         " instead of 0" 
-         endif
-         if (ub .ne. extent) then
-            errcnt = errcnt + 1
-            print *, "Upperbound of ", basicnames(i), " was ",
-     *        ub, " instead of ", extent
-         endif
- 10   continue
-C
-      if (errcnt .gt. 0) then
-         print *, "Found ", errcnt, " errors in testing Fortran types"
-      else
-         print *, " Found no errors in basic Fortran "
-      endif
-C
-      call mpi_finalize(ierr)
-      end
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typecreate.c b/teshsuite/smpi/mpich-test/pt2pt/typecreate.c
deleted file mode 100644 (file)
index bc606b5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include "mpi.h"
-#include "test.h"
-#include <stdlib.h>
-
-int main( int argc, char **argv )
-{
-    int i, n, n_goal = 2048, rc, len;
-    MPI_Datatype *type_array;
-    char msg[MPI_MAX_ERROR_STRING];
-
-    MPI_Init( &argc, &argv );
-    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
-
-    n = n_goal;
-
-    type_array = (MPI_Datatype *)malloc( n * sizeof(MPI_Datatype) );
-    
-    for (i=0; i<n; i++) {
-       int             blens[2];
-       MPI_Aint        displ[2];
-       MPI_Datatype    types[2];
-
-       blens[0] = 2;
-       blens[1] = 3;
-       displ[0] = 0;
-       displ[1] = (i+2) * sizeof(int);
-       types[0] = MPI_INT;
-       types[1] = MPI_DOUBLE;
-       rc = MPI_Type_struct( 2, blens, displ, types, type_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when creating type number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-       rc = MPI_Type_commit( type_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when commiting type number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           n = i + 1;
-           break;
-       }
-    }
-    for (i=0; i<n; i++) {
-       rc = MPI_Type_free( type_array + i );
-       if (rc) {
-           fprintf( stderr, "Error when freeing type number %d\n", i );
-           MPI_Error_string( rc, msg, &len );
-           fprintf( stderr, "%s\n", msg );
-           break;
-       }
-    }
-    free( type_array );
-    printf( "Completed test of %d type creations\n", n );
-    if (n != n_goal) {
-       printf (
-"This MPI implementation limits the number of datatypes that can be created\n\
-This is allowed by the standard and is not a bug, but is a limit on the\n\
-implementation\n" );
-    }
-    MPI_Finalize( );
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typecreate.std b/teshsuite/smpi/mpich-test/pt2pt/typecreate.std
deleted file mode 100644 (file)
index 2e09a88..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Completed test of 2048 type creations
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typetest.c b/teshsuite/smpi/mpich-test/pt2pt/typetest.c
deleted file mode 100644 (file)
index 593728c..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/* 
- * Patrick Bridges * bridges@mcs.anl.gov * patrick@CS.MsState.Edu 
- *
- * Modified by William Gropp
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "test.h"
-#include "mpi.h"
-#include <string.h>
-/* CM5 users need to comment out the next include (memory.h) because 
-   of an error in the CM5 include file (memory.h is inconsistent with
-   string.h) */
-/* #include <memory.h> */
-
-struct struct1 {
-    double d1;
-    char   c1[8];
-};
-
-
-struct struct2 {
-    double d1;
-    double d2;
-    char   c1[8];
-    char   c2[8];
-    double d3;
-    char   c3[8];
-    double d4;
-    char   c4[8];
-};
-
-struct struct3 {
-    double d1[2];
-    char  c1[2][8];
-    struct struct1 s1[2];
-};
-
-/* Structure with probable gap */
-struct struct4 {
-    int a1;
-    char c1, c2;
-    int a2;
-};   
-
-int main( int argc, char **argv )
-{
-    int rank, size, ret; 
-    MPI_Status Status;
-    MPI_Datatype struct1_t, struct2_t, struct3_t, struct4_t, struct4a_t,
-       astruct1_t, carray_t;
-    static int block1[2] = {1, 1};
-    static int block2[6] = {2, 2, 1, 1, 1, 1};
-    static int block3[3] = {2, 2, 1};
-    static int block4[4] = {1, 1, 1, 1};
-    static int block4a[3] = {1, 2, 1};
-    MPI_Aint disp1[2], disp2[6], disp3[6], disp4[4], disp4a[3];
-    MPI_Datatype type1[2], type2[6], type3[3];
-    MPI_Datatype type4[4] = {MPI_INT, MPI_CHAR, MPI_CHAR, MPI_INT};
-    MPI_Datatype type4a[3] = {MPI_INT, MPI_CHAR, MPI_INT};
-    struct struct1 dummy1;
-    struct struct2 dummy2;
-    struct struct3 dummy3;
-    struct struct4 dummy4;
-    int i, master_rank = 0, slave_rank = 1;
-
-    MPI_Init(&argc, &argv);
-    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    MPI_Comm_size(MPI_COMM_WORLD, &size);
-
-    for (i=1; i<argc; i++) {
-       if (argv[i] && strcmp("-alt",argv[i]) == 0) {
-           master_rank = 1;
-           slave_rank  = 0;
-           printf( "[%d] setting master rank to 1\n", rank );
-           }
-       }
-
-    Test_Init("typetest", rank);
-
-    /* Create some types to try out */
-
-    /* A simple array of characters */ 
-    MPI_Type_contiguous(8, MPI_CHAR, &carray_t); 
-    ret = MPI_Type_commit(&carray_t);
-    if (ret != MPI_SUCCESS) {
-       fprintf(stderr, "Could not make char array type."), fflush(stderr); 
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* A fairly simple structure */
-    MPI_Address( &dummy1, &disp1[0] );
-    MPI_Address( &dummy1.c1[0], &disp1[1] );
-    disp1[1] = disp1[1] - disp1[0];
-    disp1[0] = 0;
-    type1[0] = MPI_DOUBLE;
-    type1[1] = carray_t;
-    MPI_Type_struct(2, block1, disp1, type1, &struct1_t);
-    ret = MPI_Type_commit(&struct1_t);
-    if (ret != MPI_SUCCESS) {
-       fprintf(stderr, "Could not make struct 1."); fflush(stderr); 
-        MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* And a short array of this type */
-    MPI_Type_contiguous(2, struct1_t, &astruct1_t);
-    ret = MPI_Type_commit(&astruct1_t);
-    if (ret != MPI_SUCCESS) {
-       fprintf(stderr, "Could not make struct 1 array."); fflush(stderr);
-        MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    
-    /* A more complex structure */
-    MPI_Address( &dummy2, &disp2[0] );
-    MPI_Address( &dummy2.c1[0], &disp2[1] );
-    MPI_Address( &dummy2.d3, &disp2[2] );
-    MPI_Address( &dummy2.c3[0], &disp2[3] );
-    MPI_Address( &dummy2.d4, &disp2[4] );
-    MPI_Address( &dummy2.c4[0], &disp2[5] );
-    for (i=1; i<6; i++) {
-      disp2[i] = disp2[i] - disp2[0];
-    }
-    disp2[0] = 0;                    
-    type2[0] = MPI_DOUBLE; type2[1] = carray_t; type2[2] = MPI_DOUBLE;
-    type2[3] = carray_t; type2[4] = MPI_DOUBLE; type2[5] = carray_t;
-    MPI_Type_struct(6, block2, disp2, type2, &struct2_t);
-    ret = MPI_Type_commit(&struct2_t);
-    if (ret != MPI_SUCCESS) {
-       fprintf(stderr, "Could not make struct 2."), fflush(stderr);
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* Another (hopefully compatible) complex structure */
-    MPI_Address( &dummy3, &disp3[0] );
-    MPI_Address( &dummy3.c1[0][0], &disp3[1] );
-    MPI_Address( &dummy3.s1[0], &disp3[2] );
-    for (i=1; i<3; i++) 
-      disp3[i] = disp3[i] - disp3[0];
-    disp3[0] = 0; 
-    type3[0] = MPI_DOUBLE; type3[1] = carray_t; type3[2] = astruct1_t;
-    MPI_Type_struct(3, block3, disp3, type3, &struct3_t);
-    ret = MPI_Type_commit(&struct3_t);
-    if (ret != MPI_SUCCESS) {
-       fprintf(stderr, "Could not make struct 3."), fflush(stderr);
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-
-    /* A structure with gaps (invokes padding) */
-    MPI_Address( &dummy4.a1, &disp4[0] );
-    MPI_Address( &dummy4.c1, &disp4[1] );
-    MPI_Address( &dummy4.c2, &disp4[2] );
-    MPI_Address( &dummy4.a2, &disp4[3] );
-    for (i=1; i<4; i++) 
-       disp4[i] = disp4[i] - disp4[0];
-    disp4[0] = 0;
-    MPI_Type_struct(4, block4, disp4, type4, &struct4_t);
-    ret = MPI_Type_commit(&struct4_t);
-
-
-    MPI_Address( &dummy4.a1, &disp4a[0] );
-    MPI_Address( &dummy4.c1, &disp4a[1] );
-    MPI_Address( &dummy4.a2, &disp4a[2] );
-    for (i=1; i<3; i++) 
-       disp4a[i] = disp4a[i] - disp4a[0];
-    disp4a[0] = 0;
-    MPI_Type_struct(3, block4a, disp4a, type4a, &struct4a_t);
-    ret = MPI_Type_commit(&struct4a_t);
-
-    /* Wait for everyone to be ready */
-    MPI_Barrier(MPI_COMM_WORLD);
-    if (rank == master_rank) {         
-
-       /* Fill up the type */
-       dummy2.d1 = 11.0; dummy2.d2 = 12.0; dummy2.d3 = 13.0; dummy2.d4 = 14.0;
-       strncpy(dummy2.c1, "two", 8);
-       strncpy(dummy2.c2, "four", 8);
-       strncpy(dummy2.c3, "six", 8);
-       strncpy(dummy2.c4, "eight", 8);
-       
-       /* Send the type */
-       MPI_Send(&dummy2, 1, struct2_t, slave_rank, 2000, MPI_COMM_WORLD);
-       /* Clear out the type */
-       memset(&dummy2, 0, sizeof(dummy2));
-       /* And receive it back */
-       MPI_Recv(&dummy2, 1, struct2_t, slave_rank, 2000, MPI_COMM_WORLD, 
-                &Status);
-       
-       /* Did it make it OK? */
-       if ((dummy2.d1 != 11.0) || (dummy2.d2 != 12.0) || 
-           (dummy2.d3 != 13.0) || (dummy2.d4 != 14.0) || 
-           strncmp(dummy2.c1, "two", 8) || strncmp(dummy2.c2, "four", 8) || 
-           strncmp(dummy2.c3, "six", 8) || strncmp(dummy2.c4, "eight", 8)) {
-           Test_Failed("Complex Type Round Trip Test");
-#ifdef MPE_USE_EXTENSIONS
-           printf( "Pack action is\n" );
-           MPIR_PrintDatatypePack( stdout, 1, struct2_t, (long)&dummy2, 0 );
-           printf( "Unpack action is\n" );
-           MPIR_PrintDatatypeUnpack( stdout, 1, struct2_t, 0, (long)&dummy2 );
-#endif
-       } else {
-           Test_Passed("Complex Type Round Trip Test");
-       }
-
-
-       /* Fill up the type again */
-       dummy2.d1 = 11.0; dummy2.d2 = 12.0; dummy2.d3 = 13.0; dummy2.d4 = 14.0;
-       strncpy(dummy2.c1, "two", 8);
-       strncpy(dummy2.c2, "four", 8);
-       strncpy(dummy2.c3, "six", 8);
-       strncpy(dummy2.c4, "eight", 8);
-       
-       /* Send the type */
-       MPI_Send(&dummy2, 1, struct2_t, slave_rank, 2000, MPI_COMM_WORLD);
-       /* Clear out the type */
-       memset(&dummy2, 0, sizeof(dummy2));
-       /* And receive it back */
-       MPI_Recv(&dummy2, 1, struct2_t, slave_rank, 2000, MPI_COMM_WORLD, 
-                &Status);
-       
-       /* Did it make it OK? */
-       if ((dummy2.d1 != 11.0) || (dummy2.d2 != 12.0) || 
-           (dummy2.d3 != 13.0) || (dummy2.d4 != 14.0) || 
-           strncmp(dummy2.c1, "two", 8) || strncmp(dummy2.c2, "four", 8) || 
-           strncmp(dummy2.c3, "six", 8) || strncmp(dummy2.c4, "eight", 8))
-           Test_Failed("Compatible Complex Type Round Trip Test");
-       else
-           Test_Passed("Compatible Complex Type Round Trip Test");
-
-       /* Expect ints to be at least 4 bytes.  Make sure that the MSbit is
-          0 so that there are no sign-extension suprises. */
-       dummy4.a1 = 0x17faec2b;
-       dummy4.c1 = 'c';
-       dummy4.c2 = 'F';
-       dummy4.a2 = 0x91fb8354;
-       MPI_Send( &dummy4, 1, struct4_t, slave_rank, 2004, MPI_COMM_WORLD );
-       memset( &dummy4, 0, sizeof(dummy4) );
-       MPI_Recv( &dummy4, 1, struct4a_t, slave_rank, 2004, MPI_COMM_WORLD, 
-                 &Status );
-       /* Check for correct data */
-       if (dummy4.a1 != 0x17faec2b || dummy4.c1 != 'c' ||
-           dummy4.c2 != 'F' || dummy4.a2 != 0x91fb8354) {
-           Test_Failed( "Padded Structure Type Round Trip Test" );
-           }
-       else {
-           Test_Passed( "Padded Structure Type Round Trip Test" );
-           }
-
-       if ((MPI_Type_free(&struct3_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct1_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct2_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct4_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct4a_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&astruct1_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&carray_t) != MPI_SUCCESS))
-           Test_Failed("Type Free test");
-       else
-           Test_Passed("Type Free test");
-       
-       Test_Waitforall( );
-    } else {
-       MPI_Recv(&dummy2, 1, struct2_t, master_rank, 2000, 
-                MPI_COMM_WORLD, &Status);
-       MPI_Send(&dummy2, 1, struct2_t, master_rank, 2000, MPI_COMM_WORLD);
-
-       MPI_Recv(&dummy3, 1, struct3_t, master_rank, 2000, MPI_COMM_WORLD, 
-                &Status);
-       if ((dummy3.d1[0] != 11.0) || (dummy3.d1[1] != 12.0) || 
-           (dummy3.s1[0].d1 != 13.0) || (dummy3.s1[1].d1 != 14.0) || 
-           strncmp(dummy3.c1[0], "two", 8) || 
-           strncmp(dummy3.c1[1], "four", 8) || 
-           strncmp(dummy3.s1[0].c1, "six", 8) || 
-           strncmp(dummy3.s1[1].c1, "eight", 8)) {
-
-           /* Kill dummy3 so it will die after it's sent back */
-           memset(&dummy3, 0, sizeof(dummy3));
-           Test_Message("Message didn't convert properly. Hosing \
-return message.");
-       }
-       MPI_Send(&dummy3, 1, struct3_t, master_rank, 2000, MPI_COMM_WORLD);
-
-       /* Use same structure type */
-       MPI_Recv( &dummy4, 1, struct4_t, master_rank, 2004, MPI_COMM_WORLD, 
-                 &Status );
-       MPI_Send( &dummy4, 1, struct4_t, master_rank, 2004, MPI_COMM_WORLD );
-
-       if ((MPI_Type_free(&struct3_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct1_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct2_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct4_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&struct4a_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&astruct1_t) != MPI_SUCCESS) ||
-           (MPI_Type_free(&carray_t) != MPI_SUCCESS))
-           Test_Failed("Type Free test");
-       else
-           Test_Passed("Type Free test");
-
-       Test_Waitforall( );
-    }
-
-    if (rank == master_rank) {         
-       (void)Summarize_Test_Results();
-       }
-
-    Test_Finalize();
-    MPI_Finalize();
-
-return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typeub.c b/teshsuite/smpi/mpich-test/pt2pt/typeub.c
deleted file mode 100644 (file)
index 56b7660..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#include <math.h>
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-/*
- *     Trying to manipulate the extent of a datatype with succesive
- *     calls to MPI_Type_struct.  Tests that a MPI_UB buried within
- *      a structure is found.  From kalns@canidae.cps.msu.edu (modified to
- *      fit test structure).
- */
-int main( int argc, char **argv )
-{
-   int          errs = 0, toterrs, rank; 
-   MPI_Aint    extent;
-   int         blens[2];
-   MPI_Aint    displ[2];
-   MPI_Datatype types[2];
-   MPI_Datatype type1,type2,type3;
-   MPI_Aint     extent1, extent2, extent3;
-
-   MPI_Init( &argc, &argv );
-
-  /*   2 blocks of 1 int each, stride of 4 ; expect extent to be 20
-   */
-   MPI_Type_vector( 2, 1, 4, MPI_INT, &type1 );
-   MPI_Type_commit( &type1 );
-   MPI_Type_extent( type1, &extent );
-   extent1 = 5 * sizeof(int);
-   if (extent != extent1) {
-       errs++;
-       printf("extent(type1)=%ld\n",(long)extent);
-       }
-
-   blens[0]=1;
-   blens[1]=1;
-   displ[0]=0;
-   displ[1]=sizeof(int)*4;
-   types[0]=type1;
-   types[1]=MPI_UB;
-   extent2 = displ[1];
-
-  /*   using MPI_UB and Type_struct, monkey with the extent, making it 16
-   */
-   MPI_Type_struct( 2, blens, displ, types, &type2 );
-   MPI_Type_commit( &type2 );
-   MPI_Type_extent( type2, &extent );
-   if (extent != extent2) {
-       errs++;
-       printf("extent(type2)=%ld\n",(long)extent);
-       }
-
-  /*   monkey with the extent again, making it 4
-   *   ===> MPICH gives 4      
-   *   ===> MPIF gives 16, the old extent      
-   */
-   displ[1]=sizeof(int);
-   types[0]=type2;
-   types[1]=MPI_UB;
-   extent3 = extent2;
-
-   MPI_Type_struct( 2, blens, displ, types, &type3 );
-   MPI_Type_commit( &type3 );
-
-   MPI_Type_extent( type3, &extent );
-   if (extent != extent3 && extent != 4) {
-       errs++;
-       printf("extent(type3)=%ld\n",(long)extent);
-       }
-
-   MPI_Type_free( &type1 );
-   MPI_Type_free( &type2 );
-   MPI_Type_free( &type3 );
-
-   MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-   MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-   if (rank == 0) {
-       if (toterrs == 0) printf( " No Errors\n" );
-       else              printf( "Found %d errors\n", toterrs );
-   }
-
-
-   MPI_Finalize();
-   return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typeub2.c b/teshsuite/smpi/mpich-test/pt2pt/typeub2.c
deleted file mode 100644 (file)
index 68951f2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-int main( int argc, char *argv[] )
-{
-    MPI_Datatype dt1, dt2, dt3;
-    MPI_Aint     ex1, ex2, ex3;
-    int          sz1, sz2, sz3;
-    MPI_Aint     lb,ub;
-    MPI_Aint     disp[3];
-    MPI_Datatype types[3];
-    int          blocklen[3];
-    MPI_Init(&argc, &argv);
-    blocklen[0] = 1;    blocklen[1] = 1;        blocklen[2] = 1;
-    disp[0] = -3;       disp[1] = 0;            disp[2] = 6;
-    types[0] = MPI_LB;  types[1] = MPI_INT;     types[2] = MPI_UB;
-    MPI_Type_struct(3,blocklen,disp, types,&dt1);
-    MPI_Type_commit(&dt1);
-        MPI_Type_lb(dt1, &lb);          MPI_Type_ub(dt1, &ub);
-        MPI_Type_extent(dt1,&ex1);      MPI_Type_size(dt1,&sz1);
-
-       /* Values should be lb = -3, ub = 6 extent 9; 
-          size depends on implementation */
-       if (lb != -3 || ub != 6 || ex1 != 9) {
-           printf("Example 3.26 type1 lb %d ub %d extent %d size %d\n",
-                  (int)lb, (int)ub, (int)ex1, sz1);
-       }
-       else 
-           printf("Example 3.26 type1 correct\n" );
-    MPI_Type_contiguous(2,dt1,&dt2);
-        MPI_Type_lb(dt2, &lb);          MPI_Type_ub(dt2, &ub);
-        MPI_Type_extent(dt2,&ex2);      MPI_Type_size(dt2,&sz2);
-       /* Values should be lb = -3, ub = 15, extent = 18, size
-          depends on implementation */
-       if (lb != -3 || ub != 15 || ex2 != 18) {
-           printf("Example 3.26 type2 lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex2, sz2);
-       }
-       else 
-           printf( "Example 3.26 type2 correct\n" );
-    types[0]=dt1;               types[1]=dt1;
-    blocklen[0]=1;              blocklen[1]=1;
-    disp[0]=0;                  disp[1]=ex1;
-    MPI_Type_struct(2, blocklen, disp, types, &dt3);
-    MPI_Type_commit(&dt3);
-        MPI_Type_lb(dt3, &lb);          MPI_Type_ub(dt3, &ub);
-        MPI_Type_extent(dt3,&ex3);      MPI_Type_size(dt3,&sz3);
-       /* Another way to express type2 */
-       if (lb != -3 || ub != 15 || ex3 != 18) {
-           printf("type3 lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex3, sz2);
-       }
-       else 
-           printf( "type3 correct\n" );
-    MPI_Type_free( &dt1 );
-    MPI_Type_free( &dt2 );
-    MPI_Type_free( &dt3 );
-       
-    MPI_Finalize();
-    return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typeub2.std b/teshsuite/smpi/mpich-test/pt2pt/typeub2.std
deleted file mode 100644 (file)
index 52c4c6c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Example 3.26 type1 correct
-Example 3.26 type2 correct
-type3 correct
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typeub3.c b/teshsuite/smpi/mpich-test/pt2pt/typeub3.c
deleted file mode 100644 (file)
index 8cc3ea5..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/* This test checks that all of the MPI Type routines correctly compute 
-   the UB and LB of a datatype from the greatest/least instance */
-
-#include "mpi.h"
-#include <stdio.h>
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-int main( int argc, char *argv[] )
-{
-    MPI_Datatype dt1, dt2, dt3, dt4, dt5;
-    MPI_Aint     ex;
-    int          sz;
-    MPI_Aint     lb,ub;
-    MPI_Aint     disp[3];
-    MPI_Datatype types[3];
-    int          blocklen[3];
-    int          idisp[3];
-
-    MPI_Init(&argc, &argv);
-
-    /* Create a datatype with explicit LB and UB */
-    blocklen[0] = 1;    blocklen[1] = 1;        blocklen[2] = 1;
-    disp[0] = -3;       disp[1] = 0;            disp[2] = 6;
-    types[0] = MPI_LB;  types[1] = MPI_INT;     types[2] = MPI_UB;
-    /* Generate samples for contiguous, hindexed, hvector, indexed, 
-       and vector (struct and contiguous tested in typeub2) */
-
-    MPI_Type_struct(3,blocklen,disp, types,&dt1);
-    MPI_Type_commit(&dt1);
-
-    /* This type is the same as in typeub2, and is tested there */
-    
-    types[0]=dt1;               types[1]=dt1;
-    blocklen[0]=1;              blocklen[1]=1;
-    disp[0]=-4;                 disp[1]=7;
-    idisp[0]=-4;                idisp[1]=7;
-
-    MPI_Type_hindexed( 2, blocklen, disp, dt1, &dt2 );
-    MPI_Type_commit( &dt2 );
-
-        MPI_Type_lb( dt2, &lb );       MPI_Type_ub( dt2, &ub );
-       MPI_Type_extent( dt2, &ex );   MPI_Type_size( dt2, &sz );
-
-       if (lb != -7 || ub != 13 || ex != 20) {
-           printf("hindexed lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex, sz);
-       }
-       else 
-           printf( "hindexed ok\n" );
-
-    MPI_Type_indexed( 2, blocklen, idisp, dt1, &dt3 );
-    MPI_Type_commit( &dt3 );
-
-        MPI_Type_lb( dt3, &lb );       MPI_Type_ub( dt3, &ub );
-       MPI_Type_extent( dt3, &ex );   MPI_Type_size( dt3, &sz );
-
-       if (lb != -39 || ub != 69 || ex != 108) {
-           printf("indexed lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex, sz);
-       }
-       else 
-           printf( "indexed ok\n" );
-
-    MPI_Type_hvector( 2, 1, 14, dt1, &dt4 );
-    MPI_Type_commit( &dt4 );
-
-        MPI_Type_lb( dt4, &lb );       MPI_Type_ub( dt4, &ub );
-       MPI_Type_extent( dt4, &ex );   MPI_Type_size( dt4, &sz );
-
-       if (lb != -3 || ub != 20 || ex != 23) {
-           printf("hvector lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex, sz);
-       }
-       else 
-           printf( "hvector ok\n" );
-
-    MPI_Type_vector( 2, 1, 14, dt1, &dt5 );
-    MPI_Type_commit( &dt5 );
-    
-        MPI_Type_lb( dt5, &lb );       MPI_Type_ub( dt5, &ub );
-       MPI_Type_extent( dt5, &ex );   MPI_Type_size( dt5, &sz );
-
-       if (lb != -3 || ub != 132 || ex != 135) {
-           printf("vector lb %d ub %d extent %d size %d\n", 
-                  (int)lb, (int)ub, (int)ex, sz);
-       }
-       else 
-           printf( "vector ok\n" );
-
-    MPI_Type_free( &dt1 );
-    MPI_Type_free( &dt2 );
-    MPI_Type_free( &dt3 );
-    MPI_Type_free( &dt4 );
-    MPI_Type_free( &dt5 );
-
-    MPI_Finalize();
-    return 0;
-}
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/typeub3.std b/teshsuite/smpi/mpich-test/pt2pt/typeub3.std
deleted file mode 100644 (file)
index a04e547..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-hindexed ok
-indexed ok
-hvector ok
-vector ok
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitall.c b/teshsuite/smpi/mpich-test/pt2pt/waitall.c
deleted file mode 100644 (file)
index 3fd97ed..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * This code tests waitall; in particular, the that ordering requirement
- * on nonblocking communication is observed.
- */
-
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-#ifdef HAVE_UNISTD_H
-/* For sleep */
-#include <unistd.h>
-#endif
-
-#define MAX_REQ 32
-
-#ifndef HAVE_SLEEP
-void sleep( int secs )
-{
-#ifdef VX_WORKS
-    /* Also needs include <time.h>? */
-    struct timespec rqtp = { 10, 0 };
-    nanosleep(&rqtp, NULL);
-#else
-    double t;
-    t = MPI_Wtime();
-    while (MPI_Wtime() - t < (double)secs) ;
-#endif
-}
-#endif
-
-int main( int argc, char **argv )
-{
-    int rank, size;
-    int i, j, count, err = 0, toterr;
-    MPI_Request r[MAX_REQ];
-    MPI_Status  s[MAX_REQ];
-    int         buf[MAX_REQ][MAX_REQ];
-
-    MPI_Init( &argc, &argv );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    if (size < 2) {
-       fprintf( stderr, "This test requires at least 2 processes\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    /* First, cause the wait all to happen AFTER the Sends */
-    if (rank == 0) {
-       for (i=0; i<MAX_REQ; i++) {
-           MPI_Irecv( buf[i], i+1, MPI_INT, 1, 99, MPI_COMM_WORLD, 
-                      &r[MAX_REQ-1-i] ); 
-       }
-       MPI_Waitall( MAX_REQ, r, s );
-       /* Check that we've received the correct data */
-       for (i=0; i<MAX_REQ; i++) {
-           MPI_Get_count( &s[MAX_REQ-1-i], MPI_INT, &count );
-           if (count != i) {
-               err++;
-               fprintf( stderr, "Wrong count (%d) for request %d\n", 
-                        count, MAX_REQ-1-i );
-           }
-       }
-    }
-    else if (rank == 1) {
-       for (i=0; i<MAX_REQ; i++) {
-           for (j=0; j<=i; j++)
-               buf[i][j] = i * MAX_REQ + j;
-           MPI_Send( buf[i], i, MPI_INT, 0, 99, MPI_COMM_WORLD );
-       }
-    }
-
-    /* Second, cause the waitall to start BEFORE the Sends */
-    if (rank == 0) {
-       for (i=0; i<MAX_REQ; i++) {
-           MPI_Irecv( buf[i], i+1, MPI_INT, 1, 99, MPI_COMM_WORLD, 
-                      &r[MAX_REQ-1-i] ); 
-       }
-       MPI_Send( MPI_BOTTOM, 0, MPI_INT, 1, 0, MPI_COMM_WORLD );
-       MPI_Waitall( MAX_REQ, r, s );
-       /* Check that we've received the correct data */
-       for (i=0; i<MAX_REQ; i++) {
-           MPI_Get_count( &s[MAX_REQ-1-i], MPI_INT, &count );
-           if (count != i) {
-               err++;
-               fprintf( stderr, 
-                        "Wrong count (%d) for request %d (waitall posted)\n", 
-                        count, MAX_REQ-1-i );
-           }
-       }
-    }
-    else if (rank == 1) {
-       MPI_Recv( MPI_BOTTOM, 0, MPI_INT, 0, 0, MPI_COMM_WORLD, &s[0] );
-       sleep( 2 );
-       for (i=0; i<MAX_REQ; i++) {
-           for (j=0; j<=i; j++)
-               buf[i][j] = i * MAX_REQ + j;
-           MPI_Send( buf[i], i, MPI_INT, 0, 99, MPI_COMM_WORLD );
-       }
-    }
-
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (rank == 0) {
-       toterr = err;
-       if (toterr == 0) 
-           printf( "Test complete\n" );
-       else
-           printf( "Found %d errors in test!\n", toterr );
-    }
-    
-    MPI_Finalize();
-    return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitall.std b/teshsuite/smpi/mpich-test/pt2pt/waitall.std
deleted file mode 100644 (file)
index f75da10..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Test complete
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitall2.c b/teshsuite/smpi/mpich-test/pt2pt/waitall2.c
deleted file mode 100644 (file)
index 5ec20dc..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-  Test of waitall.  This makes sure that the requests in a wait can occur
-  in any order.
-
-  Run with 2 processes.
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Pause( double );
-
-void Pause( double sec )
-{
-  /*double t1 =*/ MPI_Wtime();
-  sleep(sec);
-//while (MPI_Wtime() - t1 < sec) ;
-}
-
-int main( int argc, char **argv )
-{
-  int size, rank, flag, i;
-  int *buf1, *buf2, cnt;
-  double t0;
-  MPI_Status statuses[2];
-  MPI_Request req[2];
-
-  MPI_Init( &argc, &argv );
-  MPI_Comm_size( MPI_COMM_WORLD, &size );
-  MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-  if (size < 2) {
-    printf( "This test requires at least 2 processors\n" );
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-    return 1;
-  }
-  
-  /* Large enough that almost certainly a rendezvous algorithm will be used
-     by Issend.  buflimit.c will give you a more reliable value */
-  cnt = 35000;
-
-  /* Test:
-     process 0                        process 1
-                                      Irecv1
-                                      Irecv2
-     Sendrecv                         Sendrecv
-     pause(2 sec)                     pause(2 sec)
-     Issend2                          Waitall
-     test(2) for 5 secs
-     Ssend1
-     Wait(2) if necessary
-
-     If the test for Issend2 never succeeds, then the waitall appears to be
-     waiting for req1 first.  By using Issend, we can keep the program from
-     hanging.
-  */
-  buf1 = (int *)malloc( cnt * sizeof(int) );
-  buf2 = (int *)malloc( cnt * sizeof(int) );
-  if (!buf1 || !buf2) {
-    printf( "Could not allocate buffers of size %d\n", cnt );
-    MPI_Abort( MPI_COMM_WORLD, 1 );
-    return 1;
-  }
-
-  for (i=0; i<cnt; i++) {
-    buf1[i] = i;
-    buf2[i] = i;
-  }
-
-  if (rank == 0) {
-    MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, size - 1, 3, 
-                 MPI_BOTTOM, 0, MPI_BYTE, size - 1, 3, 
-                 MPI_COMM_WORLD, &statuses[0] );
-    Pause( 2.0 );
-    MPI_Issend( buf2, cnt, MPI_INT, size-1, 2, MPI_COMM_WORLD, &req[0] );
-    t0 = MPI_Wtime();
-    flag = 0;
-    while (t0 + 5.0 > MPI_Wtime() && !flag) 
-      MPI_Test( &req[0], &flag, &statuses[0] );
-    MPI_Ssend( buf1, cnt, MPI_INT, size-1, 1, MPI_COMM_WORLD );
-    if (!flag) {
-      printf( 
-    "*ERROR: MPI_Waitall appears to be waiting for requests in the order\n\
-they appear in the request list\n" );
-      MPI_Wait( &req[0], &statuses[0] );
-    }
-    else {
-       printf( " No Errors\n" ) ;
-    }
-  }
-  else if (rank == size - 1) {
-    MPI_Irecv( buf1, cnt, MPI_INT, 0, 1, MPI_COMM_WORLD, &req[0] );
-    MPI_Irecv( buf2, cnt, MPI_INT, 0, 2, MPI_COMM_WORLD, &req[1] );
-    MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 0, 3, 
-                 MPI_BOTTOM, 0, MPI_BYTE, 0, 3, MPI_COMM_WORLD, &statuses[0] );
-    Pause( 2.0 );
-    MPI_Waitall( 2, req, statuses );
-  }
-
-  free( buf1 );
-  free( buf2 );
-  MPI_Finalize();
-  return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitall3.c b/teshsuite/smpi/mpich-test/pt2pt/waitall3.c
deleted file mode 100644 (file)
index cdd13f8..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-  Test of waitall.  This makes sure that the requests in a wait can occur
-  in any order.
-
-  Run with 4 processes.  This checks for code that listens to a specified
-  process.  This is similar to the test in waitall2, except the incoming
-  messages come from processes 1 and 2.  (no message comes from process 3).
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Pause( double );
-
-void Pause( double sec )
-{
-  /*double t1 =*/ MPI_Wtime();
-  sleep(sec);
-//  while (MPI_Wtime() - t1 < sec) ;
-}
-
-int main( int argc, char **argv )
-{
-    int size, rank, flag, i;
-    int *buf1, *buf2, cnt;
-    double t0;
-    MPI_Status statuses[2];
-    MPI_Request req[2];
-    
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    if (size < 3) {
-       printf( "This test requires at least 3 processors\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-       return 1;
-    }
-  
-    /* Large enough that almost certainly a rendezvous algorithm will be used
-       by Issend.  buflimit.c will give you a more reliable value */
-    cnt = 35000;
-
-    /* Test:
-     process 0                    process 1               process 2
-                                  Irecv1
-                                  Irecv2
-     Barrier                      Barrier                 Barrier
-     pause(2 sec)                 pause(2 sec)            
-     issend2                      Waitall                 
-     test(2) for 5 secs
-     sendrecv (process 2)                                 sendrecv(process0)
-                                                          ssend1
-     wait(2) if necessary
-
-     If the test for Issend2 never succeeds, then the waitall appears to be
-     waiting for req1 first.  By using Issend, we can keep the program from
-     hanging.
-    */
-    buf1 = (int *)malloc( cnt * sizeof(int) );
-    buf2 = (int *)malloc( cnt * sizeof(int) );
-    if (!buf1 || !buf2) {
-       printf( "Could not allocate buffers of size %d\n", cnt );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-       return 1;
-    }
-    
-    for (i=0; i<cnt; i++) {
-       buf1[i] = i;
-       buf2[i] = i;
-    }
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (rank == 0) {
-       MPI_Barrier( MPI_COMM_WORLD );
-       Pause( 2.0 );
-       MPI_Isend( buf2, cnt, MPI_INT, 1, 2, MPI_COMM_WORLD, &req[0] );
-       t0 = MPI_Wtime();
-       flag = 0;
-       while (t0 + 5.0 > MPI_Wtime() && !flag) 
-           MPI_Test( &req[0], &flag, &statuses[0] );
-/* Tell process 2 to go ahead */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 2, 3, 
-                     MPI_BOTTOM, 0, MPI_BYTE, 2, 3, MPI_COMM_WORLD, &statuses[0] );
-       if (!flag) {
-           printf( 
-    "*ERROR: MPI_Waitall appears to be waiting for requests in the order\n\
-they appear in the request list\n" );
-           /* We can wait now since process 2 should have allowed the wait
-              to proceed */
-           MPI_Wait( &req[0], &statuses[0] );
-       }
-       else {
-           printf( " No Errors\n" ) ;
-       }
-    }
-    else if (rank == 1) {
-       MPI_Irecv( buf1, cnt, MPI_INT, 2, 1, MPI_COMM_WORLD, &req[0] );
-       MPI_Irecv( buf2, cnt, MPI_INT, 0, 2, MPI_COMM_WORLD, &req[1] );
-       MPI_Barrier( MPI_COMM_WORLD );
-       Pause( 2.0 );
-       MPI_Waitall( 2, req, statuses );
-    }
-    else if (rank == 2) {
-       MPI_Barrier( MPI_COMM_WORLD );
-       /* Wait for process 0 to tell us to go ahead */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 0, 3, 
-                     MPI_BOTTOM, 0, MPI_BYTE, 0, 3, MPI_COMM_WORLD, &statuses[0] );
-       MPI_Send( buf1, cnt, MPI_INT, 1, 1, MPI_COMM_WORLD );
-    }
-    else {
-       MPI_Barrier( MPI_COMM_WORLD );
-    }
-    
-    free( buf1 );
-    free( buf2 );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitall4.c b/teshsuite/smpi/mpich-test/pt2pt/waitall4.c
deleted file mode 100644 (file)
index 24d9ea4..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
-  Test of waitall.  This makes sure that the requests in a wait can occur
-  in any order.
-
-  Run with 4 processes.  This checks for code that listens to a specified
-  process.  This is similar to the test in waitall3, except that the 
-  wait is on sends instead of receives.  Messages are sent by process 2 to
-  processes 0 and 1.  Process 3 is uninvolved.
-  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Pause( double );
-
-void Pause( double sec )
-{
-  /*double t1 =*/ MPI_Wtime();
-  sleep(sec);
-//  while (MPI_Wtime() - t1 < sec) ;
-}
-
-int main( int argc, char **argv )
-{
-    int size, rank, flag, i;
-    int *buf1, *buf2, cnt;
-    double t0;
-    MPI_Status statuses[2];
-    MPI_Request req[2];
-    
-    MPI_Init( &argc, &argv );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-
-    if (size < 3) {
-       printf( "This test requires at least 3 processors\n" );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-       return 1;
-    }
-  
-    /* Large enough that almost certainly a rendezvous algorithm will be used
-       by Issend.  buflimit.c will give you a more reliable value */
-    cnt = 35000;
-
-    /* Test:
-     process 0                    process 1               process 2
-                                                          Issend1
-                                                          Issend0
-     Barrier                      Barrier                 Barrier
-     pause(2 sec)                 pause(2 sec)            pause(1 sec)
-     irecv2                                               waitall
-     test(2) for 5 secs
-     sendrecv (process 1)         sendrecv(process0)
-                                  recv2
-     wait(2) if necessary
-
-     If the test for Irecv2 never succeeds, then the waitall appears to be
-     waiting for req1 first.  By using Issend, we can keep the program from
-     hanging.
-    */
-    buf1 = (int *)malloc( cnt * sizeof(int) );
-    buf2 = (int *)malloc( cnt * sizeof(int) );
-    if (!buf1 || !buf2) {
-       printf( "Could not allocate buffers of size %d\n", cnt );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-       return 1;
-    }
-    
-    for (i=0; i<cnt; i++) {
-       buf1[i] = i;
-       buf2[i] = i;
-    }
-
-    MPI_Barrier( MPI_COMM_WORLD );
-    if (rank == 0) {
-       MPI_Barrier( MPI_COMM_WORLD );
-       Pause( 2.0 );
-       MPI_Irecv( buf2, cnt, MPI_INT, 2, 2, MPI_COMM_WORLD, &req[0] );
-       t0 = MPI_Wtime();
-       flag = 0;
-       while (t0 + 5.0 > MPI_Wtime() && !flag) 
-           MPI_Test( &req[0], &flag, &statuses[0] );
-       /* printf( "Test succeeded at %f with flag %d\n", MPI_Wtime()-t0, flag ); */
-       /* Tell process 2 to go ahead */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 1, 3, 
-                     MPI_BOTTOM, 0, MPI_BYTE, 1, 3, MPI_COMM_WORLD, &statuses[0] );
-       if (!flag) {
-           printf( 
-    "*ERROR: MPI_Waitall appears to be waiting for requests in the order\n\
-they appear in the request list\n" );
-           /* We can wait now since process 2 should have allowed the wait
-              to proceed */
-           MPI_Wait( &req[0], &statuses[0] );
-       }
-       else {
-           printf( " No Errors\n" ) ;
-       }
-    }
-    else if (rank == 2) {
-       MPI_Isend( buf1, cnt, MPI_INT, 1, 1, MPI_COMM_WORLD, &req[0] );
-       MPI_Isend( buf2, cnt, MPI_INT, 0, 2, MPI_COMM_WORLD, &req[1] );
-       MPI_Barrier( MPI_COMM_WORLD );
-       Pause( 1.0 );
-       MPI_Waitall( 2, req, statuses );
-    }
-    else if (rank == 1) {
-       MPI_Status status;
-       MPI_Barrier( MPI_COMM_WORLD );
-       /* Wait for process 0 to tell us to go ahead */
-       MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 0, 3, 
-                     MPI_BOTTOM, 0, MPI_BYTE, 0, 3, MPI_COMM_WORLD, &statuses[0] );
-       MPI_Recv( buf1, cnt, MPI_INT, 2, 1, MPI_COMM_WORLD, &status );
-    }
-    else {
-       MPI_Barrier( MPI_COMM_WORLD );
-    }
-    
-    free( buf1 );
-    free( buf2 );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitany.c b/teshsuite/smpi/mpich-test/pt2pt/waitany.c
deleted file mode 100644 (file)
index 47adda6..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * This code tests waitany; in one version of MPICH, it uncovered some
- * problems with the ADI Test calls.
- */
-/* #define i_ntotin 256  */ /* ok    */
-/* #define i_ntotin 257  */ /* fails */
-#define i_ntotin 25600  
-
-#include <stdio.h>
-#include "mpi.h"
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-#define DAR 32  /* ``Data: ARray''  */
-
-
-int main( int argc, char **argv )
- {
-  int locId ;
-  int data [i_ntotin] ;
-
-  MPI_Init(&argc, &argv) ;
-  MPI_Comm_rank(MPI_COMM_WORLD, &locId) ;
-
-  if(locId == 0) {
-
-    /* The server... */
-
-    MPI_Status status[2] ;
-    MPI_Request events [2] ;
-
-    int eventId ;
-
-    int dstId = 1 ;
-
-    int i ;
-
-    for(i = 0 ; i < i_ntotin ; i++)
-      data [i] = i + 1 ;
-
-    events [0] = MPI_REQUEST_NULL ;
-    events [1] = MPI_REQUEST_NULL ;
-
-    MPI_Isend(data, i_ntotin, MPI_INT, dstId, DAR,
-              MPI_COMM_WORLD, events + 1) ;
-        /* enable send of data */
-
-    /*_begin_trace_code  */
-    /* printf("locId = %d: MPI_Isend(%x, %d, %x, %d, %d, %x, %x)\n",
-      locId, data, i_ntotin, MPI_INT, dstId, DAR, MPI_COMM_WORLD, events [1]); 
-      */
-    /*_end_trace_code  */
-
-    /*_begin_trace_code  */
-    /* printf("locId = %d: MPI_Waitany(%d, [%x, %x], %x %x)...",
-      locId, 2, events [0], events [1], &eventId, &status) ; */
-    /*_end_trace_code  */
-
-    MPI_Waitany(2, events, &eventId, status) ;
-
-    /*_begin_trace_code  */
-    printf("done.  eventId = %d\n", eventId) ;
-    /*_end_trace_code  */
-  }
-
-  if(locId == 1) {
-
-    /* The Client...  */
-
-    MPI_Status status ;
-
-    int srcId = MPI_ANY_SOURCE ;
-
-    /*_begin_trace_code  */
-    /*
-    printf("locId = %d: MPI_Recv(%x, %d, %x, %d, %d, %x, %x)...",
-      locId, data, i_ntotin, MPI_INT, srcId, DAR, MPI_COMM_WORLD, &status) ;
-      */
-    /*_end_trace_code  */
-
-    MPI_Recv(data, i_ntotin, MPI_INT, srcId, DAR,
-             MPI_COMM_WORLD, &status) ;
-
-    /*_begin_trace_code  */
-    /*printf("done.\n") ;*/
-    /*_end_trace_code  */
-
-    /*
-    printf("locId = %d: data [0] = %d, data [%d] = %d\n",
-      locId, data [0], i_ntotin - 1, data [i_ntotin - 1]) ;
-       */
-  }
-
-  MPI_Barrier( MPI_COMM_WORLD );
-  if (locId == 0)
-      printf( "Test complete\n" );
-  MPI_Finalize() ;
-  return 0;
-}
-
-
-
diff --git a/teshsuite/smpi/mpich-test/pt2pt/waitany.std b/teshsuite/smpi/mpich-test/pt2pt/waitany.std
deleted file mode 100644 (file)
index d8092c1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-done.  eventId = 1
-Test complete
diff --git a/teshsuite/smpi/mpich-test/runbase b/teshsuite/smpi/mpich-test/runbase
deleted file mode 100644 (file)
index ae91ba4..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-#! /bin/sh
-#
-# This file contains support shell routines and steps common to all
-# runtests scripts.
-#
-# Find MPIRUN
-#
-# Some people don't include "." in their path (! in case an ls trojan horse,
-# I guess - if someone does that to you, you have bigger problems).  This
-# code tests to see if you have a path to mpirun; if not, it tries ./mpirun.
-#
-# One particular problem is having multiple mpiruns in the path.  An
-# absolute path for mpirun will fix many problems
-FindMPIRUN () {
-    if [ -z "$MPICH_USE_LIB_MPIRUN" -a ! -x "$mpirun" ] ; then
-        IFS="${IFS=    }"; saveifs="$IFS"; IFS="${IFS}:"
-        for dir in $PATH ; do 
-            if [ -x $dir/mpirun ] ; then
-               if [ -n "${MPICH_VERSION}" ] ; then
-                   # Test that we've found the correct mpirun
-                   if strings $dir/mpirun | grep "MPIRUN for MPICH" > /dev/null ; then
-                       :
-                   else
-                       # echo "$dir/mpirun isn't for MPICH"
-                       continue
-                   fi
-               fi
-                mpirun="mpirun"
-                break
-             fi
-        done
-        IFS="$saveifs"
-    fi
-    if [ -z "$mpirun" -a -x "./mpirun" ] ; then
-        mpirun=./mpirun
-    fi
-    #
-    if [ -z "$mpirun" ] ; then
-        echo "No mpirun in path.  Testing can not proceed."
-        exit 1
-    fi
-}
-
-# MakeExe program-name
-MakeExe() {
-    if [ -s $STOPFILE ] ; then 
-        echo "Found stopfile $STOPFILE; exiting"
-       exit 0
-    fi
-    if [ ! -x $1 ] ; then
-       $MAKE $1
-        if [ ! -x $1 ] ; then 
-           if [ "$MPITEST_CONTINUE" = "always" ] ; then
-               echo "Could not build executable $1; skipping this test"
-           else 
-               echo "Could not build executable $1; aborting tests"
-               exit 1
-           fi
-        fi
-    fi
-}
-
-# CleanExe program-name
-CleanExe() {
-    if [ $makeeach = 1 ] ; then
-       /bin/rm -f $1 $1.o
-    fi
-}
-
-# Output marker
-OutTime() {
-    if [ $quiet = 0 ] ; then
-       if [ -z "$hostname" ] ; then
-           hostname=`hostname`
-       fi
-       d=`date`
-       echo "$hostname : $d"
-    fi
-}
-
-# Do an "on the fly" check for problems.
-# Checkout testname difffile
-# difffile may be empty, in which case stdout is used.
-# If $writesummaryfile is yes, output the results to $summaryfile.
-# Use XML-style output for the summary file:
-# <MPITEST>
-# <NAME NAME="" STATUS="PASS"|"FAIL">
-# <WORKDIR>directory</WORKDIR>
-# <TESTDIFF>
-#    text from different
-# </TESTDIFF>
-# </MPITEST>
-#
-# We'd also like to support 
-# <NP>$np</NP>
-# but we don't have that information when this routine is called
-CheckOutput() {
-    bfile=$1
-    difffile=$2
-    fileok="no"
-    if [ ! -s ${bfile}.out ] ; then
-        echo "No output file ${bfile}.out!"
-    else
-       cmpfile=""
-        # Handle Fortran systems that generate stop statements
-        rm -f ${bfile}.tout
-       grep -v 'FORTRAN STOP' ${bfile}.out > ${bfile}.tout
-       for stdfile in $srcdir/${bfile}.std $srcdir/${bfile}.std2 \
-                       $srcdir/std/${bfile}.std ${bfile}.stdo ; do
-           if [ -z "$cmpfile" -a -s "$stdfile" ] ; then
-               cmpfile=$stdfile
-           fi
-           if test -s $stdfile && diff -b ${bfile}.tout $stdfile > /dev/null ; then
-               fileok=yes
-               break;
-           fi
-       done
-       if [ $fileok = "no" ] ; then
-           if [ -n "$difffile" ] ; then
-               if [ -n "$cmpfile" ] ; then
-                    echo "Differences in ${bfile}.out" >> ${difffile}
-                   diff -b ${bfile}.tout $cmpfile >> ${difffile}
-               else
-                    echo "Cannot find a file to compare against for test ${bfile}.out"
-               fi
-           else
-               if [ -n "$cmpfile" ] ; then
-                    echo "Differences in ${bfile}.out"
-                   diff -b ${bfile}.tout $cmpfile
-               else
-                    echo "Cannot find a file to compare against for test ${bfile}.out"
-               fi
-            fi
-           nodiff=0
-       fi
-       if [ "$writesummaryfile" = "yes" ] ; then
-           if [ $fileok = "yes" ] ; then 
-               passed=pass
-           else
-               passed=fail
-           fi
-           mydir=`pwd`
-           cat >>$summaryfile <<EOF
-<MPITEST>
-<NAME>$bfile</NAME>
-<WORKDIR>$mydir</WORKDIR>
-<STATUS>$passed</STATUS>
-EOF
-            if [ -n "$np" ] ; then
-               echo "<NP>$np</NP>" >> $summaryfile
-            fi
-           if [ $fileok = "no" ] ; then
-               echo "<TESTDIFF>" >> $summaryfile
-               if [ ! -s ${bfile}.out ] ; then
-                   echo "No output file" >>$summaryfile
-               else
-                   if [ -z "$cmpfile" ] ; then 
-                       cmpfile="/dev/null"
-                   fi
-                   diff -b ${bfile}.tout $cmpfile | \
-                   sed -e 's/&/-AMP-amp;/g' -e 's/</-AMP-lt;/g' \
-                       -e 's/>/-AMP-gt;/g' | \
-                   sed -e 's/-AMP-/\&/g' >> $summaryfile
-               fi
-               echo "</TESTDIFF>" >> $summaryfile
-           fi
-           if [ -s "$bfile.tbk" ] ; then
-               echo "<TRACEBACK>" >> $summaryfile
-               echo "$bfile.tbk" >>$summaryfile
-               echo "</TRACEBACK>" >> $summaryfile
-           fi
-           echo "</MPITEST>" >> $summaryfile
-       fi
-        rm -f ${bfile}.tout
-    fi
-}
-
-# Runtest pgm-name np marker-test args outfiles
-# filename.tbk is a traceback file.  Use a tool like pardump $1 > $1.tbk
-# to get such files
-RunTest() {
-    OutTime
-    pgm=$1
-    np=$2
-    testfiles="$testfiles $pgm.out"
-    /bin/rm -f $pgm.out $pgm.tbk
-    MakeExe $1
-    if [ ! -x $pgm ] ; then
-        # If no executable, put the make data into $1.out
-        $MAKE $pgm > $pgm.out 2>&1 
-    else
-        mname=$3
-        if [ -z "$mname" ] ; then mname="*** $1 ***" ; fi
-        #echo "$mname" >> $pgm.out
-        echo "$mname"
-        mvarg=""
-        if [ -n "$5" ] ; then rm -f $5 ; 
-            if [ -n "$MPIRUNMVBACK" ] ; then mvarg="$MPIRUNMVBACK \"$5\"" ; fi 
-        fi
-        # The eval is necessary to ensure that the mvarg value is properly
-        # tokenized.  The ./$1 ensures that the program will be found,
-        # even if . is not in the PATH.
-        
-        eval $mpirun $args -np $np $mvarg ./$pgm $4 </dev/null >> $pgm.out 2>&1
-        if [ -n "$5" ] ; then 
-            for file in $5 ; do 
-                if [ -s $file ] ; then 
-                    cat $file >> $pgm.out ; rm -f $file 
-                fi
-            done
-        fi
-        #echo "$mname" >> $pgm.out
-        if [ ! -s $srcdir/$pgm.std -a ! -s $pgm.stdo ] ; then
-            # We don't need a special file if the output is just "No Errors"
-            cat >>$pgm.stdo <<EOF
- No Errors
-EOF
-        fi
-        if [ "$CheckOutputWhileRunning" = "yes" -o "$check_at_once" = 1 ] ; then
-            CheckOutput $pgm
-        fi
-       # CleanExe $pgm
-    #ipcs
-    fi
-    np=""
-}
-
-#
-# Check the output of the programs against the "standard" output.  The 
-# possible files are:
-#   $srcdir/file.std
-#   $srcdir/file.std2
-#   file.stdo     
-# The last one is an automatically generated file for those programs
-# that simply produce a " No errors" output.
-CheckAllOutput ()
-{
-    difffile=$1
-    /bin/rm -f ${difffile}
-    nodiff=1
-    for file in $testfiles ; do
-       bfile=`basename $file .out`
-       CheckOutput $bfile ${difffile}
-    done
-    if [ -s ${difffile} ] ; then
-        cat ${difffile}
-    elif [ $nodiff = 1 ] ; then
-        echo "-- No differences found; test successful"
-    fi
-}
diff --git a/teshsuite/smpi/mpich-test/topol/cart.c b/teshsuite/smpi/mpich-test/topol/cart.c
deleted file mode 100644 (file)
index d8bc77d..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-#define NUM_DIMS 2
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int              errors=0;
-    int              dims[NUM_DIMS];
-    int              periods[NUM_DIMS];
-    int              coords[NUM_DIMS];
-    int              new_coords[NUM_DIMS];
-    int              reorder = 1;
-    MPI_Comm         comm_temp, comm_cart, new_comm;
-    int              topo_status;
-    int              ndims;
-    int              new_rank;
-    int              remain_dims[NUM_DIMS];
-    int              newnewrank;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Clear dims array and get dims for topology */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Dims_create ( size, NUM_DIMS, dims );
-
-    /* Make a new communicator with a topology */
-    MPI_Cart_create ( MPI_COMM_WORLD, 2, dims, periods, reorder, &comm_temp );
-    MPI_Comm_dup ( comm_temp, &comm_cart );
-
-    /* Determine the status of the new communicator */
-    MPI_Topo_test ( comm_cart, &topo_status );
-    if (topo_status != MPI_CART) {
-       printf( "topo_status of duped comm is not MPI_CART\n" );
-       errors++;
-    }
-
-    /* How many dims do we have? */
-    MPI_Cartdim_get( comm_cart, &ndims );
-    if ( ndims != NUM_DIMS ) {
-       printf( "Number of dims of duped comm (%d) should be %d\n", 
-               ndims, NUM_DIMS );
-       errors++;
-    }
-
-    /* Get the topology, does it agree with what we put in? */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Cart_get ( comm_cart, NUM_DIMS, dims, periods, coords );
-
-    /* Does the mapping from coords to rank work? */
-    MPI_Cart_rank ( comm_cart, coords, &new_rank );
-    if ( new_rank != rank ) {
-       printf( "New rank of duped comm (%d) != old rank (%d)\n", 
-               new_rank, rank );
-       errors++;
-    }
-
-    /* Does the mapping from rank to coords work */
-    MPI_Cart_coords ( comm_cart, rank, NUM_DIMS, new_coords );
-    for (i=0;i<NUM_DIMS;i++) 
-       if ( coords[i] != new_coords[i] ) {
-           printf( "Old coords[%d] of duped comm (%d) != new_coords (%d)\n", 
-                   i, coords[i], new_coords[i] );
-           errors++;
-       }
-
-    /* Let's shift in each dimension and see how it works!   */
-    /* Because it's late and I'm tired, I'm not making this  */
-    /* automatically test itself.                            */
-    for (i=0;i<NUM_DIMS;i++) {
-      int source, dest;
-      MPI_Cart_shift(comm_cart, i, 1, &source, &dest);
-#ifdef VERBOSE      
-      printf ("[%d] Shifting %d in the %d dimension\n",rank,1,i);
-      printf ("[%d]    source = %d  dest = %d\n",rank,source,dest); 
-#endif
-    }
-
-    /* Subdivide */
-    remain_dims[0] = 0; 
-    for (i=1; i<NUM_DIMS; i++) remain_dims[i] = 1;
-    MPI_Cart_sub ( comm_cart, remain_dims, &new_comm );
-
-    /* Determine the status of the new communicator */
-    MPI_Topo_test ( new_comm, &topo_status );
-    if (topo_status != MPI_CART) {
-       printf( "topo_status of cartsub comm is not MPI_CART\n" );
-       errors++;
-    }
-
-    /* How many dims do we have? */
-    MPI_Cartdim_get( new_comm, &ndims );
-    if ( ndims != NUM_DIMS-1 ) {
-       printf( "Number of dims of cartsub comm (%d) should be %d\n", 
-               ndims, NUM_DIMS-1 );
-       errors++;
-    }
-
-    /* Get the topology, does it agree with what we put in? */
-    for(i=0;i<NUM_DIMS-1;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Cart_get ( new_comm, ndims, dims, periods, coords );
-    
-    /* Does the mapping from coords to rank work? */
-    MPI_Comm_rank ( new_comm, &newnewrank );
-    MPI_Cart_rank ( new_comm, coords, &new_rank );
-    if ( new_rank != newnewrank ) {
-       printf( "New rank of cartsub comm (%d) != old rank (%d)\n", 
-               new_rank, newnewrank );
-       errors++;
-    }
-
-    /* Does the mapping from rank to coords work */
-    MPI_Cart_coords ( new_comm, new_rank, NUM_DIMS -1, new_coords );
-    for (i=0;i<NUM_DIMS-1;i++) 
-       if ( coords[i] != new_coords[i] ) {
-           printf( "Old coords[%d] of cartsub comm (%d) != new_coords (%d)\n", 
-                   i, coords[i], new_coords[i] );
-           errors++;
-       }
-
-    /* We're at the end */
-    MPI_Comm_free( &new_comm );
-    MPI_Comm_free( &comm_temp );
-    MPI_Comm_free( &comm_cart );
-    Test_Waitforall( );
-    if (errors) printf( "[%d] done with %d ERRORS!\n", rank,errors );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/topol/cart1f.f b/teshsuite/smpi/mpich-test/topol/cart1f.f
deleted file mode 100644 (file)
index 5bd5982..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-        program main
-        include 'mpif.h'
-
-
-        integer NUM_DIMS
-        parameter (NUM_DIMS=2)
-
-        integer ierr
-        integer errors, toterrors
-        integer comm_temp, comm_cart, new_comm
-        integer size, rank, i
-        logical periods(NUM_DIMS)
-        integer dims(NUM_DIMS)
-        integer coords(NUM_DIMS)
-        integer new_coords(NUM_DIMS)
-        logical remain_dims(NUM_DIMS)
-        integer newnewrank
-        logical reorder
-        integer topo_status
-        integer ndims
-        integer new_rank
-
-        integer source, dest
-
-        errors=0
-        call MPI_INIT (ierr)
-
-        call MPI_COMM_RANK( MPI_COMM_WORLD, rank, ierr)
-        call MPI_COMM_SIZE (MPI_COMM_WORLD, size, ierr )
-
-c
-c    Clear dims array and get dims for topology 
-c
-        do 100 i=1,NUM_DIMS
-                dims(i)=0
-                periods(i)= .false.
-100     continue
-        call MPI_DIMS_CREATE( size, NUM_DIMS, dims, ierr)
-
-c
-c     Make a new communicator with a topology 
-c
-        reorder = .true.
-        call MPI_CART_CREATE( MPI_COMM_WORLD, 2, dims, periods,  
-     $          reorder, comm_temp, ierr)
-        call MPI_COMM_DUP (comm_temp, comm_cart, ierr)
-
-c
-c     Determine the status of the new communicator 
-c
-        call MPI_TOPO_TEST (comm_cart, topo_status, ierr)
-        IF (topo_status .ne. MPI_CART) then
-           print *, "Topo_status is not MPI_CART"
-           errors=errors+1
-        ENDIF
-
-c
-c     How many dims do we have? 
-c
-        call MPI_CARTDIM_GET( comm_cart, ndims, ierr)
-        if (ndims .ne. NUM_DIMS ) then
-           print *, "ndims (", ndims, ") is not NUM_DIMS (", NUMDIMS,
-     $          ")" 
-           errors = errors+1
-        ENDIF
-
-c
-c     Get the topology, does it agree with what we put in? 
-c
-        do 500 i=1,NUM_DIMS
-                dims(i)=0
-                periods(i)=.false.
-500     continue
-        call MPI_CART_GET( comm_cart, NUM_DIMS, dims, periods, coords,
-     $       ierr) 
-c
-c     Does the mapping from coords to rank work? 
-c
-        call MPI_CART_RANK( comm_cart, coords, new_rank, ierr)
-        if (new_rank .ne. rank ) then
-           print *, "New_rank = ", new_rank, " is not rank (", rank, ")"
-           errors=errors+1
-        endif
-
-c
-c     Does the mapping from rank to coords work 
-c
-        call MPI_CART_COORDS( comm_cart, rank, NUM_DIMS, new_coords ,
-     $       ierr) 
-        do 600 i=1,NUM_DIMS
-                if (coords(i) .ne. new_coords(i)) then
-                   print *, "coords(",i,") = ", coords(i), " not = ",
-     $                  new_coords(i) 
-                   errors=errors + 1
-                endif
-600     continue
-
-c
-c     Let's shift in each dimension and see how it works!  
-c     Because it's late and I'm tired, I'm not making this 
-c     automatically test itself.                          
-c
-        do 700 i=1,NUM_DIMS
-           call MPI_CART_SHIFT( comm_cart, (i-1), 1, source, dest, ierr)
-c           print *, '[', rank, '] shifting 1 in the ', (i-1), 
-c     $                 ' dimension'
-c           print *, '[', rank, ']     source = ', source, 
-c     $                 ' dest = ', dest
-                
-700     continue
-
-c
-c     Subdivide 
-c
-        remain_dims(1)=.false.
-        do 800 i=2,NUM_DIMS
-                remain_dims(i)=.true.
-800     continue
-        call MPI_CART_SUB( comm_cart, remain_dims, new_comm, ierr)
-
-c
-c     Determine the status of the new communicator 
-c
-        call MPI_TOPO_TEST( new_comm, topo_status, ierr )
-        if (topo_status .ne. MPI_CART ) then
-           print *, "Topo_status of new comm is not MPI_CART"
-           errors=errors+1
-        endif
-
-c
-c     How many dims do we have? 
-c
-        call MPI_CARTDIM_GET( new_comm, ndims, ierr)
-        if (ndims .ne. NUM_DIMS-1 ) then
-           print *, "ndims (", ndims, ") is not NUM_DIMS-1"
-           errors = errors+1
-        endif
-
-c
-c     Get the topology, does it agree with what we put in? 
-c
-        do 900 i=1,NUM_DIMS-1
-                dims(i)=0
-                periods(i)=.false.
-900     continue
-        call MPI_CART_GET( new_comm, ndims, dims, periods, coords, ierr)
-    
-c
-c     Does the mapping from coords to rank work? 
-c
-        call MPI_COMM_RANK( new_comm, newnewrank, ierr)
-        call MPI_CART_RANK( new_comm, coords, new_rank, ierr)
-        if (new_rank .ne. newnewrank ) then
-           print *, "New rank (", new_rank, ") is not newnewrank"
-           errors=errors+1
-        endif
-
-c
-c     Does the mapping from rank to coords work 
-c
-        call MPI_CART_COORDS( new_comm, new_rank, NUM_DIMS-1, new_coords
-     $       ,  ierr)
-        do 1000 i=1,NUM_DIMS-1
-                if (coords(i) .ne. new_coords(i)) then
-                   print *, "coords(",i,") = ", coords(i),
-     $                  " != new_coords (", new_coords(i), ")"
-                   errors=errors+1
-                endif
-1000    continue
-
-c
-c     We're at the end 
-c
-        call MPI_COMM_FREE( new_comm, ierr)
-        call MPI_COMM_FREE( comm_temp, ierr)
-        call MPI_COMM_FREE( comm_cart, ierr)
-        
-c       call Test_Waitforall_( )
-
-        call MPI_ALLREDUCE( errors, toterrors, 1, MPI_INTEGER,
-     1                      MPI_SUM, MPI_COMM_WORLD, ierr )
-        if (rank .eq. 0) then
-           if (toterrors .eq. 0) then
-              print *, ' No Errors'
-           else
-              print *, ' Done with ', toterrors, ' ERRORS!'
-           endif
-        endif
-        call MPI_FINALIZE(ierr)
-c          print *, '[', rank, '] done with ', errors, ' ERRORS!'
-
-        end
diff --git a/teshsuite/smpi/mpich-test/topol/cart2.c b/teshsuite/smpi/mpich-test/topol/cart2.c
deleted file mode 100644 (file)
index b28d2b9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-#define NUM_DIMS 2
-
-int verbose = 0; 
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int              dims[NUM_DIMS];
-    int              periods[NUM_DIMS];
-    int              new_coords[NUM_DIMS];
-    int              new_new_coords[NUM_DIMS];
-    int              reorder = 1;
-    int              left, right, top, bottom;
-    MPI_Comm         comm_cart;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Clear dims array and get dims for topology */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Dims_create ( size, NUM_DIMS, dims );
-
-    /* Make a new communicator with a topology */
-    MPI_Cart_create ( MPI_COMM_WORLD, 2, dims, periods, reorder, &comm_cart );
-
-    /* Does the mapping from rank to coords work */
-    MPI_Cart_coords ( comm_cart, rank, NUM_DIMS, new_coords ); 
-
-    /* 2nd call to Cart coords gives us an error - why? */
-    MPI_Cart_coords ( comm_cart, rank, NUM_DIMS, new_new_coords ); /***34***/ 
-
-    /* Try cart shift */
-    MPI_Cart_shift( comm_cart, 0, 1, &left, &right );
-    MPI_Cart_shift( comm_cart, 1, 1, &bottom, &top );
-
-    if (dims[0] == 2) {
-       /* We should see
-          [0] -1 2 -1 1
-          [1] -1 3 0 -1
-          [2] 0 -1 -1 3
-          [3] 1 -1 2 -1
-       */
-       if (verbose) {
-           printf( "[%d] final dims = [%d,%d]\n", rank, dims[0], dims[1] );
-           printf( "[%d] left = %d, right = %d, bottom = %d, top = %d\n", 
-                   rank, left, right, bottom, top );
-       }
-    }
-
-    MPI_Comm_free( &comm_cart );
-    Test_Waitforall( );
-    MPI_Finalize();
-    
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/topol/cart2f.f b/teshsuite/smpi/mpich-test/topol/cart2f.f
deleted file mode 100644 (file)
index 54ae04d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-        program main
-        include 'mpif.h'
-
-        integer NUM_DIMS
-        parameter (NUM_DIMS=2)
-
-        integer rank, size, i
-        integer dims(NUM_DIMS)
-        logical periods(NUM_DIMS)
-        integer new_coords(NUM_DIMS)
-        integer new_new_coords(NUM_DIMS)
-        logical reorder
-        
-        integer comm_cart
-        integer ierr
-
-        reorder= .true.
-        
-        call MPI_INIT(ierr)
-
-        call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
-        call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
-
-c     Clear dims array and get dims for topology 
-        do 100 i=1,NUM_DIMS
-                dims(i)=0
-                periods(i)=.false.
-100     continue
-        call MPI_DIMS_CREATE(size, NUM_DIMS, dims, ierr)
-
-c     Make a new communicator with a topology 
-        call MPI_CART_CREATE(MPI_COMM_WORLD, 2, dims, periods,
-     $          reorder, comm_cart, ierr)
-
-c     Does the mapping from rank to coords work 
-        call MPI_CART_COORDS(comm_cart, rank, NUM_DIMS, new_coords,
-     $          ierr)
-
-c     2nd call to Cart coords gives us an error - why?    *34*
-        call MPI_CART_COORDS(comm_cart, rank, NUM_DIMS, new_new_coords,
-     $          ierr)
-
-        call MPI_COMM_FREE(comm_cart, ierr)
-c       call Test_Waitforall()
-        if (rank .eq. 0) then
-c          call MPI_ALLREDUCE( errors, toterrors, 1, MPI_INTEGER,
-c       1       MPI_SUM, MPI_COMM_WORLD )
-           print *, ' No Errors'
-c          print *, ' Done with ', toterrors, ' ERRORS!'
-        endif
-        call MPI_FINALIZE(ierr)
-c        print *, 'cart2f completed, errors=', ierr
-
-        end
diff --git a/teshsuite/smpi/mpich-test/topol/cartc.f90 b/teshsuite/smpi/mpich-test/topol/cartc.f90
deleted file mode 100644 (file)
index 6544a1b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-program topology
-  
-     implicit none
-     include "mpif.h"
-     integer, parameter :: Ndim=2
-     integer :: Rang, Nprocs, Comm, info
-     integer, dimension(Ndim) :: Dims
-     logical, dimension(Ndim) :: Period
-     logical                  :: Reorder=.FALSE.
-
-     Period(:) = .FALSE.
-     CALL MPI_INIT(info)
-     CALL MPI_COMM_RANK( MPI_COMM_WORLD, rang, info )
-     CALL MPI_COMM_SIZE( MPI_COMM_WORLD, Nprocs, info )
-     Dims(:) = 0
-     CALL MPI_DIMS_CREATE( Nprocs, Ndim, Dims, info )
-     CALL MPI_CART_CREATE( MPI_COMM_WORLD, Ndim, Dims, Period, Reorder, &
-                           Comm, info )
-     print *, "Rang : ",rang," New Comm cart : ",Comm
-     call MPI_FINALIZE(info)
-end program topology
diff --git a/teshsuite/smpi/mpich-test/topol/cartf.f b/teshsuite/smpi/mpich-test/topol/cartf.f
deleted file mode 100644 (file)
index e793c64..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-c
-c     From Craig Douglas, modified by Bill Gropp (based on code in Using
-c     MPI).
-c     This code tests some topology routines and sendrecv with some
-c     MPI_PROC_NULL source/destinations.  It should be run with 4
-c     processes 
-c
-        program main
-        include 'mpif.h'
-        integer maxn
-        parameter (maxn = 35)
-        double precision  a(maxn,maxn)
-        integer nx, ny
-        integer myid, newid, numprocs, comm2d, ierr, stride
-        integer nbrleft, nbrright, nbrtop, nbrbottom
-        integer sx, ex, sy, ey
-        integer dims(2), coords(2)
-        integer nerrs, toterrs
-        logical periods(2)
-        logical verbose
-        data periods/2*.false./
-        data verbose/.false./
-c
-        call MPI_INIT( ierr )
-        call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
-        call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
-c        print *, "Process ", myid, " of ", numprocs, " is alive"
-        if (numprocs .ne. 4) then
-           print *, "This test requires exactly four processes"
-           call MPI_Abort( MPI_COMM_WORLD, 1, ierr )
-        endif 
-        nx = 8
-        ny = 4
-        dims(1) = 0
-        dims(2) = 0
-        call MPI_DIMS_CREATE( numprocs, 2, dims, ierr )
-        call MPI_CART_CREATE( MPI_COMM_WORLD, 2, dims, periods, .true.,
-     *                      comm2d, ierr )
-        call MPI_COMM_RANK( comm2d, newid, ierr )
-        if (verbose) then
-           print *, "Process ", myid, " of ", numprocs, " is now ",
-     $          newid
-        endif
-        myid = newid
-        call MPI_Cart_shift( comm2d, 0,  1, nbrleft,   nbrright, ierr )
-        call MPI_Cart_shift( comm2d, 1,  1, nbrbottom, nbrtop,   ierr )
-        if (verbose) then
-            print *, "Process ", myid, " has nbrs", nbrleft, nbrright,
-     &            nbrtop, nbrbottom
-        endif
-        call MPI_Cart_get( comm2d, 2, dims, periods, coords, ierr )
-        call MPE_DECOMP1D( nx, dims(1), coords(1), sx, ex )
-        call MPE_DECOMP1D( ny, dims(2), coords(2), sy, ey )
-c
-c       Fortran allows print to include * and , in the output!
-c       So, we use an explicit Format
-        if ( myid .eq. 0 )
-     &    print 10, dims(1), dims(2)
- 10     format( " Dims: ", i4, i4 )
-        if (verbose) then
-           print *, "Process ", myid, " has coords of ", coords
-           print *, "Process ", myid, " has sx,ex/sy,ey ", sx,
-     $          ex, sy, ey
-        endif
-        call MPI_TYPE_VECTOR( ey-sy+3, 1, ex-sx+3,
-     $                        MPI_DOUBLE_PRECISION, stride, ierr )
-        call MPI_TYPE_COMMIT( stride, ierr )
-        call setupv( myid, a, sx, ex, sy, ey )
-        call MPI_BARRIER( MPI_COMM_WORLD, ierr )
-c
-        call exchng2( myid, a, sx, ex, sy, ey, comm2d, stride,
-     $                nbrleft, nbrright, nbrtop, nbrbottom )
-c
-c     Check results
-c
-        call checkval( a, sx, ex, sy, ey, nx, ny, nerrs )
-c
-        call mpi_allreduce( nerrs, toterrs, 1, MPI_INTEGER, MPI_SUM,
-     $       MPI_COMM_WORLD, ierr )
-        if (myid .eq. 0) then
-           print *, " Total errors = ", toterrs
-        endif
-        call MPI_TYPE_FREE( stride, ierr )
-        call MPI_COMM_FREE( comm2d, ierr )
-c        call prv( -1, -1, -1, a, sx, ex, sy, ey )
-        call MPI_FINALIZE(ierr)
-        end
-        subroutine MPE_DECOMP1D( n, numprocs, myid, s, e )
-        integer n, numprocs, myid, s, e
-        integer nlocal
-        integer deficit
-c
-        nlocal  = n / numprocs
-        s       = myid * nlocal + 1
-        deficit = mod(n,numprocs)
-        s       = s + min(myid,deficit)
-        if (myid .lt. deficit) then
-            nlocal = nlocal + 1
-        endif
-        e = s + nlocal - 1
-        if (e .gt. n .or. myid .eq. numprocs-1) e = n
-        return
-        end
-        subroutine exchng2( myid, v, sx, ex, sy, ey,
-     $                      comm2d, stride,
-     $                      nbrleft, nbrright, nbrtop, nbrbottom  )
-        include "mpif.h"
-        integer myid, sx, ex, sy, ey, stride
-        double precision v(sx-1:ex+1,sy-1:ey+1)
-        integer nbrleft, nbrright, nbrtop, nbrbottom, comm2d
-        integer status(MPI_STATUS_SIZE), ierr, nx
-c
-        nx = ex - sx + 1
-c  These are just like the 1-d versions, except for less data
-c        call prv( myid, -1, -1, v, sx, ex, sy, ey )
-        call MPI_SENDRECV( v(sx,ey),  nx, MPI_DOUBLE_PRECISION,
-     $                    nbrtop, 0,
-     $                    v(sx,sy-1), nx, MPI_DOUBLE_PRECISION,
-     $                    nbrbottom, 0, comm2d, status, ierr )
-c        call prv( myid, nbrtop, nbrbottom, v, sx, ex, sy, ey )
-        call MPI_SENDRECV( v(sx,sy),  nx, MPI_DOUBLE_PRECISION,
-     $                    nbrbottom, 1,
-     $                    v(sx,ey+1), nx, MPI_DOUBLE_PRECISION,
-     $                    nbrtop, 1, comm2d, status, ierr )
-c        call prv( myid, nbrbottom, nbrtop, v, sx, ex, sy, ey )
-c This uses the "strided" datatype
-c       v(ex,sy-1) = -100 - myid
-        call MPI_SENDRECV( v(ex,sy-1),  1, stride, nbrright,  2,
-     $                     v(sx-1,sy-1), 1, stride, nbrleft,  2,
-     $                     comm2d, status, ierr )
-c        call prv( myid, nbrright, nbrleft, v, sx, ex, sy, ey )
-c       v(sx,sy-1) = -200 - myid
-        call MPI_SENDRECV( v(sx,sy-1),  1, stride, nbrleft,   3,
-     $                     v(ex+1,sy-1), 1, stride, nbrright, 3,
-     $                     comm2d, status, ierr )
-c        call prv( myid, nbrleft, nbrright, v, sx, ex, sy, ey )
-        return
-        end
-        subroutine prv( myid, n1, n2, v, sx, ex, sy, ey )
-c***********************************************************************
-c
-c       Print a matrix of numbers.
-c
-c***********************************************************************
-        integer myid, n1, n2, sx, ex, sy, ey
-        double precision  v(sx-1:ex+1,sy-1:ey+1)
-        integer count, i, j
-        save count
-        character*5 fname
-        data count  / 0 /
-        if ( myid .lt. 0 ) then
-            close( 11 )
-            return
-        endif
-        write (fname,'(''foo.'',i1)') myid
-        if ( count .eq. 0 )
-     &      open( 11, file=fname, status='UNKNOWN' )
-        write (11,*) '----------------------------------------'
-        if ( count .eq. 0 ) then
-            write (11,*) 'sx ', sx
-            write (11,*) 'ex ', ex
-            write (11,*) 'sy ', sy
-            write (11,*) 'ey ', ey
-            write (11,*) '----------------------------------------'
-        endif
-        count = count + 1
-        write (11,*) 'count,n1,n2: ', count, n1, n2
-        do j = ey+1,sy-1,-1
-            write (11,1) j, (v(i,j), i = sx-1,ex+1)
-        enddo
-        return
- 1      Format( i3, 20f7.0 )
-c1      Format( i3, 1p, 20d10.1 )
-        end
-        subroutine setupv( myid, v, sx, ex, sy, ey )
-        integer myid, sx, ex, sy, ey
-        double precision  v(sx-1:ex+1,sy-1:ey+1)
-        integer i, j, k
-c        write (*,*) 'setupv: ', myid, sx, ex, sy, ey
-        do j = sy,ey
-            k = j * 1000.0
-            do i = sx,ex
-                v(i,j)    = i + k
-                v(i,sy-1) = 0
-                v(i,ey+1) = 0
-            enddo
-            v(sx-1,j) = 0
-            v(ex+1,j) = 0
-        enddo
-        return
-        end
-c***********************************************************************
-      subroutine checkval( a, sx, ex, sy, ey, nx, ny, errs )
-      integer sx, ex, sy, ey, nx, ny
-      double precision a(sx-1:ex+1,sy-1:ey+1)
-      integer i, j, k
-      integer errs
-c
-c     Check interior
-c
-      errs = 0
-      do 10 j=sy,ey
-         k = j * 1000
-         do 10 i=sx,ex
-            if (a(i,j) .ne. i + k ) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 10   continue
-c
-c     Check the boundaries
-c      
-      i = sx - 1
-      if (sx .eq. 1) then
-         do 20 j=sy,ey
-            if (a(i,j) .ne. 0.0) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 20      continue
-      else
-         do 30 j=sy,ey
-            if (a(i,j) .ne. i + j * 1000) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 30      continue
-      endif
-      i = ex + 1
-      if (ex .eq. nx) then
-         do 40 j=sy,ey
-            if (a(i,j) .ne. 0.0) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 40      continue
-      else
-         do 50 j=sy,ey
-            if (a(i,j) .ne. i + j * 1000) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 50      continue
-      endif
-      j = sy - 1
-      if (sy .eq. 1) then
-         do 60 i=sx,ex
-            if (a(i,j) .ne. 0.0) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 60      continue
-      else
-         do 70 i=sx,ex
-            if (a(i,j) .ne. i + j * 1000) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 70      continue
-      endif
-      j = ey + 1
-      if (ey .eq. ny) then
-         do 80 i=sx,ex
-            if (a(i,j) .ne. 0.0) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 80      continue
-      else
-         do 90 i=sx,ex
-            if (a(i,j) .ne. i + j * 1000) then
-               errs = errs + 1
-               print *, "error at (", i, ",", j, ") = ", a(i,j)
-            endif
- 90      continue
-      endif
-      return 
-      end
diff --git a/teshsuite/smpi/mpich-test/topol/cartf.std b/teshsuite/smpi/mpich-test/topol/cartf.std
deleted file mode 100644 (file)
index 16a9835..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-*** Testing cart from Fortran ***
- Dims:    2   2
- Total errors =   0
-*** Testing cart from Fortran ***
diff --git a/teshsuite/smpi/mpich-test/topol/cartmap.c b/teshsuite/smpi/mpich-test/topol/cartmap.c
deleted file mode 100644 (file)
index 5f5bf4d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-/* stdlib.h Needed for malloc declaration */
-#include <stdlib.h>
-#include "test.h"
-
-#define NUM_DIMS 2
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int              errors=0;
-    int              dims[NUM_DIMS];
-    int              periods[NUM_DIMS];
-    int              *rbuf, *sbuf;
-    int              new_rank;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Clear dims array and get dims for topology */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Dims_create ( size, NUM_DIMS, dims );
-
-    /* Look at what rankings a cartesian topology MIGHT have */
-    MPI_Cart_map( MPI_COMM_WORLD, 2, dims, periods, &new_rank );
-
-    /* Check that all new ranks are used exactly once */
-    rbuf = (int *)malloc( size * sizeof(int) );
-    sbuf = (int *)malloc( size * sizeof(int) );
-    if (!rbuf || !sbuf) {
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-    for (i=0; i<size; i++) 
-       sbuf[i] = 0;
-    sbuf[new_rank] = 1;
-    MPI_Reduce( sbuf, rbuf, size, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
-    if (rank == 0) {
-       for (i=0; i<size; i++) {
-           if (rbuf[i] != 1) {
-               errors++;
-               fprintf( stderr, "Rank %d used %d times\n", i, rbuf[i] );
-           }
-       }
-       if (errors == 0) 
-           printf( "Cart map test passed\n" );
-    }
-
-    free( rbuf );
-    free( sbuf );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/topol/cartmap.std b/teshsuite/smpi/mpich-test/topol/cartmap.std
deleted file mode 100644 (file)
index 6e6af96..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-**** Testing MPI_Cart_map etc ****
-Cart map test passed
-**** Testing MPI_Cart_map etc ****
diff --git a/teshsuite/smpi/mpich-test/topol/cartorder.c b/teshsuite/smpi/mpich-test/topol/cartorder.c
deleted file mode 100644 (file)
index a380455..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-#include "mpi.h"
-#include <stdio.h>
-#include "test.h"
-
-/* This test makes sure that the ordering if reorder is FALSE is
-   as specified in 6.2, virtual topologies 
-
-   At the same time, it duplicates the tests in cart.c, but
-   with reorder = 0.
-*/
-
-#define NUM_DIMS 2
-
-int main( int argc, char **argv )
-{
-    int              rank, size, i;
-    int              errors=0;
-    int              dims[NUM_DIMS];
-    int              periods[NUM_DIMS];
-    int              coords[NUM_DIMS];
-    int              new_coords[NUM_DIMS];
-    int              reorder = 0;
-    MPI_Comm         comm_temp, comm_cart, new_comm;
-    int              topo_status;
-    int              ndims;
-    int              new_rank;
-    int              remain_dims[NUM_DIMS];
-    int              newnewrank;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    MPI_Comm_size( MPI_COMM_WORLD, &size );
-
-    /* Clear dims array and get dims for topology */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Dims_create ( size, NUM_DIMS, dims );
-
-    /* Make a new communicator with a topology */
-    MPI_Cart_create ( MPI_COMM_WORLD, 2, dims, periods, reorder, &comm_temp );
-    MPI_Comm_dup ( comm_temp, &comm_cart );
-
-    /* Determine the status of the new communicator */
-    MPI_Topo_test ( comm_cart, &topo_status );
-    if (topo_status != MPI_CART) {
-       printf( "topo_status of duped comm is not MPI_CART\n" );
-       errors++;
-    }
-
-    /* How many dims do we have? */
-    MPI_Cartdim_get( comm_cart, &ndims );
-    if ( ndims != NUM_DIMS ) {
-       printf( "Number of dims of duped comm (%d) should be %d\n", 
-               ndims, NUM_DIMS );
-       errors++;
-    }
-
-    /* Get the topology, does it agree with what we put in? */
-    for(i=0;i<NUM_DIMS;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Cart_get ( comm_cart, NUM_DIMS, dims, periods, coords );
-
-    /* Check that the coordinates are correct */
-#if NUM_DIMS == 2
-    if (rank != coords[1] + coords[0] * dims[1]) {
-       errors++;
-       fprintf( stderr, 
-"Did not get expected coordinate (row major required by MPI standard 6.2)\n" );
-    }
-#endif
-    /* Does the mapping from coords to rank work? */
-    MPI_Cart_rank ( comm_cart, coords, &new_rank );
-    if ( new_rank != rank ) {
-       printf( "New rank of duped comm (%d) != old rank (%d)\n", 
-               new_rank, rank );
-       errors++;
-    }
-
-    /* Does the mapping from rank to coords work */
-    MPI_Cart_coords ( comm_cart, rank, NUM_DIMS, new_coords );
-    for (i=0;i<NUM_DIMS;i++) 
-       if ( coords[i] != new_coords[i] ) {
-           printf( "Old coords[%d] of duped comm (%d) != new_coords (%d)\n", 
-                   i, coords[i], new_coords[i] );
-           errors++;
-       }
-
-    /* Let's shift in each dimension and see how it works!   */
-    /* Because it's late and I'm tired, I'm not making this  */
-    /* automatically test itself.                            */
-    for (i=0;i<NUM_DIMS;i++) {
-      int source, dest;
-      MPI_Cart_shift(comm_cart, i, 1, &source, &dest);
-#ifdef VERBOSE      
-      printf ("[%d] Shifting %d in the %d dimension\n",rank,1,i);
-      printf ("[%d]    source = %d  dest = %d\n",rank,source,dest); 
-#endif
-    }
-
-    /* Subdivide */
-    remain_dims[0] = 0; 
-    for (i=1; i<NUM_DIMS; i++) remain_dims[i] = 1;
-    MPI_Cart_sub ( comm_cart, remain_dims, &new_comm );
-
-    /* Determine the status of the new communicator */
-    MPI_Topo_test ( new_comm, &topo_status );
-    if (topo_status != MPI_CART) {
-       printf( "topo_status of cartsub comm is not MPI_CART\n" );
-       errors++;
-    }
-
-    /* How many dims do we have? */
-    MPI_Cartdim_get( new_comm, &ndims );
-    if ( ndims != NUM_DIMS-1 ) {
-       printf( "Number of dims of cartsub comm (%d) should be %d\n", 
-               ndims, NUM_DIMS-1 );
-       errors++;
-    }
-
-    /* Get the topology, does it agree with what we put in? */
-    for(i=0;i<NUM_DIMS-1;i++) { dims[i] = 0; periods[i] = 0; }
-    MPI_Cart_get ( new_comm, ndims, dims, periods, coords );
-    
-    /* Does the mapping from coords to rank work? */
-    MPI_Comm_rank ( new_comm, &newnewrank );
-    MPI_Cart_rank ( new_comm, coords, &new_rank );
-    if ( new_rank != newnewrank ) {
-       printf( "New rank of cartsub comm (%d) != old rank (%d)\n", 
-               new_rank, newnewrank );
-       errors++;
-    }
-    /* Does the mapping from rank to coords work */
-    MPI_Cart_coords ( new_comm, new_rank, NUM_DIMS -1, new_coords );
-    for (i=0;i<NUM_DIMS-1;i++) 
-       if ( coords[i] != new_coords[i] ) {
-           printf( "Old coords[%d] of cartsub comm (%d) != new_coords (%d)\n", 
-                   i, coords[i], new_coords[i] );
-           errors++;
-       }
-
-    /* We're at the end */
-    MPI_Comm_free( &new_comm );
-    MPI_Comm_free( &comm_temp );
-    MPI_Comm_free( &comm_cart );
-    Test_Waitforall( );
-    if (errors) printf( "[%d] done with %d ERRORS!\n", rank,errors );
-    MPI_Finalize();
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/topol/dims.c b/teshsuite/smpi/mpich-test/topol/dims.c
deleted file mode 100644 (file)
index c9c4747..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; -*- */
-
-#include "mpi.h"
-#include <stdio.h>
-
-int main( int argc, char *argv[] )
-{
-    int dims[10];
-    int i, j, ndims, totnodes, err, errcnt = 0;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
-
-    /* Try for error checks */
-    dims[0] = 2;
-    dims[1] = 2;
-    dims[2] = 0;
-    err = MPI_Dims_create( 26, 3, dims );
-    if (err == MPI_SUCCESS) {
-       printf( "The product of the specified dims does not divide the nnodes and MPI_Dims_create did not return an error\n" );
-       for (i=0; i<3; i++) {
-           printf( "dims[%d] = %d\n", i, dims[i] );
-       }
-       errcnt++;
-    }
-
-    /* Check for a few reasonable decompositions */
-    dims[0] = dims[1] = 0;
-    err = MPI_Dims_create( 16, 2, dims );
-    if (err) {
-       char msg[MPI_MAX_ERROR_STRING];
-       int result_len;
-       MPI_Error_string( err, msg, &result_len );
-       printf( "Unexpected error return from dims_create (16,2) %s\n", msg );
-       errcnt++;
-    }
-    else {
-       if (dims[0] * dims[1] != 16) {
-           printf( "Returned dimensions do not match request\n" );
-           errcnt++;
-       }
-#ifdef MPICH_NAME
-       if (dims[0] != 4) {
-           errcnt++;
-           printf( "Expected 4 x 4, got %d x %d\n", dims[0],dims[1] );
-       }
-#endif
-    }
-
-    dims[0] = dims[1] = 0;
-    /* 60 = 2 * 2 * 3 * 5 */
-    err = MPI_Dims_create( 60, 2, dims );
-    if (err) {
-       char msg[MPI_MAX_ERROR_STRING];
-       int result_len;
-       MPI_Error_string( err, msg, &result_len );
-       printf( "Unexpected error return from dims_create (16,2) %s\n", msg );
-       errcnt++;
-    }
-    else {
-       if (dims[0] * dims[1] != 60) {
-           printf( "Returned dimensions do not match request (%d)\n",
-                   dims[0] * dims[1] );
-           errcnt++;
-       }
-#ifdef MPICH_NAME
-       if (dims[0] == 1 || dims[1] == 1) {
-           errcnt++;
-           printf( "Expected rectangular decomp, got %d x %d\n", 
-                   dims[0],dims[1] );
-       }
-#endif
-    }
-
-    /* Test a range of values */
-    for (ndims=1; ndims<=4; ndims++) {
-       for (i=2; i<64; i++) {
-           for (j=0; j<ndims; j++) {
-               dims[j] = 0;
-           }
-           MPI_Dims_create( i, ndims, dims );
-           /* Check the results */
-           totnodes = 1;
-           for (j=0; j<ndims; j++) {
-               totnodes *= dims[j];
-               if (dims[j] <= 0) {
-                   errcnt++;
-                   printf( "Non positive dims[%d] = %d for %d nodes and %d ndims\n", 
-                           j, dims[j], i, ndims );
-               }
-           }
-           if (totnodes != i) {
-               errcnt++;
-               printf( "Did not correctly partition %d nodes among %d dims (got %d nodes)\n",
-                       i, ndims, totnodes );
-               if (ndims > 1) {
-                   printf( "Dims = " );
-                   for (j=0; j<ndims; j++) {
-                       printf( " %d", dims[j] );
-                   }
-                   printf( "\n" );
-               }
-           }
-               
-       }
-    }
-    /* Summarize the results */
-    if (errcnt) {
-       printf( " %d errors found\n", errcnt );
-    }
-    else {
-       printf( " No Errors\n" );
-    }
-    MPI_Finalize( );
-    return 0;
-}
diff --git a/teshsuite/smpi/mpich-test/topol/graphtest.c b/teshsuite/smpi/mpich-test/topol/graphtest.c
deleted file mode 100644 (file)
index ee60559..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-
-  Test for the MPI Graph routines :
-
-  MPI_Graphdims_get
-  MPI_Graph_create
-  MPI_Graph_get
-  MPI_Graph_map
-  MPI_Graph_neighbors
-  MPI_Graph_neighbors_count
-*/
-
-
-#include "mpi.h"
-#include <stdio.h>
-/* stdlib.h Needed for malloc declaration */
-#include <stdlib.h>
-#include "test.h"
-
-void NumberEdges ( int **, int **, int, int, int );
-void PrintGraph  ( int, int *, int * );
-
-int main( int argc, char **argv )
-{
-    MPI_Comm comm, new_comm;
-    int      reorder;
-    int      nbrarray[3], baseindex;
-    int      size, i, j, nnodes, nedges, q_nnodes, q_nedges, q_nnbrs, newrank;
-    int      *index, *edges, *q_index, *q_edges, *rankbuf;
-    int      worldrank, err = 0, toterr;
-
-    MPI_Init( &argc, &argv );
-
-    MPI_Comm_rank( MPI_COMM_WORLD, &worldrank );
-
-/* Generate the graph for a binary tree.  
-   
-   Note that EVERY process must have the SAME data
-   */
-    comm = MPI_COMM_WORLD;
-    MPI_Comm_size( comm, &size );
-
-    index = (int *)malloc( (size + 1) * sizeof(int) );
-    edges = (int *)malloc( (size + 1) * 3 * sizeof(int) );
-    reorder = 0;
-    for (i=0; i < size; i++) {
-       index[i] = 0;
-    }
-    NumberEdges( &index, &edges, -1, 0, size - 1 );
-    nedges= index[0];
-    for (i=1; i<size; i++) {
-       nedges += index[i];
-       index[i] = index[i] + index[i-1];
-    }
-    nnodes = size;
-#ifdef DEBUG
-    PrintGraph( nnodes, index, edges );
-#endif
-    MPI_Graph_create( comm, nnodes, index, edges, reorder, &new_comm );
-
-/* Now, try to get the information about this graph */
-    MPI_Graphdims_get( new_comm, &q_nnodes, &q_nedges );
-    if (q_nnodes != nnodes) {
-       printf( "Wrong number of nodes, expected %d got %d\n", nnodes, q_nnodes );
-       err++;
-    }
-    if (q_nedges != nedges) {
-       printf( "Wrong number of edges; expected %d got %d\n", nedges, q_nedges );
-       err++;
-    }
-    q_index = (int *)malloc( q_nnodes * sizeof(int) );
-    q_edges = (int *)malloc( q_nedges * sizeof(int) );
-
-    MPI_Graph_get( new_comm, q_nnodes, q_nedges, q_index, q_edges );
-
-/* Check with original */
-    if (worldrank == 0) {
-       printf( "Checking graph_get\n" );
-    }
-/* Because reorder was set to zero, we should have the same data */
-    for (i=0; i<size; i++) {
-       if (index[i] != q_index[i]) {
-           err++;
-           printf( "index[%d] is %d, should be %d\n", i, q_index[i], index[i] );
-       }
-    }
-    for (i=0; i<nedges; i++) {
-       if (edges[i] != q_edges[i]) {
-           err++;
-           printf( "edges[%d] is %d, should be %d\n", i, q_edges[i], edges[i] );
-       }
-    }
-
-/* Now, get each neighbor set individually */
-    for (i=0; i<size; i++) {
-       MPI_Graph_neighbors_count( new_comm, i, &q_nnbrs );
-       MPI_Graph_neighbors( new_comm, i, 3, nbrarray );
-
-       /* Need to test */
-       baseindex = (i > 0) ? index[i-1] : 0;
-       for (j=0; j<q_nnbrs; j++) {
-           if (nbrarray[j] != edges[baseindex+j]) {
-               err++;
-               printf( "nbrarray[%d] for rank %d should be %d, is %d\n",
-                       j, i, edges[baseindex+j], nbrarray[j] );
-           }
-       }
-    }
-
-/* Test MPI_Graph_map by seeing what ranks are generated for this graph */
-    MPI_Graph_map( comm, nnodes, index, edges, &newrank );
-
-    if (worldrank == 0) {
-       printf( "Checking graph_map\n" );
-    }
-/* Check that the ranks are at least disjoint among all processors. */
-    rankbuf = (int *)malloc( size * sizeof(int) );
-    MPI_Allgather( &newrank, 1, MPI_INT, rankbuf, 1, MPI_INT, comm );
-    for (i=0; i<size; i++) {
-       for (j=0; j<size; j++) {
-           if (rankbuf[j] == i) break;
-       }
-       if (j >= size) {
-           err++;
-           printf( "Rank %d missing in graph_map\n", i );
-       }
-    }
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (worldrank == 0) {
-       if (toterr == 0) 
-           printf( "No errors in MPI Graph routines\n" );
-       else
-           printf( "Found %d errors in MPI Graph routines\n", toterr );
-    }
-
-    MPI_Comm_free( &new_comm );
-    free( index );
-    free( edges );
-    free( q_index );
-    free( q_edges );
-    free( rankbuf );
-    MPI_Finalize( );
-    return 0;
-}
-
-/* 
- * Routine to print out a graph for debugging
- */
-void PrintGraph( nnodes, index, edges )
-int nnodes, *index, *edges;
-{
-    int i, lastidx, j;
-    lastidx=0;
-    printf( "rank\tindex\tedges\n" );
-    for (i=0; i<nnodes; i++) {
-       printf( "%d\t%d\t", i, index[i] );
-       for (j=0; j<index[i] - lastidx; j++) {
-           printf( "%d ", *edges++ );
-       }
-       printf( "\n" );
-       lastidx = index[i];
-    }
-}
-
-/* 
-   Number index[0] as first, add its children, and then number them.
-   Note that because of the way the index/edge list is defined, we 
-   need to do a depth-first evaluation
-
-   Each process is connected to the processes rank+1
-   and rank + 1 + floor((size)/2), where size is the size of the subtree 
-
-   Make index[i] the DEGREE of node i.  We'll make the relative to 0
-   at the end.
- */
-void NumberEdges( Index, Edges, parent, first, last )
-int **Index, **Edges, parent, first, last;
-{
-    int *index = *Index;
-    int *edges = *Edges;
-    int right;
-
-    index[0] = 0;
-    if (parent >= 0) {
-#ifdef DEBUG    
-       printf( "Adding parent %d to %d\n", parent, first );
-#endif
-       *index   = *index + 1;
-       *edges++ = parent;
-    }
-    if (first >= last) {
-       /* leaf */
-       index++;
-       if (parent >= 0) {
-           *Index = index;
-           *Edges = edges;
-       }
-       return;
-    }
-
-/* Internal node.  Always at least a left child */
-#ifdef DEBUG
-    printf( "Adding left child %d to %d\n", first + 1, first );
-#endif
-    *index      = *index + 1;
-    *edges++ = first + 1;
-
-/* Try to add a right child */
-    right = (last - first)/2;
-    right = first + right + 1;
-    if (right == first + 1) 
-       right++;
-    if (right <= last) {
-       /* right child */
-#ifdef DEBUG    
-       printf( "Adding rightchild %d to %d\n", right, first );
-#endif
-       *index   = *index + 1;
-       *edges++ = right;
-    }
-    index++;
-    if (first + 1 <= last && right - 1 > first) {
-       NumberEdges( &index, &edges, first, first + 1, 
-                    (right <= last) ? right - 1: last );
-    }
-    if (right <= last) {
-       NumberEdges( &index, &edges, first, right, last );
-    }
-    if (parent >= 0) {
-       *Index = index;
-       *Edges = edges;
-    }
-}
diff --git a/teshsuite/smpi/mpich-test/topol/graphtest.std b/teshsuite/smpi/mpich-test/topol/graphtest.std
deleted file mode 100644 (file)
index 0182e23..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-**** Testing MPI_Graph_create etc ****
-Checking graph_get
-Checking graph_map
-No errors in MPI Graph routines
-**** Testing MPI_Graph_create etc ****
diff --git a/teshsuite/smpi/mpich-test/topol/test.c b/teshsuite/smpi/mpich-test/topol/test.c
deleted file mode 100644 (file)
index 9c7b299..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Procedures for recording and printing test results */
-
-#include <stdio.h>
-#include <string.h>
-#include "test.h"
-#include "mpi.h"
-
-static int tests_passed = 0;
-static int tests_failed = 0;
-static char failed_tests[255][81];
-static char suite_name[255];
-FILE *fileout = NULL;
-
-void Test_Init(suite, rank)
-char *suite;
-int rank;
-{
-    char filename[512];
-
-    sprintf(filename, "%s-%d.out", suite, rank);
-    strncpy(suite_name, suite, 255);
-    fileout = fopen(filename, "w");
-    if (!fileout) {
-       fprintf( stderr, "Could not open %s on node %d\n", filename, rank );
-       MPI_Abort( MPI_COMM_WORLD, 1 );
-    }
-}
-
-void Test_Message(mess)
-char *mess;
-{
-    fprintf(fileout, "[%s]: %s\n", suite_name, mess);
-    fflush(fileout);
-}
-
-void Test_Failed(test)
-char *test;
-{
-    fprintf(fileout, "[%s]: *** Test '%s' Failed! ***\n", suite_name, test);
-    strncpy(failed_tests[tests_failed], test, 81);
-    fflush(fileout);
-    tests_failed++;
-}
-
-void Test_Passed(test)
-char *test;
-{
-#ifdef VERBOSE    
-    fprintf(fileout, "[%s]: Test '%s' Passed.\n", suite_name, test);
-    fflush(fileout);
-#endif
-    tests_passed++;
-}
-
-int Summarize_Test_Results()
-{
-#ifdef VERBOSE
-    fprintf(fileout, "For test suite '%s':\n", suite_name);
-#else
-    if (tests_failed > 0)
-#endif
-    {
-       fprintf(fileout, "Of %d attempted tests, %d passed, %d failed.\n", 
-               tests_passed + tests_failed, tests_passed, tests_failed);
-    }
-    if (tests_failed > 0) {
-       int i;
-
-       fprintf(fileout, "*** Tests Failed:\n");
-       for (i = 0; i < tests_failed; i++)
-           fprintf(fileout, "*** %s\n", failed_tests[i]);
-    }
-    return tests_failed;
-}
-
-void Test_Finalize()
-{
-    fflush(fileout);
-    fclose(fileout);
-}
-
-#include "mpi.h"
-/* Wait for every process to pass through this point.  This test is used
-   to make sure that all processes complete, and that a test "passes" because
-   it executed, not because it some process failed.  
- */
-void Test_Waitforall( )
-{
-int m, one, myrank, n;
-
-MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
-MPI_Comm_size( MPI_COMM_WORLD, &n );
-one = 1;
-MPI_Allreduce( &one, &m, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-
-if (m != n) {
-    printf( "[%d] Expected %d processes to wait at end, got %d\n", myrank, 
-           n, m );
-    }
-if (myrank == 0) 
-    printf( " No Errors\n" );
-}
diff --git a/teshsuite/smpi/mpich-test/topol/test.h b/teshsuite/smpi/mpich-test/topol/test.h
deleted file mode 100644 (file)
index b79cd2c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Header for testing procedures */
-
-#ifndef _INCLUDED_TEST_H_
-#define _INCLUDED_TEST_H_
-
-#if defined(NEEDS_STDLIB_PROTOTYPES)
-#include "protofix.h"
-#endif
-
-void Test_Init (char *, int);
-#ifdef USE_STDARG
-void Test_Printf (char *, ...);
-#else
-/* No prototype */
-void Test_Printf();
-#endif
-void Test_Message (char *);
-void Test_Failed (char *);
-void Test_Passed (char *);
-int Summarize_Test_Results (void);
-void Test_Finalize (void);
-void Test_Waitforall (void);
-
-#endif
diff --git a/teshsuite/smpi/mpich-test/topol/twod.f b/teshsuite/smpi/mpich-test/topol/twod.f
deleted file mode 100644 (file)
index 6d791b3..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-c**********************************************************************
-c   twod.f - a solution to the Poisson problem by using Jacobi 
-c   interation on a 2-d decomposition
-c     
-c   .... the rest of this is from pi3.f to show the style ...
-c
-c   Each node: 
-c    1) receives the number of rectangles used in the approximation.
-c    2) calculates the areas of it's rectangles.
-c    3) Synchronizes for a global summation.
-c   Node 0 prints the result.
-c
-c  Variables:
-c
-c    pi  the calculated result
-c    n   number of points of integration.  
-c    x           midpoint of each rectangle's interval
-c    f           function to integrate
-c    sum,pi      area of rectangles
-c    tmp         temporary scratch space for global summation
-c    i           do loop index
-c
-c     This code is included (without the prints) because one version of
-c     MPICH SEGV'ed (probably because of errors in handling send/recv of
-c     MPI_PROC_NULL source/destination).
-c
-c****************************************************************************
-      program main
-      include "mpif.h"
-      integer maxn
-      parameter (maxn = 128)
-      double precision  a(maxn,maxn), b(maxn,maxn), f(maxn,maxn)
-      integer nx, ny
-      integer myid, numprocs, it, rc, comm2d, ierr, stride
-      integer nbrleft, nbrright, nbrtop, nbrbottom
-      integer sx, ex, sy, ey
-      integer dims(2)
-      logical periods(2)
-      double precision diff2d, diffnorm, dwork
-      double precision t1, t2
-      external diff2d
-      data periods/2*.false./
-
-      call MPI_INIT( ierr )
-      call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
-      call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
-c      print *, "Process ", myid, " of ", numprocs, " is alive"
-      if (myid .eq. 0) then
-c
-c         Get the size of the problem
-c
-c          print *, 'Enter nx'
-c          read *, nx
-           nx = 10
-      endif
-c      print *, 'About to do bcast on ', myid
-      call MPI_BCAST(nx,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
-      ny   = nx
-c
-c Get a new communicator for a decomposition of the domain.  Let MPI
-c find a "good" decomposition
-c
-      dims(1) = 0
-      dims(2) = 0
-      call MPI_DIMS_CREATE( numprocs, 2, dims, ierr )
-      call MPI_CART_CREATE( MPI_COMM_WORLD, 2, dims, periods, .true.,
-     *                    comm2d, ierr )
-c
-c Get my position in this communicator
-c 
-      call MPI_COMM_RANK( comm2d, myid, ierr )
-c      print *, "Process ", myid, " of ", numprocs, " is alive"
-c
-c My neighbors are now +/- 1 with my rank.  Handle the case of the 
-c boundaries by using MPI_PROCNULL.
-      call fnd2dnbrs( comm2d, nbrleft, nbrright, nbrtop, nbrbottom )
-c      print *, "Process ", myid, ":", 
-c     *     nbrleft, nbrright, nbrtop, nbrbottom
-c
-c Compute the decomposition
-c     
-      call fnd2ddecomp( comm2d, nx, sx, ex, sy, ey )
-c      print *, "Process ", myid, ":", sx, ex, sy, ey
-c
-c Create a new, "strided" datatype for the exchange in the "non-contiguous"
-c direction
-c
-      call mpi_Type_vector( ey-sy+1, 1, ex-sx+3, 
-     $                      MPI_DOUBLE_PRECISION, stride, ierr )
-      call mpi_Type_commit( stride, ierr )
-c
-c
-c Initialize the right-hand-side (f) and the initial solution guess (a)
-c
-      call twodinit( a, b, f, nx, sx, ex, sy, ey )
-c
-c Actually do the computation.  Note the use of a collective operation to
-c check for convergence, and a do-loop to bound the number of iterations.
-c
-      call MPI_BARRIER( MPI_COMM_WORLD, ierr )
-      t1 = MPI_WTIME()
-      do 10 it=1, 100
-        call exchng2( a, b, sx, ex, sy, ey, comm2d, stride, 
-     $                nbrleft, nbrright, nbrtop, nbrbottom )
-        call sweep2d( b, f, nx, sx, ex, sy, ey, a )
-        call exchng2( b, a, sx, ex, sy, ey, comm2d, stride, 
-     $                nbrleft, nbrright, nbrtop, nbrbottom )
-        call sweep2d( a, f, nx, sx, ex, sy, ey, b )
-        dwork = diff2d( a, b, nx, sx, ex, sy, ey )
-        call MPI_Allreduce( dwork, diffnorm, 1, MPI_DOUBLE_PRECISION, 
-     $                     MPI_SUM, comm2d, ierr )
-        if (diffnorm .lt. 1.0e-5) goto 20
-c        if (myid .eq. 0) print *, 2*it, ' Difference is ', diffnorm
-10     continue
-      if (myid .eq. 0) print *, 'Failed to converge'
-20    continue
-      t2 = MPI_WTIME()
-c      if (myid .eq. 0) then
-c         print *, 'Converged after ', 2*it, ' Iterations in ', t2 - t1,
-c     $        ' secs '
-c      endif
-c
-c
-      call MPI_Type_free( stride, ierr )
-      call MPI_Comm_free( comm2d, ierr )
-      if (myid .eq. 0) then
-         print *, ' No Errors'
-      endif
-      call MPI_FINALIZE(rc)
-      end
-c
-c Perform a Jacobi sweep for a 2-d decomposition
-c
-      subroutine sweep2d( a, f, n, sx, ex, sy, ey, b )
-      integer n, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), f(sx-1:ex+1, sy-1:ey+1),
-     +                 b(sx-1:ex+1, sy-1:ey+1)
-c
-      integer i, j
-      double precision h
-c
-      h = 1.0d0 / dble(n+1)
-      do 10 i=sx, ex
-         do 10 j=sy, ey
-            b(i,j) = 0.25 * (a(i-1,j)+a(i,j+1)+a(i,j-1)+a(i+1,j)) - 
-     +               h * h * f(i,j)
- 10   continue
-      return
-      end
-
-       subroutine exchng2( a, b, sx, ex, sy, ey, 
-     $                     comm2d, stride, 
-     $                     nbrleft, nbrright, nbrtop, nbrbottom  )
-       include "mpif.h"
-       integer sx, ex, sy, ey, stride
-       double precision a(sx-1:ex+1, sy-1:ey+1), 
-     $                  b(sx-1:ex+1, sy-1:ey+1)
-       integer nbrleft, nbrright, nbrtop, nbrbottom, comm2d
-       integer status(MPI_STATUS_SIZE), ierr, nx
-c
-       nx = ex - sx + 1
-c  These are just like the 1-d versions, except for less data
-        call MPI_SENDRECV( b(ex,sy),  nx, MPI_DOUBLE_PRECISION, 
-     $                    nbrtop, 0,
-     $                    a(sx-1,sy), nx, MPI_DOUBLE_PRECISION, 
-     $                    nbrbottom, 0, comm2d, status, ierr )
-        call MPI_SENDRECV( b(sx,sy),  nx, MPI_DOUBLE_PRECISION,
-     $                    nbrbottom, 1,
-     $                    a(ex+1,sy), nx, MPI_DOUBLE_PRECISION, 
-     $                    nbrtop, 1, comm2d, status, ierr )
-c
-c This uses the "strided" datatype
-        call MPI_SENDRECV( b(sx,ey),  1, stride, nbrright,  0,
-     $                     a(sx,sy-1), 1, stride, nbrleft,  0, 
-     $                     comm2d, status, ierr )
-        call MPI_SENDRECV( b(sx,sy),  1, stride, nbrleft,   1,
-     $                     a(sx,ey+1), 1, stride, nbrright, 1, 
-     $                     comm2d, status, ierr )
-        return
-        end
-
-c
-c  The rest of the 2-d program
-c
-      double precision function diff2d( a, b, nx, sx, ex, sy, ey )
-      integer nx, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), b(sx-1:ex+1, sy-1:ey+1)
-c
-      double precision sum
-      integer i, j
-c
-      sum = 0.0d0
-      do 10 j=sy,ey
-         do 10 i=sx,ex
-            sum = sum + (a(i,j) - b(i,j)) ** 2
- 10      continue
-c      
-      diff2d = sum
-      return
-      end
-      subroutine twodinit( a, b, f, nx, sx, ex, sy, ey )
-      integer nx, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), b(sx-1:ex+1, sy-1:ey+1),
-     &                 f(sx-1:ex+1, sy-1:ey+1)
-c
-      integer i, j
-c
-      do 10 j=sy-1,ey+1
-         do 10 i=sx-1,ex+1
-            a(i,j) = 0.0d0
-            b(i,j) = 0.0d0
-            f(i,j) = 0.0d0
- 10      continue
-c      
-c    Handle boundary conditions
-c
-      if (sx .eq. 1) then 
-         do 20 j=sy,ey
-            a(0,j) = 1.0d0
-            b(0,j) = 1.0d0
- 20      continue
-      endif
-      if (ex .eq. nx) then
-         do 21 j=sy,ey
-            a(nx+1,j) = 0.0d0
-            b(nx+1,j) = 0.0d0
- 21      continue
-      endif 
-      if (sy .eq. 1) then
-         do 30 i=sx,ex
-            a(i,0) = 1.0d0
-            b(i,0) = 1.0d0
- 30      continue 
-      endif
-c
-      return
-      end
-
-c
-c  This file contains a routine for producing a decomposition of a 1-d array
-c  when given a number of processors.  It may be used in "direct" product
-c  decomposition.  The values returned assume a "global" domain in [1:n]
-c
-      subroutine MPE_DECOMP1D( n, numprocs, myid, s, e )
-      integer n, numprocs, myid, s, e
-      integer nlocal
-      integer deficit
-c
-      nlocal  = n / numprocs
-      s       = myid * nlocal + 1
-      deficit = mod(n,numprocs)
-      s       = s + min(myid,deficit)
-      if (myid .lt. deficit) then
-          nlocal = nlocal + 1
-      endif
-      e = s + nlocal - 1
-      if (e .gt. n .or. myid .eq. numprocs-1) e = n
-      return
-      end
-c
-c This routine show how to determine the neighbors in a 2-d decomposition of
-c the domain. This assumes that MPI_Cart_create has already been called 
-c
-      subroutine fnd2dnbrs( comm2d, 
-     $                      nbrleft, nbrright, nbrtop, nbrbottom )
-      integer comm2d, nbrleft, nbrright, nbrtop, nbrbottom
-c
-      integer ierr
-c
-      call MPI_Cart_shift( comm2d, 0,  1, nbrleft,   nbrright, ierr )
-      call MPI_Cart_shift( comm2d, 1,  1, nbrbottom, nbrtop,   ierr )
-c
-      return
-      end
-c
-c Note: THIS IS A TEST PROGRAM.  THE ACTUAL VALUES MOVED ARE NOT
-c CORRECT FOR A POISSON SOLVER.
-c
-      subroutine fnd2ddecomp( comm2d, n, sx, ex, sy, ey )
-      integer comm2d
-      integer n, sx, ex, sy, ey
-      integer dims(2), coords(2), ierr
-      logical periods(2)
-c
-      call MPI_Cart_get( comm2d, 2, dims, periods, coords, ierr )
-
-      call MPE_DECOMP1D( n, dims(1), coords(1), sx, ex )
-      call MPE_DECOMP1D( n, dims(2), coords(2), sy, ey )
-c
-      return
-      end
diff --git a/teshsuite/smpi/mpich-test/topol/twod2.f b/teshsuite/smpi/mpich-test/topol/twod2.f
deleted file mode 100644 (file)
index eb5ea75..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-c**********************************************************************
-c   twod.f - a solution to the Poisson problem by using Jacobi 
-c   interation on a 2-d decomposition
-c     
-c   .... the rest of this is from pi3.f to show the style ...
-c
-c   Each node: 
-c    1) receives the number of rectangles used in the approximation.
-c    2) calculates the areas of it's rectangles.
-c    3) Synchronizes for a global summation.
-c   Node 0 prints the result.
-c
-c  Variables:
-c
-c    pi  the calculated result
-c    n   number of points of integration.  
-c    x           midpoint of each rectangle's interval
-c    f           function to integrate
-c    sum,pi      area of rectangles
-c    tmp         temporary scratch space for global summation
-c    i           do loop index
-c
-c     This code is included (without the prints) because one version of
-c     MPICH SEGV'ed (probably because of errors in handling send/recv of
-c     MPI_PROC_NULL source/destination).
-c
-c****************************************************************************
-      program main
-      include "mpif.h"
-      integer maxn
-      parameter (maxn = 128)
-      double precision  a(maxn,maxn), b(maxn,maxn), f(maxn,maxn)
-      integer nx, ny
-      integer myid, numprocs, it, rc, comm2d, ierr, stride
-      integer nbrleft, nbrright, nbrtop, nbrbottom
-      integer sx, ex, sy, ey
-      integer dims(2)
-      logical periods(2)
-      double precision diff2d, diffnorm, dwork
-      double precision t1, t2
-      external diff2d
-      data periods/2*.false./
-
-      call MPI_INIT( ierr )
-      call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
-      call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr )
-c      print *, "Process ", myid, " of ", numprocs, " is alive"
-      if (myid .eq. 0) then
-c
-c         Get the size of the problem
-c
-c          print *, 'Enter nx'
-c          read *, nx
-           nx = 10
-      endif
-c      print *, 'About to do bcast on ', myid
-      call MPI_BCAST(nx,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
-      ny   = nx
-c
-c Get a new communicator for a decomposition of the domain.  Let MPI
-c find a "good" decomposition
-c
-      dims(1) = 0
-      dims(2) = 0
-      call MPI_DIMS_CREATE( numprocs, 2, dims, ierr )
-      call MPI_CART_CREATE( MPI_COMM_WORLD, 2, dims, periods, .true.,
-     *                    comm2d, ierr )
-c
-c Get my position in this communicator
-c 
-      call MPI_COMM_RANK( comm2d, myid, ierr )
-c      print *, "Process ", myid, " of ", numprocs, " is alive"
-c
-c My neighbors are now +/- 1 with my rank.  Handle the case of the 
-c boundaries by using MPI_PROCNULL.
-      call fnd2dnbrs( comm2d, nbrleft, nbrright, nbrtop, nbrbottom )
-c      print *, "Process ", myid, ":", 
-c     *     nbrleft, nbrright, nbrtop, nbrbottom
-c
-c Compute the decomposition
-c     
-      call fnd2ddecomp( comm2d, nx, sx, ex, sy, ey )
-c      print *, "Process ", myid, ":", sx, ex, sy, ey
-c
-c Create a new, "strided" datatype for the exchange in the "non-contiguous"
-c direction
-c
-      call mpi_Type_vector( ey-sy+1, 1, ex-sx+3, 
-     $                      MPI_DOUBLE_PRECISION, stride, ierr )
-      call mpi_Type_commit( stride, ierr )
-c
-c
-c Initialize the right-hand-side (f) and the initial solution guess (a)
-c
-      call twodinit( a, b, f, nx, sx, ex, sy, ey )
-c
-c Actually do the computation.  Note the use of a collective operation to
-c check for convergence, and a do-loop to bound the number of iterations.
-c
-      call MPI_BARRIER( MPI_COMM_WORLD, ierr )
-      t1 = MPI_WTIME()
-      do 10 it=1, 100
-       call exchng2( b, sx, ex, sy, ey, comm2d, stride, 
-     $                nbrleft, nbrright, nbrtop, nbrbottom )
-       call sweep2d( b, f, nx, sx, ex, sy, ey, a )
-       call exchng2( a, sx, ex, sy, ey, comm2d, stride, 
-     $                nbrleft, nbrright, nbrtop, nbrbottom )
-       call sweep2d( a, f, nx, sx, ex, sy, ey, b )
-       dwork = diff2d( a, b, nx, sx, ex, sy, ey )
-       call MPI_Allreduce( dwork, diffnorm, 1, MPI_DOUBLE_PRECISION, 
-     $                     MPI_SUM, comm2d, ierr )
-        if (diffnorm .lt. 1.0e-5) goto 20
-        if (myid .eq. 0) print *, 2*it, ' Difference is ', diffnorm
-10     continue
-      if (myid .eq. 0) print *, 'Failed to converge'
-20    continue
-      t2 = MPI_WTIME()
-c      if (myid .eq. 0) then
-c         print *, 'Converged after ', 2*it, ' Iterations in ', t2 - t1,
-c     $        ' secs '
-c      endif
-c
-c
-      call MPI_Type_free( stride, ierr )
-      call MPI_Comm_free( comm2d, ierr )
-      call MPI_FINALIZE(rc)
-      end
-c
-c Perform a Jacobi sweep for a 2-d decomposition
-c
-      subroutine sweep2d( a, f, n, sx, ex, sy, ey, b )
-      integer n, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), f(sx-1:ex+1, sy-1:ey+1),
-     +                 b(sx-1:ex+1, sy-1:ey+1)
-c
-      integer i, j
-      double precision h
-c
-      h = 1.0d0 / dble(n+1)
-      do 10 j=sy, ey
-         do 10 i=sx, ex
-            b(i,j) = 0.25 * (a(i-1,j)+a(i,j+1)+a(i,j-1)+a(i+1,j)) - 
-     +               h * h * f(i,j)
- 10   continue
-      return
-      end
-c
-       subroutine exchng2( a, sx, ex, sy, ey, 
-     $                     comm2d, stride, 
-     $                     nbrleft, nbrright, nbrtop, nbrbottom  )
-       include "mpif.h"
-       integer sx, ex, sy, ey, stride
-       double precision a(sx-1:ex+1, sy-1:ey+1)
-       integer nbrleft, nbrright, nbrtop, nbrbottom, comm2d
-       integer status(MPI_STATUS_SIZE), ierr, nx
-c
-       nx = ex - sx + 1
-c  These are just like the 1-d versions, except for less data
-       call MPI_SENDRECV( a(sx,ey),  nx, MPI_DOUBLE_PRECISION, 
-     $                           nbrtop, 0,
-     $                    a(sx,sy-1), nx, MPI_DOUBLE_PRECISION, 
-     $                    nbrbottom, 0, comm2d, status, ierr )
-       call MPI_SENDRECV( a(sx,sy),  nx, MPI_DOUBLE_PRECISION,
-     $                    nbrbottom, 1,
-     $                    a(sx,ey+1), nx, MPI_DOUBLE_PRECISION, 
-     $                    nbrtop, 1, comm2d, status, ierr )
-c
-c This uses the "strided" datatype
-       call MPI_SENDRECV( a(ex,sy),  1, stride, nbrright,  0,
-     $                     a(sx-1,sy), 1, stride, nbrleft,  0, 
-     $                     comm2d, status, ierr )
-       call MPI_SENDRECV( a(sx,sy),  1, stride, nbrleft,   1,
-     $                     a(ex+1,sy), 1, stride, nbrright, 1, 
-     $                     comm2d, status, ierr )
-       return
-       end
-
-c
-c  The rest of the 2-d program
-c
-      double precision function diff2d( a, b, nx, sx, ex, sy, ey )
-      integer nx, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), b(sx-1:ex+1, sy-1:ey+1)
-c
-      double precision sum
-      integer i, j
-c
-      sum = 0.0d0
-      do 10 j=sy,ey
-         do 10 i=sx,ex
-            sum = sum + (a(i,j) - b(i,j)) ** 2
- 10      continue
-c      
-      diff2d = sum
-      return
-      end
-      subroutine twodinit( a, b, f, nx, sx, ex, sy, ey )
-      integer nx, sx, ex, sy, ey
-      double precision a(sx-1:ex+1, sy-1:ey+1), b(sx-1:ex+1, sy-1:ey+1),
-     &                 f(sx-1:ex+1, sy-1:ey+1)
-c
-      integer i, j
-c
-      do 10 j=sy-1,ey+1
-         do 10 i=sx-1,ex+1
-            a(i,j) = 0.0d0
-            b(i,j) = 0.0d0
-            f(i,j) = 0.0d0
- 10      continue
-c      
-c    Handle boundary conditions
-c
-      if (sx .eq. 1) then 
-         do 20 j=sy,ey
-            a(0,j) = 1.0d0
-            b(0,j) = 1.0d0
- 20      continue
-      endif
-      if (ex .eq. nx) then
-         do 21 j=sy,ey
-            a(nx+1,j) = 0.0d0
-            b(nx+1,j) = 0.0d0
- 21      continue
-      endif 
-      if (sy .eq. 1) then
-         do 30 i=sx,ex
-            a(i,0) = 1.0d0
-            b(i,0) = 1.0d0
- 30      continue 
-      endif
-c
-      return
-      end
-
-c
-c  This file contains a routine for producing a decomposition of a 1-d array
-c  when given a number of processors.  It may be used in "direct" product
-c  decomposition.  The values returned assume a "global" domain in [1:n]
-c
-      subroutine MPE_DECOMP1D( n, numprocs, myid, s, e )
-      integer n, numprocs, myid, s, e
-      integer nlocal
-      integer deficit
-c
-      nlocal  = n / numprocs
-      s              = myid * nlocal + 1
-      deficit = mod(n,numprocs)
-      s              = s + min(myid,deficit)
-      if (myid .lt. deficit) then
-          nlocal = nlocal + 1
-      endif
-      e = s + nlocal - 1
-      if (e .gt. n .or. myid .eq. numprocs-1) e = n
-      return
-      end
-c
-c This routine show how to determine the neighbors in a 2-d decomposition of
-c the domain. This assumes that MPI_Cart_create has already been called 
-c
-      subroutine fnd2dnbrs( comm2d, 
-     $                      nbrleft, nbrright, nbrtop, nbrbottom )
-      integer comm2d, nbrleft, nbrright, nbrtop, nbrbottom
-c
-      integer ierr
-c
-      call MPI_Cart_shift( comm2d, 0,  1, nbrleft,   nbrright, ierr )
-      call MPI_Cart_shift( comm2d, 1,  1, nbrbottom, nbrtop,   ierr )
-c
-      return
-      end
-c
-c Note: THIS IS A TEST PROGRAM.  THE ACTUAL VALUES MOVED ARE NOT
-c CORRECT FOR A POISSON SOLVER.
-c
-      subroutine fnd2ddecomp( comm2d, n, sx, ex, sy, ey )
-      integer comm2d
-      integer n, sx, ex, sy, ey
-      integer dims(2), coords(2), ierr
-      logical periods(2)
-c
-      call MPI_Cart_get( comm2d, 2, dims, periods, coords, ierr )
-
-      call MPE_DECOMP1D( n, dims(1), coords(1), sx, ex )
-      call MPE_DECOMP1D( n, dims(2), coords(2), sy, ey )
-c
-      return
-      end
-      
-
similarity index 68%
rename from teshsuite/smpi/mpich-test/CMakeLists.txt
rename to teshsuite/smpi/mpich3-test/CMakeLists.txt
index da0de8a..645ace8 100644 (file)
@@ -35,5 +35,13 @@ endif()
 set(txt_files
   ${txt_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/README
-  ${CMAKE_CURRENT_SOURCE_DIR}/runbase
+  ${CMAKE_CURRENT_SOURCE_DIR}/runtests
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
+  ${CMAKE_CURRENT_SOURCE_DIR}/checktests
+  ${CMAKE_CURRENT_SOURCE_DIR}/util/mtest.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/f77/testlist
+  ${CMAKE_CURRENT_SOURCE_DIR}/f90/testlist
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/mpitestconf.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/mpitest.h
   PARENT_SCOPE)
diff --git a/teshsuite/smpi/mpich3-test/README b/teshsuite/smpi/mpich3-test/README
new file mode 100644 (file)
index 0000000..7b81d59
--- /dev/null
@@ -0,0 +1,155 @@
+MPICH Test Suite
+
+This test suite is a *supplement* to other test suites, including the
+original MPICH testsuite, the Intel testsuite, and the IBM MPI test suite 
+(or test suites derived from that test, including the MPI C++ tests).
+
+Building the Test Suite
+=======================
+In many cases, configure will find the MPI implementation
+automatically.  In some cases, it will need some help.  For example:
+
+For IBM MPI, where the compilation commands are not mpicc and mpif77 etc.:
+
+./configure CC=xlc MPICC=mpcc F77=xlf MPIF77=mpxlf CXX=xlC \
+                       MPICXX="mpCC -cpp" F90=xlf90 MPIF90=mpxlf90 \
+                      --disable-spawn \
+                      --enable-strictmpi
+
+(or the _r versions of the compilers)
+
+If mpicc and friends are not in your default path (and you do not want to
+add them), you can specify the path with --with-mpi=<path>.  For example,
+if they are in /usr/local/mympi/bin, use
+
+./configure --with-mpi=/usr/local/mympi 
+
+(configure will append the bin to the path that you give).
+
+You may need to add MPI_SIZEOF_OFFSET=8 .
+
+The option "-cpp" is needed for at least some versions of mpCC to define the
+C++ bindings of the MPI routines.
+
+For implementations that do not implement all of MPI-2, there are --disable
+options, including --disable-spawn and --disable-cxx.  To restrict tests to 
+just what is defined in the MPI specification, use --enable-strictmpi .
+
+The script that runs the tests assumes that the MPI implementation
+supports mpiexec; you should consider this the first test of the implementation.
+
+Setting Options
+===============
+The following environment variables will modify the behavior of the tests
+
+MPITEST_DEBUG - if set, output information for debugging the test suite
+MPITEST_VERBOSE - if set to an integer value, output messages whose
+                  level is at least that value (0 is a good choice here)
+MPITEST_RETURN_WITH_CODE - Set the return code from the test programs based on
+                        success or failure, with a zero for success and one
+                        for failure (value must be yes, YES, true, or TRUE to 
+                        turn this on)
+MPITEST_THREADLEVEL_DEFAULT - Set the default thread level.  Values are 
+                             multiple, serialized, funneled, and single.
+
+Batch Systems
+=============
+For systems that run applications through a batch system, the option "-batch"
+to the runtests script will create a script file that can be edited and 
+submitted to the batch system.  The script checktests can be run to 
+summarize the results.  
+
+Specifically, (assuming the bash shell, and that the directory "btest", a
+subdirectory of the test suite directory, is used for running the tests):
+
+export MPITEST_BATCHDIR=`pwd`/btest
+runtests -batch -tests=testlist
+... edit btest/runtests.batch to make it a value batch submissions script
+... run that script and wait for the batch job to complete
+cd btest && ../checktests 
+
+If a program other than mpiexec is used in the batch form to run programs, then
+specify that to runtests:
+
+    runtests -batch -mpiexec=aprun -tests=testlist
+
+(Here, aprun is the command used on Cray XE6 systems.)
+
+Note that some programs that are used to run MPI programs add extra output, 
+which can confuse any tool that depends on clean output in STDOUT.  Since
+such unfortunate behavior is common, the option -ignorebogus can be given 
+to checktests:
+
+cd btest && ../checktests --ignorebogus
+
+Controlling the Tests that are Run
+==================================
+The tests are actually built and run by the script "runtests".  This script 
+can be given a file that contains a list of the tests to run.  This file has
+two primary types of entries:
+
+    directories:  Enter directory and look for the file "testlist".  
+                  Recursively run the contents of that file
+    program names: Build and run that program
+
+Lines may also be commented out with "#".
+
+The simplest program line contains the name of the program and the number of
+MPI processes to use.  For example, the following will build the
+program sendrecv1 and run it with 4 processes:
+
+sendrecv1 4
+
+In addition, the program line can contain key=value pairs that provide 
+special information about running the test.  For example, 
+
+sendflood 8 timeLimit=600
+
+says to build and run the program sendflood with 8 MPI processes and
+permit the test to run for 600 seconds (by default, at least for
+MPICH, the default timelimit is 180 seconds).  Other key=value pairs
+can be used to select whether a program should be run at all,
+depending on the abilities of the MPI implementation (this is
+particularly important for Fortran programs, since preprocessor
+support for Fortran is a non-standard extension to the Fortran
+language, and there are some compilers that would not accept Fortran
+programs that used the preprocessor).
+
+The most important key=value pairs are:
+
+
+timeLimit=n : Use a timelimit of n seconds
+
+arg=string  : Run the program with string as an argument to the program
+
+mpiexecarg=string  : Run the program with string as an argument to mpiexec
+
+env=name=value : Run the program with environment variable "name" given the
+                 value "value"
+
+mpiversion=x.y : Build and run the program only if the MPI version is at 
+                 least x.y.  For example, 
+
+                distgraph1 4 mpiversion=2.2
+
+               will build and run distgraph1 with 4 MPI processes only 
+               if the MPI version is at least 2.2.
+
+strict=bool : If bool is false, only build and run the program if 
+              --enable-strictmpi was not used in configuring the test suite.
+             That is, a line such as 
+
+              neighb_coll 4 strict=false
+
+              Says that this test is not valid for a strict MPI implementation;
+              it contains extensions to the standard, or in the case of some
+             MPICH development, MPIX routines
+
+resultTest=proc : This is used to change the way in which the success or 
+                  failure of a test is evaluated.  proc is one of several 
+                  Perl subroutines defined within the runtest program.  These
+                  are primarily used within the testsuite for tests programs
+                  exit with expected status values or that timeouts are 
+                  in fact handled.
+
+
diff --git a/teshsuite/smpi/mpich3-test/attr/CMakeLists.txt b/teshsuite/smpi/mpich3-test/attr/CMakeLists.txt
new file mode 100644 (file)
index 0000000..90e04da
--- /dev/null
@@ -0,0 +1,91 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(attr2type attr2type.c ../util/mtest.c)
+  add_executable(attrend2 attrend2.c ../util/mtest.c)
+  add_executable(attrend attrend.c ../util/mtest.c)
+  add_executable(attrerr attrerr.c ../util/mtest.c)
+  add_executable(attrerrcomm attrerrcomm.c ../util/mtest.c)
+  add_executable(attrerrtype attrerrtype.c ../util/mtest.c)
+  add_executable(attric attric.c ../util/mtest.c)
+  add_executable(attrorder attrorder.c ../util/mtest.c)
+  add_executable(attrordercomm attrordercomm.c ../util/mtest.c)
+  add_executable(attrordertype attrordertype.c ../util/mtest.c)
+  add_executable(attrt attrt.c ../util/mtest.c)
+  add_executable(baseattr2 baseattr2.c ../util/mtest.c)
+  add_executable(baseattrcomm baseattrcomm.c ../util/mtest.c)
+  add_executable(fkeyval fkeyval.c ../util/mtest.c)
+  add_executable(fkeyvalcomm fkeyvalcomm.c ../util/mtest.c)
+  add_executable(fkeyvaltype fkeyvaltype.c ../util/mtest.c)
+  add_executable(keyval_double_free keyval_double_free.c ../util/mtest.c)
+
+  target_link_libraries(attr2type  simgrid)
+  target_link_libraries(attrend2 simgrid)
+  target_link_libraries(attrend simgrid)
+  target_link_libraries(attrerr simgrid)
+  target_link_libraries(attrerrcomm simgrid)
+  target_link_libraries(attrerrtype simgrid)
+  target_link_libraries(attric simgrid)
+  target_link_libraries(attrorder simgrid)
+  target_link_libraries(attrordercomm simgrid)
+  target_link_libraries(attrordertype simgrid)
+  target_link_libraries(attrt simgrid)
+  target_link_libraries(baseattr2 simgrid)
+  target_link_libraries(baseattrcomm simgrid)
+  target_link_libraries(fkeyval simgrid)
+  target_link_libraries(fkeyvalcomm simgrid)
+  target_link_libraries(fkeyvaltype simgrid)
+  target_link_libraries(keyval_double_free simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/attr2type.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrend2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrend.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrerrcomm.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrerrtype.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attric.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrorder.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrordercomm.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrordertype.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrt.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseattr2.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseattrcomm.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyval.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyvalcomm.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyvaltype.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/keyval_double_free.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/attr/attr2type.c b/teshsuite/smpi/mpich3-test/attr/attr2type.c
new file mode 100644 (file)
index 0000000..69706cf
--- /dev/null
@@ -0,0 +1,126 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static int foo_keyval = MPI_KEYVAL_INVALID;
+
+int foo_initialize(void);
+void foo_finalize(void);
+
+int foo_copy_attr_function(MPI_Datatype type, int type_keyval,
+                          void *extra_state, void *attribute_val_in,
+                          void *attribute_val_out, int *flag);
+int foo_delete_attr_function(MPI_Datatype type, int type_keyval,
+                            void *attribute_val, void *extra_state);
+static const char *my_func = 0;
+static int verbose = 0;
+static int delete_called = 0;
+static int copy_called = 0;
+
+int main(int argc, char *argv[])
+{
+    int mpi_errno;
+    MPI_Datatype type, duptype;
+    int rank;
+
+    MPI_Init(&argc, &argv);
+    
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    foo_initialize();
+
+    mpi_errno = MPI_Type_contiguous(2, MPI_INT, &type);
+
+    mpi_errno = MPI_Type_set_attr(type, foo_keyval, NULL);
+
+    mpi_errno = MPI_Type_dup(type, &duptype);
+
+    my_func = "Free of type";
+    mpi_errno = MPI_Type_free(&type);
+
+    my_func = "free of duptype";
+    mpi_errno = MPI_Type_free(&duptype);
+
+    foo_finalize();
+
+    if (rank == 0) {
+      int errs = 0;
+      if (copy_called != 1) {
+       printf( "Copy called %d times; expected once\n", copy_called );
+       errs++;
+      }
+      if (delete_called != 2) {
+       printf( "Delete called %d times; expected twice\n", delete_called );
+       errs++;
+      }
+      if (errs == 0) {
+       printf( " No Errors\n" );
+      }else if(mpi_errno!=MPI_SUCCESS){
+       printf( " Output fail - Found %d errors\n", errs );
+      }else {
+       printf( " Found %d errors\n", errs );
+      }
+      fflush(stdout);
+    }
+
+    MPI_Finalize();
+    return 0;
+}
+
+int foo_copy_attr_function(MPI_Datatype type,
+                          int type_keyval,
+                          void *extra_state,
+                          void *attribute_val_in,
+                          void *attribute_val_out,
+                          int *flag)
+{
+    if (verbose) printf("copy fn. called\n");
+    copy_called ++;
+    * (char **) attribute_val_out = NULL;
+    *flag = 1;
+
+    return MPI_SUCCESS;
+}
+
+int foo_delete_attr_function(MPI_Datatype type,
+                            int type_keyval,
+                            void *attribute_val,
+                            void *extra_state)
+{
+    if (verbose) printf("delete fn. called in %s\n", my_func );
+    delete_called ++;
+
+    return MPI_SUCCESS;
+}
+
+int foo_initialize(void)
+{
+    int mpi_errno;
+
+    /* create keyval for use later */
+    mpi_errno = MPI_Type_create_keyval(foo_copy_attr_function,
+                                      foo_delete_attr_function,
+                                      &foo_keyval,
+                                      NULL);
+    if (mpi_errno==MPI_SUCCESS && verbose) printf("created keyval\n");
+
+    return 0;
+}
+
+void foo_finalize(void)
+{
+    int mpi_errno;
+
+    /* remove keyval */
+    mpi_errno = MPI_Type_free_keyval(&foo_keyval);
+
+    if (mpi_errno==MPI_SUCCESS && verbose) printf("freed keyval\n");
+
+    return;
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/attrend.c b/teshsuite/smpi/mpich3-test/attr/attrend.c
new file mode 100644 (file)
index 0000000..37c4a1b
--- /dev/null
@@ -0,0 +1,82 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+      The MPI-2 specification makes it clear that delect attributes are 
+      called on MPI_COMM_WORLD and MPI_COMM_SELF at the very beginning of
+      MPI_Finalize.  This is useful for tools that want to perform the MPI 
+      equivalent of an "at_exit" action.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int exit_key = MPI_KEYVAL_INVALID;
+int wasCalled = 0;
+int foundError = 0;
+/* #define DEBUG */
+int delete_fn ( MPI_Comm, int, void *, void * );
+#ifdef DEBUG
+#define FFLUSH fflush(stdout);
+#else
+#define FFLUSH
+#endif
+
+int main( int argc, char **argv )
+{
+    int errs = 0, wrank;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    
+    /* create the keyval for the exit handler */
+    MPI_Keyval_create( MPI_NULL_COPY_FN, delete_fn, &exit_key, (void *)0 );
+
+    /* Attach to comm_self */
+    MPI_Attr_put( MPI_COMM_SELF, exit_key, (void*)0 );
+    /* We can free the key now */
+    MPI_Keyval_free( &exit_key );
+
+    /* Now, exit MPI */
+    /* MTest_Finalize( errs ); */
+    MPI_Finalize();
+
+    /* Check that the exit handler was called, and without error */
+    if (wrank == 0) {
+       /* In case more than one process exits MPI_Finalize */
+       if (wasCalled != 1) {
+           errs++;
+           printf( "Attribute delete function on MPI_COMM_SELF was not called\n" );
+       }
+       if (foundError != 0) {
+           errs++;
+           printf( "Found %d errors while executing delete function in MPI_COMM_SELF\n", foundError );
+       }
+       if (errs == 0) {
+           printf( " No Errors\n" );
+       }
+       else { 
+           printf( " Found %d errors\n", errs );
+       }
+       fflush(stdout );
+    }
+
+    return 0;
+}
+
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    int flag;
+    wasCalled++;
+    MPI_Finalized( &flag );
+    if (flag) {
+       foundError++;
+    }
+    return MPI_SUCCESS;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/attr/attrend2.c b/teshsuite/smpi/mpich3-test/attr/attrend2.c
new file mode 100644 (file)
index 0000000..cf6d39f
--- /dev/null
@@ -0,0 +1,129 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+      The MPI-2.2 specification makes it clear that attributes are called on
+      MPI_COMM_WORLD and MPI_COMM_SELF at the very beginning of MPI_Finalize in
+      LIFO order with respect to the order in which they are set.  This is
+      useful for tools that want to perform the MPI equivalent of an "at_exit"
+      action.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* 20 ought to be enough attributes to ensure that hash-table based MPI
+ * implementations do not accidentally pass the test except by being extremely
+ * "lucky".  There are (20!) possible permutations which means that there is
+ * about a 1 in 2.43e18 chance of getting LIFO ordering out of a hash table,
+ * assuming a decent hash function is used. */
+#define NUM_TEST_ATTRS (20)
+
+static __attribute__((unused)) int exit_keys[NUM_TEST_ATTRS]; /* init to MPI_KEYVAL_INVALID */
+static __attribute__((unused)) int was_called[NUM_TEST_ATTRS];
+int foundError = 0;
+int delete_fn (MPI_Comm, int, void *, void *);
+
+int main(int argc, char **argv)
+{
+    int wrank;
+
+    MTest_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int errs = 0, wrank;
+    int i;
+    for (i = 0; i < NUM_TEST_ATTRS; ++i) {
+        exit_keys[i] = MPI_KEYVAL_INVALID;
+        was_called[i] = 0;
+
+        /* create the keyval for the exit handler */
+        MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, delete_fn, &exit_keys[i], NULL);
+        /* attach to comm_self */
+        MPI_Comm_set_attr(MPI_COMM_SELF, exit_keys[i], (void*)(long)i);
+    }
+
+    /* we can free the keys now */
+    for (i = 0; i < NUM_TEST_ATTRS; ++i) {
+        MPI_Comm_free_keyval(&exit_keys[i]);
+    }
+
+    /* now, exit MPI */
+    MPI_Finalize();
+
+    /* check that the exit handlers were called in LIFO order, and without error */
+    if (wrank == 0) {
+        /* In case more than one process exits MPI_Finalize */
+        for (i = 0; i < NUM_TEST_ATTRS; ++i) {
+            if (was_called[i] < 1) {
+                errs++;
+                printf("Attribute delete function on MPI_COMM_SELF was not called for idx=%d\n", i);
+            }
+            else if (was_called[i] > 1) {
+                errs++;
+                printf("Attribute delete function on MPI_COMM_SELF was called multiple times for idx=%d\n", i);
+            }
+        }
+        if (foundError != 0) {
+            errs++;
+            printf("Found %d errors while executing delete function in MPI_COMM_SELF\n", foundError);
+        }
+        if (errs == 0) {
+            printf(" No Errors\n");
+        }
+        else {
+            printf(" Found %d errors\n", errs);
+        }
+        fflush(stdout);
+    }
+#else /* this is a pre-MPI-2.2 implementation, ordering is not defined */
+    MPI_Finalize();
+    if (wrank == 0)
+        printf(" No Errors\n");
+#endif
+
+    return 0;
+}
+
+int delete_fn(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state)
+{
+    int flag;
+    int i;
+    int my_idx = (int)(long)attribute_val;
+
+    if (my_idx < 0 || my_idx > NUM_TEST_ATTRS) {
+        printf("internal error, my_idx=%d is invalid!\n", my_idx);
+        fflush(stdout);
+    }
+
+    was_called[my_idx]++;
+
+    MPI_Finalized(&flag);
+    if (flag) {
+        printf("my_idx=%d, MPI_Finalized returned %d, should have been 0", my_idx, flag);
+        foundError++;
+    }
+
+    /* since attributes were added in 0..(NUM_TEST_ATTRS-1) order, they will be
+     * called in (NUM_TEST_ATTRS-1)..0 order */
+    for (i = 0; i < my_idx; ++i) {
+        if (was_called[i] != 0) {
+            printf("my_idx=%d, was_called[%d]=%d but should be 0\n", my_idx, i, was_called[i]);
+            foundError++;
+        }
+    }
+    for (i = my_idx; i < NUM_TEST_ATTRS; ++i) {
+        if (was_called[i] != 1) {
+            printf("my_idx=%d, was_called[%d]=%d but should be 1\n", my_idx, i, was_called[i]);
+            foundError++;
+        }
+    }
+
+    return MPI_SUCCESS;
+}
+
similarity index 73%
rename from teshsuite/smpi/mpich-test/context/attrerr.c
rename to teshsuite/smpi/mpich3-test/attr/attrerr.c
index a73d0f0..39e3611 100644 (file)
@@ -1,3 +1,9 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 /*
 
   Exercise attribute routines.
@@ -8,7 +14,7 @@
  */
 #include <stdio.h>
 #include "mpi.h"
-#include "test.h"
+#include "mpitest.h"
 
 int test_communicators ( void );
 void abort_msg ( const char *, int );
@@ -17,9 +23,10 @@ int deletebomb_fn ( MPI_Comm, int, void *, void * );
 
 int main( int argc, char **argv )
 {
-    MPI_Init( &argc, &argv );
-    test_communicators();
-    Test_Waitforall( );
+    int errs;
+    MTest_Init( &argc, &argv );
+    errs = test_communicators();
+    MTest_Finalize( errs );
     MPI_Finalize();
     return 0;
 }
@@ -33,17 +40,18 @@ int main( int argc, char **argv )
  */
 /* Return an error as the value */
 int copybomb_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
-                void *attribute_val_in, void *attribute_val_out, int *flag)
+               void *attribute_val_in, void *attribute_val_out, int *flag)
 {
-/* Note that if (sizeof(int) < sizeof(void *), just setting the int
-   part of attribute_val_out may leave some dirty bits
- */
+    /* Note that if (sizeof(int) < sizeof(void *), just setting the int
+       part of attribute_val_out may leave some dirty bits
   */
     *flag = 1;
     return MPI_ERR_OTHER;
 }
 
 /* Set delete flag to 1 to allow the attribute to be deleted */
 static int delete_flag = 0;
+
 int deletebomb_fn( MPI_Comm comm, int keyval, void *attribute_val, 
                   void *extra_state)
 {
@@ -60,17 +68,17 @@ void abort_msg( const char *str, int code )
 int test_communicators( void )
 {
     MPI_Comm dup_comm_world, d2;
-    ptrdiff_t world_rank;
-    int world_size, key_1;
-    int err;
+    int world_rank, world_size, key_1;
+    int err, errs = 0;
     MPI_Aint value;
-    int rank;
-    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
-    world_rank=rank;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
     MPI_Comm_size( MPI_COMM_WORLD, &world_size );
+#ifdef DEBUG
     if (world_rank == 0) {
        printf( "*** Attribute copy/delete return codes ***\n" );
     }
+#endif
 
     MPI_Comm_dup( MPI_COMM_WORLD, &dup_comm_world );
     MPI_Barrier( dup_comm_world );
@@ -81,13 +89,16 @@ int test_communicators( void )
     if ((err=MPI_Keyval_create( copybomb_fn, deletebomb_fn, &key_1, &value )))
        abort_msg( "Keyval_create", err );
 
-    err = MPI_Attr_put( dup_comm_world, key_1, (void *)world_rank );
+    err = MPI_Attr_put( dup_comm_world, key_1, (void *) (MPI_Aint) world_rank );
     if (err) {
+       errs++;
        printf( "Error with first put\n" );
     }
 
-    err = MPI_Attr_put( dup_comm_world, key_1, (void *)(2*world_rank) );
+    err = MPI_Attr_put( dup_comm_world, key_1, 
+                       (void *) (MPI_Aint) (2*world_rank) );
     if (err == MPI_SUCCESS) {
+       errs++;
        printf( "delete function return code was MPI_SUCCESS in put\n" );
     }
 
@@ -95,20 +106,27 @@ int test_communicators( void )
        should *not be removed* */
     err = MPI_Attr_delete( dup_comm_world, key_1 );
     if (err == MPI_SUCCESS) {
+       errs++;
        printf( "delete function return code was MPI_SUCCESS in delete\n" );
     }
     
     err = MPI_Comm_dup( dup_comm_world, &d2 );
     if (err == MPI_SUCCESS) {
+       errs++;
        printf( "copy function return code was MPI_SUCCESS in dup\n" );
     }
+#ifndef USE_STRICT_MPI
+    /* Another interpretation is to leave d2 unchanged on error */
     if (err && d2 != MPI_COMM_NULL) {
+       errs++;
        printf( "dup did not return MPI_COMM_NULL on error\n" );
     }
+#endif
 
     delete_flag = 1;
     MPI_Comm_free( &dup_comm_world );
+    MPI_Keyval_free( &key_1 );
 
-    return 0;
+    return errs;
 }
 
diff --git a/teshsuite/smpi/mpich3-test/attr/attrerrcomm.c b/teshsuite/smpi/mpich3-test/attr/attrerrcomm.c
new file mode 100644 (file)
index 0000000..df42e48
--- /dev/null
@@ -0,0 +1,141 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+
+  Exercise attribute routines.
+  This version checks for correct behavior of the copy and delete functions
+  on an attribute, particularly the correct behavior when the routine returns
+  failure.
+
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int test_communicators ( void );
+void abort_msg ( const char *, int );
+int copybomb_fn ( MPI_Comm, int, void *, void *, void *, int * );
+int deletebomb_fn ( MPI_Comm, int, void *, void * );
+
+int main( int argc, char **argv )
+{
+    int errs;
+    MTest_Init( &argc, &argv );
+    errs = test_communicators();
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+/* 
+ * MPI 1.2 Clarification: Clarification of Error Behavior of 
+ *                        Attribute Callback Functions 
+ * Any return value other than MPI_SUCCESS is erroneous.  The specific value
+ * returned to the user is undefined (other than it can't be MPI_SUCCESS).
+ * Proposals to specify particular values (e.g., user's value) failed.
+ */
+/* Return an error as the value */
+int copybomb_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+               void *attribute_val_in, void *attribute_val_out, int *flag)
+{
+    /* Note that if (sizeof(int) < sizeof(void *), just setting the int
+       part of attribute_val_out may leave some dirty bits
+    */
+    *flag = 1;
+    return MPI_ERR_OTHER;
+}
+
+/* Set delete flag to 1 to allow the attribute to be deleted */
+static int delete_flag = 0;
+
+int deletebomb_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+                  void *extra_state)
+{
+    if (delete_flag) return MPI_SUCCESS;
+    return MPI_ERR_OTHER;
+}
+
+void abort_msg( const char *str, int code )
+{
+    fprintf( stderr, "%s, err = %d\n", str, code );
+    MPI_Abort( MPI_COMM_WORLD, code );
+}
+
+int test_communicators( void )
+{
+    MPI_Comm dup_comm_world, d2;
+    int world_rank, world_size, key_1;
+    int err, errs = 0;
+    MPI_Aint value;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &world_size );
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "*** Attribute copy/delete return codes ***\n" );
+    }
+#endif
+
+    MPI_Comm_dup( MPI_COMM_WORLD, &dup_comm_world );
+    MPI_Barrier( dup_comm_world );
+
+    MPI_Errhandler_set( dup_comm_world, MPI_ERRORS_RETURN );
+
+    value = - 11;
+    if ((err=MPI_Comm_create_keyval( copybomb_fn, deletebomb_fn, &key_1, &value )))
+       abort_msg( "Keyval_create", err );
+
+    err = MPI_Comm_set_attr( dup_comm_world, key_1, (void *) (MPI_Aint) world_rank );
+    if (err) {
+       errs++;
+       printf( "Error with first put\n" );
+    }
+
+    err = MPI_Comm_set_attr( dup_comm_world, key_1, (void *) (MPI_Aint) (2*world_rank) );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "delete function return code was MPI_SUCCESS in put\n" );
+    }
+
+    /* Because the attribute delete function should fail, the attribute
+       should *not be removed* */
+    err = MPI_Comm_delete_attr( dup_comm_world, key_1 );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "delete function return code was MPI_SUCCESS in delete\n" );
+    }
+    
+    err = MPI_Comm_dup( dup_comm_world, &d2 );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "copy function return code was MPI_SUCCESS in dup\n" );
+    }
+    if (err != MPI_ERR_OTHER) {
+       int lerrclass;
+       MPI_Error_class( err, &lerrclass );
+       if (lerrclass != MPI_ERR_OTHER) {
+           errs++;
+           printf( "dup did not return an error code of class ERR_OTHER; " );
+           printf( "err = %d, class = %d\n", err, lerrclass );
+       }
+    }
+#ifndef USE_STRICT_MPI
+    /* Another interpretation is to leave d2 unchanged on error */
+    if (err && d2 != MPI_COMM_NULL) {
+       errs++;
+       printf( "dup did not return MPI_COMM_NULL on error\n" );
+    }
+#endif
+
+    delete_flag = 1;
+    MPI_Comm_free( &dup_comm_world );
+
+    MPI_Comm_free_keyval( &key_1 );
+
+    return errs;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/attr/attrerrtype.c b/teshsuite/smpi/mpich3-test/attr/attrerrtype.c
new file mode 100644 (file)
index 0000000..d3d9a39
--- /dev/null
@@ -0,0 +1,139 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+
+  Exercise attribute routines.
+  This version checks for correct behavior of the copy and delete functions
+  on an attribute, particularly the correct behavior when the routine returns
+  failure.
+
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int test_attrs ( void );
+void abort_msg ( const char *, int );
+int copybomb_fn ( MPI_Datatype, int, void *, void *, void *, int * );
+int deletebomb_fn ( MPI_Datatype, int, void *, void * );
+
+int main( int argc, char **argv )
+{
+    int errs;
+    MTest_Init( &argc, &argv );
+    errs = test_attrs();
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+/* 
+ * MPI 1.2 Clarification: Clarification of Error Behavior of 
+ *                        Attribute Callback Functions 
+ * Any return value other than MPI_SUCCESS is erroneous.  The specific value
+ * returned to the user is undefined (other than it can't be MPI_SUCCESS).
+ * Proposals to specify particular values (e.g., user's value) failed.
+ */
+/* Return an error as the value */
+int copybomb_fn( MPI_Datatype oldtype, int keyval, void *extra_state,
+               void *attribute_val_in, void *attribute_val_out, int *flag)
+{
+    /* Note that if (sizeof(int) < sizeof(void *), just setting the int
+       part of attribute_val_out may leave some dirty bits
+    */
+    *flag = 1;
+    return MPI_ERR_OTHER;
+}
+
+/* Set delete flag to 1 to allow the attribute to be deleted */
+static int delete_flag = 0;
+static int deleteCalled = 0;
+
+int deletebomb_fn( MPI_Datatype type, int keyval, void *attribute_val, 
+                  void *extra_state)
+{
+    deleteCalled ++;
+    if (delete_flag) return MPI_SUCCESS;
+    return MPI_ERR_OTHER;
+}
+
+void abort_msg( const char *str, int code )
+{
+    fprintf( stderr, "%s, err = %d\n", str, code );
+    MPI_Abort( MPI_COMM_WORLD, code );
+}
+
+int test_attrs( void )
+{
+    MPI_Datatype dup_type, d2;
+    int world_rank, world_size, key_1;
+    int err, errs = 0;
+    MPI_Aint value;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &world_size );
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "*** Attribute copy/delete return codes ***\n" );
+    }
+#endif
+
+    
+    MPI_Type_dup( MPI_DOUBLE, &dup_type );
+
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    value = - 11;
+    if ((err=MPI_Type_create_keyval( copybomb_fn, deletebomb_fn, &key_1, &value )))
+       abort_msg( "Keyval_create", err );
+
+    err = MPI_Type_set_attr( dup_type, key_1, (void *) (MPI_Aint) world_rank );
+    if (err) {
+       errs++;
+       printf( "Error with first put\n" );
+    }
+
+    err = MPI_Type_set_attr( dup_type, key_1, (void *) (MPI_Aint) (2*world_rank) );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "delete function return code was MPI_SUCCESS in put\n" );
+    }
+
+    /* Because the attribute delete function should fail, the attribute
+       should *not be removed* */
+    err = MPI_Type_delete_attr( dup_type, key_1 );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "delete function return code was MPI_SUCCESS in delete\n" );
+    }
+    
+    err = MPI_Type_dup( dup_type, &d2 );
+    if (err == MPI_SUCCESS) {
+       errs++;
+       printf( "copy function return code was MPI_SUCCESS in dup\n" );
+    }
+#ifndef USE_STRICT_MPI
+    /* Another interpretation is to leave d2 unchanged on error */
+    if (err && d2 != MPI_DATATYPE_NULL) {
+       errs++;
+       printf( "dup did not return MPI_DATATYPE_NULL on error\n" );
+    }
+#endif
+
+    delete_flag  = 1;
+    deleteCalled = 0;
+    if (d2 != MPI_DATATYPE_NULL) 
+       MPI_Type_free(&d2);
+    MPI_Type_free( &dup_type );
+    if (deleteCalled == 0) {
+       errs++;
+       printf( "Free of a datatype did not invoke the attribute delete routine\n" );
+    }
+    MPI_Type_free_keyval( &key_1 );
+
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/attric.c b/teshsuite/smpi/mpich3-test/attr/attric.c
new file mode 100644 (file)
index 0000000..c71e96c
--- /dev/null
@@ -0,0 +1,155 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+
+  Exercise communicator routines for intercommunicators
+
+  This C version derived from attrt, which in turn was
+  derived from a Fortran test program from ...
+
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* #define DEBUG */
+int test_communicators ( void );
+int copy_fn ( MPI_Comm, int, void *, void *, void *, int * );
+int delete_fn ( MPI_Comm, int, void *, void * );
+#ifdef DEBUG
+#define FFLUSH fflush(stdout);
+#else
+#define FFLUSH
+#endif
+
+int main( int argc, char **argv )
+{
+    int errs = 0;
+    MTest_Init( &argc, &argv );
+    
+    errs = test_communicators();
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, int *flag)
+{
+    /* Note that if (sizeof(int) < sizeof(void *), just setting the int
+       part of attribute_val_out may leave some dirty bits
+    */
+    *(MPI_Aint *)attribute_val_out = (MPI_Aint)attribute_val_in;
+    *flag = 1;
+    return MPI_SUCCESS;
+}
+
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    int world_rank;
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    if ((MPI_Aint)attribute_val != (MPI_Aint)world_rank) {
+       printf( "incorrect attribute value %d\n", *(int*)attribute_val );
+       MPI_Abort(MPI_COMM_WORLD, 1005 );
+    }
+    return MPI_SUCCESS;
+}
+
+int test_communicators( void )
+{
+    MPI_Comm dup_comm, comm;
+    void *vvalue;
+    int flag, world_rank, world_size, key_1, key_3;
+    int errs = 0;
+    MPI_Aint value;
+    int      isLeft;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &world_size );
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "*** Communicators ***\n" ); fflush(stdout);
+    }
+#endif
+
+    while (MTestGetIntercomm( &comm, &isLeft, 2 )) {
+        MTestPrintfMsg(1, "start while loop, isLeft=%s\n", (isLeft ? "TRUE" : "FALSE"));
+
+       if (comm == MPI_COMM_NULL) {
+            MTestPrintfMsg(1, "got COMM_NULL, skipping\n");
+            continue;
+        }
+
+       /*
+         Check Comm_dup by adding attributes to comm & duplicating
+       */
+    
+       value = 9;
+       MPI_Keyval_create(copy_fn,     delete_fn,   &key_1, &value );
+        MTestPrintfMsg(1, "Keyval_create key=%#x value=%d\n", key_1, value);
+       value = 7;
+       MPI_Keyval_create(MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                         &key_3, &value ); 
+        MTestPrintfMsg(1, "Keyval_create key=%#x value=%d\n", key_3, value);
+
+       /* This may generate a compilation warning; it is, however, an
+          easy way to cache a value instead of a pointer */
+       /* printf( "key1 = %x key3 = %x\n", key_1, key_3 ); */
+       MPI_Attr_put(comm, key_1, (void *) (MPI_Aint) world_rank );
+       MPI_Attr_put(comm, key_3, (void *)0 );
+       
+        MTestPrintfMsg(1, "Comm_dup\n" );
+       MPI_Comm_dup(comm, &dup_comm );
+
+       /* Note that if sizeof(int) < sizeof(void *), we can't use
+          (void **)&value to get the value we passed into Attr_put.  To avoid 
+          problems (e.g., alignment errors), we recover the value into 
+          a (void *) and cast to int. Note that this may generate warning
+          messages from the compiler.  */
+       MPI_Attr_get(dup_comm, key_1, (void **)&vvalue, &flag );
+       value = (MPI_Aint)vvalue;
+       
+       if (! flag) {
+           errs++;
+           printf( "dup_comm key_1 not found on %d\n", world_rank );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3004 );
+       }
+       
+       if (value != world_rank) {
+           errs++;
+           printf( "dup_comm key_1 value incorrect: %ld\n", (long)value );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3005 );
+       }
+
+       MPI_Attr_get(dup_comm, key_3, (void **)&vvalue, &flag );
+       value = (MPI_Aint)vvalue;
+       if (flag) {
+           errs++;
+           printf( "dup_comm key_3 found!\n" );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3008 );
+       }
+        MTestPrintfMsg(1, "Keyval_free key=%#x\n", key_1);
+       MPI_Keyval_free(&key_1 );
+        MTestPrintfMsg(1, "Keyval_free key=%#x\n", key_3);
+       MPI_Keyval_free(&key_3 );
+       /*
+         Free all communicators created
+       */
+        MTestPrintfMsg(1, "Comm_free comm\n");
+       MPI_Comm_free( &comm );
+        MTestPrintfMsg(1, "Comm_free dup_comm\n");
+       MPI_Comm_free( &dup_comm );
+    }
+
+    return errs;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/attr/attrorder.c b/teshsuite/smpi/mpich3-test/attr/attrorder.c
new file mode 100644 (file)
index 0000000..d1539ae
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test creating and inserting attributes in \
+different orders to ensure that the list management code handles all cases.";
+*/
+
+int checkAttrs( MPI_Comm comm, int n, int key[], int attrval[] );
+int checkNoAttrs( MPI_Comm comm, int n, int key[] );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int key[3], attrval[3];
+    int i;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+
+    {
+       comm = MPI_COMM_WORLD;
+       /* Create key values */
+       for (i=0; i<3; i++) {
+           MPI_Keyval_create( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+           attrval[i] = 1024 * i;
+       }
+       
+       /* Insert attribute in several orders.  Test after put with get,
+        then delete, then confirm delete with get. */
+
+       MPI_Attr_put( comm, key[2], &attrval[2] );
+       MPI_Attr_put( comm, key[1], &attrval[1] );
+       MPI_Attr_put( comm, key[0], &attrval[0] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Attr_delete( comm, key[0] );
+       MPI_Attr_delete( comm, key[1] );
+       MPI_Attr_delete( comm, key[2] );
+
+       errs += checkNoAttrs( comm, 3, key );
+       
+       MPI_Attr_put( comm, key[1], &attrval[1] );
+       MPI_Attr_put( comm, key[2], &attrval[2] );
+       MPI_Attr_put( comm, key[0], &attrval[0] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Attr_delete( comm, key[2] );
+       MPI_Attr_delete( comm, key[1] );
+       MPI_Attr_delete( comm, key[0] );
+
+       errs += checkNoAttrs( comm, 3, key );
+
+       MPI_Attr_put( comm, key[0], &attrval[0] );
+       MPI_Attr_put( comm, key[1], &attrval[1] );
+       MPI_Attr_put( comm, key[2], &attrval[2] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Attr_delete( comm, key[1] );
+       MPI_Attr_delete( comm, key[2] );
+       MPI_Attr_delete( comm, key[0] );
+
+       errs += checkNoAttrs( comm, 3, key );
+       
+       for (i=0; i<3; i++) {
+           MPI_Keyval_free( &key[i] );
+       }
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
+
+int checkAttrs( MPI_Comm comm, int n, int key[], int attrval[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Attr_get( comm, key[i], &val_p, &flag );
+       if (!flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d not set\n", i );
+       }
+       else if (val_p != &attrval[i]) {
+           errs++;
+           fprintf( stderr, "Attribute value for key %d not correct\n",
+                    i );
+       }
+    }
+
+    return errs;
+}
+
+int checkNoAttrs( MPI_Comm comm, int n, int key[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Attr_get( comm, key[i], &val_p, &flag );
+       if (flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d set but should be deleted\n", i );
+       }
+    }
+
+    return errs;
+}
+       
diff --git a/teshsuite/smpi/mpich3-test/attr/attrordercomm.c b/teshsuite/smpi/mpich3-test/attr/attrordercomm.c
new file mode 100644 (file)
index 0000000..209c0a3
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test creating and inserting attributes in \
+different orders to ensure that the list management code handles all cases.";
+*/
+
+int checkAttrs( MPI_Comm comm, int n, int key[], int attrval[] );
+int checkNoAttrs( MPI_Comm comm, int n, int key[] );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int key[3], attrval[3];
+    int i;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+
+    {
+       comm = MPI_COMM_WORLD;
+       /* Create key values */
+       for (i=0; i<3; i++) {
+           MPI_Comm_create_keyval( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+           attrval[i] = 1024 * i;
+       }
+       
+       /* Insert attribute in several orders.  Test after put with get,
+        then delete, then confirm delete with get. */
+
+       MPI_Comm_set_attr( comm, key[2], &attrval[2] );
+       MPI_Comm_set_attr( comm, key[1], &attrval[1] );
+       MPI_Comm_set_attr( comm, key[0], &attrval[0] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Comm_delete_attr( comm, key[0] );
+       MPI_Comm_delete_attr( comm, key[1] );
+       MPI_Comm_delete_attr( comm, key[2] );
+
+       errs += checkNoAttrs( comm, 3, key );
+       
+       MPI_Comm_set_attr( comm, key[1], &attrval[1] );
+       MPI_Comm_set_attr( comm, key[2], &attrval[2] );
+       MPI_Comm_set_attr( comm, key[0], &attrval[0] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Comm_delete_attr( comm, key[2] );
+       MPI_Comm_delete_attr( comm, key[1] );
+       MPI_Comm_delete_attr( comm, key[0] );
+
+       errs += checkNoAttrs( comm, 3, key );
+
+       MPI_Comm_set_attr( comm, key[0], &attrval[0] );
+       MPI_Comm_set_attr( comm, key[1], &attrval[1] );
+       MPI_Comm_set_attr( comm, key[2], &attrval[2] );
+
+       errs += checkAttrs( comm, 3, key, attrval );
+       
+       MPI_Comm_delete_attr( comm, key[1] );
+       MPI_Comm_delete_attr( comm, key[2] );
+       MPI_Comm_delete_attr( comm, key[0] );
+
+       errs += checkNoAttrs( comm, 3, key );
+       
+       for (i=0; i<3; i++) {
+           MPI_Comm_free_keyval( &key[i] );
+       }
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
+
+int checkAttrs( MPI_Comm comm, int n, int key[], int attrval[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Comm_get_attr( comm, key[i], &val_p, &flag );
+       if (!flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d not set\n", i );
+       }
+       else if (val_p != &attrval[i]) {
+           errs++;
+           fprintf( stderr, "Attribute value for key %d not correct\n",
+                    i );
+       }
+    }
+
+    return errs;
+}
+
+int checkNoAttrs( MPI_Comm comm, int n, int key[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Comm_get_attr( comm, key[i], &val_p, &flag );
+       if (flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d set but should be deleted\n", i );
+       }
+    }
+
+    return errs;
+}
+       
diff --git a/teshsuite/smpi/mpich3-test/attr/attrordertype.c b/teshsuite/smpi/mpich3-test/attr/attrordertype.c
new file mode 100644 (file)
index 0000000..25cf1d9
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test creating and inserting attributes in \
+different orders to ensure that the list management code handles all cases.";
+*/
+
+int checkAttrs( MPI_Datatype type, int n, int key[], int attrval[] );
+int checkNoAttrs( MPI_Datatype type, int n, int key[] );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int key[3], attrval[3];
+    int i;
+    MPI_Datatype type;
+
+    MTest_Init( &argc, &argv );
+
+    {
+       type = MPI_INT;
+       /* Create key values */
+       for (i=0; i<3; i++) {
+           MPI_Type_create_keyval( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+           attrval[i] = 1024 * i;
+       }
+       
+       /* Insert attribute in several orders.  Test after put with get,
+        then delete, then confirm delete with get. */
+
+       MPI_Type_set_attr( type, key[2], &attrval[2] );
+       MPI_Type_set_attr( type, key[1], &attrval[1] );
+       MPI_Type_set_attr( type, key[0], &attrval[0] );
+
+       errs += checkAttrs( type, 3, key, attrval );
+       
+       MPI_Type_delete_attr( type, key[0] );
+       MPI_Type_delete_attr( type, key[1] );
+       MPI_Type_delete_attr( type, key[2] );
+
+       errs += checkNoAttrs( type, 3, key );
+       
+       MPI_Type_set_attr( type, key[1], &attrval[1] );
+       MPI_Type_set_attr( type, key[2], &attrval[2] );
+       MPI_Type_set_attr( type, key[0], &attrval[0] );
+
+       errs += checkAttrs( type, 3, key, attrval );
+       
+       MPI_Type_delete_attr( type, key[2] );
+       MPI_Type_delete_attr( type, key[1] );
+       MPI_Type_delete_attr( type, key[0] );
+
+       errs += checkNoAttrs( type, 3, key );
+
+       MPI_Type_set_attr( type, key[0], &attrval[0] );
+       MPI_Type_set_attr( type, key[1], &attrval[1] );
+       MPI_Type_set_attr( type, key[2], &attrval[2] );
+
+       errs += checkAttrs( type, 3, key, attrval );
+       
+       MPI_Type_delete_attr( type, key[1] );
+       MPI_Type_delete_attr( type, key[2] );
+       MPI_Type_delete_attr( type, key[0] );
+
+       errs += checkNoAttrs( type, 3, key );
+       
+       for (i=0; i<3; i++) {
+           MPI_Type_free_keyval( &key[i] );
+       }
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
+
+int checkAttrs( MPI_Datatype type, int n, int key[], int attrval[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Type_get_attr( type, key[i], &val_p, &flag );
+       if (!flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d not set\n", i );
+       }
+       else if (val_p != &attrval[i]) {
+           errs++;
+           fprintf( stderr, "Attribute value for key %d not correct\n",
+                    i );
+       }
+    }
+
+    return errs;
+}
+
+int checkNoAttrs( MPI_Datatype type, int n, int key[] )
+{
+    int errs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Type_get_attr( type, key[i], &val_p, &flag );
+       if (flag) {
+           errs++;
+           fprintf( stderr, "Attribute for key %d set but should be deleted\n", i );
+       }
+    }
+
+    return errs;
+}
+       
diff --git a/teshsuite/smpi/mpich3-test/attr/attrt.c b/teshsuite/smpi/mpich3-test/attr/attrt.c
new file mode 100644 (file)
index 0000000..4a94201
--- /dev/null
@@ -0,0 +1,311 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+
+  Exercise communicator routines.
+
+  This C version derived from a Fortran test program from ....
+
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+//#define DEBUG
+int test_communicators ( void );
+int copy_fn ( MPI_Comm, int, void *, void *, void *, int * );
+int delete_fn ( MPI_Comm, int, void *, void * );
+#ifdef DEBUG
+#define FFLUSH fflush(stdout);
+#else
+#define FFLUSH
+#endif
+
+int main( int argc, char **argv )
+{
+    int errs = 0;
+    MTest_Init( &argc, &argv );
+    
+    errs = test_communicators();
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, int *flag)
+{
+    /* Note that if (sizeof(int) < sizeof(void *), just setting the int
+       part of attribute_val_out may leave some dirty bits
+    */
+    *(MPI_Aint *)attribute_val_out = (MPI_Aint)attribute_val_in;
+    *flag = 1;
+    return MPI_SUCCESS;
+}
+
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    int world_rank;
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    if ((MPI_Aint)attribute_val != (MPI_Aint)world_rank) {
+       printf( "incorrect attribute value %d\n", *(int*)attribute_val );
+       MPI_Abort(MPI_COMM_WORLD, 1005 );
+    }
+    return MPI_SUCCESS;
+}
+
+int test_communicators( void )
+{
+    MPI_Comm dup_comm_world, lo_comm, rev_comm, dup_comm, 
+       split_comm, world_comm;
+    MPI_Group world_group, lo_group, rev_group;
+    void *vvalue;
+    int ranges[1][3];
+    int flag, world_rank, world_size, rank, size, n, key_1, key_3;
+    int color, key, result;
+    int errs = 0;
+    MPI_Aint value;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &world_size );
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "*** Communicators ***\n" ); fflush(stdout);
+    }
+#endif
+
+    MPI_Comm_dup( MPI_COMM_WORLD, &dup_comm_world );
+
+    /*
+      Exercise Comm_create by creating an equivalent to dup_comm_world
+      (sans attributes) and a half-world communicator.
+    */
+
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "    Comm_create\n" ); fflush(stdout);
+    }
+#endif
+
+    MPI_Comm_group( dup_comm_world, &world_group );
+    MPI_Comm_create( dup_comm_world, world_group, &world_comm );
+    MPI_Comm_rank( world_comm, &rank );
+    if (rank != world_rank) {
+       errs++;
+       printf( "incorrect rank in world comm: %d\n", rank );
+       MPI_Abort(MPI_COMM_WORLD, 3001 );
+    }
+
+    n = world_size / 2;
+
+    ranges[0][0] = 0;
+    ranges[0][1] = (world_size - n) - 1;
+    ranges[0][2] = 1;
+
+#ifdef DEBUG
+    printf( "world rank = %d before range incl\n", world_rank );FFLUSH;
+#endif
+    MPI_Group_range_incl(world_group, 1, ranges, &lo_group );
+#ifdef DEBUG
+    printf( "world rank = %d after range incl\n", world_rank );FFLUSH;
+#endif
+    MPI_Comm_create(world_comm, lo_group, &lo_comm );
+#ifdef DEBUG
+    printf( "world rank = %d before group free\n", world_rank );FFLUSH;
+#endif
+    MPI_Group_free( &lo_group );
+
+#ifdef DEBUG
+    printf( "world rank = %d after group free\n", world_rank );FFLUSH;
+#endif
+
+    if (world_rank < (world_size - n)) {
+       MPI_Comm_rank(lo_comm, &rank );
+       if (rank == MPI_UNDEFINED) {
+           errs++;
+           printf( "incorrect lo group rank: %d\n", rank ); fflush(stdout);
+           MPI_Abort(MPI_COMM_WORLD, 3002 );
+       }
+       else {
+           /* printf( "lo in\n" );FFLUSH; */
+           MPI_Barrier(lo_comm );
+           /* printf( "lo out\n" );FFLUSH; */
+       }
+    }
+    else {
+       if (lo_comm != MPI_COMM_NULL) {
+           errs++;
+           printf( "rank : %d incorrect lo comm:\n", rank ); fflush(stdout);
+           MPI_Abort(MPI_COMM_WORLD, 3003 );
+       }
+    }
+
+#ifdef DEBUG
+    printf( "worldrank = %d\n", world_rank );FFLUSH;
+#endif
+    MPI_Barrier(world_comm);
+
+#ifdef DEBUG
+    printf( "bar!\n" );FFLUSH;
+#endif
+    /*
+      Check Comm_dup by adding attributes to lo_comm & duplicating
+    */
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "    Comm_dup\n" );
+       fflush(stdout);
+    }
+#endif
+    
+    if (lo_comm != MPI_COMM_NULL) {
+       value = 9;
+       MPI_Keyval_create(copy_fn,     delete_fn,   &key_1, &value );
+       value = 8;
+       value = 7;
+       MPI_Keyval_create(MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                         &key_3, &value ); 
+
+       /* This may generate a compilation warning; it is, however, an
+          easy way to cache a value instead of a pointer */
+       /* printf( "key1 = %x key3 = %x\n", key_1, key_3 ); */
+       MPI_Attr_put(lo_comm, key_1, (void *) (MPI_Aint) world_rank );
+       MPI_Attr_put(lo_comm, key_3, (void *)0 );
+       
+       MPI_Comm_dup(lo_comm, &dup_comm );
+
+       /* Note that if sizeof(int) < sizeof(void *), we can't use
+          (void **)&value to get the value we passed into Attr_put.  To avoid 
+          problems (e.g., alignment errors), we recover the value into 
+          a (void *) and cast to int. Note that this may generate warning
+          messages from the compiler.  */
+       MPI_Attr_get(dup_comm, key_1, (void **)&vvalue, &flag );
+       value = (MPI_Aint)vvalue;
+       
+       if (! flag) {
+           errs++;
+           printf( "dup_comm key_1 not found on %d\n", world_rank );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3004 );
+       }
+       
+       if (value != world_rank) {
+           errs++;
+           printf( "dup_comm key_1 value incorrect: %ld, expected %d\n", 
+                   (long)value, world_rank );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3005 );
+       }
+
+       MPI_Attr_get(dup_comm, key_3, (void **)&vvalue, &flag );
+       value = (MPI_Aint)vvalue;
+       if (flag) {
+           errs++;
+           printf( "dup_comm key_3 found!\n" );
+           fflush( stdout );
+           MPI_Abort(MPI_COMM_WORLD, 3008 );
+       }
+       MPI_Keyval_free(&key_1 );
+       MPI_Keyval_free(&key_3 );
+    }
+    /* 
+       Split the world into even & odd communicators with reversed ranks.
+    */
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "    Comm_split\n" );
+       fflush(stdout);
+    }
+#endif
+    
+    color = world_rank % 2;
+    key   = world_size - world_rank;
+    
+    MPI_Comm_split(dup_comm_world, color, key, &split_comm );
+    MPI_Comm_size(split_comm, &size );
+    MPI_Comm_rank(split_comm, &rank );
+    if (rank != ((size - world_rank/2) - 1)) {
+       errs++;
+       printf( "incorrect split rank: %d\n", rank ); fflush(stdout);
+       MPI_Abort(MPI_COMM_WORLD, 3009 );
+    }
+    
+    MPI_Barrier(split_comm );
+    /*
+      Test each possible Comm_compare result
+    */
+#ifdef DEBUG
+    if (world_rank == 0) {
+       printf( "    Comm_compare\n" );
+       fflush(stdout);
+    }
+#endif
+    
+    MPI_Comm_compare(world_comm, world_comm, &result );
+    if (result != MPI_IDENT) {
+       errs++;
+       printf( "incorrect ident result: %d\n", result );
+       MPI_Abort(MPI_COMM_WORLD, 3010 );
+    }
+    
+    if (lo_comm != MPI_COMM_NULL) {
+       MPI_Comm_compare(lo_comm, dup_comm, &result );
+       if (result != MPI_CONGRUENT) {
+           errs++;
+            printf( "incorrect congruent result: %d\n", result );
+            MPI_Abort(MPI_COMM_WORLD, 3011 );
+       }
+    }
+    
+    ranges[0][0] = world_size - 1;
+    ranges[0][1] = 0;
+    ranges[0][2] = -1;
+
+    MPI_Group_range_incl(world_group, 1, ranges, &rev_group );
+    MPI_Comm_create(world_comm, rev_group, &rev_comm );
+
+    MPI_Comm_compare(world_comm, rev_comm, &result );
+    if (result != MPI_SIMILAR && world_size != 1) {
+       errs++;
+       printf( "incorrect similar result: %d\n", result );
+       MPI_Abort(MPI_COMM_WORLD, 3012 );
+    }
+    
+    if (lo_comm != MPI_COMM_NULL) {
+       MPI_Comm_compare(world_comm, lo_comm, &result );
+       if (result != MPI_UNEQUAL && world_size != 1) {
+           errs++;
+           printf( "incorrect unequal result: %d\n", result );
+           MPI_Abort(MPI_COMM_WORLD, 3013 );
+       }
+    }
+    /*
+      Free all communicators created
+    */
+#ifdef DEBUG
+    if (world_rank == 0) 
+       printf( "    Comm_free\n" );
+#endif
+    
+    MPI_Comm_free( &world_comm );
+    MPI_Comm_free( &dup_comm_world );
+    
+    MPI_Comm_free( &rev_comm );
+    MPI_Comm_free( &split_comm );
+    
+    MPI_Group_free( &world_group );
+    MPI_Group_free( &rev_group );
+    
+    if (lo_comm != MPI_COMM_NULL) {
+        MPI_Comm_free( &lo_comm );
+        MPI_Comm_free( &dup_comm );
+    }
+    
+    return errs;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/attr/baseattr2.c b/teshsuite/smpi/mpich3-test/attr/baseattr2.c
new file mode 100644 (file)
index 0000000..58190f6
--- /dev/null
@@ -0,0 +1,174 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+void MissingKeyval( int rc, const char keyname[] );
+
+int main( int argc, char **argv)
+{
+    int    errs = 0;
+    int    rc;
+    void *v;
+    int  flag;
+    int  vval;
+    int  rank, size;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the attribute values */
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_TAG_UB, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_TAG_UB" );
+       errs++;
+    }
+    else {
+       if (!flag) {
+       errs++;
+       fprintf( stderr, "Could not get TAG_UB\n" );
+       }
+       else {
+           vval = *(int*)v;
+           if (vval < 32767) {
+               errs++;
+               fprintf( stderr, "Got too-small value (%d) for TAG_UB\n", vval );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_HOST, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_HOST" );
+       errs++;
+    }
+    else {
+       if (!flag) {
+           errs++;
+           fprintf( stderr, "Could not get HOST\n" );
+       }
+       else {
+           vval = *(int*)v;
+           if ((vval < 0 || vval >= size) && vval != MPI_PROC_NULL) {
+               errs++;
+               fprintf( stderr, "Got invalid value %d for HOST\n", vval );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_IO, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_IO" );
+       errs++;
+    }
+    else {
+       if (!flag) {
+           errs++;
+           fprintf( stderr, "Could not get IO\n" );
+       }
+       else {
+           vval = *(int*)v;
+           if ((vval < 0 || vval >= size) && vval != MPI_ANY_SOURCE &&
+               vval != MPI_PROC_NULL) {
+               errs++;
+               fprintf( stderr, "Got invalid value %d for IO\n", vval );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_WTIME_IS_GLOBAL" );
+       errs++;
+    }
+    else {
+       if (flag) {
+           /* Wtime need not be set */
+           vval = *(int*)v;
+           if (vval < 0 || vval > 1) {
+               errs++;
+               fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n", 
+                        vval );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_APPNUM, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_APPNUM" );
+       errs++;
+    }
+    else {
+       /* appnum need not be set */
+       if (flag) {
+           vval = *(int *)v;
+           if (vval < 0) {
+               errs++;
+               fprintf( stderr, "MPI_APPNUM is defined as %d but must be nonnegative\n", vval );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_UNIVERSE_SIZE" );
+       errs++;
+    }
+    else {
+       /* MPI_UNIVERSE_SIZE need not be set */
+       if (flag) {
+           vval = *(int *)v;
+           if (vval < size) {
+               errs++;
+               fprintf( stderr, "MPI_UNIVERSE_SIZE = %d, less than comm world (%d)\n", vval, size );
+           }
+       }
+    }
+
+    rc = MPI_Attr_get( MPI_COMM_WORLD, MPI_LASTUSEDCODE, &v, &flag );
+    if (rc) {
+       MissingKeyval( rc, "MPI_LASTUSEDCODE" );
+       errs++;
+    }
+    else {
+       /* Last used code must be defined and >= MPI_ERR_LASTCODE */
+       if (flag) {
+           vval = *(int*)v;
+           if (vval < MPI_ERR_LASTCODE) {
+               errs++;
+               fprintf( stderr, "MPI_LASTUSEDCODE points to an integer (%d) smaller than MPI_ERR_LASTCODE (%d)\n", vval, MPI_ERR_LASTCODE );
+           }
+       }
+       else {
+           errs++;
+           fprintf( stderr, "MPI_LASTUSECODE is not defined\n" );
+       }
+    }
+
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
+
+    MTest_Finalize( errs );
+    MPI_Finalize( );
+    
+    return 0;
+}
+
+void MissingKeyval( int errcode, const char keyname[] )
+{
+    int errclass, slen;
+    char string[MPI_MAX_ERROR_STRING];
+    
+    MPI_Error_class( errcode, &errclass );
+    MPI_Error_string( errcode, string, &slen );
+    printf( "For key %s: Error class %d (%s)\n", keyname, errclass, string );
+    fflush( stdout );
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/baseattrcomm.c b/teshsuite/smpi/mpich3-test/attr/baseattrcomm.c
new file mode 100644 (file)
index 0000000..aaa7622
--- /dev/null
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int main( int argc, char **argv)
+{
+    int    errs = 0;
+    void *v;
+    int  flag;
+    int  vval;
+    int  rank, size;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_TAG_UB, &v, &flag );
+    if (!flag) {
+       errs++;
+       fprintf( stderr, "Could not get TAG_UB\n" );
+    }
+    else {
+       vval = *(int*)v;
+       if (vval < 32767) {
+           errs++;
+           fprintf( stderr, "Got too-small value (%d) for TAG_UB\n", vval );
+       }
+    }
+
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_HOST, &v, &flag );
+    if (!flag) {
+       errs++;
+       fprintf( stderr, "Could not get HOST\n" );
+    }
+    else {
+       vval = *(int*)v;
+       if ((vval < 0 || vval >= size) && vval != MPI_PROC_NULL) {
+           errs++;
+           fprintf( stderr, "Got invalid value %d for HOST\n", vval );
+       }
+    }
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_IO, &v, &flag );
+    if (!flag) {
+       errs++;
+       fprintf( stderr, "Could not get IO\n" );
+    }
+    else {
+       vval = *(int*)v;
+       if ((vval < 0 || vval >= size) && vval != MPI_ANY_SOURCE &&
+                 vval != MPI_PROC_NULL) {
+           errs++;
+           fprintf( stderr, "Got invalid value %d for IO\n", vval );
+       }
+    }
+
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, &v, &flag );
+    if (flag) {
+       /* Wtime need not be set */
+       vval = *(int*)v;
+       if (vval < 0 || vval > 1) {
+           errs++;
+           fprintf( stderr, "Invalid value for WTIME_IS_GLOBAL (got %d)\n", 
+                    vval );
+       }
+    }
+
+    /* MPI 2.0, section 5.5.3 - MPI_APPNUM should be set if the program is
+       started with more than one executable name (e.g., in MPMD instead
+       of SPMD mode).  This is independent of the dynamic process routines,
+       and should be supported even if MPI_COMM_SPAWN and friends are not. */
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_APPNUM, &v, &flag );
+    /* appnum need not be set */
+    if (flag) {
+       vval = *(int *)v;
+       if (vval < 0) {
+           errs++;
+           fprintf( stderr, "MPI_APPNUM is defined as %d but must be nonnegative\n", vval );
+       }
+    }
+
+    /* MPI 2.0 section 5.5.1.  MPI_UNIVERSE_SIZE need not be set, but
+       should be present.  */
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &v, &flag );
+    /* MPI_UNIVERSE_SIZE need not be set */
+    if (flag) {
+       /* But if it is set, it must be at least the size of comm_world */
+       vval = *(int *)v;
+       if (vval < size) {
+           errs++;
+           fprintf( stderr, "MPI_UNIVERSE_SIZE = %d, less than comm world (%d)\n", vval, size );
+       }
+    }
+    
+    MPI_Comm_get_attr( MPI_COMM_WORLD, MPI_LASTUSEDCODE, &v, &flag );
+    /* Last used code must be defined and >= MPI_ERR_LASTCODE */
+    if (flag) {
+       vval = *(int*)v;
+       if (vval < MPI_ERR_LASTCODE) {
+           errs++;
+           fprintf( stderr, "MPI_LASTUSEDCODE points to an integer (%d) smaller than MPI_ERR_LASTCODE (%d)\n", vval, MPI_ERR_LASTCODE );
+       }
+    }
+    else {
+       errs++;
+       fprintf( stderr, "MPI_LASTUSECODE is not defined\n" );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize( );
+    
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/fkeyval.c b/teshsuite/smpi/mpich3-test/attr/fkeyval.c
new file mode 100644 (file)
index 0000000..48722c1
--- /dev/null
@@ -0,0 +1,113 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test freeing keyvals while still attached to \
+a communicator, then make sure that the keyval delete and copy code are still \
+executed";
+*/
+
+/* Function prototypes to keep compilers happy */
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag);
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state);
+
+/* Copy increments the attribute value */
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag)
+{
+    /* Copy the address of the attribute */
+    *(void **)attribute_val_out = attribute_val_in;
+    /* Change the value */
+    *(int *)attribute_val_in = *(int *)attribute_val_in + 1;
+    /* set flag to 1 to tell comm dup to insert this attribute
+       into the new communicator */
+    *flag = 1;
+    return MPI_SUCCESS;
+}
+
+/* Delete decrements the attribute value */
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    *(int *)attribute_val = *(int *)attribute_val - 1;
+    return MPI_SUCCESS;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int attrval;
+    int i, key[32], keyval, saveKeyval;
+    MPI_Comm comm, dupcomm;
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracomm( &comm, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Keyval_create( copy_fn, delete_fn, &keyval, (void *)0 );
+       saveKeyval = keyval;   /* in case we need to free explicitly */
+       attrval = 1;
+       MPI_Attr_put( comm, keyval, (void*)&attrval );
+       /* See MPI-1, 5.7.1.  Freeing the keyval does not remove it if it
+          is in use in an attribute */
+       MPI_Keyval_free( &keyval );
+       
+       /* We create some dummy keyvals here in case the same keyval
+          is reused */
+       for (i=0; i<32; i++) {
+           MPI_Keyval_create( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+       }
+
+       MPI_Comm_dup( comm, &dupcomm );
+       /* Check that the attribute was copied */
+       if (attrval != 2) {
+           errs++;
+           printf( "Attribute not incremented when comm dup'ed (%s)\n",
+                   MTestGetIntracommName() );
+       }
+       MPI_Comm_free( &dupcomm );
+       if (attrval != 1) {
+           errs++;
+           printf( "Attribute not decremented when dupcomm %s freed\n",
+                   MTestGetIntracommName() );
+       }
+       /* Check that the attribute was freed in the dupcomm */
+
+       if (comm != MPI_COMM_WORLD && comm != MPI_COMM_SELF) {
+           MPI_Comm_free( &comm );
+           /* Check that the original attribute was freed */
+           if (attrval != 0) {
+               errs++;
+               printf( "Attribute not decremented when comm %s freed\n",
+                       MTestGetIntracommName() );
+           }
+       }
+       else {
+           /* Explicitly delete the attributes from world and self */
+           MPI_Attr_delete( comm, saveKeyval );
+       }
+       /* Free those other keyvals */
+       for (i=0; i<32; i++) {
+           MPI_Keyval_free( &key[i] );
+       }
+    }
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    /* The attributes on comm self and world were deleted by finalize 
+       (see separate test) */
+    
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/fkeyvalcomm.c b/teshsuite/smpi/mpich3-test/attr/fkeyvalcomm.c
new file mode 100644 (file)
index 0000000..e2e6614
--- /dev/null
@@ -0,0 +1,114 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test freeing keyvals while still attached to \
+a communicator, then make sure that the keyval delete and copy code are still \
+executed";
+*/
+
+/* Function prototypes to keep compilers happy */
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag);
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state);
+
+/* Copy increments the attribute value */
+int copy_fn( MPI_Comm oldcomm, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag)
+{
+    /* Copy the address of the attribute */
+    *(void **)attribute_val_out = attribute_val_in;
+    /* Change the value */
+    *(int *)attribute_val_in = *(int *)attribute_val_in + 1;
+    /* set flag to 1 to tell comm dup to insert this attribute
+       into the new communicator */
+    *flag = 1;
+    return MPI_SUCCESS;
+}
+
+/* Delete decrements the attribute value */
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    *(int *)attribute_val = *(int *)attribute_val - 1;
+    return MPI_SUCCESS;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int attrval;
+    int i, key[32], keyval, saveKeyval;
+    MPI_Comm comm, dupcomm;
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracomm( &comm, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_create_keyval( copy_fn, delete_fn, &keyval, (void *)0 );
+       saveKeyval = keyval;   /* in case we need to free explicitly */
+       attrval = 1;
+       MPI_Comm_set_attr( comm, keyval, (void*)&attrval );
+       /* See MPI-1, 5.7.1.  Freeing the keyval does not remove it if it
+          is in use in an attribute */
+       MPI_Comm_free_keyval( &keyval );
+       
+       /* We create some dummy keyvals here in case the same keyval
+          is reused */
+       for (i=0; i<32; i++) {
+           MPI_Comm_create_keyval( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+       }
+
+       MPI_Comm_dup( comm, &dupcomm );
+       /* Check that the attribute was copied */
+       if (attrval != 2) {
+           errs++;
+           printf( "Attribute not incremented when comm dup'ed (%s)\n",
+                   MTestGetIntracommName() );
+       }
+       MPI_Comm_free( &dupcomm );
+       if (attrval != 1) {
+           errs++;
+           printf( "Attribute not decremented when dupcomm %s freed\n",
+                   MTestGetIntracommName() );
+       }
+       /* Check that the attribute was freed in the dupcomm */
+
+       if (comm != MPI_COMM_WORLD && comm != MPI_COMM_SELF) {
+           MPI_Comm_free( &comm );
+           /* Check that the original attribute was freed */
+           if (attrval != 0) {
+               errs++;
+               printf( "Attribute not decremented when comm %s freed\n",
+                       MTestGetIntracommName() );
+           }
+       }
+       else {
+           /* Explicitly delete the attributes from world and self */
+           MPI_Comm_delete_attr( comm, saveKeyval );
+       }
+       /* Free those other keyvals */
+       for (i=0; i<32; i++) {
+           MPI_Comm_free_keyval( &key[i] );
+       }
+    }
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    /* The attributes on comm self and world were deleted by finalize 
+       (see separate test) */
+    
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/fkeyvaltype.c b/teshsuite/smpi/mpich3-test/attr/fkeyvaltype.c
new file mode 100644 (file)
index 0000000..392e51d
--- /dev/null
@@ -0,0 +1,127 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+#include "stdlib.h"
+
+/*
+static char MTestDescrip[] = "Test freeing keyvals while still attached to \
+a datatype, then make sure that the keyval delete and copy code are still \
+executed";
+*/
+
+/* Copy increments the attribute value */
+int copy_fn( MPI_Datatype oldtype, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag);
+int copy_fn( MPI_Datatype oldtype, int keyval, void *extra_state,
+            void *attribute_val_in, void *attribute_val_out, 
+            int *flag)
+{
+    /* Copy the address of the attribute */
+    *(void **)attribute_val_out = attribute_val_in;
+    /* Change the value */
+    *(int *)attribute_val_in = *(int *)attribute_val_in + 1;
+    /* set flag to 1 to tell comm dup to insert this attribute
+       into the new communicator */
+    *flag = 1;
+    return MPI_SUCCESS;
+}
+
+/* Delete decrements the attribute value */
+int delete_fn( MPI_Datatype type, int keyval, void *attribute_val, 
+              void *extra_state);
+int delete_fn( MPI_Datatype type, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    *(int *)attribute_val = *(int *)attribute_val - 1;
+    return MPI_SUCCESS;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int attrval;
+    int i, key[32], keyval, saveKeyval;
+    MPI_Datatype type, duptype;
+    MTestDatatype mstype, mrtype;
+    char typename[MPI_MAX_OBJECT_NAME];
+    int tnlen;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetDatatypes( &mstype, &mrtype, 1 )) {
+       type = mstype.datatype;
+       MPI_Type_create_keyval( copy_fn, delete_fn, &keyval, (void *)0 );
+       saveKeyval = keyval;   /* in case we need to free explicitly */
+       attrval = 1;
+       MPI_Type_set_attr( type, keyval, (void*)&attrval );
+       /* See MPI-1, 5.7.1.  Freeing the keyval does not remove it if it
+          is in use in an attribute */
+       MPI_Type_free_keyval( &keyval );
+       
+       /* We create some dummy keyvals here in case the same keyval
+          is reused */
+       for (i=0; i<32; i++) {
+           MPI_Type_create_keyval( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+                              &key[i], (void *)0 );
+       }
+
+       if (attrval != 1) {
+           errs++;
+           MPI_Type_get_name( type, typename, &tnlen );
+           printf( "attrval is %d, should be 1, before dup in type %s\n",
+                    attrval, typename );
+       }
+       MPI_Type_dup( type, &duptype );
+       /* Check that the attribute was copied */
+       if (attrval != 2) {
+           errs++;
+           MPI_Type_get_name( type, typename, &tnlen );
+           printf( "Attribute not incremented when type dup'ed (%s)\n",
+                    typename );
+       }
+       MPI_Type_free( &duptype );
+       if (attrval != 1) {
+           errs++;
+           MPI_Type_get_name( type, typename, &tnlen );
+           printf( "Attribute not decremented when duptype %s freed\n",
+                   typename );
+       }
+       /* Check that the attribute was freed in the duptype */
+
+       if (!mstype.isBasic) {
+           MPI_Type_get_name( type, typename, &tnlen );
+            MTestFreeDatatype(&mstype);
+           /* Check that the original attribute was freed */
+           if (attrval != 0) {
+               errs++;
+               printf( "Attribute not decremented when type %s freed\n",
+                       typename );
+           }
+       }
+       else {
+           /* Explicitly delete the attributes from world and self */
+           MPI_Type_delete_attr( type, saveKeyval );
+            if (mstype.buf) {
+                free(mstype.buf);
+                mstype.buf = 0;
+            }
+       }
+       /* Free those other keyvals */
+       for (i=0; i<32; i++) {
+           MPI_Type_free_keyval( &key[i] );
+       }
+        MTestFreeDatatype(&mrtype);
+    }
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/keyval_double_free.c b/teshsuite/smpi/mpich3-test/attr/keyval_double_free.c
new file mode 100644 (file)
index 0000000..9b5eaa6
--- /dev/null
@@ -0,0 +1,42 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "mpitest.h"
+
+/* tests multiple invocations of Keyval_free on the same keyval */
+
+int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra);
+int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra) {
+    MPI_Keyval_free(&keyval);
+    return MPI_SUCCESS;
+}
+
+int main (int argc, char **argv)
+{
+    MPI_Comm duped;
+    int keyval = MPI_KEYVAL_INVALID;
+    int keyval_copy = MPI_KEYVAL_INVALID;
+    int errs=0;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_dup(MPI_COMM_SELF, &duped);
+
+    MPI_Keyval_create(MPI_NULL_COPY_FN, delete_fn,  &keyval, NULL);
+    keyval_copy = keyval;
+
+    MPI_Attr_put(MPI_COMM_SELF, keyval, NULL);
+    MPI_Attr_put(duped, keyval, NULL);
+
+    MPI_Comm_free(&duped);         /* first MPI_Keyval_free */
+    MPI_Keyval_free(&keyval);      /* second MPI_Keyval_free */
+    MPI_Keyval_free(&keyval_copy); /* third MPI_Keyval_free */
+    MTest_Finalize( errs );
+    MPI_Finalize();                /* fourth MPI_Keyval_free */
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/attr/testlist b/teshsuite/smpi/mpich3-test/attr/testlist
new file mode 100644 (file)
index 0000000..368d246
--- /dev/null
@@ -0,0 +1,32 @@
+#needs MPI_Keyval_create and MPI_Attr_get
+#attrt 2
+#needs MPI_Intercomm_create
+#attric 4
+#needs MPI_Errhandler_set, MPI_Keyval_create, MPI_Keyval_free, MPI_Attr_put
+#attrerr 1
+#needs MPI_Keyval_create, MPI_Keyval_free, MPI_Attr_put
+#attrend 1
+#attrend 4
+attrend2 1
+attrend2 5
+#needs MPI_Errhandler_set, MPI_Comm_create_keyval, MPI_Comm_free_keyval, MPI_Comm_set_attr, MPI_Comm_delete_attr
+#attrerrcomm 1
+#needs MPI_Errhandler_set, MPI_Type_create_keyval, MPI_Type_dup, MPI_Type_set_attr, MPI_Type_delete_attr
+#attrerrtype 1
+#needs MPI_Type_create_keyval, MPI_Type_dup, MPI_Type_set_attr
+#attr2type 1
+#needs MPI_Keyval_create, MPI_Keyval_free, MPI_Attr_put, MPI_Attr_get, MPI_Attr_delete
+#attrorder 1
+#needs MPI_Comm_create_keyval, MPI_Comm_free_keyval, MPI_Comm_get_attr, MPI_Comm_set_attr, MPI_Comm_delete_attr
+#attrordercomm 1
+#needs MPI_Type_create_keyval, MPI_Type_delete_keyval, MPI_Type_set_attr, MPI_Type_delete_attr
+#attrordertype 1
+#needs MPI_Errhandler_set, MPI_Attr_get
+#baseattr2 1
+#needs MPI_Comm_get_attr
+#baseattrcomm 1
+#MPI_Keyval_create, MPI_Keyval_free for type and comm also
+#fkeyval 1
+#fkeyvalcomm 1
+#fkeyvaltype 1
+#keyval_double_free 1
diff --git a/teshsuite/smpi/mpich3-test/checktests b/teshsuite/smpi/mpich3-test/checktests
new file mode 100755 (executable)
index 0000000..ab26692
--- /dev/null
@@ -0,0 +1,96 @@
+#! /usr/local/bin/perl
+
+$debug   = 1;
+$verbose = 1;
+$ignoreBogusOutput = 0;
+$filePattern = "runtests.*.status";
+
+$testsPassed = 0;
+$testsFailed = 0;
+
+foreach $_ (@ARGV) {
+    if (/^--?ignorebogus/) {
+       $ignoreBogusOutput = 1;
+    }
+    else {
+       print STDERR "checktests [ -ignorebogus ]\n";
+       exit(1);
+    }
+}
+
+open( RESULTS, "ls -1 $filePattern |" ) || die "Cannot list directory using ls -1 $filePattern\n";
+
+while (<RESULTS>) {
+    chop;
+    $statusFile = $_;
+    $resultsFile = $statusFile;
+    $resultsFile =~ s/\.status/.out/;
+
+    if ($resultsFile =~ /runtests\.([0-9]+)\.out/) {
+       $count = $1;
+    }
+    else {
+       $count = -1;
+       print STDERR "Unable to determine test number from $resultsFile!\n";
+       $testsFailed ++;
+       next;
+    }
+    open (SFD, "<$statusFile" );
+    while (<SFD>) {
+       chop;
+       $testStatus = $_;
+    }
+    close (SFD);
+    
+    if (-s $resultsFile) {
+       open (RFD, "<$resultsFile");
+       $runLine = <RFD>;
+       $sawNoerrors = 0;
+       # Successful output should contain ONLY the line No Errors
+       while (<RFD>) {
+           chop;
+           $outLine = $_;
+           if ($outLine =~ /^\s+No [Ee]rrors\s*$/) {
+               $sawNoerrors = 1;
+           }
+           else {
+               # To filter out output that may be added to STDOUT
+               # by a badly behaved runtime system, you can either
+               # add a specific filter here (preferred) or set the
+               # -ignorebogus option (considered a workaround)
+               # The following is an example that accepts certain
+               # kinds of output once "No Errors" is seen.
+               if ($sawNoerrors) {
+                   if ( /^Application [0-9]+ resources: utime .*/) {
+                       last;
+                    }
+                }
+               if (!$ignoreBogusOutput) {
+                   # Any extraneous output is an error
+                   $sawNoerrors = 0;
+               }
+           }
+       }
+       close (RFD);
+       if ($sawNoerrors == 1 && $testStatus == 0) {
+           $testsPassed ++;
+       }
+       else {
+           # Test wrote No Errors but then exited with a non-zero status
+           $testsFailed ++;
+           # Output the errors
+           if ($verbose) {
+               print STDOUT "Test $count failed:\n";
+               print STDOUT "Test status: $testStatus\n";
+               print STDOUT "Test output:\n";
+               system ("cat $resultsFile" );
+           }
+       }
+    }
+    else {
+       print STDERR "No $resultsFile\n" if $debug;
+       $testsFailed ++;
+    }
+}
+
+print "Tests passed: $testsPassed; test failed: $testsFailed\n";
diff --git a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4d4093b
--- /dev/null
@@ -0,0 +1,306 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(allgather2 allgather2.c ../util/mtest.c)
+  add_executable(allgather3 allgather3.c ../util/mtest.c)
+  add_executable(allgatherv2 allgatherv2.c ../util/mtest.c)
+  add_executable(allgatherv3 allgatherv3.c ../util/mtest.c)
+  add_executable(allgatherv4 allgatherv4.c ../util/mtest.c)
+  add_executable(allred2 allred2.c ../util/mtest.c)
+  add_executable(allred3 allred3.c ../util/mtest.c)
+  add_executable(allred4 allred4.c ../util/mtest.c)
+  add_executable(allred5 allred5.c ../util/mtest.c)
+  add_executable(allred6 allred6.c ../util/mtest.c)
+#  add_executable(allred allred.c ../util/mtest.c)
+  add_executable(allredmany allredmany.c ../util/mtest.c)
+  add_executable(alltoall1 alltoall1.c ../util/mtest.c)
+  add_executable(alltoallv0 alltoallv0.c ../util/mtest.c)
+  add_executable(alltoallv alltoallv.c ../util/mtest.c)
+  add_executable(alltoallw1 alltoallw1.c ../util/mtest.c)
+  add_executable(alltoallw2 alltoallw2.c ../util/mtest.c)
+  add_executable(alltoallw_zeros alltoallw_zeros.c ../util/mtest.c)
+  add_executable(bcast2 bcast2.c ../util/mtest.c)
+  add_executable(bcast3 bcast3.c ../util/mtest.c)
+  add_executable(bcasttest bcasttest.c ../util/mtest.c)
+  add_executable(bcastzerotype bcastzerotype.c ../util/mtest.c)
+  add_executable(coll10 coll10.c ../util/mtest.c)
+  add_executable(coll11 coll11.c ../util/mtest.c)
+  add_executable(coll12 coll12.c ../util/mtest.c)
+  add_executable(coll13 coll13.c ../util/mtest.c)
+  add_executable(coll2 coll2.c ../util/mtest.c)
+  add_executable(coll3 coll3.c ../util/mtest.c)
+  add_executable(coll4 coll4.c ../util/mtest.c)
+  add_executable(coll5 coll5.c ../util/mtest.c)
+  add_executable(coll6 coll6.c ../util/mtest.c)
+  add_executable(coll7 coll7.c ../util/mtest.c)
+  add_executable(coll8 coll8.c ../util/mtest.c)
+  add_executable(coll9 coll9.c ../util/mtest.c)
+  add_executable(exscan2 exscan2.c ../util/mtest.c)
+  add_executable(exscan exscan.c ../util/mtest.c)
+  add_executable(gather2 gather2.c ../util/mtest.c)
+  add_executable(gather2_save gather2_save.c ../util/mtest.c)
+  add_executable(gather gather.c ../util/mtest.c)
+  add_executable(iallred iallred.c ../util/mtest.c)
+  add_executable(ibarrier ibarrier.c ../util/mtest.c)
+  add_executable(icallgather icallgather.c ../util/mtest.c)
+  add_executable(icallgatherv icallgatherv.c ../util/mtest.c)
+  add_executable(icallreduce icallreduce.c ../util/mtest.c)
+  add_executable(icalltoall icalltoall.c ../util/mtest.c)
+  add_executable(icalltoallv icalltoallv.c ../util/mtest.c)
+  add_executable(icalltoallw icalltoallw.c ../util/mtest.c)
+  add_executable(icbarrier icbarrier.c ../util/mtest.c)
+  add_executable(icbcast icbcast.c ../util/mtest.c)
+  add_executable(icgather icgather.c ../util/mtest.c)
+  add_executable(icgatherv icgatherv.c ../util/mtest.c)
+  add_executable(icreduce icreduce.c ../util/mtest.c)
+  add_executable(icscatter icscatter.c ../util/mtest.c)
+  add_executable(icscatterv icscatterv.c ../util/mtest.c)
+  add_executable(longuser longuser.c ../util/mtest.c)
+  add_executable(nonblocking2 nonblocking2.c ../util/mtest.c)
+  add_executable(nonblocking3 nonblocking3.c ../util/mtest.c)
+  add_executable(nonblocking nonblocking.c ../util/mtest.c)
+  add_executable(opband opband.c ../util/mtest.c)
+  add_executable(opbor opbor.c ../util/mtest.c)
+  add_executable(opbxor opbxor.c ../util/mtest.c)
+  add_executable(op_commutative op_commutative.c ../util/mtest.c)
+  add_executable(opland opland.c ../util/mtest.c)
+  add_executable(oplor oplor.c ../util/mtest.c)
+  add_executable(oplxor oplxor.c ../util/mtest.c)
+  add_executable(opmax opmax.c ../util/mtest.c)
+  add_executable(opmaxloc opmaxloc.c ../util/mtest.c)
+  add_executable(opmin opmin.c ../util/mtest.c)
+  add_executable(opminloc opminloc.c ../util/mtest.c)
+  add_executable(opprod opprod.c ../util/mtest.c)
+  add_executable(opsum opsum.c ../util/mtest.c)
+  add_executable(red3 red3.c ../util/mtest.c)
+  add_executable(red4 red4.c ../util/mtest.c)
+  add_executable(redscat2 redscat2.c ../util/mtest.c)
+  add_executable(redscat3 redscat3.c ../util/mtest.c)
+  add_executable(redscatbkinter redscatbkinter.c ../util/mtest.c)
+  add_executable(redscatblk3 redscatblk3.c ../util/mtest.c)
+  add_executable(red_scat_block2 red_scat_block2.c ../util/mtest.c)
+  add_executable(red_scat_block red_scat_block.c ../util/mtest.c)
+  add_executable(redscat redscat.c ../util/mtest.c)
+  add_executable(redscatinter redscatinter.c ../util/mtest.c)
+  add_executable(reduce_mpich reduce.c ../util/mtest.c)
+  add_executable(reduce_local reduce_local.c ../util/mtest.c)
+  add_executable(scantst scantst.c ../util/mtest.c)
+  add_executable(scatter2 scatter2.c ../util/mtest.c)
+  add_executable(scatter3 scatter3.c ../util/mtest.c)
+  add_executable(scattern scattern.c ../util/mtest.c)
+  add_executable(scatterv scatterv.c ../util/mtest.c)
+  add_executable(uoplong uoplong.c ../util/mtest.c)
+
+  target_link_libraries(allgather2  simgrid)
+  target_link_libraries(allgather3  simgrid)
+  target_link_libraries(allgatherv2  simgrid)
+  target_link_libraries(allgatherv3  simgrid)
+  target_link_libraries(allgatherv4  simgrid)
+  target_link_libraries(allred2  simgrid)
+  target_link_libraries(allred3  simgrid)
+  target_link_libraries(allred4  simgrid)
+  target_link_libraries(allred5  simgrid)
+  target_link_libraries(allred6  simgrid)
+#  target_link_libraries(allred  simgrid)
+  target_link_libraries(allredmany  simgrid)
+  target_link_libraries(alltoall1  simgrid)
+  target_link_libraries(alltoallv0  simgrid)
+  target_link_libraries(alltoallv  simgrid)
+  target_link_libraries(alltoallw1  simgrid)
+  target_link_libraries(alltoallw2  simgrid)
+  target_link_libraries(alltoallw_zeros  simgrid)
+  target_link_libraries(bcast2  simgrid)
+  target_link_libraries(bcast3  simgrid)
+  target_link_libraries(bcasttest  simgrid)
+  target_link_libraries(bcastzerotype  simgrid)
+  target_link_libraries(coll10  simgrid)
+  target_link_libraries(coll11  simgrid)
+  target_link_libraries(coll12  simgrid)
+  target_link_libraries(coll13  simgrid)
+  target_link_libraries(coll2  simgrid)
+  target_link_libraries(coll3  simgrid)
+  target_link_libraries(coll4  simgrid)
+  target_link_libraries(coll5  simgrid)
+  target_link_libraries(coll6  simgrid)
+  target_link_libraries(coll7  simgrid)
+  target_link_libraries(coll8  simgrid)
+  target_link_libraries(coll9  simgrid)
+  target_link_libraries(exscan2  simgrid)
+  target_link_libraries(exscan  simgrid)
+  target_link_libraries(gather2  simgrid)
+  target_link_libraries(gather2_save  simgrid)
+  target_link_libraries(gather  simgrid)
+  target_link_libraries(iallred  simgrid)
+  target_link_libraries(ibarrier  simgrid)
+  target_link_libraries(icallgather  simgrid)
+  target_link_libraries(icallgatherv  simgrid)
+  target_link_libraries(icallreduce  simgrid)
+  target_link_libraries(icalltoall  simgrid)
+  target_link_libraries(icalltoallv  simgrid)
+  target_link_libraries(icalltoallw  simgrid)
+  target_link_libraries(icbarrier  simgrid)
+  target_link_libraries(icbcast  simgrid)
+  target_link_libraries(icgather  simgrid)
+  target_link_libraries(icgatherv  simgrid)
+  target_link_libraries(icreduce  simgrid)
+  target_link_libraries(icscatter  simgrid)
+  target_link_libraries(icscatterv  simgrid)
+  target_link_libraries(longuser  simgrid)
+  target_link_libraries(nonblocking2  simgrid)
+  target_link_libraries(nonblocking3  simgrid)
+  target_link_libraries(nonblocking  simgrid)
+  target_link_libraries(opband  simgrid)
+  target_link_libraries(opbor  simgrid)
+  target_link_libraries(opbxor  simgrid)
+  target_link_libraries(op_commutative  simgrid)
+  target_link_libraries(opland  simgrid)
+  target_link_libraries(oplor  simgrid)
+  target_link_libraries(oplxor  simgrid)
+  target_link_libraries(opmax  simgrid)
+  target_link_libraries(opmaxloc  simgrid)
+  target_link_libraries(opmin  simgrid)
+  target_link_libraries(opminloc  simgrid)
+  target_link_libraries(opprod  simgrid)
+  target_link_libraries(opsum  simgrid)
+  target_link_libraries(red3  simgrid)
+  target_link_libraries(red4  simgrid)
+  target_link_libraries(redscat2  simgrid)
+  target_link_libraries(redscat3  simgrid)
+  target_link_libraries(redscatbkinter  simgrid)
+  target_link_libraries(redscatblk3  simgrid)
+  target_link_libraries(red_scat_block2  simgrid)
+  target_link_libraries(red_scat_block  simgrid)
+  target_link_libraries(redscat  simgrid)
+  target_link_libraries(redscatinter  simgrid)
+  target_link_libraries(reduce_mpich  simgrid)
+  target_link_libraries(reduce_local  simgrid)
+  target_link_libraries(scantst  simgrid)
+  target_link_libraries(scatter2  simgrid)
+  target_link_libraries(scatter3  simgrid)
+  target_link_libraries(scattern  simgrid)
+  target_link_libraries(scatterv  simgrid)
+  target_link_libraries(uoplong  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/allgather2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allgather3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv4.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred4.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred5.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred6.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allred.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoall1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv0.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/alltoallw_zeros.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bcast2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bcast3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bcasttest.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bcastzerotype.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll10.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll11.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll12.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll13.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll4.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll5.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll6.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll7.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll8.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/coll9.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/exscan2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/exscan.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gather2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gather2_save.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gather.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/iallred.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/ibarrier.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icallgather.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icallgatherv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icallreduce.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icalltoall.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icalltoallv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icalltoallw.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icbarrier.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icbcast.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icgather.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icgatherv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icreduce.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icscatter.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icscatterv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/longuser.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opband.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opbor.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opbxor.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/op_commutative.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opland.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/oplor.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/oplxor.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opmax.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opmaxloc.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opmin.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opminloc.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opprod.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/opsum.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/red3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/red4.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscat2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscat3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscatbkinter.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscatblk3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_block2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_block.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscat.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/redscatinter.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/reduce.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/reduce_local.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scantst.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scatter2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scatter3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scattern.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scatterv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/uoplong.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/coll/allgather2.c b/teshsuite/smpi/mpich3-test/coll/allgather2.c
new file mode 100644 (file)
index 0000000..edb907d
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous.  Use IN_PLACE */
+
+int main( int argc, char **argv )
+{
+    double *vecout;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    i, errs = 0;
+    int    rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+        for (count = 1; count < 9000; count = count * 2) {
+            vecout = (double *)malloc( size * count * sizeof(double) );
+            
+            for (i=0; i<count; i++) {
+                vecout[rank*count+i] = rank*count+i;
+            }
+            MPI_Allgather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 
+                           vecout, count, MPI_DOUBLE, comm );
+            for (i=0; i<count*size; i++) {
+                if (vecout[i] != i) {
+                    errs++;
+                    if (errs < 10) {
+                        fprintf( stderr, "vecout[%d]=%d\n",
+                                 i, (int)vecout[i] );
+                    }
+                }
+            }
+            free( vecout );
+        }
+
+       MTestFreeComm( &comm );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/allgather3.c b/teshsuite/smpi/mpich3-test/coll/allgather3.c
new file mode 100644 (file)
index 0000000..66389b5
--- /dev/null
@@ -0,0 +1,64 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous. */
+
+int main( int argc, char **argv )
+{
+    double *vecout, *invec;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    i, errs = 0;
+    int    rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+        for (count = 1; count < 9000; count = count * 2) {
+           invec = (double *)malloc( count * sizeof(double) );
+            vecout = (double *)malloc( size * count * sizeof(double) );
+            
+            for (i=0; i<count; i++) {
+                invec[i] = rank*count+i;
+            }
+            MPI_Allgather( invec, count, MPI_DOUBLE, 
+                           vecout, count, MPI_DOUBLE, comm );
+            for (i=0; i<count*size; i++) {
+                if (vecout[i] != i) {
+                    errs++;
+                    if (errs < 10) {
+                        fprintf( stderr, "vecout[%d]=%d\n",
+                                 i, (int)vecout[i] );
+                    }
+                }
+            }
+           free( invec );
+            free( vecout );
+        }
+
+       MTestFreeComm( &comm );
+    }
+
+    /* Do a zero byte gather */
+    MPI_Allgather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, NULL, 0, MPI_BYTE, MPI_COMM_WORLD );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/allgatherv2.c b/teshsuite/smpi/mpich3-test/coll/allgatherv2.c
new file mode 100644 (file)
index 0000000..4a54344
--- /dev/null
@@ -0,0 +1,70 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous.  Use IN_PLACE.  This is 
+   the trivial version based on the allgather test (allgatherv but with
+   constant data sizes) */
+
+int main( int argc, char **argv )
+{
+    double *vecout;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    i, errs = 0;
+    int    rank, size;
+    int    *displs, *recvcounts;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+
+       displs     = (int *)malloc( size * sizeof(int) );
+       recvcounts = (int *)malloc( size * sizeof(int) );
+       
+        for (count = 1; count < 9000; count = count * 2) {
+            vecout = (double *)malloc( size * count * sizeof(double) );
+            
+            for (i=0; i<count; i++) {
+                vecout[rank*count+i] = rank*count+i;
+            }
+            for (i=0; i<size; i++) {
+                recvcounts[i] = count;
+                displs[i]    = i * count;
+            }
+            MPI_Allgatherv( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 
+                            vecout, recvcounts, displs, MPI_DOUBLE, comm );
+            for (i=0; i<count*size; i++) {
+                if (vecout[i] != i) {
+                    errs++;
+                    if (errs < 10) {
+                        fprintf( stderr, "vecout[%d]=%d\n",
+                                 i, (int)vecout[i] );
+                    }
+                }
+            }
+            free( vecout );
+        }
+       free( displs );
+       free( recvcounts );
+       MTestFreeComm( &comm );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/allgatherv3.c b/teshsuite/smpi/mpich3-test/coll/allgatherv3.c
new file mode 100644 (file)
index 0000000..7ba9a66
--- /dev/null
@@ -0,0 +1,72 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous.  This is 
+   the trivial version based on the allgather test (allgatherv but with
+   constant data sizes) */
+
+int main( int argc, char **argv )
+{
+    double *vecout, *invec;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    i, errs = 0;
+    int    rank, size;
+    int    *displs, *recvcounts;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+
+       displs     = (int *)malloc( size * sizeof(int) );
+       recvcounts = (int *)malloc( size * sizeof(int) );
+       
+        for (count = 1; count < 9000; count = count * 2) {
+           invec = (double *)malloc( count * sizeof(double) );
+            vecout = (double *)malloc( size * count * sizeof(double) );
+            
+            for (i=0; i<count; i++) {
+                invec[i] = rank*count+i;
+            }
+            for (i=0; i<size; i++) {
+                recvcounts[i] = count;
+                displs[i]    = i * count;
+            }
+            MPI_Allgatherv( invec, count, MPI_DOUBLE, 
+                            vecout, recvcounts, displs, MPI_DOUBLE, comm );
+            for (i=0; i<count*size; i++) {
+                if (vecout[i] != i) {
+                    errs++;
+                    if (errs < 10) {
+                        fprintf( stderr, "vecout[%d]=%d\n",
+                                 i, (int)vecout[i] );
+                    }
+                }
+            }
+           free( invec );
+            free( vecout );
+        }
+       free( displs );
+       free( recvcounts );
+       MTestFreeComm( &comm );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/allgatherv4.c b/teshsuite/smpi/mpich3-test/coll/allgatherv4.c
new file mode 100644 (file)
index 0000000..963fd36
--- /dev/null
@@ -0,0 +1,245 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+#include <math.h>
+#include <assert.h>
+
+/* FIXME: What is this test supposed to accomplish? */
+
+#define START_BUF (1)
+#define LARGE_BUF (256 * 1024)
+
+/* FIXME: MAX_BUF is too large */
+#define MAX_BUF   (128 * 1024 * 1024)
+#define LOOPS 10
+
+__thread char * sbuf, * rbuf;
+__thread int * recvcounts, * displs;
+int errs = 0;
+
+/* #define dprintf printf */
+#define dprintf(...)
+
+typedef enum {
+    REGULAR,
+    BCAST,
+    SPIKE,
+    HALF_FULL,
+    LINEAR_DECREASE,
+    BELL_CURVE
+} test_t;
+
+void comm_tests(MPI_Comm comm);
+double run_test(long long msg_size, MPI_Comm comm, test_t test_type, double * max_time);
+
+int main(int argc, char ** argv)
+{
+    int comm_size, comm_rank;
+    MPI_Comm comm;
+
+    MTest_Init(&argc, &argv);
+    MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
+
+    if (LARGE_BUF * comm_size > MAX_BUF)
+        goto fn_exit;
+
+    sbuf = (void *) calloc(MAX_BUF, 1);
+    rbuf = (void *) calloc(MAX_BUF, 1);
+
+    srand(time(NULL));
+
+    recvcounts = (void *) malloc(comm_size * sizeof(int));
+    displs = (void *) malloc(comm_size * sizeof(int));
+    if (!recvcounts || !displs || !sbuf || !rbuf) {
+        fprintf(stderr, "Unable to allocate memory:\n");
+       if (!sbuf) fprintf(stderr,"\tsbuf of %d bytes\n", MAX_BUF );
+       if (!rbuf) fprintf(stderr,"\trbuf of %d bytes\n", MAX_BUF );
+       if (!recvcounts) fprintf(stderr,"\trecvcounts of %zd bytes\n", comm_size * sizeof(int) );
+       if (!displs) fprintf(stderr,"\tdispls of %zd bytes\n", comm_size * sizeof(int) );
+        fflush(stderr);
+        MPI_Abort(MPI_COMM_WORLD, -1);
+    }
+
+    if (!comm_rank) {
+        dprintf("Message Range: (%d, %d); System size: %d\n", START_BUF, LARGE_BUF, comm_size);
+        fflush(stdout);
+    }
+
+
+    /* COMM_WORLD tests */
+    if (!comm_rank) {
+        dprintf("\n\n==========================================================\n");
+        dprintf("                         MPI_COMM_WORLD\n");
+        dprintf("==========================================================\n");
+    }
+    comm_tests(MPI_COMM_WORLD);
+
+    /* non-COMM_WORLD tests */
+    if (!comm_rank) {
+        dprintf("\n\n==========================================================\n");
+        dprintf("                         non-COMM_WORLD\n");
+        dprintf("==========================================================\n");
+    }
+    MPI_Comm_split(MPI_COMM_WORLD, (comm_rank == comm_size - 1) ? 0 : 1, 0, &comm);
+    if (comm_rank < comm_size - 1)
+        comm_tests(comm);
+    MPI_Comm_free(&comm);
+
+    /* Randomized communicator tests */
+    if (!comm_rank) {
+        dprintf("\n\n==========================================================\n");
+        dprintf("                         Randomized Communicator\n");
+        dprintf("==========================================================\n");
+    }
+    MPI_Comm_split(MPI_COMM_WORLD, 0, rand(), &comm);
+    comm_tests(comm);
+    MPI_Comm_free(&comm);
+
+    //free(sbuf);
+    //free(rbuf);
+    free(recvcounts);
+    free(displs);
+
+fn_exit:
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
+
+void comm_tests(MPI_Comm comm)
+{
+    int comm_size, comm_rank;
+    double rtime, max_time;
+    long long msg_size;
+
+    MPI_Comm_size(comm, &comm_size);
+    MPI_Comm_rank(comm, &comm_rank);
+
+    for (msg_size = START_BUF; msg_size <= LARGE_BUF; msg_size *= 2) {
+        if (!comm_rank) {
+            dprintf("\n====> MSG_SIZE: %d\n", (int) msg_size);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, REGULAR, &max_time);
+        if (!comm_rank) {
+            dprintf("REGULAR:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, BCAST, &max_time);
+        if (!comm_rank) {
+            dprintf("BCAST:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, SPIKE, &max_time);
+        if (!comm_rank) {
+            dprintf("SPIKE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, HALF_FULL, &max_time);
+        if (!comm_rank) {
+            dprintf("HALF_FULL:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, LINEAR_DECREASE, &max_time);
+        if (!comm_rank) {
+            dprintf("LINEAR_DECREASE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+
+        rtime = run_test(msg_size, comm, BELL_CURVE, &max_time);
+        if (!comm_rank) {
+            dprintf("BELL_CURVE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
+            fflush(stdout);
+        }
+    }
+}
+
+double run_test(long long msg_size, MPI_Comm comm, test_t test_type, 
+               double * max_time)
+{
+    int i, j;
+    int comm_size, comm_rank;
+    double start, end;
+    double total_time, avg_time;
+    MPI_Aint tmp;
+
+    MPI_Comm_size(comm, &comm_size);
+    MPI_Comm_rank(comm, &comm_rank);
+
+    displs[0] = 0;
+    for (i = 0; i < comm_size; i++) {
+        if (test_type == REGULAR)
+            recvcounts[i] = msg_size;
+        else if (test_type == BCAST)
+            recvcounts[i] = (!i) ? msg_size : 0;
+        else if (test_type == SPIKE)
+            recvcounts[i] = (!i) ? (msg_size / 2) : (msg_size / (2 * (comm_size - 1)));
+        else if (test_type == HALF_FULL)
+            recvcounts[i] = (i < (comm_size / 2)) ? (2 * msg_size) : 0;
+        else if (test_type == LINEAR_DECREASE) {
+            tmp = 2 * msg_size * (comm_size - 1 - i) / (comm_size - 1);
+           if (tmp != (int)tmp) {
+               fprintf( stderr, "Integer overflow in variable tmp\n" );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+            recvcounts[i] = (int) tmp;
+
+            /* If the maximum message size is too large, don't run */
+            if (tmp > MAX_BUF) return 0;
+        }
+        else if (test_type == BELL_CURVE) {
+            for (j = 0; j < i; j++) {
+                if (i - 1 + j >= comm_size) continue;
+                tmp = msg_size * comm_size / (log(comm_size) * i);
+                recvcounts[i - 1 + j] = (int) tmp;
+                displs[i - 1 + j] = 0;
+
+                /* If the maximum message size is too large, don't run */
+                if (tmp > MAX_BUF) return 0;
+            }
+        }
+
+        if (i < comm_size - 1)
+            displs[i+1] = displs[i] + recvcounts[i];
+    }
+
+    /* Test that:
+       1: sbuf is large enough
+       2: rbuf is large enough
+       3: There were no failures (e.g., tmp nowhere > rbuf size 
+    */
+    MPI_Barrier(comm);
+    start = MPI_Wtime();
+    for (i = 0; i < LOOPS; i++) {
+        MPI_Allgatherv(sbuf, recvcounts[comm_rank], MPI_CHAR,
+                       rbuf, recvcounts, displs, MPI_CHAR, comm);
+    }
+    end = MPI_Wtime();
+    MPI_Barrier(comm);
+
+    /* Convert to microseconds (why?) */
+    total_time = 1.0e6 * (end - start);
+    MPI_Reduce(&total_time, &avg_time, 1, MPI_DOUBLE, MPI_SUM, 0, comm);
+    MPI_Reduce(&total_time, max_time, 1, MPI_DOUBLE, MPI_MAX, 0, comm);
+
+    return (avg_time / (LOOPS * comm_size));
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred.c b/teshsuite/smpi/mpich3-test/coll/allred.c
new file mode 100644 (file)
index 0000000..d33f876
--- /dev/null
@@ -0,0 +1,447 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*      Warning - this test will fail for MPI_PROD & maybe MPI_SUM
+ *        if more than 10 MPI processes are used.  Loss of precision
+ *        will occur as the number of processors is increased.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+int count, size, rank;
+int cerrcnt;
+
+struct int_test { int a; int b; };
+struct long_test { long a; int b; };
+struct short_test { short a; int b; };
+struct float_test { float a; int b; };
+struct double_test { double a; int b; };
+
+#define mpi_op2str(op)                   \
+    ((op == MPI_SUM) ? "MPI_SUM" :       \
+     (op == MPI_PROD) ? "MPI_PROD" :     \
+     (op == MPI_MAX) ? "MPI_MAX" :       \
+     (op == MPI_MIN) ? "MPI_MIN" :       \
+     (op == MPI_LOR) ? "MPI_LOR" :       \
+     (op == MPI_LXOR) ? "MPI_LXOR" :     \
+     (op == MPI_LAND) ? "MPI_LAND" :     \
+     (op == MPI_BOR) ? "MPI_BOR" :       \
+     (op == MPI_BAND) ? "MPI_BAND" :     \
+     (op == MPI_BXOR) ? "MPI_BXOR" :     \
+     (op == MPI_MAXLOC) ? "MPI_MAXLOC" : \
+     (op == MPI_MINLOC) ? "MPI_MINLOC" : \
+     "MPI_NO_OP")
+
+/* calloc to avoid spurious valgrind warnings when "type" has padding bytes */
+#define DECL_MALLOC_IN_OUT_SOL(type)                 \
+    type *in, *out, *sol;                            \
+    in  = (type *) calloc(count, sizeof(type));      \
+    out = (type *) calloc(count, sizeof(type));      \
+    sol = (type *) calloc(count, sizeof(type));
+
+#define SET_INDEX_CONST(arr, val)               \
+    {                                           \
+        int i;                                  \
+        for (i = 0; i < count; i++)             \
+            arr[i] = val;                       \
+    }
+
+#define SET_INDEX_SUM(arr, val)                 \
+    {                                           \
+        int i;                                  \
+        for (i = 0; i < count; i++)             \
+            arr[i] = i + val;                   \
+    }
+
+#define SET_INDEX_FACTOR(arr, val)              \
+    {                                           \
+        int i;                                  \
+        for (i = 0; i < count; i++)             \
+            arr[i] = i * (val);                 \
+    }
+
+#define SET_INDEX_POWER(arr, val)               \
+    {                                           \
+        int i, j;                               \
+        for (i = 0; i < count; i++) {           \
+            (arr)[i] = 1;                       \
+            for (j = 0; j < (val); j++)         \
+                arr[i] *= i;                    \
+        }                                       \
+    }
+
+#define ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op)                 \
+    do {                                                                \
+        char name[MPI_MAX_OBJECT_NAME] = {0};                           \
+        int len = 0;                                                    \
+        if (lerrcnt) {                                                  \
+            MPI_Type_get_name(mpi_type, name, &len);                    \
+            fprintf(stderr, "(%d) Error for type %s and op %s\n",       \
+                    rank, name, mpi_op2str(mpi_op));                    \
+        }                                                               \
+        free(in); free(out); free(sol);                                 \
+    } while(0)
+
+/* The logic on the error check on MPI_Allreduce assumes that all 
+   MPI_Allreduce routines return a failure if any do - this is sufficient
+   for MPI implementations that reject some of the valid op/datatype pairs
+   (and motivated this addition, as some versions of the IBM MPI 
+   failed in just this way).
+*/
+#define ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol)              \
+    {                                                                   \
+        int i, rc, lerrcnt = 0;                                                \
+        rc = MPI_Allreduce(in, out, count, mpi_type, mpi_op, MPI_COMM_WORLD); \
+       if (rc) { lerrcnt++; cerrcnt++; MTestPrintError( rc ); }        \
+       else {                                                          \
+          for (i = 0; i < count; i++) {                                   \
+              if (out[i] != sol[i]) {                                     \
+                  cerrcnt++;                                              \
+                  lerrcnt++;                                              \
+              }                                                           \
+          }                                                              \
+        }                                                               \
+        ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op);                \
+    }
+
+#define STRUCT_ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol)       \
+    {                                                                   \
+        int i, rc, lerrcnt = 0;                                                \
+        rc = MPI_Allreduce(in, out, count, mpi_type, mpi_op, MPI_COMM_WORLD); \
+       if (rc) { lerrcnt++; cerrcnt++; MTestPrintError( rc ); }        \
+        else {                                                            \
+          for (i = 0; i < count; i++) {                                   \
+              if ((out[i].a != sol[i].a) || (out[i].b != sol[i].b)) {     \
+                  cerrcnt++;                                              \
+                  lerrcnt++;                                              \
+              }                                                           \
+            }                                                             \
+        }                                                               \
+        ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op);                \
+    }
+
+#define SET_INDEX_STRUCT_CONST(arr, val, el)                    \
+    {                                                           \
+        int i;                                                  \
+        for (i = 0; i < count; i++)                             \
+            arr[i].el = val;                                    \
+    }
+
+#define SET_INDEX_STRUCT_SUM(arr, val, el)                      \
+    {                                                           \
+        int i;                                                  \
+        for (i = 0; i < count; i++)                             \
+            arr[i].el = i + (val);                              \
+    }
+
+#define sum_test1(type, mpi_type)                                       \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_SUM(in, 0);                                           \
+        SET_INDEX_FACTOR(sol, size);                                    \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_SUM, in, out, sol);            \
+    }
+
+#define prod_test1(type, mpi_type)                                      \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_SUM(in, 0);                                           \
+        SET_INDEX_POWER(sol, size);                                     \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_PROD, in, out, sol);           \
+    }
+
+#define max_test1(type, mpi_type)                                       \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_SUM(in, rank);                                        \
+        SET_INDEX_SUM(sol, size - 1);                                   \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_MAX, in, out, sol);            \
+    }
+
+#define min_test1(type, mpi_type)                                       \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_SUM(in, rank);                                        \
+        SET_INDEX_SUM(sol, 0);                                          \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_MIN, in, out, sol);            \
+    }
+
+#define const_test(type, mpi_type, mpi_op, val1, val2, val3)            \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_CONST(in, (val1));                                    \
+        SET_INDEX_CONST(sol, (val2));                                   \
+        SET_INDEX_CONST(out, (val3));                                   \
+        ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol);             \
+    }
+
+#define lor_test1(type, mpi_type)                                       \
+    const_test(type, mpi_type, MPI_LOR, (rank & 0x1), (size > 1), 0)
+#define lor_test2(type, mpi_type)                       \
+    const_test(type, mpi_type, MPI_LOR, 0, 0, 0)
+#define lxor_test1(type, mpi_type)                                      \
+    const_test(type, mpi_type, MPI_LXOR, (rank == 1), (size > 1), 0)
+#define lxor_test2(type, mpi_type)                      \
+    const_test(type, mpi_type, MPI_LXOR, 0, 0, 0)
+#define lxor_test3(type, mpi_type)                      \
+    const_test(type, mpi_type, MPI_LXOR, 1, (size & 0x1), 0)
+#define land_test1(type, mpi_type)                              \
+    const_test(type, mpi_type, MPI_LAND, (rank & 0x1), 0, 0)
+#define land_test2(type, mpi_type)                      \
+    const_test(type, mpi_type, MPI_LAND, 1, 1, 0)
+#define bor_test1(type, mpi_type)                                       \
+    const_test(type, mpi_type, MPI_BOR, (rank & 0x3), ((size < 3) ? size - 1 : 0x3), 0)
+#define bxor_test1(type, mpi_type)                                      \
+    const_test(type, mpi_type, MPI_BXOR, (rank == 1) * 0xf0, (size > 1) * 0xf0, 0)
+#define bxor_test2(type, mpi_type)                      \
+    const_test(type, mpi_type, MPI_BXOR, 0, 0, 0)
+#define bxor_test3(type, mpi_type)                      \
+    const_test(type, mpi_type, MPI_BXOR, ~0, (size &0x1) ? ~0 : 0, 0)
+
+#define band_test1(type, mpi_type)                                      \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        if (rank == size-1) {                                           \
+            SET_INDEX_SUM(in, 0);                                       \
+        }                                                               \
+        else {                                                          \
+            SET_INDEX_CONST(in, ~0);                                    \
+        }                                                               \
+        SET_INDEX_SUM(sol, 0);                                          \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_BAND, in, out, sol);           \
+    }
+
+#define band_test2(type, mpi_type)                                      \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        if (rank == size-1) {                                           \
+            SET_INDEX_SUM(in, 0);                                       \
+        }                                                               \
+        else {                                                          \
+            SET_INDEX_CONST(in, 0);                                     \
+        }                                                               \
+        SET_INDEX_CONST(sol, 0);                                        \
+        SET_INDEX_CONST(out, 0);                                        \
+        ALLREDUCE_AND_FREE(mpi_type, MPI_BAND, in, out, sol);           \
+    }
+
+#define maxloc_test(type, mpi_type)                                     \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_STRUCT_SUM(in, rank, a);                              \
+        SET_INDEX_STRUCT_CONST(in, rank, b);                            \
+        SET_INDEX_STRUCT_SUM(sol, size - 1, a);                         \
+        SET_INDEX_STRUCT_CONST(sol, size - 1, b);                       \
+        SET_INDEX_STRUCT_CONST(out, 0, a);                              \
+        SET_INDEX_STRUCT_CONST(out, -1, b);                             \
+        STRUCT_ALLREDUCE_AND_FREE(mpi_type, MPI_MAXLOC, in, out, sol);   \
+    }
+
+#define minloc_test(type, mpi_type)                                     \
+    {                                                                   \
+        DECL_MALLOC_IN_OUT_SOL(type);                                   \
+        SET_INDEX_STRUCT_SUM(in, rank, a);                              \
+        SET_INDEX_STRUCT_CONST(in, rank, b);                            \
+        SET_INDEX_STRUCT_SUM(sol, 0, a);                                \
+        SET_INDEX_STRUCT_CONST(sol, 0, b);                              \
+        SET_INDEX_STRUCT_CONST(out, 0, a);                              \
+        SET_INDEX_STRUCT_CONST(out, -1, b);                             \
+        STRUCT_ALLREDUCE_AND_FREE(mpi_type, MPI_MINLOC, in, out, sol);  \
+    }
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+#define test_types_set_mpi_2_2_integer(op,post) do {                \
+        op##_test##post(int8_t, MPI_INT8_T);                        \
+        op##_test##post(int16_t, MPI_INT16_T);                      \
+        op##_test##post(int32_t, MPI_INT32_T);                      \
+        op##_test##post(int64_t, MPI_INT64_T);                      \
+        op##_test##post(uint8_t, MPI_UINT8_T);                      \
+        op##_test##post(uint16_t, MPI_UINT16_T);                    \
+        op##_test##post(uint32_t, MPI_UINT32_T);                    \
+        op##_test##post(uint64_t, MPI_UINT64_T);                    \
+        op##_test##post(MPI_Aint, MPI_AINT);                        \
+        op##_test##post(MPI_Offset, MPI_OFFSET);                    \
+    } while (0)
+#else
+#define test_types_set_mpi_2_2_integer(op,post) do { } while (0)
+#endif
+
+#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
+#define test_types_set_mpi_3_0_integer(op,post) do {                \
+        op##_test##post(MPI_Count, MPI_COUNT);                      \
+    } while (0)
+#else
+#define test_types_set_mpi_3_0_integer(op,post) do { } while (0)
+#endif
+
+#define test_types_set1(op, post)                                   \
+    {                                                               \
+        op##_test##post(int, MPI_INT);                              \
+        op##_test##post(long, MPI_LONG);                            \
+        op##_test##post(short, MPI_SHORT);                          \
+        op##_test##post(unsigned short, MPI_UNSIGNED_SHORT);        \
+        op##_test##post(unsigned, MPI_UNSIGNED);                    \
+        op##_test##post(unsigned long, MPI_UNSIGNED_LONG);          \
+        op##_test##post(unsigned char, MPI_UNSIGNED_CHAR);          \
+        test_types_set_mpi_2_2_integer(op,post);                    \
+        test_types_set_mpi_3_0_integer(op,post);                    \
+    }
+
+#define test_types_set2(op, post)               \
+    {                                           \
+        test_types_set1(op, post);              \
+        op##_test##post(float, MPI_FLOAT);      \
+        op##_test##post(double, MPI_DOUBLE);    \
+    }
+
+#define test_types_set3(op, post)                                   \
+    {                                                               \
+        op##_test##post(unsigned char, MPI_BYTE);                   \
+    }
+
+/* Make sure that we test complex and double complex, even if long 
+   double complex is not available */
+#if defined(USE_LONG_DOUBLE_COMPLEX)
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
+    && defined(HAVE_DOUBLE__COMPLEX) \
+    && defined(HAVE_LONG_DOUBLE__COMPLEX)
+#define test_types_set4(op, post)                                             \
+    do {                                                                      \
+        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);                 \
+        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);               \
+        if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {                 \
+            op##_test##post(long double _Complex, MPI_C_LONG_DOUBLE_COMPLEX); \
+        }                                                                     \
+    } while (0)
+
+#else
+#define test_types_set4(op, post) do { } while (0)
+#endif
+#else
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
+    && defined(HAVE_DOUBLE__COMPLEX) 
+#define test_types_set4(op, post)                                         \
+    do {                                                                  \
+        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);             \
+        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);           \
+    } while (0)
+
+#else
+#define test_types_set4(op, post) do { } while (0)
+#endif
+
+#endif /* defined(USE_LONG_DOUBLE_COMPLEX) */
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE__BOOL)
+#define test_types_set5(op, post)           \
+    do {                                    \
+        op##_test##post(_Bool, MPI_C_BOOL); \
+    } while (0)
+
+#else
+#define test_types_set5(op, post) do { } while (0)
+#endif
+
+int main( int argc, char **argv )
+{
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (size < 2) {
+       fprintf( stderr, "At least 2 processes required\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    count = 10;
+    /* Allow an argument to override the count.
+       Note that the product tests may fail if the count is very large.
+     */
+    if (argc >= 2) {
+       count = atoi( argv[1] );
+       if  (count <= 0) {
+           fprintf( stderr, "Invalid count argument %s\n", argv[1] );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+    }
+
+    test_types_set2(sum, 1);
+    test_types_set2(prod, 1);
+    test_types_set2(max, 1);
+    test_types_set2(min, 1);
+
+    test_types_set1(lor, 1);
+    test_types_set1(lor, 2);
+
+    test_types_set1(lxor, 1);
+    test_types_set1(lxor, 2);
+    test_types_set1(lxor, 3);
+
+    test_types_set1(land, 1);
+    test_types_set1(land, 2);
+
+    test_types_set1(bor, 1);
+    test_types_set1(band, 1);
+    test_types_set1(band, 2);
+
+    test_types_set1(bxor, 1);
+    test_types_set1(bxor, 2);
+    test_types_set1(bxor, 3);
+
+    test_types_set3(bor, 1);
+    test_types_set3(band, 1);
+    test_types_set3(band, 2);
+
+    test_types_set3(bxor, 1);
+    test_types_set3(bxor, 2);
+    test_types_set3(bxor, 3);
+
+    test_types_set4(sum, 1);
+    test_types_set4(prod, 1);
+
+    test_types_set5(lor, 1);
+    test_types_set5(lor, 2);
+    test_types_set5(lxor, 1);
+    test_types_set5(lxor, 2);
+    test_types_set5(lxor, 3);
+    test_types_set5(land, 1);
+    test_types_set5(land, 2);
+
+    maxloc_test(struct int_test, MPI_2INT);
+    maxloc_test(struct long_test, MPI_LONG_INT);
+    maxloc_test(struct short_test, MPI_SHORT_INT);
+    maxloc_test(struct float_test, MPI_FLOAT_INT);
+    maxloc_test(struct double_test, MPI_DOUBLE_INT);
+
+    minloc_test(struct int_test, MPI_2INT);
+    minloc_test(struct long_test, MPI_LONG_INT);
+    minloc_test(struct short_test, MPI_SHORT_INT);
+    minloc_test(struct float_test, MPI_FLOAT_INT);
+    minloc_test(struct double_test, MPI_DOUBLE_INT);
+
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( cerrcnt );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred2.c b/teshsuite/smpi/mpich3-test/coll/allred2.c
new file mode 100644 (file)
index 0000000..f33b245
--- /dev/null
@@ -0,0 +1,55 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Allreduce with MPI_IN_PLACE";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *buf, i;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+       
+       for (count = 1; count < 65000; count = count * 2) {
+           /* Contiguous data */
+           buf = (int *)malloc( count * sizeof(int) );
+           for (i=0; i<count; i++) buf[i] = rank + i;
+           MPI_Allreduce( MPI_IN_PLACE, buf, count, MPI_INT, MPI_SUM, comm );
+           /* Check the results */
+           for (i=0; i<count; i++) {
+               int result = i * size + (size*(size-1))/2;
+               if (buf[i] != result) {
+                   errs ++;
+                   if (errs < 10) {
+                       fprintf( stderr, "buf[%d] = %d expected %d\n",
+                                i, buf[i], result );
+                   }
+               }
+           }
+           free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred3.c b/teshsuite/smpi/mpich3-test/coll/allred3.c
new file mode 100644 (file)
index 0000000..aaf8a23
--- /dev/null
@@ -0,0 +1,212 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include <assert.h>
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Allreduce with non-commutative user-defined operations";
+*/
+
+/* We make the error count global so that we can easily control the output
+   of error information (in particular, limiting it after the first 10 
+   errors */
+int errs = 0;
+
+/* This implements a simple matrix-matrix multiply.  This is an associative
+   but not commutative operation.  The matrix size is set in matSize;
+   the number of matrices is the count argument. The matrix is stored
+   in C order, so that
+     c(i,j) is cin[j+i*matSize]
+ */
+#define MAXCOL 256
+static int matSize = 0;  /* Must be < MAXCOL */
+static int max_offset = 0;
+void uop( void *, void *, int *, MPI_Datatype * );
+void uop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    const int *cin = (const int *)cinPtr;
+    int *cout = (int *)coutPtr;
+    int i, j, k, nmat;
+    int tempcol[MAXCOL];
+    int offset1, offset2;
+    int matsize2 = matSize*matSize;
+
+    for (nmat = 0; nmat < *count; nmat++) {
+       for (j=0; j<matSize; j++) {
+           for (i=0; i<matSize; i++) {
+               tempcol[i] = 0;
+               for (k=0; k<matSize; k++) {
+                   /* col[i] += cin(i,k) * cout(k,j) */
+                   offset1    = k+i*matSize;
+                   offset2    = j+k*matSize;
+                   assert(offset1 < max_offset);
+                   assert(offset2 < max_offset);
+                   tempcol[i] += cin[offset1] * cout[offset2];
+               }
+           }
+           for (i=0; i<matSize; i++) {
+               offset1       = j+i*matSize;
+               assert(offset1 < max_offset);
+               cout[offset1] = tempcol[i];
+           }
+       }
+       cin  += matsize2;
+       cout += matsize2;
+    }
+}
+
+/* Initialize the integer matrix as a permutation of rank with rank+1.
+   If we call this matrix P_r, we know that product of P_0 P_1 ... P_{size-2}
+   is the the matrix representing the permutation that shifts left by one.
+   As the final matrix (in the size-1 position), we use the matrix that
+   shifts RIGHT by one
+*/   
+static void initMat( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank;
+    int offset;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size*size; i++) {
+       assert(i < max_offset);
+       mat[i] = 0;
+    }
+
+    if (rank < size-1) {
+       /* Create the permutation matrix that exchanges r with r+1 */
+       for (i=0; i<size; i++) {
+           if (i == rank) {
+               offset = ((i+1)%size) + i * size;
+               assert(offset < max_offset);
+               mat[offset] = 1;
+           }
+           else if (i == ((rank + 1)%size)) {
+               offset = ((i+size-1)%size) + i * size;
+               assert(offset < max_offset);
+               mat[offset] = 1;
+           }
+           else {
+               offset = i+i*size;
+               assert(offset < max_offset);
+               mat[offset] = 1;
+           }
+       }
+    }
+    else {
+       /* Create the permutation matrix that shifts right by one */
+       for (i=0; i<size; i++) {
+           for (j=0; j<size; j++) {
+               offset = j + i * size;  /* location of c(i,j) */
+               mat[offset] = 0;
+               if ( ((j-i+size)%size) == 1 ) mat[offset] = 1;
+           }
+       }
+       
+    }
+}
+
+/* Compare a matrix with the identity matrix */
+static int isIdentity( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank, lerrs = 0;
+    int offset;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size; i++) {
+       for (j=0; j<size; j++) {
+           if (i == j) {
+               offset = j+i*size;
+               assert(offset < max_offset);
+               if (mat[offset] != 1) {
+                   lerrs++;
+                   if (errs + lerrs< 10) {
+                       printf( "[%d] mat[%d,%d] = %d, expected 1 for comm %s\n", 
+                               rank, i,j, mat[offset], MTestGetIntracommName() );
+                   }
+               }
+           }
+           else {
+               offset = j+i*size;
+               assert(offset < max_offset);
+               if (mat[offset] != 0) {
+                   lerrs++;
+                   if (errs + lerrs< 10) {
+                       printf( "[%d] mat[%d,%d] = %d, expected 0 for comm %s\n", 
+                               rank, i,j, mat[offset], MTestGetIntracommName() );
+                   }
+               }
+           }
+       }
+    }
+    return lerrs;
+}
+
+int main( int argc, char *argv[] )
+{
+    int size;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *buf, *bufout;
+    MPI_Op op;
+    MPI_Datatype mattype;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Op_create( uop, 0, &op );
+    
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) {
+           continue;
+       }
+       MPI_Comm_size( comm, &size );
+       matSize = size;
+
+       /* Only one matrix for now */
+       count = 1;
+
+       /* A single matrix, the size of the communicator */
+       MPI_Type_contiguous( size*size, MPI_INT, &mattype );
+       MPI_Type_commit( &mattype );
+
+       max_offset = count * size * size;
+       buf = (int *)malloc( max_offset * sizeof(int) );
+       if (!buf) {
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       bufout = (int *)malloc( max_offset * sizeof(int) );
+       if (!bufout) {
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+
+       initMat( comm, buf );
+       MPI_Allreduce( buf, bufout, count, mattype, op, comm );
+       errs += isIdentity( comm, bufout );
+
+       /* Try the same test, but using MPI_IN_PLACE */
+       initMat( comm, bufout );
+       MPI_Allreduce( MPI_IN_PLACE, bufout, count, mattype, op, comm );
+       errs += isIdentity( comm, bufout );
+
+       free( buf );
+       free( bufout );
+
+       //MPI_Type_free( &mattype );
+       MTestFreeComm( &comm );
+    }
+
+   // MPI_Op_free( &op );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred4.c b/teshsuite/smpi/mpich3-test/coll/allred4.c
new file mode 100644 (file)
index 0000000..32e0c00
--- /dev/null
@@ -0,0 +1,234 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2004 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include <assert.h>
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Allreduce with non-commutative user-defined operations using matrix rotations";
+*/
+
+/* This example is similar to allred3.c, but uses only 3x3 matrics with 
+   integer-valued entries.  This is an associative but not commutative
+   operation.
+   The number of matrices is the count argument. The matrix is stored
+   in C order, so that
+     c(i,j) is cin[j+i*3]
+
+   Three different matrices are used:
+   I = identity matrix
+   A = (1 0 0    B = (0 1 0
+        0 0 1         1 0 0
+        0 1 0)        0 0 1)
+
+   The product 
+
+         I^k A I^(p-2-k-j) B I^j
+
+   is 
+
+   ( 0 1 0 
+     0 0 1
+     1 0 0 )
+
+   for all values of k, p, and j.  
+ */
+
+void matmult( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype );
+
+void matmult( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    const int *cin = (const int *)cinPtr;
+    int *cout = (int *)coutPtr;
+    int i, j, k, nmat;
+    int tempcol[3];
+    int offset1, offset2;
+
+    for (nmat = 0; nmat < *count; nmat++) {
+       for (j=0; j<3; j++) {
+           for (i=0; i<3; i++) {
+               tempcol[i] = 0;
+               for (k=0; k<3; k++) {
+                   /* col[i] += cin(i,k) * cout(k,j) */
+                   offset1 = k+i*3;
+                   offset2 = j+k*3;
+                   tempcol[i] += cin[offset1] * cout[offset2];
+               }
+           }
+           for (i=0; i<3; i++) {
+               offset1 = j+i*3;
+               cout[offset1] = tempcol[i];
+           }
+       }
+       /* Advance to the next matrix */
+       cin += 9;
+       cout += 9;
+    }
+}
+
+/* Initialize the integer matrix as one of the 
+   above matrix entries, as a function of count.
+   We guarantee that both the A and B matrices are included.
+*/   
+static void initMat( int rank, int size, int nmat, int mat[] )
+{
+    int i, kind;
+
+    /* Zero the matrix */
+    for (i=0; i<9; i++) {
+       mat[i] = 0;
+    }
+
+    /* Decide which matrix to create (I, A, or B) */
+    if ( size == 2) {
+       /* rank 0 is A, 1 is B */
+       kind = 1 + rank;
+    }
+    else {
+       int tmpA, tmpB;
+       /* Most ranks are identity matrices */
+       kind = 0;
+       /* Make sure exactly one rank gets the A matrix
+          and one the B matrix */
+       tmpA = size / 4;
+       tmpB = (3 * size) / 4;
+       
+       if (rank == tmpA) kind = 1;
+       if (rank == tmpB) kind = 2;
+    }
+    
+    switch (kind) {
+    case 0: /* Identity */
+       mat[0] = 1;
+       mat[4] = 1;
+       mat[8] = 1;
+       break;
+    case 1: /* A */
+       mat[0] = 1;
+       mat[5] = 1;
+       mat[7] = 1;
+       break;
+    case 2: /* B */
+       mat[1] = 1;
+       mat[3] = 1;
+       mat[8] = 1;
+       break;
+    }
+}
+
+/* Compare a matrix with the known result */
+static int checkResult( int nmat, int mat[], const char *msg )
+{
+    int n, k, errs = 0, wrank;
+    static int solution[9] = { 0, 1, 0, 
+                               0, 0, 1, 
+                               1, 0, 0 };
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    for (n=0; n<nmat; n++) {
+       for (k=0; k<9; k++) {
+           if (mat[k] != solution[k]) {
+               errs ++;
+               if (errs == 1) {
+                   printf( "Errors for communicators %s\n", 
+                           MTestGetIntracommName() ); fflush(stdout);
+
+               }
+               if (errs < 10) {
+                   printf( "[%d]matrix #%d(%s): Expected mat[%d,%d] = %d, got %d\n",
+                           wrank, n, msg, k / 3, k % 3, solution[k], mat[k] );
+                   fflush(stdout);
+               }
+           }
+       }
+       /* Advance to the next matrix */
+       mat += 9;
+    }
+    return errs;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size, rank;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *buf, *bufout;
+    MPI_Op op;
+    MPI_Datatype mattype;
+    int i;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Op_create( matmult, 0, &op );
+    
+    /* A single rotation matrix (3x3, stored as 9 consequetive elements) */
+    MPI_Type_contiguous( 9, MPI_INT, &mattype );
+    MPI_Type_commit( &mattype );
+
+    /* Sanity check: test that our routines work properly */
+    { int one = 1;
+    buf = (int *)malloc( 4*9 * sizeof(int) );
+    initMat( 0, 4, 0, &buf[0] );
+    initMat( 1, 4, 0, &buf[9] );
+    initMat( 2, 4, 0, &buf[18] );
+    initMat( 3, 4, 0, &buf[27] );
+    matmult( &buf[0], &buf[9], &one, &mattype );
+    matmult( &buf[9], &buf[18], &one, &mattype );
+    matmult( &buf[18], &buf[27], &one, &mattype );
+    checkResult( 1, &buf[27], "Sanity Check" );
+    free(buf);
+    }
+    
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+
+       for (count = 1; count < size; count ++ ) {
+           
+           /* Allocate the matrices */
+           buf = (int *)malloc( count * 9 * sizeof(int) );
+           if (!buf) {
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+
+           bufout = (int *)malloc( count * 9 * sizeof(int) );
+           if (!bufout) {
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+
+           for (i=0; i < count; i++) {
+               initMat( rank, size, i, &buf[i*9] );
+           }
+           
+           MPI_Allreduce( buf, bufout, count, mattype, op, comm );
+           errs += checkResult( count, bufout, "" );
+
+           /* Try the same test, but using MPI_IN_PLACE */
+           for (i=0; i < count; i++) {
+               initMat( rank, size, i, &bufout[i*9] );
+           }
+           MPI_Allreduce( MPI_IN_PLACE, bufout, count, mattype, op, comm );
+           errs += checkResult( count, bufout, "IN_PLACE" );
+
+           free( buf );
+           free( bufout );
+       }
+       MTestFreeComm( &comm );
+    }
+       
+    MPI_Op_free( &op );
+    MPI_Type_free( &mattype );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred5.c b/teshsuite/smpi/mpich3-test/coll/allred5.c
new file mode 100644 (file)
index 0000000..a442550
--- /dev/null
@@ -0,0 +1,65 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include <assert.h>
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Allreduce with count greater than the number of processes";
+*/
+
+/* We make the error count global so that we can easily control the output
+   of error information (in particular, limiting it after the first 10 
+   errors */
+int errs = 0;
+
+int main( int argc, char *argv[] )
+{
+    MPI_Comm comm;
+    MPI_Datatype dtype;
+    int count, *bufin, *bufout, size, i, minsize=1;
+
+    MTest_Init( &argc, &argv );
+    
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) {
+           continue;
+       }
+       MPI_Comm_size( comm, &size );
+       count = size * 2;
+       bufin = (int *)malloc( count * sizeof(int) );
+       bufout = (int *)malloc( count * sizeof(int) );
+       if (!bufin || !bufout) {
+           fprintf( stderr, "Unable to allocated space for buffers (%d)\n",
+                    count );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       for (i=0; i<count; i++) {
+           bufin[i] = i;
+           bufout[i] = -1;
+       }
+
+       dtype = MPI_INT;
+       MPI_Allreduce( bufin, bufout, count, dtype, MPI_SUM, comm );
+       /* Check output */
+       for (i=0; i<count; i++) {
+           if (bufout[i] != i * size) {
+               fprintf( stderr, "Expected bufout[%d] = %d but found %d\n",
+                        i, i * size, bufout[i] );
+               errs++;
+           }
+       }
+       free( bufin );
+       free( bufout );
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/allred6.c b/teshsuite/smpi/mpich3-test/coll/allred6.c
new file mode 100644 (file)
index 0000000..ba829e1
--- /dev/null
@@ -0,0 +1,73 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Allreduce with apparent non-commutative operators";
+*/
+/* While the operator is in fact commutative, this forces the MPI code to
+   run the code that is used for non-commutative operators, and for 
+   various message lengths.  Other tests check truly non-commutative 
+   operators */
+
+void mysum( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype );
+
+void mysum( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    const int *cin = (const int *)cinPtr;
+    int       *cout = (int *)coutPtr;
+    int        i, n = *count;
+    for (i=0; i<n; i++) 
+       cout[i] += cin[i];
+}
+int main( int argc, char *argv[] )
+{
+    int      errs = 0;
+    int      rank, size;
+    int      minsize = 2, count; 
+    MPI_Comm comm;
+    MPI_Op   op;
+    int      *buf, i;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Op_create( mysum, 0, &op );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+       
+       for (count = 1; count < 65000; count = count * 2) {
+           /* Contiguous data */
+           buf = (int *)malloc( count * sizeof(int) );
+           for (i=0; i<count; i++) buf[i] = rank + i;
+           MPI_Allreduce( MPI_IN_PLACE, buf, count, MPI_INT, op, comm );
+           /* Check the results */
+           for (i=0; i<count; i++) {
+               int result = i * size + (size*(size-1))/2;
+               if (buf[i] != result) {
+                   errs ++;
+                   if (errs < 10) {
+                       fprintf( stderr, "buf[%d] = %d expected %d\n",
+                                i, buf[i], result );
+                   }
+               }
+           }
+           free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+    MPI_Op_free( &op );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
similarity index 62%
rename from teshsuite/smpi/mpich-test/coll/allredmany.c
rename to teshsuite/smpi/mpich3-test/coll/allredmany.c
index 9d6b283..438119e 100644 (file)
@@ -1,6 +1,10 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include <stdio.h>
 #include "mpi.h"
-#include "test.h"
 
 /*
  * This example should be run with 2 processes and tests the ability of the
 int main( int argc, char **argv )
 {
   double wscale = 10.0, scale;
-  int numprocs, myid,i,namelen;
-  char processor_name[MPI_MAX_PROCESSOR_NAME];
+  int numprocs, myid,i;
 
   MPI_Init(&argc,&argv);
   MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
   MPI_Comm_rank(MPI_COMM_WORLD,&myid);
-  MPI_Get_processor_name(processor_name,&namelen);
 
-  /* fprintf(stderr,"Process %d on %s\n",
-          myid, processor_name); */
   for ( i=0; i<10000; i++) {
     MPI_Allreduce(&wscale,&scale,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
   }
+
+  if (myid == 0) {
+      /* If we get here at all, we're ok */
+      printf( " No Errors\n" );
+  }
   MPI_Finalize();
+  
   return 0;
 }
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoall1.c b/teshsuite/smpi/mpich3-test/coll/alltoall1.c
new file mode 100644 (file)
index 0000000..cd6d3d8
--- /dev/null
@@ -0,0 +1,121 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+#include <stdlib.h>
+
+/*
+static char MTEST_Descrip[] = "";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *sendbuf, *recvbuf, *p;
+    int sendcount, recvcount;
+    int i, j;
+    MPI_Datatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       /* printf( "Size of comm = %d\n", size ); */
+       for (count = 1; count < 65000; count = count * 2) {
+           
+           /* Create a send buf and a receive buf suitable for testing
+              all to all.  */
+           sendcount = count;
+           recvcount = count;
+           sendbuf   = (int *)malloc( count * size * sizeof(int) );
+           recvbuf   = (int *)malloc( count * size * sizeof(int) );
+           sendtype  = MPI_INT;
+           recvtype  = MPI_INT;
+
+           if (!sendbuf || !recvbuf) {
+               errs++;
+               fprintf( stderr, "Failed to allocate sendbuf and/or recvbuf\n" );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           for (i=0; i<count*size; i++) 
+               recvbuf[i] = -1;
+           p = sendbuf;
+           for (j=0; j<size; j++) {
+               for (i=0; i<count; i++) {
+                   *p++ = j * size + rank + i;
+               }
+           }
+
+           MPI_Alltoall( sendbuf, sendcount, sendtype,
+                         recvbuf, recvcount, recvtype, comm );
+
+           p = recvbuf;
+           for (j=0; j<size; j++) {
+               for (i=0; i<count; i++) {
+                   if (*p != rank * size + j + i) {
+                       errs++;
+                       if (errs < 10) {
+                           fprintf( stderr, "Error with communicator %s and size=%d count=%d\n",
+                                    MTestGetIntracommName(), size, count );
+                           fprintf( stderr, "recvbuf[%d,%d] = %d, should %d\n",
+                                    j,i, *p, rank * size + j + i );
+                       }
+                   }
+                   p++;
+               }
+           }
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+            /* check MPI_IN_PLACE, added in MPI-2.2 */
+            p = recvbuf;
+            for (j=0; j<size; j++) {
+                for (i=0; i<count; i++) {
+                    *p++ = j * size + rank + i;
+                }
+            }
+            MPI_Alltoall( MPI_IN_PLACE, -1/*ignored*/, MPI_DATATYPE_NULL/*ignored*/,
+                          recvbuf, recvcount, recvtype, comm );
+            p = recvbuf;
+            for (j=0; j<size; j++) {
+                for (i=0; i<count; i++) {
+                    if (*p != rank * size + j + i) {
+                        errs++;
+                        if (errs < 10) {
+                            fprintf( stderr, "Error (MPI_IN_PLACE) with communicator %s and size=%d count=%d\n",
+                                     MTestGetIntracommName(), size, count );
+                            fprintf(stderr, "recvbuf[%d,%d] = %d, should be %d\n",
+                                    j,i, *p, rank * size + j + i );
+                        }
+                    }
+                    p++;
+                }
+            }
+#endif
+
+           free( recvbuf );
+           free( sendbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallv.c b/teshsuite/smpi/mpich3-test/coll/alltoallv.c
new file mode 100644 (file)
index 0000000..bcae133
--- /dev/null
@@ -0,0 +1,136 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*
+  This program tests MPI_Alltoallv by having processor i send different
+  amounts of data to each processor.
+
+  Because there are separate send and receive types to alltoallv,
+  there need to be tests to rearrange data on the fly.  Not done yet.
+  
+  The first test sends i items to processor i from all processors.
+
+  Currently, the test uses only MPI_INT; this is adequate for testing systems
+  that use point-to-point operations
+ */
+
+int main( int argc, char **argv )
+{
+
+    MPI_Comm comm;
+    int      *sbuf, *rbuf;
+    int      rank, size;
+    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
+    int      i, j, *p, err;
+    
+    MTest_Init( &argc, &argv );
+    err = 0;
+    
+    while (MTestGetIntracommGeneral( &comm, 2, 1 )) {
+      if (comm == MPI_COMM_NULL) continue;
+
+      /* Create the buffer */
+      MPI_Comm_size( comm, &size );
+      MPI_Comm_rank( comm, &rank );
+      sbuf = (int *)malloc( size * size * sizeof(int) );
+      rbuf = (int *)malloc( size * size * sizeof(int) );
+      if (!sbuf || !rbuf) {
+       fprintf( stderr, "Could not allocated buffers!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      
+      /* Load up the buffers */
+      for (i=0; i<size*size; i++) {
+       sbuf[i] = i + 100*rank;
+       rbuf[i] = -i;
+      }
+      
+      /* Create and load the arguments to alltoallv */
+      sendcounts = (int *)malloc( size * sizeof(int) );
+      recvcounts = (int *)malloc( size * sizeof(int) );
+      rdispls    = (int *)malloc( size * sizeof(int) );
+      sdispls    = (int *)malloc( size * sizeof(int) );
+      if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
+       fprintf( stderr, "Could not allocate arg items!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      for (i=0; i<size; i++) {
+       sendcounts[i] = i;
+       recvcounts[i] = rank;
+       rdispls[i]    = i * rank;
+       sdispls[i]    = (i * (i+1))/2;
+      }
+      MPI_Alltoallv( sbuf, sendcounts, sdispls, MPI_INT,
+                    rbuf, recvcounts, rdispls, MPI_INT, comm );
+      
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+       p = rbuf + rdispls[i];
+       for (j=0; j<rank; j++) {
+         if (p[j] != i * 100 + (rank*(rank+1))/2 + j) {
+           fprintf( stderr, "[%d] got %d expected %d for %dth\n",
+                    rank, p[j],(i*(i+1))/2 + j, j );
+           err++;
+         }
+       }
+      }
+
+      free( sdispls );
+      free( sendcounts );
+      free( sbuf );
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+      /* check MPI_IN_PLACE, added in MPI-2.2 */
+      free( rbuf );
+      rbuf = (int *)malloc( size * (2 * size) * sizeof(int) );
+      if (!rbuf) {
+        fprintf( stderr, "Could not reallocate rbuf!\n" );
+        MPI_Abort( comm, 1 );
+      }
+
+      /* Load up the buffers */
+      for (i = 0; i < size; i++) {
+        recvcounts[i] = i + rank;
+        rdispls[i]    = i * (2 * size);
+      }
+      memset(rbuf, -1, size * (2 * size) * sizeof(int));
+      for (i=0; i < size; i++) {
+        p = rbuf + rdispls[i];
+        for (j = 0; j < recvcounts[i]; ++j) {
+          p[j] = 100 * rank + 10 * i + j;
+        }
+      }
+      MPI_Alltoallv( MPI_IN_PLACE, NULL, NULL, MPI_INT,
+                     rbuf, recvcounts, rdispls, MPI_INT, comm );
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+        p = rbuf + rdispls[i];
+        for (j=0; j<recvcounts[i]; j++) {
+          int expected = 100 * i + 10 * rank + j;
+          if (p[j] != expected) {
+            fprintf(stderr, "[%d] got %d expected %d for block=%d, element=%dth\n",
+                    rank, p[j], expected, i, j);
+            ++err;
+          }
+        }
+      }
+#endif
+
+      free( rdispls );
+      free( recvcounts );
+      free( rbuf );
+      MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallv0.c b/teshsuite/smpi/mpich3-test/coll/alltoallv0.c
new file mode 100644 (file)
index 0000000..e1c8785
--- /dev/null
@@ -0,0 +1,132 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/*
+  This program tests MPI_Alltoallv by having processor each process 
+  send data to two neighbors only, using counts of 0 for the other processes.
+  This idiom is sometimes used for halo exchange operations.
+
+  Because there are separate send and receive types to alltoallv,
+  there need to be tests to rearrange data on the fly.  Not done yet.
+  
+  Currently, the test uses only MPI_INT; this is adequate for testing systems
+  that use point-to-point operations
+ */
+
+int main( int argc, char **argv )
+{
+
+    MPI_Comm comm;
+    int      *sbuf, *rbuf;
+    int      rank, size;
+    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
+    int      i, *p, err;
+    int      left, right, length;
+    
+    MTest_Init( &argc, &argv );
+    err = 0;
+    
+    while (MTestGetIntracommGeneral( &comm, 2, 1 )) {
+      if (comm == MPI_COMM_NULL) continue;
+
+      MPI_Comm_size( comm, &size );
+      MPI_Comm_rank( comm, &rank );
+      
+      if (size < 3) continue;
+
+      /* Create and load the arguments to alltoallv */
+      sendcounts = (int *)malloc( size * sizeof(int) );
+      recvcounts = (int *)malloc( size * sizeof(int) );
+      rdispls    = (int *)malloc( size * sizeof(int) );
+      sdispls    = (int *)malloc( size * sizeof(int) );
+      if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
+       fprintf( stderr, "Could not allocate arg items!\n" );
+       MPI_Abort( comm, 1 );
+      }
+
+      /* Get the neighbors */
+      left  = (rank - 1 + size) % size;
+      right = (rank + 1) % size;
+
+      /* Set the defaults */
+      for (i=0; i<size; i++) {
+         sendcounts[i] = 0;
+         recvcounts[i] = 0;
+         rdispls[i]    = 0;
+         sdispls[i]    = 0;
+      }
+
+      for (length=1; length < 66000; length = length*2+1 ) {
+         /* Get the buffers */
+         sbuf = (int *)malloc( 2 * length * sizeof(int) );
+         rbuf = (int *)malloc( 2 * length * sizeof(int) );
+         if (!sbuf || !rbuf) {
+             fprintf( stderr, "Could not allocate buffers!\n" );
+             MPI_Abort( comm, 1 );
+         }
+         
+         /* Load up the buffers */
+         for (i=0; i<length; i++) {
+             sbuf[i]        = i + 100000*rank;
+             sbuf[i+length] = i + 100000*rank;
+             rbuf[i]        = -i;
+             rbuf[i+length] = -i-length;
+         }
+         sendcounts[left]  = length;
+         sendcounts[right] = length;
+         recvcounts[left]  = length;
+         recvcounts[right] = length;
+         rdispls[left]     = 0;
+         rdispls[right]    = length;
+         sdispls[left]     = 0;
+         sdispls[right]    = length;
+      
+         MPI_Alltoallv( sbuf, sendcounts, sdispls, MPI_INT,
+                        rbuf, recvcounts, rdispls, MPI_INT, comm );
+      
+         /* Check rbuf */
+         p = rbuf;          /* left */
+
+         for (i=0; i<length; i++) {
+             if (p[i] != i + 100000 * left) {
+                 if (err < 10) {
+                     fprintf( stderr, "[%d from %d] got %d expected %d for %dth\n", 
+                              rank, left, p[i], i + 100000 * left, i );
+                 }
+                 err++;
+             }
+         }
+
+         p = rbuf + length; /* right */
+         for (i=0; i<length; i++) {
+             if (p[i] != i + 100000 * right) {
+                 if (err < 10) {
+                     fprintf( stderr, "[%d from %d] got %d expected %d for %dth\n", 
+                              rank, right, p[i], i + 100000 * right, i );
+                 }
+                 err++;
+             }
+         }
+
+         free( rbuf );
+         free( sbuf );
+      }
+         
+      free( sdispls );
+      free( rdispls );
+      free( recvcounts );
+      free( sendcounts );
+      MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallw1.c b/teshsuite/smpi/mpich3-test/coll/alltoallw1.c
new file mode 100644 (file)
index 0000000..ba655ab
--- /dev/null
@@ -0,0 +1,269 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  Changes to this example
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*
+ * This example is taken from MPI-The complete reference, Vol 1, 
+ * pages 222-224.
+ * 
+ * Lines after the "--CUT HERE--" were added to make this into a complete 
+ * test program.
+ */
+
+/* Specify the maximum number of errors to report. */
+#define MAX_ERRORS 10
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MAX_SIZE 64
+
+MPI_Datatype transpose_type(int M, int m, int n, MPI_Datatype type);
+MPI_Datatype submatrix_type(int N, int m, int n, MPI_Datatype type);
+void Transpose(float *localA, float *localB, int M, int N, MPI_Comm comm);
+void Transpose(float *localA, float *localB, int M, int N, MPI_Comm comm)
+/* transpose MxN matrix A that is block distributed (1-D) on  
+   processes of comm onto block distributed matrix B  */
+{
+  int i, j, extent, myrank, p, n[2], m[2];
+  int lasti, lastj;
+  int *sendcounts, *recvcounts;
+  int *sdispls, *rdispls;
+  MPI_Datatype xtype[2][2], stype[2][2], *sendtypes, *recvtypes;
+
+  MTestPrintfMsg( 2, "M = %d, N = %d\n", M, N );
+
+  /* compute parameters */
+  MPI_Comm_size(comm, &p);
+  MPI_Comm_rank(comm, &myrank);
+  extent = sizeof(float);
+
+  /* allocate arrays */
+  sendcounts = (int *)malloc(p*sizeof(int));
+  recvcounts = (int *)malloc(p*sizeof(int));
+  sdispls    = (int *)malloc(p*sizeof(int));
+  rdispls    = (int *)malloc(p*sizeof(int));
+  sendtypes  = (MPI_Datatype *)malloc(p*sizeof(MPI_Datatype));
+  recvtypes  = (MPI_Datatype *)malloc(p*sizeof(MPI_Datatype));
+
+  /* compute block sizes */
+  m[0] = M/p;
+  m[1] = M - (p-1)*(M/p);
+  n[0] = N/p;
+  n[1] = N - (p-1)*(N/p);
+
+  /* compute types */
+  for (i=0; i <= 1; i++)
+      for (j=0; j <= 1; j++) {
+         xtype[i][j] = transpose_type(N, m[i], n[j], MPI_FLOAT);
+         stype[i][j] = submatrix_type(M, m[i], n[j], MPI_FLOAT);
+      }
+  
+  /* prepare collective operation arguments */
+  lasti = myrank == p-1;
+  for (j=0;  j < p; j++) {
+    lastj        = j == p-1;
+    sendcounts[j] = 1;
+    sdispls[j]   = j*n[0]*extent;
+    sendtypes[j]  = xtype[lasti][lastj];
+    recvcounts[j] = 1;
+    rdispls[j]   = j*m[0]*extent;
+    recvtypes[j]  = stype[lastj][lasti];
+  }
+  
+  /* communicate */
+  MTestPrintfMsg( 2, "Begin Alltoallw...\n" ); 
+  /* -- Note that the book incorrectly uses &localA and &localB 
+     as arguments to MPI_Alltoallw */
+  MPI_Alltoallw(localA, sendcounts, sdispls, sendtypes, 
+                localB, recvcounts, rdispls, recvtypes, comm);
+  MTestPrintfMsg( 2, "Done with Alltoallw\n" ); 
+
+  /* Free buffers */
+  free( sendcounts );
+  free( recvcounts );
+  free( sdispls );
+  free( rdispls );
+  free( sendtypes );
+  free( recvtypes );
+
+  /* Free datatypes */
+  for (i=0; i <= 1; i++)
+      for (j=0; j <= 1; j++) {
+         MPI_Type_free( &xtype[i][j] );
+         MPI_Type_free( &stype[i][j] );
+      }
+}
+
+
+/* Define an n x m submatrix in a n x M local matrix (this is the 
+   destination in the transpose matrix */
+MPI_Datatype submatrix_type(int M, int m, int n, MPI_Datatype type)
+/* computes a datatype for an mxn submatrix within an MxN matrix 
+   with entries of type type */
+{
+  /* MPI_Datatype subrow; */
+  MPI_Datatype submatrix;
+
+  /* The book, MPI: The Complete Reference, has the wrong type constructor 
+     here.  Since the stride in the vector type is relative to the input 
+     type, the stride in the book's code is n times as long as is intended. 
+     Since n may not exactly divide N, it is better to simply use the 
+     blocklength argument in Type_vector */
+  /*
+  MPI_Type_contiguous(n, type, &subrow);
+  MPI_Type_vector(m, 1, N, subrow, &submatrix);  
+  */
+  MPI_Type_vector(n, m, M, type, &submatrix );
+  MPI_Type_commit(&submatrix);
+
+  /* Add a consistency test: the size of submatrix should be
+     n * m * sizeof(type) and the extent should be ((n-1)*M+m) * sizeof(type) */
+  {
+      int      tsize;
+      MPI_Aint textent, lb;
+      MPI_Type_size( type, &tsize );
+      MPI_Type_get_extent( submatrix, &lb, &textent );
+      
+      if (textent != tsize * (M * (n-1)+m)) {
+         fprintf( stderr, "Submatrix extent is %ld, expected %ld (%d,%d,%d)\n",
+                  (long)textent, (long)(tsize * (M * (n-1)+m)), M, n, m );
+      }
+  }
+  return(submatrix);
+}
+
+/* Extract an m x n submatrix within an m x N matrix and transpose it.
+   Assume storage by rows; the defined datatype accesses by columns */
+MPI_Datatype transpose_type(int N, int m, int n, MPI_Datatype type)
+/* computes a datatype for the transpose of an mxn matrix 
+   with entries of type type */
+{
+  MPI_Datatype subrow, subrow1, submatrix;
+  MPI_Aint lb, extent;
+  
+  MPI_Type_vector(m, 1, N, type, &subrow);
+  MPI_Type_get_extent(type, &lb, &extent);
+  MPI_Type_create_resized(subrow, 0, extent, &subrow1);
+  MPI_Type_contiguous(n, subrow1, &submatrix); 
+  MPI_Type_commit(&submatrix);
+  MPI_Type_free( &subrow );
+  MPI_Type_free( &subrow1 );
+
+  /* Add a consistency test: the size of submatrix should be
+     n * m * sizeof(type) and the extent should be ((m-1)*N+n) * sizeof(type) */
+  {
+      int      tsize;
+      MPI_Aint textent, llb;
+      MPI_Type_size( type, &tsize );
+      MPI_Type_get_true_extent( submatrix, &llb, &textent );
+      
+      if (textent != tsize * (N * (m-1)+n)) {
+         fprintf( stderr, "Transpose Submatrix extent is %ld, expected %ld (%d,%d,%d)\n",
+                  (long)textent, (long)(tsize * (N * (m-1)+n)), N, n, m );
+      }
+  }
+
+  return(submatrix);
+}
+
+/* -- CUT HERE -- */
+
+int main( int argc, char *argv[] )
+{
+    int gM, gN, lm, lmlast, ln, lnlast, i, j, errs = 0;
+    int size, rank;
+    float *localA, *localB;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+    gM = 20;
+    gN = 30;
+
+    /* Each block is lm x ln in size, except for the last process, 
+       which has lmlast x lnlast */
+    lm     = gM/size;
+    lmlast = gM - (size - 1)*lm;
+    ln     = gN/size;
+    lnlast = gN - (size - 1)*ln;
+
+    /* Create the local matrices.
+       Initialize the input matrix so that the entries are 
+       consequtive integers, by row, starting at 0.
+     */
+    if (rank == size - 1) {
+       localA = (float *)malloc( gN * lmlast * sizeof(float) );
+       localB = (float *)malloc( gM * lnlast * sizeof(float) );
+       for (i=0; i<lmlast; i++) {
+           for (j=0; j<gN; j++) {
+               localA[i*gN+j] = (float)(i*gN+j + rank * gN * lm);
+           }
+       }
+       
+    }
+    else {
+       localA = (float *)malloc( gN * lm * sizeof(float) );
+       localB = (float *)malloc( gM * ln * sizeof(float) );
+       for (i=0; i<lm; i++) {
+           for (j=0; j<gN; j++) {
+               localA[i*gN+j] = (float)(i*gN+j + rank * gN * lm);
+           }
+       }
+    }
+
+    MTestPrintfMsg( 2, "Allocated local arrays\n" );
+    /* Transpose */
+    Transpose( localA, localB, gM, gN, comm );
+
+    /* check the transposed matrix
+       In the global matrix, the transpose has consequtive integers, 
+       organized by columns.
+     */
+    if (rank == size - 1) {
+       for (i=0; i<lnlast; i++) {
+           for (j=0; j<gM; j++) {
+               int expected = i+gN*j + rank * ln;
+               if ((int)localB[i*gM+j] != expected) {
+                   if (errs < MAX_ERRORS) 
+                       printf( "Found %d but expected %d\n", 
+                               (int)localB[i*gM+j], expected );
+                   errs++;
+               }
+           }
+       }
+       
+    }
+    else {
+       for (i=0; i<ln; i++) {
+           for (j=0; j<gM; j++) {
+               int expected = i+gN*j + rank * ln;
+               if ((int)localB[i*gM+j] != expected) {
+                   if (errs < MAX_ERRORS) 
+                       printf( "Found %d but expected %d\n", 
+                               (int)localB[i*gM+j], expected );
+                   errs++;
+               }
+           }
+       }
+    }
+
+    /* Free storage */
+    free( localA );
+    free( localB );
+
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallw2.c b/teshsuite/smpi/mpich3-test/coll/alltoallw2.c
new file mode 100644 (file)
index 0000000..7d40236
--- /dev/null
@@ -0,0 +1,148 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*
+  This program tests MPI_Alltoallw by having processor i send different
+  amounts of data to each processor.  This is just the MPI_Alltoallv test,
+  but with displacements in bytes rather than units of the datatype.
+
+  Because there are separate send and receive types to alltoallw,
+  there need to be tests to rearrange data on the fly.  Not done yet.
+  
+  The first test sends i items to processor i from all processors.
+
+  Currently, the test uses only MPI_INT; this is adequate for testing systems
+  that use point-to-point operations
+ */
+
+int main( int argc, char **argv )
+{
+
+    MPI_Comm comm;
+    int      *sbuf, *rbuf;
+    int      rank, size;
+    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
+    int      i, j, *p, err;
+    MPI_Datatype *sendtypes, *recvtypes;
+    
+    MTest_Init( &argc, &argv );
+    err = 0;
+    
+    while (MTestGetIntracommGeneral( &comm, 2, 1 )) {
+      if (comm == MPI_COMM_NULL) continue;
+
+      /* Create the buffer */
+      MPI_Comm_size( comm, &size );
+      MPI_Comm_rank( comm, &rank );
+      sbuf = (int *)malloc( size * size * sizeof(int) );
+      rbuf = (int *)malloc( size * size * sizeof(int) );
+      if (!sbuf || !rbuf) {
+       fprintf( stderr, "Could not allocated buffers!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      
+      /* Load up the buffers */
+      for (i=0; i<size*size; i++) {
+       sbuf[i] = i + 100*rank;
+       rbuf[i] = -i;
+      }
+      
+      /* Create and load the arguments to alltoallv */
+      sendcounts = (int *)malloc( size * sizeof(int) );
+      recvcounts = (int *)malloc( size * sizeof(int) );
+      rdispls    = (int *)malloc( size * sizeof(int) );
+      sdispls    = (int *)malloc( size * sizeof(int) );
+      sendtypes    = (MPI_Datatype *)malloc( size * sizeof(MPI_Datatype) );
+      recvtypes    = (MPI_Datatype *)malloc( size * sizeof(MPI_Datatype) );
+      if (!sendcounts || !recvcounts || !rdispls || !sdispls || !sendtypes || !recvtypes) {
+       fprintf( stderr, "Could not allocate arg items!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      /* Note that process 0 sends no data (sendcounts[0] = 0) */
+      for (i=0; i<size; i++) {
+       sendcounts[i] = i;
+       recvcounts[i] = rank;
+       rdispls[i]    = i * rank * sizeof(int);
+       sdispls[i]    = (((i+1) * (i))/2) * sizeof(int);
+        sendtypes[i] = recvtypes[i] = MPI_INT;
+      }
+      MPI_Alltoallw( sbuf, sendcounts, sdispls, sendtypes,
+                    rbuf, recvcounts, rdispls, recvtypes, comm );
+      
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+       p = rbuf + rdispls[i]/sizeof(int);
+       for (j=0; j<rank; j++) {
+         if (p[j] != i * 100 + (rank*(rank+1))/2 + j) {
+           fprintf( stderr, "[%d] got %d expected %d for %dth\n",
+                    rank, p[j],(i*(i+1))/2 + j, j );
+           err++;
+         }
+       }
+      }
+
+      free(sendtypes);
+      free(sdispls);
+      free(sendcounts);
+      free(sbuf);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+      /* check MPI_IN_PLACE, added in MPI-2.2 */
+      free( rbuf );
+      rbuf = (int *)malloc( size * (2 * size) * sizeof(int) );
+      if (!rbuf) {
+        fprintf( stderr, "Could not reallocate rbuf!\n" );
+        MPI_Abort( comm, 1 );
+      }
+
+      /* Load up the buffers */
+      for (i = 0; i < size; i++) {
+        /* alltoallw displs are in bytes, not in type extents */
+        rdispls[i]    = i * (2 * size) * sizeof(int);
+        recvtypes[i]  = MPI_INT;
+        recvcounts[i] = i + rank;
+      }
+      memset(rbuf, -1, size * (2 * size) * sizeof(int));
+      for (i=0; i < size; i++) {
+        p = rbuf + (rdispls[i] / sizeof(int));
+        for (j = 0; j < recvcounts[i]; ++j) {
+          p[j] = 100 * rank + 10 * i + j;
+        }
+      }
+
+      MPI_Alltoallw( MPI_IN_PLACE, NULL, NULL, NULL,
+                     rbuf, recvcounts, rdispls, recvtypes, comm );
+
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+        p = rbuf + (rdispls[i] / sizeof(int));
+        for (j=0; j<recvcounts[i]; j++) {
+          int expected = 100 * i + 10 * rank + j;
+          if (p[j] != expected) {
+            fprintf(stderr, "[%d] got %d expected %d for block=%d, element=%dth\n",
+                    rank, p[j], expected, i, j);
+            ++err;
+          }
+        }
+      }
+#endif
+
+      free(recvtypes);
+      free(rdispls);
+      free(recvcounts);
+      free(rbuf);
+      MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/alltoallw_zeros.c b/teshsuite/smpi/mpich3-test/coll/alltoallw_zeros.c
new file mode 100644 (file)
index 0000000..65e5c9d
--- /dev/null
@@ -0,0 +1,111 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* Based on a test case contributed by Michael Hofmann.
+ *
+ * This test makes sure that zero counts with non-zero-sized types on the
+ * send (recv) side match and don't cause a problem with non-zero counts and
+ * zero-sized types on the recv (send) side when using MPI_Alltoallw and
+ * MPI_Alltoallv.  */
+
+/* TODO test intercommunicators as well */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <mpi.h>
+
+#include "mpitest.h"
+
+int main(int argc, char *argv[])
+{
+    int sendbuf, recvbuf;
+    int *sendcounts;
+    int *recvcounts;
+    int *sdispls;
+    int *rdispls;
+    MPI_Datatype sendtype;
+    MPI_Datatype *sendtypes;
+    MPI_Datatype *recvtypes;
+    int rank = -1;
+    int size = -1;
+    int i;
+
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    sendtypes = malloc(size * sizeof(MPI_Datatype));
+    recvtypes = malloc(size * sizeof(MPI_Datatype));
+    sendcounts = malloc(size * sizeof(int));
+    recvcounts = malloc(size * sizeof(int));
+    sdispls = malloc(size * sizeof(int));
+    rdispls = malloc(size * sizeof(int));
+    if (!sendtypes  || !recvtypes ||
+        !sendcounts || !recvcounts ||
+        !sdispls    || !rdispls)
+    {
+        printf("error, unable to allocate memory\n");
+        goto fn_exit;
+    }
+
+    MPI_Type_contiguous(0, MPI_INT, &sendtype);
+    MPI_Type_commit(&sendtype);
+
+    for (i = 0; i < size; ++i) {
+        sendtypes[i] = sendtype;
+        sendcounts[i] = 1;
+        sdispls[i] = 0;
+
+        recvtypes[i] = MPI_INT;
+        recvcounts[i] = 0;
+        rdispls[i] = 0;
+    }
+
+
+    /* try zero-counts on both the send and recv side in case only one direction is broken for some reason */
+    MPI_Alltoallw(&sendbuf, sendcounts, sdispls, sendtypes, &recvbuf, recvcounts, rdispls, recvtypes, MPI_COMM_WORLD);
+    MPI_Alltoallw(&sendbuf, recvcounts, rdispls, recvtypes, &recvbuf, sendcounts, sdispls, sendtypes, MPI_COMM_WORLD);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* pass MPI_IN_PLACE and different but compatible types rank is even/odd */
+    if (rank % 2)
+        MPI_Alltoallw(MPI_IN_PLACE, NULL, NULL, NULL, &recvbuf, recvcounts, rdispls, recvtypes, MPI_COMM_WORLD);
+    else
+        MPI_Alltoallw(MPI_IN_PLACE, NULL, NULL, NULL, &recvbuf, sendcounts, sdispls, sendtypes, MPI_COMM_WORLD);
+#endif
+
+    /* now the same for Alltoallv instead of Alltoallw */
+    MPI_Alltoallv(&sendbuf, sendcounts, sdispls, sendtypes[0], &recvbuf, recvcounts, rdispls, recvtypes[0], MPI_COMM_WORLD);
+    MPI_Alltoallv(&sendbuf, recvcounts, rdispls, recvtypes[0], &recvbuf, sendcounts, sdispls, sendtypes[0], MPI_COMM_WORLD);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    if (rank % 2)
+        MPI_Alltoallv(MPI_IN_PLACE, NULL, NULL, MPI_DATATYPE_NULL, &recvbuf, recvcounts, rdispls, recvtypes[0], MPI_COMM_WORLD);
+    else
+        MPI_Alltoallv(MPI_IN_PLACE, NULL, NULL, MPI_DATATYPE_NULL, &recvbuf, sendcounts, sdispls, sendtypes[0], MPI_COMM_WORLD);
+#endif
+
+    MPI_Type_free(&sendtype);
+
+    if (rank == 0)
+        printf(" No Errors\n");
+
+fn_exit:
+    if (rdispls)    free(rdispls);
+    if (sdispls)    free(sdispls);
+    if (recvcounts) free(recvcounts);
+    if (sendcounts) free(sendcounts);
+    if (recvtypes)  free(recvtypes);
+    if (sendtypes)  free(sendtypes);
+
+    MPI_Finalize();
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/bcast2.c b/teshsuite/smpi/mpich3-test/coll/bcast2.c
new file mode 100644 (file)
index 0000000..b2c2f79
--- /dev/null
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of broadcast with various roots and datatypes";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size, root;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    MTestDatatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+       /* The max value of count must be very large to ensure that we 
+          reach the long message algorithms */
+       for (count = 1; count < 280000; count = count * 4) {
+           while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
+               for (root=0; root<size; root++) {
+                   if (rank == root) {
+                       sendtype.InitBuf( &sendtype );
+                       err = MPI_Bcast( sendtype.buf, sendtype.count,
+                                        sendtype.datatype, root, comm );
+                       if (err) {
+                           errs++;
+                           MTestPrintError( err );
+                       }
+                   }
+                   else {
+                       recvtype.InitBuf( &recvtype );
+                       err = MPI_Bcast( recvtype.buf, recvtype.count, 
+                                   recvtype.datatype, root, comm );
+                       if (err) {
+                           errs++;
+                           fprintf( stderr, "Error with communicator %s and datatype %s\n", 
+                                MTestGetIntracommName(), 
+                                MTestGetDatatypeName( &recvtype ) );
+                           MTestPrintError( err );
+                       }
+                       err = MTestCheckRecv( 0, &recvtype );
+                       if (err) {
+                           errs += errs;
+                       }
+                   }
+               }
+               MTestFreeDatatype( &recvtype );
+               MTestFreeDatatype( &sendtype );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/bcast3.c b/teshsuite/smpi/mpich3-test/coll/bcast3.c
new file mode 100644 (file)
index 0000000..84250b2
--- /dev/null
@@ -0,0 +1,77 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of broadcast with various roots and datatypes and sizes that are not powers of two";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size, root;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    MTestDatatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       count = 1;
+       /* This must be very large to ensure that we reach the long message
+          algorithms */
+       for (count = 4; count < 66000; count = count * 4) {
+           while (MTestGetDatatypes( &sendtype, &recvtype, count-1 )) {
+               for (root=0; root<size; root++) {
+                   if (rank == root) {
+                       sendtype.InitBuf( &sendtype );
+                       err = MPI_Bcast( sendtype.buf, sendtype.count,
+                                        sendtype.datatype, root, comm );
+                       if (err) {
+                           errs++;
+                           MTestPrintError( err );
+                       }
+                   }
+                   else {
+                       recvtype.InitBuf( &recvtype );
+                       err = MPI_Bcast( recvtype.buf, recvtype.count, 
+                                   recvtype.datatype, root, comm );
+                       if (err) {
+                           errs++;
+                           fprintf( stderr, "Error with communicator %s and datatype %s\n", 
+                                MTestGetIntracommName(), 
+                                MTestGetDatatypeName( &recvtype ) );
+                           MTestPrintError( err );
+                       }
+                       err = MTestCheckRecv( 0, &recvtype );
+                       if (err) {
+                           errs += errs;
+                       }
+                   }
+               }
+               MTestFreeDatatype( &recvtype );
+               MTestFreeDatatype( &sendtype );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/bcasttest.c b/teshsuite/smpi/mpich3-test/coll/bcasttest.c
new file mode 100644 (file)
index 0000000..d7d9cda
--- /dev/null
@@ -0,0 +1,103 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "mpitest.h"
+
+#define ROOT      0
+#define NUM_REPS  5
+#define NUM_SIZES 4
+
+int main( int argc, char **argv)
+{
+    int *buf;
+    int i, rank, reps, n;
+    int bVerify = 1;
+    int sizes[NUM_SIZES] = { 100, 64*1024, 128*1024, 1024*1024 };
+    int num_errors=0;
+    
+    MTest_Init( &argc, &argv );
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (argc > 1)
+    {
+       if (strcmp(argv[1], "-novalidate") == 0 || strcmp(argv[1], "-noverify") == 0)
+           bVerify = 0;
+    }
+
+    buf = (int *) malloc(sizes[NUM_SIZES-1]*sizeof(int));
+    memset(buf, 0, sizes[NUM_SIZES-1]*sizeof(int));
+
+    for (n=0; n<NUM_SIZES; n++)
+    {
+#ifdef DEBUG
+       if (rank == ROOT)
+       {
+           printf("bcasting %d MPI_INTs %d times\n", sizes[n], NUM_REPS);
+           fflush(stdout);
+       }
+#endif
+       for (reps=0; reps < NUM_REPS; reps++)
+       {
+           if (bVerify)
+           {
+                if (rank == ROOT)
+                {
+                   for (i=0; i<sizes[n]; i++)
+                   {
+                       buf[i] = 1000000 * (n * NUM_REPS + reps) + i;
+                   }
+               }
+               else
+                {
+                   for (i=0; i<sizes[n]; i++)
+                   {
+                        buf[i] = -1 - (n * NUM_REPS + reps);
+                   }
+               }
+           }
+
+#          ifdef DEBUG
+           {
+               printf("rank=%d, n=%d, reps=%d\n", rank, n, reps);
+           }
+#           endif
+           
+           MPI_Bcast(buf, sizes[n], MPI_INT, ROOT, MPI_COMM_WORLD);
+
+           if (bVerify)
+           {
+               num_errors = 0;
+               for (i=0; i<sizes[n]; i++)
+               {
+                   if (buf[i] != 1000000 * (n * NUM_REPS + reps) + i)
+                   {
+                       num_errors++;
+                       if (num_errors < 10)
+                       {
+                           printf("Error: Rank=%d, n=%d, reps=%d, i=%d, buf[i]=%d expected=%d\n", rank, n, reps, i, buf[i],
+                                  1000000 * (n * NUM_REPS + reps) +i);
+                           fflush(stdout);
+                       }
+                   }
+               }
+               if (num_errors >= 10)
+               {
+                   printf("Error: Rank=%d, num_errors = %d\n", rank, num_errors);
+                   fflush(stdout);
+               }
+           }
+       }
+    }
+    
+    free(buf);
+
+    MTest_Finalize( num_errors );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/bcastzerotype.c b/teshsuite/smpi/mpich3-test/coll/bcastzerotype.c
new file mode 100644 (file)
index 0000000..65a6055
--- /dev/null
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include <mpi.h>
+
+/* test broadcast behavior with non-zero counts but zero-sized types */
+
+int main(int argc, char *argv[])
+{
+    int i, type_size;
+    MPI_Datatype type = MPI_DATATYPE_NULL;
+    char *buf = NULL;
+    int wrank, wsize;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+
+    /* a random non-zero sized buffer */
+#define NELEM (10)
+    buf = malloc(NELEM*sizeof(int));
+    assert(buf);
+
+    for (i = 0; i < NELEM; i++) {
+        buf[i] = wrank * NELEM + i;
+    }
+
+    /* create a zero-size type */
+    MPI_Type_contiguous(0, MPI_INT, &type);
+    MPI_Type_commit(&type);
+    MPI_Type_size(type, &type_size);
+    assert(type_size == 0);
+
+    /* do the broadcast, which will break on some MPI implementations */
+    MPI_Bcast(buf, NELEM, type, 0, MPI_COMM_WORLD);
+
+    /* check that the buffer remains unmolested */
+    for (i = 0; i < NELEM; i++) {
+        assert(buf[i] == wrank * NELEM + i);
+    }
+
+    MPI_Type_free(&type);
+    MPI_Finalize();
+
+    if (wrank == 0) {
+        printf(" No errors\n");
+    }
+
+    return 0;
+}
similarity index 77%
rename from teshsuite/smpi/mpich-test/coll/coll10.c
rename to teshsuite/smpi/mpich3-test/coll/coll10.c
index 1935bce..e93abed 100644 (file)
@@ -1,6 +1,12 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
+
 #define BAD_ANSWER 100000
 
 int assoc ( int *, int *, int *, MPI_Datatype * );
@@ -12,9 +18,7 @@ int assoc ( int *, int *, int *, MPI_Datatype * );
     Note that the computation is in process rank (in the communicator)
     order, independant of the root.
  */
-int assoc(invec, inoutvec, len, dtype)
-int *invec, *inoutvec, *len;
-MPI_Datatype *dtype;
+int assoc(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
 {
   int i;
   for ( i=0; i<*len; i++ )  {
@@ -39,7 +43,7 @@ int main( int argc, char **argv )
     int              result = -100;
     MPI_Op           op;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -51,10 +55,7 @@ int main( int argc, char **argv )
     MPI_Op_free( &op );
     if (result == BAD_ANSWER) errors++;
 
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 84%
rename from teshsuite/smpi/mpich-test/coll/coll11.c
rename to teshsuite/smpi/mpich3-test/coll/coll11.c
index e3ce6c8..9b5ddda 100644 (file)
@@ -1,13 +1,16 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 void addem ( int *, int *, int *, MPI_Datatype * );
 void assoc ( int *, int *, int *, MPI_Datatype * );
 
-void addem(invec, inoutvec, len, dtype)
-int *invec, *inoutvec, *len;
-MPI_Datatype *dtype;
+void addem(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
 {
   int i;
   for ( i=0; i<*len; i++ ) 
@@ -23,9 +26,7 @@ MPI_Datatype *dtype;
     Note that the computation is in process rank (in the communicator)
     order, independant of the root.
  */
-void assoc(invec, inoutvec, len, dtype)
-int *invec, *inoutvec, *len;
-MPI_Datatype *dtype;
+void assoc(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
 {
   int i;
   for ( i=0; i<*len; i++ )  {
@@ -50,7 +51,7 @@ int main( int argc, char **argv )
     int              correct_result;
     MPI_Op           op_assoc, op_addem;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -89,22 +90,19 @@ int main( int argc, char **argv )
                 rank );
        errors++;
        }
-    /*result = -100;
+    result = -100;
     data = rank;
     MPI_Scan ( &data, &result, 1, MPI_INT, op_assoc, MPI_COMM_WORLD );
     if (result == BAD_ANSWER) {
        fprintf( stderr, "[%d] Error scanning with non-commutative op\n",
                 rank );
        errors++;
-       }*/
+       }
 
     MPI_Op_free( &op_assoc );
     MPI_Op_free( &op_addem );
 
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 82%
rename from teshsuite/smpi/mpich-test/coll/coll12.c
rename to teshsuite/smpi/mpich3-test/coll/coll12.c
index b25b52c..d493a59 100644 (file)
@@ -1,7 +1,12 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 
 #include <stdio.h>
 #include "mpi.h"
-#include "test.h"
+#include "mpitest.h"
 
 #define TABLE_SIZE 2
 
@@ -11,10 +16,10 @@ int main( int argc, char **argv )
   double a[TABLE_SIZE];
   struct { double a; int b; } in[TABLE_SIZE], out[TABLE_SIZE];
   int    i;
-  int    errors = 0, toterrors;
+  int    errors = 0;
 
   /* Initialize the environment and some variables */
-  MPI_Init( &argc, &argv );
+  MTest_Init( &argc, &argv );
   MPI_Comm_rank( MPI_COMM_WORLD, &rank );
   MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -62,15 +67,7 @@ int main( int argc, char **argv )
       }
 
   /* Finish up! */
-  MPI_Allreduce( &errors, &toterrors, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-  if (toterrors) {
-      if (errors)
-         printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-  }
-  else {
-      if (rank == 0) printf( " No Errors\n" );
-  }
-      
+  MTest_Finalize( errors );
   MPI_Finalize();
-  return errors;
+  return MTestReturnValue( errors );
 }
diff --git a/teshsuite/smpi/mpich3-test/coll/coll13.c b/teshsuite/smpi/mpich3-test/coll/coll13.c
new file mode 100644 (file)
index 0000000..7e5b3c7
--- /dev/null
@@ -0,0 +1,85 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  Changes to the original code
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+/* 
+From: hook@nas.nasa.gov (Edward C. Hook)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "mpitest.h"
+
+#include <string.h>
+#include <errno.h>
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+#endif
+
+int main( int argc, char *argv[] )
+{
+    int rank, size;
+    int chunk = 128;
+    int i;
+    int *sb;
+    int *rb;
+    int status;
+
+    MTest_Init(&argc,&argv);
+    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+    MPI_Comm_size(MPI_COMM_WORLD,&size);
+
+    for ( i=1 ; i < argc ; ++i ) {
+       if ( argv[i][0] != '-' )
+           continue;
+       switch(argv[i][1]) {
+       case 'm':
+           chunk = atoi(argv[++i]);
+           break;
+       default:
+           fprintf(stderr,"Unrecognized argument %s\n",
+                   argv[i]);
+           MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+       }
+    }
+
+    sb = (int *)malloc(size*chunk*sizeof(int));
+    if ( !sb ) {
+       perror( "can't allocate send buffer" );
+       MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+    }
+    rb = (int *)malloc(size*chunk*sizeof(int));
+    if ( !rb ) {
+       perror( "can't allocate recv buffer");
+       free(sb);
+       MPI_Abort(MPI_COMM_WORLD,EXIT_FAILURE);
+    }
+    for ( i=0 ; i < size*chunk ; ++i ) {
+       sb[i] = rank + 1;
+       rb[i] = 0;
+    }
+
+    /* fputs("Before MPI_Alltoall\n",stdout); */
+
+    /* This should really send MPI_CHAR, but since sb and rb were allocated
+       as chunk*size*sizeof(int), the buffers are large enough */
+    status = MPI_Alltoall(sb,chunk,MPI_INT,rb,chunk,MPI_INT,
+                         MPI_COMM_WORLD);
+
+    /* fputs("Before MPI_Allreduce\n",stdout); */
+
+    MTest_Finalize( status );
+
+    free(sb);
+    free(rb);
+
+    MPI_Finalize();
+
+    return MTestReturnValue( status );
+}
+
similarity index 73%
rename from teshsuite/smpi/mpich-test/coll/coll2.c
rename to teshsuite/smpi/mpich3-test/coll/coll2.c
index d587171..ae08c96 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
 
@@ -10,19 +15,14 @@ int main( int argc, char **argv )
     int              table[MAX_PROCESSES][MAX_PROCESSES];
     int              errors=0;
     int              participants;
-    MPI_Comm         testcomm;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
     /* A maximum of MAX_PROCESSES processes can participate */
     if ( size > MAX_PROCESSES ) participants = MAX_PROCESSES;
     else              participants = size;
-    /* Set the particpants so that it divides the MAX_PROCESSES */
-    while (MAX_PROCESSES % participants) participants--;
-    /* Create the communicator */
-    MPI_Comm_split( MPI_COMM_WORLD, rank < participants, rank, &testcomm );
 
     if (MAX_PROCESSES % participants) {
        fprintf( stderr, "Number of processors must divide %d\n",
@@ -45,10 +45,12 @@ int main( int argc, char **argv )
 
       /* Gather everybody's result together - sort of like an */
       /* inefficient allgather */
-      for (i=0; i<participants; i++)
-       MPI_Gather(&table[begin_row][0], send_count, MPI_INT, 
+      for (i=0; i<participants; i++) {
+        void *sendbuf = (i == rank ? MPI_IN_PLACE : &table[begin_row][0]);
+       MPI_Gather(sendbuf,              send_count, MPI_INT,
                   &table[0][0],         recv_count, MPI_INT, i, 
-                  testcomm );
+                  MPI_COMM_WORLD );
+      }
 
       /* Everybody should have the same table now,  */
       /* This test does not in any way guarantee there are no errors */
@@ -59,10 +61,7 @@ int main( int argc, char **argv )
       }
     } 
 
-    MPI_Comm_free( &testcomm );
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 84%
rename from teshsuite/smpi/mpich-test/coll/coll3.c
rename to teshsuite/smpi/mpich3-test/coll/coll3.c
index 31e0b74..84260d1 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
 
@@ -13,7 +18,7 @@ int main( int argc, char **argv )
     int              displs[MAX_PROCESSES];
     int              recv_counts[MAX_PROCESSES];
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -48,7 +53,8 @@ int main( int argc, char **argv )
       /* Gather everybody's result together - sort of like an */
       /* inefficient allgather */
       for (i=0; i<participants; i++) {
-       MPI_Gatherv(&table[begin_row][0], send_count, MPI_INT, 
+        void *sendbuf = (i == rank ? MPI_IN_PLACE : &table[begin_row][0]);
+        MPI_Gatherv(sendbuf,      send_count, MPI_INT,
                    &table[0][0], recv_counts, displs, MPI_INT, 
                    i, MPI_COMM_WORLD);
       }
@@ -78,9 +84,7 @@ int main( int argc, char **argv )
          }
     } 
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
diff --git a/teshsuite/smpi/mpich3-test/coll/coll4.c b/teshsuite/smpi/mpich3-test/coll/coll4.c
new file mode 100644 (file)
index 0000000..cd39065
--- /dev/null
@@ -0,0 +1,60 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+#define MAX_PROCESSES 10
+
+int main( int argc, char **argv )
+{
+    int              rank, size, i,j;
+    int              table[MAX_PROCESSES][MAX_PROCESSES];
+    int              row[MAX_PROCESSES];
+    int              errors=0;
+    int              participants;
+    MPI_Comm         comm;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+
+    comm = MPI_COMM_WORLD;
+
+    /* A maximum of MAX_PROCESSES processes can participate */
+    if ( size > MAX_PROCESSES ) {
+       participants = MAX_PROCESSES;
+       MPI_Comm_split( MPI_COMM_WORLD, rank < MAX_PROCESSES, rank, &comm );
+    }
+    else  {
+       participants = size;
+       MPI_Comm_dup( MPI_COMM_WORLD, &comm );
+    }
+    if ( (rank < participants) ) {
+       int send_count = MAX_PROCESSES;
+       int recv_count = MAX_PROCESSES;
+
+       /* If I'm the root (process 0), then fill out the big table */
+       if (rank == 0) 
+           for ( i=0; i<participants; i++) 
+               for ( j=0; j<MAX_PROCESSES; j++ ) 
+                   table[i][j] = i+j;
+       
+       /* Scatter the big table to everybody's little table */
+       MPI_Scatter(&table[0][0], send_count, MPI_INT, 
+                   &row[0]     , recv_count, MPI_INT, 0, comm );
+       
+       /* Now see if our row looks right */
+       for (i=0; i<MAX_PROCESSES; i++) 
+           if ( row[i] != i+rank ) errors++;
+    } 
+    
+    MPI_Comm_free( &comm );
+
+    MTest_Finalize( errors );
+    MPI_Finalize();
+    return MTestReturnValue( errors );
+}
similarity index 82%
rename from teshsuite/smpi/mpich-test/coll/coll5.c
rename to teshsuite/smpi/mpich3-test/coll/coll5.c
index 971bca3..980650f 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
 
@@ -14,7 +19,7 @@ int main( int argc, char **argv )
     int              displs[MAX_PROCESSES];
     int              send_counts[MAX_PROCESSES];
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -43,9 +48,7 @@ int main( int argc, char **argv )
        if ( row[i] != i+rank ) errors++;
     } 
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 78%
rename from teshsuite/smpi/mpich-test/coll/coll6.c
rename to teshsuite/smpi/mpich3-test/coll/coll6.c
index 06e7363..6e8ea36 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
 
@@ -12,21 +17,23 @@ int main( int argc, char **argv )
     int              participants;
     int              displs[MAX_PROCESSES];
     int              recv_counts[MAX_PROCESSES];
+    MPI_Comm         test_comm;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
     /* A maximum of MAX_PROCESSES processes can participate */
-    if ( size > MAX_PROCESSES ) participants = MAX_PROCESSES;
-    else              participants = size;
-    /* while (MAX_PROCESSES % participants) participants--; */
+    participants = ( size > MAX_PROCESSES ) ? MAX_PROCESSES : size;
+
     if (MAX_PROCESSES % participants) {
        fprintf( stderr, "Number of processors must divide %d\n",
                MAX_PROCESSES );
        MPI_Abort( MPI_COMM_WORLD, 1 );
        }
-    if ( (rank < participants) ) {
+    MPI_Comm_split(MPI_COMM_WORLD, rank<participants, rank, &test_comm);
+
+    if ( rank < participants ) {
 
       /* Determine what rows are my responsibility */
       int block_size = MAX_PROCESSES / participants;
@@ -48,7 +55,7 @@ int main( int argc, char **argv )
       /* Everybody gets the gathered data */
       MPI_Allgatherv(&table[begin_row][0], send_count, MPI_INT, 
                     &table[0][0], recv_counts, displs, 
-                    MPI_INT, MPI_COMM_WORLD);
+                     MPI_INT, test_comm);
 
       /* Everybody should have the same table now.
 
@@ -74,9 +81,9 @@ int main( int argc, char **argv )
          }
     } 
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
+
+    MPI_Comm_free(&test_comm);
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 79%
rename from teshsuite/smpi/mpich-test/coll/coll7.c
rename to teshsuite/smpi/mpich3-test/coll/coll7.c
index 0b17b7d..3d352ef 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 #define MAX_PROCESSES 10
 
@@ -11,7 +16,7 @@ int main( int argc, char **argv )
     int              errors=0;
     int              participants;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -39,8 +44,8 @@ int main( int argc, char **argv )
          table[i][j] = rank + 10;
 
       /* Everybody gets the gathered table */
-      MPI_Allgather(&table[begin_row][0], send_count, MPI_INT, 
-                  &table[0][0],          recv_count, MPI_INT, MPI_COMM_WORLD);
+      MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
+                    &table[0][0], recv_count, MPI_INT, MPI_COMM_WORLD);
 
       /* Everybody should have the same table now,  */
       /* This test does not in any way guarantee there are no errors */
@@ -51,9 +56,7 @@ int main( int argc, char **argv )
       }
     } 
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 77%
rename from teshsuite/smpi/mpich-test/coll/coll8.c
rename to teshsuite/smpi/mpich3-test/coll/coll8.c
index 6f81af3..b05fb18 100644 (file)
@@ -1,6 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 int main( int argc, char **argv )
 {
@@ -10,7 +15,7 @@ int main( int argc, char **argv )
     int              result = -100;
     int              correct_result;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -31,9 +36,7 @@ int main( int argc, char **argv )
     MPI_Bcast  ( &result, 1, MPI_INT, 0, MPI_COMM_WORLD );
     if (result != (size-1)) errors++;
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
similarity index 70%
rename from teshsuite/smpi/mpich-test/coll/coll9.c
rename to teshsuite/smpi/mpich3-test/coll/coll9.c
index 4925254..5fd33c8 100644 (file)
@@ -1,12 +1,15 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
-#include "test.h"
+#include "mpitest.h"
 
 void addem ( int *, int *, int *, MPI_Datatype * );
 
-void addem(invec, inoutvec, len, dtype)
-int *invec, *inoutvec, *len;
-MPI_Datatype *dtype;
+void addem(int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
 {
   int i;
   for ( i=0; i<*len; i++ ) 
@@ -22,7 +25,7 @@ int main( int argc, char **argv )
     int              correct_result;
     MPI_Op           op;
 
-    MPI_Init( &argc, &argv );
+    MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
@@ -36,9 +39,7 @@ int main( int argc, char **argv )
       correct_result += i;
     if (result != correct_result) errors++;
 
-    Test_Waitforall( );
+    MTest_Finalize( errors );
     MPI_Finalize();
-    if (errors)
-      printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
-    return errors;
+    return MTestReturnValue( errors );
 }
diff --git a/teshsuite/smpi/mpich3-test/coll/exscan.c b/teshsuite/smpi/mpich3-test/coll/exscan.c
new file mode 100644 (file)
index 0000000..70f4c53
--- /dev/null
@@ -0,0 +1,98 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Exscan";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    int minsize = 2, count; 
+    int *sendbuf, *recvbuf, i;
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       for (count = 1; count < 65000; count = count * 2) {
+
+           sendbuf = (int *)malloc( count * sizeof(int) );
+           recvbuf = (int *)malloc( count * sizeof(int) );
+
+           for (i=0; i<count; i++) {
+               sendbuf[i] = rank + i * size;
+               recvbuf[i] = -1;
+           }
+           
+           MPI_Exscan( sendbuf, recvbuf, count, MPI_INT, MPI_SUM, comm );
+
+           /* Check the results.  rank 0 has no data */
+           if (rank > 0) {
+               int result;
+               for (i=0; i<count; i++) {
+                   result = rank * i * size + ((rank) * (rank-1))/2;
+                   if (recvbuf[i] != result) {
+                       errs++;
+                       if (errs < 10) {
+                           fprintf( stderr, "Error in recvbuf[%d] = %d on %d, expected %d\n",
+                                    i, recvbuf[i], rank, result );
+                       }
+                   }
+               }
+           }
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+            /* now try the MPI_IN_PLACE flavor */
+            for (i=0; i<count; i++) {
+                sendbuf[i] = -1; /* unused */
+                recvbuf[i] = rank + i * size;
+            }
+
+            MPI_Exscan( MPI_IN_PLACE, recvbuf, count, MPI_INT, MPI_SUM, comm );
+
+            /* Check the results.  rank 0's data must remain unchanged */
+            for (i=0; i<count; i++) {
+                int result;
+                if (rank == 0)
+                    result = rank + i * size;
+                else
+                    result = rank * i * size + ((rank) * (rank-1))/2;
+                if (recvbuf[i] != result) {
+                    errs++;
+                    if (errs < 10) {
+                        fprintf( stderr, "Error in recvbuf[%d] = %d on %d, expected %d\n",
+                                 i, recvbuf[i], rank, result );
+                    }
+                }
+            }
+#endif
+
+           free( sendbuf );
+           free( recvbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/exscan2.c b/teshsuite/smpi/mpich3-test/coll/exscan2.c
new file mode 100644 (file)
index 0000000..50c898d
--- /dev/null
@@ -0,0 +1,57 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Exscan (simple test)";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    int sendbuf[1], recvbuf[1];
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    
+    sendbuf[0] = rank;
+    recvbuf[0] = -2;
+           
+    MPI_Exscan( sendbuf, recvbuf, 1, MPI_INT, MPI_SUM, comm );
+
+    /* Check the results.  rank 0 has no data.  Input is
+       0  1  2  3  4  5  6  7  8 ...
+       Output is
+       -  0  1  3  6 10 15 21 28 36
+       (scan, not counting the contribution from the calling process)
+    */
+    if (rank > 0) {
+       int result = (((rank) * (rank-1))/2);
+       /* printf( "%d: %d\n", rank, result ); */
+       if (recvbuf[0] != result) {
+           errs++;
+           fprintf( stderr, "Error in recvbuf = %d on %d, expected %d\n",
+                        recvbuf[0], rank, result );
+       }
+    }
+    else if (recvbuf[0] != -2) {
+       errs++;
+       fprintf( stderr, "Error in recvbuf on zero, is %d\n", recvbuf[0] );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/gather.c b/teshsuite/smpi/mpich3-test/coll/gather.c
new file mode 100644 (file)
index 0000000..7433caa
--- /dev/null
@@ -0,0 +1,74 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous */
+
+int main( int argc, char **argv )
+{
+    MPI_Datatype vec;
+    MPI_Comm     comm;
+    double *vecin, *vecout;
+    int    minsize = 2, count;
+    int    root, i, n, stride, errs = 0;
+    int    rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       for (root=0; root<size; root++) {
+           for (count = 1; count < 65000; count = count * 2) {
+               n = 12;
+               stride = 10;
+               vecin = (double *)malloc( n * stride * size * sizeof(double) );
+               vecout = (double *)malloc( size * n * sizeof(double) );
+               
+               MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec );
+               MPI_Type_commit( &vec );
+               
+               for (i=0; i<n*stride; i++) vecin[i] =-2;
+               for (i=0; i<n; i++) vecin[i*stride] = rank * n + i;
+               
+               MPI_Gather( vecin, 1, vec, vecout, n, MPI_DOUBLE, root, comm );
+               
+               if (rank == root) {
+                   for (i=0; i<n*size; i++) {
+                       if (vecout[i] != i) {
+                           errs++;
+                           if (errs < 10) {
+                               fprintf( stderr, "vecout[%d]=%d\n",
+                                        i, (int)vecout[i] );
+                           }
+                       }
+                   }
+               }
+               MPI_Type_free( &vec );
+               free( vecin );
+               free( vecout );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    /* do a zero length gather */
+    MPI_Gather( NULL, 0, MPI_BYTE, NULL, 0, MPI_BYTE, 0, MPI_COMM_WORLD );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/gather2.c b/teshsuite/smpi/mpich3-test/coll/gather2.c
new file mode 100644 (file)
index 0000000..3c47467
--- /dev/null
@@ -0,0 +1,90 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous.  Use IN_PLACE */
+
+int main( int argc, char **argv )
+{
+    MPI_Datatype vec;
+    double *vecin, *vecout;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    root, i, n, stride, errs = 0;
+    int    rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       for (root=0; root<size; root++) {
+           for (count = 1; count < 65000; count = count * 2) {
+               n = 12;
+               stride = 10;
+               vecin = (double *)malloc( n * stride * size * sizeof(double) );
+               vecout = (double *)malloc( size * n * sizeof(double) );
+               
+               MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec );
+               MPI_Type_commit( &vec );
+               
+               for (i=0; i<n*stride; i++) vecin[i] =-2;
+               for (i=0; i<n; i++) vecin[i*stride] = rank * n + i;
+               int errorcode = MPI_SUCCESS;
+               if (rank == root) {
+                   for (i=0; i<n; i++) {
+                       vecout[rank*n+i] = rank*n+i;
+                   }
+                   errorcode = MPI_Gather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 
+                               vecout, n, MPI_DOUBLE, root, comm );
+               }
+               else {
+                   errorcode = MPI_Gather( vecin, 1, vec, NULL, -1, MPI_DATATYPE_NULL, 
+                               root, comm );
+               }
+
+               if (rank == root) {
+                   for (i=0; i<n*size; i++) {
+                       if (vecout[i] != i) {
+                           errs++;
+                           if (errs < 10) {
+                               fprintf( stderr, "vecout[%d]=%d, err=%d\n",
+                                        i, (int)vecout[i], errorcode );
+                           }
+                       }
+                   }
+               }
+               MPI_Type_free( &vec );
+               free( vecin );
+               free( vecout );
+           }
+       }
+        MTestFreeComm( &comm );
+    }
+
+    /* do a zero length gather */
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    if ( rank == 0 ) {
+       MPI_Gather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, NULL, 0, MPI_BYTE, 0,
+                   MPI_COMM_WORLD );
+    } else {
+       MPI_Gather( NULL, 0, MPI_BYTE, NULL, 0, MPI_BYTE, 0, MPI_COMM_WORLD );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/gather2_save.c b/teshsuite/smpi/mpich3-test/coll/gather2_save.c
new file mode 100644 (file)
index 0000000..a2ac0bd
--- /dev/null
@@ -0,0 +1,91 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Gather data from a vector to contiguous.  Use IN_PLACE */
+
+int main( int argc, char **argv )
+{
+    MPI_Datatype vec;
+    double *vecin, *vecout;
+    MPI_Comm comm;
+    int    count, minsize = 2;
+    int    root, i, n, stride, errs = 0;
+    int    rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       for (root=0; root<size; root++) {
+           for (count = 1; count < 65000; count = count * 2) {
+               n = 12;
+               stride = 10;
+               vecin = (double *)malloc( n * stride * size * sizeof(double) );
+               vecout = (double *)malloc( size * n * sizeof(double) );
+               
+               MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec );
+               MPI_Type_commit( &vec );
+               
+               for (i=0; i<n*stride; i++) vecin[i] =-2;
+               for (i=0; i<n; i++) vecin[i*stride] = rank * n + i;
+               int errorcode = MPI_SUCCESS;
+               if (rank == root) {
+                   for (i=0; i<n; i++) {
+                       vecout[rank*n+i] = rank*n+i;
+                   }
+                   errorcode = MPI_Gather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 
+                               vecout, n, MPI_DOUBLE, root, comm );
+               }
+               else {
+                   errorcode = MPI_Gather( vecin, 1, vec, NULL, -1, MPI_DATATYPE_NULL, 
+                               root, comm );
+               }
+
+               if (rank == root) {
+                   for (i=0; i<n*size; i++) {
+                       if (vecout[i] != i) {
+                           errs++;
+                           if (errs < 10) {
+                               fprintf( stderr, "vecout[%d]=%d, err=%d\n",
+                                        i, (int)vecout[i], errorcode );
+                           }
+                       }
+                   }
+               }
+               MPI_Type_free( &vec );
+               free( vecin );
+               free( vecout );
+           }
+       }
+        printf("end with comm size : %d\n", size);     
+        MTestFreeComm( &comm );
+    }
+
+    /* do a zero length gather */
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    if ( rank == 0 ) {
+       MPI_Gather( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, NULL, 0, MPI_BYTE, 0,
+                   MPI_COMM_WORLD );
+    } else {
+       MPI_Gather( NULL, 0, MPI_BYTE, NULL, 0, MPI_BYTE, 0, MPI_COMM_WORLD );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/iallred.c b/teshsuite/smpi/mpich3-test/coll/iallred.c
new file mode 100644 (file)
index 0000000..564a47f
--- /dev/null
@@ -0,0 +1,40 @@
+#include <stdio.h>
+#include <assert.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* Since MPICH is currently the only NBC implementation in existence, just use
+ * this quick-and-dirty #ifdef to decide whether to test the nonblocking
+ * collectives.  Eventually we can add a configure option or configure test, or
+ * the MPI-3 standard will be released and these can be gated on a MPI_VERSION
+ * check */
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
+int main(int argc, char *argv[])
+{
+    int size, rank;
+#if defined(TEST_NBC_ROUTINES)
+    MPI_Request request;
+    int one = 1, two = 2, isum, sum;
+#endif
+    MPI_Init(&argc,&argv);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    assert(size == 2);
+#if defined(TEST_NBC_ROUTINES)
+    MPI_Iallreduce(&one,&isum,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD,&request);
+    MPI_Allreduce(&two,&sum,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+    MPI_Wait(&request,MPI_STATUS_IGNORE);
+
+    assert(isum == 2);
+    assert(sum == 4);
+    if (rank == 0)
+        printf(" No errors\n");
+#endif
+
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/ibarrier.c b/teshsuite/smpi/mpich3-test/coll/ibarrier.c
new file mode 100644 (file)
index 0000000..44d6703
--- /dev/null
@@ -0,0 +1,41 @@
+/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2013 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* Regression test for ticket #1785, contributed by Jed Brown.  The test was
+ * hanging indefinitely under a buggy version of ch3:sock. */
+
+#include <mpi.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
+int main(int argc, char *argv[])
+{
+#if defined(TEST_NBC_ROUTINES)
+    MPI_Request barrier;
+    int i,done;
+#endif
+    int rank;
+
+    MPI_Init(&argc,&argv);
+    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+#if defined(TEST_NBC_ROUTINES)
+    MPI_Ibarrier(MPI_COMM_WORLD,&barrier);
+    for (i=0,done=0; !done; i++) {
+        usleep(1000);
+        /*printf("[%d] MPI_Test: %d\n",rank,i);*/
+        MPI_Test(&barrier,&done,MPI_STATUS_IGNORE);
+    }
+#endif
+    if (rank == 0)
+        printf(" No Errors\n");
+
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icallgather.c b/teshsuite/smpi/mpich3-test/coll/icallgather.c
new file mode 100644 (file)
index 0000000..987e01a
--- /dev/null
@@ -0,0 +1,107 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm allgather test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *rbuf = 0, *sbuf = 0;
+    int leftGroup, i, count, rank, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           /* The left group will send rank to the right group;
+              The right group will send -rank to the left group */
+           rbuf = (int *)malloc( count * rsize * sizeof(int) );
+           sbuf = (int *)malloc( count * sizeof(int) );
+           for (i=0; i<count*rsize; i++) rbuf[i] = -1;
+           if (leftGroup) {
+               for (i=0; i<count; i++)       sbuf[i] = i + rank*count;
+           }
+           else {
+               for (i=0; i<count; i++)       sbuf[i] = -(i + rank*count);
+           }
+           err = MPI_Allgather( sbuf, count, datatype,
+                                rbuf, count, datatype, comm );
+           if (err) {
+               errs++;
+               MTestPrintError( err );
+           }
+           if (leftGroup) {
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -i) {
+                       errs++;
+                   }
+               }
+           }
+           else {
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != i) {
+                       errs++;
+                   }
+               }
+           }
+
+           /* Use Allgather in a unidirectional way */
+           for (i=0; i<count*rsize; i++) rbuf[i] = -1;
+           if (leftGroup) {
+               err = MPI_Allgather( sbuf, 0, datatype,
+                                    rbuf, count, datatype, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -i) {
+                       errs++;
+                   }
+               }
+           }
+           else {
+               err = MPI_Allgather( sbuf, count, datatype,
+                                    rbuf, 0, datatype, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -1) {
+                       errs++;
+                   }
+               }
+           }
+           free( rbuf );
+           free( sbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icallgatherv.c b/teshsuite/smpi/mpich3-test/coll/icallgatherv.c
new file mode 100644 (file)
index 0000000..a720ed4
--- /dev/null
@@ -0,0 +1,122 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm allgatherv test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *rbuf = 0, *sbuf = 0;
+    int *recvcounts, *recvdispls;
+    int leftGroup, i, count, rank, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+           /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           /* The left group will send rank to the right group;
+              The right group will send -rank to the left group */
+           rbuf = (int *)malloc( count * rsize * sizeof(int) );
+           sbuf = (int *)malloc( count * sizeof(int) );
+           recvcounts = (int *) malloc( rsize * sizeof(int) );
+           recvdispls = (int *) malloc( rsize * sizeof(int) );
+           for (i=0; i<count*rsize; i++) rbuf[i] = -1;
+           for (i=0; i<rsize; i++) {
+               recvcounts[i] = count;
+               recvdispls[i] = i * count;
+           }
+           if (leftGroup) {
+               for (i=0; i<count; i++)       sbuf[i] = i + rank*count;
+           }
+           else {
+               for (i=0; i<count; i++)       sbuf[i] = -(i + rank*count);
+           }
+           err = MPI_Allgatherv( sbuf, count, datatype,
+                                 rbuf, recvcounts, recvdispls, datatype, 
+                                 comm );
+           if (err) {
+               errs++;
+               MTestPrintError( err );
+           }
+           if (leftGroup) {
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -i) {
+                       errs++;
+                   }
+               }
+           }
+           else {
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != i) {
+                       errs++;
+                   }
+               }
+           }
+
+           /* Use Allgather in a unidirectional way */
+           for (i=0; i<count*rsize; i++) rbuf[i] = -1;
+           if (leftGroup) {
+               err = MPI_Allgatherv( sbuf, 0, datatype,
+                                     rbuf, recvcounts, recvdispls, datatype, 
+                                     comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -i) {
+                       errs++;
+                   }
+               }
+           }
+           else {
+                for (i=0; i<rsize; i++) {
+                    recvcounts[i] = 0;
+                    recvdispls[i] = 0;
+                }
+               err = MPI_Allgatherv( sbuf, count, datatype,
+                                     rbuf, recvcounts, recvdispls, datatype, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               for (i=0; i<count*rsize; i++) {
+                   if (rbuf[i] != -1) {
+                       errs++;
+                   }
+               }
+           }
+           free( rbuf );
+           free( sbuf );
+           free( recvcounts );
+           free( recvdispls );
+        }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icallreduce.c b/teshsuite/smpi/mpich3-test/coll/icallreduce.c
new file mode 100644 (file)
index 0000000..2ec7614
--- /dev/null
@@ -0,0 +1,85 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm allreduce test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *sendbuf = 0, *recvbuf = 0;
+    int leftGroup, i, count, rank, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           /* printf( "rank = %d(%d)\n", rank, leftGroup ); fflush(stdout); */
+           sendbuf = (int *)malloc( count * sizeof(int) );
+           recvbuf = (int *)malloc( count * sizeof(int) );
+           if (leftGroup) {
+               for (i=0; i<count; i++) sendbuf[i] = i;
+           }
+           else {
+               for (i=0; i<count; i++) sendbuf[i] = -i;
+           }
+           for (i=0; i<count; i++) recvbuf[i] = 0;
+           err = MPI_Allreduce( sendbuf, recvbuf, count, datatype, 
+                                MPI_SUM, comm );
+           if (err) {
+               errs++;
+               MTestPrintError( err );
+           }
+           /* In each process should be the sum of the values from the
+              other process */
+           if (leftGroup) {
+               for (i=0; i<count; i++) {
+                   if (recvbuf[i] != -i * rsize) {
+                       errs++;
+                       if (errs < 10) {
+                           fprintf( stderr, "recvbuf[%d] = %d\n", i, recvbuf[i] );
+                       }
+                   }
+               }
+           }
+           else {
+               for (i=0; i<count; i++) {
+                   if (recvbuf[i] != i * rsize) {
+                       errs++;
+                       if (errs < 10) {
+                           fprintf( stderr, "recvbuf[%d] = %d\n", i, recvbuf[i] );
+                       }
+                   }
+               }
+           }
+            free( sendbuf );
+            free( recvbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icalltoall.c b/teshsuite/smpi/mpich3-test/coll/icalltoall.c
new file mode 100644 (file)
index 0000000..a6a55e1
--- /dev/null
@@ -0,0 +1,85 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm alltoall test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *sendbuf = 0, *recvbuf = 0;
+    int leftGroup, i, j, idx, count, rrank, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       for (count = 1; count < 66000; count = 2 * count) {
+           /* Get an intercommunicator */
+           MPI_Comm_remote_size( comm, &rsize );
+           MPI_Comm_rank( comm, &rrank );
+           sendbuf = (int *)malloc( rsize * count * sizeof(int) );
+           recvbuf = (int *)malloc( rsize * count * sizeof(int) );
+           for (i=0; i<rsize*count; i++) recvbuf[i] = -1;
+           if (leftGroup) {
+               idx = 0;
+               for (j=0; j<rsize; j++) {
+                   for (i=0; i<count; i++) {
+                       sendbuf[idx++] = i + rrank;
+                   }
+               }
+               err = MPI_Alltoall( sendbuf, count, datatype, 
+                                   NULL, 0, datatype, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+           }
+           else {
+               int rank, size;
+
+               MPI_Comm_rank( comm, &rank );
+               MPI_Comm_size( comm, &size );
+
+               /* In the right group */
+               err = MPI_Alltoall( NULL, 0, datatype, 
+                                   recvbuf, count, datatype, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Check that we have received the correct data */
+               idx = 0;
+               for (j=0; j<rsize; j++) {
+                   for (i=0; i<count; i++) {
+                       if (recvbuf[idx++] != i + j) {
+                           errs++;
+                           if (errs < 10) 
+                               fprintf( stderr, "buf[%d] = %d on %d\n", 
+                                        i, recvbuf[i], rank );
+                       }
+                   }
+               }
+           }
+           free( recvbuf );
+           free( sendbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icalltoallv.c b/teshsuite/smpi/mpich3-test/coll/icalltoallv.c
new file mode 100644 (file)
index 0000000..41123c3
--- /dev/null
@@ -0,0 +1,99 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/*
+  This program tests MPI_Alltoallv by having processor i send different
+  amounts of data to each processor.
+
+  Because there are separate send and receive types to alltoallv,
+  there need to be tests to rearrange data on the fly.  Not done yet.
+  
+  The first test sends i items to processor i from all processors.
+
+  Currently, the test uses only MPI_INT; this is adequate for testing systems
+  that use point-to-point operations
+ */
+
+int main( int argc, char **argv )
+{
+    MPI_Comm comm;
+    int      *sbuf, *rbuf;
+    int      rank, size, lsize, asize;
+    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
+    int      i, j, *p, err;
+    int      leftGroup;
+
+    MTest_Init( &argc, &argv );
+    err = 0;
+
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+      if (comm == MPI_COMM_NULL) continue;
+
+      /* Create the buffer */
+      MPI_Comm_size( comm, &lsize );
+      MPI_Comm_remote_size( comm, &size );
+      asize = (lsize > size) ? lsize : size;
+      MPI_Comm_rank( comm, &rank );
+      sbuf = (int *)malloc( size * size * sizeof(int) );
+      rbuf = (int *)malloc( asize * asize * sizeof(int) );
+      if (!sbuf || !rbuf) {
+       fprintf( stderr, "Could not allocated buffers!\n" );
+       MPI_Abort( comm, 1 );
+      }
+
+      /* Load up the buffers */
+      for (i=0; i<size*size; i++) {
+       sbuf[i] = i + 100*rank;
+       rbuf[i] = -i;
+      }
+
+      /* Create and load the arguments to alltoallv */
+      sendcounts = (int *)malloc( size * sizeof(int) );
+      recvcounts = (int *)malloc( size * sizeof(int) );
+      rdispls    = (int *)malloc( size * sizeof(int) );
+      sdispls    = (int *)malloc( size * sizeof(int) );
+      if (!sendcounts || !recvcounts || !rdispls || !sdispls) {
+       fprintf( stderr, "Could not allocate arg items!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      for (i=0; i<size; i++) {
+       sendcounts[i] = i;
+       sdispls[i]    = (i * (i+1))/2;
+       recvcounts[i] = rank;
+       rdispls[i] = i * rank;
+      }
+      MPI_Alltoallv( sbuf, sendcounts, sdispls, MPI_INT,
+                    rbuf, recvcounts, rdispls, MPI_INT, comm );
+
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+       p = rbuf + rdispls[i];
+       for (j=0; j<rank; j++) {
+         if (p[j] != i * 100 + (rank*(rank+1))/2 + j) {
+           fprintf( stderr, "[%d] got %d expected %d for %dth\n",
+                    rank, p[j],(i*(i+1))/2 + j, j );
+           err++;
+         }
+       }
+      }
+
+      free( sdispls );
+      free( rdispls );
+      free( recvcounts );
+      free( sendcounts );
+      free( rbuf );
+      free( sbuf );
+      MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icalltoallw.c b/teshsuite/smpi/mpich3-test/coll/icalltoallw.c
new file mode 100644 (file)
index 0000000..2b8252e
--- /dev/null
@@ -0,0 +1,109 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/*
+  This program tests MPI_Alltoallw by having processor i send different
+  amounts of data to each processor.  This is just the MPI_Alltoallv test,
+  but with displacements in bytes rather than units of the datatype.
+
+  Because there are separate send and receive types to alltoallw,
+  there need to be tests to rearrange data on the fly.  Not done yet.
+  
+  The first test sends i items to processor i from all processors.
+
+  Currently, the test uses only MPI_INT; this is adequate for testing systems
+  that use point-to-point operations
+ */
+
+int main( int argc, char **argv )
+{
+
+    MPI_Comm comm;
+    int      *sbuf, *rbuf;
+    int      rank, size, lsize, asize;
+    int      *sendcounts, *recvcounts, *rdispls, *sdispls;
+    int      i, j, *p, err;
+    MPI_Datatype *sendtypes, *recvtypes;
+    int      leftGroup;
+
+    MTest_Init( &argc, &argv );
+    err = 0;
+
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+      if (comm == MPI_COMM_NULL) continue;
+
+      /* Create the buffer */
+      MPI_Comm_size( comm, &lsize );
+      MPI_Comm_remote_size( comm, &size );
+      asize = (lsize > size) ? lsize : size;
+      MPI_Comm_rank( comm, &rank );
+      sbuf = (int *)malloc( size * size * sizeof(int) );
+      rbuf = (int *)malloc( asize * asize * sizeof(int) );
+      if (!sbuf || !rbuf) {
+       fprintf( stderr, "Could not allocated buffers!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      
+      /* Load up the buffers */
+      for (i=0; i<size*size; i++) {
+       sbuf[i] = i + 100*rank;
+       rbuf[i] = -i;
+      }
+
+      /* Create and load the arguments to alltoallv */
+      sendcounts = (int *)malloc( size * sizeof(int) );
+      recvcounts = (int *)malloc( size * sizeof(int) );
+      rdispls    = (int *)malloc( size * sizeof(int) );
+      sdispls    = (int *)malloc( size * sizeof(int) );
+      sendtypes  = (MPI_Datatype *)malloc( size * sizeof(MPI_Datatype) );
+      recvtypes  = (MPI_Datatype *)malloc( size * sizeof(MPI_Datatype) );
+      if (!sendcounts || !recvcounts || !rdispls || !sdispls || !sendtypes || !recvtypes) {
+       fprintf( stderr, "Could not allocate arg items!\n" );
+       MPI_Abort( comm, 1 );
+      }
+      /* Note that process 0 sends no data (sendcounts[0] = 0) */
+      for (i=0; i<size; i++) {
+       sendcounts[i] = i;
+       sdispls[i]    = (((i+1) * (i))/2) * sizeof(int);
+        sendtypes[i]  = MPI_INT;
+       recvcounts[i] = rank;
+       rdispls[i]    = i * rank * sizeof(int);
+       recvtypes[i]  = MPI_INT;
+      }
+      MPI_Alltoallw( sbuf, sendcounts, sdispls, sendtypes,
+                    rbuf, recvcounts, rdispls, recvtypes, comm );
+      
+      /* Check rbuf */
+      for (i=0; i<size; i++) {
+       p = rbuf + rdispls[i]/sizeof(int);
+       for (j=0; j<rank; j++) {
+         if (p[j] != i * 100 + (rank*(rank+1))/2 + j) {
+           fprintf( stderr, "[%d] got %d expected %d for %dth\n",
+                    rank, p[j],(i*(i+1))/2 + j, j );
+           err++;
+         }
+       }
+      }
+
+      free(sendtypes);
+      free(recvtypes);
+      free( sdispls );
+      free( rdispls );
+      free( recvcounts );
+      free( sendcounts );
+      free( rbuf );
+      free( sbuf );
+      MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icbarrier.c b/teshsuite/smpi/mpich3-test/coll/icbarrier.c
new file mode 100644 (file)
index 0000000..b2d022a
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm barrier test";
+*/
+
+/* This only checks that the Barrier operation accepts intercommunicators.
+   It does not check for the semantics of a intercomm barrier (all processes
+   in the local group can exit when (but not before) all processes in the 
+   remote group enter the barrier */
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int leftGroup;
+    MPI_Comm comm;
+    /* MPI_Datatype datatype; */
+
+    MTest_Init( &argc, &argv );
+
+    /* datatype = MPI_INT; */
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+        if (comm == MPI_COMM_NULL)
+            continue;
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+       if (leftGroup) {
+           err = MPI_Barrier( comm );
+           if (err) {
+               errs++;
+               MTestPrintError( err );
+           }
+       }
+       else {
+           /* In the right group */
+           err = MPI_Barrier( comm );
+           if (err) {
+               errs++;
+               MTestPrintError( err );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icbcast.c b/teshsuite/smpi/mpich3-test/coll/icbcast.c
new file mode 100644 (file)
index 0000000..660d861
--- /dev/null
@@ -0,0 +1,87 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm broadcast test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *buf = 0;
+    int leftGroup, i, count, rank;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+        if (comm == MPI_COMM_NULL)
+            continue;
+
+       MPI_Comm_rank( comm, &rank );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           buf = (int *)malloc( count * sizeof(int) );
+           if (leftGroup) {
+               if (rank == 0) {
+                   for (i=0; i<count; i++) buf[i] = i;
+               }
+               else {
+                   for (i=0; i<count; i++) buf[i] = -1;
+               }
+               err = MPI_Bcast( buf, count, datatype, 
+                                (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  broadcast */
+               if (rank != 0) {
+                   for (i=0; i<count; i++) {
+                       if (buf[i] != -1) {
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               /* In the right group */
+               for (i=0; i<count; i++) buf[i] = -1;
+               err = MPI_Bcast( buf, count, datatype, 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Check that we have received the correct data */
+               for (i=0; i<count; i++) {
+                   if (buf[i] != i) {
+                       errs++;
+                   }
+               }
+           }
+       free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icgather.c b/teshsuite/smpi/mpich3-test/coll/icgather.c
new file mode 100644 (file)
index 0000000..4865cd0
--- /dev/null
@@ -0,0 +1,86 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm gather test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *buf = 0;
+    int leftGroup, i, count, rank, rsize, size;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_size( comm, &size );
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+       for (count = 1; count < 65000; count = 2 * count) {
+           if (leftGroup) {
+               buf = (int *)malloc( count * rsize * sizeof(int) );
+               for (i=0; i<count*rsize; i++) buf[i] = -1;
+
+               err = MPI_Gather( NULL, 0, datatype,
+                                 buf, count, datatype, 
+                                (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  broadcast */
+               if (rank != 0) {
+                   for (i=0; i<count; i++) {
+                       if (buf[i] != -1) {
+                           errs++;
+                       }
+                   }
+               }
+               else {
+                   /* Check for the correct data */
+                   for (i=0; i<count*rsize; i++) {
+                       if (buf[i] != i) {
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               /* In the right group */
+               buf = (int *)malloc( count * sizeof(int) );
+               for (i=0; i<count; i++) buf[i] = rank * count + i;
+               err = MPI_Gather( buf, count, datatype, 
+                                 NULL, 0, datatype, 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+           }
+       free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icgatherv.c b/teshsuite/smpi/mpich3-test/coll/icgatherv.c
new file mode 100644 (file)
index 0000000..4786daa
--- /dev/null
@@ -0,0 +1,100 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm gatherv test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *buf = 0;
+    int *recvcounts;
+    int *recvdispls;
+    int leftGroup, i, count, rank, rsize, size;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_size( comm, &size );
+               
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           /* Get an intercommunicator */
+           recvcounts = (int *)malloc( rsize * sizeof(int) );
+           recvdispls = (int *)malloc( rsize * sizeof(int) );
+           /* This simple test duplicates the Gather test, 
+              using the same lengths for all messages */
+           for (i=0; i<rsize; i++) {
+               recvcounts[i] = count;
+               recvdispls[i] = count * i;
+           }
+           if (leftGroup) {
+               buf = (int *)malloc( count * rsize * sizeof(int) );
+               for (i=0; i<count*rsize; i++) buf[i] = -1;
+
+               err = MPI_Gatherv( NULL, 0, datatype,
+                                 buf, recvcounts, recvdispls, datatype, 
+                                (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  broadcast */
+               if (rank != 0) {
+                   for (i=0; i<count; i++) {
+                       if (buf[i] != -1) {
+                           errs++;
+                       }
+                   }
+               }
+               else {
+                   /* Check for the correct data */
+                   for (i=0; i<count*rsize; i++) {
+                       if (buf[i] != i) {
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               /* In the right group */
+               buf = (int *)malloc( count * sizeof(int) );
+               for (i=0; i<count; i++) buf[i] = rank * count + i;
+               err = MPI_Gatherv( buf, count, datatype, 
+                                  NULL, 0, 0, datatype, 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+           }
+           free( buf );
+           free( recvcounts );
+           free( recvdispls );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icreduce.c b/teshsuite/smpi/mpich3-test/coll/icreduce.c
new file mode 100644 (file)
index 0000000..49bd537
--- /dev/null
@@ -0,0 +1,96 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm reduce test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *sendbuf = 0, *recvbuf=0;
+    int leftGroup, i, count, rank, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+        if (comm == MPI_COMM_NULL)
+            continue;
+
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           sendbuf = (int *)malloc( count * sizeof(int) );
+           recvbuf = (int *)malloc( count * sizeof(int) );
+           for (i=0; i<count; i++) {
+               sendbuf[i] = -1;
+               recvbuf[i] = -1;
+           }
+           if (leftGroup) {
+               err = MPI_Reduce( sendbuf, recvbuf, count, datatype, MPI_SUM,
+                                (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  broadcast, and that we got the right answers */
+               if (rank == 0) {
+                   for (i=0; i<count; i++) {
+                       if (recvbuf[i] != i * rsize) {
+                           errs++;
+                       }
+                   }
+               }
+               else {
+                   for (i=0; i<count; i++) {
+                       if (recvbuf[i] != -1) {
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               /* In the right group */
+               for (i=0; i<count; i++) sendbuf[i] = i;
+               err = MPI_Reduce( sendbuf, recvbuf, count, datatype, MPI_SUM, 
+                                 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Check that we have received no data */
+               for (i=0; i<count; i++) {
+                   if (recvbuf[i] != -1) {
+                       errs++;
+                   }
+               }
+           }
+       free( sendbuf ); 
+       free( recvbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icscatter.c b/teshsuite/smpi/mpich3-test/coll/icscatter.c
new file mode 100644 (file)
index 0000000..403cec0
--- /dev/null
@@ -0,0 +1,97 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm scatter test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *buf = 0;
+    int leftGroup, i, count, rank, size, rsize;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           buf = 0;
+           if (leftGroup) {
+               buf = (int *)malloc( count * rsize * sizeof(int) );
+               if (rank == 0) {
+                   for (i=0; i<count*rsize; i++) buf[i] = i;
+               }
+               else {
+                   for (i=0; i<count*rsize; i++) buf[i] = -1;
+               }
+               err = MPI_Scatter( buf, count, datatype, 
+                                  NULL, 0, datatype,
+                                (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  scatter */
+               if (rank != 0) {
+                   for (i=0; i<count*rsize; i++) {
+                       if (buf[i] != -1) {
+                           if (errs < 10) {
+                               fprintf( stderr, "Received data on root group!\n" );
+                           }
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               buf = (int *)malloc( count * sizeof(int) );
+               /* In the right group */
+               for (i=0; i<count; i++) buf[i] = -1;
+               err = MPI_Scatter( NULL, 0, datatype, 
+                                  buf, count, datatype, 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Check that we have received the correct data */
+               for (i=0; i<count; i++) {
+                   if (buf[i] != i + rank * count) {
+                       if (errs < 10) 
+                           fprintf( stderr, "buf[%d] = %d on %d\n", 
+                                    i, buf[i], rank );
+                       errs++;
+                   }
+               }
+           }
+           free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/icscatterv.c b/teshsuite/smpi/mpich3-test/coll/icscatterv.c
new file mode 100644 (file)
index 0000000..3d6a577
--- /dev/null
@@ -0,0 +1,107 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple intercomm scatterv test";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int *buf = 0;
+    int *sendcounts;
+    int *senddispls;
+    int leftGroup, i, count, rank, rsize, size;
+    MPI_Comm comm;
+    MPI_Datatype datatype;
+
+    MTest_Init( &argc, &argv );
+
+    datatype = MPI_INT;
+    /* Get an intercommunicator */
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = 2 * count) {
+           buf = 0;
+           sendcounts = (int *)malloc( rsize * sizeof(int) );
+           senddispls = (int *)malloc( rsize * sizeof(int) );
+           for (i=0; i<rsize; i++) {
+               sendcounts[i] = count;
+               senddispls[i] = count * i;
+           }
+           if (leftGroup) {
+               buf = (int *)malloc( count * rsize * sizeof(int) );
+               if (rank == 0) {
+                   for (i=0; i<count*rsize; i++) buf[i] = i;
+               }
+               else {
+                   for (i=0; i<count*rsize; i++) buf[i] = -1;
+               }
+               err = MPI_Scatterv( buf, sendcounts, senddispls, datatype, 
+                                   NULL, 0, datatype,
+                                   (rank == 0) ? MPI_ROOT : MPI_PROC_NULL,
+                                   comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Test that no other process in this group received the 
+                  scatter */
+               if (rank != 0) {
+                   for (i=0; i<count*rsize; i++) {
+                       if (buf[i] != -1) {
+                           if (errs < 10) {
+                               fprintf( stderr, "Received data on root group!\n" );
+                           }
+                           errs++;
+                       }
+                   }
+               }
+           }
+           else {
+               buf = (int *)malloc( count * sizeof(int) );
+               /* In the right group */
+               for (i=0; i<count; i++) buf[i] = -1;
+               err = MPI_Scatterv( NULL, 0, 0, datatype, 
+                                   buf, count, datatype, 0, comm );
+               if (err) {
+                   errs++;
+                   MTestPrintError( err );
+               }
+               /* Check that we have received the correct data */
+               for (i=0; i<count; i++) {
+                   if (buf[i] != i + rank * count) {
+                       if (errs < 10) 
+                           fprintf( stderr, "buf[%d] = %d on %d\n", 
+                                    i, buf[i], rank );
+                       errs++;
+                   }
+               }
+           }
+           free( sendcounts );
+           free( senddispls );
+           free( buf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
similarity index 88%
rename from teshsuite/smpi/mpich-test/coll/longuser.c
rename to teshsuite/smpi/mpich3-test/coll/longuser.c
index 9733836..fd5ac85 100644 (file)
@@ -1,7 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "test.h"
 
 int add ( double *, double *, int *, MPI_Datatype * );
 /*
@@ -9,10 +13,7 @@ int add ( double *, double *, int *, MPI_Datatype * );
  * possible pipelining in the implementation of reductions with user-defined
  * operations).
  */
-int add( invec, inoutvec, len, dtype )
-double       *invec, *inoutvec;
-int          *len;
-MPI_Datatype *dtype;
+int add( double *invec, double *inoutvec, int *len, MPI_Datatype *dtype )
 {
     int i, n = *len;
     for (i=0; i<n; i++) {
diff --git a/teshsuite/smpi/mpich3-test/coll/nonblocking.c b/teshsuite/smpi/mpich3-test/coll/nonblocking.c
new file mode 100644 (file)
index 0000000..8f49a99
--- /dev/null
@@ -0,0 +1,159 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This is a very weak sanity test that all nonblocking collectives specified by
+ * MPI-3 are present in the library and take arguments as expected.  This test
+ * does not check for progress, matching issues, or sensible output buffer
+ * values. */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
+#define NUM_INTS (2)
+
+#define my_assert(cond_)                                                  \
+    do {                                                                  \
+        if (!(cond_)) {                                                   \
+            fprintf(stderr, "assertion (%s) failed, aborting\n", #cond_); \
+            MPI_Abort(MPI_COMM_WORLD, 1);                                 \
+        }                                                                 \
+    } while (0)
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+    int rank, size;
+    int *sbuf = NULL;
+    int *rbuf = NULL;
+    int *scounts = NULL;
+    int *rcounts = NULL;
+    int *sdispls = NULL;
+    int *rdispls = NULL;
+    MPI_Comm comm;
+#if defined(TEST_NBC_ROUTINES)
+    int i;
+    int *types = NULL;
+    MPI_Request req;
+#endif
+
+    /* intentionally not using MTest_Init/MTest_Finalize in order to make it
+     * easy to take this test and use it as an NBC sanity test outside of the
+     * MPICH test suite */
+    MPI_Init(&argc, &argv);
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size(comm, &size);
+    MPI_Comm_rank(comm, &rank);
+
+#if defined(TEST_NBC_ROUTINES)
+    /* enough space for every process to contribute at least NUM_INTS ints to any
+     * collective operation */
+    sbuf = malloc(NUM_INTS*size*sizeof(int));
+    my_assert(sbuf);
+    rbuf = malloc(NUM_INTS*size*sizeof(int));
+    my_assert(rbuf);
+    scounts = malloc(size*sizeof(int));
+    my_assert(scounts);
+    rcounts = malloc(size*sizeof(int));
+    my_assert(rcounts);
+    sdispls = malloc(size*sizeof(int));
+    my_assert(sdispls);
+    rdispls = malloc(size*sizeof(int));
+    my_assert(rdispls);
+    types = malloc(size*sizeof(int));
+    my_assert(types);
+
+    for (i = 0; i < size; ++i) {
+        sbuf[2*i]   = i;
+        sbuf[2*i+1] = i;
+        rbuf[2*i]   = i;
+        rbuf[2*i+1] = i;
+        scounts[i]  = NUM_INTS;
+        rcounts[i]  = NUM_INTS;
+        sdispls[i]  = i * NUM_INTS;
+        rdispls[i]  = i * NUM_INTS;
+        types[i]    = MPI_INT;
+    }
+
+    MPI_Ibarrier(comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ibcast(sbuf, NUM_INTS, MPI_INT, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Igather(sbuf, NUM_INTS, MPI_INT, rbuf, NUM_INTS, MPI_INT, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Igatherv(sbuf, NUM_INTS, MPI_INT, rbuf, rcounts, rdispls, MPI_INT, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iscatter(sbuf, NUM_INTS, MPI_INT, rbuf, NUM_INTS, MPI_INT, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iscatterv(sbuf, scounts, sdispls, MPI_INT, rbuf, NUM_INTS, MPI_INT, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iallgather(sbuf, NUM_INTS, MPI_INT, rbuf, NUM_INTS, MPI_INT, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iallgatherv(sbuf, NUM_INTS, MPI_INT, rbuf, rcounts, rdispls, MPI_INT, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ialltoall(sbuf, NUM_INTS, MPI_INT, rbuf, NUM_INTS, MPI_INT, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ialltoallv(sbuf, scounts, sdispls, MPI_INT, rbuf, rcounts, rdispls, MPI_INT, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ialltoallw(sbuf, scounts, sdispls, types, rbuf, rcounts, rdispls, types, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iallreduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ireduce_scatter(sbuf, rbuf, rcounts, MPI_INT, MPI_SUM, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Ireduce_scatter_block(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    MPI_Iexscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+#endif
+
+    if (sbuf) free(sbuf);
+    if (rbuf) free(rbuf);
+    if (scounts) free(scounts);
+    if (rcounts) free(rcounts);
+    if (sdispls) free(sdispls);
+    if (rdispls) free(rdispls);
+
+    if (rank == 0) {
+        if (errs)
+            fprintf(stderr, "Found %d errors\n", errs);
+        else
+            printf(" No errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/nonblocking2.c b/teshsuite/smpi/mpich3-test/coll/nonblocking2.c
new file mode 100644 (file)
index 0000000..bc8a2c2
--- /dev/null
@@ -0,0 +1,470 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* A basic test of all 17 nonblocking collective operations specified by the
+ * draft MPI-3 standard.  It only exercises the intracommunicator functionality,
+ * does not use MPI_IN_PLACE, and only transmits/receives simple integer types
+ * with relatively small counts.  It does check a few fancier issues, such as
+ * ensuring that "premature user releases" of MPI_Op and MPI_Datatype objects
+ * does not result in an error or segfault. */
+
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+#define COUNT (10)
+#define PRIME (17)
+
+#define my_assert(cond_)                                                  \
+    do {                                                                  \
+        if (!(cond_)) {                                                   \
+            fprintf(stderr, "assertion (%s) failed, aborting\n", #cond_); \
+            MPI_Abort(MPI_COMM_WORLD, 1);                                 \
+        }                                                                 \
+    } while (0)
+
+/* Since MPICH is currently the only NBC implementation in existence, just use
+ * this quick-and-dirty #ifdef to decide whether to test the nonblocking
+ * collectives.  Eventually we can add a configure option or configure test, or
+ * the MPI-3 standard will be released and these can be gated on a MPI_VERSION
+ * check */
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
+static void sum_fn(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    int i;
+    int *in = invec;
+    int *inout = inoutvec;
+    for (i = 0; i < *len; ++i) {
+        inout[i] = in[i] + inout[i];
+    }
+}
+
+
+int main(int argc, char **argv)
+{
+    int rank, size;
+    int *buf = NULL;
+    int *recvbuf = NULL;
+    int *sendcounts = NULL;
+    int *recvcounts = NULL;
+    int *sdispls = NULL;
+    int *rdispls = NULL;
+    int *sendtypes = NULL;
+    int *recvtypes = NULL;
+#if defined(TEST_NBC_ROUTINES)
+    int i, j;
+    char *buf_alias = NULL;
+    MPI_Request req;
+#endif
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+#if defined(TEST_NBC_ROUTINES)
+
+    buf        = malloc(COUNT*size*sizeof(int));
+    recvbuf    = malloc(COUNT*size*sizeof(int));
+    sendcounts = malloc(size*sizeof(int));
+    recvcounts = malloc(size*sizeof(int));
+    sdispls    = malloc(size*sizeof(int));
+    rdispls    = malloc(size*sizeof(int));
+    sendtypes  = malloc(size*sizeof(MPI_Datatype));
+    recvtypes  = malloc(size*sizeof(MPI_Datatype));
+
+    /* MPI_Ibcast */
+    for (i = 0; i < COUNT; ++i) {
+        if (rank == 0) {
+            buf[i] = i;
+        }
+        else {
+            buf[i] = 0xdeadbeef;
+        }
+    }
+    MPI_Ibcast(buf, COUNT, MPI_INT, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    for (i = 0; i < COUNT; ++i) {
+        if (buf[i] != i)
+            printf("buf[%d]=%d i=%d\n", i, buf[i], i);
+        my_assert(buf[i] == i);
+    }
+
+    /* MPI_Ibcast (again, but designed to stress scatter/allgather impls) */
+    buf_alias = (char *)buf;
+    my_assert(COUNT*size*sizeof(int) > PRIME); /* sanity */
+    for (i = 0; i < PRIME; ++i) {
+        if (rank == 0)
+            buf_alias[i] = i;
+        else
+            buf_alias[i] = 0xdb;
+    }
+    for (i = PRIME; i < COUNT * size * sizeof(int); ++i) {
+        buf_alias[i] = 0xbf;
+    }
+    MPI_Ibcast(buf, PRIME, MPI_SIGNED_CHAR, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < PRIME; ++i) {
+        if (buf_alias[i] != i)
+            printf("buf_alias[%d]=%d i=%d\n", i, buf_alias[i], i);
+        my_assert(buf_alias[i] == i);
+    }
+
+    /* MPI_Ibarrier */
+    MPI_Ibarrier(MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    /* MPI_Ireduce */
+    for (i = 0; i < COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Ireduce(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    if (rank == 0) {
+        for (i = 0; i < COUNT; ++i) {
+            if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+                printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+            my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+        }
+    }
+
+    /* same again, use a user op and free it before the wait */
+    {
+        MPI_Op op = MPI_OP_NULL;
+        MPI_Op_create(sum_fn, /*commute=*/1, &op);
+
+        for (i = 0; i < COUNT; ++i) {
+            buf[i] = rank + i;
+            recvbuf[i] = 0xdeadbeef;
+        }
+        MPI_Ireduce(buf, recvbuf, COUNT, MPI_INT, op, 0, MPI_COMM_WORLD, &req);
+        MPI_Op_free(&op);
+        MPI_Wait(&req, MPI_STATUS_IGNORE);
+        if (rank == 0) {
+            for (i = 0; i < COUNT; ++i) {
+                if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+                    printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+                my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+            }
+        }
+    }
+
+    /* MPI_Iallreduce */
+    for (i = 0; i < COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Iallreduce(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < COUNT; ++i) {
+        if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+            printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+        my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+    }
+
+    /* MPI_Ialltoallv (a weak test, neither irregular nor sparse) */
+    for (i = 0; i < size; ++i) {
+        sendcounts[i] = COUNT;
+        recvcounts[i] = COUNT;
+        sdispls[i] = COUNT * i;
+        rdispls[i] = COUNT * i;
+        for (j = 0; j < COUNT; ++j) {
+            buf[i*COUNT+j] = rank + (i * j);
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Ialltoallv(buf, sendcounts, sdispls, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (rank * j)));*/
+            my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+        }
+    }
+
+    /* MPI_Igather */
+    for (i = 0; i < size*COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Igather(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    if (rank == 0) {
+        for (i = 0; i < size; ++i) {
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[i*COUNT+j] == i + j);
+            }
+        }
+    }
+    else {
+        for (i = 0; i < size*COUNT; ++i) {
+            my_assert(recvbuf[i] == 0xdeadbeef);
+        }
+    }
+
+    /* same test again, just use a dup'ed datatype and free it before the wait */
+    {
+        MPI_Datatype type = MPI_DATATYPE_NULL;
+        MPI_Type_dup(MPI_INT, &type);
+
+        for (i = 0; i < size*COUNT; ++i) {
+            buf[i] = rank + i;
+            recvbuf[i] = 0xdeadbeef;
+        }
+        MPI_Igather(buf, COUNT, MPI_INT, recvbuf, COUNT, type, 0, MPI_COMM_WORLD, &req);
+        MPI_Type_free(&type); /* should cause implementations that don't refcount
+                                 correctly to blow up or hang in the wait */
+        MPI_Wait(&req, MPI_STATUS_IGNORE);
+        if (rank == 0) {
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    my_assert(recvbuf[i*COUNT+j] == i + j);
+                }
+            }
+        }
+        else {
+            for (i = 0; i < size*COUNT; ++i) {
+                my_assert(recvbuf[i] == 0xdeadbeef);
+            }
+        }
+    }
+
+    /* MPI_Iscatter */
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            if (rank == 0)
+                buf[i*COUNT+j] = i + j;
+            else
+                buf[i*COUNT+j] = 0xdeadbeef;
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Iscatter(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (j = 0; j < COUNT; ++j) {
+        my_assert(recvbuf[j] == rank + j);
+    }
+    if (rank != 0) {
+        for (i = 0; i < size*COUNT; ++i) {
+            /* check we didn't corrupt the sendbuf somehow */
+            my_assert(buf[i] == 0xdeadbeef);
+        }
+    }
+
+    /* MPI_Iscatterv */
+    for (i = 0; i < size; ++i) {
+        /* weak test, just test the regular case where all counts are equal */
+        sendcounts[i] = COUNT;
+        sdispls[i] = i * COUNT;
+        for (j = 0; j < COUNT; ++j) {
+            if (rank == 0)
+                buf[i*COUNT+j] = i + j;
+            else
+                buf[i*COUNT+j] = 0xdeadbeef;
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Iscatterv(buf, sendcounts, sdispls, MPI_INT, recvbuf, COUNT, MPI_INT, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (j = 0; j < COUNT; ++j) {
+        my_assert(recvbuf[j] == rank + j);
+    }
+    if (rank != 0) {
+        for (i = 0; i < size*COUNT; ++i) {
+            /* check we didn't corrupt the sendbuf somehow */
+            my_assert(buf[i] == 0xdeadbeef);
+        }
+    }
+    for (i = 1; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /* check we didn't corrupt the rest of the recvbuf */
+            my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+        }
+    }
+
+    /* MPI_Ireduce_scatter */
+    for (i = 0; i < size; ++i) {
+        recvcounts[i] = COUNT;
+        for (j = 0; j < COUNT; ++j) {
+            buf[i*COUNT+j] = rank + i;
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Ireduce_scatter(buf, recvbuf, recvcounts, MPI_INT, MPI_SUM, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (j = 0; j < COUNT; ++j) {
+        my_assert(recvbuf[j] == (size * rank + ((size - 1) * size) / 2));
+    }
+    for (i = 1; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /* check we didn't corrupt the rest of the recvbuf */
+            my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+        }
+    }
+
+    /* MPI_Ireduce_scatter_block */
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            buf[i*COUNT+j] = rank + i;
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Ireduce_scatter_block(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (j = 0; j < COUNT; ++j) {
+        my_assert(recvbuf[j] == (size * rank + ((size - 1) * size) / 2));
+    }
+    for (i = 1; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /* check we didn't corrupt the rest of the recvbuf */
+            my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+        }
+    }
+
+    /* MPI_Igatherv */
+    for (i = 0; i < size*COUNT; ++i) {
+        buf[i] = 0xdeadbeef;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    for (i = 0; i < COUNT; ++i) {
+        buf[i] = rank + i;
+    }
+    for (i = 0; i < size; ++i) {
+        recvcounts[i] = COUNT;
+        rdispls[i] = i * COUNT;
+    }
+    MPI_Igatherv(buf, COUNT, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, 0, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    if (rank == 0) {
+        for (i = 0; i < size; ++i) {
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[i*COUNT+j] == i + j);
+            }
+        }
+    }
+    else {
+        for (i = 0; i < size*COUNT; ++i) {
+            my_assert(recvbuf[i] == 0xdeadbeef);
+        }
+    }
+
+    /* MPI_Ialltoall */
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            buf[i*COUNT+j] = rank + (i * j);
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Ialltoall(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (i * j)));*/
+            my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+        }
+    }
+
+    /* MPI_Iallgather */
+    for (i = 0; i < size*COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Iallgather(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            my_assert(recvbuf[i*COUNT+j] == i + j);
+        }
+    }
+
+    /* MPI_Iallgatherv */
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+        recvcounts[i] = COUNT;
+        rdispls[i] = i * COUNT;
+    }
+    for (i = 0; i < COUNT; ++i)
+        buf[i] = rank + i;
+    MPI_Iallgatherv(buf, COUNT, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            my_assert(recvbuf[i*COUNT+j] == i + j);
+        }
+    }
+
+    /* MPI_Iscan */
+    for (i = 0; i < COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Iscan(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < COUNT; ++i) {
+        my_assert(recvbuf[i] == ((rank * (rank+1) / 2) + (i * (rank + 1))));
+    }
+
+    /* MPI_Iexscan */
+    for (i = 0; i < COUNT; ++i) {
+        buf[i] = rank + i;
+        recvbuf[i] = 0xdeadbeef;
+    }
+    MPI_Iexscan(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < COUNT; ++i) {
+        if (rank == 0)
+            my_assert(recvbuf[i] == 0xdeadbeef);
+        else
+            my_assert(recvbuf[i] == ((rank * (rank+1) / 2) + (i * (rank + 1)) - (rank + i)));
+    }
+
+    /* MPI_Ialltoallw (a weak test, neither irregular nor sparse) */
+    for (i = 0; i < size; ++i) {
+        sendcounts[i] = COUNT;
+        recvcounts[i] = COUNT;
+        sdispls[i] = COUNT * i * sizeof(int);
+        rdispls[i] = COUNT * i * sizeof(int);
+        sendtypes[i] = MPI_INT;
+        recvtypes[i] = MPI_INT;
+        for (j = 0; j < COUNT; ++j) {
+            buf[i*COUNT+j] = rank + (i * j);
+            recvbuf[i*COUNT+j] = 0xdeadbeef;
+        }
+    }
+    MPI_Ialltoallw(buf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, MPI_COMM_WORLD, &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+    for (i = 0; i < size; ++i) {
+        for (j = 0; j < COUNT; ++j) {
+            /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (rank * j)));*/
+            my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+        }
+    }
+
+#endif /* defined(TEST_NBC_ROUTINES) */
+
+    if (rank == 0)
+        printf(" No Errors\n");
+
+
+    MPI_Finalize();
+    free(buf);
+    free(recvbuf);
+    free(sendcounts);
+    free(recvcounts);
+    free(rdispls);
+    free(sdispls);
+    free(recvtypes);
+    free(sendtypes);
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/nonblocking3.c b/teshsuite/smpi/mpich3-test/coll/nonblocking3.c
new file mode 100644 (file)
index 0000000..2c0ab32
--- /dev/null
@@ -0,0 +1,842 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test attempts to execute multiple simultaneous nonblocking collective
+ * (NBC) MPI routines at the same time, and manages their completion with a
+ * variety of routines (MPI_{Wait,Test}{,_all,_any,_some}).  It also throws a
+ * few point-to-point operations into the mix.
+ *
+ * Possible improvements:
+ * - post operations on multiple comms from multiple threads
+ */
+
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+static int errs = 0;
+
+/* Constants that control the high level test harness behavior. */
+/* MAIN_ITERATIONS is how many NBC ops the test will attempt to issue. */
+#define MAIN_ITERATIONS (100000)
+/* WINDOW is the maximum number of outstanding NBC requests at any given time */
+#define WINDOW (20)
+/* we sleep with probability 1/CHANCE_OF_SLEEP */
+#define CHANCE_OF_SLEEP (1000)
+/* JITTER_DELAY is denominated in microseconds (us) */
+#define JITTER_DELAY (50000) /* 0.05 seconds */
+/* NUM_COMMS is the number of communicators on which ops will be posted */
+#define NUM_COMMS (4)
+
+/* Constants that control behavior of the individual testing operations.
+ * Altering these can help to explore the testing space, but increasing them too
+ * much can consume too much memory (often O(n^2) usage). */
+/* FIXME is COUNT==10 too limiting? should we try a larger count too (~500)? */
+#define COUNT (10)
+#define PRIME (17)
+
+#define my_assert(cond_)                                                                 \
+    do {                                                                                 \
+        if (!(cond_)) {                                                                  \
+            ++errs;                                                                      \
+            if (errs < 10) {                                                             \
+                fprintf(stderr, "assertion (%s) failed on line %d\n", #cond_, __LINE__); \
+            }                                                                            \
+        }                                                                                \
+    } while (0)
+
+/* Since MPICH is currently the only NBC implementation in existence, just use
+ * this quick-and-dirty #ifdef to decide whether to test the nonblocking
+ * collectives.  Eventually we can add a configure option or configure test, or
+ * the MPI-3 standard will be released and these can be gated on a MPI_VERSION
+ * check */
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_NBC_ROUTINES 1
+#endif
+
+#if defined(TEST_NBC_ROUTINES)
+/* Intended to act like "rand_r", but we can be sure that it will exist and be
+ * consistent across all of comm world.  Returns a number in the range
+ * [0,GEN_PRN_MAX] */
+#define GEN_PRN_MAX (4294967291-1)
+static unsigned int gen_prn(unsigned int x)
+{
+    /* a simple "multiplicative congruential method" PRNG, with parameters:
+     *   m=4294967291, largest 32-bit prime
+     *   a=279470273, good primitive root of m from "TABLES OF LINEAR
+     *                CONGRUENTIAL GENERATORS OF DIFFERENT SIZES AND GOOD
+     *                LATTICE STRUCTURE", by Pierre L’Ecuyer */
+    return (279470273UL * (unsigned long)x) % 4294967291UL;
+}
+
+/* given a random unsigned int value "rndval_" from gen_prn, this evaluates to a
+ * value in the range [min_,max_) */
+#define rand_range(rndval_,min_,max_) \
+    ((unsigned int)((min_) + ((rndval_) * (1.0 / (GEN_PRN_MAX+1.0)) * ((max_) - (min_)))))
+
+
+static void sum_fn(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    int i;
+    int *in = invec;
+    int *inout = inoutvec;
+    for (i = 0; i < *len; ++i) {
+        inout[i] = in[i] + inout[i];
+    }
+}
+
+/* used to keep track of buffers that should be freed after the corresponding
+ * operation has completed */
+struct laundry {
+    int case_num; /* which test case initiated this req/laundry */
+    MPI_Comm comm;
+    int *buf;
+    int *recvbuf;
+    int *sendcounts;
+    int *recvcounts;
+    int *sdispls;
+    int *rdispls;
+    int *sendtypes;
+    int *recvtypes;
+};
+
+static void cleanup_laundry(struct laundry *l)
+{
+    l->case_num = -1;
+    l->comm = MPI_COMM_NULL;
+    if (l->buf) free(l->buf);
+    if (l->recvbuf) free(l->recvbuf);
+    if (l->sendcounts) free(l->sendcounts);
+    if (l->recvcounts) free(l->recvcounts);
+    if (l->sdispls) free(l->sdispls);
+    if (l->rdispls) free(l->rdispls);
+    if (l->sendtypes) free(l->sendtypes);
+    if (l->recvtypes) free(l->recvtypes);
+}
+
+/* Starts a "random" operation on "comm" corresponding to "rndnum" and returns
+ * in (*req) a request handle corresonding to that operation.  This call should
+ * be considered collective over comm (with a consistent value for "rndnum"),
+ * even though the operation may only be a point-to-point request. */
+static void start_random_nonblocking(MPI_Comm comm, unsigned int rndnum, MPI_Request *req, struct laundry *l)
+{
+    int i, j;
+    int rank, size;
+    int *buf = NULL;
+    int *recvbuf = NULL;
+    int *sendcounts = NULL;
+    int *recvcounts = NULL;
+    int *sdispls = NULL;
+    int *rdispls = NULL;
+    int *sendtypes = NULL;
+    int *recvtypes = NULL;
+    char *buf_alias = NULL;
+
+    MPI_Comm_rank(comm, &rank);
+    MPI_Comm_size(comm, &size);
+
+    *req = MPI_REQUEST_NULL;
+
+    l->case_num = -1;
+    l->comm = comm;
+
+    l->buf        = buf        = malloc(COUNT*size*sizeof(int));
+    l->recvbuf    = recvbuf    = malloc(COUNT*size*sizeof(int));
+    l->sendcounts = sendcounts = malloc(size*sizeof(int));
+    l->recvcounts = recvcounts = malloc(size*sizeof(int));
+    l->sdispls    = sdispls    = malloc(size*sizeof(int));
+    l->rdispls    = rdispls    = malloc(size*sizeof(int));
+    l->sendtypes  = sendtypes  = malloc(size*sizeof(MPI_Datatype));
+    l->recvtypes  = recvtypes  = malloc(size*sizeof(MPI_Datatype));
+
+#define NUM_CASES (21)
+    l->case_num = rand_range(rndnum, 0, NUM_CASES);
+    switch (l->case_num) {
+        case 0: /* MPI_Ibcast */
+            for (i = 0; i < COUNT; ++i) {
+                if (rank == 0) {
+                    buf[i] = i;
+                }
+                else {
+                    buf[i] = 0xdeadbeef;
+                }
+            }
+            MPI_Ibcast(buf, COUNT, MPI_INT, 0, comm, req);
+            break;
+
+        case 1: /* MPI_Ibcast (again, but designed to stress scatter/allgather impls) */
+            /* FIXME fiddle with PRIME and buffer allocation s.t. PRIME is much larger (1021?) */
+            buf_alias = (char *)buf;
+            my_assert(COUNT*size*sizeof(int) > PRIME); /* sanity */
+            for (i = 0; i < PRIME; ++i) {
+                if (rank == 0)
+                    buf_alias[i] = i;
+                else
+                    buf_alias[i] = 0xdb;
+            }
+            for (i = PRIME; i < COUNT * size * sizeof(int); ++i) {
+                buf_alias[i] = 0xbf;
+            }
+            MPI_Ibcast(buf, PRIME, MPI_SIGNED_CHAR, 0, comm, req);
+            break;
+
+        case 2: /* MPI_Ibarrier */
+            MPI_Ibarrier(comm, req);
+            break;
+
+        case 3: /* MPI_Ireduce */
+            for (i = 0; i < COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Ireduce(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, 0, comm, req);
+            break;
+
+        case 4: /* same again, use a user op and free it before the wait */
+            {
+                MPI_Op op = MPI_OP_NULL;
+                MPI_Op_create(sum_fn, /*commute=*/1, &op);
+                for (i = 0; i < COUNT; ++i) {
+                    buf[i] = rank + i;
+                    recvbuf[i] = 0xdeadbeef;
+                }
+                MPI_Ireduce(buf, recvbuf, COUNT, MPI_INT, op, 0, comm, req);
+                MPI_Op_free(&op);
+            }
+            break;
+
+        case 5: /* MPI_Iallreduce */
+            for (i = 0; i < COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Iallreduce(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, comm, req);
+            break;
+
+        case 6: /* MPI_Ialltoallv (a weak test, neither irregular nor sparse) */
+            for (i = 0; i < size; ++i) {
+                sendcounts[i] = COUNT;
+                recvcounts[i] = COUNT;
+                sdispls[i] = COUNT * i;
+                rdispls[i] = COUNT * i;
+                for (j = 0; j < COUNT; ++j) {
+                    buf[i*COUNT+j] = rank + (i * j);
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Ialltoallv(buf, sendcounts, sdispls, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, comm, req);
+            break;
+
+        case 7: /* MPI_Igather */
+            for (i = 0; i < size*COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Igather(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, 0, comm, req);
+            break;
+
+        case 8: /* same test again, just use a dup'ed datatype and free it before the wait */
+            {
+                MPI_Datatype type = MPI_DATATYPE_NULL;
+                MPI_Type_dup(MPI_INT, &type);
+                for (i = 0; i < size*COUNT; ++i) {
+                    buf[i] = rank + i;
+                    recvbuf[i] = 0xdeadbeef;
+                }
+                MPI_Igather(buf, COUNT, MPI_INT, recvbuf, COUNT, type, 0, comm, req);
+                MPI_Type_free(&type); /* should cause implementations that don't refcount
+                                         correctly to blow up or hang in the wait */
+            }
+            break;
+
+        case 9: /* MPI_Iscatter */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    if (rank == 0)
+                        buf[i*COUNT+j] = i + j;
+                    else
+                        buf[i*COUNT+j] = 0xdeadbeef;
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Iscatter(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, 0, comm, req);
+            break;
+
+        case 10: /* MPI_Iscatterv */
+            for (i = 0; i < size; ++i) {
+                /* weak test, just test the regular case where all counts are equal */
+                sendcounts[i] = COUNT;
+                sdispls[i] = i * COUNT;
+                for (j = 0; j < COUNT; ++j) {
+                    if (rank == 0)
+                        buf[i*COUNT+j] = i + j;
+                    else
+                        buf[i*COUNT+j] = 0xdeadbeef;
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Iscatterv(buf, sendcounts, sdispls, MPI_INT, recvbuf, COUNT, MPI_INT, 0, comm, req);
+            break;
+
+        case 11: /* MPI_Ireduce_scatter */
+            for (i = 0; i < size; ++i) {
+                recvcounts[i] = COUNT;
+                for (j = 0; j < COUNT; ++j) {
+                    buf[i*COUNT+j] = rank + i;
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Ireduce_scatter(buf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm, req);
+            break;
+
+        case 12: /* MPI_Ireduce_scatter_block */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    buf[i*COUNT+j] = rank + i;
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Ireduce_scatter_block(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, comm, req);
+            break;
+
+        case 13: /* MPI_Igatherv */
+            for (i = 0; i < size*COUNT; ++i) {
+                buf[i] = 0xdeadbeef;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            for (i = 0; i < COUNT; ++i) {
+                buf[i] = rank + i;
+            }
+            for (i = 0; i < size; ++i) {
+                recvcounts[i] = COUNT;
+                rdispls[i] = i * COUNT;
+            }
+            MPI_Igatherv(buf, COUNT, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, 0, comm, req);
+            break;
+
+        case 14: /* MPI_Ialltoall */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    buf[i*COUNT+j] = rank + (i * j);
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Ialltoall(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, comm, req);
+            break;
+
+        case 15: /* MPI_Iallgather */
+            for (i = 0; i < size*COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Iallgather(buf, COUNT, MPI_INT, recvbuf, COUNT, MPI_INT, comm, req);
+            break;
+
+        case 16: /* MPI_Iallgatherv */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+                recvcounts[i] = COUNT;
+                rdispls[i] = i * COUNT;
+            }
+            for (i = 0; i < COUNT; ++i)
+                buf[i] = rank + i;
+            MPI_Iallgatherv(buf, COUNT, MPI_INT, recvbuf, recvcounts, rdispls, MPI_INT, comm, req);
+            break;
+
+        case 17: /* MPI_Iscan */
+            for (i = 0; i < COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Iscan(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, comm, req);
+            break;
+
+        case 18: /* MPI_Iexscan */
+            for (i = 0; i < COUNT; ++i) {
+                buf[i] = rank + i;
+                recvbuf[i] = 0xdeadbeef;
+            }
+            MPI_Iexscan(buf, recvbuf, COUNT, MPI_INT, MPI_SUM, comm, req);
+            break;
+
+        case 19: /* MPI_Ialltoallw (a weak test, neither irregular nor sparse) */
+            for (i = 0; i < size; ++i) {
+                sendcounts[i] = COUNT;
+                recvcounts[i] = COUNT;
+                sdispls[i] = COUNT * i * sizeof(int);
+                rdispls[i] = COUNT * i * sizeof(int);
+                sendtypes[i] = MPI_INT;
+                recvtypes[i] = MPI_INT;
+                for (j = 0; j < COUNT; ++j) {
+                    buf[i*COUNT+j] = rank + (i * j);
+                    recvbuf[i*COUNT+j] = 0xdeadbeef;
+                }
+            }
+            MPI_Ialltoallw(buf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, req);
+            break;
+
+        case 20: /* basic pt2pt MPI_Isend/MPI_Irecv pairing */
+            /* even ranks send to odd ranks, but only if we have a full pair */
+            if ((rank % 2 != 0) || (rank != size-1)) {
+                for (j = 0; j < COUNT; ++j) {
+                    buf[j] = j;
+                    recvbuf[j] = 0xdeadbeef;
+                }
+                if (rank % 2 == 0)
+                    MPI_Isend(buf, COUNT, MPI_INT, rank+1, 5, comm, req);
+                else
+                    MPI_Irecv(recvbuf, COUNT, MPI_INT, rank-1, 5, comm, req);
+            }
+            break;
+
+        default:
+            fprintf(stderr, "unexpected value for l->case_num=%d)\n", (l->case_num));
+            MPI_Abort(comm, 1);
+            break;
+    }
+}
+
+static void check_after_completion(struct laundry *l)
+{
+    int i, j;
+    int rank, size;
+    MPI_Comm comm   = l->comm;
+    int *buf        = l->buf;
+    int *recvbuf    = l->recvbuf;
+    int *sendcounts = l->sendcounts;
+    int *recvcounts = l->recvcounts;
+    int *sdispls    = l->sdispls;
+    int *rdispls    = l->rdispls;
+    int *sendtypes  = l->sendtypes;
+    int *recvtypes  = l->recvtypes;
+    char *buf_alias = (char *)buf;
+
+    MPI_Comm_rank(comm, &rank);
+    MPI_Comm_size(comm, &size);
+
+    /* these cases all correspond to cases in start_random_nonblocking */
+    switch (l->case_num) {
+        case 0: /* MPI_Ibcast */
+            for (i = 0; i < COUNT; ++i) {
+                if (buf[i] != i)
+                    printf("buf[%d]=%d i=%d\n", i, buf[i], i);
+                my_assert(buf[i] == i);
+            }
+            break;
+
+        case 1: /* MPI_Ibcast (again, but designed to stress scatter/allgather impls) */
+            for (i = 0; i < PRIME; ++i) {
+                if (buf_alias[i] != i)
+                    printf("buf_alias[%d]=%d i=%d\n", i, buf_alias[i], i);
+                my_assert(buf_alias[i] == i);
+            }
+            break;
+
+        case 2: /* MPI_Ibarrier */
+            /* nothing to check */
+            break;
+
+        case 3: /* MPI_Ireduce */
+            if (rank == 0) {
+                for (i = 0; i < COUNT; ++i) {
+                    if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+                        printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+                    my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+                }
+            }
+            break;
+
+        case 4: /* same again, use a user op and free it before the wait */
+            if (rank == 0) {
+                for (i = 0; i < COUNT; ++i) {
+                    if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+                        printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+                    my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+                }
+            }
+            break;
+
+        case 5: /* MPI_Iallreduce */
+            for (i = 0; i < COUNT; ++i) {
+                if (recvbuf[i] != ((size * (size-1) / 2) + (i * size)))
+                    printf("got recvbuf[%d]=%d, expected %d\n", i, recvbuf[i], ((size * (size-1) / 2) + (i * size)));
+                my_assert(recvbuf[i] == ((size * (size-1) / 2) + (i * size)));
+            }
+            break;
+
+        case 6: /* MPI_Ialltoallv (a weak test, neither irregular nor sparse) */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (rank * j)));*/
+                    my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+                }
+            }
+            break;
+
+        case 7: /* MPI_Igather */
+            if (rank == 0) {
+                for (i = 0; i < size; ++i) {
+                    for (j = 0; j < COUNT; ++j) {
+                        my_assert(recvbuf[i*COUNT+j] == i + j);
+                    }
+                }
+            }
+            else {
+                for (i = 0; i < size*COUNT; ++i) {
+                    my_assert(recvbuf[i] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 8: /* same test again, just use a dup'ed datatype and free it before the wait */
+            if (rank == 0) {
+                for (i = 0; i < size; ++i) {
+                    for (j = 0; j < COUNT; ++j) {
+                        my_assert(recvbuf[i*COUNT+j] == i + j);
+                    }
+                }
+            }
+            else {
+                for (i = 0; i < size*COUNT; ++i) {
+                    my_assert(recvbuf[i] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 9: /* MPI_Iscatter */
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[j] == rank + j);
+            }
+            if (rank != 0) {
+                for (i = 0; i < size*COUNT; ++i) {
+                    /* check we didn't corrupt the sendbuf somehow */
+                    my_assert(buf[i] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 10: /* MPI_Iscatterv */
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[j] == rank + j);
+            }
+            if (rank != 0) {
+                for (i = 0; i < size*COUNT; ++i) {
+                    /* check we didn't corrupt the sendbuf somehow */
+                    my_assert(buf[i] == 0xdeadbeef);
+                }
+            }
+            for (i = 1; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /* check we didn't corrupt the rest of the recvbuf */
+                    my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 11: /* MPI_Ireduce_scatter */
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[j] == (size * rank + ((size - 1) * size) / 2));
+            }
+            for (i = 1; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /* check we didn't corrupt the rest of the recvbuf */
+                    my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 12: /* MPI_Ireduce_scatter_block */
+            for (j = 0; j < COUNT; ++j) {
+                my_assert(recvbuf[j] == (size * rank + ((size - 1) * size) / 2));
+            }
+            for (i = 1; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /* check we didn't corrupt the rest of the recvbuf */
+                    my_assert(recvbuf[i*COUNT+j] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 13: /* MPI_Igatherv */
+            if (rank == 0) {
+                for (i = 0; i < size; ++i) {
+                    for (j = 0; j < COUNT; ++j) {
+                        my_assert(recvbuf[i*COUNT+j] == i + j);
+                    }
+                }
+            }
+            else {
+                for (i = 0; i < size*COUNT; ++i) {
+                    my_assert(recvbuf[i] == 0xdeadbeef);
+                }
+            }
+            break;
+
+        case 14: /* MPI_Ialltoall */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (i * j)));*/
+                    my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+                }
+            }
+            break;
+
+        case 15: /* MPI_Iallgather */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    my_assert(recvbuf[i*COUNT+j] == i + j);
+                }
+            }
+            break;
+
+        case 16: /* MPI_Iallgatherv */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    my_assert(recvbuf[i*COUNT+j] == i + j);
+                }
+            }
+            break;
+
+        case 17: /* MPI_Iscan */
+            for (i = 0; i < COUNT; ++i) {
+                my_assert(recvbuf[i] == ((rank * (rank+1) / 2) + (i * (rank + 1))));
+            }
+            break;
+
+        case 18: /* MPI_Iexscan */
+            for (i = 0; i < COUNT; ++i) {
+                if (rank == 0)
+                    my_assert(recvbuf[i] == 0xdeadbeef);
+                else
+                    my_assert(recvbuf[i] == ((rank * (rank+1) / 2) + (i * (rank + 1)) - (rank + i)));
+            }
+            break;
+
+        case 19: /* MPI_Ialltoallw (a weak test, neither irregular nor sparse) */
+            for (i = 0; i < size; ++i) {
+                for (j = 0; j < COUNT; ++j) {
+                    /*printf("recvbuf[%d*COUNT+%d]=%d, expecting %d\n", i, j, recvbuf[i*COUNT+j], (i + (rank * j)));*/
+                    my_assert(recvbuf[i*COUNT+j] == (i + (rank * j)));
+                }
+            }
+            break;
+
+        case 20: /* basic pt2pt MPI_Isend/MPI_Irecv pairing */
+            /* even ranks send to odd ranks, but only if we have a full pair */
+            if ((rank % 2 != 0) || (rank != size-1)) {
+                for (j = 0; j < COUNT; ++j) {
+                    /* only odd procs did a recv */
+                    if (rank % 2 == 0) {
+                        my_assert(recvbuf[j] == 0xdeadbeef);
+                    }
+                    else {
+                        if (recvbuf[j] != j) printf("recvbuf[%d]=%d j=%d\n", j, recvbuf[j], j);
+                        my_assert(recvbuf[j] == j);
+                    }
+                }
+            }
+            break;
+
+        default:
+            printf("invalid case_num (%d) detected\n", l->case_num);
+            assert(0);
+            break;
+    }
+}
+#undef NUM_CASES
+
+static void complete_something_somehow(unsigned int rndnum, int numreqs, MPI_Request reqs[], int *outcount, int indices[])
+{
+    int i, idx, flag;
+
+#define COMPLETION_CASES (8)
+    switch (rand_range(rndnum, 0, COMPLETION_CASES)) {
+        case 0:
+            MPI_Waitall(numreqs, reqs, MPI_STATUSES_IGNORE);
+            *outcount = numreqs;
+            for (i = 0; i < numreqs; ++i) {
+                indices[i] = i;
+            }
+            break;
+
+        case 1:
+            MPI_Testsome(numreqs, reqs, outcount, indices, MPI_STATUS_IGNORE);
+            if (*outcount == MPI_UNDEFINED) {
+                *outcount = 0;
+            }
+            break;
+
+        case 2:
+            MPI_Waitsome(numreqs, reqs, outcount, indices, MPI_STATUS_IGNORE);
+            if (*outcount == MPI_UNDEFINED) {
+                *outcount = 0;
+            }
+            break;
+
+        case 3:
+            MPI_Waitany(numreqs, reqs, &idx, MPI_STATUS_IGNORE);
+            if (idx == MPI_UNDEFINED) {
+                *outcount = 0;
+            }
+            else {
+                *outcount = 1;
+                indices[0] = idx;
+            }
+            break;
+
+        case 4:
+            MPI_Testany(numreqs, reqs, &idx, &flag, MPI_STATUS_IGNORE);
+            if (idx == MPI_UNDEFINED) {
+                *outcount = 0;
+            }
+            else {
+                *outcount = 1;
+                indices[0] = idx;
+            }
+            break;
+
+        case 5:
+            MPI_Testall(numreqs, reqs, &flag, MPI_STATUSES_IGNORE);
+            if (flag) {
+                *outcount = numreqs;
+                for (i = 0; i < numreqs; ++i) {
+                    indices[i] = i;
+                }
+            }
+            else {
+                *outcount = 0;
+            }
+            break;
+
+        case 6:
+            /* select a new random index and wait on it */
+            rndnum = gen_prn(rndnum);
+            idx = rand_range(rndnum, 0, numreqs);
+            MPI_Wait(&reqs[idx], MPI_STATUS_IGNORE);
+            *outcount = 1;
+            indices[0] = idx;
+            break;
+
+        case 7:
+            /* select a new random index and wait on it */
+            rndnum = gen_prn(rndnum);
+            idx = rand_range(rndnum, 0, numreqs);
+            MPI_Test(&reqs[idx], &flag, MPI_STATUS_IGNORE);
+            *outcount = (flag ? 1 : 0);
+            indices[0] = idx;
+            break;
+
+        default:
+            assert(0);
+            break;
+    }
+#undef COMPLETION_CASES
+}
+#endif /* defined(TEST_NBC_ROUTINES) */
+
+int main(int argc, char **argv)
+{
+    int wrank, wsize;
+#if defined(TEST_NBC_ROUTINES)
+    int i, num_posted, num_completed;
+    unsigned int seed = 0x10bc;
+    unsigned int post_seq, complete_seq;
+    struct laundry larr[WINDOW];
+    MPI_Request reqs[WINDOW];
+    int outcount;
+    int indices[WINDOW];
+    MPI_Comm comms[NUM_COMMS];
+    MPI_Comm comm;
+#endif
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+
+#if defined(TEST_NBC_ROUTINES)
+
+    /* it is critical that all processes in the communicator start with a
+     * consistent value for "post_seq" */
+    post_seq = complete_seq = gen_prn(seed);
+
+    num_completed = 0;
+    num_posted = 0;
+
+    /* construct all of the communicators, just dups of comm world for now */
+    for (i = 0; i < NUM_COMMS; ++i) {
+        MPI_Comm_dup(MPI_COMM_WORLD, &comms[i]);
+    }
+
+    /* fill the entire window of ops */
+    for (i = 0; i < WINDOW; ++i) {
+        reqs[i] = MPI_REQUEST_NULL;
+        memset(&larr[i], 0, sizeof(struct laundry));
+        larr[i].case_num = -1;
+
+        /* randomly select a comm, using a new seed to avoid correlating
+         * particular kinds of NBC ops with particular communicators */
+        comm = comms[rand_range(gen_prn(post_seq), 0, NUM_COMMS)];
+
+        start_random_nonblocking(comm, post_seq, &reqs[i], &larr[i]);
+        ++num_posted;
+        post_seq = gen_prn(post_seq);
+    }
+
+    /* now loop repeatedly, completing ops with "random" completion functions,
+     * until we've posted and completed MAIN_ITERATIONS ops */
+    while (num_completed < MAIN_ITERATIONS) {
+        complete_something_somehow(complete_seq, WINDOW, reqs, &outcount, indices);
+        complete_seq = gen_prn(complete_seq);
+        for (i = 0; i < outcount; ++i) {
+            int idx = indices[i];
+            assert(reqs[idx] == MPI_REQUEST_NULL);
+            if (larr[idx].case_num != -1) {
+                check_after_completion(&larr[idx]);
+                cleanup_laundry(&larr[idx]);
+                ++num_completed;
+                if (num_posted < MAIN_ITERATIONS) {
+                    comm = comms[rand_range(gen_prn(post_seq), 0, NUM_COMMS)];
+                    start_random_nonblocking(comm, post_seq, &reqs[idx], &larr[idx]);
+                    ++num_posted;
+                    post_seq = gen_prn(post_seq);
+                }
+            }
+        }
+
+        /* "randomly" and infrequently introduce some jitter into the system */
+        if (0 == rand_range(gen_prn(complete_seq + wrank), 0, CHANCE_OF_SLEEP)) {
+            usleep(JITTER_DELAY); /* take a short nap */
+        }
+    }
+
+    for (i = 0; i < NUM_COMMS; ++i) {
+        MPI_Comm_free(&comms[i]);
+    }
+
+#endif /* defined(TEST_NBC_ROUTINES) */
+
+    if (wrank == 0) {
+        if (errs)
+            printf("found %d errors\n", errs);
+        else
+            printf(" No errors\n");
+    }
+
+    MPI_Finalize();
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/op_commutative.c b/teshsuite/smpi/mpich3-test/coll/op_commutative.c
new file mode 100644 (file)
index 0000000..28043ef
--- /dev/null
@@ -0,0 +1,109 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "A simple test of MPI_Op_create/commute/free";
+*/
+
+static int errs = 0;
+
+/*
+static void comm_user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    user_op(invec, inoutvec, len, datatype);
+}
+*/
+
+/*
+static void noncomm_user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    user_op(invec, inoutvec, len, datatype);
+}
+*/
+
+static void user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    int i;
+    int *invec_int = (int *)invec;
+    int *inoutvec_int = (int *)inoutvec;
+
+    if (*datatype != MPI_INT) {
+        ++errs;
+        printf("invalid datatype passed to user_op");
+        return;
+    }
+
+    for (i = 0; i < *len; ++i) {
+        inoutvec_int[i] = invec_int[i] * 2 + inoutvec_int[i];
+    }
+}
+
+
+int main( int argc, char *argv[] )
+{
+    MPI_Op c_uop = MPI_OP_NULL;
+    MPI_Op nc_uop = MPI_OP_NULL;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int is_commutative = 0;
+#endif
+
+    MTest_Init(&argc, &argv);
+
+    /* make sure that user-define ops work too */
+    MPI_Op_create(&user_op, 1/*commute*/,  &c_uop);
+    MPI_Op_create(&user_op, 0/*!commute*/, &nc_uop);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* this function was added in MPI-2.2 */
+
+#define CHECK_COMMUTATIVE(op_)                      \
+    do {                                            \
+        MPI_Op_commutative((op_), &is_commutative); \
+        if (!is_commutative) { ++errs; }            \
+    } while (0)
+
+    /* Check all predefined reduction operations for commutivity.
+     * This list is from section 5.9.2 of the MPI-2.1 standard */
+    CHECK_COMMUTATIVE(MPI_MAX);
+    CHECK_COMMUTATIVE(MPI_MIN);
+    CHECK_COMMUTATIVE(MPI_SUM);
+    CHECK_COMMUTATIVE(MPI_PROD);
+    CHECK_COMMUTATIVE(MPI_LAND);
+    CHECK_COMMUTATIVE(MPI_BAND);
+    CHECK_COMMUTATIVE(MPI_LOR);
+    CHECK_COMMUTATIVE(MPI_BOR);
+    CHECK_COMMUTATIVE(MPI_LXOR);
+    CHECK_COMMUTATIVE(MPI_BXOR);
+    CHECK_COMMUTATIVE(MPI_MAXLOC);
+    CHECK_COMMUTATIVE(MPI_MINLOC);
+
+#undef CHECK_COMMUTATIVE
+
+    MPI_Op_commutative(c_uop, &is_commutative);
+    if (!is_commutative) {
+        ++errs;
+    }
+
+    /* also check our non-commutative user defined operation */
+    MPI_Op_commutative(nc_uop, &is_commutative);
+    if (is_commutative) {
+        ++errs;
+    }
+#endif
+
+    MPI_Op_free(&nc_uop);
+    MPI_Op_free(&c_uop);
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/opband.c b/teshsuite/smpi/mpich3-test/coll/opband.c
new file mode 100644 (file)
index 0000000..b8ac9d0
--- /dev/null
@@ -0,0 +1,370 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_BAND operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    short sinbuf[3], soutbuf[3];
+    unsigned short usinbuf[3], usoutbuf[3];
+    long linbuf[3], loutbuf[3];
+    unsigned long ulinbuf[3], uloutbuf[3];
+    unsigned uinbuf[3], uoutbuf[3];
+    
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0xff : 0xf0;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != (char)0xff) {
+               errs++;
+               fprintf( stderr, "char BAND(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char BAND(0) test failed\n" );
+           }
+           if (coutbuf[2] != (char)0xf0 && size > 1) {
+               errs++;
+               fprintf( stderr, "char BAND(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 0xff;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0) ? 0xff : 0xf0;
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    rc = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_SIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (scoutbuf[0] != (signed char)0xff) {
+               errs++;
+               fprintf( stderr, "signed char BAND(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char BAND(0) test failed\n" );
+           }
+           if (scoutbuf[2] != (signed char)0xf0 && size > 1) {
+               errs++;
+               fprintf( stderr, "signed char BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 0xff;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0) ? 0xff : 0xf0;
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    rc = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_UNSIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ucoutbuf[0] != 0xff) {
+               errs++;
+               fprintf( stderr, "unsigned char BAND(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char BAND(0) test failed\n" );
+           }
+           if (ucoutbuf[2] != 0xf0 && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned char BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* bytes */
+    MTestPrintfMsg( 10, "Reduce of MPI_BYTE\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0xff : 0xf0;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_BYTE, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_BYTE", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != (char)0xff) {
+               errs++;
+               fprintf( stderr, "byte BAND(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "byte BAND(0) test failed\n" );
+           }
+           if (coutbuf[2] != (char)0xf0 && size > 1) {
+               errs++;
+               fprintf( stderr, "byte BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* short */
+    MTestPrintfMsg( 10, "Reduce of MPI_SHORT\n" );
+    sinbuf[0] = 0xffff;
+    sinbuf[1] = 0;
+    sinbuf[2] = (rank > 0) ? 0xffff : 0xf0f0;
+
+    soutbuf[0] = 0;
+    soutbuf[1] = 1;
+    soutbuf[2] = 1;
+    rc = MPI_Reduce( sinbuf, soutbuf, 3, MPI_SHORT, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (soutbuf[0] != (short)0xffff) {
+               errs++;
+               fprintf( stderr, "short BAND(1) test failed\n" );
+           }
+           if (soutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BAND(0) test failed\n" );
+           }
+           if (soutbuf[2] != (short)0xf0f0 && size > 1) {
+               errs++;
+               fprintf( stderr, "short BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_SHORT\n" );
+    /* unsigned short */
+    usinbuf[0] = 0xffff;
+    usinbuf[1] = 0;
+    usinbuf[2] = (rank > 0) ? 0xffff : 0xf0f0;
+
+    usoutbuf[0] = 0;
+    usoutbuf[1] = 1;
+    usoutbuf[2] = 1;
+    rc = MPI_Reduce( usinbuf, usoutbuf, 3, MPI_UNSIGNED_SHORT, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_UNSIGNED_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (usoutbuf[0] != 0xffff) {
+               errs++;
+               fprintf( stderr, "short BAND(1) test failed\n" );
+           }
+           if (usoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BAND(0) test failed\n" );
+           }
+           if (usoutbuf[2] != 0xf0f0 && size > 1) {
+               errs++;
+               fprintf( stderr, "short BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED\n" );
+    uinbuf[0] = 0xffffffff;
+    uinbuf[1] = 0;
+    uinbuf[2] = (rank > 0) ? 0xffffffff : 0xf0f0f0f0;
+
+    uoutbuf[0] = 0;
+    uoutbuf[1] = 1;
+    uoutbuf[2] = 1;
+    rc = MPI_Reduce( uinbuf, uoutbuf, 3, MPI_UNSIGNED, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_UNSIGNED", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uoutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "unsigned BAND(1) test failed\n" );
+           }
+           if (uoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned BAND(0) test failed\n" );
+           }
+           if (uoutbuf[2] != 0xf0f0f0f0 && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* long */
+    MTestPrintfMsg( 10, "Reduce of MPI_LONG\n" );
+    linbuf[0] = 0xffffffff;
+    linbuf[1] = 0;
+    linbuf[2] = (rank > 0) ? 0xffffffff : 0xf0f0f0f0;
+
+    loutbuf[0] = 0;
+    loutbuf[1] = 1;
+    loutbuf[2] = 1;
+    rc = MPI_Reduce( linbuf, loutbuf, 3, MPI_LONG, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (loutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "long BAND(1) test failed\n" );
+           }
+           if (loutbuf[1]) {
+               errs++;
+               fprintf( stderr, "long BAND(0) test failed\n" );
+           }
+           if (loutbuf[2] != 0xf0f0f0f0 && size > 1) {
+               errs++;
+               fprintf( stderr, "long BAND(>) test failed\n" );
+           }
+       }
+    }
+
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_LONG\n" );
+    /* unsigned long */
+    ulinbuf[0] = 0xffffffff;
+    ulinbuf[1] = 0;
+    ulinbuf[2] = (rank > 0) ? 0xffffffff : 0xf0f0f0f0;
+
+    uloutbuf[0] = 0;
+    uloutbuf[1] = 1;
+    uloutbuf[2] = 1;
+    rc = MPI_Reduce( ulinbuf, uloutbuf, 3, MPI_UNSIGNED_LONG, MPI_BAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BAND and MPI_UNSIGNED_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uloutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "unsigned long BAND(1) test failed\n" );
+           }
+           if (uloutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned long BAND(0) test failed\n" );
+           }
+           if (uloutbuf[2] != 0xf0f0f0f0 && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned long BAND(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 0xffffffff;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0) ? 0xffffffff : 0xf0f0f0f0;
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       rc = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_BAND, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_BAND and MPI_LONG_LONG", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (lloutbuf[0] != 0xffffffff) {
+                   errs++;
+                   fprintf( stderr, "long long BAND(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long BAND(0) test failed\n" );
+               }
+               if (lloutbuf[2] != 0xf0f0f0f0 && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long long BAND(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opbor.c b/teshsuite/smpi/mpich3-test/coll/opbor.c
new file mode 100644 (file)
index 0000000..7c4e5d6
--- /dev/null
@@ -0,0 +1,402 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_BOR operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    short sinbuf[3], soutbuf[3];
+    unsigned short usinbuf[3], usoutbuf[3];
+    long linbuf[3], loutbuf[3];
+    unsigned long ulinbuf[3], uloutbuf[3];
+    unsigned uinbuf[3], uoutbuf[3];
+    int iinbuf[3], ioutbuf[3];
+    
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != (char)0xff) {
+               errs++;
+               fprintf( stderr, "char BOR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char BOR(0) test failed\n" );
+           }
+           if (coutbuf[2] != (char)0xff && size > 1) {
+               errs++;
+               fprintf( stderr, "char BOR(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 0xff;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    rc = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_SIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (scoutbuf[0] != (signed char)0xff) {
+               errs++;
+               fprintf( stderr, "signed char BOR(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char BOR(0) test failed\n" );
+           }
+           if (scoutbuf[2] != (signed char)0xff && size > 1) {
+               errs++;
+               fprintf( stderr, "signed char BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 0xff;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    rc = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_UNSIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ucoutbuf[0] != 0xff) {
+               errs++;
+               fprintf( stderr, "unsigned char BOR(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char BOR(0) test failed\n" );
+           }
+           if (ucoutbuf[2] != 0xff && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned char BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* bytes */
+    MTestPrintfMsg( 10, "Reduce of MPI_BYTE\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_BYTE, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_BYTE", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != (char)0xff) {
+               errs++;
+               fprintf( stderr, "byte BOR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "byte BOR(0) test failed\n" );
+           }
+           if (coutbuf[2] != (char)0xff && size > 1) {
+               errs++;
+               fprintf( stderr, "byte BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* short */
+    MTestPrintfMsg( 10, "Reduce of MPI_SHORT\n" );
+    sinbuf[0] = 0xffff;
+    sinbuf[1] = 0;
+    sinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
+
+    soutbuf[0] = 0;
+    soutbuf[1] = 1;
+    soutbuf[2] = 1;
+    rc = MPI_Reduce( sinbuf, soutbuf, 3, MPI_SHORT, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (soutbuf[0] != (short)0xffff) {
+               errs++;
+               fprintf( stderr, "short BOR(1) test failed\n" );
+           }
+           if (soutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BOR(0) test failed\n" );
+           }
+           if (soutbuf[2] != (short)0xffff && size > 1) {
+               errs++;
+               fprintf( stderr, "short BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned short */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_SHORT\n" );
+    usinbuf[0] = 0xffff;
+    usinbuf[1] = 0;
+    usinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
+
+    usoutbuf[0] = 0;
+    usoutbuf[1] = 1;
+    usoutbuf[2] = 1;
+    rc = MPI_Reduce( usinbuf, usoutbuf, 3, MPI_UNSIGNED_SHORT, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_UNSIGNED_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (usoutbuf[0] != 0xffff) {
+               errs++;
+               fprintf( stderr, "short BOR(1) test failed\n" );
+           }
+           if (usoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BOR(0) test failed\n" );
+           }
+           if (usoutbuf[2] != 0xffff && size > 1) {
+               errs++;
+               fprintf( stderr, "short BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED\n" );
+    uinbuf[0] = 0xffffffff;
+    uinbuf[1] = 0;
+    uinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    uoutbuf[0] = 0;
+    uoutbuf[1] = 1;
+    uoutbuf[2] = 1;
+    rc = MPI_Reduce( uinbuf, uoutbuf, 3, MPI_UNSIGNED, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_UNSIGNED", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uoutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "unsigned BOR(1) test failed\n" );
+           }
+           if (uoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned BOR(0) test failed\n" );
+           }
+           if (uoutbuf[2] != 0xffffffff && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* int */
+    MTestPrintfMsg( 10, "Reduce of MPI_INT\n" );
+    iinbuf[0] = 0xffffffff;
+    iinbuf[1] = 0;
+    iinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    ioutbuf[0] = 0;
+    ioutbuf[1] = 1;
+    ioutbuf[2] = 1;
+    rc = MPI_Reduce( iinbuf, ioutbuf, 3, MPI_INT, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_INT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ioutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "int BOR(1) test failed\n" );
+           }
+           if (ioutbuf[1]) {
+               errs++;
+               fprintf( stderr, "int BOR(0) test failed\n" );
+           }
+           if (ioutbuf[2] != 0xffffffff && size > 1) {
+               errs++;
+               fprintf( stderr, "int BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* long */
+    MTestPrintfMsg( 10, "Reduce of MPI_LONG\n" );
+    linbuf[0] = 0xffffffff;
+    linbuf[1] = 0;
+    linbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    loutbuf[0] = 0;
+    loutbuf[1] = 1;
+    loutbuf[2] = 1;
+    rc = MPI_Reduce( linbuf, loutbuf, 3, MPI_LONG, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (loutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "long BOR(1) test failed\n" );
+           }
+           if (loutbuf[1]) {
+               errs++;
+               fprintf( stderr, "long BOR(0) test failed\n" );
+           }
+           if (loutbuf[2] != 0xffffffff && size > 1) {
+               errs++;
+               fprintf( stderr, "long BOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned long */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_LONG\n" );
+    ulinbuf[0] = 0xffffffff;
+    ulinbuf[1] = 0;
+    ulinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    uloutbuf[0] = 0;
+    uloutbuf[1] = 1;
+    uloutbuf[2] = 1;
+    rc = MPI_Reduce( ulinbuf, uloutbuf, 3, MPI_UNSIGNED_LONG, MPI_BOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BOR and MPI_UNSIGNED_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uloutbuf[0] != 0xffffffff) {
+               errs++;
+               fprintf( stderr, "unsigned long BOR(1) test failed\n" );
+           }
+           if (uloutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned long BOR(0) test failed\n" );
+           }
+           if (uloutbuf[2] != 0xffffffff && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned long BOR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 0xffffffff;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       rc = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_BOR, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_BOR and MPI_LONG_LONG", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (lloutbuf[0] != 0xffffffff) {
+                   errs++;
+                   fprintf( stderr, "long long BOR(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long BOR(0) test failed\n" );
+               }
+               if (lloutbuf[2] != 0xffffffff && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long long BOR(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opbxor.c b/teshsuite/smpi/mpich3-test/coll/opbxor.c
new file mode 100644 (file)
index 0000000..6673561
--- /dev/null
@@ -0,0 +1,402 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_BXOR operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    short sinbuf[3], soutbuf[3];
+    unsigned short usinbuf[3], usoutbuf[3];
+    long linbuf[3], loutbuf[3];
+    unsigned long ulinbuf[3], uloutbuf[3];
+    unsigned uinbuf[3], uoutbuf[3];
+    int iinbuf[3], ioutbuf[3];
+    
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    coutbuf[0] = 0xf;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != ((size % 2) ? (char)0xff : (char)0) ) {
+               errs++;
+               fprintf( stderr, "char BXOR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char BXOR(0) test failed\n" );
+           }
+           if (coutbuf[2] != ((size % 2) ? (char)0xc3 : (char)0xff)) {
+               errs++;
+               fprintf( stderr, "char BXOR(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 0xff;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    scoutbuf[0] = 0xf;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    rc = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_SIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (scoutbuf[0] != ((size % 2) ? (signed char)0xff : (signed char)0) ) {
+               errs++;
+               fprintf( stderr, "signed char BXOR(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char BXOR(0) test failed\n" );
+           }
+           if (scoutbuf[2] != ((size % 2) ? (signed char)0xc3 : (signed char)0xff)) {
+               errs++;
+               fprintf( stderr, "signed char BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 0xff;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    rc = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_UNSIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ucoutbuf[0] != ((size % 2) ? 0xff : 0)) {
+               errs++;
+               fprintf( stderr, "unsigned char BXOR(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char BXOR(0) test failed\n" );
+           }
+           if (ucoutbuf[2] != ((size % 2) ? (unsigned char)0xc3 : (unsigned char)0xff)) {
+               errs++;
+               fprintf( stderr, "unsigned char BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* bytes */
+    MTestPrintfMsg( 10, "Reduce of MPI_BYTE\n" );
+    cinbuf[0] = 0xff;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0) ? 0x3c : 0xc3;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_BYTE, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_BYTE", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != ((size % 2) ? (char)0xff : 0)) {
+               errs++;
+               fprintf( stderr, "byte BXOR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "byte BXOR(0) test failed\n" );
+           }
+           if (coutbuf[2] != ((size % 2) ? (char)0xc3 : (char)0xff)) {
+               errs++;
+               fprintf( stderr, "byte BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* short */
+    MTestPrintfMsg( 10, "Reduce of MPI_SHORT\n" );
+    sinbuf[0] = 0xffff;
+    sinbuf[1] = 0;
+    sinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
+
+    soutbuf[0] = 0;
+    soutbuf[1] = 1;
+    soutbuf[2] = 1;
+    rc = MPI_Reduce( sinbuf, soutbuf, 3, MPI_SHORT, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (soutbuf[0] != ((size % 2) ? (short)0xffff : 0)) {
+               errs++;
+               fprintf( stderr, "short BXOR(1) test failed\n" );
+           }
+           if (soutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BXOR(0) test failed\n" );
+           }
+           if (soutbuf[2] != ((size % 2) ? (short)0xc3c3 : (short)0xffff)) {
+               errs++;
+               fprintf( stderr, "short BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned short */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_SHORT\n" );
+    usinbuf[0] = 0xffff;
+    usinbuf[1] = 0;
+    usinbuf[2] = (rank > 0) ? 0x3c3c : 0xc3c3;
+
+    usoutbuf[0] = 0;
+    usoutbuf[1] = 1;
+    usoutbuf[2] = 1;
+    rc = MPI_Reduce( usinbuf, usoutbuf, 3, MPI_UNSIGNED_SHORT, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_UNSIGNED_SHORT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (usoutbuf[0] != ((size % 2) ? 0xffff : 0)) {
+               errs++;
+               fprintf( stderr, "short BXOR(1) test failed\n" );
+           }
+           if (usoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "short BXOR(0) test failed\n" );
+           }
+           if (usoutbuf[2] != ((size % 2) ? 0xc3c3 : 0xffff)) {
+               errs++;
+               fprintf( stderr, "short BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED\n" );
+    uinbuf[0] = 0xffffffff;
+    uinbuf[1] = 0;
+    uinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    uoutbuf[0] = 0;
+    uoutbuf[1] = 1;
+    uoutbuf[2] = 1;
+    rc = MPI_Reduce( uinbuf, uoutbuf, 3, MPI_UNSIGNED, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_UNSIGNED", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uoutbuf[0] != ((size % 2) ? 0xffffffff : 0)) {
+               errs++;
+               fprintf( stderr, "unsigned BXOR(1) test failed\n" );
+           }
+           if (uoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned BXOR(0) test failed\n" );
+           }
+           if (uoutbuf[2] != ((size % 2) ? 0xc3c3c3c3 : 0xffffffff)) {
+               errs++;
+               fprintf( stderr, "unsigned BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* int */
+    MTestPrintfMsg( 10, "Reduce of MPI_INT\n" );
+    iinbuf[0] = 0xffffffff;
+    iinbuf[1] = 0;
+    iinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    ioutbuf[0] = 0;
+    ioutbuf[1] = 1;
+    ioutbuf[2] = 1;
+    rc = MPI_Reduce( iinbuf, ioutbuf, 3, MPI_INT, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_INT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ioutbuf[0] != ((size % 2) ? 0xffffffff : 0)) {
+               errs++;
+               fprintf( stderr, "int BXOR(1) test failed\n" );
+           }
+           if (ioutbuf[1]) {
+               errs++;
+               fprintf( stderr, "int BXOR(0) test failed\n" );
+           }
+           if (ioutbuf[2] != ((size % 2) ? 0xc3c3c3c3 : 0xffffffff)) {
+               errs++;
+               fprintf( stderr, "int BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* long */
+    MTestPrintfMsg( 10, "Reduce of MPI_LONG\n" );
+    linbuf[0] = 0xffffffff;
+    linbuf[1] = 0;
+    linbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    loutbuf[0] = 0;
+    loutbuf[1] = 1;
+    loutbuf[2] = 1;
+    rc = MPI_Reduce( linbuf, loutbuf, 3, MPI_LONG, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (loutbuf[0] != ((size % 2) ? 0xffffffff : 0)) {
+               errs++;
+               fprintf( stderr, "long BXOR(1) test failed\n" );
+           }
+           if (loutbuf[1]) {
+               errs++;
+               fprintf( stderr, "long BXOR(0) test failed\n" );
+           }
+           if (loutbuf[2] != ((size % 2) ? 0xc3c3c3c3 : 0xffffffff)) {
+               errs++;
+               fprintf( stderr, "long BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned long */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_LONG\n" );
+    ulinbuf[0] = 0xffffffff;
+    ulinbuf[1] = 0;
+    ulinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    uloutbuf[0] = 0;
+    uloutbuf[1] = 1;
+    uloutbuf[2] = 1;
+    rc = MPI_Reduce( ulinbuf, uloutbuf, 3, MPI_UNSIGNED_LONG, MPI_BXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_BXOR and MPI_UNSIGNED_LONG", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (uloutbuf[0] != ((size % 2) ? 0xffffffff : 0)) {
+               errs++;
+               fprintf( stderr, "unsigned long BXOR(1) test failed\n" );
+           }
+           if (uloutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned long BXOR(0) test failed\n" );
+           }
+           if (uloutbuf[2] != ((size % 2) ? 0xc3c3c3c3 : 0xffffffff)) {
+               errs++;
+               fprintf( stderr, "unsigned long BXOR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 0xffffffff;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0) ? 0x3c3c3c3c : 0xc3c3c3c3;
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       rc = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_BXOR, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_BXOR and MPI_LONG_LONG", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (lloutbuf[0] != ((size % 2) ? 0xffffffff : 0)) {
+                   errs++;
+                   fprintf( stderr, "long long BXOR(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long BXOR(0) test failed\n" );
+               }
+               if (lloutbuf[2] != ((size % 2) ? 0xc3c3c3c3 : 0xffffffff)) {
+                   errs++;
+                   fprintf( stderr, "long long BXOR(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opland.c b/teshsuite/smpi/mpich3-test/coll/opland.c
new file mode 100644 (file)
index 0000000..ad32a75
--- /dev/null
@@ -0,0 +1,283 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_LAND operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    float finbuf[3], foutbuf[3];
+    double dinbuf[3], doutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_LAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LAND and MPI_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (!coutbuf[0]) {
+               errs++;
+               fprintf( stderr, "char AND(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char AND(0) test failed\n" );
+           }
+           if (coutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "char AND(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    rc = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_LAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LAND and MPI_SIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (!scoutbuf[0]) {
+               errs++;
+               fprintf( stderr, "signed char AND(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char AND(0) test failed\n" );
+           }
+           if (scoutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "signed char AND(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    rc = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_LAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LAND and MPI_UNSIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (!ucoutbuf[0]) {
+               errs++;
+               fprintf( stderr, "unsigned char AND(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char AND(0) test failed\n" );
+           }
+           if (ucoutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned char AND(>) test failed\n" );
+           }
+       }
+    }
+
+#ifndef USE_STRICT_MPI
+    /* float */
+    MTestPrintfMsg( 10, "Reduce of MPI_FLOAT\n" );
+    finbuf[0] = 1;
+    finbuf[1] = 0;
+    finbuf[2] = (rank > 0);
+
+    foutbuf[0] = 0;
+    foutbuf[1] = 1;
+    foutbuf[2] = 1;
+    rc = MPI_Reduce( finbuf, foutbuf, 3, MPI_FLOAT, MPI_LAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LAND and MPI_FLOAT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (!foutbuf[0]) {
+               errs++;
+               fprintf( stderr, "float AND(1) test failed\n" );
+           }
+           if (foutbuf[1]) {
+               errs++;
+               fprintf( stderr, "float AND(0) test failed\n" );
+           }
+           if (foutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "float AND(>) test failed\n" );
+           }
+       }
+    }
+
+    MTestPrintfMsg( 10, "Reduce of MPI_DOUBLE\n" );
+    /* double */
+    dinbuf[0] = 1;
+    dinbuf[1] = 0;
+    dinbuf[2] = (rank > 0);
+
+    doutbuf[0] = 0;
+    doutbuf[1] = 1;
+    doutbuf[2] = 1;
+    rc = MPI_Reduce( dinbuf, doutbuf, 3, MPI_DOUBLE, MPI_LAND, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LAND and MPI_DOUBLE", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (!doutbuf[0]) {
+               errs++;
+               fprintf( stderr, "double AND(1) test failed\n" );
+           }
+           if (doutbuf[1]) {
+               errs++;
+               fprintf( stderr, "double AND(0) test failed\n" );
+           }
+           if (doutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "double AND(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = (rank > 0);
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       rc = MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_LAND, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_LAND and MPI_LONG_DOUBLE", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (!ldoutbuf[0]) {
+                   errs++;
+                   fprintf( stderr, "long double AND(1) test failed\n" );
+               }
+               if (ldoutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long double AND(0) test failed\n" );
+               }
+               if (ldoutbuf[2] && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long double AND(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+#endif /* USE_STRICT_MPI */
+
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0);
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       rc = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_LAND, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_LAND and MPI_LONG_LONG", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (!lloutbuf[0]) {
+                   errs++;
+                   fprintf( stderr, "long long AND(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long AND(0) test failed\n" );
+               }
+               if (lloutbuf[2] && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long long AND(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/oplor.c b/teshsuite/smpi/mpich3-test/coll/oplor.c
new file mode 100644 (file)
index 0000000..a168d35
--- /dev/null
@@ -0,0 +1,284 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_LOR operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    float finbuf[3], foutbuf[3];
+    double dinbuf[3], doutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* Some MPI implementations do not implement all of the required
+       (datatype,operations) combinations, and further, they do not
+       always provide clear and specific error messages.  By catching 
+       the error, we can provide a higher quality, more specific message.
+    */
+    MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    err = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_LOR, 0, comm );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "MPI_LOR and MPI_CHAR", err );
+    }
+    else {
+       if (rank == 0) {
+           if (!coutbuf[0]) {
+               errs++;
+               fprintf( stderr, "char OR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char OR(0) test failed\n" );
+           }
+           if (!coutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "char OR(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    err = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_LOR, 0, comm );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "MPI_LOR and MPI_SIGNED_CHAR", err );
+    }
+    else {
+       if (rank == 0) {
+           if (!scoutbuf[0]) {
+               errs++;
+               fprintf( stderr, "signed char OR(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char OR(0) test failed\n" );
+           }
+           if (!scoutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "signed char OR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    err = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_LOR, 0, comm );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "MPI_LOR and MPI_UNSIGNED_CHAR", err );
+    }
+    else {
+       if (rank == 0) {
+           if (!ucoutbuf[0]) {
+               errs++;
+               fprintf( stderr, "unsigned char OR(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char OR(0) test failed\n" );
+           }
+           if (!ucoutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned char OR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifndef USE_STRICT_MPI
+    /* float */
+    MTestPrintfMsg( 10, "Reduce of MPI_FLOAT\n" );
+    finbuf[0] = 1;
+    finbuf[1] = 0;
+    finbuf[2] = (rank > 0);
+
+    foutbuf[0] = 0;
+    foutbuf[1] = 1;
+    foutbuf[2] = 1;
+    err = MPI_Reduce( finbuf, foutbuf, 3, MPI_FLOAT, MPI_LOR, 0, comm );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "MPI_LOR and MPI_FLOAT", err );
+    }
+    else {
+       if (rank == 0) {
+           if (!foutbuf[0]) {
+               errs++;
+               fprintf( stderr, "float OR(1) test failed\n" );
+           }
+           if (foutbuf[1]) {
+               errs++;
+               fprintf( stderr, "float OR(0) test failed\n" );
+           }
+           if (!foutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "float OR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* double */
+    MTestPrintfMsg( 10, "Reduce of MPI_DOUBLE\n" );
+    dinbuf[0] = 1;
+    dinbuf[1] = 0;
+    dinbuf[2] = (rank > 0);
+
+    doutbuf[0] = 0;
+    doutbuf[1] = 1;
+    doutbuf[2] = 1;
+    err = MPI_Reduce( dinbuf, doutbuf, 3, MPI_DOUBLE, MPI_LOR, 0, comm );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "MPI_LOR and MPI_DOUBLE", err );
+    }
+    else {
+       if (rank == 0) {
+           if (!doutbuf[0]) {
+               errs++;
+               fprintf( stderr, "double OR(1) test failed\n" );
+           }
+           if (doutbuf[1]) {
+               errs++;
+               fprintf( stderr, "double OR(0) test failed\n" );
+           }
+           if (!doutbuf[2] && size > 1) {
+               errs++;
+               fprintf( stderr, "double OR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = (rank > 0);
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       err = MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_LOR, 0, comm );
+       if (err) {
+           errs++;
+           MTestPrintErrorMsg( "MPI_LOR and MPI_LONG_DOUBLE", err );
+       }
+       else {
+           if (rank == 0) {
+               if (!ldoutbuf[0]) {
+                   errs++;
+                   fprintf( stderr, "long double OR(1) test failed\n" );
+               }
+               if (ldoutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long double OR(0) test failed\n" );
+               }
+               if (!ldoutbuf[2] && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long double OR(>) test failed\n" );
+               }
+           }
+       }
+       }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+#endif /* USE_STRICT_MPI */
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0);
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       err = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_LOR, 0, comm );
+       if (err) {
+           errs++;
+           MTestPrintErrorMsg( "MPI_LOR and MPI_LONG_LONG", err );
+       }
+       else {
+           if (rank == 0) {
+               if (!lloutbuf[0]) {
+                   errs++;
+                   fprintf( stderr, "long long OR(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long OR(0) test failed\n" );
+               }
+               if (!lloutbuf[2] && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long long OR(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/oplxor.c b/teshsuite/smpi/mpich3-test/coll/oplxor.c
new file mode 100644 (file)
index 0000000..e55970d
--- /dev/null
@@ -0,0 +1,281 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_LXOR operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    float finbuf[3], foutbuf[3];
+    double dinbuf[3], doutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Set errors return so that we can provide better information 
+       should a routine reject one of the operand/datatype pairs */
+    MPI_Errhandler_set( comm, MPI_ERRORS_RETURN );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    rc = MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_LXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LXOR and MPI_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (coutbuf[0] != (size % 2)) {
+               errs++;
+               fprintf( stderr, "char XOR(1) test failed\n" );
+           }
+           if (coutbuf[1]) {
+               errs++;
+               fprintf( stderr, "char XOR(0) test failed\n" );
+           }
+           if (coutbuf[2] == (size % 2) && size > 1) {
+               errs++;
+               fprintf( stderr, "char XOR(>) test failed\n" );
+           }
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    rc = MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_LXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LXOR and MPI_SIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (scoutbuf[0] != (size % 2)) {
+               errs++;
+               fprintf( stderr, "signed char XOR(1) test failed\n" );
+           }
+           if (scoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "signed char XOR(0) test failed\n" );
+           }
+           if (scoutbuf[2] == (size % 2) && size > 1) {
+               errs++;
+               fprintf( stderr, "signed char XOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    rc = MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_LXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LXOR and MPI_UNSIGNED_CHAR", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (ucoutbuf[0] != (size % 2)) {
+               errs++;
+               fprintf( stderr, "unsigned char XOR(1) test failed\n" );
+           }
+           if (ucoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "unsigned char XOR(0) test failed\n" );
+           }
+           if (ucoutbuf[2] == (size % 2) && size > 1) {
+               errs++;
+               fprintf( stderr, "unsigned char XOR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifndef USE_STRICT_MPI
+    /* float */
+    MTestPrintfMsg( 10, "Reduce of MPI_FLOAT\n" );
+    finbuf[0] = 1;
+    finbuf[1] = 0;
+    finbuf[2] = (rank > 0);
+
+    foutbuf[0] = 0;
+    foutbuf[1] = 1;
+    foutbuf[2] = 1;
+    rc = MPI_Reduce( finbuf, foutbuf, 3, MPI_FLOAT, MPI_LXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LXOR and MPI_FLOAT", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (foutbuf[0] != (size % 2)) {
+               errs++;
+               fprintf( stderr, "float XOR(1) test failed\n" );
+           }
+           if (foutbuf[1]) {
+               errs++;
+               fprintf( stderr, "float XOR(0) test failed\n" );
+           }
+           if (foutbuf[2] == (size % 2) && size > 1) {
+               errs++;
+               fprintf( stderr, "float XOR(>) test failed\n" );
+           }
+       }
+    }
+
+    /* double */
+    MTestPrintfMsg( 10, "Reduce of MPI_DOUBLE\n" );
+    dinbuf[0] = 1;
+    dinbuf[1] = 0;
+    dinbuf[2] = (rank > 0);
+
+    doutbuf[0] = 0;
+    doutbuf[1] = 1;
+    doutbuf[2] = 1;
+    rc = MPI_Reduce( dinbuf, doutbuf, 3, MPI_DOUBLE, MPI_LXOR, 0, comm );
+    if (rc) {
+       MTestPrintErrorMsg( "MPI_LXOR and MPI_DOUBLE", rc );
+       errs++;
+    }
+    else {
+       if (rank == 0) {
+           if (doutbuf[0] != (size % 2)) {
+               errs++;
+               fprintf( stderr, "double XOR(1) test failed\n" );
+           }
+           if (doutbuf[1]) {
+               errs++;
+               fprintf( stderr, "double XOR(0) test failed\n" );
+           }
+           if (doutbuf[2] == (size % 2) && size > 1) {
+               errs++;
+               fprintf( stderr, "double XOR(>) test failed\n" );
+           }
+       }
+    }
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = (rank > 0);
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       rc = MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_LXOR, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_LXOR and MPI_LONG_DOUBLE", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (ldoutbuf[0] != (size % 2)) {
+                   errs++;
+                   fprintf( stderr, "long double XOR(1) test failed\n" );
+               }
+               if (ldoutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long double XOR(0) test failed\n" );
+               }
+               if (ldoutbuf[2] == (size % 2) && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long double XOR(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+#endif /* USE_STRICT_MPI */
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0);
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       rc = MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_LXOR, 0, comm );
+       if (rc) {
+           MTestPrintErrorMsg( "MPI_LXOR and MPI_LONG_LONG", rc );
+           errs++;
+       }
+       else {
+           if (rank == 0) {
+               if (lloutbuf[0] != (size % 2)) {
+                   errs++;
+                   fprintf( stderr, "long long XOR(1) test failed\n" );
+               }
+               if (lloutbuf[1]) {
+                   errs++;
+                   fprintf( stderr, "long long XOR(0) test failed\n" );
+               }
+               if (lloutbuf[2] == (size % 2) && size > 1) {
+                   errs++;
+                   fprintf( stderr, "long long XOR(>) test failed\n" );
+               }
+           }
+       }
+    }
+    }
+#endif
+
+    MPI_Errhandler_set( comm, MPI_ERRORS_ARE_FATAL );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opmax.c b/teshsuite/smpi/mpich3-test/coll/opmax.c
new file mode 100644 (file)
index 0000000..1c9c1ff
--- /dev/null
@@ -0,0 +1,180 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_MAX operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of char and types that  are not required 
+ * integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = rank;
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_MAX, 0, comm );
+    if (rank == 0) {
+       if (coutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "char MAX(1) test failed\n" );
+       }
+       if (coutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "char MAX(0) test failed\n" );
+       }
+       if (size < 128 && coutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "char MAX(>) test failed\n" );
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = rank;
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_MAX, 0, comm );
+    if (rank == 0) {
+       if (scoutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "signed char MAX(1) test failed\n" );
+       }
+       if (scoutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "signed char MAX(0) test failed\n" );
+       }
+       if (size < 128 && scoutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "signed char MAX(>) test failed\n" );
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = rank;
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_MAX, 0, comm );
+    if (rank == 0) {
+       if (ucoutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "unsigned char MAX(1) test failed\n" );
+       }
+       if (ucoutbuf[1]) {
+           errs++;
+           fprintf( stderr, "unsigned char MAX(0) test failed\n" );
+       }
+       if (size < 256 && ucoutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "unsigned char MAX(>) test failed\n" );
+       }
+    }
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = rank;
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_MAX, 0, comm );
+       if (rank == 0) {
+           if (ldoutbuf[0] != 1) {
+               errs++;
+               fprintf( stderr, "long double MAX(1) test failed\n" );
+           }
+           if (ldoutbuf[1] != 0.0) {
+               errs++;
+               fprintf( stderr, "long double MAX(0) test failed\n" );
+           }
+           if (ldoutbuf[2] != size - 1) {
+               errs++;
+               fprintf( stderr, "long double MAX(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = rank;
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_MAX, 0, comm );
+       if (rank == 0) {
+           if (lloutbuf[0] != 1) {
+               errs++;
+               fprintf( stderr, "long long MAX(1) test failed\n" );
+           }
+           if (lloutbuf[1] != 0) {
+               errs++;
+               fprintf( stderr, "long long MAX(0) test failed\n" );
+           }
+           if (lloutbuf[2] != size - 1) {
+               errs++;
+               fprintf( stderr, "long long MAX(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_LONG */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opmaxloc.c b/teshsuite/smpi/mpich3-test/coll/opmaxloc.c
new file mode 100644 (file)
index 0000000..9ea01f6
--- /dev/null
@@ -0,0 +1,286 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_MAXLOC operations on datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of char and types that  are not required 
+ * integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ *
+ * The rule on max loc is that if there is a tie in the value, the minimum
+ * rank is used (see 4.9.3 in the MPI-1 standard)
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* 2 int */
+    {
+       struct twoint { int val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_2INT, MPI_MAXLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "2int MAXLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0) {
+               errs++;
+               fprintf( stderr, "2int MAXLOC(0) test failed, value = %d, should be zero\n", coutbuf[1].val );
+           }
+           if (coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "2int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+           }
+           if (coutbuf[2].val != size-1 || coutbuf[2].loc != size-1) {
+               errs++;
+               fprintf( stderr, "2int MAXLOC(>) test failed\n" );
+           }
+       }
+    }
+
+    /* float int */
+    {
+       struct floatint { float val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = (float)rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_FLOAT_INT, MPI_MAXLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "float-int MAXLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0) {
+               errs++;
+               fprintf( stderr, "float-int MAXLOC(0) test failed, value = %f, should be zero\n", coutbuf[1].val );
+           }
+           if (coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "float-int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+           }
+           if (coutbuf[2].val != size-1 || coutbuf[2].loc != size-1) {
+               errs++;
+               fprintf( stderr, "float-int MAXLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+    /* long int */
+    {
+       struct longint { long val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_LONG_INT, MPI_MAXLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "long-int MAXLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0) {
+               errs++;
+               fprintf( stderr, "long-int MAXLOC(0) test failed, value = %ld, should be zero\n", coutbuf[1].val );
+           }
+           if (coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "long-int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+           }
+           if (coutbuf[2].val != size-1 || coutbuf[2].loc != size-1) {
+               errs++;
+               fprintf( stderr, "long-int MAXLOC(>) test failed\n" );
+           }
+       }
+    }
+
+    /* short int */
+    {
+       struct shortint { short val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_SHORT_INT, MPI_MAXLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "short-int MAXLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0) {
+               errs++;
+               fprintf( stderr, "short-int MAXLOC(0) test failed, value = %d, should be zero\n", coutbuf[1].val );
+           }
+           if (coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "short-int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+           }
+           if (coutbuf[2].val != size-1) {
+               errs++;
+               fprintf( stderr, "short-int MAXLOC(>) test failed, value = %d, should be %d\n", coutbuf[2].val, size-1 );
+           }
+           if (coutbuf[2].loc != size -1) {
+               errs++;
+               fprintf( stderr, "short-int MAXLOC(>) test failed, location of max = %d, should be %d\n", coutbuf[2].loc, size-1 );
+           }
+       }
+    }
+    
+    /* double int */
+    {
+       struct doubleint { double val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_DOUBLE_INT, MPI_MAXLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "double-int MAXLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0) {
+               errs++;
+               fprintf( stderr, "double-int MAXLOC(0) test failed, value = %f, should be zero\n", coutbuf[1].val );
+           }
+           if (coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "double-int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+           }
+           if (coutbuf[2].val != size-1 || coutbuf[2].loc != size-1) {
+               errs++;
+               fprintf( stderr, "double-int MAXLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+#ifdef HAVE_LONG_DOUBLE
+    /* long double int */
+    {
+       struct longdoubleint { long double val; int loc; } cinbuf[3], coutbuf[3];
+
+        /* avoid valgrind warnings about padding bytes in the long double */
+        memset(&cinbuf[0], 0, sizeof(cinbuf));
+        memset(&coutbuf[0], 0, sizeof(coutbuf));
+
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+           MPI_Reduce( cinbuf, coutbuf, 3, MPI_LONG_DOUBLE_INT, MPI_MAXLOC, 
+                       0, comm );
+           if (rank == 0) {
+               if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MAXLOC(1) test failed\n" );
+               }
+               if (coutbuf[1].val != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MAXLOC(0) test failed, value = %f, should be zero\n", (double)coutbuf[1].val );
+               }
+               if (coutbuf[1].loc != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MAXLOC(0) test failed, location of max = %d, should be zero\n", coutbuf[1].loc );
+               }
+               if (coutbuf[2].val != size-1) {
+                   errs++;
+                   fprintf( stderr, "long double-int MAXLOC(>) test failed, value = %f, should be %d\n", (double)coutbuf[2].val, size-1 );
+               }
+               if (coutbuf[2].loc != size-1) {
+                   errs++;
+                   fprintf( stderr, "long double-int MAXLOC(>) test failed, location of max = %d, should be %d\n", coutbuf[2].loc, size-1 );
+               }
+           }
+       }
+    }
+#endif
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opmin.c b/teshsuite/smpi/mpich3-test/coll/opmin.c
new file mode 100644 (file)
index 0000000..59202da
--- /dev/null
@@ -0,0 +1,180 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_MIN operations on optional datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of char and types that  are not required 
+ * integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank & 0x7f);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_MIN, 0, comm );
+    if (rank == 0) {
+       if (coutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "char MIN(1) test failed\n" );
+       }
+       if (coutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "char MIN(0) test failed\n" );
+       }
+       if (coutbuf[2] != 0) {
+           errs++;
+           fprintf( stderr, "char MIN(>) test failed\n" );
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank & 0x7f);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_MIN, 0, comm );
+    if (rank == 0) {
+       if (scoutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "signed char MIN(1) test failed\n" );
+       }
+       if (scoutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "signed char MIN(0) test failed\n" );
+       }
+       if (scoutbuf[2] != 0) {
+           errs++;
+           fprintf( stderr, "signed char MIN(>) test failed\n" );
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank & 0x7f);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_MIN, 0, comm );
+    if (rank == 0) {
+       if (ucoutbuf[0] != 1) {
+           errs++;
+           fprintf( stderr, "unsigned char MIN(1) test failed\n" );
+       }
+       if (ucoutbuf[1]) {
+           errs++;
+           fprintf( stderr, "unsigned char MIN(0) test failed\n" );
+       }
+       if (ucoutbuf[2] != 0) {
+           errs++;
+           fprintf( stderr, "unsigned char MIN(>) test failed\n" );
+       }
+    }
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = rank;
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_MIN, 0, comm );
+       if (rank == 0) {
+           if (ldoutbuf[0] != 1) {
+               errs++;
+               fprintf( stderr, "long double MIN(1) test failed\n" );
+           }
+           if (ldoutbuf[1] != 0.0) {
+               errs++;
+               fprintf( stderr, "long double MIN(0) test failed\n" );
+           }
+           if (ldoutbuf[2] != 0.0) {
+               errs++;
+               fprintf( stderr, "long double MIN(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = rank;
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_MIN, 0, comm );
+       if (rank == 0) {
+           if (lloutbuf[0] != 1) {
+               errs++;
+               fprintf( stderr, "long long MIN(1) test failed\n" );
+           }
+           if (lloutbuf[1] != 0) {
+               errs++;
+               fprintf( stderr, "long long MIN(0) test failed\n" );
+           }
+           if (lloutbuf[2] != 0) {
+               errs++;
+               fprintf( stderr, "long long MIN(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_LONG */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opminloc.c b/teshsuite/smpi/mpich3-test/coll/opminloc.c
new file mode 100644 (file)
index 0000000..9eb84ee
--- /dev/null
@@ -0,0 +1,249 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_MINLOC operations on datatypes dupported by MPICH";
+*/
+
+/*
+ * This test looks at the handling of char and types that  are not required 
+ * integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ *
+ * The rule on min loc is that if there is a tie in the value, the minimum
+ * rank is used (see 4.9.3 in the MPI-1 standard)
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* 2 int */
+    {
+       struct twoint { int val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = (rank & 0x7f);
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_2INT, MPI_MINLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 && coutbuf[0].loc != -1) {
+               errs++;
+               fprintf( stderr, "2int MINLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0 && coutbuf[1].loc != -1) {
+               errs++;
+               fprintf( stderr, "2int MINLOC(0) test failed\n" );
+           }
+           if (coutbuf[2].val != 0 && coutbuf[2].loc != 0) {
+               errs++;
+               fprintf( stderr, "2int MINLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+    /* float int */
+    {
+       struct floatint { float val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = (float)rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_FLOAT_INT, MPI_MINLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 && coutbuf[0].loc != -1) {
+               errs++;
+               fprintf( stderr, "float-int MINLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0 && coutbuf[1].loc != -1) {
+               errs++;
+               fprintf( stderr, "float-int MINLOC(0) test failed\n" );
+           }
+           if (coutbuf[2].val != 0 && coutbuf[2].loc != 0) {
+               errs++;
+               fprintf( stderr, "float-int MINLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+    /* long int */
+    {
+       struct longint { long val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_LONG_INT, MPI_MINLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "long-int MINLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "long-int MINLOC(0) test failed\n" );
+           }
+           if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
+               errs++;
+               fprintf( stderr, "long-int MINLOC(>) test failed\n" );
+           }
+       }
+    }
+
+    /* short int */
+    {
+       struct shortint { short val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_SHORT_INT, MPI_MINLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "short-int MINLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "short-int MINLOC(0) test failed\n" );
+           }
+           if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
+               errs++;
+               fprintf( stderr, "short-int MINLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+    /* double int */
+    {
+       struct doubleint { double val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       MPI_Reduce( cinbuf, coutbuf, 3, MPI_DOUBLE_INT, MPI_MINLOC, 0, comm );
+       if (rank == 0) {
+           if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+               errs++;
+               fprintf( stderr, "double-int MINLOC(1) test failed\n" );
+           }
+           if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
+               errs++;
+               fprintf( stderr, "double-int MINLOC(0) test failed\n" );
+           }
+           if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
+               errs++;
+               fprintf( stderr, "double-int MINLOC(>) test failed\n" );
+           }
+       }
+    }
+    
+#ifdef HAVE_LONG_DOUBLE
+    /* long double int */
+    {
+       struct longdoubleint { long double val; int loc; } cinbuf[3], coutbuf[3];
+       
+       cinbuf[0].val = 1;
+       cinbuf[0].loc = rank;
+       cinbuf[1].val = 0;
+       cinbuf[1].loc = rank;
+       cinbuf[2].val = rank;
+       cinbuf[2].loc = rank;
+       
+       coutbuf[0].val = 0;
+       coutbuf[0].loc = -1;
+       coutbuf[1].val = 1;
+       coutbuf[1].loc = -1;
+       coutbuf[2].val = 1;
+       coutbuf[2].loc = -1;
+       if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+           MPI_Reduce( cinbuf, coutbuf, 3, MPI_LONG_DOUBLE_INT, MPI_MINLOC, 
+                       0, comm );
+           if (rank == 0) {
+               if (coutbuf[0].val != 1 || coutbuf[0].loc != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MINLOC(1) test failed\n" );
+               }
+               if (coutbuf[1].val != 0 || coutbuf[1].loc != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MINLOC(0) test failed\n" );
+               }
+               if (coutbuf[2].val != 0 || coutbuf[2].loc != 0) {
+                   errs++;
+                   fprintf( stderr, "long double-int MINLOC(>) test failed\n" );
+               }
+           }
+       }
+    }
+#endif
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opprod.c b/teshsuite/smpi/mpich3-test/coll/opprod.c
new file mode 100644 (file)
index 0000000..e96aae2
--- /dev/null
@@ -0,0 +1,289 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_PROD operations on optional datatypes dupported by MPICH";
+*/
+
+typedef struct { double r, i; } d_complex;
+#ifdef HAVE_LONG_DOUBLE
+typedef struct { long double r, i; } ld_complex;
+#endif
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, maxsize, result[6] = { 1, 1, 2, 6, 24, 120 };
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    d_complex dinbuf[3], doutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    if (size > 5) maxsize = 5;
+    else          maxsize = size;
+
+    /* General forumula: If we multiple the values from 1 to n, the 
+       product is n!.  This grows very fast, so we'll only use the first 
+       five (1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120), with n!
+       stored in the array result[n] */
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = (rank < maxsize && rank > 0) ? rank : 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 1);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_PROD, 0, comm );
+    if (rank == 0) {
+       if (coutbuf[0] != (char)result[maxsize-1]) {
+           errs++;
+           fprintf( stderr, "char PROD(rank) test failed (%d!=%d)\n",
+                    (int)coutbuf[0], (int)result[maxsize]);
+       }
+       if (coutbuf[1]) {
+           errs++;
+           fprintf( stderr, "char PROD(0) test failed\n" );
+       }
+       if (size > 1 && coutbuf[2]) {
+           errs++;
+           fprintf( stderr, "char PROD(>) test failed\n" );
+       }
+    }
+#endif /* USE_STRICT_MPI */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = (rank < maxsize && rank > 0) ? rank : 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 1);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_PROD, 0, comm );
+    if (rank == 0) {
+       if (scoutbuf[0] != (signed char)result[maxsize-1]) {
+           errs++;
+           fprintf( stderr, "signed char PROD(rank) test failed (%d!=%d)\n",
+                    (int)scoutbuf[0], (int)result[maxsize]);
+       }
+       if (scoutbuf[1]) {
+           errs++;
+           fprintf( stderr, "signed char PROD(0) test failed\n" );
+       }
+       if (size > 1 && scoutbuf[2]) {
+           errs++;
+           fprintf( stderr, "signed char PROD(>) test failed\n" );
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = (rank < maxsize && rank > 0) ? rank : 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_PROD, 0, comm );
+    if (rank == 0) {
+       if (ucoutbuf[0] != (unsigned char)result[maxsize-1]) {
+           errs++;
+           fprintf( stderr, "unsigned char PROD(rank) test failed\n" );
+       }
+       if (ucoutbuf[1]) {
+           errs++;
+           fprintf( stderr, "unsigned char PROD(0) test failed\n" );
+       }
+       if (size > 1 && ucoutbuf[2]) {
+           errs++;
+           fprintf( stderr, "unsigned char PROD(>) test failed\n" );
+       }
+    }
+
+#ifndef USE_STRICT_MPI
+    /* For some reason, complex is not allowed for sum and prod */
+    if (MPI_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
+       int dc;
+#ifdef HAVE_LONG_DOUBLE        
+       ld_complex ldinbuf[3], ldoutbuf[3];
+#endif 
+       /* Must determine which C type matches this Fortran type */
+       MPI_Type_size( MPI_DOUBLE_COMPLEX, &dc );
+       if (dc == sizeof(d_complex)) {
+           /* double complex; may be null if we do not have Fortran support */
+           dinbuf[0].r = (rank < maxsize && rank > 0) ? rank : 1;
+           dinbuf[1].r = 0;
+           dinbuf[2].r = (rank > 0);
+           dinbuf[0].i = 0;
+           dinbuf[1].i = 1;
+           dinbuf[2].i = -(rank > 0);
+           
+           doutbuf[0].r = 0;
+           doutbuf[1].r = 1;
+           doutbuf[2].r = 1;
+           doutbuf[0].i = 0;
+           doutbuf[1].i = 1;
+           doutbuf[2].i = 1;
+           MPI_Reduce( dinbuf, doutbuf, 3, MPI_DOUBLE_COMPLEX, MPI_PROD, 0, comm );
+           if (rank == 0) {
+               double imag, real;
+               if (doutbuf[0].r != (double)result[maxsize-1] || doutbuf[0].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(rank) test failed\n" );
+               }
+               /* Multiplying the imaginary part depends on size mod 4 */
+               imag = 1.0; real = 0.0; /* Make compiler happy */
+               switch (size % 4) {
+               case 1: imag = 1.0; real = 0.0; break;
+               case 2: imag = 0.0; real = -1.0; break;
+               case 3: imag =-1.0; real = 0.0; break;
+               case 0: imag = 0.0; real = 1.0; break; 
+               }
+               if (doutbuf[1].r != real || doutbuf[1].i != imag) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(i) test failed (%f,%f)!=(%f,%f)\n",
+                        doutbuf[1].r,doutbuf[1].i,real,imag);
+               }
+               if (doutbuf[2].r != 0 || doutbuf[2].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(>) test failed\n" );
+               }
+           }
+       }
+#ifdef HAVE_LONG_DOUBLE
+       else if (dc == sizeof(ld_complex)) {
+           /* double complex; may be null if we do not have Fortran support */
+           ldinbuf[0].r = (rank < maxsize && rank > 0) ? rank : 1;
+           ldinbuf[1].r = 0;
+           ldinbuf[2].r = (rank > 0);
+           ldinbuf[0].i = 0;
+           ldinbuf[1].i = 1;
+           ldinbuf[2].i = -(rank > 0);
+           
+           ldoutbuf[0].r = 0;
+           ldoutbuf[1].r = 1;
+           ldoutbuf[2].r = 1;
+           ldoutbuf[0].i = 0;
+           ldoutbuf[1].i = 1;
+           ldoutbuf[2].i = 1;
+           MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_DOUBLE_COMPLEX, MPI_PROD, 0, comm );
+           if (rank == 0) {
+               long double imag, real;
+               if (ldoutbuf[0].r != (double)result[maxsize-1] || ldoutbuf[0].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(rank) test failed\n" );
+               }
+               /* Multiplying the imaginary part depends on size mod 4 */
+               imag = 1.0; real = 0.0; /* Make compiler happy */
+               switch (size % 4) {
+               case 1: imag = 1.0; real = 0.0; break;
+               case 2: imag = 0.0; real = -1.0; break;
+               case 3: imag =-1.0; real = 0.0; break;
+               case 0: imag = 0.0; real = 1.0; break; 
+               }
+               if (ldoutbuf[1].r != real || ldoutbuf[1].i != imag) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(i) test failed (%Lf,%Lf)!=(%Lf,%Lf)\n",
+                        ldoutbuf[1].r,ldoutbuf[1].i,real,imag);
+               }
+               if (ldoutbuf[2].r != 0 || ldoutbuf[2].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex PROD(>) test failed\n" );
+               }
+           }
+       }
+#endif /* HAVE_LONG_DOUBLE */
+    }
+#endif /* USE_STRICT_MPI */
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = (rank < maxsize && rank > 0) ? rank : 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = (rank > 0);
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_PROD, 0, comm );
+       if (rank == 0) {
+           if (ldoutbuf[0] != (long double)result[maxsize-1]) {
+               errs++;
+               fprintf( stderr, "long double PROD(rank) test failed\n" );
+           }
+           if (ldoutbuf[1]) {
+               errs++;
+               fprintf( stderr, "long double PROD(0) test failed\n" );
+           }
+           if (size > 1 && ldoutbuf[2] != 0) {
+               errs++;
+               fprintf( stderr, "long double PROD(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_DOUBLE */
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = (rank < maxsize && rank > 0) ? rank : 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0);
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_PROD, 0, comm );
+       if (rank == 0) {
+           if (lloutbuf[0] != (long long)result[maxsize-1]) {
+               errs++;
+               fprintf( stderr, "long long PROD(rank) test failed\n" );
+           }
+           if (lloutbuf[1]) {
+               errs++;
+               fprintf( stderr, "long long PROD(0) test failed\n" );
+           }
+           if (size > 1 && lloutbuf[2]) {
+               errs++;
+               fprintf( stderr, "long long PROD(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif /* HAVE_LONG_LONG */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/opsum.c b/teshsuite/smpi/mpich3-test/coll/opsum.c
new file mode 100644 (file)
index 0000000..c9bd5f8
--- /dev/null
@@ -0,0 +1,266 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_SUM operations on optional datatypes dupported by MPICH";
+*/
+
+typedef struct { double r, i; } d_complex;
+#ifdef HAVE_LONG_DOUBLE
+typedef struct { long double r, i; } ld_complex;
+#endif
+
+/*
+ * This test looks at the handling of logical and for types that are not 
+ * integers or are not required integers (e.g., long long).  MPICH allows
+ * these as well.  A strict MPI test should not include this test.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size;
+    MPI_Comm      comm;
+    char cinbuf[3], coutbuf[3];
+    signed char scinbuf[3], scoutbuf[3];
+    unsigned char ucinbuf[3], ucoutbuf[3];
+    d_complex dinbuf[3], doutbuf[3];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+#ifndef USE_STRICT_MPI
+    /* char */
+    MTestPrintfMsg( 10, "Reduce of MPI_CHAR\n" );
+    cinbuf[0] = 1;
+    cinbuf[1] = 0;
+    cinbuf[2] = (rank > 0);
+
+    coutbuf[0] = 0;
+    coutbuf[1] = 1;
+    coutbuf[2] = 1;
+    MPI_Reduce( cinbuf, coutbuf, 3, MPI_CHAR, MPI_SUM, 0, comm );
+    if (rank == 0) {
+       if (size < 128 && coutbuf[0] != size) {
+           errs++;
+           fprintf( stderr, "char SUM(1) test failed\n" );
+       }
+       if (size < 128 && coutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "char SUM(0) test failed\n" );
+       }
+       if (size < 128 && coutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "char SUM(>) test failed\n" );
+       }
+    }
+#endif /* USE_MPI_STRICT */
+
+    /* signed char */
+    MTestPrintfMsg( 10, "Reduce of MPI_SIGNED_CHAR\n" );
+    scinbuf[0] = 1;
+    scinbuf[1] = 0;
+    scinbuf[2] = (rank > 0);
+
+    scoutbuf[0] = 0;
+    scoutbuf[1] = 1;
+    scoutbuf[2] = 1;
+    MPI_Reduce( scinbuf, scoutbuf, 3, MPI_SIGNED_CHAR, MPI_SUM, 0, comm );
+    if (rank == 0) {
+       if (size < 128 && scoutbuf[0] != size) {
+           errs++;
+           fprintf( stderr, "signed char SUM(1) test failed\n" );
+       }
+       if (size < 128 && scoutbuf[1] != 0) {
+           errs++;
+           fprintf( stderr, "signed char SUM(0) test failed\n" );
+       }
+       if (size < 128 && scoutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "signed char SUM(>) test failed\n" );
+       }
+    }
+
+    /* unsigned char */
+    MTestPrintfMsg( 10, "Reduce of MPI_UNSIGNED_CHAR\n" );
+    ucinbuf[0] = 1;
+    ucinbuf[1] = 0;
+    ucinbuf[2] = (rank > 0);
+
+    ucoutbuf[0] = 0;
+    ucoutbuf[1] = 1;
+    ucoutbuf[2] = 1;
+    MPI_Reduce( ucinbuf, ucoutbuf, 3, MPI_UNSIGNED_CHAR, MPI_SUM, 0, comm );
+    if (rank == 0) {
+       if (size < 128 && ucoutbuf[0] != size) {
+           errs++;
+           fprintf( stderr, "unsigned char SUM(1) test failed\n" );
+       }
+       if (size < 128 && ucoutbuf[1]) {
+           errs++;
+           fprintf( stderr, "unsigned char SUM(0) test failed\n" );
+       }
+       if (size < 128 && ucoutbuf[2] != size - 1) {
+           errs++;
+           fprintf( stderr, "unsigned char SUM(>) test failed\n" );
+       }
+    }
+
+#ifndef USE_STRICT_MPI
+    /* For some reason, complex is not allowed for sum and prod */
+    if (MPI_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
+       int dc;
+#ifdef HAVE_LONG_DOUBLE        
+       ld_complex ldinbuf[3], ldoutbuf[3];
+#endif 
+       /* Must determine which C type matches this Fortran type */
+       MPI_Type_size( MPI_DOUBLE_COMPLEX, &dc );
+       if (dc == sizeof(d_complex)) {
+           MTestPrintfMsg( 10, "Reduce of MPI_DOUBLE_COMPLEX\n" );
+           /* double complex; may be null if we do not have Fortran support */
+           dinbuf[0].r = 1;
+           dinbuf[1].r = 0;
+           dinbuf[2].r = (rank > 0);
+           dinbuf[0].i = -1;
+           dinbuf[1].i = 0;
+           dinbuf[2].i = -(rank > 0);
+           
+           doutbuf[0].r = 0;
+           doutbuf[1].r = 1;
+           doutbuf[2].r = 1;
+           doutbuf[0].i = 0;
+           doutbuf[1].i = 1;
+           doutbuf[2].i = 1;
+           MPI_Reduce( dinbuf, doutbuf, 3, MPI_DOUBLE_COMPLEX, MPI_SUM, 0, comm );
+           if (rank == 0) {
+               if (doutbuf[0].r != size || doutbuf[0].i != -size) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(1) test failed\n" );
+               }
+               if (doutbuf[1].r != 0 || doutbuf[1].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(0) test failed\n" );
+               }
+               if (doutbuf[2].r != size - 1 || doutbuf[2].i != 1 - size) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(>) test failed\n" );
+               }
+           }
+       }
+#ifdef HAVE_LONG_DOUBLE
+       else if (dc == sizeof(ld_complex)) {
+           MTestPrintfMsg( 10, "Reduce of MPI_DOUBLE_COMPLEX\n" );
+           /* double complex; may be null if we do not have Fortran support */
+           ldinbuf[0].r = 1;
+           ldinbuf[1].r = 0;
+           ldinbuf[2].r = (rank > 0);
+           ldinbuf[0].i = -1;
+           ldinbuf[1].i = 0;
+           ldinbuf[2].i = -(rank > 0);
+           
+           ldoutbuf[0].r = 0;
+           ldoutbuf[1].r = 1;
+           ldoutbuf[2].r = 1;
+           ldoutbuf[0].i = 0;
+           ldoutbuf[1].i = 1;
+           ldoutbuf[2].i = 1;
+           MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_DOUBLE_COMPLEX, 
+                       MPI_SUM, 0, comm );
+           if (rank == 0) {
+               if (ldoutbuf[0].r != size || ldoutbuf[0].i != -size) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(1) test failed\n" );
+               }
+               if (ldoutbuf[1].r != 0 || ldoutbuf[1].i != 0) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(0) test failed\n" );
+               }
+               if (ldoutbuf[2].r != size - 1 || ldoutbuf[2].i != 1 - size) {
+                   errs++;
+                   fprintf( stderr, "double complex SUM(>) test failed\n" );
+               }
+           }
+       }
+#endif
+       /* Implicitly ignore if there is no matching C type */
+    }
+#endif /* USE_STRICT_MPI */
+
+#ifdef HAVE_LONG_DOUBLE
+    { long double ldinbuf[3], ldoutbuf[3];
+    /* long double */
+    ldinbuf[0] = 1;
+    ldinbuf[1] = 0;
+    ldinbuf[2] = (rank > 0);
+
+    ldoutbuf[0] = 0;
+    ldoutbuf[1] = 1;
+    ldoutbuf[2] = 1;
+    if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_DOUBLE\n" );
+       MPI_Reduce( ldinbuf, ldoutbuf, 3, MPI_LONG_DOUBLE, MPI_SUM, 0, comm );
+       if (rank == 0) {
+           if (ldoutbuf[0] != size) {
+               errs++;
+               fprintf( stderr, "long double SUM(1) test failed\n" );
+           }
+           if (ldoutbuf[1] != 0.0) {
+               errs++;
+               fprintf( stderr, "long double SUM(0) test failed\n" );
+           }
+           if (ldoutbuf[2] != size - 1) {
+               errs++;
+               fprintf( stderr, "long double SUM(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif
+
+#ifdef HAVE_LONG_LONG
+    {
+       long long llinbuf[3], lloutbuf[3];
+    /* long long */
+    llinbuf[0] = 1;
+    llinbuf[1] = 0;
+    llinbuf[2] = (rank > 0);
+
+    lloutbuf[0] = 0;
+    lloutbuf[1] = 1;
+    lloutbuf[2] = 1;
+    if (MPI_LONG_LONG != MPI_DATATYPE_NULL) {
+       MTestPrintfMsg( 10, "Reduce of MPI_LONG_LONG\n" );
+       MPI_Reduce( llinbuf, lloutbuf, 3, MPI_LONG_LONG, MPI_SUM, 0, comm );
+       if (rank == 0) {
+           if (lloutbuf[0] != size) {
+               errs++;
+               fprintf( stderr, "long long SUM(1) test failed\n" );
+           }
+           if (lloutbuf[1] != 0) {
+               errs++;
+               fprintf( stderr, "long long SUM(0) test failed\n" );
+           }
+           if (lloutbuf[2] != size - 1) {
+               errs++;
+               fprintf( stderr, "long long SUM(>) test failed\n" );
+           }
+       }
+    }
+    }
+#endif
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/red3.c b/teshsuite/smpi/mpich3-test/coll/red3.c
new file mode 100644 (file)
index 0000000..32358d9
--- /dev/null
@@ -0,0 +1,200 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Reduce with non-commutative user-define operations";
+*/
+/*
+ * This tests that the reduce operation respects the noncommutative flag.
+ * See red4.c for a version that can distinguish between P_{root} P_{root+1} 
+ * ... P_{root-1} and P_0 ... P_{size-1} .  The MPI standard clearly
+ * specifies that the result is P_0 ... P_{size-1}, independent of the root 
+ * (see 4.9.4 in MPI-1)
+ */
+
+/* This implements a simple matrix-matrix multiply.  This is an associative
+   but not commutative operation.  The matrix size is set in matSize;
+   the number of matrices is the count argument. The matrix is stored
+   in C order, so that
+     c(i,j) is cin[j+i*matSize]
+ */
+#define MAXCOL 256
+static int matSize = 0;  /* Must be < MAXCOL */
+void uop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype );
+void uop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    const int *cin = (const int *)cinPtr;
+    int *cout = (int *)coutPtr;
+    int i, j, k, nmat;
+    int tempCol[MAXCOL];
+
+    for (nmat = 0; nmat < *count; nmat++) {
+       for (j=0; j<matSize; j++) {
+           for (i=0; i<matSize; i++) {
+               tempCol[i] = 0;
+               for (k=0; k<matSize; k++) {
+                   /* col[i] += cin(i,k) * cout(k,j) */
+                   tempCol[i] += cin[k+i*matSize] * cout[j+k*matSize];
+               }
+           }
+           for (i=0; i<matSize; i++) {
+               cout[j+i*matSize] = tempCol[i];
+           }
+       }
+    }
+}
+
+/* Initialize the integer matrix as a permutation of rank with rank+1.
+   If we call this matrix P_r, we know that product of P_0 P_1 ... P_{size-2}
+   is a left shift by 1.
+*/   
+
+static void initMat( MPI_Comm comm, int mat[] )
+{
+    int i, size, rank;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size*size; i++) mat[i] = 0;
+
+    /* For each row */
+    for (i=0; i<size; i++) {
+       if (rank != size - 1) {
+           if (i == rank)                   mat[((i+1)%size) + i * size] = 1;
+           else if (i == ((rank + 1)%size)) mat[((i+size-1)%size) + i * size] = 1;
+           else                             mat[i+i*size] = 1;
+       }
+       else {
+           mat[i+i*size] = 1;
+       }
+    }
+}
+
+#ifdef FOO
+/* Compare a matrix with the identity matrix */
+static int isIdentity( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank, errs = 0;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size; i++) {
+       for (j=0; j<size; j++) {
+           if (i == j) {
+               if (mat[j+i*size] != 1) {
+                   errs++;
+               }
+           }
+           else {
+               if (mat[j+i*size] != 0) {
+                   errs++;
+               }
+           }
+       }
+    }
+    return errs;
+}
+#endif
+
+/* Compare a matrix with the identity matrix */
+static int isShiftLeft( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank, errs = 0;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size; i++) {
+       for (j=0; j<size; j++) {
+           if (i == ((j + 1) % size)) {
+               if (mat[j+i*size] != 1) {
+                   errs++;
+               }
+           }
+           else {
+               if (mat[j+i*size] != 0) {
+                   errs++;
+               }
+           }
+       }
+    }
+    return errs;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, root;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *buf, *bufout;
+    MPI_Op op;
+    MPI_Datatype mattype;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Op_create( uop, 0, &op );
+    
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+
+       matSize = size;  /* used by the user-defined operation */
+       /* Only one matrix for now */
+       count = 1;
+
+       /* A single matrix, the size of the communicator */
+       MPI_Type_contiguous( size*size, MPI_INT, &mattype );
+       MPI_Type_commit( &mattype );
+       
+       buf = (int *)malloc( count * size * size * sizeof(int) );
+       if (!buf) MPI_Abort( MPI_COMM_WORLD, 1 );
+       bufout = (int *)malloc( count * size * size * sizeof(int) );
+       if (!bufout) MPI_Abort( MPI_COMM_WORLD, 1 );
+
+       for (root = 0; root < size; root ++) {
+           initMat( comm, buf );
+           MPI_Reduce( buf, bufout, count, mattype, op, root, comm );
+           if (rank == root) {
+               errs += isShiftLeft( comm, bufout );
+           }
+
+           /* Try the same test, but using MPI_IN_PLACE */
+           initMat( comm, bufout );
+           if (rank == root) {
+               MPI_Reduce( MPI_IN_PLACE, bufout, count, mattype, op, root, comm );
+           }
+           else {
+               MPI_Reduce( bufout, NULL, count, mattype, op, root, comm );
+           }
+           if (rank == root) {
+               errs += isShiftLeft( comm, bufout );
+           }
+       }
+
+       free( buf );
+       free( bufout );
+       
+       MPI_Type_free( &mattype );
+
+       MTestFreeComm( &comm );
+    }
+
+    MPI_Op_free( &op );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/red4.c b/teshsuite/smpi/mpich3-test/coll/red4.c
new file mode 100644 (file)
index 0000000..a3e9183
--- /dev/null
@@ -0,0 +1,259 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Reduce with non-commutative user-define operations and arbitrary root";
+*/
+
+/*
+ * This tests that the reduce operation respects the noncommutative flag.
+ * and that can distinguish between P_{root} P_{root+1} 
+ * ... P_{root-1} and P_0 ... P_{size-1} .  The MPI standard clearly
+ * specifies that the result is P_0 ... P_{size-1}, independent of the root 
+ * (see 4.9.4 in MPI-1)
+ */
+
+/* This implements a simple matrix-matrix multiply.  This is an associative
+   but not commutative operation.  The matrix size is set in matSize;
+   the number of matrices is the count argument. The matrix is stored
+   in C order, so that
+     c(i,j) is cin[j+i*matSize]
+ */
+#define MAXCOL 256
+static int matSize = 0;  /* Must be < MAXCOL */
+
+void uop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype );
+void uop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    const int *cin;
+    int       *cout;
+    int       i, j, k, nmat;
+    int       tempCol[MAXCOL];
+
+    if (*count != 1) printf( "Panic!\n" );
+    for (nmat = 0; nmat < *count; nmat++) {
+       cin  = (const int *)cinPtr;
+       cout = (int *)coutPtr;
+       for (j=0; j<matSize; j++) {
+           for (i=0; i<matSize; i++) {
+               tempCol[i] = 0;
+               for (k=0; k<matSize; k++) {
+                   /* col[i] += cin(i,k) * cout(k,j) */
+                   tempCol[i] += cin[k+i*matSize] * cout[j+k*matSize];
+               }
+           }
+           for (i=0; i<matSize; i++) {
+               cout[j+i*matSize] = tempCol[i];
+           }
+       }
+       cinPtr = (int *)cinPtr + matSize*matSize;
+       coutPtr = (int *)coutPtr + matSize*matSize;
+    }
+}
+
+/* Initialize the integer matrix as a permutation of rank with rank+1.
+   If we call this matrix P_r, we know that product of P_0 P_1 ... P_{size-1}
+   is the matrix with rows ordered as
+   1,size,2,3,4,...,size-1
+   (The matrix is basically a circular shift right, 
+   shifting right n-1 steps for an n x n dimensional matrix, with the last
+   step swapping rows 1 and size)
+*/   
+
+static void initMat( MPI_Comm comm, int mat[] )
+{
+    int i, size, rank;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* Remember the matrix size */
+    matSize = size;
+
+    for (i=0; i<matSize*matSize; i++) mat[i] = 0;
+
+    for (i=0; i<matSize; i++) {
+       if (i == rank)                   
+           mat[((i+1)%matSize) + i * matSize] = 1;
+       else if (i == ((rank + 1)%matSize)) 
+           mat[((i+matSize-1)%matSize) + i * matSize] = 1;
+       else                             
+           mat[i+i*matSize] = 1;
+    }
+}
+
+/* Compare a matrix with the identity matrix */
+/*
+static int isIdentity( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank, errs = 0;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    for (i=0; i<size; i++) {
+       for (j=0; j<size; j++) {
+           if (j == i) {
+               if (mat[j+i*size] != 1) {
+                   printf( "mat(%d,%d) = %d, should = 1\n", 
+                           i, j, mat[j+i*size] );
+                   errs++;
+               }
+           }
+           else {
+               if (mat[j+i*size] != 0) {
+                   printf( "mat(%d,%d) = %d, should = 0\n",
+                           i, j, mat[j+i*size] );
+                   errs++;
+               }
+           }
+       }
+    }
+    return errs;
+}
+*/
+
+/* Compare a matrix with the identity matrix with rows permuted to as rows
+   1,size,2,3,4,5,...,size-1 */
+static int isPermutedIdentity( MPI_Comm comm, int mat[] )
+{
+    int i, j, size, rank, errs = 0;
+    
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* Check the first two last rows */
+    i = 0;
+    for (j=0; j<size; j++) {
+       if (j==0) { 
+           if (mat[j] != 1) {
+               printf( "mat(%d,%d) = %d, should = 1\n", 
+                       i, j, mat[j] );
+               errs++;
+           }
+       }
+       else {
+           if (mat[j] != 0) {
+               printf( "mat(%d,%d) = %d, should = 0\n", 
+                       i, j, mat[j] );
+               errs++;
+           }
+       }
+    }
+    i = 1;
+    for (j=0; j<size; j++) {
+       if (j==size-1) { 
+           if (mat[j+i*size] != 1) {
+               printf( "mat(%d,%d) = %d, should = 1\n", 
+                       i, j, mat[j+i*size] );
+               errs++;
+           }
+       }
+       else {
+           if (mat[j+i*size] != 0) {
+               printf( "mat(%d,%d) = %d, should = 0\n", 
+                       i, j, mat[j+i*size] );
+               errs++;
+           }
+       }
+    }
+    /* The remaint rows are shifted down by one */
+    for (i=2; i<size; i++) {
+       for (j=0; j<size; j++) {
+           if (j == i-1) {
+               if (mat[j+i*size] != 1) {
+                   printf( "mat(%d,%d) = %d, should = 1\n", 
+                           i, j, mat[j+i*size] );
+                   errs++;
+               }
+           }
+           else {
+               if (mat[j+i*size] != 0) {
+                   printf( "mat(%d,%d) = %d, should = 0\n",
+                           i, j, mat[j+i*size] );
+                   errs++;
+               }
+           }
+       }
+    }
+    return errs;
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, root;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    int *buf, *bufout;
+    MPI_Op op;
+    MPI_Datatype mattype;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Op_create( uop, 0, &op );
+    
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+
+       if (size > MAXCOL) {
+           /* Skip because there are too many processes */
+           MTestFreeComm( &comm );
+           continue;
+       }
+
+       /* Only one matrix for now */
+       count = 1;
+
+       /* A single matrix, the size of the communicator */
+       MPI_Type_contiguous( size*size, MPI_INT, &mattype );
+       MPI_Type_commit( &mattype );
+       
+       buf = (int *)malloc( count * size * size * sizeof(int) );
+       if (!buf) MPI_Abort( MPI_COMM_WORLD, 1 );
+       bufout = (int *)malloc( count * size * size * sizeof(int) );
+       if (!bufout) MPI_Abort( MPI_COMM_WORLD, 1 );
+
+       for (root = 0; root < size; root ++) {
+           initMat( comm, buf );
+           MPI_Reduce( buf, bufout, count, mattype, op, root, comm );
+           if (rank == root) {
+               errs += isPermutedIdentity( comm, bufout );
+           }
+
+           /* Try the same test, but using MPI_IN_PLACE */
+           initMat( comm, bufout );
+           if (rank == root) {
+               MPI_Reduce( MPI_IN_PLACE, bufout, count, mattype, op, root, comm );
+           }
+           else {
+               MPI_Reduce( bufout, NULL, count, mattype, op, root, comm );
+           }
+           if (rank == root) {
+               errs += isPermutedIdentity( comm, bufout );
+           }
+       }
+       MPI_Type_free( &mattype );
+
+       free( buf );
+       free( bufout );
+
+       MTestFreeComm( &comm );
+    }
+
+    MPI_Op_free( &op );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/red_scat_block.c b/teshsuite/smpi/mpich3-test/coll/red_scat_block.c
new file mode 100644 (file)
index 0000000..7891cb6
--- /dev/null
@@ -0,0 +1,82 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+ * Test of reduce scatter block.
+ *
+ * Each process contributes its rank + the index to the reduction,
+ * then receives the ith sum
+ *
+ * Can be called with any number of processes.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+    int err = 0;
+    int toterr, size, rank;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int i, sumval;
+    int *sendbuf;
+    int *recvbuf;
+#endif
+    MPI_Comm comm;
+
+    MPI_Init(&argc, &argv);
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size(comm, &size);
+    MPI_Comm_rank(comm, &rank);
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* MPI_Reduce_scatter block was added in MPI-2.2 */
+    sendbuf = (int *) malloc(size * sizeof(int));
+    recvbuf = (int *) malloc(size * sizeof(int));
+    if (!sendbuf || !recvbuf) {
+        err++;
+        fprintf(stderr, "unable to allocate send/recv buffers, aborting");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+    for (i=0; i<size; i++)
+        sendbuf[i] = rank + i;
+
+    MPI_Reduce_scatter_block(sendbuf, recvbuf, 1, MPI_INT, MPI_SUM, comm);
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    if (recvbuf[0] != sumval) {
+        err++;
+        fprintf(stdout, "Did not get expected value for reduce scatter block\n");
+        fprintf(stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval);
+    }
+
+    free(sendbuf);
+
+    /* let's try it again with MPI_IN_PLACE this time */
+    for (i=0; i<size; i++)
+        recvbuf[i] = rank + i;
+
+    MPI_Reduce_scatter_block(MPI_IN_PLACE, recvbuf, 1, MPI_INT, MPI_SUM, comm);
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    if (recvbuf[0] != sumval) {
+        err++;
+        fprintf(stdout, "Did not get expected value for reduce scatter block\n");
+        fprintf(stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval);
+    }
+    free(recvbuf);
+#endif
+
+    MPI_Allreduce(&err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+    if (rank == 0 && toterr == 0) {
+        printf(" No Errors\n");
+    }
+    MPI_Finalize();
+
+    return toterr;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/red_scat_block2.c b/teshsuite/smpi/mpich3-test/coll/red_scat_block2.c
new file mode 100644 (file)
index 0000000..e98273b
--- /dev/null
@@ -0,0 +1,132 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce_scatter_block.
+ *
+ * Checks that non-commutative operations are not commuted and that
+ * all of the operations are performed.
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int err = 0;
+
+/* left(x,y) ==> x */
+void left(void *a, void *b, int *count, MPI_Datatype *type);
+void left(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        if (in[i] > inout[i])
+            ++err;
+        inout[i] = in[i];
+    }
+}
+
+/* right(x,y) ==> y */
+void right(void *a, void *b, int *count, MPI_Datatype *type);
+void right(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        if (in[i] > inout[i])
+            ++err;
+        inout[i] = inout[i];
+    }
+}
+
+/* Just performs a simple sum but can be marked as non-commutative to
+   potentially tigger different logic in the implementation. */
+void nc_sum(void *a, void *b, int *count, MPI_Datatype *type);
+void nc_sum(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        inout[i] = in[i] + inout[i];
+    }
+}
+
+#define MAX_BLOCK_SIZE 256
+
+int main( int argc, char **argv )
+{
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int      *sendbuf;
+    int      block_size;
+    int      *recvbuf;
+    int      i;
+    MPI_Op left_op, right_op, nc_sum_op;
+#endif
+    int      size, rank;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* MPI_Reduce_scatter block was added in MPI-2.2 */
+
+    MPI_Op_create(&left, 0/*non-commutative*/, &left_op);
+    MPI_Op_create(&right, 0/*non-commutative*/, &right_op);
+    MPI_Op_create(&nc_sum, 0/*non-commutative*/, &nc_sum_op);
+
+    for (block_size = 1; block_size < MAX_BLOCK_SIZE; block_size *= 2) {
+        sendbuf = (int *) malloc( block_size * size * sizeof(int) );
+        recvbuf = malloc( block_size * sizeof(int) );
+
+        for (i=0; i<(size*block_size); i++) 
+            sendbuf[i] = rank + i;
+        for (i=0; i<block_size; i++)
+            recvbuf[i] = 0xdeadbeef;
+
+        MPI_Reduce_scatter_block( sendbuf, recvbuf, block_size, MPI_INT, left_op, comm );
+        for (i = 0; i < block_size; ++i)
+            if (recvbuf[i] != (rank * block_size + i)) ++err;
+
+        MPI_Reduce_scatter_block( sendbuf, recvbuf, block_size, MPI_INT, right_op, comm );
+        for (i = 0; i < block_size; ++i)
+            if (recvbuf[i] != ((size - 1) + (rank * block_size) + i)) ++err;
+
+        MPI_Reduce_scatter_block( sendbuf, recvbuf, block_size, MPI_INT, nc_sum_op, comm );
+        for (i = 0; i < block_size; ++i) {
+            int x = rank * block_size + i;
+            if (recvbuf[i] != (size*x + (size-1)*size/2)) ++err;
+        }
+
+        free(recvbuf);
+        free(sendbuf);
+    }
+
+    MPI_Op_free(&left_op);
+    MPI_Op_free(&right_op);
+    MPI_Op_free(&nc_sum_op);
+#endif 
+
+    MTest_Finalize( err );
+    MPI_Finalize( );
+
+    return err;
+}
similarity index 71%
rename from teshsuite/smpi/mpich-test/coll/redscat.c
rename to teshsuite/smpi/mpich3-test/coll/redscat.c
index 9cb824a..9214c5d 100644 (file)
@@ -1,3 +1,8 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 /* 
  * Test of reduce scatter.
  *
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "test.h"
 
 int main( int argc, char **argv )
 {
     int      err = 0, toterr;
-    int      *sendbuf, *recvbuf, *recvcounts;
+    int      *sendbuf, recvbuf, *recvcounts;
     int      size, rank, i, sumval;
     MPI_Comm comm;
 
@@ -29,16 +33,17 @@ int main( int argc, char **argv )
     for (i=0; i<size; i++) 
        sendbuf[i] = rank + i;
     recvcounts = (int *)malloc( size * sizeof(int) );
-        recvbuf = (int *)malloc( size * sizeof(int) );
     for (i=0; i<size; i++) 
-    recvcounts[i] = 1;
-    MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+       recvcounts[i] = 1;
+
+    MPI_Reduce_scatter( sendbuf, &recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+
     sumval = size * rank + ((size - 1) * size)/2;
 /* recvbuf should be size * (rank + i) */
-    if (recvbuf[0] != sumval) {
+    if (recvbuf != sumval) {
        err++;
        fprintf( stdout, "Did not get expected value for reduce scatter\n" );
-       fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval );
+       fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf, sumval );
     }
 
     MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
diff --git a/teshsuite/smpi/mpich3-test/coll/redscat2.c b/teshsuite/smpi/mpich3-test/coll/redscat2.c
new file mode 100644 (file)
index 0000000..f77bad8
--- /dev/null
@@ -0,0 +1,128 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce scatter.
+ *
+ * Checks that non-commutative operations are not commuted and that
+ * all of the operations are performed.
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int err = 0;
+
+/* left(x,y) ==> x */
+void left(void *a, void *b, int *count, MPI_Datatype *type);
+void left(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        if (in[i] > inout[i])
+            ++err;
+        inout[i] = in[i];
+    }
+}
+
+/* right(x,y) ==> y */
+void right(void *a, void *b, int *count, MPI_Datatype *type);
+void right(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        if (in[i] > inout[i])
+            ++err;
+        inout[i] = inout[i];
+    }
+}
+
+/* Just performs a simple sum but can be marked as non-commutative to
+   potentially tigger different logic in the implementation. */
+void nc_sum(void *a, void *b, int *count, MPI_Datatype *type);
+void nc_sum(void *a, void *b, int *count, MPI_Datatype *type)
+{
+    int *in = a;
+    int *inout = b;
+    int i;
+
+    for (i = 0; i < *count; ++i)
+    {
+        inout[i] = in[i] + inout[i];
+    }
+}
+
+#define MAX_BLOCK_SIZE 256
+
+int main( int argc, char **argv )
+{
+    int      *sendbuf, *recvcounts;
+    int      block_size;
+    int      *recvbuf;
+    int      size, rank, i;
+    MPI_Comm comm;
+    MPI_Op left_op, right_op, nc_sum_op;
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+    MPI_Op_create(&left, 0/*non-commutative*/, &left_op);
+    MPI_Op_create(&right, 0/*non-commutative*/, &right_op);
+    MPI_Op_create(&nc_sum, 0/*non-commutative*/, &nc_sum_op);
+
+    for (block_size = 1; block_size < MAX_BLOCK_SIZE; block_size *= 2) {
+        sendbuf = (int *) malloc( block_size * size * sizeof(int) );
+        recvbuf = malloc( block_size * sizeof(int) );
+
+        for (i=0; i<(size*block_size); i++) 
+            sendbuf[i] = rank + i;
+        for (i=0; i<block_size; i++)
+            recvbuf[i] = 0xdeadbeef;
+        recvcounts = (int *)malloc( size * sizeof(int) );
+        for (i=0; i<size; i++) 
+            recvcounts[i] = block_size;
+
+        MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, left_op, comm );
+        for (i = 0; i < block_size; ++i)
+            if (recvbuf[i] != (rank * block_size + i)) ++err;
+
+        MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, right_op, comm );
+        for (i = 0; i < block_size; ++i)
+            if (recvbuf[i] != ((size - 1) + (rank * block_size) + i)) ++err;
+
+        MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, nc_sum_op, comm );
+        for (i = 0; i < block_size; ++i) {
+            int x = rank * block_size + i;
+            if (recvbuf[i] != (size*x + (size-1)*size/2)) ++err;
+        }
+
+        free(recvbuf);
+        free(sendbuf);
+    }
+
+    MPI_Op_free(&left_op);
+    MPI_Op_free(&right_op);
+    MPI_Op_free(&nc_sum_op);
+
+    MTest_Finalize( err );
+    MPI_Finalize( );
+
+    return err;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/redscat3.c b/teshsuite/smpi/mpich3-test/coll/redscat3.c
new file mode 100644 (file)
index 0000000..d2ed7ec
--- /dev/null
@@ -0,0 +1,108 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce scatter with large data (needed in MPICH to trigger the
+ * long-data algorithm)
+ *
+ * Each processor contributes its rank + the index to the reduction, 
+ * then receives the ith sum
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/* Limit the number of error reports */
+#define MAX_ERRORS 10
+
+int main( int argc, char **argv )
+{
+    int      err = 0;
+    int      *sendbuf, *recvbuf, *recvcounts;
+    int      size, rank, i, j, idx, mycount, sumval;
+    MPI_Comm comm;
+
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    recvcounts = (int *)malloc( size * sizeof(int) );
+    if (!recvcounts) {
+       fprintf( stderr, "Could not allocate %d ints for recvcounts\n", 
+                size );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    mycount = (1024 * 1024) / size;
+    for (i=0; i<size; i++) 
+       recvcounts[i] = mycount;
+    sendbuf = (int *) malloc( mycount * size * sizeof(int) );
+    if (!sendbuf) {
+       fprintf( stderr, "Could not allocate %d ints for sendbuf\n", 
+                mycount * size );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    idx = 0;
+    for (i=0; i<size; i++) {
+       for (j=0; j<mycount; j++) {
+           sendbuf[idx++] = rank + i;
+       }
+    }
+    recvbuf = (int *)malloc( mycount * sizeof(int) );
+    if (!recvbuf) {
+       fprintf( stderr, "Could not allocate %d ints for recvbuf\n", 
+                mycount );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    for (i=0; i<mycount; i++) {
+       recvbuf[i] = -1;
+    }
+
+    MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    /* recvbuf should be size * (rank + i) */
+    for (i=0; i<mycount; i++) {
+       if (recvbuf[i] != sumval) {
+           err++;
+           if (err < MAX_ERRORS) {
+               fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+               fprintf( stdout, "[%d] Got recvbuf[%d] = %d expected %d\n",
+                        rank, i, recvbuf[i], sumval );
+           }
+       }
+    }
+
+    MPI_Reduce_scatter( MPI_IN_PLACE, sendbuf, recvcounts, MPI_INT, MPI_SUM, 
+                       comm );
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    /* recv'ed values for my process should be size * (rank + i) */
+    for (i=0; i<mycount; i++) {
+       if (sendbuf[i] != sumval) {
+           err++;
+           if (err < MAX_ERRORS) {
+               fprintf( stdout, "Did not get expected value for reduce scatter (in place)\n" );
+               fprintf( stdout, "[%d] Got buf[%d] = %d expected %d\n", 
+                        rank, i, sendbuf[rank*mycount+i], sumval );
+           }
+       }
+    }
+
+    free(sendbuf);
+    free(recvbuf);
+    free(recvcounts);
+       
+    MTest_Finalize( err );
+
+    MPI_Finalize( );
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/redscatbkinter.c b/teshsuite/smpi/mpich3-test/coll/redscatbkinter.c
new file mode 100644 (file)
index 0000000..bf5f65f
--- /dev/null
@@ -0,0 +1,106 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce scatter block with large data on an intercommunicator
+ * (needed in MPICH to trigger the long-data algorithm)
+ *
+ * Each processor contributes its rank + the index to the reduction, 
+ * then receives the ith sum
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int main( int argc, char **argv )
+{
+    int      err = 0;
+    int      size, rsize, rank, i;
+    int      recvcount, /* Each process receives this much data */
+             sendcount, /* Each process contributes this much data */
+            basecount; /* Unit of elements - basecount *rsize is recvcount, 
+                          etc. */
+    int      isLeftGroup;
+    long long *sendbuf, *recvbuf;
+    long long sumval;
+    MPI_Comm comm;
+
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    basecount = 1024;
+
+    while (MTestGetIntercomm( &comm, &isLeftGroup, 2 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+
+       if (0) {
+           printf( "[%d] %s (%d,%d) remote %d\n", rank, 
+                   isLeftGroup ? "L" : "R", 
+                   rank, size, rsize );
+       }
+
+       recvcount = basecount * rsize;
+       sendcount = basecount * rsize * size;
+
+       sendbuf = (long long *) malloc( sendcount * sizeof(long long) );
+       if (!sendbuf) {
+           fprintf( stderr, "Could not allocate %d ints for sendbuf\n", 
+                    sendcount );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+
+       for (i=0; i<sendcount; i++) {
+           sendbuf[i] = (long long)(rank*sendcount + i);
+       }
+       recvbuf = (long long *)malloc( recvcount * sizeof(long long) );
+       if (!recvbuf) {
+           fprintf( stderr, "Could not allocate %d ints for recvbuf\n", 
+                    recvcount );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       for (i=0; i<recvcount; i++) {
+           recvbuf[i] = (long long)(-i);
+       }
+       
+       MPI_Reduce_scatter_block( sendbuf, recvbuf, recvcount, MPI_LONG_LONG, 
+                                 MPI_SUM, comm );
+
+       /* Check received data */
+       for (i=0; i<recvcount; i++) {
+           sumval = (long long)(sendcount) * (long long)((rsize * (rsize-1))/2) +
+               (long long)(i + rank * rsize * basecount) * (long long)rsize;
+           if (recvbuf[i] != sumval) {
+               err++;
+               if (err < 4) {
+                   fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+                   fprintf( stdout, "[%d] %s recvbuf[%d] = %lld, expected %lld\n",
+                            rank, 
+                            isLeftGroup ? "L" : "R", 
+                            i, recvbuf[i], sumval );
+               }
+           }
+       }
+       
+       free(sendbuf);
+       free(recvbuf);
+
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+
+    MPI_Finalize( );
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/redscatblk3.c b/teshsuite/smpi/mpich3-test/coll/redscatblk3.c
new file mode 100644 (file)
index 0000000..5fb81e5
--- /dev/null
@@ -0,0 +1,89 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce scatter with large data (needed in MPICH to trigger the
+ * long-data algorithm)
+ *
+ * Each processor contributes its rank + the index to the reduction, 
+ * then receives the ith sum
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int main( int argc, char **argv )
+{
+    int      err = 0;
+    int      *sendbuf, *recvbuf;
+    int      size, rank, i, j, idx, mycount, sumval;
+    MPI_Comm comm;
+
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    mycount = (1024 * 1024) / size;
+
+    sendbuf = (int *) malloc( mycount * size * sizeof(int) );
+    if (!sendbuf) {
+       fprintf( stderr, "Could not allocate %d ints for sendbuf\n", 
+                mycount * size );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    idx = 0;
+    for (i=0; i<size; i++) {
+       for (j=0; j<mycount; j++) {
+           sendbuf[idx++] = rank + i;
+       }
+    }
+    recvbuf = (int *)malloc( mycount * sizeof(int) );
+    if (!recvbuf) {
+       fprintf( stderr, "Could not allocate %d ints for recvbuf\n", 
+                mycount );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    MPI_Reduce_scatter_block( sendbuf, recvbuf, mycount, MPI_INT, MPI_SUM, 
+                             comm );
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    /* recvbuf should be size * (rank + i) */
+    for (i=0; i<mycount; i++) {
+       if (recvbuf[i] != sumval) {
+           err++;
+           fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+           fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[i], sumval );
+       }
+    }
+
+    MPI_Reduce_scatter_block( MPI_IN_PLACE, sendbuf, mycount, MPI_INT, MPI_SUM, 
+                       comm );
+
+    sumval = size * rank + ((size - 1) * size)/2;
+    /* recv'ed values for my process should be size * (rank + i) */
+    for (i=0; i<mycount; i++) {
+       if (sendbuf[rank*mycount+i] != sumval) {
+           err++;
+           fprintf( stdout, "Did not get expected value for reduce scatter (in place)\n" );
+           fprintf( stdout, "[%d] Got %d expected %d\n", rank, sendbuf[rank*mycount+i], sumval );
+       }
+    }
+
+    free(sendbuf);
+    free(recvbuf);
+       
+    MTest_Finalize( err );
+
+    MPI_Finalize( );
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/redscatinter.c b/teshsuite/smpi/mpich3-test/coll/redscatinter.c
new file mode 100644 (file)
index 0000000..bebfd8a
--- /dev/null
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* 
+ * Test of reduce scatter with large data on an intercommunicator
+ * (needed in MPICH to trigger the long-data algorithm)
+ *
+ * Each processor contributes its rank + the index to the reduction, 
+ * then receives the ith sum
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int main( int argc, char **argv )
+{
+    int      err = 0;
+    int      *recvcounts;
+    int      size, rsize, rank, i;
+    int      recvcount, /* Each process receives this much data */
+             sendcount, /* Each process contributes this much data */
+            basecount; /* Unit of elements - basecount *rsize is recvcount, 
+                          etc. */
+    int      isLeftGroup;
+    long long *sendbuf, *recvbuf;
+    long long sumval;
+    MPI_Comm comm;
+
+
+    MTest_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+
+    basecount = 1024;
+
+    while (MTestGetIntercomm( &comm, &isLeftGroup, 2 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_rank( comm, &rank );
+
+       if (0) {
+           printf( "[%d] %s (%d,%d) remote %d\n", rank, 
+                   isLeftGroup ? "L" : "R", 
+                   rank, size, rsize );
+       }
+
+       recvcount = basecount * rsize;
+       sendcount = basecount * rsize * size;
+
+       recvcounts = (int *)malloc( size * sizeof(int) );
+       if (!recvcounts) {
+           fprintf( stderr, "Could not allocate %d int for recvcounts\n", 
+                    size );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       for (i=0; i<size; i++) 
+           recvcounts[i] = recvcount;
+       
+       sendbuf = (long long *) malloc( sendcount * sizeof(long long) );
+       if (!sendbuf) {
+           fprintf( stderr, "Could not allocate %d ints for sendbuf\n", 
+                    sendcount );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+
+       for (i=0; i<sendcount; i++) {
+           sendbuf[i] = (long long)(rank*sendcount + i);
+       }
+       recvbuf = (long long *)malloc( recvcount * sizeof(long long) );
+       if (!recvbuf) {
+           fprintf( stderr, "Could not allocate %d ints for recvbuf\n", 
+                    recvcount );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       for (i=0; i<recvcount; i++) {
+           recvbuf[i] = (long long)(-i);
+       }
+       
+       MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_LONG_LONG, MPI_SUM,
+                           comm );
+
+       /* Check received data */
+       for (i=0; i<recvcount; i++) {
+           sumval = (long long)(sendcount) * (long long)((rsize * (rsize-1))/2) +
+               (long long)(i + rank * rsize * basecount) * (long long)rsize;
+           if (recvbuf[i] != sumval) {
+               err++;
+               if (err < 4) {
+                   fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+                   fprintf( stdout, "[%d] %s recvbuf[%d] = %lld, expected %lld\n",
+                            rank, 
+                            isLeftGroup ? "L" : "R", 
+                            i, recvbuf[i], sumval );
+               }
+           }
+       }
+       
+       free(sendbuf);
+       free(recvbuf);
+       free(recvcounts);
+
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( err );
+
+    MPI_Finalize( );
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/reduce.c b/teshsuite/smpi/mpich3-test/coll/reduce.c
new file mode 100644 (file)
index 0000000..6106782
--- /dev/null
@@ -0,0 +1,57 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "A simple test of Reduce with all choices of root process";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, root;
+    int *sendbuf, *recvbuf, i;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       
+       for (count = 1; count < 130000; count = count * 2) {
+           sendbuf = (int *)malloc( count * sizeof(int) );
+           recvbuf = (int *)malloc( count * sizeof(int) );
+           for (root = 0; root < size; root ++) {
+               for (i=0; i<count; i++) sendbuf[i] = i;
+               for (i=0; i<count; i++) recvbuf[i] = -1;
+               MPI_Reduce( sendbuf, recvbuf, count, MPI_INT, MPI_SUM, 
+                           root, comm );
+               if (rank == root) {
+                   for (i=0; i<count; i++) {
+                       if (recvbuf[i] != i * size) {
+                           errs++;
+                       }
+                   }
+               }
+           }
+           free( sendbuf );
+           free( recvbuf );
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/reduce_local.c b/teshsuite/smpi/mpich3-test/coll/reduce_local.c
new file mode 100644 (file)
index 0000000..6521bb7
--- /dev/null
@@ -0,0 +1,98 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "A simple test of MPI_Reduce_local";
+*/
+
+#define MAX_BUF_ELEMENTS (65000)
+
+static int uop_errs = 0;
+
+/* prototype to keep the compiler happy */
+static void user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype);
+
+static void user_op(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype)
+{
+    int i;
+    int *invec_int = (int *)invec;
+    int *inoutvec_int = (int *)inoutvec;
+
+    if (*datatype != MPI_INT) {
+        ++uop_errs;
+        printf("invalid datatype passed to user_op");
+        return;
+    }
+
+    for (i = 0; i < *len; ++i) {
+        inoutvec_int[i] = invec_int[i] * 2 + inoutvec_int[i];
+    }
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    int i;
+    int *inbuf = NULL;
+    int *inoutbuf = NULL;
+    int count = -1;
+    MPI_Op uop = MPI_OP_NULL;
+#endif
+
+    MTest_Init(&argc, &argv);
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* this function was added in MPI-2.2 */
+
+    inbuf = malloc(sizeof(int) * MAX_BUF_ELEMENTS);
+    inoutbuf = malloc(sizeof(int) * MAX_BUF_ELEMENTS);
+
+    for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) {
+        for (i = 0; i < count; ++i) {
+            inbuf[i] = i;
+            inoutbuf[i] = i;
+        }
+        MPI_Reduce_local(inbuf, inoutbuf, count, MPI_INT, MPI_SUM);
+        for (i = 0; i < count; ++i)
+            if (inbuf[i] != i) {
+                ++errs;
+            if (inoutbuf[i] != (2*i))
+                ++errs;
+        }
+    }
+
+    /* make sure that user-define ops work too */
+    MPI_Op_create(&user_op, 0/*!commute*/, &uop);
+    for (count = 0; count < MAX_BUF_ELEMENTS; count > 0 ? count*=2 : count++) {
+        for (i = 0; i < count; ++i) {
+            inbuf[i] = i;
+            inoutbuf[i] = i;
+        }
+        MPI_Reduce_local(inbuf, inoutbuf, count, MPI_INT, uop);
+        errs += uop_errs;
+        for (i = 0; i < count; ++i)
+            if (inbuf[i] != i) {
+                ++errs;
+            if (inoutbuf[i] != (3*i))
+                ++errs;
+        }
+    }
+    MPI_Op_free(&uop);
+
+    free(inbuf);
+    free(inoutbuf);
+#endif
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/scantst.c b/teshsuite/smpi/mpich3-test/coll/scantst.c
new file mode 100644 (file)
index 0000000..2690644
--- /dev/null
@@ -0,0 +1,117 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+
+void addem ( int *, int *, int *, MPI_Datatype * );
+void assoc ( int *, int *, int *, MPI_Datatype * );
+
+void addem( int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
+{
+  int i;
+  for ( i=0; i<*len; i++ ) 
+    inoutvec[i] += invec[i];
+}
+
+#define BAD_ANSWER 100000
+
+/*
+    The operation is inoutvec[i] = invec[i] op inoutvec[i] 
+    (see 4.9.4).  The order is important.
+
+    Note that the computation is in process rank (in the communicator)
+    order, independant of the root.
+ */
+void assoc( int *invec, int *inoutvec, int *len, MPI_Datatype *dtype)
+{
+  int i;
+  for ( i=0; i<*len; i++ )  {
+    if (inoutvec[i] <= invec[i] ) {
+      int rank;
+      MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+      fprintf( stderr, "[%d] inout[0] = %d, in[0] = %d\n", 
+             rank, inoutvec[0], invec[0] );
+      inoutvec[i] = BAD_ANSWER;
+      }
+    else 
+      inoutvec[i] = invec[i];
+  }
+}
+
+int main( int argc, char **argv )
+{
+    int              rank, size, i;
+    int              data;
+    int              errors=0;
+    int              result = -100;
+    int              correct_result;
+    MPI_Op           op_assoc, op_addem;
+    MPI_Comm comm=MPI_COMM_WORLD;
+    
+    MPI_Init( &argc, &argv );
+    MPI_Op_create( (MPI_User_function *)assoc, 0, &op_assoc );
+    MPI_Op_create( (MPI_User_function *)addem, 1, &op_addem );
+
+    /* Run this for a variety of communicator sizes */
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    data = rank;
+       
+    correct_result = 0;
+    for (i=0;i<=rank;i++)
+        correct_result += i;
+    
+    MPI_Scan ( &data, &result, 1, MPI_INT, MPI_SUM, comm );
+    if (result != correct_result) {
+        fprintf( stderr, "[%d] Error suming ints with scan\n", rank );
+        errors++;
+    }
+
+    MPI_Scan ( &data, &result, 1, MPI_INT, MPI_SUM, comm );
+    if (result != correct_result) {
+        fprintf( stderr, "[%d] Error summing ints with scan (2)\n", rank );
+        errors++;
+    }
+    
+    data = rank;
+    result = -100;
+    MPI_Scan ( &data, &result, 1, MPI_INT, op_addem, comm );
+    if (result != correct_result) {
+        fprintf( stderr, "[%d] Error summing ints with scan (userop)\n", 
+                 rank );
+        errors++;
+    }
+    
+    MPI_Scan ( &data, &result, 1, MPI_INT, op_addem, comm );
+    if (result != correct_result) {
+        fprintf( stderr, "[%d] Error summing ints with scan (userop2)\n", 
+                 rank );
+        errors++;
+    }
+    result = -100;
+    data = rank;
+    MPI_Scan ( &data, &result, 1, MPI_INT, op_assoc, comm );
+    if (result == BAD_ANSWER) {
+        fprintf( stderr, "[%d] Error scanning with non-commutative op\n",
+                 rank );
+        errors++;
+    }
+
+    MPI_Op_free( &op_assoc );
+    MPI_Op_free( &op_addem );
+    
+    MPI_Finalize();
+    if (errors)
+        printf( "[%d] done with ERRORS(%d)!\n", rank, errors );
+    else {
+       if (rank == 0) 
+           printf(" No Errors\n");
+    }
+
+    return errors;
+}
diff --git a/teshsuite/smpi/mpich3-test/coll/scatter2.c b/teshsuite/smpi/mpich3-test/coll/scatter2.c
new file mode 100644 (file)
index 0000000..5535a30
--- /dev/null
@@ -0,0 +1,73 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* This example sends a vector and receives individual elements, but the
+   root process does not receive any data */
+
+int main( int argc, char **argv )
+{
+    MPI_Datatype vec;
+    double *vecin, *vecout, ivalue;
+    int    root, i, n, stride, err = 0;
+    int    rank, size;
+    MPI_Aint vextent;
+
+    MTest_Init( &argc, &argv );
+    
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    n = 12;
+    stride = 10;
+    vecin = (double *)malloc( n * stride * size * sizeof(double) );
+    vecout = (double *)malloc( n * sizeof(double) );
+    
+    MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec );
+    MPI_Type_commit( &vec );
+    MPI_Type_extent( vec, &vextent );
+    if (vextent != ((n-1)*(MPI_Aint)stride + 1) * sizeof(double) ) {
+       err++;
+       printf( "Vector extent is %ld, should be %ld\n", 
+                (long) vextent, (long)(((n-1)*stride+1)*sizeof(double)) );
+    }
+    /* Note that the exted of type vector is from the first to the
+       last element, not n*stride.
+       E.g., with n=1, the extent is a single double */
+
+    for (i=0; i<n*stride*size; i++) vecin[i] = (double)i;
+    for (root=0; root<size; root++) {
+       for (i=0; i<n; i++) vecout[i] = -1.0;
+       if (rank == root) {
+           MPI_Scatter( vecin, 1, vec, MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, 
+                        root, MPI_COMM_WORLD );
+       }
+       else {
+           MPI_Scatter( NULL, -1, MPI_DATATYPE_NULL, vecout, n, MPI_DOUBLE,
+                        root, MPI_COMM_WORLD );
+           ivalue = rank * ((n-1) * stride + 1);
+           for (i=0; i<n; i++) {
+               if (vecout[i] != ivalue) {
+                   printf( "[%d] Expected %f but found %f for vecout[%d]\n", 
+                           rank, ivalue, vecout[i], i );
+                   err++;
+               }
+               ivalue += stride;
+           }
+       }
+    }
+    
+    MTest_Finalize( err );
+    MPI_Type_free( &vec );
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/coll/scatter3.c b/teshsuite/smpi/mpich3-test/coll/scatter3.c
new file mode 100644 (file)
index 0000000..a95748d
--- /dev/null
@@ -0,0 +1,87 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* This example sends contiguous data and receives a vector on some nodes
+   and contiguous data on others.  There is some evidence that some
+   MPI implementations do not check recvcount on the root process; this
+   test checks for that case 
+*/
+
+int main( int argc, char **argv )
+{
+    MPI_Datatype vec;
+    double *vecin, *vecout, ivalue;
+    int    root, i, n, stride, errs = 0;
+    int    rank, size;
+    MPI_Aint vextent;
+
+    MTest_Init( &argc, &argv );
+    
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    n = 12;
+    stride = 10;
+    /* Note that vecout really needs to be only (n-1)*stride+1 doubles, but
+       this is easier and allows a little extra room if there is a bug */
+    vecout = (double *)malloc( n * stride * sizeof(double) );
+    vecin  = (double *)malloc( n * size * sizeof(double) );
+    
+    MPI_Type_vector( n, 1, stride, MPI_DOUBLE, &vec );
+    MPI_Type_commit( &vec );
+    MPI_Type_extent( vec, &vextent );
+    if (vextent != ((n-1)*(MPI_Aint)stride + 1) * sizeof(double) ) {
+       errs++;
+       printf( "Vector extent is %ld, should be %ld\n", 
+                (long) vextent, (long)(((n-1)*stride+1)*sizeof(double)) );
+    }
+    /* Note that the exted of type vector is from the first to the
+       last element, not n*stride.
+       E.g., with n=1, the extent is a single double */
+
+    for (i=0; i<n*size; i++) vecin[i] = (double)i;
+    for (root=0; root<size; root++) {
+       for (i=0; i<n*stride; i++) vecout[i] = -1.0;
+       if (rank == root) {
+           /* Receive into a vector */
+           MPI_Scatter( vecin, n, MPI_DOUBLE, vecout, 1, vec, 
+                        root, MPI_COMM_WORLD );
+           for (i=0; i<n; i++) {
+               ivalue = n*root + i;
+               if (vecout[i*stride] != ivalue) {
+                   errs++;
+                   printf( "[%d] Expected %f but found %f for vecout[%d] on root\n", 
+                           rank, ivalue, vecout[i*stride], i *stride );
+               }
+           }
+       }
+       else {
+           /* Receive into contiguous data */
+           MPI_Scatter( NULL, -1, MPI_DATATYPE_NULL, vecout, n, MPI_DOUBLE,
+                        root, MPI_COMM_WORLD );
+           for (i=0; i<n; i++) {
+               ivalue = rank * n + i;
+               if (vecout[i] != ivalue) {
+                   printf( "[%d] Expected %f but found %f for vecout[%d]\n", 
+                           rank, ivalue, vecout[i], i );
+                   errs++;
+               }
+           }
+       }
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Type_free( &vec );
+    MPI_Finalize();
+    return 0;
+}
+
similarity index 89%
rename from teshsuite/smpi/mpich-test/coll/scattern.c
rename to teshsuite/smpi/mpich3-test/coll/scattern.c
index 082fe6a..0c2a096 100644 (file)
@@ -1,7 +1,11 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdlib.h>
 #include <stdio.h>
-#include "test.h" 
 
 /* This example sends a vector and receives individual elements */
 
diff --git a/teshsuite/smpi/mpich3-test/coll/scatterv.c b/teshsuite/smpi/mpich3-test/coll/scatterv.c
new file mode 100644 (file)
index 0000000..6d8aa94
--- /dev/null
@@ -0,0 +1,190 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+/* Prototypes for picky compilers */
+void SetData ( double *, double *, int, int, int, int, int, int );
+int CheckData ( double *, int, int, int, int, int, int );
+/*
+   This is an example of using scatterv to send a matrix from one
+   process to all others, with the matrix stored in Fortran order.
+   Note the use of an explicit UB to enable the sources to overlap.
+
+   This tests scatterv to make sure that it uses the datatype size
+   and extent correctly.  It requires number of processors that
+   can be split with MPI_Dims_create.
+
+ */
+
+void SetData( double *sendbuf, double *recvbuf, int nx, int ny,
+              int myrow, int mycol, int nrow, int ncol )
+{
+    int coldim, i, j, m, k;
+    double *p;
+
+    if (myrow == 0 && mycol == 0) {
+        coldim = nx * nrow;
+        for (j=0; j<ncol; j++) {
+            for (i=0; i<nrow; i++) {
+                p = sendbuf + i * nx + j * (ny * coldim);
+                for (m=0; m<ny; m++) {
+                    for (k=0; k<nx; k++) {
+                        p[k] = 1000 * j + 100 * i + m * nx + k;
+                    }
+                    p += coldim;
+                }
+            }
+        }
+    }
+    for (i=0; i<nx*ny; i++)
+        recvbuf[i] = -1.0;
+}
+
+int CheckData( double *recvbuf,
+               int nx, int ny, int myrow, int mycol, int nrow,
+               int expect_no_value )
+{
+    int coldim, m, k;
+    double *p, val;
+    int errs = 0;
+
+    coldim = nx;
+    p      = recvbuf;
+    for (m=0; m<ny; m++) {
+        for (k=0; k<nx; k++) {
+            /* If expect_no_value is true then we assume that the pre-scatterv
+             * value should remain in the recvbuf for our portion of the array.
+             * This is the case for the root process when using MPI_IN_PLACE. */
+            if (expect_no_value)
+                val = -1.0;
+            else
+                val = 1000 * mycol + 100 * myrow + m * nx + k;
+
+            if (p[k] != val) {
+                errs++;
+                if (errs < 10) {
+                    printf("Error in (%d,%d) [%d,%d] location, got %f expected %f\n",
+                            m, k, myrow, mycol, p[k], val );
+                }
+                else if (errs == 10) {
+                    printf( "Too many errors; suppressing printing\n" );
+                }
+            }
+        }
+        p += coldim;
+    }
+    return errs;
+}
+
+int main( int argc, char **argv )
+{
+    int rank, size, myrow, mycol, nx, ny, stride, cnt, i, j, errs, errs_in_place, tot_errs;
+    double    *sendbuf, *recvbuf;
+    MPI_Datatype vec, block, types[2];
+    MPI_Aint displs[2];
+    int      *scdispls;
+    int      blens[2];
+    MPI_Comm comm2d;
+    int dims[2], periods[2], coords[2], lcoords[2];
+    int *sendcounts;
+
+
+    MPI_Init( &argc, &argv );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+
+    /* Get a 2-d decomposition of the processes */
+    dims[0] = 0; dims[1] = 0;
+    MPI_Dims_create( size, 2, dims );
+    periods[0] = 0; periods[1] = 0;
+    MPI_Cart_create( MPI_COMM_WORLD, 2, dims, periods, 0, &comm2d );
+    MPI_Cart_get( comm2d, 2, dims, periods, coords );
+    myrow = coords[0];
+    mycol = coords[1];
+/*
+    if (rank == 0)
+        printf( "Decomposition is [%d x %d]\n", dims[0], dims[1] );
+*/
+
+    /* Get the size of the matrix */
+    nx = 10;
+    ny = 8;
+    stride = nx * dims[0];
+
+    recvbuf = (double *)malloc( nx * ny * sizeof(double) );
+    if (!recvbuf) {
+        MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    sendbuf = 0;
+    if (myrow == 0 && mycol == 0) {
+        sendbuf = (double *)malloc( nx * ny * size * sizeof(double) );
+        if (!sendbuf) {
+            MPI_Abort( MPI_COMM_WORLD, 1 );
+        }
+    }
+    sendcounts = (int *) malloc( size * sizeof(int) );
+    scdispls   = (int *)malloc( size * sizeof(int) );
+
+    MPI_Type_vector( ny, nx, stride, MPI_DOUBLE, &vec );
+    blens[0]  = 1;   blens[1] = 1;
+    types[0]  = vec; types[1] = MPI_UB;
+    displs[0] = 0;   displs[1] = nx * sizeof(double);
+
+    MPI_Type_struct( 2, blens, displs, types, &block );
+    MPI_Type_free( &vec );
+    MPI_Type_commit( &block );
+
+    /* Set up the transfer */
+    cnt     = 0;
+    for (i=0; i<dims[1]; i++) {
+        for (j=0; j<dims[0]; j++) {
+            sendcounts[cnt] = 1;
+            /* Using Cart_coords makes sure that ranks (used by
+               sendrecv) matches the cartesian coordinates (used to
+               set data in the matrix) */
+            MPI_Cart_coords( comm2d, cnt, 2, lcoords );
+            scdispls[cnt++] = lcoords[0] + lcoords[1] * (dims[0] * ny);
+        }
+    }
+
+    SetData( sendbuf, recvbuf, nx, ny, myrow, mycol, dims[0], dims[1] );
+    MPI_Scatterv( sendbuf, sendcounts, scdispls, block,
+                  recvbuf, nx * ny, MPI_DOUBLE, 0, comm2d );
+    if((errs = CheckData( recvbuf, nx, ny, myrow, mycol, dims[0], 0 ))) {
+        fprintf( stdout, "Failed to transfer data\n" );
+    }
+
+    /* once more, but this time passing MPI_IN_PLACE for the root */
+    SetData( sendbuf, recvbuf, nx, ny, myrow, mycol, dims[0], dims[1] );
+    MPI_Scatterv( sendbuf, sendcounts, scdispls, block,
+                  (rank == 0 ? MPI_IN_PLACE : recvbuf), nx * ny, MPI_DOUBLE, 0, comm2d );
+    errs_in_place = CheckData( recvbuf, nx, ny, myrow, mycol, dims[0], (rank == 0) );
+    if(errs_in_place) {
+        fprintf( stdout, "Failed to transfer data (MPI_IN_PLACE)\n" );
+    }
+
+    errs += errs_in_place;
+    MPI_Allreduce( &errs, &tot_errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+    if (rank == 0) {
+        if (tot_errs == 0)
+            printf( " No Errors\n" );
+        else
+            printf( "%d errors in use of MPI_SCATTERV\n", tot_errs );
+    }
+
+    if (sendbuf) free( sendbuf );
+    free( recvbuf );
+    free( sendcounts );
+    free( scdispls );
+    MPI_Type_free( &block );
+    MPI_Comm_free( &comm2d );
+    MPI_Finalize();
+    return errs;
+}
+
+
diff --git a/teshsuite/smpi/mpich3-test/coll/testlist b/teshsuite/smpi/mpich3-test/coll/testlist
new file mode 100644 (file)
index 0000000..34b9df9
--- /dev/null
@@ -0,0 +1,158 @@
+#needs MPI_Errhandler_set MPI_Type_get_name
+#allred 4
+#allred 7
+#allred 4 arg=100
+allredmany 4
+allred2 4
+allred3 10
+allred4 4
+allred5 5
+allred5 10
+allred6 4
+allred6 7
+reduce_mpich 5
+reduce_mpich 10
+reduce_local 2 mpiversion=2.2
+op_commutative 2
+red3 10
+red4 10
+alltoall1 8
+alltoallv 10
+alltoallv0 10
+#alltoallw1 10
+#alltoallw2 10
+#alltoallw_zeros 1
+#alltoallw_zeros 2
+#alltoallw_zeros 5
+#alltoallw_zeros 8
+allgather2 10
+allgather3 10
+allgatherv2 10
+allgatherv3 10
+#needs thread  factory
+allgatherv4 4 timeLimit=600
+bcasttest 4
+bcasttest 8
+bcasttest 10
+#uses MPI_Comm_dup
+#bcast2 4
+# More that 8 processes are required to get bcast to switch to the long
+# msg algorithm (see coll definitions in mpiimpl.h)
+#bcast2 10 timeLimit=420
+#bcast3 10 timeLimit=420
+bcastzerotype 1
+bcastzerotype 4
+bcastzerotype 5
+bcastzerotype 10
+coll2 5
+coll3 5
+coll4 4
+coll5 4
+coll6 5
+coll7 1
+coll7 2
+coll7 5
+coll8 4
+coll9 4
+coll10 4
+coll11 4
+coll12 4
+coll13 4
+longuser 4
+redscat 4
+redscat 6
+redscat2 4
+redscat2 5
+redscat2 10
+redscat3 8
+#intercomms
+#redscatinter 8
+red_scat_block 4 mpiversion=2.2
+red_scat_block 5 mpiversion=2.2
+red_scat_block 8 mpiversion=2.2
+red_scat_block2 4 mpiversion=2.2
+red_scat_block2 5 mpiversion=2.2
+red_scat_block2 10 mpiversion=2.2
+redscatblk3 8 mpiversion=2.2
+redscatblk3 10 mpiversion=2.2
+redscatbkinter 8 mpiversion=2.2
+redscatbkinter 10 mpiversion=2.2
+scantst 4
+exscan 10
+exscan2 5
+gather 4
+gather2 4
+scattern 4
+scatter2 4
+scatter3 4
+#uses dims, cart 
+#scatterv 4
+#icbcast 4
+#icbcast 10
+#icallreduce 5
+#icallreduce 7
+#icreduce 5
+#icreduce 7
+#icscatter 5
+#icscatter 7
+#icgather 5
+#icgather 7
+#icallgather 5
+#icallgather 7
+#icbarrier 5
+#icbarrier 7
+#icallgatherv 5
+#icallgatherv 7
+#icgatherv 5
+#icgatherv 7
+#icscatterv 5
+#icscatterv 7
+#icalltoall 5
+#icalltoall 7
+#icalltoallv 5
+#icalltoallv 7
+#icalltoallw 5
+#icalltoallw 7
+# the opxxx tests look at optional types, and are included for MPICH testing.
+# MPI implementations may instead signal errors for these types
+#opland 4
+#oplor 4
+#oplxor 4
+#oplxor 5
+#opband 4
+#opbor 4
+#opbxor 4
+#opbxor 5
+#opprod 5
+#opprod 6
+#opsum 4
+#opmin 4
+#opminloc 4
+#opmax 5
+#opmaxloc 5
+#uoplong 4
+#uoplong 11
+#uoplong 16
+nonblocking 4 mpiversion=3.0
+nonblocking 5 mpiversion=3.0
+nonblocking 10 mpiversion=3.0
+nonblocking2 1 mpiversion=3.0
+nonblocking2 4 mpiversion=3.0
+nonblocking2 5 mpiversion=3.0
+nonblocking2 10 timeLimit=420 mpiversion=3.0
+nonblocking3 1 mpiversion=3.0
+nonblocking3 4 mpiversion=3.0
+nonblocking3 5 mpiversion=3.0
+nonblocking3 10 timeLimit=600 mpiversion=3.0
+iallred 2 mpiversion=3.0
+# ibarrier will hang forever if it fails, but will complete quickly if it
+# succeeds
+ibarrier 2 mpiversion=3.0 timeLimit=30
+
+# run some of the tests, relinked with the nbc_pmpi_adaptor.o file
+nballtoall1 8 mpiversion=3.0
+nbcoll2 5     mpiversion=3.0
+nbredscat 4   mpiversion=3.0
+nbredscat 8   mpiversion=3.0
+nbredscat3 8  mpiversion=3.0
+nbredscatinter 8 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/coll/uoplong.c b/teshsuite/smpi/mpich3-test/coll/uoplong.c
new file mode 100644 (file)
index 0000000..39f857d
--- /dev/null
@@ -0,0 +1,109 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+/* 
+ * Test user-defined operations with a large number of elements.  
+ * Added because a talk at EuroMPI'12 claimed that these failed with
+ * more than 64k elements
+ */
+
+#define MAX_ERRS 10
+#define MAX_COUNT 1200000
+
+void myop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype );
+
+/* 
+ * myop takes a datatype that is a triple of doubles, and computes
+ * the sum, max, min of the respective elements of the triple.
+ */
+void myop( void *cinPtr, void *coutPtr, int *count, MPI_Datatype *dtype )
+{
+    int i, n = *count;
+    double const *cin = (double *)cinPtr;
+    double *cout = (double *)coutPtr;
+    
+    for (i=0; i<n; i++) {
+       cout[0] += cin[0];
+       cout[1] = (cout[1] > cin[1]) ? cout[1] : cin[1];
+       cout[2] = (cout[2] < cin[2]) ? cout[2] : cin[2];
+       cin  += 3;
+       cout += 3;
+    }
+}
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int wsize, wrank, i, count;
+    MPI_Datatype tripleType;
+    double *inVal, *outVal;
+    double maxval, sumval;
+    MPI_Op op;
+
+    MTest_Init( &argc, &argv );
+    MPI_Op_create( myop, 0, &op );
+    MPI_Type_contiguous( 3, MPI_DOUBLE, &tripleType );
+    MPI_Type_commit( &tripleType );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    for (count=1; count<MAX_COUNT; count += count) {
+       if (wrank == 0) 
+           MTestPrintfMsg( 1, "Count = %d\n", count );
+       inVal = (double *)malloc( 3 * count * sizeof(double) );
+       outVal = (double *)malloc( 3 * count * sizeof(double) );
+       if (!inVal || !outVal) {
+           fprintf( stderr, "Unable to allocated %d words for data\n", 
+                    3 * count );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       for (i=0; i<count*3; i++) {
+           outVal[i] = -1;
+           inVal[i]  = 1 + (i & 0x3);
+       }
+       MPI_Reduce( inVal, outVal, count, tripleType, op, 0, MPI_COMM_WORLD );
+       /* Check Result values */
+       if (wrank == 0) {
+           for (i=0; i<3*count; i+=3) {
+               sumval = wsize * (1 + (i & 0x3));
+               maxval = 1 + ((i+1) & 0x3);
+               if (outVal[i] != sumval) {
+                   if (errs < MAX_ERRS) 
+                       fprintf( stderr, "%d: outval[%d] = %f, expected %f (sum)\n", 
+                                count, i, outVal[i], sumval );
+                   errs++;
+               }
+               if (outVal[i+1] != maxval) {
+                   if (errs < MAX_ERRS) 
+                       fprintf( stderr, "%d: outval[%d] = %f, expected %f (max)\n", 
+                                count, i+1, outVal[i+1], maxval );
+                   errs++;
+               }
+               if (outVal[i+2] != 1 + ((i+2)&0x3)) {
+                   if (errs < MAX_ERRS) 
+                       fprintf( stderr, "%d: outval[%d] = %f, expected %f (min)\n", 
+                                count, i+2, outVal[i+2], (double)(1 + ((i+2)^0x3)) );
+                   errs++;
+               }
+           }
+       }
+
+       free( inVal );
+       free( outVal );
+    }
+    
+    MPI_Op_free( &op );
+    MPI_Type_free( &tripleType );
+    MTest_Finalize( errs );
+    MPI_Finalize( );
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/CMakeLists.txt b/teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
new file mode 100644 (file)
index 0000000..030ac6b
--- /dev/null
@@ -0,0 +1,108 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(cmfree cmfree.c ../util/mtest.c)
+  add_executable(cmsplit2 cmsplit2.c ../util/mtest.c)
+  add_executable(cmsplit cmsplit.c ../util/mtest.c)
+  add_executable(cmsplit_type cmsplit_type.c ../util/mtest.c)
+  add_executable(commcreate1 commcreate1.c ../util/mtest.c)
+  add_executable(comm_create_group comm_create_group.c ../util/mtest.c)
+  add_executable(comm_group_half comm_group_half.c ../util/mtest.c)
+  add_executable(comm_group_rand comm_group_rand.c ../util/mtest.c)
+ # add_executable(comm_idup comm_idup.c ../util/mtest.c)
+  add_executable(comm_info comm_info.c ../util/mtest.c)
+  add_executable(commname commname.c ../util/mtest.c)
+  add_executable(ctxalloc ctxalloc.c ../util/mtest.c)
+  add_executable(ctxsplit ctxsplit.c ../util/mtest.c)
+  add_executable(dup dup.c ../util/mtest.c)
+  add_executable(dupic dupic.c ../util/mtest.c)
+  add_executable(dup_with_info dup_with_info.c ../util/mtest.c)
+  add_executable(ic1 ic1.c ../util/mtest.c)
+  add_executable(ic2 ic2.c ../util/mtest.c)
+  add_executable(iccreate iccreate.c ../util/mtest.c)
+  add_executable(icgroup icgroup.c ../util/mtest.c)
+  add_executable(icm icm.c ../util/mtest.c)
+  add_executable(icsplit icsplit.c ../util/mtest.c)
+  add_executable(probe-intercomm probe-intercomm.c ../util/mtest.c)
+
+  target_link_libraries(cmfree  simgrid)
+  target_link_libraries(cmsplit2  simgrid)
+  target_link_libraries(cmsplit  simgrid)
+  target_link_libraries(cmsplit_type  simgrid)
+  target_link_libraries(commcreate1  simgrid)
+  target_link_libraries(comm_create_group  simgrid)
+  target_link_libraries(comm_group_half  simgrid)
+  target_link_libraries(comm_group_rand  simgrid)
+ # target_link_libraries(comm_idup  simgrid)
+  target_link_libraries(comm_info  simgrid)
+  target_link_libraries(commname  simgrid)
+  target_link_libraries(ctxalloc  simgrid)
+  target_link_libraries(ctxsplit  simgrid)
+  target_link_libraries(dup  simgrid)
+  target_link_libraries(dupic  simgrid)
+  target_link_libraries(dup_with_info  simgrid)
+  target_link_libraries(ic1  simgrid)
+  target_link_libraries(ic2  simgrid)
+  target_link_libraries(iccreate  simgrid)
+  target_link_libraries(icgroup  simgrid)
+  target_link_libraries(icm  simgrid)
+  target_link_libraries(icsplit  simgrid)
+  target_link_libraries(probe-intercomm  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmfree.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmsplit2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmsplit.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/cmsplit_type.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/commcreate1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/comm_create_group.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/comm_group_half.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/comm_group_rand.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/comm_idup.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/comm_info.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/commname.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/ctxalloc.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/ctxsplit.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/dup.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/dupic.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/dup_with_info.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/ic1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/ic2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/iccreate.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icgroup.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icm.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icsplit.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/probe-intercomm.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/comm/cmfree.c b/teshsuite/smpi/mpich3-test/comm/cmfree.c
new file mode 100644 (file)
index 0000000..df37772
--- /dev/null
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test that communicators have reference count semantics";
+*/
+
+#define NELM 128
+#define NCOMM 1020
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest, i;
+    MPI_Comm      comm;
+    MPI_Comm      tmpComm[NCOMM];
+    MPI_Status    status;
+    MPI_Request   req;
+    int           *buf=0;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_dup( MPI_COMM_WORLD, &comm );
+
+    /* This is similar to the datatype test, except that we post
+       an irecv on a simple data buffer but use a rank-reordered communicator.
+       In this case, an error in handling the reference count will most 
+       likely cause the program to hang, so this should be run only
+       if (a) you are confident that the code is correct or (b) 
+       a timeout is set for mpiexec 
+    */
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    if (size < 2) {
+       fprintf( stderr, "This test requires at least two processes." );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    source  = 0;
+    dest    = size - 1;
+
+    if (rank == dest) {
+       buf = (int *)malloc( NELM * sizeof(int) );
+       for (i=0; i<NELM; i++) buf[i] = -i;
+       MPI_Irecv( buf, NELM, MPI_INT, source, 0, comm, &req );
+       MPI_Comm_free( &comm );
+
+       if (comm != MPI_COMM_NULL) {
+           errs++;
+           printf( "Freed comm was not set to COMM_NULL\n" );
+       }
+
+       for (i=0; i<NCOMM; i++) {
+           MPI_Comm_split( MPI_COMM_WORLD, 0, size - rank, &tmpComm[i] );
+       }
+
+       MPI_Sendrecv( 0, 0, MPI_INT, source, 1, 
+                     0, 0, MPI_INT, source, 1, MPI_COMM_WORLD, &status );
+
+       MPI_Wait( &req, &status );
+       for (i=0; i<NELM; i++) {
+           if (buf[i] != i) {
+               errs++;
+               if (errs < 10) {
+                   printf( "buf[%d] = %d, expected %d\n", i, buf[i], i );
+               }
+           }
+       }
+       for (i=0; i<NCOMM; i++) {
+           MPI_Comm_free( &tmpComm[i] );
+       }
+       free( buf );
+    }
+    else if (rank == source) {
+       buf = (int *)malloc( NELM * sizeof(int) );
+       for (i=0; i<NELM; i++) buf[i] = i;
+
+       for (i=0; i<NCOMM; i++) {
+           MPI_Comm_split( MPI_COMM_WORLD, 0, size - rank, &tmpComm[i] );
+       }
+       /* Synchronize with the receiver */
+       MPI_Sendrecv( 0, 0, MPI_INT, dest, 1, 
+                     0, 0, MPI_INT, dest, 1, MPI_COMM_WORLD, &status );
+       MPI_Send( buf, NELM, MPI_INT, dest, 0, comm );
+       free( buf );
+    }
+    else {
+       for (i=0; i<NCOMM; i++) {
+           MPI_Comm_split( MPI_COMM_WORLD, 0, size - rank, &tmpComm[i] );
+       }
+    }
+
+    MPI_Barrier( MPI_COMM_WORLD );
+
+    if (rank != dest) {
+       /* Clean up the communicators */
+       for (i=0; i<NCOMM; i++) {
+           MPI_Comm_free( &tmpComm[i] );
+       }
+    }
+    if (comm != MPI_COMM_NULL) {
+       MPI_Comm_free( &comm );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/cmsplit.c b/teshsuite/smpi/mpich3-test/comm/cmsplit.c
new file mode 100644 (file)
index 0000000..c5f103e
--- /dev/null
@@ -0,0 +1,55 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test comm split";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, color, srank;
+    MPI_Comm      comm, scomm;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_dup( MPI_COMM_WORLD, &comm );
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    if (size < 4) {
+       fprintf( stderr, "This test requires at least four processes." );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    color = MPI_UNDEFINED;
+    if (rank < 2) color = 1;
+    MPI_Comm_split( comm, color, size - rank, &scomm );
+    
+    if (rank < 2) {
+       /* Check that the ranks are ordered correctly */
+       MPI_Comm_rank( scomm, &srank );
+       if (srank != 1 - rank) {
+           errs++;
+       }
+       MPI_Comm_free( &scomm );
+    }
+    else {
+       if (scomm != MPI_COMM_NULL) {
+           errs++;
+       }
+    }
+    MPI_Comm_free( &comm );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/cmsplit2.c b/teshsuite/smpi/mpich3-test/comm/cmsplit2.c
new file mode 100644 (file)
index 0000000..e711d29
--- /dev/null
@@ -0,0 +1,137 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test ensures that MPI_Comm_split breaks ties in key values by using the
+ * original rank in the input communicator.  This typically corresponds to
+ * the difference between using a stable sort or using an unstable sort.
+ *
+ * It checks all sizes from 1..comm_size(world)-1, so this test does not need to
+ * be run multiple times at process counts from a higher-level test driver. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpi.h"
+
+#define ERRLIMIT (10)
+
+#define my_assert(cond_)                                     \
+    do {                                                     \
+        if (!(cond_)) {                                      \
+            if (errs < ERRLIMIT)                             \
+                printf("assertion \"%s\" failed\n", #cond_); \
+            ++errs;                                          \
+        }                                                    \
+    } while (0)
+
+int main(int argc, char **argv)
+{
+    int i, j, pos, modulus, cs, rank, size;
+    int wrank, wsize;
+    int newrank, newsize;
+    int errs = 0;
+    int key;
+    int *oldranks = NULL;
+    int *identity = NULL;
+    int verbose = 0;
+    MPI_Comm comm, splitcomm;
+    MPI_Group wgroup, newgroup;
+
+    MPI_Init(&argc, &argv);
+
+    if (getenv("MPITEST_VERBOSE"))
+        verbose = 1;
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+
+    oldranks = malloc(wsize * sizeof(int));
+    identity = malloc(wsize * sizeof(int));
+    for (i = 0; i < wsize; ++i) {
+        identity[i] = i;
+    }
+
+    for (cs = 1; cs <= wsize; ++cs) {
+        /* yes, we are using comm_split to test comm_split, but this test is
+         * mainly about ensuring that the stable sort behavior is correct, not
+         * about whether the partitioning by color behavior is correct */
+        MPI_Comm_split(MPI_COMM_WORLD, (wrank < cs ? 0 : MPI_UNDEFINED), wrank, &comm);
+        if (comm != MPI_COMM_NULL) {
+            MPI_Comm_rank(comm, &rank);
+            MPI_Comm_size(comm, &size);
+
+            for (modulus = 1; modulus <= size; ++modulus) {
+                /* Divide all ranks into one of "modulus" equivalence classes.  Ranks in
+                 * output comm will be ordered first by class, then within the class by
+                 * rank in comm world. */
+                key = rank % modulus;
+
+                /* all pass same color, variable keys */
+                MPI_Comm_split(comm, 5, key, &splitcomm);
+                MPI_Comm_rank(splitcomm, &newrank);
+                MPI_Comm_size(splitcomm, &newsize);
+                my_assert(newsize == size);
+
+                MPI_Comm_group(MPI_COMM_WORLD, &wgroup);
+                MPI_Comm_group(splitcomm, &newgroup);
+                int gsize;
+                MPI_Group_size(newgroup, &gsize);
+                MPI_Group_translate_ranks(newgroup, size, identity, wgroup, oldranks);
+                MPI_Group_free(&wgroup);
+                MPI_Group_free(&newgroup);
+
+                if (splitcomm != MPI_COMM_NULL)
+                    MPI_Comm_free(&splitcomm);
+
+                /* now check that comm_split broke any ties correctly */
+                if (rank == 0) {
+                    if (verbose) {
+                        /* debugging code that is useful when the test fails */
+                        printf("modulus=%d oldranks={", modulus);
+                        for (i = 0; i < size - 1; ++i) {
+                            printf("%d,", oldranks[i]);
+                        }
+                        printf("%d} keys={", oldranks[i]);
+                        for (i = 0; i < size - 1; ++i) {
+                            printf("%d,", i % modulus);
+                        }
+                        printf("%d}\n", i % modulus);
+                    }
+
+                    pos = 0;
+                    for (i = 0; i < modulus; ++i) {
+                        /* there's probably a better way to write these loop bounds and
+                         * indices, but this is the first (correct) way that occurred to me */
+                        for (j = 0; j < (size / modulus + (i < size % modulus ? 1 : 0)); ++j) {
+                            if (errs < ERRLIMIT && oldranks[pos] != i+modulus*j) {
+                                printf("size=%d i=%d j=%d modulus=%d pos=%d i+modulus*j=%d oldranks[pos]=%d\n",
+                                       size, i, j, modulus, pos, i+modulus*j, oldranks[pos]);
+                            }
+                            my_assert(oldranks[pos] == i+modulus*j);
+                            ++pos;
+                        }
+                    }
+                }
+            }
+            MPI_Comm_free(&comm);
+        }
+    }
+
+    if (oldranks != NULL)
+        free(oldranks);
+    if (identity != NULL)
+        free(identity);
+
+    if (rank == 0) {
+        if (errs)
+            printf("found %d errors\n", errs);
+        else
+            printf(" No errors\n");
+    }
+
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/comm/cmsplit_type.c b/teshsuite/smpi/mpich3-test/comm/cmsplit_type.c
new file mode 100644 (file)
index 0000000..75d3e4b
--- /dev/null
@@ -0,0 +1,67 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+/* FIXME: This test only checks that the MPI_Comm_split_type routine
+   doesn't fail.  It does not check for correct behavior */
+
+int main(int argc, char *argv[])
+{
+    int rank, size, verbose=0;
+    int wrank;
+    MPI_Comm comm;
+
+    MPI_Init(&argc, &argv);
+
+    if (getenv("MPITEST_VERBOSE"))
+        verbose = 1;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    /* Check to see if MPI_COMM_TYPE_SHARED works correctly */
+    MPI_Comm_split_type(MPI_COMM_WORLD, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &comm);
+    if (comm == MPI_COMM_NULL)
+        printf("Expected a non-null communicator, but got MPI_COMM_NULL\n");
+    else {
+        MPI_Comm_rank(comm, &rank);
+        MPI_Comm_size(comm, &size);
+        if (rank == 0 && verbose)
+            printf("Created subcommunicator of size %d\n", size);
+        MPI_Comm_free(&comm);
+    }
+
+    /* Check to see if MPI_UNDEFINED is respected */
+    MPI_Comm_split_type(MPI_COMM_WORLD, (wrank % 2 == 0) ? MPI_COMM_TYPE_SHARED : MPI_UNDEFINED,
+                        0, MPI_INFO_NULL, &comm);
+    if ((wrank % 2) && (comm != MPI_COMM_NULL))
+        printf("Expected MPI_COMM_NULL, but did not get one\n");
+    if (wrank % 2 == 0) {
+        if (comm == MPI_COMM_NULL)
+            printf("Expected a non-null communicator, but got MPI_COMM_NULL\n");
+        else {
+            MPI_Comm_rank(comm, &rank);
+            MPI_Comm_size(comm, &size);
+            if (rank == 0 && verbose)
+                printf("Created subcommunicator of size %d\n", size);
+            MPI_Comm_free(&comm);
+        }
+    }
+
+    /* Use wrank because Comm_split_type may return more than one communicator
+       across the job, and if so, each will have a rank 0 entry.  Test 
+       output rules are for a single process to write the successful 
+       test (No Errors) output. */
+    if (wrank == 0)
+        printf(" No errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/comm_create_group.c b/teshsuite/smpi/mpich3-test/comm/comm_create_group.c
new file mode 100644 (file)
index 0000000..edce6bb
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
+int main(int argc, char *argv[])
+{
+    int size, rank, i, *excl;
+    MPI_Group world_group, even_group;
+    MPI_Comm  __attribute__((unused)) even_comm;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (size % 2) {
+        fprintf(stderr, "this program requires a multiple of 2 number of processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+    excl = malloc((size / 2) * sizeof(int));
+    assert(excl);
+
+    /* exclude the odd ranks */
+    for (i = 0; i < size / 2; i++)
+        excl[i] = (2 * i) + 1;
+
+    /* Create some groups */
+    MPI_Comm_group(MPI_COMM_WORLD, &world_group);
+    MPI_Group_excl(world_group, size / 2, excl, &even_group);
+    MPI_Group_free(&world_group);
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+    if (rank % 2 == 0) {
+        /* Even processes create a group for themselves */
+        MPI_Comm_create_group(MPI_COMM_WORLD, even_group, 0, &even_comm);
+        MPI_Barrier(even_comm);
+        MPI_Comm_free(&even_comm);
+    }
+#endif /* USE_STRICT_MPI */
+
+    MPI_Group_free(&even_group);
+    MPI_Barrier(MPI_COMM_WORLD);
+
+    if (rank == 0)
+        printf(" No errors\n");
+
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/comm_group_half.c b/teshsuite/smpi/mpich3-test/comm/comm_group_half.c
new file mode 100644 (file)
index 0000000..8302b58
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+int main(int argc, char **argv)
+{
+    int rank, size;
+    MPI_Group full_group, half_group;
+    int range[1][3];
+    MPI_Comm __attribute__((unused)) comm;
+
+    MPI_Init(NULL, NULL);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    MPI_Comm_group(MPI_COMM_WORLD, &full_group);
+    range[0][0] = 0;
+    range[0][1] = size / 2;
+    range[0][2] = 1;
+    MPI_Group_range_incl(full_group, 1, range, &half_group);
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+    if (rank <= size / 2) {
+        MPI_Comm_create_group(MPI_COMM_WORLD, half_group, 0, &comm);
+        MPI_Barrier(comm);
+        MPI_Comm_free(&comm);
+    }
+#endif /* USE_STRICT_MPI */
+
+    MPI_Group_free(&half_group);
+    MPI_Group_free(&full_group);
+
+    if (rank == 0)
+        printf(" No Errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/comm_group_rand.c b/teshsuite/smpi/mpich3-test/comm/comm_group_rand.c
new file mode 100644 (file)
index 0000000..22b7fdc
--- /dev/null
@@ -0,0 +1,64 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+#define LOOPS 100
+
+int main(int argc, char **argv)
+{
+    int rank, size, i, j, count;
+    MPI_Group full_group, sub_group;
+    int *included, *ranks;
+    MPI_Comm __attribute__((unused)) comm;
+
+    MPI_Init(NULL, NULL);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    ranks = malloc(size * sizeof(int));
+    included = malloc(size * sizeof(int));
+    MPI_Comm_group(MPI_COMM_WORLD, &full_group);
+
+    for (j = 0; j < LOOPS; j++) {
+        srand(j); /* Deterministic seed */
+
+        count = 0;
+        for (i = 0; i < size; i++) {
+            if (rand() % 2) { /* randomly include a rank */
+                included[i] = 1;
+                ranks[count++] = i;
+            }
+            else
+                included[i] = 0;
+        }
+
+        MPI_Group_incl(full_group, count, ranks, &sub_group);
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+        if (included[rank]) {
+            MPI_Comm_create_group(MPI_COMM_WORLD, sub_group, 0, &comm);
+            MPI_Barrier(comm);
+            MPI_Comm_free(&comm);
+        }
+#endif /* USE_STRICT_MPI */
+
+        MPI_Group_free(&sub_group);
+    }
+
+    MPI_Group_free(&full_group);
+
+    if (rank == 0)
+        printf(" No Errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/comm_idup.c b/teshsuite/smpi/mpich3-test/comm/comm_idup.c
new file mode 100644 (file)
index 0000000..0823943
--- /dev/null
@@ -0,0 +1,149 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* This is a temporary #ifdef to control whether we test this functionality.  A
+ * configure-test or similar would be better.  Eventually the MPI-3 standard
+ * will be released and this can be gated on a MPI_VERSION check */
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_IDUP 1
+#endif
+
+/* assert-like macro that bumps the err count and emits a message */
+#define check(x_)                                                                 \
+    do {                                                                          \
+        if (!(x_)) {                                                              \
+            ++errs;                                                               \
+            if (errs < 10) {                                                      \
+                fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
+            }                                                                     \
+        }                                                                         \
+    } while (0)
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+    int i;
+    int rank, size, lrank, lsize, rsize;
+    int buf[2];
+    MPI_Comm newcomm, ic, localcomm, stagger_comm;
+    MPI_Request rreq;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    if (size < 2) {
+        printf("this test requires at least 2 processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+#ifdef TEST_IDUP
+
+    /* test plan: make rank 0 wait in a blocking recv until all other processes
+     * have posted their MPI_Comm_idup ops, then post last.  Should ensure that
+     * idup doesn't block on the non-zero ranks, otherwise we'll get a deadlock.
+     */
+
+    if (rank == 0) {
+        for (i = 1; i < size; ++i) {
+            buf[0] = 0x01234567;
+            buf[1] = 0x89abcdef;
+            MPI_Recv(buf, 2, MPI_INT, i, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+        }
+        MPI_Comm_idup(MPI_COMM_WORLD, &newcomm, &rreq);
+        MPI_Wait(&rreq, MPI_STATUS_IGNORE);
+    }
+    else {
+        MPI_Comm_idup(MPI_COMM_WORLD, &newcomm, &rreq);
+        buf[0] = rank;
+        buf[1] = size + rank;
+        MPI_Ssend(buf, 2, MPI_INT, 0, 0, MPI_COMM_WORLD);
+        MPI_Wait(&rreq, MPI_STATUS_IGNORE);
+    }
+
+    /* do some communication to make sure that newcomm works */
+    buf[0] = rank;
+    buf[1] = 0xfeedface;
+    MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
+    check(buf[1] == (size * (size-1) / 2));
+
+    MPI_Comm_free(&newcomm);
+
+    /* now construct an intercomm and make sure we can dup that too */
+    MPI_Comm_split(MPI_COMM_WORLD, rank % 2, rank, &localcomm);
+    MPI_Intercomm_create(localcomm, 0, MPI_COMM_WORLD, (rank == 0 ? 1 : 0), 1234, &ic);
+
+    /* Create a communicator on just the "right hand group" of the intercomm in
+     * order to make it more likely to catch bugs related to incorrectly
+     * swapping the context_id and recvcontext_id in the idup code. */
+    stagger_comm = MPI_COMM_NULL;
+    if (rank % 2) {
+        MPI_Comm_dup(localcomm, &stagger_comm);
+    }
+
+    MPI_Comm_rank(ic, &lrank);
+    MPI_Comm_size(ic, &lsize);
+    MPI_Comm_remote_size(ic, &rsize);
+
+    /* Similar to above pattern, but all non-local-rank-0 processes send to
+     * remote rank 0.  Both sides participate in this way. */
+    if (lrank == 0) {
+        for (i = 1; i < rsize; ++i) {
+            buf[0] = 0x01234567;
+            buf[1] = 0x89abcdef;
+            MPI_Recv(buf, 2, MPI_INT, i, 0, ic, MPI_STATUS_IGNORE);
+        }
+        MPI_Comm_idup(ic, &newcomm, &rreq);
+        MPI_Wait(&rreq, MPI_STATUS_IGNORE);
+    }
+    else {
+        MPI_Comm_idup(ic, &newcomm, &rreq);
+        buf[0] = lrank;
+        buf[1] = lsize + lrank;
+        MPI_Ssend(buf, 2, MPI_INT, 0, 0, ic);
+        MPI_Wait(&rreq, MPI_STATUS_IGNORE);
+    }
+
+    /* do some communication to make sure that newcomm works */
+    buf[0] = lrank;
+    buf[1] = 0xfeedface;
+    MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
+    check(buf[1] == (rsize * (rsize-1) / 2));
+
+    /* free this down here, not before idup, otherwise it will undo our
+     * stagger_comm work */
+    MPI_Comm_free(&localcomm);
+
+    if (stagger_comm != MPI_COMM_NULL) {
+        MPI_Comm_free(&stagger_comm);
+    }
+    MPI_Comm_free(&newcomm);
+    MPI_Comm_free(&ic);
+
+#endif /* TEST_IDUP */
+
+    MPI_Reduce((rank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+    if (rank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+
+    MPI_Finalize();
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/comm/comm_info.c b/teshsuite/smpi/mpich3-test/comm/comm_info.c
new file mode 100644 (file)
index 0000000..d2044d4
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+#define VERBOSE 0
+
+int main(int argc, char **argv)
+{
+    int rank;
+    MPI_Info info_in, info_out;
+    int errors = 0, all_errors = 0;
+    MPI_Comm comm;
+    char __attribute__((unused)) invalid_key[] = "invalid_test_key";
+    char buf[MPI_MAX_INFO_VAL];
+    int flag;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    MPI_Info_create(&info_in);
+    MPI_Info_set(info_in, invalid_key, (char *) "true");
+
+    MPI_Comm_dup(MPI_COMM_WORLD, &comm);
+
+    MPI_Comm_set_info(comm, info_in);
+    MPI_Comm_get_info(comm, &info_out);
+
+    MPI_Info_get(info_out, invalid_key, MPI_MAX_INFO_VAL, buf, &flag);
+#ifndef USE_STRICT_MPI
+    /* Check if our invalid key was ignored.  Note, this check's MPICH's
+     * behavior, but this behavior may not be required for a standard
+     * conforming MPI implementation. */
+    if (flag) {
+        printf("%d: %s was not ignored\n", rank, invalid_key);
+        errors++;
+    }
+#endif
+
+    MPI_Info_free(&info_in);
+    MPI_Info_free(&info_out);
+    MPI_Comm_free(&comm);
+
+    MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+
+    if (rank == 0 && all_errors == 0)
+        printf(" No Errors\n");
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/commcreate1.c b/teshsuite/smpi/mpich3-test/comm/commcreate1.c
new file mode 100644 (file)
index 0000000..edb60fd
--- /dev/null
@@ -0,0 +1,139 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <string.h>
+#include "mpitest.h"
+
+/* Check that Communicators can be created from various subsets of the
+   processes in the communicator.
+*/
+
+void abortMsg( const char *, int );
+int BuildComm( MPI_Comm, MPI_Group, const char [] );
+
+void abortMsg( const char *str, int code )
+{
+    char msg[MPI_MAX_ERROR_STRING];
+    int class, resultLen;
+
+    MPI_Error_class( code, &class );
+    MPI_Error_string( code, msg, &resultLen );
+    fprintf( stderr, "%s: errcode = %d, class = %d, msg = %s\n", 
+            str, code, class, msg );
+    MPI_Abort( MPI_COMM_WORLD, code );
+}
+
+int main( int argc, char *argv[] )
+{
+    MPI_Comm  dupWorld;
+    int       wrank, wsize, gsize, err, errs = 0;
+    int       ranges[1][3];
+    MPI_Group wGroup, godd, ghigh, geven;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    /* Create some groups */
+    MPI_Comm_group( MPI_COMM_WORLD, &wGroup );
+
+    MTestPrintfMsg( 2, "Creating groups\n" );
+    ranges[0][0] = 2*(wsize/2)-1;
+    ranges[0][1] = 1;
+    ranges[0][2] = -2;
+    err = MPI_Group_range_incl( wGroup, 1, ranges, &godd );
+    if (err) abortMsg( "Failed to create odd group: ", err );
+    err = MPI_Group_size( godd, &gsize );
+    if (err) abortMsg( "Failed to get size of odd group: ", err );
+    if (gsize != wsize/2) {
+       fprintf( stderr, "Group godd size is %d should be %d\n", gsize, 
+                wsize/2 );
+       errs++;
+    }
+
+    ranges[0][0] = wsize/2+1;
+    ranges[0][1] = wsize-1;
+    ranges[0][2] = 1;
+    err = MPI_Group_range_incl( wGroup, 1, ranges, &ghigh );
+    if (err) abortMsg( "Failed to create high group\n", err );
+    ranges[0][0] = 0;
+    ranges[0][1] = wsize-1;
+    ranges[0][2] = 2;
+    err = MPI_Group_range_incl( wGroup, 1, ranges, &geven );
+    if (err) abortMsg( "Failed to create even group:", err );
+
+    MPI_Comm_dup( MPI_COMM_WORLD, &dupWorld );
+    MPI_Comm_set_name( dupWorld, (char*)"Dup of world" );
+    /* First, use the groups to create communicators from world and a dup
+       of world */
+    errs += BuildComm( MPI_COMM_WORLD, ghigh, "ghigh" );
+    errs += BuildComm( MPI_COMM_WORLD, godd, "godd" );
+    errs += BuildComm( MPI_COMM_WORLD, geven, "geven" );
+    errs += BuildComm( dupWorld, ghigh, "ghigh" );
+    errs += BuildComm( dupWorld, godd, "godd" );
+    errs += BuildComm( dupWorld, geven, "geven" );
+
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* check that we can create multiple communicators from a single collective
+     * call to MPI_Comm_create as long as the groups are all disjoint */
+    errs += BuildComm( MPI_COMM_WORLD, (wrank % 2 ? godd : geven), "godd+geven" );
+    errs += BuildComm( dupWorld,       (wrank % 2 ? godd : geven), "godd+geven" );
+    errs += BuildComm( MPI_COMM_WORLD, MPI_GROUP_EMPTY, "MPI_GROUP_EMPTY" );
+    errs += BuildComm( dupWorld,       MPI_GROUP_EMPTY, "MPI_GROUP_EMPTY" );
+#endif
+
+    MPI_Comm_free( &dupWorld );
+    MPI_Group_free( &ghigh );
+    MPI_Group_free( &godd );
+    MPI_Group_free( &geven );
+    MPI_Group_free( &wGroup );
+
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+    return 0;
+}
+
+int BuildComm( MPI_Comm oldcomm, MPI_Group group, const char gname[] )
+{
+    MPI_Comm newcomm;
+    int grank, gsize, rank, size, errs = 0;
+    char cname[MPI_MAX_OBJECT_NAME+1];
+    int  cnamelen;
+
+    MPI_Group_rank( group, &grank );
+    MPI_Group_size( group, &gsize );
+    MPI_Comm_get_name( oldcomm, cname, &cnamelen );
+    MTestPrintfMsg( 2, "Testing comm %s from %s\n", cname, gname );
+    MPI_Comm_create( oldcomm, group, &newcomm );
+    if (newcomm == MPI_COMM_NULL && grank != MPI_UNDEFINED) {
+       errs ++;
+       fprintf( stderr, "newcomm is null but process is in group\n" );
+    }
+    if (newcomm != MPI_COMM_NULL && grank == MPI_UNDEFINED) {
+       errs ++;
+       fprintf( stderr, "newcomm is not null but process is not in group\n" );
+    }
+    if (newcomm != MPI_COMM_NULL && grank != MPI_UNDEFINED) {
+       MPI_Comm_rank( newcomm, &rank );
+       if (rank != grank) {
+           errs ++;
+           fprintf( stderr, "Rank is %d should be %d in comm from %s\n", 
+                    rank, grank, gname );
+       }
+       MPI_Comm_size( newcomm, &size );
+       if (size != gsize) {
+           errs++;
+           fprintf( stderr, "Size is %d should be %d in comm from %s\n",
+                    size, gsize, gname );
+       }
+       MPI_Comm_free( &newcomm );
+       MTestPrintfMsg( 2, "Done testing comm %s from %s\n", cname, gname );
+    }
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/commname.c b/teshsuite/smpi/mpich3-test/comm/commname.c
new file mode 100644 (file)
index 0000000..6a7a736
--- /dev/null
@@ -0,0 +1,64 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    MPI_Comm comm;
+    int cnt, rlen;
+    char name[MPI_MAX_OBJECT_NAME], nameout[MPI_MAX_OBJECT_NAME];
+    MTest_Init( &argc, &argv );
+
+    /* Check world and self firt */
+    nameout[0] = 0;
+    MPI_Comm_get_name( MPI_COMM_WORLD, nameout, &rlen );
+    if (strcmp(nameout,"MPI_COMM_WORLD")) {
+       errs++;
+       printf( "Name of comm world is %s, should be MPI_COMM_WORLD\n", 
+               nameout );
+    }
+
+    nameout[0] = 0;
+    MPI_Comm_get_name( MPI_COMM_SELF, nameout, &rlen );
+    if (strcmp(nameout,"MPI_COMM_SELF")) {
+       errs++;
+       printf( "Name of comm self is %s, should be MPI_COMM_SELF\n", 
+               nameout );
+    }
+
+    /* Now, handle other communicators, including world/self */
+    cnt = 0;
+    while (MTestGetComm( &comm, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+    
+       sprintf( name, "comm-%d", cnt );
+       cnt++;
+       MPI_Comm_set_name( comm, name );
+       nameout[0] = 0;
+       MPI_Comm_get_name( comm, nameout, &rlen );
+       if (strcmp( name, nameout )) {
+           errs++;
+           printf( "Unexpected name, was %s but should be %s\n",
+                   nameout, name );
+       }
+       
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/ctxalloc.c b/teshsuite/smpi/mpich3-test/comm/ctxalloc.c
new file mode 100644 (file)
index 0000000..ef66be3
--- /dev/null
@@ -0,0 +1,62 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+ * This program tests the allocation (and deallocation) of contexts.
+ * 
+ */
+int main( int argc, char **argv )
+{
+    int errs = 0;
+    int i, j, err;
+    MPI_Comm newcomm1, newcomm2[200];
+
+    MTest_Init( &argc, &argv );
+
+    /* Get a separate communicator to duplicate */
+    MPI_Comm_dup( MPI_COMM_WORLD, &newcomm1 );
+
+    MPI_Errhandler_set( newcomm1, MPI_ERRORS_RETURN );
+    /* Allocate many communicators in batches, then free them */
+    for (i=0; i<1000; i++) {
+       for (j=0; j<200; j++) {
+           err = MPI_Comm_dup( newcomm1, &newcomm2[j] );
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   fprintf( stderr, "Failed to duplicate communicator for (%d,%d)\n", i, j );
+                   MTestPrintError( err );
+               }
+           }
+       }
+       for (j=0; j<200; j++) {
+           err = MPI_Comm_free( &newcomm2[j] );
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   fprintf( stderr, "Failed to free %d,%d\n", i, j );
+                   MTestPrintError( err );
+               }
+           }
+       }
+    }
+    err = MPI_Comm_free( &newcomm1 );
+    if (err) {
+       errs++;
+       fprintf( stderr, "Failed to free newcomm1\n" );
+       MTestPrintError( err );
+    }
+      
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/ctxsplit.c b/teshsuite/smpi/mpich3-test/comm/ctxsplit.c
new file mode 100644 (file)
index 0000000..4e73dc5
--- /dev/null
@@ -0,0 +1,80 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+ * This check is intended to fail if there is a leak of context ids.  
+ * Because this is trying to exhaust the number of context ids, it needs
+ * to run for a longer time than many tests.  The for loop uses 100,000 
+ * iterations, which is adequate for MPICH (with only about 1k context ids
+ * available).
+ */
+
+int main(int argc, char** argv) {
+
+   int      i=0;
+   int      randval;
+   int      rank;
+   int      errs = 0;
+   MPI_Comm newcomm;
+   double   startTime;
+   int      nLoop = 100000;
+   
+   MTest_Init(&argc,&argv);
+
+   for (i=1; i<argc; i++) {
+       if (strcmp( argv[i], "--loopcount" ) == 0)  {
+          i++;
+          nLoop = atoi( argv[i] );
+       }
+       else {
+          fprintf( stderr, "Unrecognized argument %s\n", argv[i] );
+       }
+   }
+
+   MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+
+   startTime = MPI_Wtime();
+   for (i=0; i<nLoop; i++) {
+       
+       if ( rank == 0 && (i%100 == 0) ) {
+          double rate = MPI_Wtime() - startTime;
+          if (rate > 0) {
+              rate = i / rate;
+              MTestPrintfMsg( 10, "After %d (%f)\n", i, rate );
+          }
+          else {
+              MTestPrintfMsg( 10, "After %d\n", i );
+          }
+       }
+       
+       /* FIXME: Explain the rationale behind rand in this test */
+       randval=rand();
+       
+       if (randval%(rank+2) == 0) {
+          MPI_Comm_split(MPI_COMM_WORLD,1,rank,&newcomm);
+          MPI_Comm_free( &newcomm );
+       }
+       else {
+          MPI_Comm_split(MPI_COMM_WORLD,MPI_UNDEFINED,rank,&newcomm);
+          if (newcomm != MPI_COMM_NULL) {
+              errs++;
+              printf( "Created a non-null communicator with MPI_UNDEFINED\n" );
+          }
+       }
+       
+   }
+   
+   MTest_Finalize( errs );
+   MPI_Finalize();
+   
+   return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/dup.c b/teshsuite/smpi/mpich3-test/comm/dup.c
new file mode 100644 (file)
index 0000000..a30975f
--- /dev/null
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char **argv )
+{
+    int errs = 0;
+    int rank, size, wrank, wsize, dest, a, b;
+    MPI_Comm newcomm;
+    MPI_Status status;
+
+    MTest_Init( &argc, &argv );
+
+    /* Can we run comm dup at all? */
+    MPI_Comm_dup( MPI_COMM_WORLD, &newcomm );
+
+    /* Check basic properties */
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    MPI_Comm_size( newcomm, &size );
+    MPI_Comm_rank( newcomm, &rank );
+    
+    if (size != wsize || rank != wrank) {
+       errs++;
+       fprintf( stderr, "Size (%d) or rank (%d) wrong\n", size, rank );
+       fflush( stderr );
+    }
+
+    /* Can we communicate with this new communicator? */
+    dest = MPI_PROC_NULL;
+    if (rank == 0) {
+       dest = size - 1;
+       a = rank;
+       b = -1;
+       MPI_Sendrecv( &a, 1, MPI_INT, dest, 0,
+                     &b, 1, MPI_INT, dest, 0, newcomm, &status );
+       if (b != dest) {
+           errs++;
+           fprintf( stderr, "Received %d expected %d on %d\n", b, dest, rank );
+           fflush( stderr );
+       }
+       if (status.MPI_SOURCE != dest) {
+           errs++;
+           fprintf( stderr, "Source not set correctly in status on %d\n", 
+                    rank );
+           fflush( stderr );
+       }
+    }
+    else if (rank == size-1) { 
+       dest = 0;
+       a = rank;
+       b = -1;
+       MPI_Sendrecv( &a, 1, MPI_INT, dest, 0,
+                     &b, 1, MPI_INT, dest, 0, newcomm, &status );
+       if (b != dest) {
+           errs++;
+           fprintf( stderr, "Received %d expected %d on %d\n", b, dest, rank );
+           fflush( stderr );
+       }
+       if (status.MPI_SOURCE != dest) {
+           errs++;
+           fprintf( stderr, "Source not set correctly in status on %d\n", 
+                    rank );
+           fflush( stderr );
+       }
+    }
+
+    MPI_Comm_free( &newcomm );
+
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/dup_with_info.c b/teshsuite/smpi/mpich3-test/comm/dup_with_info.c
new file mode 100644 (file)
index 0000000..e63acaa
--- /dev/null
@@ -0,0 +1,108 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+int run_tests(MPI_Comm comm);
+int run_tests(MPI_Comm comm)
+{
+    int rank, size, wrank, wsize, dest, a, b, errs = 0;
+    MPI_Status status;
+
+    /* Check basic properties */
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(comm, &size);
+    MPI_Comm_rank(comm, &rank);
+
+    if (size != wsize || rank != wrank) {
+        errs++;
+        fprintf(stderr, "Size (%d) or rank (%d) wrong\n", size, rank);
+        fflush(stderr);
+    }
+
+    MPI_Barrier(comm);
+
+    /* Can we communicate with this new communicator? */
+    dest = MPI_PROC_NULL;
+    if (rank == 0) {
+        dest = size - 1;
+        a = rank;
+        b = -1;
+        MPI_Sendrecv(&a, 1, MPI_INT, dest, 0, &b, 1, MPI_INT, dest, 0, comm, &status);
+        if (b != dest) {
+            errs++;
+            fprintf(stderr, "Received %d expected %d on %d\n", b, dest, rank);
+            fflush(stderr);
+        }
+        if (status.MPI_SOURCE != dest) {
+            errs++;
+            fprintf(stderr, "Source not set correctly in status on %d\n", rank);
+            fflush(stderr);
+        }
+    }
+    else if (rank == size - 1) {
+        dest = 0;
+        a = rank;
+        b = -1;
+        MPI_Sendrecv(&a, 1, MPI_INT, dest, 0, &b, 1, MPI_INT, dest, 0, comm, &status);
+        if (b != dest) {
+            errs++;
+            fprintf(stderr, "Received %d expected %d on %d\n", b, dest, rank);
+            fflush(stderr);
+        }
+        if (status.MPI_SOURCE != dest) {
+            errs++;
+            fprintf(stderr, "Source not set correctly in status on %d\n", rank);
+            fflush(stderr);
+        }
+    }
+
+    MPI_Barrier(comm);
+
+    return errs;
+}
+
+int main(int argc, char **argv)
+{
+    int total_errs = 0;
+    MPI_Comm newcomm;
+    MPI_Info info;
+
+    MTest_Init(&argc, &argv);
+
+    /* Dup with no info */
+    MPI_Comm_dup_with_info(MPI_COMM_WORLD, MPI_INFO_NULL, &newcomm);
+    total_errs += run_tests(newcomm);
+    MPI_Comm_free(&newcomm);
+
+    /* Dup with info keys */
+    MPI_Info_create(&info);
+    MPI_Info_set(info, (char *) "host", (char *) "myhost.myorg.org");
+    MPI_Info_set(info, (char *) "file", (char *) "runfile.txt");
+    MPI_Info_set(info, (char *) "soft", (char *) "2:1000:4,3:1000:7");
+    MPI_Comm_dup_with_info(MPI_COMM_WORLD, info, &newcomm);
+    total_errs += run_tests(newcomm);
+    MPI_Info_free(&info);
+    MPI_Comm_free(&newcomm);
+
+    /* Dup with deleted info keys */
+    MPI_Info_create(&info);
+    MPI_Info_set(info, (char *) "host", (char *) "myhost.myorg.org");
+    MPI_Info_set(info, (char *) "file", (char *) "runfile.txt");
+    MPI_Info_set(info, (char *) "soft", (char *) "2:1000:4,3:1000:7");
+    MPI_Comm_dup_with_info(MPI_COMM_WORLD, info, &newcomm);
+    MPI_Info_free(&info);
+    total_errs += run_tests(newcomm);
+    MPI_Comm_free(&newcomm);
+
+    MTest_Finalize(total_errs);
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/dupic.c b/teshsuite/smpi/mpich3-test/comm/dupic.c
new file mode 100644 (file)
index 0000000..8a79fb5
--- /dev/null
@@ -0,0 +1,95 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    MPI_Comm comm, dupcomm, dupcomm2;
+    MPI_Request rreq[2];
+    int count;
+    int indicies[2];
+    int r1buf, r2buf, s1buf, s2buf;
+    int rank, isLeft;
+
+    MTest_Init( &argc, &argv );
+    
+    while (MTestGetIntercomm( &comm, &isLeft, 2 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_dup( comm, &dupcomm );
+       
+       /* Check that there are separate contexts.  We do this by setting
+          up nonblocking received on both communicators, and then
+          sending to them.  If the contexts are different, tests on the
+          unsatisfied communicator should indicate no available message */
+       MPI_Comm_rank( comm, &rank );
+       if (rank == 0) {
+           s1buf = 456;
+           s2buf = 17;
+           r1buf = r2buf = -1;
+           /* These are send/receives to the process with rank zero 
+              in the other group (these are intercommunicators) */
+           MPI_Irecv( &r1buf, 1, MPI_INT, 0, 0, dupcomm, &rreq[0] );
+           MPI_Irecv( &r2buf, 1, MPI_INT, 0, 0, comm, &rreq[1] );
+           MPI_Send( &s2buf, 1, MPI_INT, 0, 0, comm );
+           MPI_Waitsome(2, rreq, &count, indicies, MPI_STATUSES_IGNORE);
+           if (count != 1 || indicies[0] != 1) {
+               /* The only valid return is that exactly one message
+                  has been received */
+               errs++;
+               if (count == 1 && indicies[0] != 1) {
+                   printf( "Error in context values for intercomm\n" );
+               }
+               else if (count == 2) {
+                   printf( "Error: two messages received!\n" );
+               }
+               else {
+                   int i;
+                   printf( "Error: count = %d", count );
+                   for (i=0; i<count; i++) {
+                       printf( " indicies[%d] = %d", i, indicies[i] );
+                   }
+                   printf( "\n" );
+               }
+           }
+               
+           /* Make sure that we do not send the next message until 
+              the other process (rank zero in the other group) 
+              has also completed the first step */
+           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_BYTE, 0, 37,
+                         MPI_BOTTOM, 0, MPI_BYTE, 0, 37, comm, 
+                         MPI_STATUS_IGNORE );
+
+           /* Complete the receive on dupcomm */
+           MPI_Send( &s1buf, 1, MPI_INT, 0, 0, dupcomm );
+           MPI_Wait( &rreq[0], MPI_STATUS_IGNORE );
+           if (r1buf != s1buf) {
+               errs++;
+               printf( "Wrong value in communication on dupcomm %d != %d\n",
+                       r1buf, s1buf );
+           }
+           if (r2buf != s2buf) {
+               errs++;
+               printf( "Wrong value in communication on comm %d != %d\n",
+                       r2buf, s2buf );
+           }
+       }
+       /* Try to duplicate a duplicated intercomm.  (This caused problems
+        with some MPIs) */
+       MPI_Comm_dup( dupcomm, &dupcomm2 );
+       MPI_Comm_free( &dupcomm2 );
+       MPI_Comm_free( &dupcomm );
+       MTestFreeComm( &comm );
+    }
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/ic1.c b/teshsuite/smpi/mpich3-test/comm/ic1.c
new file mode 100644 (file)
index 0000000..7ab4e6e
--- /dev/null
@@ -0,0 +1,61 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*
+ * A simple test of the intercomm create routine, with a communication test
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    MPI_Comm intercomm;
+    int      remote_rank, rank, size, errs = 0;
+
+    MTest_Init( &argc, &argv );
+
+
+
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    if (size < 2) {
+       printf( "Size must be at least 2\n" );
+       MPI_Abort( MPI_COMM_WORLD, 0 );
+    }
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    /* Make an intercomm of the first two elements of comm_world */
+    if (rank < 2) {
+       int lrank = rank, rrank = -1;
+       MPI_Status status;
+
+       remote_rank = 1 - rank;
+       MPI_Intercomm_create( MPI_COMM_SELF, 0,
+                             MPI_COMM_WORLD, remote_rank, 27, 
+                             &intercomm );
+
+       /* Now, communicate between them */
+       MPI_Sendrecv( &lrank, 1, MPI_INT, 0, 13, 
+                     &rrank, 1, MPI_INT, 0, 13, intercomm, &status );
+
+       if (rrank != remote_rank) {
+           errs++;
+           printf( "%d Expected %d but received %d\n", 
+                   rank, remote_rank, rrank );
+       }
+
+       MPI_Comm_free( &intercomm );
+    }
+    
+    /* The next test should create an intercomm with groups of different
+       sizes FIXME */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/ic2.c b/teshsuite/smpi/mpich3-test/comm/ic2.c
new file mode 100644 (file)
index 0000000..8385648
--- /dev/null
@@ -0,0 +1,96 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* regression test for ticket #1574
+ *
+ * Based on test code from N. Radclif @ Cray. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+
+int main(int argc, char **argv)
+{
+    MPI_Comm c0, c1, ic;
+    MPI_Group g0, g1, gworld;
+    int a, b, c, d;
+    int rank, size, remote_leader, tag;
+    int ranks[2];
+    int errs = 0;
+
+    tag = 5;
+    c0 = c1 = ic = MPI_COMM_NULL;
+    g0 = g1 = gworld = MPI_GROUP_NULL;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    if (size < 33) {
+        printf("ERROR: this test requires at least 33 processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+        return 1;
+    }
+
+    /* group of c0
+     * NOTE: a>=32 is essential for exercising the loop bounds bug from tt#1574 */
+    a = 32;
+    b = 24;
+
+    /* group of c1 */
+    c = 25;
+    d = 26;
+
+    MPI_Comm_group(MPI_COMM_WORLD, &gworld);
+
+    ranks[0] = a;
+    ranks[1] = b;
+    MPI_Group_incl(gworld, 2, ranks, &g0);
+    MPI_Comm_create(MPI_COMM_WORLD, g0, &c0);
+
+    ranks[0] = c;
+    ranks[1] = d;
+    MPI_Group_incl(gworld, 2, ranks, &g1);
+    MPI_Comm_create(MPI_COMM_WORLD, g1, &c1);
+
+    if (rank == a || rank == b) {
+        remote_leader = c;
+        MPI_Intercomm_create(c0, 0, MPI_COMM_WORLD, remote_leader, tag, &ic);
+    }
+    else if (rank == c || rank == d) {
+        remote_leader = a;
+        MPI_Intercomm_create(c1, 0, MPI_COMM_WORLD, remote_leader, tag, &ic);
+    }
+
+    MPI_Group_free(&g0);
+    MPI_Group_free(&g1);
+    MPI_Group_free(&gworld);
+
+    if (c0 != MPI_COMM_NULL)
+        MPI_Comm_free(&c0);
+    if (c1 != MPI_COMM_NULL)
+        MPI_Comm_free(&c1);
+    if (ic != MPI_COMM_NULL)
+        MPI_Comm_free(&ic);
+
+
+    MPI_Reduce((rank == 0 ? MPI_IN_PLACE : &errs), &errs,
+               1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+    if (rank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+    MPI_Finalize();
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/comm/iccreate.c b/teshsuite/smpi/mpich3-test/comm/iccreate.c
new file mode 100644 (file)
index 0000000..4b3cedd
--- /dev/null
@@ -0,0 +1,216 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+ * This program tests that MPI_Comm_create applies to intercommunicators;
+ * this is an extension added in MPI-2
+ */
+
+int TestIntercomm( MPI_Comm );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size, isLeft, wrank;
+    MPI_Comm intercomm, newcomm;
+    MPI_Group oldgroup, newgroup;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    if (size < 4) {
+       printf( "This test requires at least 4 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    while (MTestGetIntercomm( &intercomm, &isLeft, 2 )) {
+       int ranks[10], nranks, result;
+
+        if (intercomm == MPI_COMM_NULL) continue;
+
+        MPI_Comm_group( intercomm, &oldgroup );
+       ranks[0] = 0;
+       nranks   = 1;
+       MTestPrintfMsg( 1, "Creating a new intercomm 0-0\n" );
+       MPI_Group_incl( oldgroup, nranks, ranks, &newgroup );
+       MPI_Comm_create( intercomm, newgroup, &newcomm );
+
+       /* Make sure that the new communicator has the appropriate pieces */
+       if (newcomm != MPI_COMM_NULL) {
+           int new_rsize, new_size, flag, commok = 1;
+
+           MPI_Comm_set_name( newcomm, (char*)"Single rank in each group" );
+           MPI_Comm_test_inter( intercomm, &flag );
+           if (!flag) {
+               errs++;
+               printf( "[%d] Output communicator is not an intercomm\n",
+                       wrank );
+               commok = 0;
+           }
+
+           MPI_Comm_remote_size( newcomm, &new_rsize );
+           MPI_Comm_size( newcomm, &new_size );
+           /* The new communicator has 1 process in each group */
+           if (new_rsize != 1) {
+               errs++;
+               printf( "[%d] Remote size is %d, should be one\n", 
+                       wrank, new_rsize );
+               commok = 0;
+           }
+           if (new_size != 1) {
+               errs++;
+               printf( "[%d] Local size is %d, should be one\n", 
+                       wrank, new_size );
+               commok = 0;
+           }
+           /* ... more to do */
+           if (commok) {
+               errs += TestIntercomm( newcomm );
+           }
+       }
+       MPI_Group_free( &newgroup );
+       if (newcomm != MPI_COMM_NULL) {
+           MPI_Comm_free( &newcomm );
+       }
+
+       /* Now, do a sort of dup, using the original group */
+       MTestPrintfMsg( 1, "Creating a new intercomm (manual dup)\n" );
+       MPI_Comm_create( intercomm, oldgroup, &newcomm );
+       MPI_Comm_set_name( newcomm, (char*)"Dup of original" );
+       MTestPrintfMsg( 1, "Creating a new intercomm (manual dup (done))\n" );
+
+       MPI_Comm_compare( intercomm, newcomm, &result );
+       MTestPrintfMsg( 1, "Result of comm/intercomm compare is %d\n", result );
+       if (result != MPI_CONGRUENT) {
+           const char *rname=0;
+           errs++;
+           switch (result) {
+           case MPI_IDENT:     rname = "IDENT"; break;
+           case MPI_CONGRUENT: rname = "CONGRUENT"; break;
+           case MPI_SIMILAR:   rname = "SIMILAR"; break;
+           case MPI_UNEQUAL:   rname = "UNEQUAL"; break;
+           printf( "[%d] Expected MPI_CONGRUENT but saw %d (%s)", 
+                   wrank, result, rname ); fflush(stdout);
+           }
+       }
+       else {
+           /* Try to communication between each member of intercomm */
+           errs += TestIntercomm( newcomm );
+       }
+
+        if (newcomm != MPI_COMM_NULL) {
+            MPI_Comm_free(&newcomm);
+        }
+        /* test that an empty group in either side of the intercomm results in
+         * MPI_COMM_NULL for all members of the comm */
+        if (isLeft) {
+            /* left side reuses oldgroup, our local group in intercomm */
+            MPI_Comm_create(intercomm, oldgroup, &newcomm);
+        }
+        else {
+            /* right side passes MPI_GROUP_EMPTY */
+            MPI_Comm_create(intercomm, MPI_GROUP_EMPTY, &newcomm);
+        }
+        if (newcomm != MPI_COMM_NULL) {
+            printf("[%d] expected MPI_COMM_NULL, but got a different communicator\n", wrank); fflush(stdout);
+            errs++;
+        }
+
+        if (newcomm != MPI_COMM_NULL) {
+            MPI_Comm_free(&newcomm);
+        }
+       MPI_Group_free( &oldgroup );
+       MPI_Comm_free( &intercomm );
+    }
+
+    MTest_Finalize(errs);
+
+    MPI_Finalize();
+
+    return 0;
+}
+
+int TestIntercomm( MPI_Comm comm )
+{
+    int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
+    int errs = 0, wrank, nsize;
+    char commname[MPI_MAX_OBJECT_NAME+1];
+    MPI_Request *reqs;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    MPI_Comm_size( comm, &local_size );
+    MPI_Comm_remote_size( comm, &remote_size );
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_get_name( comm, commname, &nsize );
+
+    MTestPrintfMsg( 1, "Testing communication on intercomm '%s', remote_size=%d\n",
+                    commname, remote_size );
+
+    reqs = (MPI_Request *)malloc( remote_size * sizeof(MPI_Request) );
+    if (!reqs) {
+       printf( "[%d] Unable to allocated %d requests for testing intercomm %s\n", 
+               wrank, remote_size, commname );
+       errs++;
+       return errs;
+    }
+    bufs = (int **) malloc( remote_size * sizeof(int *) );
+    if (!bufs) {
+       printf( "[%d] Unable to allocated %d int pointers for testing intercomm %s\n", 
+               wrank, remote_size, commname );
+       errs++;
+       return errs;
+    }
+    bufmem = (int *) malloc( remote_size * 2 * sizeof(int) );
+    if (!bufmem) {
+       printf( "[%d] Unable to allocated %d int data for testing intercomm %s\n", 
+               wrank, 2*remote_size, commname );
+       errs++;
+       return errs;
+    }
+
+    /* Each process sends a message containing its own rank and the
+       rank of the destination with a nonblocking send.  Because we're using
+       nonblocking sends, we need to use different buffers for each isend */
+    /* NOTE: the send buffer access restriction was relaxed in MPI-2.2, although
+       it doesn't really hurt to keep separate buffers for our purposes */
+    for (j=0; j<remote_size; j++) {
+       bufs[j]    = &bufmem[2*j];
+       bufs[j][0] = rank;
+       bufs[j][1] = j;
+       MPI_Isend( bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j] );
+    }
+    MTestPrintfMsg( 2, "isends posted, about to recv\n" );
+
+    for (j=0; j<remote_size; j++) {
+       MPI_Recv( rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE );
+       if (rbuf[0] != j) {
+           printf( "[%d] Expected rank %d but saw %d in %s\n", 
+                   wrank, j, rbuf[0], commname );
+           errs++;
+       }
+       if (rbuf[1] != rank) {
+           printf( "[%d] Expected target rank %d but saw %d from %d in %s\n", 
+                   wrank, rank, rbuf[1], j, commname );
+           errs++;
+       }
+    }
+    if (errs) 
+       fflush(stdout);
+    MTestPrintfMsg( 2, "my recvs completed, about to waitall\n" );
+    MPI_Waitall( remote_size, reqs, MPI_STATUSES_IGNORE );
+
+    free( reqs );
+    free( bufs );
+    free( bufmem );
+
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/icgroup.c b/teshsuite/smpi/mpich3-test/comm/icgroup.c
new file mode 100644 (file)
index 0000000..f44e1fa
--- /dev/null
@@ -0,0 +1,54 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Get the group of an intercommunicator";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, grank, gsize;
+    int minsize = 2, isleft; 
+    MPI_Comm      comm;
+    MPI_Group     group;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntercomm( &comm, &isleft, minsize )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       MPI_Comm_group( comm, &group );
+       MPI_Group_rank( group, &grank );
+       MPI_Group_size( group, &gsize );
+       if (rank != grank) {
+           errs++;
+           fprintf( stderr, "Ranks of groups do not match %d != %d\n",
+                    rank, grank );
+       }
+       if (size != gsize) {
+           errs++;
+           fprintf( stderr, "Sizes of groups do not match %d != %d\n",
+                    size, gsize );
+       }
+       MPI_Group_free( &group );
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/icm.c b/teshsuite/smpi/mpich3-test/comm/icm.c
new file mode 100644 (file)
index 0000000..102c738
--- /dev/null
@@ -0,0 +1,107 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2004 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test intercomm merge, including the choice of the high value";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, rsize;
+    int nsize, nrank;
+    int minsize = 2;
+    int isLeft;
+    MPI_Comm      comm, comm1, comm2, comm3, comm4;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntercomm( &comm, &isLeft, minsize )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_remote_size( comm, &rsize );
+       MPI_Comm_size( comm, &size );
+
+       /* Try building intercomms */
+       MPI_Intercomm_merge( comm, isLeft, &comm1 );
+       /* Check the size and ranks */
+       MPI_Comm_size( comm1, &nsize );
+       MPI_Comm_rank( comm1, &nrank );
+       if (nsize != size + rsize) {
+           errs++;
+           printf( "(1) Comm size is %d but should be %d\n", nsize,
+                   size + rsize );
+           if (isLeft) {
+               /* The left processes should be high */
+               if (nrank != rsize + rank) {
+                   errs++;
+                   printf( "(1) rank for high process is %d should be %d\n",
+                           nrank, rsize + rank );
+               }
+           }
+           else {
+               /* The right processes should be low */
+               if (nrank != rank) {
+                   errs++;
+                   printf( "(1) rank for low process is %d should be %d\n",
+                           nrank, rank );
+               }
+           }
+       }
+       
+       MPI_Intercomm_merge( comm, !isLeft, &comm2 ); 
+       /* Check the size and ranks */
+       MPI_Comm_size( comm1, &nsize );
+       MPI_Comm_rank( comm1, &nrank );
+       if (nsize != size + rsize) {
+           errs++;
+           printf( "(2) Comm size is %d but should be %d\n", nsize,
+                   size + rsize );
+           if (!isLeft) {
+               /* The right processes should be high */
+               if (nrank != rsize + rank) {
+                   errs++;
+                   printf( "(2) rank for high process is %d should be %d\n",
+                           nrank, rsize + rank );
+               }
+           }
+           else {
+               /* The left processes should be low */
+               if (nrank != rank) {
+                   errs++;
+                   printf( "(2) rank for low process is %d should be %d\n",
+                           nrank, rank );
+               }
+           }
+       }
+       
+
+       MPI_Intercomm_merge( comm, 0, &comm3 ); 
+
+       MPI_Intercomm_merge( comm, 1, &comm4 ); 
+       
+       MPI_Comm_free( &comm1 );
+       MPI_Comm_free( &comm2 );
+       MPI_Comm_free( &comm3 ); 
+       MPI_Comm_free( &comm4 );
+      
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/icsplit.c b/teshsuite/smpi/mpich3-test/comm/icsplit.c
new file mode 100644 (file)
index 0000000..9ad2d51
--- /dev/null
@@ -0,0 +1,192 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+ * This program tests that MPI_Comm_split applies to intercommunicators;
+ * this is an extension added in MPI-2
+ */
+
+int TestIntercomm( MPI_Comm );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size, isLeft;
+    MPI_Comm intercomm, newcomm;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    if (size < 4) {
+       printf( "This test requires at least 4 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    while (MTestGetIntercomm( &intercomm, &isLeft, 2 )) {
+       int key, color;
+
+        if (intercomm == MPI_COMM_NULL) continue;
+
+       /* Split this intercomm.  The new intercomms contain the 
+          processes that had odd (resp even) rank in their local group
+          in the original intercomm */
+       MTestPrintfMsg( 1, "Created intercomm %s\n", MTestGetIntercommName() );
+       MPI_Comm_rank( intercomm, &key );
+       color = (key % 2);
+       MPI_Comm_split( intercomm, color, key, &newcomm );
+       /* Make sure that the new communicator has the appropriate pieces */
+       if (newcomm != MPI_COMM_NULL) {
+           int orig_rsize, orig_size, new_rsize, new_size;
+           int predicted_size, flag, commok=1;
+
+           MPI_Comm_test_inter( intercomm, &flag );
+           if (!flag) {
+               errs++;
+               printf( "Output communicator is not an intercomm\n" );
+               commok = 0;
+           }
+
+           MPI_Comm_remote_size( intercomm, &orig_rsize );
+           MPI_Comm_remote_size( newcomm, &new_rsize );
+           MPI_Comm_size( intercomm, &orig_size );
+           MPI_Comm_size( newcomm, &new_size );
+           /* The local size is 1/2 the original size, +1 if the 
+              size was odd and the color was even.  More precisely,
+              let n be the orig_size.  Then
+                               color 0     color 1
+              orig size even    n/2         n/2
+              orig size odd     (n+1)/2     n/2
+
+              However, since these are integer valued, if n is even,
+              then (n+1)/2 = n/2, so this table is much simpler:
+                               color 0     color 1
+              orig size even    (n+1)/2     n/2
+              orig size odd     (n+1)/2     n/2
+              
+           */
+           predicted_size = (orig_size + !color) / 2; 
+           if (predicted_size != new_size) {
+               errs++;
+               printf( "Predicted size = %d but found %d for %s (%d,%d)\n",
+                       predicted_size, new_size, MTestGetIntercommName(),
+                       orig_size, orig_rsize );
+               commok = 0;
+           }
+           predicted_size = (orig_rsize + !color) / 2;
+           if (predicted_size != new_rsize) {
+               errs++;
+               printf( "Predicted remote size = %d but found %d for %s (%d,%d)\n",
+                       predicted_size, new_rsize, MTestGetIntercommName(), 
+                       orig_size, orig_rsize );
+               commok = 0;
+           }
+           /* ... more to do */
+           if (commok) {
+               errs += TestIntercomm( newcomm );
+           }
+       }
+       else {
+           int orig_rsize;
+           /* If the newcomm is null, then this means that remote group
+              for this color is of size zero (since all processes in this 
+              test have been given colors other than MPI_UNDEFINED).
+              Confirm that here */
+           /* FIXME: ToDo */
+           MPI_Comm_remote_size( intercomm, &orig_rsize );
+           if (orig_rsize == 1) {
+               if (color == 0) {
+                   errs++;
+                   printf( "Returned null intercomm when non-null expected\n" );
+               }
+           }
+       }
+       if (newcomm != MPI_COMM_NULL) 
+           MPI_Comm_free( &newcomm );
+       MPI_Comm_free( &intercomm );
+    }
+    MTest_Finalize(errs);
+
+    MPI_Finalize();
+
+    return 0;
+}
+
+/* FIXME: This is copied from iccreate.  It should be in one place */
+int TestIntercomm( MPI_Comm comm )
+{
+    int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
+    int errs = 0, wrank, nsize;
+    char commname[MPI_MAX_OBJECT_NAME+1];
+    MPI_Request *reqs;
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    MPI_Comm_size( comm, &local_size );
+    MPI_Comm_remote_size( comm, &remote_size );
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_get_name( comm, commname, &nsize );
+
+    MTestPrintfMsg( 1, "Testing communication on intercomm %s\n", commname );
+    
+    reqs = (MPI_Request *)malloc( remote_size * sizeof(MPI_Request) );
+    if (!reqs) {
+       printf( "[%d] Unable to allocated %d requests for testing intercomm %s\n", 
+               wrank, remote_size, commname );
+       errs++;
+       return errs;
+    }
+    bufs = (int **) malloc( remote_size * sizeof(int *) );
+    if (!bufs) {
+       printf( "[%d] Unable to allocated %d int pointers for testing intercomm %s\n", 
+               wrank, remote_size, commname );
+       errs++;
+       return errs;
+    }
+    bufmem = (int *) malloc( remote_size * 2 * sizeof(int) );
+    if (!bufmem) {
+       printf( "[%d] Unable to allocated %d int data for testing intercomm %s\n", 
+               wrank, 2*remote_size, commname );
+       errs++;
+       return errs;
+    }
+
+    /* Each process sends a message containing its own rank and the
+       rank of the destination with a nonblocking send.  Because we're using
+       nonblocking sends, we need to use different buffers for each isend */
+    for (j=0; j<remote_size; j++) {
+       bufs[j]    = &bufmem[2*j];
+       bufs[j][0] = rank;
+       bufs[j][1] = j;
+       MPI_Isend( bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j] );
+    }
+
+    for (j=0; j<remote_size; j++) {
+       MPI_Recv( rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE );
+       if (rbuf[0] != j) {
+           printf( "[%d] Expected rank %d but saw %d in %s\n", 
+                   wrank, j, rbuf[0], commname );
+           errs++;
+       }
+       if (rbuf[1] != rank) {
+           printf( "[%d] Expected target rank %d but saw %d from %d in %s\n", 
+                   wrank, rank, rbuf[1], j, commname );
+           errs++;
+       }
+    }
+    if (errs) 
+       fflush(stdout);
+    MPI_Waitall( remote_size, reqs, MPI_STATUSES_IGNORE );
+
+    free( reqs );
+    free( bufs );
+    free( bufmem );
+
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/probe-intercomm.c b/teshsuite/smpi/mpich3-test/comm/probe-intercomm.c
new file mode 100644 (file)
index 0000000..edd56e2
--- /dev/null
@@ -0,0 +1,70 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test MPI_Probe() for an intercomm";
+*/
+#define MAX_DATA_LEN 100
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, recvlen, isLeft;
+    MPI_Status status;
+    int rank, size;
+    MPI_Comm  intercomm;
+    char buf[MAX_DATA_LEN];
+    const char *test_str = "test";
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+
+    if (size < 2) {
+       fprintf( stderr, "This test requires at least two processes." );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    while (MTestGetIntercomm( &intercomm, &isLeft, 2 )) {
+        if (intercomm == MPI_COMM_NULL) continue;
+
+        MPI_Comm_rank(intercomm, &rank);
+
+        /* 0 ranks on each side communicate, everyone else does nothing */
+        if(rank == 0) {
+            if (isLeft) {
+                recvlen = -1;
+                MPI_Probe(0, 0, intercomm, &status);
+                MPI_Get_count(&status, MPI_CHAR, &recvlen);
+                if (recvlen != (strlen(test_str) + 1)) {
+                    printf(" Error: recvlen (%d) != strlen(\"%s\")+1 (%d)\n", recvlen, test_str, (int)strlen(test_str) + 1);
+                    ++errs;
+                }
+                buf[0] = '\0';
+                MPI_Recv(buf, recvlen, MPI_CHAR, 0, 0, intercomm, &status);
+                if (strcmp(test_str,buf)) {
+                    printf(" Error: strcmp(test_str,buf)!=0\n");
+                    ++errs;
+                }
+            }
+            else {
+                strncpy(buf, test_str, 5);
+                MPI_Send(buf, strlen(buf)+1, MPI_CHAR, 0, 0, intercomm);
+            }
+        }
+        MTestFreeComm(&intercomm);
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/comm/testlist b/teshsuite/smpi/mpich3-test/comm/testlist
new file mode 100644 (file)
index 0000000..1e58a6f
--- /dev/null
@@ -0,0 +1,36 @@
+dup 2
+#needs MPI_Intercomm_create
+#dupic 4
+#works, but needs MPI_Comm_set_name
+commcreate1 8
+#needs MPI_Comm_set_name and MPI_Intercomm_create
+#commname 4
+#ic1 4
+# ic2 needs an unusually large number of processes (>= 33)
+#ic2 33
+#icgroup 8
+#icm 8
+#icsplit 8
+#iccreate 8
+ctxalloc 2 timeLimit=300
+ctxsplit 4 timeLimit=300
+cmfree 4
+cmsplit 4
+cmsplit2 12
+#probe-intercomm 2
+cmsplit_type 4 mpiversion=3.0
+comm_create_group 4 mpiversion=3.0
+comm_create_group 8 mpiversion=3.0
+comm_group_half 2 mpiversion=3.0
+comm_group_half 4 mpiversion=3.0
+comm_group_half 8 mpiversion=3.0
+comm_group_rand 2 mpiversion=3.0
+comm_group_rand 4 mpiversion=3.0
+comm_group_rand 8 mpiversion=3.0
+comm_idup 2 mpiversion=3.0
+comm_idup 4 mpiversion=3.0
+comm_idup 9 mpiversion=3.0
+dup_with_info 2 mpiversion=3.0
+dup_with_info 4 mpiversion=3.0
+dup_with_info 9 mpiversion=3.0
+comm_info 6 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9a95d09
--- /dev/null
@@ -0,0 +1,204 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(blockindexed-misc blockindexed-misc.c ../util/mtest.c)
+  add_executable(blockindexed-zero-count blockindexed-zero-count.c ../util/mtest.c)
+  add_executable(contents contents.c ../util/mtest.c)
+  add_executable(contigstruct contigstruct.c ../util/mtest.c)
+  add_executable(contig-zero-count contig-zero-count.c ../util/mtest.c)
+  add_executable(cxx-types cxx-types.c ../util/mtest.c)
+  add_executable(darray-cyclic darray-cyclic.c ../util/mtest.c)
+  add_executable(darray-pack darray-pack.c ../util/mtest.c)
+  add_executable(gaddress gaddress.c ../util/mtest.c)
+  add_executable(get-elements get-elements.c ../util/mtest.c)
+  add_executable(get-elements-pairtype get-elements-pairtype.c ../util/mtest.c)
+  add_executable(getpartelm getpartelm.c ../util/mtest.c)
+  add_executable(hindexed_block hindexed_block.c ../util/mtest.c)
+  add_executable(hindexed_block_contents hindexed_block_contents.c ../util/mtest.c)
+  add_executable(hindexed-zeros hindexed-zeros.c ../util/mtest.c)
+  add_executable(indexed-misc indexed-misc.c ../util/mtest.c)
+  add_executable(large-count large-count.c ../util/mtest.c)
+  add_executable(lbub lbub.c ../util/mtest.c)
+  add_executable(localpack localpack.c ../util/mtest.c)
+  add_executable(longdouble longdouble.c ../util/mtest.c)
+  add_executable(lots-of-types lots-of-types.c ../util/mtest.c)
+  add_executable(pairtype-pack pairtype-pack.c ../util/mtest.c)
+  add_executable(pairtype-size-extent pairtype-size-extent.c ../util/mtest.c)
+  add_executable(simple-commit simple-commit.c ../util/mtest.c)
+  add_executable(simple-pack simple-pack.c ../util/mtest.c)
+  add_executable(simple-pack-external simple-pack-external.c ../util/mtest.c)
+  add_executable(simple-resized simple-resized.c ../util/mtest.c)
+  add_executable(simple-size-extent simple-size-extent.c ../util/mtest.c)
+  add_executable(sizedtypes sizedtypes.c ../util/mtest.c)
+  add_executable(slice-pack slice-pack.c ../util/mtest.c)
+  add_executable(slice-pack-external slice-pack-external.c ../util/mtest.c)
+  add_executable(struct-derived-zeros struct-derived-zeros.c ../util/mtest.c)
+  add_executable(struct-empty-el struct-empty-el.c ../util/mtest.c)
+  add_executable(struct-ezhov struct-ezhov.c ../util/mtest.c)
+  add_executable(struct-no-real-types struct-no-real-types.c ../util/mtest.c)
+  add_executable(struct-pack struct-pack.c ../util/mtest.c)
+  add_executable(struct-verydeep struct-verydeep.c ../util/mtest.c)
+  add_executable(struct-zero-count struct-zero-count.c ../util/mtest.c)
+  add_executable(subarray subarray.c ../util/mtest.c)
+  add_executable(subarray-pack subarray-pack.c ../util/mtest.c)
+  add_executable(tfree tfree.c ../util/mtest.c)
+  add_executable(tmatchsize tmatchsize.c ../util/mtest.c)
+  add_executable(transpose-pack transpose-pack.c ../util/mtest.c)
+  add_executable(tresized2 tresized2.c ../util/mtest.c)
+  add_executable(tresized tresized.c ../util/mtest.c)
+  add_executable(triangular-pack triangular-pack.c ../util/mtest.c)
+  add_executable(typecommit typecommit.c ../util/mtest.c)
+  add_executable(typefree typefree.c ../util/mtest.c)
+  add_executable(typelb typelb.c ../util/mtest.c)
+  add_executable(typename typename.c ../util/mtest.c)
+  add_executable(unpack unpack.c ../util/mtest.c)
+  add_executable(unusual-noncontigs unusual-noncontigs.c ../util/mtest.c)
+  add_executable(zero-blklen-vector zero-blklen-vector.c ../util/mtest.c)
+  add_executable(zeroblks zeroblks.c ../util/mtest.c)
+  add_executable(zeroparms zeroparms.c ../util/mtest.c)
+
+  target_link_libraries(blockindexed-misc  simgrid)
+  target_link_libraries(blockindexed-zero-count  simgrid)
+  target_link_libraries(contents  simgrid)
+  target_link_libraries(contigstruct  simgrid)
+  target_link_libraries(contig-zero-count  simgrid)
+  target_link_libraries(cxx-types  simgrid)
+  target_link_libraries(darray-cyclic  simgrid)
+  target_link_libraries(darray-pack  simgrid)
+  target_link_libraries(gaddress  simgrid)
+  target_link_libraries(get-elements  simgrid)
+  target_link_libraries(get-elements-pairtype  simgrid)
+  target_link_libraries(getpartelm  simgrid)
+  target_link_libraries(hindexed_block  simgrid)
+  target_link_libraries(hindexed_block_contents  simgrid)
+  target_link_libraries(hindexed-zeros  simgrid)
+  target_link_libraries(indexed-misc  simgrid)
+  target_link_libraries(large-count  simgrid)
+  target_link_libraries(lbub  simgrid)
+  target_link_libraries(localpack  simgrid)
+  target_link_libraries(longdouble  simgrid)
+  target_link_libraries(lots-of-types  simgrid)
+  target_link_libraries(pairtype-pack  simgrid)
+  target_link_libraries(pairtype-size-extent  simgrid)
+  target_link_libraries(simple-commit  simgrid)
+  target_link_libraries(simple-pack  simgrid)
+  target_link_libraries(simple-pack-external  simgrid)
+  target_link_libraries(simple-resized  simgrid)
+  target_link_libraries(simple-size-extent  simgrid)
+  target_link_libraries(sizedtypes  simgrid)
+  target_link_libraries(slice-pack  simgrid)
+  target_link_libraries(slice-pack-external  simgrid)
+  target_link_libraries(struct-derived-zeros  simgrid)
+  target_link_libraries(struct-empty-el  simgrid)
+  target_link_libraries(struct-ezhov  simgrid)
+  target_link_libraries(struct-no-real-types  simgrid)
+  target_link_libraries(struct-pack  simgrid)
+  target_link_libraries(struct-verydeep  simgrid)
+  target_link_libraries(struct-zero-count  simgrid)
+  target_link_libraries(subarray  simgrid)
+  target_link_libraries(subarray-pack  simgrid)
+  target_link_libraries(tfree  simgrid)
+  target_link_libraries(tmatchsize  simgrid)
+  target_link_libraries(transpose-pack  simgrid)
+  target_link_libraries(tresized2  simgrid)
+  target_link_libraries(tresized  simgrid)
+  target_link_libraries(triangular-pack  simgrid)
+  target_link_libraries(typecommit  simgrid)
+  target_link_libraries(typefree  simgrid)
+  target_link_libraries(typelb  simgrid)
+  target_link_libraries(typename  simgrid)
+  target_link_libraries(unpack  simgrid)
+  target_link_libraries(unusual-noncontigs  simgrid)
+  target_link_libraries(zero-blklen-vector  simgrid)
+  target_link_libraries(zeroblks  simgrid)
+  target_link_libraries(zeroparms  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/blockindexed-misc.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/blockindexed-zero-count.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/contents.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/contigstruct.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/contig-zero-count.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/cxx-types.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/darray-cyclic.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/darray-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gaddress.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/get-elements.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/get-elements-pairtype.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/getpartelm.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/hindexed_block.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/hindexed_block_contents.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/hindexed-zeros.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/indexed-misc.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/large-count.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/lbub.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/localpack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/longdouble.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/lots-of-types.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/pairtype-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/pairtype-size-extent.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/simple-commit.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/simple-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/simple-pack-external.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/simple-resized.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/simple-size-extent.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sizedtypes.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/slice-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/slice-pack-external.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-derived-zeros.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-empty-el.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-ezhov.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-no-real-types.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-verydeep.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/struct-zero-count.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/subarray.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/subarray-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/tfree.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/tmatchsize.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/transpose-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/tresized2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/tresized.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/triangular-pack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/typecommit.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/typefree.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/typelb.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/typename.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/unpack.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/unusual-noncontigs.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/zero-blklen-vector.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/zeroblks.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/zeroparms.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/datatype/blockindexed-misc.c b/teshsuite/smpi/mpich3-test/datatype/blockindexed-misc.c
new file mode 100644 (file)
index 0000000..c3c59dc
--- /dev/null
@@ -0,0 +1,379 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int blockindexed_contig_test(void);
+int blockindexed_vector_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = blockindexed_contig_test();
+    if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n",
+                               err);
+    errs += err;
+
+    err = blockindexed_vector_test();
+    if (err && verbose) fprintf(stderr, "%d errors in blockindexed vector test.\n",
+                               err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* blockindexed_contig_test()
+ *
+ * Tests behavior with a blockindexed that can be converted to a 
+ * contig easily.  This is specifically for coverage.
+ *
+ * Returns the number of errors encountered.
+ */
+int blockindexed_contig_test(void)
+{
+    int buf[4] = {7, -1, -2, -3};
+    int err, errs = 0;
+
+    int i, count = 1;
+    int disp = 0;
+    MPI_Datatype newtype;
+
+    int size, int_size;
+    MPI_Aint extent;
+
+    err = MPI_Type_create_indexed_block(count,
+                                       1,
+                                       &disp,
+                                       MPI_INT,
+                                       &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating struct type in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+
+    MPI_Type_size(MPI_INT, &int_size);
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != int_size) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != int_size in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (extent != int_size) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: extent != int_size in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_commit(&newtype);
+
+    err = pack_and_unpack((char *) buf, 1, newtype, 4 * sizeof(int));
+    if (err != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error packing/unpacking in blockindexed_contig_test()\n");
+       }
+       errs += err;
+    }
+
+    for (i=0; i < 4; i++) {
+       int goodval;
+
+       switch(i) {
+           case 0:
+               goodval = 7;
+               break;
+           default:
+               goodval = 0; /* pack_and_unpack() zeros before unpack */
+               break;
+       }
+       if (buf[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "buf[%d] = %d; should be %d\n",
+                                i, buf[i], goodval);
+       }
+    }
+    
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+/* blockindexed_vector_test()
+ *
+ * Tests behavior with a blockindexed of some vector types;
+ * this shouldn't be easily convertable into anything else.
+ *
+ * Returns the number of errors encountered.
+ */
+int blockindexed_vector_test(void)
+{
+#define NELT (18)
+    int buf[NELT] = { -1, -1, -1,
+                       1, -2,  2,
+                      -3, -3, -3,
+                      -4, -4, -4,
+                       3, -5,  4,
+                       5, -6,  6 };
+    int expected[NELT] = {
+                       0,  0,  0,
+                       1,  0,  2,
+                       0,  0,  0,
+                       0,  0,  0,
+                       3,  0,  4,
+                       5,  0,  6 };
+    int err, errs = 0;
+
+    int i, count = 3;
+    int disp[] = {1, 4, 5};
+    MPI_Datatype vectype, newtype;
+
+    int size, int_size;
+
+    /* create a vector type of 2 ints, skipping one in between */
+    err = MPI_Type_vector(2, 1, 2, MPI_INT, &vectype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating vector type in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+
+    err = MPI_Type_create_indexed_block(count,
+                                       1,
+                                       disp,
+                                       vectype,
+                                       &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating blockindexed type in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+
+    MPI_Type_size(MPI_INT, &int_size);
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 6 * int_size) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 6 * int_size in blockindexed_contig_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_commit(&newtype);
+
+    err = pack_and_unpack((char *) buf, 1, newtype, NELT * sizeof(int));
+    if (err != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error packing/unpacking in blockindexed_vector_test()\n");
+       }
+       errs += err;
+    }
+
+    for (i=0; i < NELT; i++) {
+       if (buf[i] != expected[i]) {
+           errs++;
+           if (verbose) fprintf(stderr, "buf[%d] = %d; should be %d\n",
+                                i, buf[i], expected[i]);
+       }
+    }
+
+    MPI_Type_free( &vectype );
+    MPI_Type_free( &newtype );
+    return errs;
+}
+
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Pack_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in malloc call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    position = 0;
+    err = MPI_Pack(typebuf,
+                  count,
+                  datatype,
+                  packbuf,
+                  type_size,
+                  &position,
+                  MPI_COMM_SELF);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf,
+                    type_size,
+                    &position,
+                    typebuf,
+                    count,
+                    datatype,
+                    MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Unpack call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, type_size);
+    }
+
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/blockindexed-zero-count.c b/teshsuite/smpi/mpich3-test/datatype/blockindexed-zero-count.c
new file mode 100644 (file)
index 0000000..f7d14b0
--- /dev/null
@@ -0,0 +1,137 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int blockindexed_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = blockindexed_test();
+    if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n",
+                               err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* blockindexed_test()
+ *
+ * Tests behavior with a zero-count blockindexed.
+ *
+ * Returns the number of errors encountered.
+ */
+int blockindexed_test(void)
+{
+    int err, errs = 0;
+
+    int count = 0;
+    MPI_Datatype newtype;
+
+    int size;
+    MPI_Aint extent;
+
+    err = MPI_Type_create_indexed_block(count,
+                                       0,
+                                       (int *) 0,
+                                       MPI_INT,
+                                       &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating struct type in blockindexed_test()\n");
+       }
+       errs++;
+    }
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in blockindexed_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 0 in blockindexed_test()\n");
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in blockindexed_test()\n");
+       }
+       errs++;
+    }
+    
+    if (extent != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: extent != 0 in blockindexed_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/contents.c b/teshsuite/smpi/mpich3-test/datatype/contents.c
new file mode 100644 (file)
index 0000000..fb513c3
--- /dev/null
@@ -0,0 +1,867 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose = 0;
+
+/* tests */
+int builtin_float_test(void);
+int vector_of_vectors_test(void);
+int optimizable_vector_of_basics_test(void);
+int indexed_of_basics_test(void);
+int indexed_of_vectors_test(void);
+int struct_of_basics_test(void);
+
+/* helper functions */
+char *combiner_to_string(int combiner);
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = builtin_float_test();
+    errs += err;
+    if (err) {
+       fprintf(stderr, "Found %d errors in builtin float test.\n", err);
+    }
+
+    err = vector_of_vectors_test();
+    errs += err;
+    if (err) {
+       fprintf(stderr, "Found %d errors in vector of vectors test.\n", err);
+    }
+
+    err = optimizable_vector_of_basics_test();
+    errs += err;
+    if (err) {
+       fprintf(stderr, "Found %d errors in vector of basics test.\n", err);
+    }
+
+    err = indexed_of_basics_test();
+    errs += err;
+    if (err) {
+       fprintf(stderr, "Found %d errors in indexed of basics test.\n", err);
+    }
+
+    err = indexed_of_vectors_test();
+    errs += err;
+    if (err) {
+       fprintf(stderr, "Found %d errors in indexed of vectors test.\n", err);
+    }
+
+#ifdef HAVE_MPI_TYPE_CREATE_STRUCT
+    err = struct_of_basics_test();
+    errs += err;
+#endif
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* builtin_float_test()
+ *
+ * Tests functionality of get_envelope() and get_contents() on a MPI_FLOAT.
+ *
+ * Returns the number of errors encountered.
+ */
+int builtin_float_test(void)
+{
+    int nints, nadds, ntypes, combiner;
+
+    int err, errs = 0;
+
+    err = MPI_Type_get_envelope(MPI_FLOAT,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    
+    if (combiner != MPI_COMBINER_NAMED) errs++;
+    if (verbose && combiner != MPI_COMBINER_NAMED)
+       fprintf(stderr, "combiner = %s; should be named\n", 
+               combiner_to_string(combiner));
+
+    /* Note: it is erroneous to call MPI_Type_get_contents() on a basic. */
+    return errs;
+}
+
+/* vector_of_vectors_test()
+ *
+ * Builds a vector of a vector of ints.  Assuming an int array of size 9 
+ * integers, and treating the array as a 3x3 2D array, this will grab the 
+ * corners.
+ *
+ * Returns the number of errors encountered.
+ */
+int vector_of_vectors_test(void)
+{
+    MPI_Datatype inner_vector, inner_vector_copy;
+    MPI_Datatype outer_vector;
+
+    int nints, nadds, ntypes, combiner, *ints;
+    MPI_Aint *adds = NULL;
+    MPI_Datatype *types;
+
+    int err, errs = 0;
+
+    /* set up type */
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         MPI_INT,
+                         &inner_vector);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         inner_vector,
+                         &outer_vector);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    /* decode outer vector (get envelope, then contents) */
+    err = MPI_Type_get_envelope(outer_vector,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    if (nints != 3) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_VECTOR) errs++;
+
+    if (verbose) {
+       if (nints != 3) fprintf(stderr, 
+                               "outer vector nints = %d; should be 3\n",
+                               nints);
+       if (nadds != 0) fprintf(stderr, 
+                               "outer vector nadds = %d; should be 0\n",
+                               nadds);
+       if (ntypes != 1) fprintf(stderr, 
+                                "outer vector ntypes = %d; should be 1\n",
+                                ntypes);
+       if (combiner != MPI_COMBINER_VECTOR)
+           fprintf(stderr, "outer vector combiner = %s; should be vector\n",
+                   combiner_to_string(combiner));
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes * sizeof(*types));
+
+    /* get contents of outer vector */
+    err = MPI_Type_get_contents(outer_vector,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != 2) errs++;
+    if (ints[1] != 1) errs++;
+    if (ints[2] != 2) errs++;
+
+    if (verbose) {
+       if (ints[0] != 2) fprintf(stderr, 
+                                 "outer vector count = %d; should be 2\n",
+                                 ints[0]);
+       if (ints[1] != 1) fprintf(stderr,
+                                 "outer vector blocklength = %d; should be 1\n",
+                                 ints[1]);
+       if (ints[2] != 2) fprintf(stderr, "outer vector stride = %d; should be 2\n",
+                                 ints[2]);
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    inner_vector_copy = types[0];
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    /* decode inner vector */
+    err = MPI_Type_get_envelope(inner_vector_copy,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    if (nints != 3) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_VECTOR) errs++;
+
+    if (verbose) {
+       if (nints != 3) fprintf(stderr, 
+                               "inner vector nints = %d; should be 3\n",
+                               nints);
+       if (nadds != 0) fprintf(stderr, 
+                               "inner vector nadds = %d; should be 0\n",
+                               nadds);
+       if (ntypes != 1) fprintf(stderr, 
+                                "inner vector ntypes = %d; should be 1\n",
+                                ntypes);
+       if (combiner != MPI_COMBINER_VECTOR)
+           fprintf(stderr, "inner vector combiner = %s; should be vector\n",
+                   combiner_to_string(combiner));
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes * sizeof(*types));
+
+    err = MPI_Type_get_contents(inner_vector_copy,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != 2) errs++;
+    if (ints[1] != 1) errs++;
+    if (ints[2] != 2) errs++;
+
+    if (verbose) {
+       if (ints[0] != 2) fprintf(stderr, 
+                                 "inner vector count = %d; should be 2\n",
+                                 ints[0]);
+       if (ints[1] != 1) fprintf(stderr,
+                                 "inner vector blocklength = %d; should be 1\n",
+                                 ints[1]);
+       if (ints[2] != 2) fprintf(stderr, 
+                                 "inner vector stride = %d; should be 2\n",
+                                 ints[2]);
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    MPI_Type_free( &inner_vector_copy );
+    MPI_Type_free( &inner_vector );
+    MPI_Type_free( &outer_vector );
+
+    return 0;
+}
+
+/* optimizable_vector_of_basics_test()
+ *
+ * Builds a vector of ints.  Count is 10, blocksize is 2, stride is 2, so this
+ * is equivalent to a contig of 20.  But remember...we should get back our
+ * suboptimal values under MPI-2.
+ *
+ * Returns the number of errors encountered.
+ */
+int optimizable_vector_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+
+    int nints, nadds, ntypes, combiner, *ints;
+    MPI_Aint *adds = NULL;
+    MPI_Datatype *types;
+
+    int err, errs = 0;
+
+    /* set up type */
+    err = MPI_Type_vector(10,
+                         2,
+                         2,
+                         MPI_INT,
+                         &parent_type);
+
+    /* decode */
+    err = MPI_Type_get_envelope(parent_type,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+
+    if (nints != 3) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_VECTOR) errs++;
+
+    if (verbose) {
+        if (nints != 3) fprintf(stderr, "nints = %d; should be 3\n", nints);
+       if (nadds != 0) fprintf(stderr, "nadds = %d; should be 0\n", nadds);
+       if (ntypes != 1) fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
+       if (combiner != MPI_COMBINER_VECTOR)
+           fprintf(stderr, "combiner = %s; should be vector\n",
+                   combiner_to_string(combiner));
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes *sizeof(*types));
+
+    err = MPI_Type_get_contents(parent_type,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != 10) errs++;
+    if (ints[1] != 2) errs++;
+    if (ints[2] != 2) errs++;
+    if (types[0] != MPI_INT) errs++;
+
+    if (verbose) {
+       if (ints[0] != 10) fprintf(stderr, "count = %d; should be 10\n",
+                                  ints[0]);
+       if (ints[1] != 2) fprintf(stderr, "blocklength = %d; should be 2\n",
+                                 ints[1]);
+       if (ints[2] != 2) fprintf(stderr, "stride = %d; should be 2\n",
+                                 ints[2]);
+       if (types[0] != MPI_INT) fprintf(stderr, "type is not MPI_INT\n");
+    }
+
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    MPI_Type_free( &parent_type );
+
+    return errs;
+}
+
+
+/* indexed_of_basics_test(void)
+ *
+ * Simple indexed type.
+ *
+ * Returns number of errors encountered.
+ */
+int indexed_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+    int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };
+    int s_displacements[3] = { 10, 20, 30 };
+
+    int nints, nadds, ntypes, combiner, *ints;
+    MPI_Aint *adds = NULL;
+    MPI_Datatype *types;
+
+    int err, errs = 0;
+
+    /* set up type */
+    err = MPI_Type_indexed(s_count,
+                          s_blocklengths,
+                          s_displacements,
+                          MPI_INT,
+                          &parent_type);
+
+    /* decode */
+    err = MPI_Type_get_envelope(parent_type,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+
+    if (nints != 7) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_INDEXED) errs++;
+
+    if (verbose) {
+        if (nints != 7) fprintf(stderr, "nints = %d; should be 7\n", nints);
+       if (nadds != 0) fprintf(stderr, "nadds = %d; should be 0\n", nadds);
+       if (ntypes != 1) fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
+       if (combiner != MPI_COMBINER_INDEXED)
+           fprintf(stderr, "combiner = %s; should be indexed\n",
+                   combiner_to_string(combiner));
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes *sizeof(*types));
+
+    err = MPI_Type_get_contents(parent_type,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != s_count) errs++;
+    if (ints[1] != s_blocklengths[0]) errs++;
+    if (ints[2] != s_blocklengths[1]) errs++;
+    if (ints[3] != s_blocklengths[2]) errs++;
+    if (ints[4] != s_displacements[0]) errs++;
+    if (ints[5] != s_displacements[1]) errs++;
+    if (ints[6] != s_displacements[2]) errs++;
+    if (types[0] != MPI_INT) errs++;
+
+    if (verbose) {
+       if (ints[0] != s_count) 
+           fprintf(stderr, "count = %d; should be %d\n", ints[0], s_count);
+       if (ints[1] != s_blocklengths[0]) 
+           fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], s_blocklengths[0]);
+       if (ints[2] != s_blocklengths[1]) 
+           fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], s_blocklengths[1]);
+       if (ints[3] != s_blocklengths[2]) 
+           fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], s_blocklengths[2]);
+       if (ints[4] != s_displacements[0]) 
+           fprintf(stderr, "displacement[0] = %d; should be %d\n", ints[4], s_displacements[0]);
+       if (ints[5] != s_displacements[1]) 
+           fprintf(stderr, "displacement[1] = %d; should be %d\n", ints[5], s_displacements[1]);
+       if (ints[6] != s_displacements[2]) 
+           fprintf(stderr, "displacement[2] = %d; should be %d\n", ints[6], s_displacements[2]);
+       if (types[0] != MPI_INT) fprintf(stderr, "type[0] does not match\n");
+    }
+
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    MPI_Type_free( &parent_type );
+    return errs;
+}
+
+/* indexed_of_vectors_test()
+ *
+ * Builds an indexed type of vectors of ints.
+ *
+ * Returns the number of errors encountered.
+ */
+int indexed_of_vectors_test(void)
+{
+    MPI_Datatype inner_vector, inner_vector_copy;
+    MPI_Datatype outer_indexed;
+    
+    int i_count = 3, i_blocklengths[3] = { 3, 2, 1 };
+    int i_displacements[3] = { 10, 20, 30 };
+
+    int nints, nadds, ntypes, combiner, *ints;
+    MPI_Aint *adds = NULL;
+    MPI_Datatype *types;
+
+    int err, errs = 0;
+
+    /* set up type */
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         MPI_INT,
+                         &inner_vector);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    err = MPI_Type_indexed(i_count,
+                          i_blocklengths,
+                          i_displacements,
+                          inner_vector,
+                          &outer_indexed);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    /* decode outer vector (get envelope, then contents) */
+    err = MPI_Type_get_envelope(outer_indexed,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    if (nints != 7) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_INDEXED) errs++;
+
+    if (verbose) {
+        if (nints != 7) fprintf(stderr, "nints = %d; should be 7\n", nints);
+       if (nadds != 0) fprintf(stderr, "nadds = %d; should be 0\n", nadds);
+       if (ntypes != 1) fprintf(stderr, "ntypes = %d; should be 1\n", ntypes);
+       if (combiner != MPI_COMBINER_INDEXED)
+           fprintf(stderr, "combiner = %s; should be indexed\n",
+                   combiner_to_string(combiner));
+    }
+
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes * sizeof(*types));
+
+    /* get contents of outer vector */
+    err = MPI_Type_get_contents(outer_indexed,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != i_count) errs++;
+    if (ints[1] != i_blocklengths[0]) errs++;
+    if (ints[2] != i_blocklengths[1]) errs++;
+    if (ints[3] != i_blocklengths[2]) errs++;
+    if (ints[4] != i_displacements[0]) errs++;
+    if (ints[5] != i_displacements[1]) errs++;
+    if (ints[6] != i_displacements[2]) errs++;
+
+    if (verbose) {
+       if (ints[0] != i_count) 
+           fprintf(stderr, "count = %d; should be %d\n", ints[0], i_count);
+       if (ints[1] != i_blocklengths[0]) 
+           fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], i_blocklengths[0]);
+       if (ints[2] != i_blocklengths[1]) 
+           fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], i_blocklengths[1]);
+       if (ints[3] != i_blocklengths[2]) 
+           fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], i_blocklengths[2]);
+       if (ints[4] != i_displacements[0]) 
+           fprintf(stderr, "displacement[0] = %d; should be %d\n", ints[4], i_displacements[0]);
+       if (ints[5] != i_displacements[1]) 
+           fprintf(stderr, "displacement[1] = %d; should be %d\n", ints[5], i_displacements[1]);
+       if (ints[6] != i_displacements[2]) 
+           fprintf(stderr, "displacement[2] = %d; should be %d\n", ints[6], i_displacements[2]);
+    }
+
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    inner_vector_copy = types[0];
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    /* decode inner vector */
+    err = MPI_Type_get_envelope(inner_vector_copy,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    if (err != MPI_SUCCESS) {
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs+1;
+    }
+
+    if (nints != 3) errs++;
+    if (nadds != 0) errs++;
+    if (ntypes != 1) errs++;
+    if (combiner != MPI_COMBINER_VECTOR) errs++;
+
+    if (verbose) {
+       if (nints != 3) fprintf(stderr, 
+                               "inner vector nints = %d; should be 3\n",
+                               nints);
+       if (nadds != 0) fprintf(stderr, 
+                               "inner vector nadds = %d; should be 0\n",
+                               nadds);
+       if (ntypes != 1) fprintf(stderr, 
+                                "inner vector ntypes = %d; should be 1\n",
+                                ntypes);
+       if (combiner != MPI_COMBINER_VECTOR)
+           fprintf(stderr, "inner vector combiner = %s; should be vector\n",
+                   combiner_to_string(combiner));
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    if (nadds) adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes * sizeof(*types));
+
+    err = MPI_Type_get_contents(inner_vector_copy,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != 2) errs++;
+    if (ints[1] != 1) errs++;
+    if (ints[2] != 2) errs++;
+
+    if (verbose) {
+       if (ints[0] != 2) fprintf(stderr, 
+                                 "inner vector count = %d; should be 2\n",
+                                 ints[0]);
+       if (ints[1] != 1) fprintf(stderr,
+                                 "inner vector blocklength = %d; should be 1\n",
+                                 ints[1]);
+       if (ints[2] != 2) fprintf(stderr, 
+                                 "inner vector stride = %d; should be 2\n",
+                                 ints[2]);
+    }
+    if (errs) {
+       if (verbose) fprintf(stderr, "aborting after %d errors\n", errs);
+       return errs;
+    }
+
+    free(ints);
+    if (nadds) free(adds);
+    free(types);
+
+    MPI_Type_free( &inner_vector_copy );
+    MPI_Type_free( &inner_vector );
+    MPI_Type_free( &outer_indexed );
+
+    return 0;
+}
+
+
+#ifdef HAVE_MPI_TYPE_CREATE_STRUCT
+/* struct_of_basics_test(void)
+ *
+ * There's nothing simple about structs :).  Although this is an easy one.
+ *
+ * Returns number of errors encountered.
+ *
+ * NOT TESTED.
+ */
+int struct_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+    int s_count = 3, s_blocklengths[3] = { 3, 2, 1 };
+    MPI_Aint s_displacements[3] = { 10, 20, 30 };
+    MPI_Datatype s_types[3] = { MPI_CHAR, MPI_INT, MPI_FLOAT };
+
+    int nints, nadds, ntypes, combiner, *ints;
+    MPI_Aint *adds = NULL;
+    MPI_Datatype *types;
+
+    int err, errs = 0;
+
+    /* set up type */
+    err = MPI_Type_create_struct(s_count,
+                                s_blocklengths,
+                                s_displacements,
+                                s_types,
+                                &parent_type);
+
+    /* decode */
+    err = MPI_Type_get_envelope(parent_type,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+
+    if (nints != 4) errs++;
+    if (nadds != 3) errs++;
+    if (ntypes != 3) errs++;
+    if (combiner != MPI_COMBINER_STRUCT) errs++;
+
+    if (verbose) {
+        if (nints != 4) fprintf(stderr, "nints = %d; should be 3\n", nints);
+       if (nadds != 3) fprintf(stderr, "nadds = %d; should be 0\n", nadds);
+       if (ntypes != 3) fprintf(stderr, "ntypes = %d; should be 3\n", ntypes);
+       if (combiner != MPI_COMBINER_STRUCT)
+           fprintf(stderr, "combiner = %s; should be struct\n",
+                   combiner_to_string(combiner));
+    }
+
+    ints = malloc(nints * sizeof(*ints));
+    adds = malloc(nadds * sizeof(*adds));
+    types = malloc(ntypes *sizeof(*types));
+
+    err = MPI_Type_get_contents(parent_type,
+                               nints,
+                               nadds,
+                               ntypes,
+                               ints,
+                               adds,
+                               types);
+
+    if (ints[0] != s_count) errs++;
+    if (ints[1] != s_blocklengths[0]) errs++;
+    if (ints[2] != s_blocklengths[1]) errs++;
+    if (ints[3] != s_blocklengths[2]) errs++;
+    if (adds[0] != s_displacements[0]) errs++;
+    if (adds[1] != s_displacements[1]) errs++;
+    if (adds[2] != s_displacements[2]) errs++;
+    if (types[0] != s_types[0]) errs++;
+    if (types[1] != s_types[1]) errs++;
+    if (types[2] != s_types[2]) errs++;
+
+    if (verbose) {
+       if (ints[0] != s_count) 
+           fprintf(stderr, "count = %d; should be %d\n", ints[0], s_count);
+       if (ints[1] != s_blocklengths[0])
+           fprintf(stderr, "blocklength[0] = %d; should be %d\n", ints[1], s_blocklengths[0]);
+       if (ints[2] != s_blocklengths[1]) 
+           fprintf(stderr, "blocklength[1] = %d; should be %d\n", ints[2], s_blocklengths[1]);
+       if (ints[3] != s_blocklengths[2]) 
+           fprintf(stderr, "blocklength[2] = %d; should be %d\n", ints[3], s_blocklengths[2]);
+       if (adds[0] != s_displacements[0]) 
+           fprintf(stderr, "displacement[0] = %d; should be %d\n", adds[0], s_displacements[0]);
+       if (adds[1] != s_displacements[1]) 
+           fprintf(stderr, "displacement[1] = %d; should be %d\n", adds[1], s_displacements[1]);
+       if (adds[2] != s_displacements[2]) 
+           fprintf(stderr, "displacement[2] = %d; should be %d\n", adds[2], s_displacements[2]);
+       if (types[0] != s_types[0]) 
+           fprintf(stderr, "type[0] does not match\n");
+       if (types[1] != s_types[1]) 
+           fprintf(stderr, "type[1] does not match\n");
+       if (types[2] != s_types[2]) 
+           fprintf(stderr, "type[2] does not match\n");
+    }
+
+    free(ints);
+    free(adds);
+    free(types);
+
+    MPI_Type_free( &parent_type );
+
+    return errs;
+}
+#endif
+
+/* combiner_to_string(combiner)
+ *
+ * Converts a numeric combiner into a pointer to a string used for printing.
+ */
+char *combiner_to_string(int combiner)
+{
+    static char c_named[]    = "named";
+    static char c_contig[]   = "contig";
+    static char c_vector[]   = "vector";
+    static char c_hvector[]  = "hvector";
+    static char c_indexed[]  = "indexed";
+    static char c_hindexed[] = "hindexed";
+    static char c_struct[]   = "struct";
+#ifdef HAVE_MPI2_COMBINERS
+    static char c_dup[]              = "dup";
+    static char c_hvector_integer[]  = "hvector_integer";
+    static char c_hindexed_integer[] = "hindexed_integer";
+    static char c_indexed_block[]    = "indexed_block";
+    static char c_struct_integer[]   = "struct_integer";
+    static char c_subarray[]         = "subarray";
+    static char c_darray[]           = "darray";
+    static char c_f90_real[]         = "f90_real";
+    static char c_f90_complex[]      = "f90_complex";
+    static char c_f90_integer[]      = "f90_integer";
+    static char c_resized[]          = "resized";
+#endif
+
+    if (combiner == MPI_COMBINER_NAMED)      return c_named;
+    if (combiner == MPI_COMBINER_CONTIGUOUS) return c_contig;
+    if (combiner == MPI_COMBINER_VECTOR)     return c_vector;
+    if (combiner == MPI_COMBINER_HVECTOR)    return c_hvector;
+    if (combiner == MPI_COMBINER_INDEXED)    return c_indexed;
+    if (combiner == MPI_COMBINER_HINDEXED)   return c_hindexed;
+    if (combiner == MPI_COMBINER_STRUCT)     return c_struct;
+#ifdef HAVE_MPI2_COMBINERS
+    if (combiner == MPI_COMBINER_DUP)              return c_dup;
+    if (combiner == MPI_COMBINER_HVECTOR_INTEGER)  return c_hvector_integer;
+    if (combiner == MPI_COMBINER_HINDEXED_INTEGER) return c_hindexed_integer;
+    if (combiner == MPI_COMBINER_INDEXED_BLOCK)    return c_indexed_block;
+    if (combiner == MPI_COMBINER_STRUCT_INTEGER)   return c_struct_integer;
+    if (combiner == MPI_COMBINER_SUBARRAY)         return c_subarray;
+    if (combiner == MPI_COMBINER_DARRAY)           return c_darray;
+    if (combiner == MPI_COMBINER_F90_REAL)         return c_f90_real;
+    if (combiner == MPI_COMBINER_F90_COMPLEX)      return c_f90_complex;
+    if (combiner == MPI_COMBINER_F90_INTEGER)      return c_f90_integer;
+    if (combiner == MPI_COMBINER_RESIZED)          return c_resized;
+#endif
+    
+    return NULL;
+}
+
+int parse_args(int argc, char **argv)
+{
+#ifdef HAVE_GET_OPT
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+#else
+#endif
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/contig-zero-count.c b/teshsuite/smpi/mpich3-test/datatype/contig-zero-count.c
new file mode 100644 (file)
index 0000000..6236173
--- /dev/null
@@ -0,0 +1,135 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int contig_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = contig_test();
+    if (err && verbose) fprintf(stderr, "%d errors in contig test.\n",
+                               err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* contig_test()
+ *
+ * Tests behavior with a zero-count contig.
+ *
+ * Returns the number of errors encountered.
+ */
+int contig_test(void)
+{
+    int err, errs = 0;
+
+    int count = 0;
+    MPI_Datatype newtype;
+
+    int size;
+    MPI_Aint extent;
+
+    err = MPI_Type_contiguous(count,
+                            MPI_INT,
+                            &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating type in contig_test()\n");
+       }
+       errs++;
+    }
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 0 in contig_test()\n");
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (extent != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: extent != 0 in contig_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/contigstruct.c b/teshsuite/smpi/mpich3-test/datatype/contigstruct.c
new file mode 100644 (file)
index 0000000..657c8e0
--- /dev/null
@@ -0,0 +1,49 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+
+/*
+ * This test checks to see if we can create a simple datatype
+ * made from many contiguous copies of a single struct.  The
+ * struct is built with monotone decreasing displacements to
+ * avoid any struct->contig optimizations.
+ */
+
+int main( int argc, char **argv )
+{
+    int           blocklens[8], psize, i, rank;
+    MPI_Aint      displs[8];
+    MPI_Datatype  oldtypes[8];
+    MPI_Datatype  ntype1, ntype2;
+
+    MPI_Init( &argc, &argv );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    
+    for (i=0; i<8; i++) {
+       blocklens[i] = 1;
+       displs[i]    = (7-i) * sizeof(long);
+       oldtypes[i]  = MPI_LONG;
+    }
+    MPI_Type_struct( 8, blocklens, displs, oldtypes, &ntype1 );
+    MPI_Type_contiguous( 65536, ntype1, &ntype2 );
+    MPI_Type_commit( &ntype2 );
+
+    MPI_Pack_size( 2, ntype2, MPI_COMM_WORLD, &psize );
+
+    MPI_Type_free( &ntype2 );
+       MPI_Type_free( &ntype1 );
+
+    /* The only failure mode has been SEGV or aborts within the datatype
+       routines */
+    if (rank == 0) {
+       printf( " No Errors\n" );
+    }
+
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/cxx-types.c b/teshsuite/smpi/mpich3-test/datatype/cxx-types.c
new file mode 100644 (file)
index 0000000..a783e81
--- /dev/null
@@ -0,0 +1,66 @@
+/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test checks for the existence of four new C++ named predefined datatypes
+ * that should be accessible from C (and Fortran, not tested here). */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+
+/* assert-like macro that bumps the err count and emits a message */
+#define check(x_)                                                                 \
+    do {                                                                          \
+        if (!(x_)) {                                                              \
+            ++errs;                                                               \
+            if (errs < 10) {                                                      \
+                fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
+            }                                                                     \
+        }                                                                         \
+    } while (0)
+
+int main(int argc, char *argv[])
+{
+    int errs = 0;
+    int wrank, wsize;
+    int size;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+
+    /* perhaps the MPI library has no CXX support, in which case let's assume
+     * that these constants exist and were set to MPI_DATATYPE_NULL (standard
+     * MPICH behavior). */
+#define check_type(type_)                 \
+    do {                                  \
+        size = -1;                        \
+        if (type_ != MPI_DATATYPE_NULL) { \
+            MPI_Type_size(type_, &size);  \
+            check(size > 0);              \
+        }                                 \
+    } while (0)
+
+    check_type(MPI_CXX_BOOL);
+    check_type(MPI_CXX_FLOAT_COMPLEX);
+    check_type(MPI_CXX_DOUBLE_COMPLEX);
+    check_type(MPI_CXX_LONG_DOUBLE_COMPLEX);
+
+    MPI_Reduce((wrank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+    if (wrank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/darray-cyclic.c b/teshsuite/smpi/mpich3-test/datatype/darray-cyclic.c
new file mode 100644 (file)
index 0000000..90eea4a
--- /dev/null
@@ -0,0 +1,252 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+int AllocateGrid( int nx, int ny, int **srcArray, int **destArray );
+int PackUnpack( MPI_Datatype, const int [], int[], int );
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int wrank, wsize;
+    int gsizes[3], distribs[3], dargs[3], psizes[3];
+    int px, py, nx, ny, rx, ry, bx, by;
+    int *srcArray=NULL, *destArray=NULL;
+    int i, j, ii, jj, loc;
+    MPI_Datatype darraytype;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+
+    /* Test 1: Simple, 1-D cyclic decomposition */
+    if (AllocateGrid( 1, 3*wsize, &srcArray, &destArray ) ) {
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Simple cyclic with 1-dim global array */
+    gsizes[0]   = 3*wsize;
+    distribs[0] = MPI_DISTRIBUTE_CYCLIC;
+    dargs[0]    = 1;
+    psizes[0]   = wsize;
+    MPI_Type_create_darray( wsize, wrank, 1, 
+                           gsizes, distribs, dargs, psizes, 
+                           MPI_ORDER_C, MPI_INT, &darraytype );
+
+    /* Check the created datatype.  Because cyclic, should represent
+       a strided type */
+    if (PackUnpack( darraytype, srcArray, destArray, 3 )) {
+       fprintf( stderr, "Error in pack/unpack check\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    /* Now, check for correct data */
+    for (i=0; i<3; i++) {
+       if (destArray[i] != wrank + i * wsize) {
+           fprintf( stderr, "1D: %d: Expected %d but saw %d\n", 
+                    i, wrank + i * wsize, destArray[i] );
+           errs++;
+       }
+    }
+
+    free( destArray );
+    free( srcArray );
+    MPI_Type_free( &darraytype );
+
+    /* Test 2: Simple, 1-D cyclic decomposition, with block size=2 */
+    if (AllocateGrid( 1, 4*wsize, &srcArray, &destArray ) ) {
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Simple cyclic with 1-dim global array */
+    gsizes[0]   = 4*wsize;
+    distribs[0] = MPI_DISTRIBUTE_CYCLIC;
+    dargs[0]    = 2;
+    psizes[0]   = wsize;
+    MPI_Type_create_darray( wsize, wrank, 1, 
+                           gsizes, distribs, dargs, psizes, 
+                           MPI_ORDER_C, MPI_INT, &darraytype );
+
+    /* Check the created datatype.  Because cyclic, should represent
+       a strided type */
+    if (PackUnpack( darraytype, srcArray, destArray, 4 )) {
+       fprintf( stderr, "Error in pack/unpack check\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    loc = 0;
+    /* for each cyclic element */
+    for (i=0; i<2; i++) {
+       /* For each element in block */
+       for (j=0; j<2; j++) {
+           if (destArray[loc] != 2*wrank + i * 2*wsize + j) {
+               fprintf( stderr, "1D(2): %d: Expected %d but saw %d\n", 
+                        i, 2*wrank + i * 2*wsize+j, destArray[loc] );
+               errs++;
+           }
+           loc++;
+       }
+    }
+
+    free( destArray );
+    free( srcArray );
+    MPI_Type_free( &darraytype );
+
+    /* 2D: Create some 2-D decompositions */
+    px = wsize/2;
+    py = 2;
+    rx = wrank % px;
+    ry = wrank / px;
+
+    if (px * py != wsize) {
+       fprintf( stderr, "An even number of processes is required\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Cyclic/Cyclic */
+    if (AllocateGrid( 5*px, 7*py, &srcArray, &destArray )) {
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Simple cyclic/cyclic. Note in C order, the [1] index varies most 
+       rapidly */
+    gsizes[0]   = ny = 7*py;
+    gsizes[1]   = nx = 5*px;
+    distribs[0] = MPI_DISTRIBUTE_CYCLIC;
+    distribs[1] = MPI_DISTRIBUTE_CYCLIC;
+    dargs[0]    = 1;
+    dargs[1]    = 1;
+    psizes[0]   = py;
+    psizes[1]   = px;
+    MPI_Type_create_darray( wsize, wrank, 2, 
+                           gsizes, distribs, dargs, psizes, 
+                           MPI_ORDER_C, MPI_INT, &darraytype );
+
+    /* Check the created datatype.  Because cyclic, should represent
+       a strided type */
+    if (PackUnpack( darraytype, srcArray, destArray, 5*7 )) {
+       fprintf( stderr, "Error in pack/unpack check\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    loc = 0;
+    for (j=0; j<7; j++) {
+       for (i=0; i<5; i++) {
+           int expected = rx + ry * nx + i * px + j * nx * py;
+           if (destArray[loc] != expected) {
+               errs++;
+               fprintf( stderr, "2D(cc): [%d,%d] = %d, expected %d\n", 
+                        i, j, destArray[loc], expected );
+           }
+           loc++;
+       }
+    }
+
+    free( srcArray );
+    free( destArray );
+    MPI_Type_free( &darraytype );
+
+    /* Cyclic(2)/Cyclic(3) */
+    if (AllocateGrid( 6*px, 4*py, &srcArray, &destArray )) {
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    /* Block cyclic/cyclic. Note in C order, the [1] index varies most 
+       rapidly */
+    gsizes[0]   = ny = 4*py;
+    gsizes[1]   = nx = 6*px;
+    distribs[0] = MPI_DISTRIBUTE_CYCLIC;
+    distribs[1] = MPI_DISTRIBUTE_CYCLIC;
+    dargs[0]    = by = 2;
+    dargs[1]    = bx = 3;
+    psizes[0]   = py;
+    psizes[1]   = px;
+    MPI_Type_create_darray( wsize, wrank, 2, 
+                           gsizes, distribs, dargs, psizes, 
+                           MPI_ORDER_C, MPI_INT, &darraytype );
+
+    /* Check the created datatype.  Because cyclic, should represent
+       a strided type */
+    if (PackUnpack( darraytype, srcArray, destArray, 4*6 )) {
+       fprintf( stderr, "Error in pack/unpack check\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    loc = 0;
+    for (j=0; j<4/by; j++) {
+       for (jj=0; jj<by; jj++) {
+           for (i=0; i<6/bx; i++) {
+               for (ii=0; ii<bx; ii++) {
+                   int expected = rx * bx + ry * by * nx + i * bx * px + ii +
+                       (j * by * py + jj) * nx;
+                   if (destArray[loc] != expected) {
+                       errs++;
+                   fprintf( stderr, "2D(c(2)c(3)): [%d,%d] = %d, expected %d\n", 
+                            i*bx+ii, j*by+jj, destArray[loc], expected );
+                   }
+                   loc++;
+               }
+           }
+       }
+    }
+
+    free( srcArray );
+    free( destArray );
+    MPI_Type_free( &darraytype );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    
+    return 0;
+}
+
+int AllocateGrid( int nx, int ny, int **srcArray, int **destArray )
+{
+    int *src, *dest;
+    int i;
+    src = (int *)malloc( nx*ny*sizeof(int) );
+    dest = (int *)malloc( nx*ny*sizeof(int) );
+    if (!src || !dest) {
+       fprintf( stderr, "Unable to allocate test arrays of size (%d x %d)\n",
+                nx, ny );
+       return 1;
+    }
+    for (i=0; i<nx*ny; i++) {
+       src[i] = i;
+       dest[i] = -i-1;
+    }
+    *srcArray  = src;
+    *destArray = dest;
+    return 0;
+}
+
+/* Extract the source array into the dest array using the DARRAY datatype.
+   "count" integers are returned in destArray */
+int PackUnpack( MPI_Datatype darraytype, const int srcArray[], int destArray[],
+               int count )
+{
+    int packsize, position;
+    int *packArray;
+
+    MPI_Type_commit( &darraytype );
+    MPI_Pack_size( 1, darraytype, MPI_COMM_SELF, &packsize );
+    packArray = (int *)malloc( packsize );
+    if (!packArray) {
+       fprintf( stderr, "Unable to allocate pack array of size %d\n", 
+                packsize );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    position = 0;
+    MPI_Pack( (int*)srcArray, 1, darraytype, packArray, packsize, &position, 
+             MPI_COMM_SELF );
+    packsize = position;
+    position = 0;
+    MPI_Unpack( packArray, packsize, &position, destArray, count, MPI_INT, 
+               MPI_COMM_SELF );
+    free( packArray );
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/darray-pack.c b/teshsuite/smpi/mpich3-test/datatype/darray-pack.c
new file mode 100644 (file)
index 0000000..4af6d6c
--- /dev/null
@@ -0,0 +1,359 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/* 
+   The default behavior of the test routines should be to briefly indicate
+   the cause of any errors - in this test, that means that verbose needs
+   to be set. Verbose should turn on output that is independent of error
+   levels.
+*/
+static int verbose = 1;
+
+/* tests */
+int darray_2d_c_test1(void);
+int darray_4d_c_test1(void);
+
+/* helper functions */
+static int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MTest_Init( &argc, &argv );
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = darray_2d_c_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 2d darray c test 1.\n", err);
+    errs += err;
+
+    err = darray_4d_c_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 4d darray c test 1.\n", err);
+    errs += err;
+
+    /* print message and exit */
+    /* Allow the use of more than one process - some MPI implementations
+       (including IBM's) check that the number of processes given to 
+       Type_create_darray is no larger than MPI_COMM_WORLD */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+/* darray_2d_test1()
+ *
+ * Performs a sequence of tests building darrays with single-element
+ * blocks, running through all the various positions that the element might
+ * come from.
+ *
+ * Returns the number of errors encountered.
+ */
+int darray_2d_c_test1(void)
+{
+    MPI_Datatype darray;
+    int array[9]; /* initialized below */
+    int array_size[2] = {3, 3};
+    int array_distrib[2] = {MPI_DISTRIBUTE_BLOCK, MPI_DISTRIBUTE_BLOCK};
+    int array_dargs[2] = {MPI_DISTRIBUTE_DFLT_DARG, MPI_DISTRIBUTE_DFLT_DARG};
+    int array_psizes[2] = {3, 3};
+
+    int i, rank, err, errs = 0, sizeoftype;
+
+    /* pretend we are each rank, one at a time */
+    for (rank=0; rank < 9; rank++) {
+       /* set up buffer */
+       for (i=0; i < 9; i++) {
+           array[i] = i;
+       }
+
+       /* set up type */
+       err = MPI_Type_create_darray(9, /* size */
+                                    rank,
+                                    2, /* dims */
+                                    array_size,
+                                    array_distrib,
+                                    array_dargs,
+                                    array_psizes,
+                                    MPI_ORDER_C,
+                                    MPI_INT,
+                                    &darray);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr,
+                       "error in MPI_Type_create_darray call; aborting after %d errors\n",
+                       errs);
+           }
+           MTestPrintError( err );
+           return errs;
+       }
+       
+       MPI_Type_commit(&darray);
+
+       MPI_Type_size(darray, &sizeoftype);
+       if (sizeoftype != sizeof(int)) {
+           errs++;
+           if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                                sizeoftype, (int) sizeof(int));
+           return errs;
+       }
+       
+       err = pack_and_unpack((char *) array, 1, darray, 9*sizeof(int));
+       
+       for (i=0; i < 9; i++) {
+
+           if ((i == rank) && (array[i] != rank)) {
+               errs++;
+               if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                    i, array[i], rank);
+           }
+           else if ((i != rank) && (array[i] != 0)) {
+               errs++;
+               if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                    i, array[i], 0);
+           }
+       }
+       MPI_Type_free(&darray);
+    }
+
+    return errs;
+}
+
+/* darray_4d_c_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int darray_4d_c_test1(void)
+{
+    MPI_Datatype darray;
+    int array[72];
+    int array_size[4] = {6, 3, 2, 2};
+    int array_distrib[4] = { MPI_DISTRIBUTE_BLOCK,
+                            MPI_DISTRIBUTE_BLOCK,
+                            MPI_DISTRIBUTE_NONE,
+                            MPI_DISTRIBUTE_NONE };
+    int array_dargs[4] = { MPI_DISTRIBUTE_DFLT_DARG,
+                          MPI_DISTRIBUTE_DFLT_DARG,
+                          MPI_DISTRIBUTE_DFLT_DARG,
+                          MPI_DISTRIBUTE_DFLT_DARG };
+    int array_psizes[4] = {6, 3, 1, 1};
+
+    int i, rank, err, errs = 0, sizeoftype;
+
+    for (rank=0; rank < 18; rank++) {
+       /* set up array */
+       for (i=0; i < 72; i++) {
+           array[i] = i;
+       }
+
+       /* set up type */
+       err = MPI_Type_create_darray(18, /* size */
+                                    rank,
+                                    4, /* dims */
+                                    array_size,
+                                    array_distrib,
+                                    array_dargs,
+                                    array_psizes,
+                                    MPI_ORDER_C,
+                                    MPI_INT,
+                                    &darray);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr,
+                       "error in MPI_Type_create_darray call; aborting after %d errors\n",
+                       errs);
+           }
+           MTestPrintError( err );
+           return errs;
+       }
+
+       MPI_Type_commit(&darray);
+
+       /* verify the size of the type */
+       MPI_Type_size(darray, &sizeoftype);
+       if (sizeoftype != 4*sizeof(int)) {
+           errs++;
+           if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                                sizeoftype, (int) (4*sizeof(int)));
+           return errs;
+       }
+
+       /* pack and unpack the type, zero'ing out all other values */
+       err = pack_and_unpack((char *) array, 1, darray, 72*sizeof(int));
+
+       for (i=0; i < 4*rank; i++) {
+           if (array[i] != 0) {
+               errs++;
+               if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                    i, array[i], 0);
+           }
+       }
+
+       for (i=4*rank; i < 4*rank + 4; i++) {
+           if (array[i] != i) {
+               errs++;
+               if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                    i, array[i], i);
+           }
+       }
+       for (i=4*rank+4; i < 72; i++) {
+           if (array[i] != 0) {
+               errs++;
+               if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                    i, array[i], 0);
+           }
+       }
+
+       MPI_Type_free(&darray);
+    }
+    return errs;
+}
+
+/******************************************************************/
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_size call; aborting after %d errors\n",
+                   errs);
+       }
+       MTestPrintError( err );
+       return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Pack_size call; aborting after %d errors\n",
+                   errs);
+       }
+       MTestPrintError( err );
+       return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in malloc call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    /* FIXME: the pack size returned need not be the type_size - this will
+       only be true if the pack routine simply moves the bytes but does
+       no other transformations of the data */
+    position = 0;
+    err = MPI_Pack(typebuf,
+                  count,
+                  datatype,
+                  packbuf,
+                  type_size,
+                  &position,
+                  MPI_COMM_SELF);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf,
+                    type_size,
+                    &position,
+                    typebuf,
+                    count,
+                    datatype,
+                    MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Unpack call; aborting after %d errors\n",
+                   errs);
+       }
+       MTestPrintError( err );
+       return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, type_size);
+    }
+
+    return errs;
+}
+
+static int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/gaddress.c b/teshsuite/smpi/mpich3-test/datatype/gaddress.c
new file mode 100644 (file)
index 0000000..dfd91fc
--- /dev/null
@@ -0,0 +1,34 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int buf[10];
+    MPI_Aint a1, a2;
+
+    MTest_Init( &argc, &argv );
+    
+    MPI_Get_address( &buf[0], &a1 );
+    MPI_Get_address( &buf[1], &a2 );
+    
+    if ((int)(a2-a1) != sizeof(int)) {
+       errs++;
+       printf( "Get address of two address did not return values the correct distance apart\n" );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/get-elements-pairtype.c b/teshsuite/smpi/mpich3-test/datatype/get-elements-pairtype.c
new file mode 100644 (file)
index 0000000..56afdba
--- /dev/null
@@ -0,0 +1,106 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int verbose = 0;
+
+/* tests */
+int double_int_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = double_int_test();
+    if (err && verbose) fprintf(stderr, "%d errors in double_int test.\n",
+                               err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* send a { double, int, double} tuple and receive as a pair of
+ * MPI_DOUBLE_INTs. this should (a) be valid, and (b) result in an
+ * element count of 3.
+ */
+int double_int_test(void)
+{
+    int err, errs = 0, count;
+
+    struct { double a; int b; double c; } foo;
+    struct { double a; int b; double c; int d; } bar;
+
+    int blks[3] = { 1, 1, 1 };
+    MPI_Aint disps[3] = { 0, 0, 0 };
+    MPI_Datatype types[3] = { MPI_DOUBLE, MPI_INT, MPI_DOUBLE };
+    MPI_Datatype stype;
+
+    MPI_Status recvstatus;
+
+    /* fill in disps[1..2] with appropriate offset */
+    disps[1] = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+    disps[2] = (MPI_Aint) ((char *) &foo.c - (char *) &foo.a);
+   
+    MPI_Type_create_struct(3, blks, disps, types, &stype);
+    MPI_Type_commit(&stype);
+
+    err = MPI_Sendrecv(&foo, 1, stype, 0, 0,
+                      &bar, 2, MPI_DOUBLE_INT, 0, 0,
+                      MPI_COMM_SELF, &recvstatus);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "MPI_Sendrecv returned error (%d)\n",
+                            err);
+       return errs;
+    }
+
+    err = MPI_Get_elements(&recvstatus, MPI_DOUBLE_INT, &count);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "MPI_Get_elements returned error (%d)\n",
+                            err);
+    }
+
+    if (count != 3) {
+       errs++;
+       if (verbose) fprintf(stderr,
+                            "MPI_Get_elements returned count of %d, should be 3\n",
+                            count);
+    }
+
+    MPI_Type_free( &stype );
+
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/get-elements.c b/teshsuite/smpi/mpich3-test/datatype/get-elements.c
new file mode 100644 (file)
index 0000000..2809a3d
--- /dev/null
@@ -0,0 +1,89 @@
+/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2011 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stddef.h>
+#include <assert.h>
+
+/* Tests MPI_Get_elements with a contiguous datatype that triggered a bug in
+ * past versions of MPICH.  See ticket #1467 for more info. */
+
+struct test_struct {
+    char a;
+    short b;
+    int c;
+};
+
+int main(int argc, char **argv)
+{
+    int rank, count;
+    struct test_struct sendbuf, recvbuf;
+    int blens[3];
+    MPI_Aint displs[3];
+    MPI_Datatype types[3];
+    MPI_Datatype struct_type, contig;
+    MPI_Status status;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    /* We use a contig of a struct in order to satisfy two properties:
+     * (A) a type that contains more than one element type (the struct portion)
+     * (B) a type that has an odd number of ints in its "type contents" (1 in
+     *     this case)
+     * This triggers a specific bug in some versions of MPICH. */
+    blens[0]  = 1;
+    displs[0] = offsetof(struct test_struct, a);
+    types[0]  = MPI_CHAR;
+    blens[1]  = 1;
+    displs[1] = offsetof(struct test_struct, b);
+    types[1]  = MPI_SHORT;
+    blens[2]  = 1;
+    displs[2] = offsetof(struct test_struct, c);
+    types[2]  = MPI_INT;
+    MPI_Type_create_struct(3, blens, displs, types, &struct_type);
+    MPI_Type_contiguous(1, struct_type, &contig);
+    MPI_Type_commit(&struct_type);
+    MPI_Type_commit(&contig);
+
+    sendbuf.a = 20;
+    sendbuf.b = 30;
+    sendbuf.c = 40;
+    recvbuf.a = -1;
+    recvbuf.b = -1;
+    recvbuf.c = -1;
+
+    /* send to ourself */
+    MPI_Sendrecv(&sendbuf, 1, contig, 0, 0,
+                 &recvbuf, 1, contig, 0, 0,
+                 MPI_COMM_SELF, &status);
+
+    /* sanity */
+    assert(sendbuf.a == recvbuf.a);
+    assert(sendbuf.b == recvbuf.b);
+    assert(sendbuf.c == recvbuf.c);
+
+    /* now check that MPI_Get_elements returns the correct answer and that the
+     * library doesn't explode in the process */
+    count = 0xdeadbeef;
+    MPI_Get_elements(&status, contig, &count);
+    MPI_Type_free(&struct_type);
+    MPI_Type_free(&contig);
+
+    if (count != 3) {
+        printf("unexpected value for count, expected 3, got %d\n", count);
+    }
+    else {
+        if (rank == 0) {
+            printf(" No Errors\n");
+        }
+    }
+
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/getpartelm.c b/teshsuite/smpi/mpich3-test/datatype/getpartelm.c
new file mode 100644 (file)
index 0000000..49ba725
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTest_descrip[] = "Receive partial datatypes and check that\
+MPI_Getelements gives the correct version";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    MPI_Datatype outtype, oldtypes[2];
+    MPI_Aint     offsets[2];
+    int          blklens[2];
+    MPI_Comm     comm;
+    int          size, rank, src, dest, tag;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    
+    if (size < 2) {
+       errs++;
+       printf( "This test requires at least 2 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    
+    src  = 0;
+    dest = 1;
+
+    if (rank == src) {
+       int buf[128], position, cnt;
+       /* sender */
+
+       /* Create a datatype and send it (multiple of sizeof(int)) */
+       /* Create a send struct type */
+       oldtypes[0] = MPI_INT;
+       oldtypes[1] = MPI_CHAR;
+       blklens[0]  = 1;
+       blklens[1]  = 4*sizeof(int);
+       offsets[0]  = 0;
+       offsets[1]  = sizeof(int);
+       MPI_Type_struct( 2, blklens, offsets, oldtypes, &outtype );
+       MPI_Type_commit( &outtype );
+
+       buf[0] = 4*sizeof(int);
+       /* printf( "About to send to %d\n", dest ); */
+       MPI_Send( buf, 1, outtype, dest, 0, comm );
+       MPI_Type_free( &outtype );
+
+       /* Create a datatype and send it (not a multiple of sizeof(int)) */
+       /* Create a send struct type */
+       oldtypes[0] = MPI_INT;
+       oldtypes[1] = MPI_CHAR;
+       blklens[0]  = 1;
+       blklens[1]  = 4*sizeof(int)+1;
+       offsets[0]  = 0;
+       offsets[1]  = sizeof(int);
+       MPI_Type_struct( 2, blklens, offsets, oldtypes, &outtype );
+       MPI_Type_commit( &outtype );
+
+       buf[0] = 4*sizeof(int) + 1;
+       MPI_Send( buf, 1, outtype, dest, 1, comm );
+       MPI_Type_free( &outtype );
+
+       /* Pack data and send as packed */
+       position = 0;
+       cnt = 7;
+       MPI_Pack( &cnt, 1, MPI_INT, 
+                 buf, 128*sizeof(int), &position, comm );
+       MPI_Pack( (void*)"message", 7, MPI_CHAR,
+                 buf, 128*sizeof(int), &position, comm );
+       MPI_Send( buf, position, MPI_PACKED, dest, 2, comm );
+    }
+    else if (rank == dest) {
+       MPI_Status status;
+       int        buf[128], i, elms, count;
+
+       /* Receiver */
+       /* Create a receive struct type */
+       oldtypes[0] = MPI_INT;
+       oldtypes[1] = MPI_CHAR;
+       blklens[0]  = 1;
+       blklens[1]  = 256;
+       offsets[0]  = 0;
+       offsets[1]  = sizeof(int);
+       MPI_Type_struct( 2, blklens, offsets, oldtypes, &outtype );
+       MPI_Type_commit( &outtype );
+
+       for (i=0; i<3; i++) {
+           tag = i;
+           /* printf( "about to receive tag %d from %d\n", i, src ); */
+           MPI_Recv( buf, 1, outtype, src, tag, comm, &status );
+           MPI_Get_elements( &status, outtype, &elms );
+           if (elms != buf[0] + 1) {
+               errs++;
+               printf( "For test %d, Get elements gave %d but should be %d\n",
+                       i, elms, buf[0] + 1 );
+           }
+           MPI_Get_count( &status, outtype, &count );
+           if (count != MPI_UNDEFINED) {
+               errs++;
+               printf( "For partial send, Get_count did not return MPI_UNDEFINED\n" );
+           }
+       }
+       MPI_Type_free( &outtype );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c b/teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
new file mode 100644 (file)
index 0000000..db9d165
--- /dev/null
@@ -0,0 +1,253 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+int hindexed_zerotype_test(void);
+int hindexed_sparsetype_test(void);
+
+struct test_struct_1 {
+    int a,b,c,d;
+};
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = hindexed_zerotype_test();
+    if (verbose && err) fprintf(stderr, "error in hindexed_zerotype_test\n");
+    errs += err;
+
+    err = hindexed_sparsetype_test();
+    if (verbose && err) fprintf(stderr, "error in hindexed_sparsetype_test\n");
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* tests with an hindexed type with all zero length blocks */
+int hindexed_zerotype_test(void)
+{
+    int err, errs = 0;
+    int count, elements;
+    MPI_Datatype mytype;
+    MPI_Request request;
+    MPI_Status status;
+
+    int blks[]       = { 0, 0, 0 };
+    MPI_Aint disps[] = { 0, 4, 16 };
+
+    err = MPI_Type_hindexed(3, blks, disps, MPI_INT, &mytype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_hindexed returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mytype);
+
+    err = MPI_Irecv(NULL, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(NULL, 1, mytype, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+
+    /* verify count and elements */
+    err = MPI_Get_count(&status, mytype, &count);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_count returned error\n");
+       }
+    }
+    if (count != 0) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "count = %d; should be 0\n", count);
+       }
+    }
+
+    err = MPI_Get_elements(&status, mytype, &elements);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_elements returned error\n");
+       }
+    }
+    if (elements != 0) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "elements = %d; should be 0\n", elements);
+       }
+    }
+
+   // MPI_Type_free(&mytype);
+
+    return errs;
+}
+
+/* tests a short receive into a sparse hindexed type with a zero
+ * length block in it.  sort of eccentric, but we've got the basic
+ * stuff covered with other tests.
+ */
+int hindexed_sparsetype_test(void)
+{
+    int err, errs = 0;
+    int i, count, elements;
+    MPI_Datatype mytype;
+    MPI_Request request;
+    MPI_Status status;
+
+    int sendbuf[6]   = { 1, 2, 3, 4, 5, 6 };
+    int recvbuf[16];
+    int correct[16] = { 1, -2, 4, -4, 2, 3, 5, -8, -9, -10, 6,
+                       -12, -13, -14, -15, -16 };
+
+    int blks[]       = { 1, 0,             2,             1 };
+    MPI_Aint disps[] = { 0, 1*sizeof(int), 4*sizeof(int), 2*sizeof(int) };
+
+    err = MPI_Type_hindexed(4, blks, disps, MPI_INT, &mytype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_hindexed returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mytype);
+
+    for (i=0; i < 16; i++) recvbuf[i] = -(i+1);
+
+    err = MPI_Irecv(recvbuf, 2, mytype, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(sendbuf, 6, MPI_INT, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+    /* verify data */
+    for (i=0; i < 16; i++) {
+       if (recvbuf[i] != correct[i]) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "recvbuf[%d] = %d; should be %d\n",
+                       i, recvbuf[i], correct[i]);
+           }
+       }
+    }
+
+    /* verify count and elements */
+    err = MPI_Get_count(&status, mytype, &count);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_count returned error\n");
+       }
+    }
+    if (count != MPI_UNDEFINED) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "count = %d; should be MPI_UNDEFINED (%d)\n",
+                   count, MPI_UNDEFINED);
+       }
+    }
+
+    err = MPI_Get_elements(&status, mytype, &elements);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_elements returned error\n");
+       }
+    }
+    if (elements != 6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "elements = %d; should be 6\n", elements);
+       }
+    }
+
+//    MPI_Type_free(&mytype);
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/hindexed_block.c b/teshsuite/smpi/mpich3-test/datatype/hindexed_block.c
new file mode 100644 (file)
index 0000000..23f8f62
--- /dev/null
@@ -0,0 +1,352 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_HINDEXED_BLOCK 1
+#endif
+
+#if defined(TEST_HINDEXED_BLOCK)
+static int verbose = 0;
+#endif
+
+/* tests */
+int hindexed_block_contig_test(void);
+int hindexed_block_vector_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf, int count, MPI_Datatype datatype, int typebufsz);
+
+int main(int argc, char **argv)
+{
+#if defined(TEST_HINDEXED_BLOCK)
+    int err;
+#endif
+    int errs = 0;
+    int rank;
+
+    MPI_Init(&argc, &argv);     /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+#if defined(TEST_HINDEXED_BLOCK)
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+     * change the error handler to errors return */
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+    /* perform some tests */
+    err = hindexed_block_contig_test();
+    if (err && verbose)
+        fprintf(stderr, "%d errors in hindexed_block test.\n", err);
+    errs += err;
+
+    err = hindexed_block_vector_test();
+    if (err && verbose)
+        fprintf(stderr, "%d errors in hindexed_block vector test.\n", err);
+    errs += err;
+#endif /*defined(TEST_HINDEXED_BLOCK)*/
+
+    /* print message and exit */
+    if (rank == 0) {
+        if (errs) {
+            fprintf(stderr, "Found %d errors\n", errs);
+        }
+        else {
+            printf(" No Errors\n");
+        }
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+#if defined(TEST_HINDEXED_BLOCK)
+
+/* hindexed_block_contig_test()
+ *
+ * Tests behavior with a hindexed_block that can be converted to a
+ * contig easily.  This is specifically for coverage.
+ *
+ * Returns the number of errors encountered.
+ */
+int hindexed_block_contig_test(void)
+{
+    int buf[4] = { 7, -1, -2, -3 };
+    int err, errs = 0;
+
+    int i, count = 1;
+    MPI_Aint disp = 0;
+    MPI_Datatype newtype;
+
+    int size, int_size;
+    MPI_Aint extent;
+
+    err = MPI_Type_create_hindexed_block(count, 1, &disp, MPI_INT, &newtype);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr, "error creating struct type in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_size(MPI_INT, &int_size);
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr, "error obtaining type size in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    if (size != int_size) {
+        if (verbose) {
+            fprintf(stderr, "error: size != int_size in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr, "error obtaining type extent in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    if (extent != int_size) {
+        if (verbose) {
+            fprintf(stderr, "error: extent != int_size in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_commit(&newtype);
+
+    err = pack_and_unpack((char *) buf, 1, newtype, 4 * sizeof(int));
+    if (err != 0) {
+        if (verbose) {
+            fprintf(stderr, "error packing/unpacking in hindexed_block_contig_test()\n");
+        }
+        errs += err;
+    }
+
+    for (i = 0; i < 4; i++) {
+        int goodval;
+
+        switch (i) {
+        case 0:
+            goodval = 7;
+            break;
+        default:
+            goodval = 0;        /* pack_and_unpack() zeros before unpack */
+            break;
+        }
+        if (buf[i] != goodval) {
+            errs++;
+            if (verbose)
+                fprintf(stderr, "buf[%d] = %d; should be %d\n", i, buf[i], goodval);
+        }
+    }
+
+    MPI_Type_free(&newtype);
+
+    return errs;
+}
+
+/* hindexed_block_vector_test()
+ *
+ * Tests behavior with a hindexed_block of some vector types;
+ * this shouldn't be easily convertable into anything else.
+ *
+ * Returns the number of errors encountered.
+ */
+int hindexed_block_vector_test(void)
+{
+#define NELT (18)
+    int buf[NELT] = {
+        -1, -1, -1,
+         1, -2,  2,
+        -3, -3, -3,
+        -4, -4, -4,
+         3, -5,  4,
+         5, -6,  6
+    };
+    int expected[NELT] = {
+         0,  0,  0,
+         1,  0,  2,
+         0,  0,  0,
+         0,  0,  0,
+         3,  0,  4,
+         5,  0,  6
+    };
+    int err, errs = 0;
+
+    int i, count = 3;
+    MPI_Aint disp[] = { 1, 4, 5 };
+    MPI_Datatype vectype, newtype;
+
+    int size, int_size;
+    MPI_Aint extent;
+
+    /* create a vector type of 2 ints, skipping one in between */
+    err = MPI_Type_vector(2, 1, 2, MPI_INT, &vectype);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr, "error creating vector type in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_commit(&vectype);
+
+    MPI_Type_extent(vectype, &extent);
+    for (i = 0; i < count; i++)
+        disp[i] *= extent;
+
+    err = MPI_Type_create_hindexed_block(count, 1, disp, vectype, &newtype);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr,
+                    "error creating hindexed_block type in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_commit(&newtype);
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+        if (verbose) {
+            fprintf(stderr, "error obtaining type size in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_size(MPI_INT, &int_size);
+
+    if (size != 6 * int_size) {
+        if (verbose) {
+            fprintf(stderr, "error: size != 6 * int_size in hindexed_block_contig_test()\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_extent(newtype, &extent);
+
+    err = pack_and_unpack((char *) buf, 1, newtype, NELT * sizeof(int));
+    if (err != 0) {
+        if (verbose) {
+            fprintf(stderr, "error packing/unpacking in hindexed_block_vector_test()\n");
+        }
+        errs += err;
+    }
+
+    for (i = 0; i < NELT; i++) {
+        if (buf[i] != expected[i]) {
+            errs++;
+            if (verbose)
+                fprintf(stderr, "buf[%d] = %d; should be %d\n", i, buf[i], expected[i]);
+        }
+    }
+
+    MPI_Type_free(&vectype);
+    MPI_Type_free(&newtype);
+    return errs;
+}
+
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf, int count, MPI_Datatype datatype, int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+        errs++;
+        if (verbose) {
+            fprintf(stderr, "error in MPI_Type_size call; aborting after %d errors\n", errs);
+        }
+        return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+        errs++;
+        if (verbose) {
+            fprintf(stderr, "error in MPI_Pack_size call; aborting after %d errors\n", errs);
+        }
+        return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+        errs++;
+        if (verbose) {
+            fprintf(stderr, "error in malloc call; aborting after %d errors\n", errs);
+        }
+        return errs;
+    }
+
+    position = 0;
+    err = MPI_Pack(typebuf, count, datatype, packbuf, type_size, &position, MPI_COMM_SELF);
+
+    if (position != type_size) {
+        errs++;
+        if (verbose)
+            fprintf(stderr, "position = %d; should be %d (pack)\n", position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf, type_size, &position, typebuf, count, datatype, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+        errs++;
+        if (verbose) {
+            fprintf(stderr, "error in MPI_Unpack call; aborting after %d errors\n", errs);
+        }
+        return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+        errs++;
+        if (verbose)
+            fprintf(stderr, "position = %d; should be %d (unpack)\n", position, type_size);
+    }
+
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+        verbose = 1;
+    return 0;
+}
+#endif /*defined(TEST_HINDEXED_BLOCK)*/
diff --git a/teshsuite/smpi/mpich3-test/datatype/hindexed_block_contents.c b/teshsuite/smpi/mpich3-test/datatype/hindexed_block_contents.c
new file mode 100644 (file)
index 0000000..e316c70
--- /dev/null
@@ -0,0 +1,78 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* test based on a bug report from Lisandro Dalcin:
+ * http://lists.mcs.anl.gov/pipermail/mpich-dev/2012-October/000978.html */
+
+#include <mpi.h>
+#include <stdlib.h>
+#include <stdio.h>
+/* USE_STRICT_MPI may be defined in mpitestconf.h */
+#include "mpitestconf.h"
+
+/* assert-like macro that bumps the err count and emits a message */
+#define check(x_)                                                                 \
+    do {                                                                          \
+        if (!(x_)) {                                                              \
+            ++errs;                                                               \
+            if (errs < 10) {                                                      \
+                fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
+            }                                                                     \
+        }                                                                         \
+    } while (0)
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+    int rank;
+    MPI_Datatype t;
+    int count = 4;
+    int blocklength = 2;
+    MPI_Aint displacements[] = {0, 8, 16, 24};
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (!rank) {
+        MPI_Type_create_hindexed_block(count, blocklength,
+                                        displacements, MPI_INT,
+                                        &t);
+        MPI_Type_commit(&t);
+        {
+            int ni, na, nd, combiner;
+            int i[1024];
+            MPI_Aint a[1024];
+            MPI_Datatype d[1024];
+            int k;
+            MPI_Type_get_envelope(t, &ni, &na, &nd, &combiner);
+            MPI_Type_get_contents(t, ni, na, nd, i, a, d);
+
+            check(ni == 2);
+            check(i[0] == 4);
+            check(i[1] == 2);
+
+            check(na == 4);
+            for (k=0; k < na; k++)
+                check(a[k] == (k * 8));
+
+            check(nd == 1);
+            check(d[0] == MPI_INT);
+        }
+
+        MPI_Type_free(&t);
+    }
+
+    if (rank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/indexed-misc.c b/teshsuite/smpi/mpich3-test/datatype/indexed-misc.c
new file mode 100644 (file)
index 0000000..bab12d0
--- /dev/null
@@ -0,0 +1,736 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#include <assert.h>
+#include <limits.h>
+
+static int verbose = 1;
+
+#define check(cond_)                                                                             \
+    do {                                                                                         \
+        if (!(cond_)) {                                                                          \
+            if (verbose) {                                                                       \
+                fprintf(stderr, "condition '%s' does not hold, at line %d\n", #cond_, __LINE__); \
+            }                                                                                    \
+            errs += 1;                                                                           \
+        }                                                                                        \
+    } while (0)
+
+#define check_err(err_, what_failed_)                                                 \
+    do {                                                                              \
+        if (err_) {                                                                   \
+            if (verbose) {                                                            \
+                fprintf(stderr, "error: %s, at line %d\n", (what_failed_), __LINE__); \
+            }                                                                         \
+            errs += (err_);                                                           \
+        }                                                                             \
+    } while (0)
+
+/* tests */
+int indexed_contig_test(void);
+int indexed_zeroblock_first_test(void);
+int indexed_zeroblock_middle_test(void);
+int indexed_zeroblock_last_test(void);
+int indexed_contig_leading_zero_test(void);
+int indexed_same_lengths(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = indexed_contig_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in indexed_contig_test.\n",
+                               err);
+    errs += err;
+
+    err = indexed_zeroblock_first_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in indexed_zeroblock_first_test.\n",
+                               err);
+    errs += err;
+
+    err = indexed_zeroblock_middle_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in indexed_zeroblock_middle_test.\n",
+                               err);
+    errs += err;
+
+    err = indexed_zeroblock_last_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in indexed_zeroblock_last_test.\n",
+                               err);
+    errs += err;
+
+    err = indexed_contig_leading_zero_test();
+    if (err && verbose) fprintf(stderr,
+                                "%d errors in indexed_contig_leading_zero_test.\n",
+                                err);
+    errs += err;
+
+    err = indexed_same_lengths();
+    if (err && verbose) fprintf(stderr,
+                                "%d errors in indexed_contig_leading_zero_test.\n",
+                                err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int indexed_zeroblock_first_test(void)
+{
+    int err, errs = 0;
+
+    MPI_Datatype type;
+    int len[3]  = { 0, 1, 1 };
+    int disp[3] = { 0, 1, 4 };
+    MPI_Aint lb, ub;
+
+    err = MPI_Type_indexed(3, len, disp, MPI_INT, &type);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating indexed type in indexed_zeroblock_first_test()\n");
+       }
+       errs += 1;
+    }
+
+    MPI_Type_lb(type, &lb);
+    if (lb != sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "lb mismatch; is %d, should be %d\n",
+                   (int) lb, (int) sizeof(int));
+       }
+       errs++;
+    }
+    MPI_Type_ub(type, &ub);
+    if (ub != 5 * sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "ub mismatch; is %d, should be %d\n",
+                   (int) ub, (int) (5 * sizeof(int)));
+       }
+       errs++;
+    }
+    
+    MPI_Type_free( &type );
+    
+    return errs;
+}
+
+int indexed_zeroblock_middle_test(void)
+{
+    int err, errs = 0;
+
+    MPI_Datatype type;
+    int len[3]  = { 1, 0, 1 };
+    int disp[3] = { 1, 2, 4 };
+    MPI_Aint lb, ub;
+
+    err = MPI_Type_indexed(3, len, disp, MPI_INT, &type);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating indexed type in indexed_zeroblock_middle_test()\n");
+       }
+       errs += 1;
+    }
+
+    MPI_Type_lb(type, &lb);
+    if (lb != sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "lb mismatch; is %d, should be %d\n",
+                   (int) lb, (int) sizeof(int));
+       }
+       errs++;
+    }
+    MPI_Type_ub(type, &ub);
+    if (ub != 5 * sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "ub mismatch; is %d, should be %d\n",
+                   (int) ub, (int) (5 * sizeof(int)));
+       }
+       errs++;
+    }
+
+    MPI_Type_free( &type );
+    
+    return errs;
+}
+
+int indexed_zeroblock_last_test(void)
+{
+    int err, errs = 0;
+
+    MPI_Datatype type;
+    int len[3]  = { 1, 1, 0 };
+    int disp[3] = { 1, 4, 8 };
+    MPI_Aint lb, ub;
+
+    err = MPI_Type_indexed(3, len, disp, MPI_INT, &type);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating indexed type in indexed_zeroblock_last_test()\n");
+       }
+       errs += 1;
+    }
+
+    MPI_Type_lb(type, &lb);
+    if (lb != sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "lb mismatch; is %d, should be %d\n",
+                   (int) lb, (int) sizeof(int));
+       }
+       errs++;
+    }
+    MPI_Type_ub(type, &ub);
+    if (ub != 5 * sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "ub mismatch; is %d, should be %d\n",
+                   (int) ub, (int) (5 * sizeof(int)));
+       }
+       errs++;
+    }
+
+    MPI_Type_free( &type );
+    
+    return errs;
+}
+
+/* indexed_contig_test()
+ *
+ * Tests behavior with an indexed array that can be compacted but should
+ * continue to be stored as an indexed type.  Specifically for coverage.
+ *
+ * Returns the number of errors encountered.
+ */
+int indexed_contig_test(void)
+{
+    int buf[9] = {-1, 1, 2, 3, -2, 4, 5, -3, 6};
+    int err, errs = 0;
+
+    int i, count = 5;
+    int blklen[]    = { 1, 2, 1, 1, 1 };
+    int disp[] = { 1, 2, 5, 6, 8 };
+    MPI_Datatype newtype;
+
+    int size, int_size;
+
+    err = MPI_Type_indexed(count,
+                          blklen,
+                          disp,
+                          MPI_INT,
+                          &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating indexed type in indexed_contig_test()\n");
+       }
+       errs++;
+    }
+
+    MPI_Type_size(MPI_INT, &int_size);
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in indexed_contig_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 6 * int_size) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 6 * int_size in indexed_contig_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_commit(&newtype);
+
+    err = pack_and_unpack((char *) buf, 1, newtype, 9 * sizeof(int));
+    if (err != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error packing/unpacking in indexed_contig_test()\n");
+       }
+       errs += err;
+    }
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+
+       switch(i) {
+           case 1:
+               goodval = 1;
+               break;
+           case 2:
+               goodval = 2;
+               break;
+           case 3:
+               goodval = 3;
+               break;
+           case 5:
+               goodval = 4;
+               break;
+           case 6:
+               goodval = 5;
+               break;
+           case 8:
+               goodval = 6;
+               break;
+           default:
+               goodval = 0; /* pack_and_unpack() zeros before unpack */
+               break;
+       }
+       if (buf[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "buf[%d] = %d; should be %d\n",
+                                i, buf[i], goodval);
+       }
+    }
+
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+/* very similar to indexed_zeroblock_first_test, but only has a single contig in
+ * order to catch a particular optimization path in MPICH's
+ * Dataloop_create_indexed routine */
+int indexed_contig_leading_zero_test(void)
+{
+    int err, errs = 0;
+
+    int i;
+    MPI_Datatype type = MPI_DATATYPE_NULL;
+    MPI_Datatype struct_type = MPI_DATATYPE_NULL;
+    MPI_Datatype types[2];
+    int len[3]  = { 0, 4, 0 };
+    int disp[3] = { INT_MAX, 2, INT_MAX};
+    MPI_Aint adisp[3];
+    MPI_Aint lb, ub;
+    int *buf = NULL;
+
+    err = MPI_Type_indexed(3, len, disp, MPI_INT, &type);
+    check_err(err, "creating indexed type in indexed_contig_leading_zero_test()");
+    err = MPI_Type_commit(&type);
+    check_err(err, "committing indexed type in indexed_contig_leading_zero_test()");
+
+    MPI_Type_lb(type, &lb);
+    check(lb == 2 * sizeof(int));
+    MPI_Type_ub(type, &ub);
+    check(ub == 6 * sizeof(int));
+
+    /* make sure packing/unpacking works (hits a simple "is_contig" case in
+     * MPICH's pack/unpack routines) */
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    err = pack_and_unpack((char *) buf, 1, type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_contig_leading_zero_test()");
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if (i >= 2 && i < 6)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+    /* -------------------------------------------------------------------- */
+    /* A more rigorous test of the indexed type.  Use a hard-to-optimize struct
+     * type to force a more complicated datatype processing path
+     * (MPID_Segment_manipulate in MPICH) */
+    len[0] = 1;
+    len[1] = 1;
+    adisp[0] = 0;
+    adisp[1] = 8*sizeof(int);
+    types[0] = type;
+    types[1] = MPI_INT;
+
+    /* struct layout: xx0123xx4x ('x' indicates a hole), one char is an
+     * MPI_INT */
+    MPI_Type_create_struct(2, len, adisp, types, &struct_type);
+    check_err(err, "creating struct type in indexed_contig_leading_zero_test()");
+    err = MPI_Type_commit(&struct_type);
+    check_err(err, "committing struct type in indexed_contig_leading_zero_test()");
+
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    err = pack_and_unpack((char *) buf, 1, struct_type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_contig_test()");
+
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if ((i >= 2 && i < 6) || i == 8)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+    MPI_Type_free(&struct_type);
+    MPI_Type_free( &type );
+
+    /* -------------------------------------------------------------------- */
+    /* now do the same as above, but with hindexed */
+    len[0] = 0;
+    len[1] = 4;
+    len[2] = 0;
+    /* use *_MAX vars to improve our chances of hitting any pointer-casting
+     * bugs in a big way (segfaults, etc.) */
+    /* FIXME: This should also look at long, or use a different approach */
+#if defined(HAVE_LONG_LONG) && defined(LLONG_MAX)
+    if (sizeof(MPI_Aint) == sizeof(long long)) {
+        adisp[0] = (MPI_Aint)LLONG_MAX;
+        adisp[1] = 2*sizeof(int);
+        adisp[2] = (MPI_Aint)LLONG_MAX;
+    }
+    else 
+#endif
+    {
+        adisp[0] = (MPI_Aint)INT_MAX;
+        adisp[1] = 2*sizeof(int);
+        adisp[2] = (MPI_Aint)INT_MAX;
+    }
+
+    err = MPI_Type_hindexed(3, len, adisp, MPI_INT, &type);
+    check_err(err, "creating hindexed type in indexed_contig_leading_zero_test()");
+
+    err = MPI_Type_commit(&type);
+    check_err(err, "committing hindexed type in indexed_contig_leading_zero_test()");
+
+    MPI_Type_lb(type, &lb);
+    check(lb == 2 * sizeof(int));
+    MPI_Type_ub(type, &ub);
+    check(ub == 6 * sizeof(int));
+
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    err = pack_and_unpack((char *) buf, 1, type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_contig_test()");
+
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if (i >= 2 && i < 6)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+
+    /* -------------------------------------------------------------------- */
+    /* A more rigorous test of the hindexed type.  Use a hard-to-optimize struct
+     * type to force a more complicated datatype processing path
+     * (MPID_Segment_manipulate in MPICH) */
+    len[0] = 1;
+    len[1] = 1;
+    adisp[0] = 0;
+    adisp[1] = 8*sizeof(int);
+
+    /* struct layout: xx0123xx4x ('x' indicates a hole), one char is an
+     * MPI_INT */
+    err = MPI_Type_create_struct(2, len, adisp, types, &struct_type);
+    check_err(err, "committing struct type in indexed_contig_leading_zero_test()");
+    err = MPI_Type_commit(&struct_type);
+    check_err(err, "committing struct type in indexed_contig_leading_zero_test()");
+
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    /* fails in old MPICH (3.0rc1 and earlier), despite correct ub/lb
+     * determination */
+    err = pack_and_unpack((char *) buf, 1, struct_type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_contig_test()");
+
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if ((i >= 2 && i < 6) || i == 8)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+    MPI_Type_free(&struct_type);
+    MPI_Type_free(&type);
+
+    return errs;
+}
+
+/* Test an indexed (and hindexed) type where the block length is the same for
+ * all blocks, but with differing displacements so that it cannot directly be
+ * converted to a vector type.  It is also important to add a dummy element at
+ * the beginning in order to cause int/MPI_Aint misalignment for the
+ * displacement of the first non-zero-width component. */
+int indexed_same_lengths(void)
+{
+    int err, errs = 0;
+
+    int i;
+    MPI_Datatype type = MPI_DATATYPE_NULL;
+    int len[4];
+    int disp[4];
+    MPI_Aint adisp[4];
+    MPI_Aint lb, ub;
+    int *buf = NULL;
+
+    len[0] = 0;
+    len[1] = 1;
+    len[2] = 1;
+    len[3] = 1;
+
+    disp[0] = 0;
+    disp[1] = 1;
+    disp[2] = 3;
+    disp[3] = 8;
+
+    err = MPI_Type_indexed(4, len, disp, MPI_INT, &type);
+    check_err(err, "creating indexed type in indexed_same_lengths()");
+    err = MPI_Type_commit(&type);
+    check_err(err, "committing indexed type in indexed_same_lengths()");
+
+    MPI_Type_lb(type, &lb);
+    check(lb == 1 * sizeof(int));
+    MPI_Type_ub(type, &ub);
+    check(ub == 9 * sizeof(int));
+
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    err = pack_and_unpack((char *) buf, 1, type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_same_lengths()");
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if (i == 1 || i == 3 || i == 8)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+    MPI_Type_free(&type);
+
+    /* -------------------------------------------------------------------- */
+    /* now do the same as above, but with hindexed */
+    len[0] = 0;
+    len[1] = 1;
+    len[2] = 1;
+    len[3] = 1;
+
+    adisp[0] = 0 * sizeof(int);
+    adisp[1] = 1 * sizeof(int);
+    adisp[2] = 3 * sizeof(int);
+    adisp[3] = 8 * sizeof(int);
+
+    err = MPI_Type_hindexed(4, len, adisp, MPI_INT, &type);
+    check_err(err, "creating hindexed type in indexed_same_lengths()");
+    err = MPI_Type_commit(&type);
+    check_err(err, "committing hindexed type in indexed_same_lengths()");
+
+    MPI_Type_lb(type, &lb);
+    check(lb == 1 * sizeof(int));
+    MPI_Type_ub(type, &ub);
+    check(ub == 9 * sizeof(int));
+
+    buf = malloc(10*sizeof(int));
+    assert(buf != NULL);
+    for (i = 0; i < 10; ++i) {
+        buf[i] = i + 1;
+    }
+    err = pack_and_unpack((char *) buf, 1, type, 10 * sizeof(int));
+    check_err(err, "packing/unpacking in indexed_same_lengths()");
+    for (i = 0; i < 10; ++i) {
+        int expected;
+        if (i == 1 || i == 3 || i == 8)
+            expected = i + 1;
+        else
+            expected = 0;
+        check(buf[i] == expected);
+    }
+    free(buf);
+
+    MPI_Type_free(&type);
+
+    return errs;
+}
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Pack_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in malloc call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    position = 0;
+    err = MPI_Pack(typebuf,
+                  count,
+                  datatype,
+                  packbuf,
+                  type_size,
+                  &position,
+                  MPI_COMM_SELF);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf,
+                    type_size,
+                    &position,
+                    typebuf,
+                    count,
+                    datatype,
+                    MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Unpack call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, type_size);
+    }
+
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/large-count.c b/teshsuite/smpi/mpich3-test/datatype/large-count.c
new file mode 100644 (file)
index 0000000..31f6a2d
--- /dev/null
@@ -0,0 +1,260 @@
+/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test checks for large count functionality ("MPI_Count") mandated by
+ * MPI-3, as well as behavior of corresponding pre-MPI-3 interfaces that now
+ * have better defined behavior when an "int" quantity would overflow. */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+
+/* assert-like macro that bumps the err count and emits a message */
+#define check(x_)                                                                 \
+    do {                                                                          \
+        if (!(x_)) {                                                              \
+            ++errs;                                                               \
+            if (errs < 10) {                                                      \
+                fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
+            }                                                                     \
+        }                                                                         \
+    } while (0)
+
+/* Abort when using unimplemented functions.  Currently, it should not happen,
+ * since sizeof(MPI_Count) == sizeof(int), but it avoids compile errors about
+ * undefined functions. */
+#define err_unimpl(func) do {                                 \
+    fprintf(stderr, "ERROR: %s is not implemented\n", #func); \
+    abort();                                                  \
+  } while (0)
+
+#define MPI_Type_size_x(a,b)              err_unimpl(MPI_Type_size_x)
+#define MPI_Type_get_extent_x(a,b,c)      err_unimpl(MPI_Type_get_extent_x)
+#define MPI_Type_get_true_extent_x(a,b,c) err_unimpl(MPI_Type_get_true_extent_x)
+#define MPI_Get_elements_x(a,b,c)         err_unimpl(MPI_Get_elements_x)
+#define MPI_Status_set_elements_x(a,b,c)  err_unimpl(MPI_Status_set_elements_x)
+
+int main(int argc, char *argv[])
+{
+    int errs = 0;
+    int wrank, wsize;
+    int size, elements, count;
+    MPI_Aint lb, extent;
+    MPI_Count size_x, lb_x, extent_x, elements_x;
+    double imx4i_true_extent;
+    MPI_Datatype imax_contig = MPI_DATATYPE_NULL;
+    MPI_Datatype four_ints = MPI_DATATYPE_NULL;
+    MPI_Datatype imx4i = MPI_DATATYPE_NULL;
+    MPI_Datatype imx4i_rsz = MPI_DATATYPE_NULL;
+    MPI_Status status;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_size(MPI_COMM_WORLD, &wsize);
+
+    check(sizeof(MPI_Count) >= sizeof(int));
+    check(sizeof(MPI_Count) >= sizeof(MPI_Aint));
+    check(sizeof(MPI_Count) >= sizeof(MPI_Offset));
+
+    /* the following two checks aren't explicitly required by the standard, but
+     * it's hard to imagine a world without them holding true and so most of the
+     * subsequent code probably depends on them to some degree */
+    check(sizeof(MPI_Aint) >= sizeof(int));
+    check(sizeof(MPI_Offset) >= sizeof(int));
+
+    /* not much point in checking for integer overflow cases if MPI_Count is
+     * only as large as an int */
+    if (sizeof(MPI_Count) == sizeof(int))
+        goto epilogue;
+
+    /* a very large type */
+    MPI_Type_contiguous(INT_MAX, MPI_CHAR, &imax_contig);
+    MPI_Type_commit(&imax_contig);
+
+    /* a small-ish contig */
+    MPI_Type_contiguous(4, MPI_INT, &four_ints);
+    MPI_Type_commit(&four_ints);
+
+    /* a type with size>INT_MAX */
+    MPI_Type_vector(INT_MAX/2, 1, 3, four_ints, &imx4i);
+    MPI_Type_commit(&imx4i);
+    /* don't forget, ub for dtype w/ stride doesn't include any holes at the end
+     * of the type, hence the more complicated calculation below */
+    imx4i_true_extent = 3LL*4LL*sizeof(int)*((INT_MAX/2)-1) + 4LL*sizeof(int);
+
+    /* sanity check that the MPI_COUNT predefined named datatype exists */
+    MPI_Send(&imx4i_true_extent, 1, MPI_COUNT, MPI_PROC_NULL, 0, MPI_COMM_SELF);
+
+    /* the same oversized type but with goofy extents */
+    MPI_Type_create_resized(imx4i, /*lb=*/INT_MAX, /*extent=*/-1024, &imx4i_rsz);
+    MPI_Type_commit(&imx4i_rsz);
+
+    /* MPI_Type_size */
+    MPI_Type_size(imax_contig, &size);
+    check(size == INT_MAX);
+    MPI_Type_size(four_ints, &size);
+    check(size == 4*sizeof(int));
+    MPI_Type_size(imx4i, &size);
+    check(size == MPI_UNDEFINED); /* should overflow an int */
+    MPI_Type_size(imx4i_rsz, &size);
+    check(size == MPI_UNDEFINED); /* should overflow an int */
+
+    /* MPI_Type_size_x */
+    MPI_Type_size_x(imax_contig, &size_x);
+    check(size_x == INT_MAX);
+    MPI_Type_size_x(four_ints, &size_x);
+    check(size_x == 4*sizeof(int));
+    MPI_Type_size_x(imx4i, &size_x);
+    check(size_x == 4LL*sizeof(int)*(INT_MAX/2)); /* should overflow an int */
+    MPI_Type_size_x(imx4i_rsz, &size_x);
+    check(size_x == 4LL*sizeof(int)*(INT_MAX/2)); /* should overflow an int */
+
+    /* MPI_Type_get_extent */
+    MPI_Type_get_extent(imax_contig, &lb, &extent);
+    check(lb == 0);
+    check(extent == INT_MAX);
+    MPI_Type_get_extent(four_ints, &lb, &extent);
+    check(lb == 0);
+    check(extent == 4*sizeof(int));
+    MPI_Type_get_extent(imx4i, &lb, &extent);
+    check(lb == 0);
+    if (sizeof(MPI_Aint) == sizeof(int))
+        check(extent == MPI_UNDEFINED);
+    else
+        check(extent == imx4i_true_extent);
+
+    MPI_Type_get_extent(imx4i_rsz, &lb, &extent);
+    check(lb == INT_MAX);
+    check(extent == -1024);
+
+    /* MPI_Type_get_extent_x */
+    MPI_Type_get_extent_x(imax_contig, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == INT_MAX);
+    MPI_Type_get_extent_x(four_ints, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == 4*sizeof(int));
+    MPI_Type_get_extent_x(imx4i, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == imx4i_true_extent);
+    MPI_Type_get_extent_x(imx4i_rsz, &lb_x, &extent_x);
+    check(lb_x == INT_MAX);
+    check(extent_x == -1024);
+
+    /* MPI_Type_get_true_extent */
+    MPI_Type_get_true_extent(imax_contig, &lb, &extent);
+    check(lb == 0);
+    check(extent == INT_MAX);
+    MPI_Type_get_true_extent(four_ints, &lb, &extent);
+    check(lb == 0);
+    check(extent == 4*sizeof(int));
+    MPI_Type_get_true_extent(imx4i, &lb, &extent);
+    check(lb == 0);
+    if (sizeof(MPI_Aint) == sizeof(int))
+        check(extent == MPI_UNDEFINED);
+    else
+        check(extent == imx4i_true_extent);
+    MPI_Type_get_true_extent(imx4i_rsz, &lb, &extent);
+    check(lb == 0);
+    if (sizeof(MPI_Aint) == sizeof(int))
+        check(extent == MPI_UNDEFINED);
+    else
+        check(extent == imx4i_true_extent);
+
+    /* MPI_Type_get_true_extent_x */
+    MPI_Type_get_true_extent_x(imax_contig, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == INT_MAX);
+    MPI_Type_get_true_extent_x(four_ints, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == 4*sizeof(int));
+    MPI_Type_get_true_extent_x(imx4i, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == imx4i_true_extent);
+    MPI_Type_get_true_extent_x(imx4i_rsz, &lb_x, &extent_x);
+    check(lb_x == 0);
+    check(extent_x == imx4i_true_extent);
+
+
+    /* MPI_{Status_set_elements,Get_elements}{,_x} */
+
+    /* set simple */
+    MPI_Status_set_elements(&status, MPI_INT, 10);
+    MPI_Get_elements(&status, MPI_INT, &elements);
+    MPI_Get_elements_x(&status, MPI_INT, &elements_x);
+    MPI_Get_count(&status, MPI_INT, &count);
+    check(elements == 10);
+    check(elements_x == 10);
+    check(count == 10);
+
+    /* set_x simple */
+    MPI_Status_set_elements_x(&status, MPI_INT, 10);
+    MPI_Get_elements(&status, MPI_INT, &elements);
+    MPI_Get_elements_x(&status, MPI_INT, &elements_x);
+    MPI_Get_count(&status, MPI_INT, &count);
+    check(elements == 10);
+    check(elements_x == 10);
+    check(count == 10);
+
+    /* Sets elements corresponding to count=1 of the given MPI datatype, using
+     * set_elements and set_elements_x.  Checks expected values are returned by
+     * get_elements, get_elements_x, and get_count (including MPI_UNDEFINED
+     * clipping) */
+#define check_set_elements(type_, elts_)                          \
+    do {                                                          \
+        elements = elements_x = count = 0xfeedface;               \
+        /* can't use legacy "set" for large element counts */     \
+        if ((elts_) <= INT_MAX) {                                 \
+            MPI_Status_set_elements(&status, (type_), 1);         \
+            MPI_Get_elements(&status, (type_), &elements);        \
+            MPI_Get_elements_x(&status, (type_), &elements_x);    \
+            MPI_Get_count(&status, (type_), &count);              \
+            check(elements == (elts_));                           \
+            check(elements_x == (elts_));                         \
+            check(count == 1);                                    \
+        }                                                         \
+                                                                  \
+        elements = elements_x = count = 0xfeedface;               \
+        MPI_Status_set_elements_x(&status, (type_), 1);           \
+        MPI_Get_elements(&status, (type_), &elements);            \
+        MPI_Get_elements_x(&status, (type_), &elements_x);        \
+        MPI_Get_count(&status, (type_), &count);                  \
+        if ((elts_) > INT_MAX) {                                  \
+            check(elements == MPI_UNDEFINED);                     \
+        }                                                         \
+        else {                                                    \
+            check(elements == (elts_));                           \
+        }                                                         \
+        check(elements_x == (elts_));                             \
+        check(count == 1);                                        \
+    } while (0)                                                   \
+
+    check_set_elements(imax_contig, INT_MAX);
+    check_set_elements(four_ints, 4);
+    check_set_elements(imx4i, 4LL*(INT_MAX/2));
+    check_set_elements(imx4i_rsz, 4LL*(INT_MAX/2));
+
+epilogue:
+    if (imax_contig != MPI_DATATYPE_NULL) MPI_Type_free(&imax_contig);
+    if (four_ints != MPI_DATATYPE_NULL) MPI_Type_free(&four_ints);
+    if (imx4i != MPI_DATATYPE_NULL) MPI_Type_free(&imx4i);
+    if (imx4i_rsz != MPI_DATATYPE_NULL) MPI_Type_free(&imx4i_rsz);
+
+    MPI_Reduce((wrank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+    if (wrank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/lbub.c b/teshsuite/smpi/mpich3-test/datatype/lbub.c
new file mode 100644 (file)
index 0000000..366dd6c
--- /dev/null
@@ -0,0 +1,1305 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* 
+   The default behavior of the test routines should be to briefly indicate
+   the cause of any errors - in this test, that means that verbose needs
+   to be set. Verbose should turn on output that is independent of error
+   levels.
+*/
+static int verbose = 1;
+
+/* tests */
+int int_with_lb_ub_test(void);
+int contig_of_int_with_lb_ub_test(void);
+int contig_negextent_of_int_with_lb_ub_test(void);
+int vector_of_int_with_lb_ub_test(void);
+int vector_blklen_of_int_with_lb_ub_test(void);
+int vector_blklen_stride_of_int_with_lb_ub_test(void);
+int vector_blklen_stride_negextent_of_int_with_lb_ub_test(void);
+int vector_blklen_negstride_negextent_of_int_with_lb_ub_test(void);
+int int_with_negextent_test(void);
+int vector_blklen_negstride_of_int_with_lb_ub_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MTest_Init( &argc, &argv );
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in simple lb/ub test\n", err);
+    errs += err;
+
+    err = contig_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in contig test\n", err);
+    errs += err;
+
+    err = contig_negextent_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in negextent contig test\n", err);
+    errs += err;
+
+    err = vector_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in simple vector test\n", err);
+    errs += err;
+
+    err = vector_blklen_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in vector blklen test\n", err);
+    errs += err;
+
+    err = vector_blklen_stride_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in strided vector test\n", err);
+    errs += err;
+
+    err = vector_blklen_negstride_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in negstrided vector test\n", err);
+    errs += err;
+
+    err = int_with_negextent_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in negextent lb/ub test\n", err);
+    errs += err;
+
+    err = vector_blklen_stride_negextent_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in strided negextent vector test\n", err);
+    errs += err;
+
+    err = vector_blklen_negstride_negextent_of_int_with_lb_ub_test();
+    if (err && verbose) fprintf(stderr, "found %d errors in negstrided negextent vector test\n", err);
+    errs += err;
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
+int int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+
+    MPI_Datatype eviltype;
+
+    err = MPI_Type_struct(3, blocks, disps, types, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 4);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %ld; should be %d\n", (long) aval, 9);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -3);
+    }
+
+    if (extent != 9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 9);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 6) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, 6);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, 0);
+    }
+
+    if (aval != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 4);
+    }
+    
+    MPI_Type_free(&eviltype);
+
+    return errs;
+}
+
+int contig_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+    char *typemapstring = 0;
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    typemapstring = (char*)"{ (LB,-3),4*(BYTE,0),(UB,6) }";
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    typemapstring=(char*)"{ (LB,-3),4*(BYTE,0),(UB,6),(LB,6),4*(BYTE,9),(UB,15),(LB,15),4*(BYTE,18),(UB,24)}";
+    err = MPI_Type_contiguous(3, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_contiguous of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size of %s failed.\n", 
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 12) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", 
+                            val, 12);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 27) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 27);
+       if (verbose) fprintf( stderr, " for type %s\n", typemapstring );
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d from Type_lb; should be %d in %s\n", (int) aval, -3, typemapstring );
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d from Type_get_extent; should be %d in %s\n",
+                            (int) aval, -3, typemapstring );
+    }
+
+    if (extent != 27) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d from Type_get_extent; should be %d in %s\n",
+                            (int) extent, 27, typemapstring);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 24) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d in Type_ub; should be %din %s\n", (int) aval, 24, typemapstring);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d in %s\n", (int) true_lb, 0, typemapstring);
+    }
+
+    if (aval != 22) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d in %s\n", (int) aval, 22, typemapstring);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+int contig_negextent_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { 6, 0, -3 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+    char *typemapstring = 0;
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    typemapstring = (char*)"{ (LB,6),4*(BYTE,0),(UB,-3) }";
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* No point in continuing */
+       return errs;
+    }
+
+    typemapstring = (char*)"{ (LB,6),4*(BYTE,0),(UB,-3),(LB,-3),4*(BYTE,-9),(UB,-12),(LB,-12),4*(BYTE,-18),(UB,-21) }";
+    err = MPI_Type_contiguous(3, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_contiguous of %s failed.\n",
+                            typemapstring);
+       if (verbose) MTestPrintError( err  );
+       /* No point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size of %s failed.\n", 
+                            typemapstring);
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 12) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 12);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 9);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -12) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -12);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -12) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -12);
+    }
+
+    if (extent != 9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 9);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != -18) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, -18);
+    }
+
+    if (aval != 22) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 22);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+    
+    return errs;
+}
+
+int vector_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 1, 1, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 12) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 12);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 27) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 27);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -3);
+    }
+
+    if (extent != 27) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 27);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 24) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, 24);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, 0);
+    }
+
+    if (aval != 22) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 22);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+/*
+ * blklen = 4
+ */
+int vector_blklen_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 4, 1, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 48) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 48);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 54) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 54);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -3);
+       if (verbose) MTestPrintError( err  );
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -3);
+    }
+
+    if (extent != 54) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 54);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 51) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, 51);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, 0);
+    }
+
+    if (aval != 49) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 49);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+int vector_blklen_stride_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+    char *typemapstring = 0;
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    typemapstring = (char*)"{ (LB,-3),4*(BYTE,0),(UB,6) }";
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* No point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 4, 5, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 48) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 48);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 126) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 126);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -3);
+    }
+
+    if (extent != 126) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 126);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 123) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, 123);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, 0);
+    }
+
+    if (aval != 121) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 121);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+int vector_blklen_negstride_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { -3, 0, 6 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 4, -5, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 48) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 48);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 126) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 126);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -93) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -93);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -93) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -93);
+    }
+
+    if (extent != 126) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 126);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 33) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, 33);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != -90) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, -90);
+    }
+
+    if (aval != 121) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 121);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+int int_with_negextent_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { 6, 0, -3 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+    char *typemapstring =0;
+
+    MPI_Datatype eviltype;
+
+    typemapstring = (char*)"{ (LB,6),4*(BYTE,0),(UB,-3) }";
+    err = MPI_Type_struct(3, blocks, disps, types, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* No point in contiuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 4);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, -9);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 6) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, 6);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != 6) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, 6);
+    }
+
+    if (extent != -9) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, -9);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != 0) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, 0);
+    }
+
+    if (aval != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 4);
+    }
+    
+    MPI_Type_free(&eviltype);
+
+    return errs;
+}
+
+int vector_blklen_stride_negextent_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint lb, extent, true_lb, aval;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { 6, 0, -3 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+    MPI_Datatype inttype, eviltype;
+    char *typemapstring = 0;
+
+    /* build same type as in int_with_lb_ub_test() */
+    typemapstring = (char*)"{ (LB,6),4*(BYTE,0),(UB,-3) }";
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct of %s failed.\n",
+                            typemapstring );
+       if (verbose) MTestPrintError( err  );
+       /* No point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 4, 5, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 48) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 48);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 108) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n", (int) aval, 108);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -111) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n", (int) aval, -111);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -111) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %d; should be %d\n",
+                            (int) aval, -111);
+    }
+
+    if (extent != 108) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %d; should be %d\n",
+                            (int) extent, 108);
+    }
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -3) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %d; should be %d\n", (int) aval, -3);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != -117) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %d; should be %d\n", (int) true_lb, -117);
+    }
+
+    if (aval != 121) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %d; should be %d\n", (int) aval, 121);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
+
+int vector_blklen_negstride_negextent_of_int_with_lb_ub_test(void)
+{
+    int err, errs = 0, val;
+    MPI_Aint extent, lb, aval, true_lb;
+    int blocks[3] = { 1, 4, 1 };
+    MPI_Aint disps[3] = { 6, 0, -3 };
+    MPI_Datatype types[3] = { MPI_LB, MPI_BYTE, MPI_UB };
+
+    MPI_Datatype inttype, eviltype;
+
+    /* build same type as in int_with_lb_ub_test() */
+    err = MPI_Type_struct(3, blocks, disps, types, &inttype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_struct failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_vector(3, 4, -5, inttype, &eviltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_vector failed.\n");
+       if (verbose) MTestPrintError( err  );
+       /* no point in continuing */
+       return errs;
+    }
+
+    err = MPI_Type_size(eviltype, &val);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_size failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (val != 48) {
+       errs++;
+       if (verbose) fprintf(stderr, "  size of type = %d; should be %d\n", val, 48);
+    }
+
+    err = MPI_Type_extent(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 108) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %ld; should be %d\n", (long) aval, 108);
+    }
+    
+    err = MPI_Type_lb(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_lb failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != -21) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %ld; should be %d\n", (long) aval, -21);
+    }
+
+    err = MPI_Type_get_extent(eviltype, &lb, &extent);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (lb != -21) {
+       errs++;
+       if (verbose) fprintf(stderr, "  lb of type = %ld; should be %d\n",
+                            (long) aval, -21);
+    }
+
+    if (extent != 108) {
+       errs++;
+       if (verbose) fprintf(stderr, "  extent of type = %ld; should be %d\n",
+                            (long) extent, 108);
+    }
+
+
+    err = MPI_Type_ub(eviltype, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_ub failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (aval != 87) {
+       errs++;
+       if (verbose) fprintf(stderr, "  ub of type = %ld; should be %d\n", (long) aval, 87);
+    }
+
+    err = MPI_Type_get_true_extent(eviltype, &true_lb, &aval);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, "  MPI_Type_get_true_extent failed.\n");
+       if (verbose) MTestPrintError( err  );
+    }
+
+    if (true_lb != -27) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true_lb of type = %ld; should be %d\n", (long) true_lb, -27);
+    }
+
+    if (aval != 121) {
+       errs++;
+       if (verbose) fprintf(stderr, "  true extent of type = %ld; should be %d\n", (long) aval, 121);
+    }
+
+    MPI_Type_free( &inttype );
+    MPI_Type_free( &eviltype );
+
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/localpack.c b/teshsuite/smpi/mpich3-test/datatype/localpack.c
new file mode 100644 (file)
index 0000000..11e165a
--- /dev/null
@@ -0,0 +1,97 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* based on the pack.c test in the mpich suite.
+ */
+
+#include "mpi.h"
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+#define BUF_SIZE 16384
+
+int parse_args(int argc, char **argv);
+
+int main(int argc, char *argv[])
+{
+    int errs = 0;
+    char buffer[BUF_SIZE];
+    int n, size;
+    double a,b;
+    int pos;
+
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    pos        = 0;
+    n  = 10;
+    a  = 1.1;
+    b  = 2.2;
+
+    MPI_Pack(&n, 1, MPI_INT, buffer, BUF_SIZE, &pos, MPI_COMM_WORLD);
+    MPI_Pack(&a, 1, MPI_DOUBLE, buffer, BUF_SIZE, &pos, MPI_COMM_WORLD);
+    MPI_Pack(&b, 1, MPI_DOUBLE, buffer, BUF_SIZE, &pos, MPI_COMM_WORLD);
+
+    size = pos;
+    pos  = 0;
+    n    = 0;
+    a    = 0;
+    b    = 0;
+
+    MPI_Unpack(buffer, size, &pos, &n, 1, MPI_INT, MPI_COMM_WORLD);
+    MPI_Unpack(buffer, size, &pos, &a, 1, MPI_DOUBLE, MPI_COMM_WORLD);
+    MPI_Unpack(buffer, size, &pos, &b, 1, MPI_DOUBLE, MPI_COMM_WORLD);
+    /* Check results */
+    if (n != 10) { 
+       errs++;
+       if (verbose) fprintf(stderr, "Wrong value for n; got %d expected %d\n", n, 10 );
+    }
+    if (a != 1.1) { 
+       errs++;
+       if (verbose) fprintf(stderr, "Wrong value for a; got %f expected %f\n", a, 1.1 );
+    }
+    if (b != 2.2) { 
+       errs++;
+       if (verbose) fprintf(stderr, "Wrong value for b; got %f expected %f\n", b, 2.2 );
+    }
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/longdouble.c b/teshsuite/smpi/mpich3-test/datatype/longdouble.c
new file mode 100644 (file)
index 0000000..7175e91
--- /dev/null
@@ -0,0 +1,65 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* Some MPI implementations should not support MPI_LONG_DOUBLE because it has
+ * different representations/sizes among several concurrently supported
+ * compilers.  For example, a 16-byte GCC implementation and an 8-byte Cray
+ * compiler implementation.
+ *
+ * This test ensures that simplistic build logic/configuration did not result in
+ * a defined, yet incorrectly sized, MPI predefined datatype for long double and
+ * long double _Complex.  See tt#1671 for more info.
+ *
+ * Based on a test suggested by Jim Hoekstra @ Iowa State University. */
+
+int main(int argc, char *argv[])
+{
+    int rank, size, type_size;
+    int errs = 0;
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    if (rank == 0) {
+#ifdef HAVE_LONG_DOUBLE
+        if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+            MPI_Type_size(MPI_LONG_DOUBLE, &type_size);
+            if (type_size != sizeof(long double)) {
+                printf("type_size != sizeof(long double) : (%zd != %zd)\n",
+                       (size_t)type_size, sizeof(long double));
+                ++errs;
+            }
+        }
+#endif
+#if defined(HAVE_LONG_DOUBLE__COMPLEX) && defined(USE_LONG_DOUBLE_COMPLEX)
+        if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
+            MPI_Type_size(MPI_C_LONG_DOUBLE_COMPLEX, &type_size);
+            if (type_size != sizeof(long double _Complex)) {
+                printf("type_size != sizeof(long double _Complex) : (%zd != %zd)\n",
+                       (size_t)type_size, sizeof(long double _Complex));
+                ++errs;
+            }
+        }
+#endif
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+
+    MPI_Finalize();
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c b/teshsuite/smpi/mpich3-test/datatype/lots-of-types.c
new file mode 100644 (file)
index 0000000..418ff0b
--- /dev/null
@@ -0,0 +1,200 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* 
+   The default behavior of the test routines should be to briefly indicate
+   the cause of any errors - in this test, that means that verbose needs
+   to be set. Verbose should turn on output that is independent of error
+   levels.
+*/
+static int verbose = 1;
+
+int parse_args(int argc, char **argv);
+int lots_of_types_test(void);
+
+struct test_struct_1 {
+    int a,b,c,d;
+};
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    /* Initialize MPI */
+    MTest_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = lots_of_types_test();
+    if (verbose && err) fprintf(stderr, "error in lots_of_types_test\n");
+    errs += err;
+
+    /* print message and exit */
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+    return 0;
+}
+
+/* this test allocates 1024 indexed datatypes with 1024 distinct blocks
+ * each.  it's possible that a low memory machine will run out of memory
+ * running this test; it appears to take ~25MB of memory at this time.
+ * -- Rob Ross, 11/2/2005
+ */
+#define NUM_DTYPES 1024
+#define NUM_BLOCKS 1024
+int lots_of_types_test(void)
+{
+    int err, errs = 0;
+    int i;
+    MPI_Datatype mytypes[NUM_DTYPES];
+
+    int sendbuf[4] = { 1, 2, 3, 4 };
+
+    int count, elements;
+    MPI_Request request;
+    MPI_Status status;
+
+    /* note: first element of struct has zero blklen and should be dropped */
+    int disps[NUM_BLOCKS];
+    int blks[NUM_BLOCKS];
+
+    for (i=0; i < NUM_DTYPES; i++)
+        mytypes[i] = MPI_DATATYPE_NULL;
+
+    for (i=0; i < NUM_DTYPES; i++) {
+       int j;
+
+       disps[0] = 0;
+       blks[0]  = 4;
+       
+       for (j=1; j < NUM_BLOCKS; j++) {
+           disps[j] = 4 * j;
+           blks[j]  = (j % 3) + 1;
+       }
+
+       err = MPI_Type_indexed(NUM_BLOCKS, blks, disps, MPI_INT, &mytypes[i]);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Type_indexed returned error on type %d\n",
+                       i);
+           }
+            mytypes[i] = MPI_DATATYPE_NULL;
+            goto fn_exit;
+       }
+       
+       MPI_Type_commit(&mytypes[i]);
+    }
+
+    for (i=0; i < NUM_DTYPES; i++) {
+       int j;
+       int recvbuf[4] = { -1, -1, -1, -1 };
+
+       /* we will only receive 4 ints, so short buffer is ok */
+       err = MPI_Irecv(recvbuf, 1, mytypes[i], 0, 0, MPI_COMM_SELF, &request);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Irecv returned error\n");
+           }
+       }
+       
+       err = MPI_Send(sendbuf, 4, MPI_INT, 0, 0, MPI_COMM_SELF);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Send returned error\n");
+           }
+       }
+       
+       err = MPI_Wait(&request, &status);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Wait returned error\n");
+           }
+       }
+       
+       /* verify data */
+       for (j=0; j < 4; j++) {
+           if (recvbuf[j] != sendbuf[j]) {
+               errs++;
+               if (verbose) {
+                   fprintf(stderr, "recvbuf[%d] = %d; should be %d\n",
+                           j, recvbuf[j], sendbuf[j]);
+               }
+           }
+       }
+
+       /* verify count and elements */
+       err = MPI_Get_count(&status, mytypes[i], &count);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Get_count returned error\n");
+           }
+       }
+       if (count != MPI_UNDEFINED) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "count = %d; should be MPI_UNDEFINED (%d)\n",
+                       count, MPI_UNDEFINED);
+           }
+       }
+       
+       err = MPI_Get_elements(&status, mytypes[i], &elements);
+       if (err != MPI_SUCCESS) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "MPI_Get_elements returned error\n");
+           }
+       }
+       if (elements != 4) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "elements = %d; should be 4\n", elements);
+           }
+       }
+    }
+
+ fn_exit:
+    for (i=0; i < NUM_DTYPES; i++) {
+        if (mytypes[i] != MPI_DATATYPE_NULL)
+            MPI_Type_free(&mytypes[i]);
+    }
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/pairtype-pack.c b/teshsuite/smpi/mpich3-test/datatype/pairtype-pack.c
new file mode 100644 (file)
index 0000000..8086bd5
--- /dev/null
@@ -0,0 +1,210 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+int short_int_pack_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz);
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = short_int_pack_test();
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int short_int_pack_test(void)
+{
+    int i, err, errs = 0;
+
+    struct shortint { short a; int b; } sibuf[16];
+
+    for (i=0; i < 16; i++) {
+       sibuf[i].a = (short) (i * 2);
+       sibuf[i].b = i * 2 + 1;
+    }
+
+    err = pack_and_unpack((char *) sibuf, 16, MPI_SHORT_INT, sizeof(sibuf));
+    if (err != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error packing/unpacking in short_int_pack_test()\n");
+       }
+       errs += err;
+    }
+
+    for (i=0; i < 16; i++) {
+       if (sibuf[i].a != (short) (i * 2)) {
+           err++;
+           if (verbose) {
+               fprintf(stderr,
+                       "buf[%d] has invalid short (%d); should be %d\n",
+                       i, (int) sibuf[i].a, i * 2);
+           }
+       }
+       if (sibuf[i].b != i * 2 + 1) {
+           err++;
+           if (verbose) {
+               fprintf(stderr,
+                       "buf[%d] has invalid int (%d); should be %d\n",
+                       i, (int) sibuf[i].b, i * 2 + 1);
+           }
+       }
+    }
+
+    return errs;
+}
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Pack_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in malloc call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    position = 0;
+    err = MPI_Pack(typebuf,
+                  count,
+                  datatype,
+                  packbuf,
+                  type_size,
+                  &position,
+                  MPI_COMM_SELF);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf,
+                    type_size,
+                    &position,
+                    typebuf,
+                    count,
+                    datatype,
+                    MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Unpack call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, type_size);
+    }
+
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/pairtype-size-extent.c b/teshsuite/smpi/mpich3-test/datatype/pairtype-size-extent.c
new file mode 100644 (file)
index 0000000..b4a1533
--- /dev/null
@@ -0,0 +1,143 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 1;
+
+
+
+int parse_args(int argc, char **argv);
+
+MPI_Aint pairtype_displacement(MPI_Datatype type, int *out_size_p);
+
+MPI_Aint pairtype_displacement(MPI_Datatype type, int *out_size_p)
+{
+    MPI_Aint disp;
+
+    /* Note that a portable test may not use a switch statement for 
+       datatypes, as they are not required to be compile-time constants */
+    if (type == MPI_FLOAT_INT) {
+       struct { float a; int b; } foo;
+       disp = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+       *out_size_p = sizeof(foo);
+    }
+    else if (type == MPI_DOUBLE_INT) {
+       struct { double a; int b; } foo;
+       disp = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+       *out_size_p = sizeof(foo);
+    }
+    else if (type == MPI_LONG_INT) {
+       struct { long a; int b; } foo;
+       disp = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+       *out_size_p = sizeof(foo);
+    }
+    else if (type == MPI_SHORT_INT) {
+       struct { short a; int b; } foo;
+       disp = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+       *out_size_p = sizeof(foo);
+    }
+    else if (type == MPI_LONG_DOUBLE_INT && type != MPI_DATATYPE_NULL) {
+       struct { long double a; int b; } foo;
+       disp = (MPI_Aint) ((char *) &foo.b - (char *) &foo.a);
+       *out_size_p = sizeof(foo);
+    }
+    else {
+       disp = -1;
+    }
+    return disp;
+}
+
+int main(int argc, char *argv[])
+{
+
+struct { MPI_Datatype atype, ptype; char name[32]; }
+pairtypes[] =
+    { {MPI_FLOAT, MPI_FLOAT_INT, "MPI_FLOAT_INT"},
+      {MPI_DOUBLE, MPI_DOUBLE_INT, "MPI_DOUBLE_INT"},
+      {MPI_LONG, MPI_LONG_INT, "MPI_LONG_INT"},
+      {MPI_SHORT, MPI_SHORT_INT, "MPI_SHORT_INT"},
+      {MPI_LONG_DOUBLE, MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT"},
+      {(MPI_Datatype) -1, (MPI_Datatype) -1, "end"}
+    };
+    int errs = 0;
+
+    int i;
+    int blks[2] = {1, 1};
+    MPI_Aint disps[2] = {0, 0};
+    MPI_Datatype types[2] = {MPI_INT, MPI_INT};
+    MPI_Datatype stype;
+    
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    for (i=0; pairtypes[i].atype != (MPI_Datatype) -1; i++) {
+       int atype_size, ptype_size, stype_size, handbuilt_extent=0;
+       MPI_Aint ptype_extent, stype_extent, dummy_lb;
+
+       types[0] = pairtypes[i].atype;
+
+       /* Check for undefined optional types, such as
+          LONG_DOUBLE_INT (if, for example, long double or
+          long long are not supported) */
+       if (types[0] == MPI_DATATYPE_NULL) continue;
+
+       MPI_Type_size(types[0], &atype_size);
+       disps[1] = pairtype_displacement(pairtypes[i].ptype,
+                                        &handbuilt_extent);
+
+       MPI_Type_create_struct(2, blks, disps, types, &stype);
+
+       MPI_Type_size(stype, &stype_size);
+       MPI_Type_size(pairtypes[i].ptype, &ptype_size);
+       if (stype_size != ptype_size) {
+           errs++;
+
+           if (verbose) fprintf(stderr,
+                                "size of %s (%d) does not match size of hand-built MPI struct (%d)\n",
+                                pairtypes[i].name, ptype_size, stype_size);
+       }
+
+       MPI_Type_get_extent(stype, &dummy_lb, &stype_extent);
+       MPI_Type_get_extent(pairtypes[i].ptype, &dummy_lb, &ptype_extent);
+       if (stype_extent != ptype_extent || stype_extent != handbuilt_extent) {
+           errs++;
+
+           if (verbose) fprintf(stderr,
+                                "extent of %s (%d) does not match extent of either hand-built MPI struct (%d) or equivalent C struct (%d)\n",
+                                pairtypes[i].name, (int) stype_extent,
+                                (int) ptype_extent,
+                                handbuilt_extent);
+       }
+       MPI_Type_free( &stype );
+    }
+    
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /* We use a simple test because getopt isn't universally available */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    if (argc > 1 && strcmp(argv[1], "-nov") == 0)
+       verbose = 0;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/simple-commit.c b/teshsuite/smpi/mpich3-test/datatype/simple-commit.c
new file mode 100644 (file)
index 0000000..2caa4e8
--- /dev/null
@@ -0,0 +1,78 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* Tests that commit of a couple of basic types succeeds. */
+
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int mpi_err, errs = 0;
+    MPI_Datatype type;
+
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    type = MPI_INT;
+    mpi_err = MPI_Type_commit(&type);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_commit of MPI_INT failed.\n");
+       }
+       errs++;
+    }
+
+    type = MPI_FLOAT_INT;
+    mpi_err = MPI_Type_commit(&type);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_commit of MPI_FLOAT_INT failed.\n");
+       }
+       errs++;
+    }
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/simple-pack-external.c b/teshsuite/smpi/mpich3-test/datatype/simple-pack-external.c
new file mode 100644 (file)
index 0000000..6465944
--- /dev/null
@@ -0,0 +1,412 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+static int verbose = 0;
+
+/* tests */
+int builtin_float_test(void);
+int vector_of_vectors_test(void);
+int optimizable_vector_of_basics_test(void);
+int struct_of_basics_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MTest_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = builtin_float_test();
+    if (err && verbose) fprintf(stderr, "%d errors in builtin float test.\n",
+                               err);
+    errs += err;
+
+    err = vector_of_vectors_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in vector of vectors test.\n", err);
+    errs += err;
+
+    err = optimizable_vector_of_basics_test();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in vector of basics test.\n", err);
+    errs += err;
+
+    err = struct_of_basics_test();
+    if (err && verbose) fprintf(stderr, 
+                               "%d errors in struct of basics test.\n", err);
+    errs += err;
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+/* builtin_float_test()
+ *
+ * Tests functionality of get_envelope() and get_contents() on a MPI_FLOAT.
+ *
+ * Returns the number of errors encountered.
+ */
+int builtin_float_test(void)
+{
+    int nints, nadds, ntypes, combiner;
+
+    int /* err, */ errs = 0;
+
+    /* err = */ MPI_Type_get_envelope(MPI_FLOAT,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    
+    if (combiner != MPI_COMBINER_NAMED) errs++;
+
+    /* Note: it is erroneous to call MPI_Type_get_contents() on a basic. */
+    return errs;
+}
+
+/* vector_of_vectors_test()
+ *
+ * Builds a vector of a vector of ints.  Assuming an int array of size 9 
+ * integers, and treating the array as a 3x3 2D array, this will grab the
+ * corners.
+ *
+ * Returns the number of errors encountered.
+ */
+int vector_of_vectors_test(void)
+{
+    MPI_Datatype inner_vector;
+    MPI_Datatype outer_vector;
+    int array[9] = {  1, -1,  2,
+                    -2, -3, -4,
+                     3, -5,  4 };
+
+    char *buf;
+    int i, err, errs = 0;
+    MPI_Aint sizeoftype, position;
+
+    /* set up type */
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         MPI_INT,
+                         &inner_vector);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs;
+    }
+
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         inner_vector,
+                         &outer_vector);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs;
+    }
+
+    MPI_Type_commit(&outer_vector);
+
+    MPI_Pack_external_size((char*)"external32", 1, outer_vector, &sizeoftype);
+    if (sizeoftype != 4*4) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            (int) sizeoftype, 4*4);
+       return errs;
+    }
+
+    buf = (char *) malloc(sizeoftype);
+
+    position = 0;
+    err = MPI_Pack_external((char*)"external32",
+                           array,
+                           1,
+                           outer_vector,
+                           buf,
+                           sizeoftype,
+                           &position);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            (int) position, (int) sizeoftype);
+    }
+
+    memset(array, 0, 9*sizeof(int));
+    position = 0;
+    err = MPI_Unpack_external((char*)"external32",
+                             buf,
+                             sizeoftype,
+                             &position,
+                             array,
+                             1,
+                             outer_vector);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            (int) position, (int) sizeoftype);
+    }
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+       switch (i) {
+           case 0:
+               goodval = 1;
+               break;
+           case 2:
+               goodval = 2;
+               break;
+           case 6:
+               goodval = 3;
+               break;
+           case 8:
+               goodval = 4;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&inner_vector);
+    MPI_Type_free(&outer_vector);
+    return errs;
+}
+
+/* optimizable_vector_of_basics_test()
+ *
+ * Builds a vector of ints.  Count is 10, blocksize is 2, stride is 2, so this
+ * is equivalent to a contig of 20.
+ *
+ * Returns the number of errors encountered.
+ */
+int optimizable_vector_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+    int array[20] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+                     16, 17, 18, 19 };
+    char *buf;
+    int i;
+    MPI_Aint sizeofint, sizeoftype, position;
+
+    int /* err, */ errs = 0;
+
+    MPI_Pack_external_size((char*)"external32", 1, MPI_INT, &sizeofint);
+
+    if (sizeofint != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "size of external32 MPI_INT = %d; should be %d\n",
+                            (int) sizeofint, 4);
+    }
+
+    /* set up type */
+    /* err = */ MPI_Type_vector(10,
+                         2,
+                         2,
+                         MPI_INT,
+                         &parent_type);
+
+    MPI_Type_commit(&parent_type);
+
+    MPI_Pack_external_size((char*)"external32", 1, parent_type, &sizeoftype);
+
+
+    if (sizeoftype != 20 * sizeofint) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of vector = %d; should be %d\n",
+                            (int) sizeoftype, (int) (20 * sizeofint));
+    }
+
+    buf = (char *) malloc(sizeoftype);
+
+    position = 0;
+    /* err = */ MPI_Pack_external((char*)"external32",
+                           array,
+                           1,
+                           parent_type,
+                           buf,
+                           sizeoftype,
+                           &position);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            (int) position, (int) sizeoftype);
+    }
+
+    memset(array, 0, 20 * sizeof(int));
+    position = 0;
+    /* err = */ MPI_Unpack_external((char*)"external32",
+                             buf,
+                             sizeoftype,
+                             &position,
+                             array,
+                             1,
+                             parent_type);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "position = %ld; should be %ld (unpack)\n",
+                            (long) position, (long) sizeoftype);
+    }
+
+    for (i=0; i < 20; i++) {
+       if (array[i] != i) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], i);
+       }
+    }
+
+    MPI_Type_free(&parent_type);
+    return errs;
+}
+
+/* struct_of_basics_test()
+ *
+ * Builds a struct of ints.  Count is 10, all blocksizes are 2, all
+ * strides are 2*sizeofint, so this is equivalent to a contig of 20.
+ *
+ * Returns the number of errors encountered.
+ */
+int struct_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+    int array[20] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+                     16, 17, 18, 19 };
+    char *buf;
+    int i;
+    MPI_Aint sizeofint, sizeoftype, position;
+    int blocks[10];
+    MPI_Aint indices[10];
+    MPI_Datatype types[10];
+
+    int /* err, */ errs = 0;
+
+    MPI_Pack_external_size((char*)"external32", 1, MPI_INT, &sizeofint);
+
+    if (sizeofint != 4) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "size of external32 MPI_INT = %d; should be %d\n",
+                            (int) sizeofint, 4);
+    }
+
+    for (i = 0; i < 10; i++) {
+       blocks[i] = 2;
+       indices[i] = 2 * i * sizeofint;
+       /* This will cause MPICH to consider this as a blockindex. We
+        * need different types here. */
+       types[i] = MPI_INT;
+    }
+
+    /* set up type */
+    /* err = */ MPI_Type_struct(10,
+                         blocks,
+                         indices,
+                         types,
+                         &parent_type);
+
+    MPI_Type_commit(&parent_type);
+
+    MPI_Pack_external_size((char*)"external32", 1, parent_type, &sizeoftype);
+
+    if (sizeoftype != 20 * sizeofint) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of vector = %d; should be %d\n",
+                            (int) sizeoftype, (int) (20 * sizeofint));
+    }
+
+    buf = (char *) malloc(sizeoftype);
+
+    position = 0;
+    /* err = */ MPI_Pack_external((char*)"external32",
+                           array,
+                           1,
+                           parent_type,
+                           buf,
+                           sizeoftype,
+                           &position);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            (int) position, (int) sizeoftype);
+    }
+
+    memset(array, 0, 20 * sizeof(int));
+    position = 0;
+    /* err = */ MPI_Unpack_external((char*)"external32",
+                             buf,
+                             sizeoftype,
+                             &position,
+                             array,
+                             1,
+                             parent_type);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "position = %ld; should be %ld (unpack)\n",
+                            (long) position, (long) sizeoftype);
+    }
+
+    for (i=0; i < 20; i++) {
+       if (array[i] != i) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], i);
+       }
+    }
+
+    MPI_Type_free(&parent_type);
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/simple-pack.c b/teshsuite/smpi/mpich3-test/datatype/simple-pack.c
new file mode 100644 (file)
index 0000000..6e7b244
--- /dev/null
@@ -0,0 +1,311 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int builtin_float_test(void);
+int vector_of_vectors_test(void);
+int optimizable_vector_of_basics_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = builtin_float_test();
+    if (err && verbose) fprintf(stderr, "%d errors in builtin float test.\n", 
+                               err);
+    errs += err;
+
+    err = vector_of_vectors_test();
+    if (err && verbose) fprintf(stderr, 
+                               "%d errors in vector of vectors test.\n", err);
+    errs += err;
+
+    err = optimizable_vector_of_basics_test();
+    if (err && verbose) fprintf(stderr, 
+                               "%d errors in vector of basics test.\n", err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* builtin_float_test()
+ *
+ * Tests functionality of get_envelope() and get_contents() on a MPI_FLOAT.
+ *
+ * Returns the number of errors encountered.
+ */
+int builtin_float_test(void)
+{
+    int nints, nadds, ntypes, combiner;
+
+    int /* err, */ errs = 0;
+
+    /* err = */ MPI_Type_get_envelope(MPI_FLOAT,
+                               &nints,
+                               &nadds,
+                               &ntypes,
+                               &combiner);
+    
+    if (combiner != MPI_COMBINER_NAMED) errs++;
+
+    /* Note: it is erroneous to call MPI_Type_get_contents() on a basic. */
+    return errs;
+}
+
+/* vector_of_vectors_test()
+ *
+ * Builds a vector of a vector of ints.  Assuming an int array of size 9 
+ * integers, and treating the array as a 3x3 2D array, this will grab the 
+ * corners.
+ *
+ * Returns the number of errors encountered.
+ */
+int vector_of_vectors_test(void)
+{
+    MPI_Datatype inner_vector;
+    MPI_Datatype outer_vector;
+    int array[9] = {  1, -1,  2,
+                    -2, -3, -4,
+                     3, -5,  4 };
+
+    char *buf;
+    int i, err, errs = 0, sizeoftype, position;
+
+    /* set up type */
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         MPI_INT,
+                         &inner_vector);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs;
+    }
+
+    err = MPI_Type_vector(2,
+                         1,
+                         2,
+                         inner_vector,
+                         &outer_vector);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) fprintf(stderr, 
+                            "error in MPI call; aborting after %d errors\n",
+                            errs+1);
+       return errs;
+    }
+
+    MPI_Type_commit(&outer_vector);
+    MPI_Type_size(outer_vector, &sizeoftype);
+    if (sizeoftype != 4*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            (int) sizeoftype, (int) (4*sizeof(int)));
+       return errs;
+    }
+
+    buf = (char *) malloc(sizeoftype);
+
+    position = 0;
+    err = MPI_Pack(array,
+                  1,
+                  outer_vector,
+                  buf,
+                  sizeoftype,
+                  &position,
+                  MPI_COMM_WORLD);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, sizeoftype);
+    }
+
+    memset(array, 0, 9*sizeof(int));
+    position = 0;
+    err = MPI_Unpack(buf,
+                    sizeoftype,
+                    &position,
+                    array,
+                    1,
+                    outer_vector,
+                    MPI_COMM_WORLD);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, sizeoftype);
+    }
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+       switch (i) {
+           case 0:
+               goodval = 1;
+               break;
+           case 2:
+               goodval = 2;
+               break;
+           case 6:
+               goodval = 3;
+               break;
+           case 8:
+               goodval = 4;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&inner_vector);
+    MPI_Type_free(&outer_vector);
+    return errs;
+}
+
+/* optimizable_vector_of_basics_test()
+ *
+ * Builds a vector of ints.  Count is 10, blocksize is 2, stride is 2, so this
+ * is equivalent to a contig of 20.
+ *
+ * Returns the number of errors encountered.
+ */
+int optimizable_vector_of_basics_test(void)
+{
+    MPI_Datatype parent_type;
+    int array[20] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+                     16, 17, 18, 19 };
+    char *buf;
+    int i, sizeofint, sizeoftype, position;
+
+    int /* err, */ errs = 0;
+
+    MPI_Type_size(MPI_INT, &sizeofint);
+
+    if (sizeofint != sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of MPI_Int = %d; should be %d\n",
+                            sizeofint, (int) sizeof(int));
+    }
+
+    /* set up type */
+    /* err = */ MPI_Type_vector(10,
+                         2,
+                         2,
+                         MPI_INT,
+                         &parent_type);
+
+    MPI_Type_commit(&parent_type);
+
+    MPI_Type_size(parent_type, &sizeoftype);
+
+    if (sizeoftype != 20 * sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of vector = %d; should be %d\n",
+                            (int) sizeoftype, (int) (20 * sizeof(int)));
+    }
+
+    buf = (char *) malloc(sizeoftype);
+
+    position = 0;
+    /* err = */ MPI_Pack(array,
+                  1,
+                  parent_type,
+                  buf,
+                  sizeoftype,
+                  &position,
+                  MPI_COMM_WORLD);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, sizeoftype);
+    }
+
+    memset(array, 0, 20 * sizeof(int));
+    position = 0;
+    /* err = */ MPI_Unpack(buf,
+                    sizeoftype,
+                    &position,
+                    array,
+                    1,
+                    parent_type,
+                    MPI_COMM_WORLD);
+
+    if (position != sizeoftype) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, sizeoftype);
+    }
+
+    for (i=0; i < 20; i++) {
+       if (array[i] != i) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], i);
+       }
+    }
+
+    MPI_Type_free(&parent_type);
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/simple-resized.c b/teshsuite/smpi/mpich3-test/datatype/simple-resized.c
new file mode 100644 (file)
index 0000000..83aa629
--- /dev/null
@@ -0,0 +1,143 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int derived_resized_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = derived_resized_test();
+    if (err && verbose) fprintf(stderr, "%d errors in derived_resized test.\n",
+                               err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* derived_resized_test()
+ *
+ * Tests behavior with resizing of a simple derived type.
+ *
+ * Returns the number of errors encountered.
+ */
+int derived_resized_test(void)
+{
+    int err, errs = 0;
+
+    int count = 2;
+    MPI_Datatype newtype, resizedtype;
+
+    int size;
+    MPI_Aint extent;
+
+    err = MPI_Type_contiguous(count,
+                            MPI_INT,
+                            &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating type in derived_resized_test()\n");
+       }
+       errs++;
+    }
+
+    err = MPI_Type_create_resized(newtype,
+                                 (MPI_Aint) 0,
+                                 (MPI_Aint) (2*sizeof(int) + 10),
+                                 &resizedtype);
+
+    err = MPI_Type_size(resizedtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in derived_resized_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 2*sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != %d in derived_resized_test()\n", (int) (2*sizeof(int)));
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(resizedtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in derived_resized_test()\n");
+       }
+       errs++;
+    }
+    
+    if (extent != 2*sizeof(int) + 10) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: invalid extent (%d) in derived_resized_test(); should be %d\n",
+                   (int) extent,
+                   (int) (2*sizeof(int) + 10));
+       }
+       errs++;
+    }    
+
+    MPI_Type_free( &newtype );
+    MPI_Type_free( &resizedtype );
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/simple-size-extent.c b/teshsuite/smpi/mpich3-test/datatype/simple-size-extent.c
new file mode 100644 (file)
index 0000000..bde5592
--- /dev/null
@@ -0,0 +1,167 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* Tests that Type_get_extent of a couple of basic types succeeds. */
+
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int mpi_err, errs = 0, size;
+    MPI_Aint lb, ub, extent;
+    MPI_Datatype type;
+
+    struct { float a; int b; } foo;
+
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    type = MPI_INT;
+    mpi_err = MPI_Type_size(type, &size);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_size of MPI_INT failed.\n");
+       }
+       errs++;
+    }
+    if (size != sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_size of MPI_INT incorrect size (%d); should be %d.\n",
+                   size, (int) sizeof(int));
+       }
+       errs++;
+    }
+
+    mpi_err = MPI_Type_get_extent(type, &lb, &extent);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_INT failed.\n");
+       }
+       errs++;
+    }
+    if (extent != sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_INT returned incorrect extent (%d); should be %d.\n",
+                   (int) extent, (int) sizeof(int));
+       }
+       errs++;
+    }
+    if (lb != 0) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_INT returned incorrect lb (%d); should be 0.\n",
+                   (int) lb);
+       }
+       errs++;
+    }
+    mpi_err = MPI_Type_ub(type, &ub);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_ub of MPI_INT failed.\n");
+       }
+       errs++;
+    }
+    if (ub != extent - lb) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_ub of MPI_INT returned incorrect ub (%d); should be %d.\n",
+                   (int) ub, (int) (extent - lb));
+       }
+       errs++;
+    }
+
+    type = MPI_FLOAT_INT;
+    mpi_err = MPI_Type_size(type, &size);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_size of MPI_FLOAT_INT failed.\n");
+       }
+       errs++;
+    }
+    if (size != sizeof(float) + sizeof(int)) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_size of MPI_FLOAT_INT returned incorrect size (%d); should be %d.\n",
+                   size, (int) (sizeof(float) + sizeof(int)));
+       }
+       errs++;
+    }
+
+    mpi_err = MPI_Type_get_extent(type, &lb, &extent);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_FLOAT_INT failed.\n");
+       }
+       errs++;
+    }
+    if (extent != sizeof(foo)) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_FLOAT_INT returned incorrect extent (%d); should be %d.\n",
+                   (int) extent, (int) sizeof(foo));
+       }
+       errs++;
+    }
+    if (lb != 0) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_get_extent of MPI_FLOAT_INT returned incorrect lb (%d); should be 0.\n",
+                   (int) lb);
+       }
+       errs++;
+    }
+    mpi_err = MPI_Type_ub(type, &ub);
+    if (mpi_err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_ub of MPI_FLOAT_INT failed.\n");
+       }
+       errs++;
+    }
+    if (ub != extent - lb) {
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_ub of MPI_FLOAT_INT returned incorrect ub (%d); should be %d.\n",
+                   (int) ub, (int) (extent - lb));
+       }
+       errs++;
+    }
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/sizedtypes.c b/teshsuite/smpi/mpich3-test/datatype/sizedtypes.c
new file mode 100644 (file)
index 0000000..42bec06
--- /dev/null
@@ -0,0 +1,94 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of the sized types, supported in MPI-2";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Type_size( MPI_REAL4, &size );
+    if (size != 4) {
+       errs ++;
+       printf( "MPI_REAL4 has size %d\n", size );
+    }
+    MPI_Type_size( MPI_REAL8, &size );
+    if (size != 8) {
+       errs ++;
+       printf( "MPI_REAL8 has size %d\n", size );
+    }
+    if (MPI_REAL16 != MPI_DATATYPE_NULL) {
+       MPI_Type_size( MPI_REAL16, &size );
+       if (size != 16) {
+           errs ++;
+           printf( "MPI_REAL16 has size %d\n", size );
+       }
+    }
+
+    MPI_Type_size( MPI_COMPLEX8, &size );
+    if (size != 8) {
+       errs ++;
+       printf( "MPI_COMPLEX8 has size %d\n", size );
+    }
+    MPI_Type_size( MPI_COMPLEX16, &size );
+    if (size != 16) {
+       errs ++;
+       printf( "MPI_COMPLEX16 has size %d\n", size );
+    }
+    if (MPI_COMPLEX32 != MPI_DATATYPE_NULL) {
+       MPI_Type_size( MPI_COMPLEX32, &size );
+       if (size != 32) {
+           errs ++;
+           printf( "MPI_COMPLEX32 has size %d\n", size );
+       }
+    }
+
+    MPI_Type_size( MPI_INTEGER1, &size );
+    if (size != 1) {
+       errs ++;
+       printf( "MPI_INTEGER1 has size %d\n", size );
+    }
+    MPI_Type_size( MPI_INTEGER2, &size );
+    if (size != 2) {
+       errs ++;
+       printf( "MPI_INTEGER2 has size %d\n", size );
+    }
+    MPI_Type_size( MPI_INTEGER4, &size );
+    if (size != 4) {
+       errs ++;
+       printf( "MPI_INTEGER4 has size %d\n", size );
+    }
+    if (MPI_INTEGER8 != MPI_DATATYPE_NULL) {
+       MPI_Type_size( MPI_INTEGER8, &size );
+       if (size != 8) {
+           errs ++;
+           printf( "MPI_INTEGER8 has size %d\n", size );
+       }
+    }
+#ifdef HAVE_MPI_INTEGER16
+    if (MPI_INTEGER16 != MPI_DATATYPE_NULL) {
+       MPI_Type_size( MPI_INTEGER16, &size );
+       if (size != 16) {
+           errs ++;
+           printf( "MPI_INTEGER16 has size %d\n", size );
+       }
+    }
+#endif
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c b/teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c
new file mode 100644 (file)
index 0000000..25038fc
--- /dev/null
@@ -0,0 +1,130 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "mpi.h"
+
+static int verbose = 0;
+int a[100][100][100], e[9][9][9];
+
+
+/* helper functions */
+static int parse_args(int argc, char **argv);
+
+int main(int argc, char *argv[])
+{
+    /* Variable declarations */
+    MPI_Datatype oneslice, twoslice, threeslice;
+    int errs = 0;
+    MPI_Aint sizeofint, bufsize, position;
+    void *buffer;
+       
+    int i, j, k;
+       
+    /* Initialize a to some known values. */
+    for (i = 0; i < 100; i++) {
+       for (j = 0; j < 100; j++) {
+           for (k = 0; k < 100; k++) {
+               a[i][j][k] = i*1000000+j*1000+k;
+           }
+       }
+    }
+       
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    MPI_Type_extent(MPI_INT, &sizeofint);
+  
+    parse_args(argc, argv);
+
+    /* Create data types. */
+    /* NOTE: This differs from the way that it's done on the sheet. */
+    /* On the sheet, the slice is a[0, 2, 4, ..., 16][2-10][1-9]. */
+    /* Below, the slice is a[0-8][2-10][1, 3, 5, ..., 17]. */
+    MPI_Type_vector(9, 1, 2, MPI_INT, &oneslice);
+    MPI_Type_hvector(9, 1, 100*sizeofint, oneslice, &twoslice);
+    MPI_Type_hvector(9, 1, 100*100*sizeofint, twoslice, &threeslice);
+       
+    MPI_Type_commit(&threeslice);
+       
+    /* Pack it into a buffer. */
+    position = 0;
+/*     MPI_Pack_size(1, threeslice, MPI_COMM_WORLD, &bufsize); */
+    MPI_Pack_external_size((char*)"external32", 1, threeslice, &bufsize);
+    if (bufsize != 2916)
+    {
+        fprintf(stderr," Error on pack size! Got %d; expecting %d\n", (int) bufsize, 2916);
+    }
+    buffer = (void *) malloc((unsigned) bufsize);
+
+    /* -1 to indices on sheet to compensate for Fortran --> C */
+    MPI_Pack_external((char*)"external32",
+                     &(a[0][2][1]),
+                     1, threeslice,
+                     buffer,
+                     bufsize,
+                     &position);
+
+    /* Unpack the buffer into e. */
+    position = 0;
+    MPI_Unpack_external((char*)"external32",
+                       buffer,
+                       bufsize,
+                       &position,
+                       e, 9*9*9,
+                       MPI_INT);
+       
+    /* Display errors, if any. */
+    for (i = 0; i < 9; i++) {
+       for (j = 0; j < 9; j++) {
+           for (k = 0; k < 9; k++) {
+              /* The truncation in integer division makes this safe. */
+               if (e[i][j][k] != a[i][j+2][k*2+1]) {
+                   errs++;
+                   if (verbose) {
+                       printf("Error in location %d x %d x %d: %d, should be %d.\n",
+                              i, j, k, e[i][j][k], a[i][j+2][k*2+1]);
+                   }
+               }
+           }
+       }
+    } 
+  
+    /* Release memory. */
+    free(buffer);
+
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+
+    MPI_Type_free(&oneslice);
+    MPI_Type_free(&twoslice);
+    MPI_Type_free(&threeslice);
+
+    MPI_Finalize();
+    return 0;
+}
+
+/* parse_args()
+ */
+static int parse_args(int argc, char **argv)
+{
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/slice-pack.c b/teshsuite/smpi/mpich3-test/datatype/slice-pack.c
new file mode 100644 (file)
index 0000000..ef8c3c9
--- /dev/null
@@ -0,0 +1,135 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+int a[100][100][100], e[9][9][9];
+
+
+/* helper functions */
+static int parse_args(int argc, char **argv);
+
+int main(int argc, char *argv[])
+{
+    /* Variable declarations */
+    MPI_Datatype oneslice, twoslice, threeslice;
+    int errs = 0;
+    MPI_Aint sizeofint;
+       
+    int bufsize, position;
+    void *buffer;
+       
+    int i, j, k;
+       
+    /* Initialize a to some known values. */
+    for (i = 0; i < 100; i++) {
+       for (j = 0; j < 100; j++) {
+           for (k = 0; k < 100; k++) {
+               a[i][j][k] = i*1000000+j*1000+k;
+           }
+       }
+    }
+       
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    MPI_Type_extent(MPI_INT, &sizeofint);
+  
+    parse_args(argc, argv);
+
+    /* Create data types. */
+    /* NOTE: This differs from the way that it's done on the sheet. */
+    /* On the sheet, the slice is a[0, 2, 4, ..., 16][2-10][1-9]. */
+    /* Below, the slice is a[0-8][2-10][1, 3, 5, ..., 17]. */
+    MPI_Type_vector(9, 1, 2, MPI_INT, &oneslice);
+    MPI_Type_hvector(9, 1, 100*sizeofint, oneslice, &twoslice);
+    MPI_Type_hvector(9, 1, 100*100*sizeofint, twoslice, &threeslice);
+       
+    MPI_Type_commit(&threeslice);
+       
+    /* Pack it into a buffer. */
+    position = 0;
+    MPI_Pack_size(1, threeslice, MPI_COMM_WORLD, &bufsize);
+    buffer = (void *) malloc((unsigned) bufsize);
+
+    /* -1 to indices on sheet to compensate for Fortran --> C */
+    MPI_Pack(&(a[0][2][1]),
+            1, threeslice,
+            buffer,
+            bufsize,
+            &position,
+            MPI_COMM_WORLD);
+
+    /* Unpack the buffer into e. */
+    position = 0;
+    MPI_Unpack(buffer,
+              bufsize,
+              &position,
+              e, 9*9*9,
+              MPI_INT,
+              MPI_COMM_WORLD);
+       
+    /* Display errors, if any. */
+    for (i = 0; i < 9; i++) {
+       for (j = 0; j < 9; j++) {
+           for (k = 0; k < 9; k++) {
+              /* The truncation in integer division makes this safe. */
+               if (e[i][j][k] != a[i][j+2][k*2+1]) {
+                   errs++;
+                   if (verbose) {
+                       printf("Error in location %d x %d x %d: %d, should be %d.\n",
+                              i, j, k, e[i][j][k], a[i][j+2][k*2+1]);
+                   }
+               }
+           }
+       }
+    } 
+  
+    /* Release memory. */
+    free(buffer);
+
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+
+    MPI_Type_free(&oneslice);
+    MPI_Type_free(&twoslice);
+    MPI_Type_free(&threeslice);
+
+    MPI_Finalize();
+    return 0;
+}
+
+/* parse_args()
+ */
+static int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-derived-zeros.c b/teshsuite/smpi/mpich3-test/datatype/struct-derived-zeros.c
new file mode 100644 (file)
index 0000000..f07841a
--- /dev/null
@@ -0,0 +1,61 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* Based on code from Jeff Parker at IBM. */
+
+#include <stdio.h>
+
+#include <mpi.h>
+#include "mpitest.h"
+
+int main(int argc, char *argv[])
+{
+    MPI_Datatype mystruct, vecs[3];
+    MPI_Aint stride = 5, displs[3];
+    int i=0, blockcount[3];
+    int errs=0;
+
+    MTest_Init( &argc, &argv );
+
+    for(i = 0; i < 3; i++)
+    {
+        MPI_Type_hvector(i, 1, stride, MPI_INT, &vecs[i]);
+        MPI_Type_commit(&vecs[i]);
+        blockcount[i]=1;
+    }
+    displs[0]=0; displs[1]=-100; displs[2]=-200; /* irrelevant */
+
+    MPI_Type_struct(3, blockcount, displs, vecs, &mystruct);
+    MPI_Type_commit(&mystruct);
+
+    MPI_Type_free(&mystruct);
+    for(i = 0; i < 3; i++)
+    {
+        MPI_Type_free(&vecs[i]);
+    }
+
+    /* this time with the first argument always 0 */
+    for(i = 0; i < 3; i++)
+    {
+        MPI_Type_hvector(0, 1, stride, MPI_INT, &vecs[i]);
+        MPI_Type_commit(&vecs[i]);
+        blockcount[i]=1;
+    }
+    displs[0]=0; displs[1]=-100; displs[2]=-200; /* irrelevant */
+
+    MPI_Type_struct(3, blockcount, displs, vecs, &mystruct);
+    MPI_Type_commit(&mystruct);
+
+    MPI_Type_free(&mystruct);
+    for(i = 0; i < 3; i++)
+    {
+        MPI_Type_free(&vecs[i]);
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c b/teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c
new file mode 100644 (file)
index 0000000..d0c57bd
--- /dev/null
@@ -0,0 +1,209 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+int single_struct_test(void);
+
+struct test_struct_1 {
+    int a,b,c,d;
+};
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = single_struct_test();
+    if (verbose && err) fprintf(stderr, "error in single_struct_test\n");
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int single_struct_test(void)
+{
+    int err, errs = 0;
+    int count, elements;
+    int sendbuf[6] = { 1, 2, 3, 4, 5, 6 };
+    struct test_struct_1 ts1[2];
+    MPI_Datatype mystruct;
+    MPI_Request request;
+    MPI_Status status;
+
+    /* note: first element of struct has zero blklen and should be dropped */
+    MPI_Aint disps[3]     = { 2*sizeof(float), 0,       2*sizeof(int) };
+    int blks[3]           = { 0,               1,       2 };
+    MPI_Datatype types[3] = { MPI_FLOAT,       MPI_INT, MPI_INT };
+
+    ts1[0].a = -1;
+    ts1[0].b = -1;
+    ts1[0].c = -1;
+    ts1[0].d = -1;
+
+    ts1[1].a = -1;
+    ts1[1].b = -1;
+    ts1[1].c = -1;
+    ts1[1].d = -1;
+
+    err = MPI_Type_struct(3, blks, disps, types, &mystruct);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_struct returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mystruct);
+
+    err = MPI_Irecv(ts1, 2, mystruct, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(sendbuf, 6, MPI_INT, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+
+    /* verify data */
+    if (ts1[0].a != 1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[0].a = %d; should be %d\n", ts1[0].a, 1);
+       }
+    }
+    if (ts1[0].b != -1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[0].b = %d; should be %d\n", ts1[0].b, -1);
+       }
+    }
+    if (ts1[0].c != 2) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[0].c = %d; should be %d\n", ts1[0].c, 2);
+       }
+    }
+    if (ts1[0].d != 3) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[0].d = %d; should be %d\n", ts1[0].d, 3);
+       }
+    }
+    if (ts1[1].a != 4) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[1].a = %d; should be %d\n", ts1[1].a, 4);
+       }
+    }
+    if (ts1[1].b != -1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[1].b = %d; should be %d\n", ts1[1].b, -1);
+       }
+    }
+    if (ts1[1].c != 5) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[1].c = %d; should be %d\n", ts1[1].c, 5);
+       }
+    }
+    if (ts1[1].d != 6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts1[1].d = %d; should be %d\n", ts1[1].d, 6);
+       }
+    }
+
+    /* verify count and elements */
+    err = MPI_Get_count(&status, mystruct, &count);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_count returned error\n");
+       }
+    }
+    if (count != 2) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "count = %d; should be 2\n", count);
+       }
+    }
+
+    err = MPI_Get_elements(&status, mystruct, &elements);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Get_elements returned error\n");
+       }
+    }
+    if (elements != 6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "elements = %d; should be 6\n", elements);
+       }
+    }
+
+    MPI_Type_free(&mystruct);
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-ezhov.c b/teshsuite/smpi/mpich3-test/datatype/struct-ezhov.c
new file mode 100644 (file)
index 0000000..036eaf6
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpi.h"
+#include <string.h>
+
+#define COUNT          14
+#define SIZE           340
+#define EL_COUNT       1131
+
+char s_buf[EL_COUNT*SIZE];
+char r_buf[EL_COUNT*SIZE];
+
+int main( int argc, char **argv )
+{
+    int                rank, size, ret; 
+    MPI_Status                 Status;
+    MPI_Request                request;
+    MPI_Datatype       struct_type, type1[COUNT];
+    MPI_Aint           disp1[COUNT] = {0, 0, 332, 340};
+    int                        block1[COUNT] = {1, 56, 2, 1};
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    type1[0] = MPI_LB;
+    type1[1] = MPI_FLOAT;
+    type1[2] = MPI_FLOAT;
+    type1[3] = MPI_UB;
+    
+    MPI_Type_struct(4, block1, disp1, type1, &struct_type);
+    
+    ret = MPI_Type_commit(&struct_type);
+    if (ret != MPI_SUCCESS) 
+    {
+        fprintf(stderr, "Could not make struct type."), fflush(stderr); 
+        MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    
+    memset(s_buf, 0, EL_COUNT*SIZE);
+    memset(r_buf, 0, EL_COUNT*SIZE);
+
+    MPI_Isend(s_buf, EL_COUNT, struct_type, 0, 4, MPI_COMM_WORLD, &request);
+    MPI_Recv(r_buf, EL_COUNT, struct_type, 0, 4, MPI_COMM_WORLD, &Status );
+    MPI_Wait(&request, &Status);
+    
+    MPI_Type_free(&struct_type);
+    
+    MPI_Finalize();
+
+    printf(" No Errors\n");
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-no-real-types.c b/teshsuite/smpi/mpich3-test/datatype/struct-no-real-types.c
new file mode 100644 (file)
index 0000000..a1bded0
--- /dev/null
@@ -0,0 +1,147 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* 
+   The default behavior of the test routines should be to briefly indicate
+   the cause of any errors - in this test, that means that verbose needs
+   to be set. Verbose should turn on output that is independent of error
+   levels.
+*/
+static int verbose = 1;
+
+/* tests */
+int no_real_types_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MTest_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = no_real_types_test();
+    if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n",
+                               err);
+    errs += err;
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+/* no_real_types_test()
+ *
+ * Tests behavior with an empty struct type
+ *
+ * Returns the number of errors encountered.
+ */
+int no_real_types_test(void)
+{
+    int err, errs = 0;
+
+    int count = 1;
+    int len = 1;
+    MPI_Aint disp = 10;
+    MPI_Datatype type = MPI_LB;
+    MPI_Datatype newtype;
+
+    int size;
+    MPI_Aint extent;
+
+    err = MPI_Type_create_struct(count,
+                                &len,
+                                &disp,
+                                &type,
+                                &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating struct type no_real_types_test()\n");
+       }
+       MTestPrintError( err );
+       errs++;
+    }
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in no_real_types_test()\n");
+       }
+       MTestPrintError( err );
+       errs++;
+    }
+    
+    if (size != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 0 in no_real_types_test()\n");
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in no_real_types_test()\n");
+       }
+       MTestPrintError( err );
+       errs++;
+    }
+    
+    if (extent != -10) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: extent is %ld but should be -10 in no_real_types_test()\n", 
+                   (long) extent );
+           fprintf( stderr, 
+            "type map is { (LB,10) }, so UB is 0 and extent is ub-lb\n" );
+       }
+       errs++;
+    }    
+
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-pack.c b/teshsuite/smpi/mpich3-test/datatype/struct-pack.c
new file mode 100644 (file)
index 0000000..cf16e6a
--- /dev/null
@@ -0,0 +1,416 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+int single_struct_test(void);
+int array_of_structs_test(void);
+int struct_of_structs_test(void);
+
+struct test_struct_1 {
+    int a,b;
+    char c,d;
+    int e;
+};
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = single_struct_test();
+    if (verbose && err) fprintf(stderr, "error in single_struct_test\n");
+    errs += err;
+
+    err = array_of_structs_test();
+    if (verbose && err) fprintf(stderr, "error in array_of_structs_test\n");
+    errs += err;
+
+    err = struct_of_structs_test();
+    if (verbose && err) fprintf(stderr, "error in struct_of_structs_test\n");
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int single_struct_test(void)
+{
+    int err, errs = 0;
+    int bufsize, position = 0;
+    struct test_struct_1 ts1, ts2;
+    MPI_Datatype mystruct;
+    char *buffer;
+
+    MPI_Aint disps[3] = {0, 2*sizeof(int), 3*sizeof(int)}; /* guessing... */
+    int blks[3] = { 2, 2, 1 };
+    MPI_Datatype types[3] = { MPI_INT, MPI_CHAR, MPI_INT };
+
+    ts1.a = 1;
+    ts1.b = 2;
+    ts1.c = 3;
+    ts1.d = 4;
+    ts1.e = 5;
+
+    err = MPI_Type_struct(3, blks, disps, types, &mystruct);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_struct returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mystruct);
+
+    MPI_Pack_size(1, mystruct, MPI_COMM_WORLD, &bufsize);
+    buffer = (char *) malloc(bufsize);
+
+    err = MPI_Pack(&ts1,
+                  1,
+                  mystruct,
+                  buffer,
+                  bufsize,
+                  &position,
+                  MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Pack returned error\n");
+       }
+    }
+
+    position = 0;
+    err = MPI_Unpack(buffer,
+                    bufsize,
+                    &position,
+                    &ts2,
+                    1,
+                    mystruct,
+                    MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Unpack returned error\n");
+       }
+    }
+
+    MPI_Type_free(&mystruct);
+    free(buffer);
+
+    if (ts1.a != ts2.a) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts2.a = %d; should be %d\n", ts2.a, ts1.a);
+       }
+    }
+    if (ts1.b != ts2.b) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts2.b = %d; should be %d\n", ts2.b, ts1.b);
+       }
+    }
+    if (ts1.c != ts2.c) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts2.c = %d; should be %d\n",
+                   (int) ts2.c, (int) ts1.c);
+       }
+    }
+    if (ts1.d != ts2.d) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts2.d = %d; should be %d\n",
+                   (int) ts2.d, (int) ts1.d);
+       }
+    }
+    if (ts1.e != ts2.e) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "ts2.e = %d; should be %d\n", ts2.e, ts1.e);
+       }
+    }
+
+    return errs;
+}
+
+int array_of_structs_test(void)
+{
+    int i, err, errs = 0;
+    int bufsize, position = 0;
+    struct test_struct_1 ts1[10], ts2[10];
+    MPI_Datatype mystruct;
+    char *buffer;
+
+    MPI_Aint disps[3] = {0, 2*sizeof(int), 3*sizeof(int)}; /* guessing... */
+    int blks[3] = { 2, 2, 1 };
+    MPI_Datatype types[3] = { MPI_INT, MPI_CHAR, MPI_INT };
+
+    for (i=0; i < 10; i++) {
+       ts1[i].a = 10*i + 1;
+       ts1[i].b = 10*i + 2;
+       ts1[i].c = 10*i + 3;
+       ts1[i].d = 10*i + 4;
+       ts1[i].e = 10*i + 5;
+
+       ts2[i].a = -13;
+       ts2[i].b = -13;
+       ts2[i].c = -13;
+       ts2[i].d = -13;
+       ts2[i].e = -13;
+    }
+
+    err = MPI_Type_struct(3, blks, disps, types, &mystruct);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_struct returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mystruct);
+
+    MPI_Pack_size(10, mystruct, MPI_COMM_WORLD, &bufsize);
+    buffer = (char *) malloc(bufsize);
+
+    err = MPI_Pack(ts1,
+                  10,
+                  mystruct,
+                  buffer,
+                  bufsize,
+                  &position,
+                  MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Pack returned error\n");
+       }
+    }
+
+    position = 0;
+    err = MPI_Unpack(buffer,
+                    bufsize,
+                    &position,
+                    ts2,
+                    10,
+                    mystruct,
+                    MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Unpack returned error\n");
+       }
+    }
+
+    MPI_Type_free(&mystruct);
+    free(buffer);
+
+    for (i=0; i < 10; i++) {
+       if (ts1[i].a != ts2[i].a) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "ts2[%d].a = %d; should be %d\n",
+                       i, ts2[i].a, ts1[i].a);
+           }
+       }
+       if (ts1[i].b != ts2[i].b) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "ts2[%d].b = %d; should be %d\n",
+                       i, ts2[i].b, ts1[i].b);
+           }
+       }
+       if (ts1[i].c != ts2[i].c) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "ts2[%d].c = %d; should be %d\n",
+                       i, (int) ts2[i].c, (int) ts1[i].c);
+           }
+       }
+       if (ts1[i].d != ts2[i].d) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "ts2[%d].d = %d; should be %d\n",
+                       i, (int) ts2[i].d, (int) ts1[i].d);
+           }
+       }
+       if (ts1[i].e != ts2[i].e) {
+           errs++;
+           if (verbose) {
+               fprintf(stderr, "ts2[%d].e = %d; should be %d\n",
+                       i, ts2[i].e, ts1[i].e);
+           }
+       }
+    }
+
+    return errs;
+}
+
+int struct_of_structs_test(void)
+{
+    int i, j, err, errs = 0, bufsize, position;
+
+    char buf[50], buf2[50], *packbuf;
+
+    MPI_Aint disps[3] = {0, 3, 0};
+    int blks[3] = {2, 1, 0};
+    MPI_Datatype types[3], chartype, tiletype1, tiletype2, finaltype;
+
+    /* build a contig of one char to try to keep optimizations
+     * from being applied.
+     */
+    err = MPI_Type_contiguous(1, MPI_CHAR, &chartype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "chartype create failed\n");
+       }
+       return errs;
+    }
+
+    /* build a type that we can tile a few times */
+    types[0] = MPI_CHAR;
+    types[1] = chartype;
+
+    err = MPI_Type_struct(2, blks, disps, types, &tiletype1);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "tiletype1 create failed\n");
+       }
+       return errs;
+    }
+
+    /* build the same type again, again to avoid optimizations */
+    err = MPI_Type_struct(2, blks, disps, types, &tiletype2);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "tiletype2 create failed\n");
+       }
+       return errs;
+    }
+
+    /* build a combination of those two tiletypes */
+    disps[0] = 0;
+    disps[1] = 5;
+    disps[2] = 10;
+    blks[0]  = 1;
+    blks[1]  = 1;
+    blks[2]  = 1;
+    types[0] = tiletype1;
+    types[1] = tiletype2;
+    types[2] = MPI_UB;
+    err = MPI_Type_struct(3, blks, disps, types, &finaltype);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "finaltype create failed\n");
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&finaltype);
+    MPI_Type_free(&chartype);
+    MPI_Type_free(&tiletype1);
+    MPI_Type_free(&tiletype2);
+
+    MPI_Pack_size(5, finaltype, MPI_COMM_WORLD, &bufsize);
+
+    packbuf = malloc(bufsize);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "pack buffer allocation (%d bytes) failed\n", bufsize);
+       }
+       return errs;
+    }
+
+    for (j=0; j < 10; j++) {
+       for (i=0; i < 5; i++) {
+           if (i == 2 || i == 4) buf[5*j + i] = 0;
+           else                  buf[5*j + i] = i;
+       }
+    }
+
+    position = 0;
+    err = MPI_Pack(buf, 5, finaltype, packbuf, bufsize, &position, MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "pack failed\n");
+       }
+       return errs;
+    }
+
+    memset(buf2, 0, 50);
+    position = 0;
+    err = MPI_Unpack(packbuf, bufsize, &position, buf2, 5, finaltype, MPI_COMM_WORLD);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "unpack failed\n");
+       }
+       return errs;
+    }
+
+    for (j=0; j < 10; j++) {
+       for (i=0; i < 5; i++) {
+           if (buf[5*j + i] != buf2[5*j + i]) {
+               errs++;
+               if (verbose) {
+                   fprintf(stderr,
+                           "buf2[%d] = %d; should be %d\n",
+                           5*j + i,
+                           (int) buf2[5*j+i],
+                           (int) buf[5*j+i]);
+               }
+           }
+       }
+    }
+
+    free(packbuf);
+    MPI_Type_free(&finaltype);
+    return errs;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-verydeep.c b/teshsuite/smpi/mpich3-test/datatype/struct-verydeep.c
new file mode 100644 (file)
index 0000000..f8bf884
--- /dev/null
@@ -0,0 +1,187 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/* Regression test for MPICH trac ticket #972, originally written by
+ * Rob Latham <robl@mcs.anl.gov> as a simplification of a type
+ * encountered by the HDF5 library.
+ *
+ * Should be run with 1 process. */
+
+#include <stdio.h>
+#include "mpi.h"
+
+/* uncomment to use debugging routine in MPICH
+extern int MPIDU_Datatype_debug(MPI_Datatype type, int depth);
+*/
+
+int makeHDF5type0(MPI_Datatype *type);
+int makeHDF5type0(MPI_Datatype *type)
+{
+    MPI_Datatype ctg, vect, structype, vec2, structype2,
+                 vec3, structype3, vec4, structype4, vec5;
+
+    int b[3];
+    MPI_Aint d[3];
+    MPI_Datatype t[3];
+
+    MPI_Type_contiguous(4, MPI_BYTE, &ctg);
+
+    MPI_Type_vector(1, 5, 1, ctg, &vect);
+
+    b[0] =         b[1] =       b[2] = 1;
+    d[0] = 0;      d[1] = 0;    d[2] = 40;
+    t[0] = MPI_LB; t[1] = vect; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype);
+
+    MPI_Type_vector(1, 5, 1, structype, &vec2);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 2000;  d[2] = 400;
+    t[0] = MPI_LB; t[1] = vec2;  t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype2);
+
+    MPI_Type_vector(1, 5, 1, structype2, &vec3);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 0;     d[2] = 4000;
+    t[0] = MPI_LB; t[1] = vec3;  t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype3);
+
+    MPI_Type_vector(1, 5, 1, structype3, &vec4);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 0;     d[2] = 40000;
+    t[0] = MPI_LB; t[1] = vec4;  t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype4);
+
+    MPI_Type_vector(1, 1, 1, structype4, &vec5);
+
+    b[0] =         b[1] =         b[2] = 1;
+    d[0] = 0;      d[1] = 160000; d[2] = 200000;
+    t[0] = MPI_LB; t[1] = vec5;   t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, type);
+
+    MPI_Type_free(&ctg);
+    MPI_Type_free(&vect);
+    MPI_Type_free(&structype);
+    MPI_Type_free(&vec2);
+    MPI_Type_free(&structype2);
+    MPI_Type_free(&vec3);
+    MPI_Type_free(&structype3);
+    MPI_Type_free(&vec4);
+    MPI_Type_free(&structype4);
+    MPI_Type_free(&vec5);
+    MPI_Type_commit(type);
+
+    return 0;
+}
+
+int makeHDF5type1(MPI_Datatype *type);
+int makeHDF5type1(MPI_Datatype *type)
+{
+    MPI_Datatype ctg, vect, structype, vec2, structype2,
+                 vec3, structype3, vec4, structype4, vec5;
+
+    int b[3];
+    MPI_Aint d[3];
+    MPI_Datatype t[3];
+
+    MPI_Type_contiguous(4, MPI_BYTE, &ctg);
+
+    MPI_Type_vector(1, 5, 1, ctg, &vect);
+
+    b[0] =         b[1] =       b[2] = 1;
+    d[0] = 0;      d[1] = 20;    d[2] = 40;
+    t[0] = MPI_LB; t[1] = vect; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype);
+
+    MPI_Type_vector(1, 5, 1, structype, &vec2);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 0;     d[2] = 400;
+    t[0] = MPI_LB; t[1] = vec2; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype2);
+
+    MPI_Type_vector(1, 5, 1, structype2, &vec3);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 0;     d[2] = 4000;
+    t[0] = MPI_LB; t[1] = vec3; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype3);
+
+    MPI_Type_vector(1, 5, 1, structype3, &vec4);
+
+    b[0] =         b[1] =        b[2] = 1;
+    d[0] = 0;      d[1] = 0;     d[2] = 40000;
+    t[0] = MPI_LB; t[1] = vec4; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, &structype4);
+
+    MPI_Type_vector(1, 1, 1, structype4, &vec5);
+
+    b[0] =         b[1] =         b[2] = 1;
+    d[0] = 0;      d[1] = 160000; d[2] = 200000;
+    t[0] = MPI_LB; t[1] = vec5; t[2] = MPI_UB;
+    MPI_Type_create_struct(3, b, d, t, type);
+
+    MPI_Type_free(&ctg);
+    MPI_Type_free(&vect);
+    MPI_Type_free(&structype);
+    MPI_Type_free(&vec2);
+    MPI_Type_free(&structype2);
+    MPI_Type_free(&vec3);
+    MPI_Type_free(&structype3);
+    MPI_Type_free(&vec4);
+    MPI_Type_free(&structype4);
+    MPI_Type_free(&vec5);
+    MPI_Type_commit(type);
+
+    return 0;
+}
+
+int makeHDF5type(MPI_Datatype *type);
+int makeHDF5type(MPI_Datatype *type)
+{
+    int i;
+
+#define NTYPES 2
+
+    int blocklens[NTYPES];
+    MPI_Aint disps[NTYPES];
+
+    MPI_Datatype types[NTYPES];
+    makeHDF5type0(&(types[0]));
+    makeHDF5type1(&(types[1]));
+
+    for (i=0; i< NTYPES; i++) {
+        blocklens[i] = 1;
+        disps[i] = 0;
+    }
+
+    MPI_Type_create_struct(NTYPES, blocklens, disps, types, type);
+    MPI_Type_commit(type);
+
+    for(i=0; i<NTYPES; i++) {
+        MPI_Type_free(&(types[i]));
+    }
+    return 0;
+}
+
+int main(int argc, char **argv)
+{
+    MPI_Datatype hdf5type;
+
+    MPI_Init(&argc, &argv);
+    makeHDF5type(&hdf5type);
+
+    /*MPIDU_Datatype_debug(hdf5type, 32);*/
+
+    MPI_Type_free(&hdf5type);
+    MPI_Finalize();
+
+    printf(" No Errors\n");
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c b/teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c
new file mode 100644 (file)
index 0000000..74b2d19
--- /dev/null
@@ -0,0 +1,136 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+/* tests */
+int builtin_struct_test(void);
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = builtin_struct_test();
+    if (err && verbose) fprintf(stderr, "%d errors in builtin struct test.\n", err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* builtin_struct_test()
+ *
+ * Tests behavior with a zero-count struct of builtins.
+ *
+ * Returns the number of errors encountered.
+ */
+int builtin_struct_test(void)
+{
+    int err, errs = 0;
+
+    int count = 0;
+    MPI_Datatype newtype;
+
+    int size;
+    MPI_Aint extent;
+
+    err = MPI_Type_create_struct(count,
+                                (int *) 0,
+                                (MPI_Aint *) 0,
+                                (MPI_Datatype *) 0,
+                                &newtype);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error creating struct type in builtin_struct_test()\n");
+       }
+       errs++;
+    }
+
+    err = MPI_Type_size(newtype, &size);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type size in builtin_struct_test()\n");
+       }
+       errs++;
+    }
+    
+    if (size != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: size != 0 in builtin_struct_test()\n");
+       }
+       errs++;
+    }    
+
+    err = MPI_Type_extent(newtype, &extent);
+    if (err != MPI_SUCCESS) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error obtaining type extent in builtin_struct_test()\n");
+       }
+       errs++;
+    }
+    
+    if (extent != 0) {
+       if (verbose) {
+           fprintf(stderr,
+                   "error: extent != 0 in builtin_struct_test()\n");
+       }
+       errs++;
+    }    
+
+    MPI_Type_free( &newtype );
+
+    return errs;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/subarray-pack.c b/teshsuite/smpi/mpich3-test/datatype/subarray-pack.c
new file mode 100644 (file)
index 0000000..79cd40b
--- /dev/null
@@ -0,0 +1,748 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int verbose = 0;
+
+/* tests */
+int subarray_1d_c_test1(void);
+int subarray_1d_fortran_test1(void);
+int subarray_2d_c_test1(void);
+int subarray_4d_c_test1(void);
+int subarray_2d_c_test2(void);
+int subarray_2d_fortran_test1(void);
+int subarray_4d_fortran_test1(void);
+
+/* helper functions */
+static int parse_args(int argc, char **argv);
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz);
+
+int main(int argc, char **argv)
+{
+    int err, errs = 0;
+
+    MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* perform some tests */
+    err = subarray_1d_c_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 1d subarray c test 1.\n", err);
+    errs += err;
+
+    err = subarray_1d_fortran_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 1d subarray fortran test 1.\n",
+                               err);
+    errs += err;
+
+    err = subarray_2d_c_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 2d subarray c test 1.\n", err);
+    errs += err;
+
+    err = subarray_2d_fortran_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 2d subarray fortran test 1.\n",
+                               err);
+    errs += err;
+
+    err = subarray_2d_c_test2();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 2d subarray c test 2.\n", err);
+    errs += err;
+
+    err = subarray_4d_c_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 4d subarray c test 1.\n", err);
+    errs += err;
+
+    err = subarray_4d_fortran_test1();
+    if (err && verbose) fprintf(stderr,
+                               "%d errors in 4d subarray fortran test 1.\n", err);
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* subarray_1d_c_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_1d_c_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[9] = { -1, 1, 2, 3, -2, -3, -4, -5, -6 };
+    int array_size[] = {9};
+    int array_subsize[] = {3};
+    int array_start[] = {1};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(1, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_C,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 3 * sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (3 * sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 9 * sizeof(int));
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+       switch (i) {
+           case 1:
+               goodval = 1;
+               break;
+           case 2:
+               goodval = 2;
+               break;
+           case 3:
+               goodval = 3;
+               break;
+           default:
+               goodval = 0; /* pack_and_unpack() zeros before unpacking */
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+/* subarray_1d_fortran_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_1d_fortran_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[9] = { -1, 1, 2, 3, -2, -3, -4, -5, -6 };
+    int array_size[] = {9};
+    int array_subsize[] = {3};
+    int array_start[] = {1};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(1, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_FORTRAN,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 3 * sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (3 * sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 9 * sizeof(int));
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+       switch (i) {
+           case 1:
+               goodval = 1;
+               break;
+           case 2:
+               goodval = 2;
+               break;
+           case 3:
+               goodval = 3;
+               break;
+           default:
+               goodval = 0; /* pack_and_unpack() zeros before unpacking */
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+
+/* subarray_2d_test()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_2d_c_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[9] = { -1, -2, -3,
+                    -4,  1,  2,
+                    -5,  3,  4 };
+    int array_size[2] = {3, 3};
+    int array_subsize[2] = {2, 2};
+    int array_start[2] = {1, 1};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(2, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_C,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 4*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (4*sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 9*sizeof(int));
+
+    for (i=0; i < 9; i++) {
+       int goodval;
+       switch (i) {
+           case 4:
+               goodval = 1;
+               break;
+           case 5:
+               goodval = 2;
+               break;
+           case 7:
+               goodval = 3;
+               break;
+           case 8:
+               goodval = 4;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+/* subarray_2d_c_test2()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_2d_c_test2(void)
+{
+    MPI_Datatype subarray;
+    int array[12] = { -1, -2, -3, -4,  1,   2,
+                     -5, -6, -7, -8, -9, -10 };
+    int array_size[2] = {2, 6};
+    int array_subsize[2] = {1, 2};
+    int array_start[2] = {0, 4};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(2, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_C,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 2*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (2*sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 12*sizeof(int));
+
+    for (i=0; i < 12; i++) {
+       int goodval;
+       switch (i) {
+           case 4:
+               goodval = 1;
+               break;
+           case 5:
+               goodval = 2;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+/* subarray_4d_c_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_4d_c_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[] = {
+       -1111, -1112, -1113, -1114, -1115, -1116,
+       -1121, -1122, -1123, -1124, -1125, -1126,
+       -1131, -1132, -1133, -1134, -1135, -1136,
+       -1211, -1212, -1213, -1214, -1215, -1216,
+       -1221, -1222, -1223, -1224, -1225, -1226,
+       -1231, -1232, -1233, -1234, -1235, -1236,
+       -2111, -2112, -2113, -2114,     1, -2116,
+       -2121, -2122, -2123, -2124,     2, -2126,
+       -2131, -2132, -2133, -2134,     3, -2136,
+       -2211, -2212, -2213, -2214,     4, -2216,
+       -2221, -2222, -2223, -2224,     5, -2226,
+       -2231, -2232, -2233, -2234,     6, -2236
+    };
+    
+    int array_size[4] = {2, 2, 3, 6};
+    int array_subsize[4] = {1, 2, 3, 1};
+    int array_start[4] = {1, 0, 0, 4};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(4, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_C,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 6*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (6*sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 72*sizeof(int));
+
+    for (i=0; i < 72; i++) {
+       int goodval;
+       switch (i) {
+           case 40:
+               goodval = 1;
+               break;
+           case 46:
+               goodval = 2;
+               break;
+           case 52:
+               goodval = 3;
+               break;
+           case 58:
+               goodval = 4;
+               break;
+           case 64:
+               goodval = 5;
+               break;
+           case 70:
+               goodval = 6;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+/* subarray_4d_fortran_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_4d_fortran_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[] = {
+       -1111, -1112, -1113, -1114, -1115, -1116,
+       -1121, -1122, -1123, -1124, -1125, -1126,
+       -1131, -1132, -1133, -1134, -1135, -1136,
+       -1211, -1212, -1213, -1214, -1215, -1216,
+       -1221, -1222, -1223, -1224, -1225, -1226,
+       -1231, -1232, -1233, -1234, -1235, -1236,
+       -2111, -2112, -2113, -2114,     1, -2116,
+       -2121, -2122, -2123, -2124,     2, -2126,
+       -2131, -2132, -2133, -2134,     3, -2136,
+       -2211, -2212, -2213, -2214,     4, -2216,
+       -2221, -2222, -2223, -2224,     5, -2226,
+       -2231, -2232, -2233, -2234,     6, -2236
+    };
+    
+    int array_size[4] = {6, 3, 2, 2};
+    int array_subsize[4] = {1, 3, 2, 1};
+    int array_start[4] = {4, 0, 0, 1};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(4, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_FORTRAN,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 6*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (6*sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 72*sizeof(int));
+
+    for (i=0; i < 72; i++) {
+       int goodval;
+       switch (i) {
+           case 40:
+               goodval = 1;
+               break;
+           case 46:
+               goodval = 2;
+               break;
+           case 52:
+               goodval = 3;
+               break;
+           case 58:
+               goodval = 4;
+               break;
+           case 64:
+               goodval = 5;
+               break;
+           case 70:
+               goodval = 6;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+
+/* subarray_2d_fortran_test1()
+ *
+ * Returns the number of errors encountered.
+ */
+int subarray_2d_fortran_test1(void)
+{
+    MPI_Datatype subarray;
+    int array[12] = { -1, -2, -3, -4,  1,   2,
+                     -5, -6, -7, -8, -9, -10 };
+    int array_size[2] = {6, 2};
+    int array_subsize[2] = {2, 1};
+    int array_start[2] = {4, 0};
+
+    int i, err, errs = 0, sizeoftype;
+
+    /* set up type */
+    err = MPI_Type_create_subarray(2, /* dims */
+                                  array_size,
+                                  array_subsize,
+                                  array_start,
+                                  MPI_ORDER_FORTRAN,
+                                  MPI_INT,
+                                  &subarray);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_create_subarray call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    MPI_Type_commit(&subarray);
+    MPI_Type_size(subarray, &sizeoftype);
+    if (sizeoftype != 2*sizeof(int)) {
+       errs++;
+       if (verbose) fprintf(stderr, "size of type = %d; should be %d\n",
+                            sizeoftype, (int) (2*sizeof(int)));
+       return errs;
+    }
+
+    err = pack_and_unpack((char *) array, 1, subarray, 12*sizeof(int));
+
+    for (i=0; i < 12; i++) {
+       int goodval;
+       switch (i) {
+           case 4:
+               goodval = 1;
+               break;
+           case 5:
+               goodval = 2;
+               break;
+           default:
+               goodval = 0;
+               break;
+       }
+       if (array[i] != goodval) {
+           errs++;
+           if (verbose) fprintf(stderr, "array[%d] = %d; should be %d\n",
+                                i, array[i], goodval);
+       }
+    }
+
+    MPI_Type_free(&subarray);
+    return errs;
+}
+
+/******************************************************************/
+
+/* pack_and_unpack()
+ *
+ * Perform packing and unpacking of a buffer for the purposes of checking
+ * to see if we are processing a type correctly.  Zeros the buffer between
+ * these two operations, so the data described by the type should be in
+ * place upon return but all other regions of the buffer should be zero.
+ *
+ * Parameters:
+ * typebuf - pointer to buffer described by datatype and count that
+ *           will be packed and then unpacked into
+ * count, datatype - description of typebuf
+ * typebufsz - size of typebuf; used specifically to zero the buffer
+ *             between the pack and unpack steps
+ *
+ */
+static int pack_and_unpack(char *typebuf,
+                          int count,
+                          MPI_Datatype datatype,
+                          int typebufsz)
+{
+    char *packbuf;
+    int err, errs = 0, pack_size, type_size, position;
+
+    err = MPI_Type_size(datatype, &type_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Type_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    type_size *= count;
+
+    err = MPI_Pack_size(count, datatype, MPI_COMM_SELF, &pack_size);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Pack_size call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    packbuf = (char *) malloc(pack_size);
+    if (packbuf == NULL) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in malloc call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+
+    position = 0;
+    err = MPI_Pack(typebuf,
+                  count,
+                  datatype,
+                  packbuf,
+                  type_size,
+                  &position,
+                  MPI_COMM_SELF);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (pack)\n",
+                            position, type_size);
+    }
+
+    memset(typebuf, 0, typebufsz);
+    position = 0;
+    err = MPI_Unpack(packbuf,
+                    type_size,
+                    &position,
+                    typebuf,
+                    count,
+                    datatype,
+                    MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr,
+                   "error in MPI_Unpack call; aborting after %d errors\n",
+                   errs);
+       }
+       return errs;
+    }
+    free(packbuf);
+
+    if (position != type_size) {
+       errs++;
+       if (verbose) fprintf(stderr, "position = %d; should be %d (unpack)\n",
+                            position, type_size);
+    }
+
+    return errs;
+}
+
+static int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/datatype/subarray.c b/teshsuite/smpi/mpich3-test/datatype/subarray.c
new file mode 100644 (file)
index 0000000..d726b5a
--- /dev/null
@@ -0,0 +1,71 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+
+#define X 64
+#define Y 8
+#define Z 512
+
+double array[X][Y][Z];
+
+int main(int argc, char *argv[])
+{
+    int myrank;
+    MPI_Datatype subarray;
+    int array_size[] = {X, Y, Z};
+    int array_subsize[] = {X/2, Y/2, Z};
+    int array_start[] = {0, 0, 0};
+    int i, j, k;
+    int errs = 0;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
+
+    for (i = 0; i < X; ++i) {
+        for (j = 0; j < Y; ++j) {
+            for (k = 0; k < Z; ++k) {
+                if (myrank == 0)
+                    array[i][j][k] = 2.0;
+                else
+                    array[i][j][k] = -2.0;
+            }
+        }
+    }
+
+    MPI_Type_create_subarray(3, array_size, array_subsize, array_start, MPI_ORDER_C,
+                             MPI_DOUBLE, &subarray);
+    MPI_Type_commit(&subarray);
+
+    if(myrank == 0)
+        MPI_Send(array, 1, subarray, 1, 0, MPI_COMM_WORLD);
+    else {
+        MPI_Recv(array, 1, subarray, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+        for (i = array_start[0]; i < array_subsize[0]; ++i) {
+            for (j = array_start[1]; j < array_subsize[1]; ++j) {
+                for (k = array_start[2]; k < array_subsize[2]; ++k) {
+                    if (array[i][j][k] != 2.0)
+                        ++errs;
+                }
+            }
+        }
+    }
+
+    MPI_Type_free(&subarray);
+
+    MPI_Allreduce(MPI_IN_PLACE, &errs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
+    if (myrank == 0) {
+        if (errs)
+            printf("Found %d errors\n", errs);
+        else
+            printf(" No Errors\n");
+    }
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/testlist b/teshsuite/smpi/mpich3-test/datatype/testlist
new file mode 100644 (file)
index 0000000..6c35b3d
--- /dev/null
@@ -0,0 +1,70 @@
+#needs PMPI_Type_get_envelope, PMPI_Type_get_contents
+#contents 1
+gaddress 1
+#complex games with negative extents...
+#lbub 1
+#needs MPI_Pack, MPI_Unpack
+#localpack 1
+#simple-pack 1
+#simple-pack-external 1
+#transpose-pack 1
+#slice-pack 1
+#struct-pack 1
+typecommit 1
+#needs MPI_Type_get_name
+#typename 1
+#needs MPI_Type_dup
+#typefree 1
+zeroparms 1
+#getpartelm 2
+#needs  MPI_Type_create_resized
+#tresized 2
+#tresized2 2
+#needs MPI_Type_match_size
+#tmatchsize 1
+tfree 2
+typelb 1
+#needs MPI_Pack_size
+#contigstruct 1
+struct-zero-count 1
+blockindexed-zero-count 1
+#needs MPI_Pack, MPI_unpack, MPI_Pack_size
+#blockindexed-misc 1
+#needs MPI_Pack, MPI_unpack, MPI_Pack_size
+#indexed-misc 1
+#nees MPI_Type_create_subarray
+#subarray-pack 1
+#subarray 2
+#nees MPI_Type_create_darray
+#darray-pack 1
+#darray-pack 9
+# darray-pack 72
+#darray-cyclic 12
+#gcc alignment games
+#pairtype-size-extent 1
+simple-commit 1
+simple-size-extent 1
+#struct-no-real-types 1
+#needs MPI_Get_elements
+#struct-empty-el 1
+contig-zero-count 1
+#needs MPI_Type_create_resized
+#simple-resized 1
+#needs MPI_Pack
+#unusual-noncontigs 1
+#buggy, and needs MPI_Get_elements
+#hindexed-zeros 1
+#lots-of-types 1
+#get-elements-pairtype 1
+#unpack 1
+struct-ezhov 1
+#needs MPI_Pack, MPI_Unpack
+#zeroblks 1
+struct-derived-zeros 1
+struct-verydeep 1
+#get-elements 1
+hindexed_block 1 mpiversion=3.0
+hindexed_block_contents 1 mpiversion=3.0
+longdouble 1
+#large-count 1 mpiversion=3.0 xfail=ticket1767
+cxx-types 1 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/datatype/tfree.c b/teshsuite/smpi/mpich3-test/datatype/tfree.c
new file mode 100644 (file)
index 0000000..d38fb7f
--- /dev/null
@@ -0,0 +1,105 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test that freed datatypes have reference count semantics";
+*/
+
+#define VEC_NELM 128
+#define VEC_STRIDE 8
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest, i;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Request   req;
+    MPI_Datatype  strideType;
+    MPI_Datatype  tmpType[1024];
+    int           *buf = 0;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    if (size < 2) {
+       fprintf( stderr, "This test requires at least two processes." );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    source  = 0;
+    dest    = size - 1;
+
+    /* 
+       The idea here is to create a simple but non-contig datatype,
+       perform an irecv with it, free it, and then create 
+       many new datatypes.  While not a complete test, if the datatype
+       was freed and the space was reused, this test may detect 
+       that error 
+       A similar test for sends might work by sending a large enough message
+       to force the use of rendezvous send. 
+    */
+    MPI_Type_vector( VEC_NELM, 1, VEC_STRIDE, MPI_INT, &strideType );
+    MPI_Type_commit( &strideType );
+
+    if (rank == dest) {
+       buf = (int *)malloc( VEC_NELM * VEC_STRIDE * sizeof(int) );
+       for (i=0; i<VEC_NELM*VEC_STRIDE; i++) buf[i] = -i;
+       MPI_Irecv( buf, 1, strideType, source, 0, comm, &req );
+       MPI_Type_free( &strideType );
+
+       for (i=0; i<1024; i++) {
+           MPI_Type_vector( VEC_NELM, 1, 1, MPI_INT, &tmpType[i] );
+           MPI_Type_commit( &tmpType[i] );
+       }
+
+       MPI_Sendrecv( 0, 0, MPI_INT, source, 1, 
+                     0, 0, MPI_INT, source, 1, comm, &status );
+
+       MPI_Wait( &req, &status );
+       for (i=0; i<VEC_NELM; i++) {
+           if (buf[VEC_STRIDE*i] != i) {
+               errs++;
+               if (errs < 10) {
+                   printf( "buf[%d] = %d, expected %d\n", VEC_STRIDE*i, 
+                           buf[VEC_STRIDE*i], i );
+               }
+           }
+       }
+       for (i=0; i<1024; i++) {
+           MPI_Type_free( &tmpType[i] );
+       }
+       free( buf );
+    }
+    else if (rank == source) {
+       buf = (int *)malloc( VEC_NELM * sizeof(int) );
+       for (i=0; i<VEC_NELM; i++) buf[i] = i;
+       /* Synchronize with the receiver */
+       MPI_Sendrecv( 0, 0, MPI_INT, dest, 1, 
+                     0, 0, MPI_INT, dest, 1, comm, &status );
+       MPI_Send( buf, VEC_NELM, MPI_INT, dest, 0, comm );
+       free( buf );
+    }
+
+    /* Clean up the strideType */
+    if (rank != dest) {
+       MPI_Type_free( &strideType );
+    }
+
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/tmatchsize.c b/teshsuite/smpi/mpich3-test/datatype/tmatchsize.c
new file mode 100644 (file)
index 0000000..76432d7
--- /dev/null
@@ -0,0 +1,173 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of type_match_size";
+*/
+
+/*
+ * type match size is part of the extended Fortran support, and may not
+ * be present in 
+ */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int dsize;
+    MPI_Datatype  newtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* Check the most likely cases.  Note that it is an error to
+       free the type returned by MPI_Type_match_size.  Also note
+       that it is an error to request a size not supported by the compiler,
+       so Type_match_size should generate an error in that case */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = MPI_Type_match_size( MPI_TYPECLASS_REAL, sizeof(float), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Float: ", err );
+    }
+    else {
+       err = MPI_Type_size( newtype, &dsize );
+       if (err) {
+           errs++;
+           MTestPrintErrorMsg( "Float type: ", err );
+       }
+       else {
+           if (dsize != sizeof(float)) {
+               errs++;
+               printf( "Unexpected size for float (%d != %d)\n", 
+                       dsize, (int) sizeof(float) );
+           }
+       }
+    }
+
+    err = MPI_Type_match_size( MPI_TYPECLASS_REAL, sizeof(double), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Double: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(double)) {
+           errs++;
+           printf( "Unexpected size for double\n" );
+       }
+    }
+#ifdef HAVE_LONG_DOUBLE
+    err = MPI_Type_match_size( MPI_TYPECLASS_REAL, sizeof(long double), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Long double: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(long double)) {
+           errs++;
+           printf( "Unexpected size for long double\n" );
+       }
+    }
+#endif
+    
+    err = MPI_Type_match_size( MPI_TYPECLASS_INTEGER, sizeof(short), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Short: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(short)) {
+           errs++;
+           printf( "Unexpected size for short\n" );
+       }
+    }
+
+    err = MPI_Type_match_size( MPI_TYPECLASS_INTEGER, sizeof(int), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Int: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(int)) {
+           errs++;
+           printf( "Unexpected size for int\n" );
+       }
+    }
+
+    err = MPI_Type_match_size( MPI_TYPECLASS_INTEGER, sizeof(long), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Long: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(long)) {
+           errs++;
+           printf( "Unexpected size for long\n" );
+       }
+    }
+#ifdef HAVE_LONG_LONG
+    err = MPI_Type_match_size( MPI_TYPECLASS_INTEGER, sizeof(long long), &newtype );
+    if (err) {
+       errs++;
+       MTestPrintErrorMsg( "Long long: ", err );
+    }
+    else {
+       MPI_Type_size( newtype, &dsize );
+       if (dsize != sizeof(long long)) {
+           errs++;
+           printf( "Unexpected size for long long\n" );
+       }
+    }
+#endif
+
+    /* COMPLEX is a FORTRAN type.  The MPICH Type_match_size attempts
+       to give a valid datatype, but if Fortran is not available,
+       MPI_COMPLEX and MPI_DOUBLE_COMPLEX are not supported.  
+       Allow this case by testing for MPI_DATATYPE_NULL */
+    if (MPI_COMPLEX != MPI_DATATYPE_NULL) {
+       err = MPI_Type_match_size( MPI_TYPECLASS_COMPLEX, 2*sizeof(float), &newtype );
+       if (err) {
+           errs++;
+           MTestPrintErrorMsg( "Complex: ", err );
+       }
+       else {
+           MPI_Type_size( newtype, &dsize );
+           if (dsize != 2*sizeof(float)) {
+               errs++;
+               printf( "Unexpected size for complex\n" );
+           }
+       }
+    }
+
+    if (MPI_COMPLEX != MPI_DATATYPE_NULL &&
+       MPI_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
+       err = MPI_Type_match_size( MPI_TYPECLASS_COMPLEX, 2*sizeof(double), &newtype );
+       if (err) {
+           errs++;
+           MTestPrintErrorMsg( "Double complex: ", err );
+       }
+       else {
+           MPI_Type_size( newtype, &dsize );
+           if (dsize != 2*sizeof(double)) {
+               errs++;
+               printf( "Unexpected size for double complex\n" );
+           }
+       }
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c b/teshsuite/smpi/mpich3-test/datatype/transpose-pack.c
new file mode 100644 (file)
index 0000000..18e2c59
--- /dev/null
@@ -0,0 +1,120 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+
+int main(int argc, char *argv[])
+{
+    /* Variable declarations */
+    int a[100][100], b[100][100];
+    MPI_Datatype row, xpose;
+    MPI_Aint sizeofint;
+       
+    int /* err, */ errs = 0;
+    int bufsize, position = 0;
+    void *buffer;
+  
+    int i, j;
+  
+    /* Initialize a to some known values. */
+    for(i = 0; i < 100; i++) {
+       for(j = 0; j < 100; j++) {
+           a[i][j] = i*1000+j;
+           b[i][j] = -1;
+       }
+    }
+  
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    MPI_Type_extent(MPI_INT, &sizeofint);
+       
+    /* Create datatypes. */
+    MPI_Type_vector(100, 1, 100, MPI_INT, &row);
+    MPI_Type_hvector(100, 1, sizeofint, row, &xpose);
+    MPI_Type_commit(&xpose);
+       
+    /* Pack it. */
+    MPI_Pack_size(1, xpose, MPI_COMM_WORLD, &bufsize);
+    buffer = (char *) malloc((unsigned) bufsize);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    /* err = */ MPI_Pack(a,
+                  1,
+                  xpose,
+                  buffer,
+                  bufsize,
+                  &position,
+                  MPI_COMM_WORLD);
+       
+    /* Unpack the buffer into b. */
+    position = 0;
+    /* err = */ MPI_Unpack(buffer,
+                    bufsize,
+                    &position,
+                    b,
+                    100*100,
+                    MPI_INT,
+                    MPI_COMM_WORLD);
+
+    for (i = 0; i < 100; i++) {
+       for (j = 0; j < 100; j++) {
+           if(b[i][j] != a[j][i]) {
+               errs++;
+               if (verbose) fprintf(stderr, "b[%d][%d] = %d, should be %d\n",
+                                    i, j, b[i][j], a[j][i]);
+           }
+       }
+    }
+
+    MPI_Type_free(&xpose);
+    MPI_Type_free(&row);
+    
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/tresized.c b/teshsuite/smpi/mpich3-test/datatype/tresized.c
new file mode 100644 (file)
index 0000000..069fddc
--- /dev/null
@@ -0,0 +1,77 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of type resized";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, i;
+    int rank, size, source, dest;
+    int count; 
+    int *buf; 
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Datatype  newtype;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    /* Determine the sender and receiver */
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    source = 0;
+    dest   = size - 1;
+       
+    MPI_Type_create_resized( MPI_INT, 0, 3 * sizeof(int), &newtype );
+    MPI_Type_commit( &newtype );
+    for (count = 1; count < 65000; count = count * 2) {
+       buf = (int *)malloc( count * 3 * sizeof(int) );
+       if (!buf) {
+           MPI_Abort( comm, 1 );
+       }
+       for (i=0; i<3*count; i++) buf[i] = -1;
+       if (rank == source) {
+           for (i=0; i<count; i++) buf[3*i] = i;
+           MPI_Send( buf, count, newtype, dest, 0, comm );
+           MPI_Send( buf, count, newtype, dest, 1, comm );
+       }
+       else if (rank == dest) {
+           MPI_Recv( buf, count, MPI_INT, source, 0, comm, &status );
+           for (i=0; i<count; i++) {
+               if (buf[i] != i) {
+                   errs++;
+                   if (errs < 10) {
+                       printf( "buf[%d] = %d\n", i, buf[i] );
+                   }
+               }
+           }
+           for (i=0; i<count*3; i++) buf[i] = -1;
+           MPI_Recv( buf, count, newtype, source, 1, comm, &status );
+           for (i=0; i<count; i++) {
+               if (buf[3*i] != i) {
+                   errs++;
+                   if (errs < 10) {
+                       printf( "buf[3*%d] = %d\n", i, buf[i] );
+                   }
+               }
+           }
+       }
+    }
+
+    MPI_Type_free( &newtype );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/tresized2.c b/teshsuite/smpi/mpich3-test/datatype/tresized2.c
new file mode 100644 (file)
index 0000000..064084b
--- /dev/null
@@ -0,0 +1,80 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of type resized with non-zero LB";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, i;
+    int rank, size, source, dest;
+    int count; 
+    int *buf; 
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Datatype  newtype;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    /* Determine the sender and receiver */
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    source = 0;
+    dest   = size - 1;
+
+    /* Create an type that is "* INT * "
+       that is, there is a int-sized pad at the beginning of the type, 
+       and the extent is still 3 ints.  Note, however, that the INT
+       is still at displacement 0, so the effective pattern i*/
+    MPI_Type_create_resized( MPI_INT, -(int)sizeof(int), 3 * sizeof(int), &newtype ); 
+    MPI_Type_commit( &newtype );
+    for (count = 1; count < 65000; count = count * 2) {
+       buf = (int *)malloc( count * 3 * sizeof(int) );
+       if (!buf) {
+           MPI_Abort( comm, 1 );
+       }
+       for (i=0; i<3*count; i++) buf[i] = -1;
+       if (rank == source) {
+           for (i=0; i<count; i++) buf[3*i] = i;
+           MPI_Send( buf, count, newtype, dest, 0, comm );
+           MPI_Send( buf, count, newtype, dest, 1, comm );
+       }
+       else if (rank == dest) {
+           MPI_Recv( buf, count, MPI_INT, source, 0, comm, &status );
+           for (i=0; i<count; i++) {
+               if (buf[i] != i) {
+                   errs++;
+                   if (errs < 10) {
+                       printf( "buf[%d] = %d\n", i, buf[i] );
+                   }
+               }
+           }
+           for (i=0; i<count*3; i++) buf[i] = -1;
+           MPI_Recv( buf, count, newtype, source, 1, comm, &status );
+           for (i=0; i<count; i++) {
+               if (buf[3*i] != i) {
+                   errs++;
+                   if (errs < 10) {
+                       printf( "buf[3*%d] = %d\n", i, buf[i] );
+                   }
+               }
+           }
+       }
+    }
+    MPI_Type_free( &newtype );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c b/teshsuite/smpi/mpich3-test/datatype/triangular-pack.c
new file mode 100644 (file)
index 0000000..dde6eda
--- /dev/null
@@ -0,0 +1,100 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* helper functions */
+int parse_args(int argc, char **argv);
+
+static int verbose = 0;
+
+int main(int argc, char *argv[])
+{
+    /* Variable declarations */
+    int a[100][100], b[100][100];
+    int disp[100], block[100];
+    MPI_Datatype ltype;
+       
+    int bufsize, position = 0;
+    void *buffer;
+       
+    int i, j, errs = 0;
+       
+    /* Initialize a to some known values and zero out b. */
+    for(i = 0; i < 100; i++) {
+       for(j = 0; j < 100; j++) {
+           a[i][j] = 1000*i + j;
+           b[i][j] = 0;
+       }
+    }
+       
+    /* Initialize MPI */
+    MTest_Init( &argc, &argv );
+  
+    parse_args(argc, argv);
+
+    for(i = 0; i < 100; i++) {
+       /* Fortran version has disp(i) = 100*(i-1) + i and block(i) = 100-i. */
+       /* This code here is wrong. It compacts everything together,
+        * which isn't what we want.
+        * What we want is to put the lower triangular values into b and leave
+        * the rest of it unchanged, right?
+        */
+       block[i] = i+1;
+       disp[i] = 100*i;
+    }
+       
+    /* Create datatype for lower triangular part. */
+    MPI_Type_indexed(100, block, disp, MPI_INT, &ltype);
+    MPI_Type_commit(&ltype);
+       
+    /* Pack it. */
+    MPI_Pack_size(1, ltype, MPI_COMM_WORLD, &bufsize);
+    buffer = (void *) malloc((unsigned) bufsize);
+    MPI_Pack( a, 1, ltype, buffer, bufsize, &position, MPI_COMM_WORLD );
+       
+    /* Unpack the buffer into b. */
+    position = 0;
+    MPI_Unpack(buffer, bufsize, &position, b, 1, ltype, MPI_COMM_WORLD);
+       
+    for(i = 0; i < 100; i++) {
+       for(j = 0; j < 100; j++) {
+           if (j > i && b[i][j] != 0) {
+               errs++;
+               if (verbose) fprintf(stderr, "b[%d][%d] = %d; should be %d\n",
+                                    i, j, b[i][j], 0);
+           }
+           else if (j <= i && b[i][j] != 1000*i + j) {
+               errs++;
+               if (verbose) fprintf(stderr, "b[%d][%d] = %d; should be %d\n",
+                                    i, j, b[i][j], 1000*i + j);
+           }
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/typecommit.c b/teshsuite/smpi/mpich3-test/datatype/typecommit.c
new file mode 100644 (file)
index 0000000..61fb7b5
--- /dev/null
@@ -0,0 +1,53 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf, 
+        MPI_Datatype recvtype);
+void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf, 
+        MPI_Datatype recvtype)
+{
+    int blocks[2];
+    MPI_Aint struct_displs[2];
+    MPI_Datatype types[2], tmp_type;
+
+    blocks[0] = 256;
+    MPI_Get_address( sendbuf, &struct_displs[0] );
+    types[0] = sendtype;
+    blocks[1] = 256;
+    MPI_Get_address( recvbuf, &struct_displs[1] );
+    types[1] = MPI_BYTE;
+
+    MPI_Type_create_struct(2, blocks, struct_displs, types, &tmp_type);
+    MPI_Type_commit(&tmp_type);
+    MPI_Type_free(&tmp_type);
+}
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+
+    MTest_Init(&argc, &argv);
+
+    foo((void*) 0x1, MPI_FLOAT_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_DOUBLE_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_LONG_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_SHORT_INT, (void*) 0x2, MPI_BYTE);
+    foo((void*) 0x1, MPI_2INT, (void*) 0x2, MPI_BYTE);
+#ifdef HAVE_LONG_DOUBLE
+    /* Optional type may be NULL */
+    if (MPI_LONG_DOUBLE_INT != MPI_DATATYPE_NULL) {
+       foo((void*) 0x1, MPI_LONG_DOUBLE_INT, (void*) 0x2, MPI_BYTE);
+    }
+#endif
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/typefree.c b/teshsuite/smpi/mpich3-test/datatype/typefree.c
new file mode 100644 (file)
index 0000000..83a09dd
--- /dev/null
@@ -0,0 +1,35 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * This test may be used to confirm that memory is properly recovered from
+ * freed datatypes.  To test this, build the MPI implementation with memory
+ * leak checking.  As this program may be run with a single process, it should
+ * also be easy to run it under valgrind or a similar program.  With MPICH,
+ * you can configure with the option
+ *
+ *   --enable-g=mem
+ *
+ * to turn on MPICH's internal memory checking.
+ */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    MPI_Datatype type;
+
+    MTest_Init( &argc, &argv );
+    MPI_Type_dup( MPI_INT, &type );
+    MPI_Type_free( &type );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
similarity index 62%
rename from teshsuite/smpi/mpich-test/pt2pt/typelb.c
rename to teshsuite/smpi/mpich3-test/datatype/typelb.c
index edcb2bb..2dedadb 100644 (file)
@@ -1,8 +1,13 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
 
-int
-main( int argc, char **argv)
+int main( int argc, char **argv)
 {
     int blockcnt[2], rank;
     MPI_Aint offsets[2], lb, ub, extent;
@@ -10,6 +15,10 @@ main( int argc, char **argv)
 
     MPI_Init(&argc, &argv);
 
+    /* Set some values in locations that should not be accessed */
+    blockcnt[1] = -1;
+    offsets[1] = -1;
+
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     if (rank == 0) {
        blockcnt[0] = 1;
@@ -26,21 +35,20 @@ main( int argc, char **argv)
        
        /* Check that the results are correct */
 #ifdef DEBUG
-       printf("lb=%ld, ub=%ld, extent=%ld\n",
-               (long)lb, (long)ub, (long)extent);
+       printf("lb=%ld, ub=%ld, extent=%ld\n", lb, ub, extent);
        printf("Should be lb=4, ub=5, extent=1\n");
 #endif
        if (lb != 4 || ub != 5 || extent != 1) {
-            printf("lb = %ld (should be 4), ub = %ld (should be 5) extent = %ld should be 1\n",
-                   (long)lb, (long)ub, (long)extent) ;
-       else {
+         printf ("lb = %d (should be 4), ub = %d (should be 5) extent = %d should be 1\n", (int)lb, (int)ub, (int)extent) ;
+       }
+       else {
            printf( " No Errors\n" );
        }
 
        MPI_Type_free(&tmp_type);
        MPI_Type_free(&newtype);
-
     }
+
     MPI_Finalize();
     return 0;
 }
diff --git a/teshsuite/smpi/mpich3-test/datatype/typename.c b/teshsuite/smpi/mpich3-test/datatype/typename.c
new file mode 100644 (file)
index 0000000..60845c1
--- /dev/null
@@ -0,0 +1,194 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitest.h"
+#include <stdio.h>
+#include <string.h>
+
+/* Create an array with all of the MPI names in it */
+
+typedef struct mpi_names_t { MPI_Datatype dtype; const char *name; } mpi_names_t;
+
+/* The MPI standard specifies that the names must be the MPI names,
+not the related language names (e.g., MPI_CHAR, not char) */
+
+int main( int argc, char **argv )
+{
+
+mpi_names_t mpi_names[] = {
+    { MPI_CHAR, "MPI_CHAR" },
+    { MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR" },
+    { MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR" },
+    { MPI_BYTE, "MPI_BYTE" },
+    { MPI_WCHAR, "MPI_WCHAR" },
+    { MPI_SHORT, "MPI_SHORT" },
+    { MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT" },
+    { MPI_INT, "MPI_INT" },
+    { MPI_UNSIGNED, "MPI_UNSIGNED" },
+    { MPI_LONG, "MPI_LONG" },
+    { MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG" },
+    { MPI_FLOAT, "MPI_FLOAT" },
+    { MPI_DOUBLE, "MPI_DOUBLE" },
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* these two types were added in MPI-2.2 */
+    { MPI_AINT, "MPI_AINT" },
+    { MPI_OFFSET, "MPI_OFFSET" },
+#endif
+
+    { MPI_PACKED, "MPI_PACKED" },
+    { MPI_LB, "MPI_LB" },
+    { MPI_UB, "MPI_UB" },
+    { MPI_FLOAT_INT, "MPI_FLOAT_INT" },
+    { MPI_DOUBLE_INT, "MPI_DOUBLE_INT" },
+    { MPI_LONG_INT, "MPI_LONG_INT" },
+    { MPI_SHORT_INT, "MPI_SHORT_INT" },
+    { MPI_2INT, "MPI_2INT" },
+    /* Fortran */
+#ifdef HAVE_FORTRAN_BINDING
+    { MPI_COMPLEX, "MPI_COMPLEX" },
+    { MPI_DOUBLE_COMPLEX, "MPI_DOUBLE_COMPLEX" },
+    { MPI_LOGICAL, "MPI_LOGICAL" },
+    { MPI_REAL, "MPI_REAL" },
+    { MPI_DOUBLE_PRECISION, "MPI_DOUBLE_PRECISION" },
+    { MPI_INTEGER, "MPI_INTEGER" },
+    { MPI_2INTEGER, "MPI_2INTEGER" },
+    /* 2COMPLEX (and the 2DOUBLE_COMPLEX) were in MPI 1.0 but not later */
+#ifdef HAVE_MPI_2COMPLEX
+    { MPI_2COMPLEX, "MPI_2COMPLEX" },
+#endif
+#ifdef HAVE_MPI_2DOUBLE_COMPLEX
+    /* MPI_2DOUBLE_COMPLEX is an extension - it is not part of MPI 2.1 */
+    { MPI_2DOUBLE_COMPLEX, "MPI_2DOUBLE_COMPLEX" },
+#endif
+    { MPI_2REAL, "MPI_2REAL" },
+    { MPI_2DOUBLE_PRECISION, "MPI_2DOUBLE_PRECISION" },
+    { MPI_CHARACTER, "MPI_CHARACTER" },
+#endif
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* these C99 types were added in MPI-2.2 */
+    { MPI_INT8_T,   "MPI_INT8_T"   },
+    { MPI_INT16_T,  "MPI_INT16_T"  },
+    { MPI_INT32_T,  "MPI_INT32_T"  },
+    { MPI_INT64_T,  "MPI_INT64_T"  },
+    { MPI_UINT8_T,  "MPI_UINT8_T"  },
+    { MPI_UINT16_T, "MPI_UINT16_T" },
+    { MPI_UINT32_T, "MPI_UINT32_T" },
+    { MPI_UINT64_T, "MPI_UINT64_T" },
+    { MPI_C_BOOL, "MPI_C_BOOL" },
+    { MPI_C_FLOAT_COMPLEX,  "MPI_C_FLOAT_COMPLEX"  },
+    { MPI_C_DOUBLE_COMPLEX, "MPI_C_DOUBLE_COMPLEX" },
+    { MPI_AINT, "MPI_AINT" },
+    { MPI_OFFSET, "MPI_OFFSET" },
+#endif
+    /* Size-specific types */
+    /* Do not move MPI_REAL4 - this is used to indicate the very first 
+       optional type.  In addition, you must not add any required types
+       after this type */
+    /* See MPI 2.1, Section 16.2.  These are required, predefined types. 
+       If the type is not available (e.g., *only* because the Fortran
+       compiler does not support it), the value may be MPI_DATATYPE_NULL */
+    { MPI_REAL4, "MPI_REAL4" },
+    { MPI_REAL8, "MPI_REAL8" },
+    { MPI_REAL16, "MPI_REAL16" },
+    { MPI_COMPLEX8, "MPI_COMPLEX8" },
+    { MPI_COMPLEX16, "MPI_COMPLEX16" },
+    { MPI_COMPLEX32, "MPI_COMPLEX32" },
+    { MPI_INTEGER1, "MPI_INTEGER1" },
+    { MPI_INTEGER2, "MPI_INTEGER2" },
+    { MPI_INTEGER4, "MPI_INTEGER4" },
+    { MPI_INTEGER8, "MPI_INTEGER8" },
+#ifdef HAVE_MPI_INTEGER16
+    /* MPI_INTEGER16 is not included in most of the tables in MPI 2.1,
+       and some implementations omit it.  An error will be reported, but
+       this ifdef allows the test to be built and run. */
+    { MPI_INTEGER16, "MPI_INTEGER16" },
+#endif
+    /* Semi-optional types - if the compiler doesn't support long double
+       or long long, these might be MPI_DATATYPE_NULL */
+    { MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE" },
+    { MPI_LONG_LONG_INT, "MPI_LONG_LONG_INT" }, 
+    { MPI_LONG_LONG, "MPI_LONG_LONG" },
+    { MPI_UNSIGNED_LONG_LONG, "MPI_UNSIGNED_LONG_LONG" }, 
+    { MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT" },
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    /* added in MPI-2.2 */
+    { MPI_C_LONG_DOUBLE_COMPLEX, "MPI_C_LONG_DOUBLE_COMPLEX" },
+    { MPI_AINT,  "MPI_AINT"  },
+    { MPI_OFFSET, "MPI_OFFSET" },
+#endif
+#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
+    /* added in MPI 3 */
+    { MPI_COUNT, "MPI_COUNT" },
+#endif
+    { 0, (char *)0 },  /* Sentinal used to indicate the last element */
+};
+
+    char name[MPI_MAX_OBJECT_NAME];
+    int namelen, i, inOptional;
+    int errs = 0;
+
+    MTest_Init( &argc, &argv );
+    
+    /* Sample some datatypes */
+    /* See 8.4, "Naming Objects" in MPI-2.  The default name is the same
+       as the datatype name */
+    MPI_Type_get_name( MPI_DOUBLE, name, &namelen );
+    if (strncmp( name, "MPI_DOUBLE", MPI_MAX_OBJECT_NAME )) {
+       errs++;
+       fprintf( stderr, "Expected MPI_DOUBLE but got :%s:\n", name );
+    }
+
+    MPI_Type_get_name( MPI_INT, name, &namelen );
+    if (strncmp( name, "MPI_INT", MPI_MAX_OBJECT_NAME )) {
+       errs++;
+       fprintf( stderr, "Expected MPI_INT but got :%s:\n", name );
+    }
+
+    /* Now we try them ALL */
+    inOptional = 0;
+    for (i=0; mpi_names[i].name != 0; i++) {
+       /* Are we in the optional types? */
+       if (strcmp( mpi_names[i].name, "MPI_REAL4" ) == 0) 
+           inOptional = 1;
+       /* If this optional type is not supported, skip it */
+       if (inOptional && mpi_names[i].dtype == MPI_DATATYPE_NULL) continue;
+       if (mpi_names[i].dtype == MPI_DATATYPE_NULL) {
+           /* Report an error because all of the standard types 
+              must be supported */
+           errs++;
+           fprintf( stderr, "MPI Datatype %s is MPI_DATATYPE_NULL\n", 
+                    mpi_names[i].name );
+           continue;
+       }
+       MTestPrintfMsg( 10, "Checking type %s\n", mpi_names[i].name );
+       name[0] = 0;
+       MPI_Type_get_name( mpi_names[i].dtype, name, &namelen );
+       if (strncmp( name, mpi_names[i].name, namelen )) {
+           errs++;
+           fprintf( stderr, "Expected %s but got %s\n", 
+                    mpi_names[i].name, name );
+       }
+    }
+
+    /* Try resetting the name */
+    MPI_Type_set_name( MPI_INT, (char*)"int" );
+    name[0] = 0;
+    MPI_Type_get_name( MPI_INT, name, &namelen );
+    if (strncmp( name, "int", MPI_MAX_OBJECT_NAME )) {
+       errs++;
+       fprintf( stderr, "Expected int but got :%s:\n", name );
+    }
+
+#ifndef HAVE_MPI_INTEGER16
+    errs++;
+    fprintf( stderr, "MPI_INTEGER16 is not available\n" );
+#endif
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/unpack.c b/teshsuite/smpi/mpich3-test/datatype/unpack.c
new file mode 100644 (file)
index 0000000..839b8fc
--- /dev/null
@@ -0,0 +1,111 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+#include <stdlib.h>
+#include <string.h>
+
+/* Test sent in by Avery Ching to report a bug in MPICH. 
+   Adding it as a regression test. */
+
+/*
+static void print_char_buf(char *buf_name, char *buf, int buf_len)
+{
+    int i;
+
+    printf("print_char_buf: %s\n", buf_name);
+    for (i = 0; i < buf_len; i++)
+    {
+        printf("%c ", buf[i]);
+        if (((i + 1) % 10) == 0)
+            printf("\n");
+        else if (((i + 1) % 5) == 0)
+            printf("  ");
+    }
+    printf("\n");
+}
+*/
+
+char correct_buf[] = {'a', '_', 'b', 'c', '_', '_', '_', '_', 'd', '_', 
+                     'e', 'f', 'g', '_', 'h', 'i', 'j', '_', 'k', 'l',
+                     '_', '_', '_', '_', 'm', '_', 'n', 'o', 'p', '_',
+                     'q', 'r'};
+
+#define COUNT 2
+
+int main(int argc, char **argv)
+{
+    int myid, numprocs, i;
+    char *mem_buf = NULL, *unpack_buf = NULL;
+    MPI_Datatype tmp_dtype, mem_dtype;
+    MPI_Aint mem_dtype_ext = -1;
+    int mem_dtype_sz = -1;
+    int mem_buf_sz = -1, unpack_buf_sz = -1, buf_pos = 0;
+
+    int blk_arr[COUNT] = {1, 2};
+    int dsp_arr[COUNT] = {0, 2};
+    int errs = 0;
+
+    MTest_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &myid);
+    MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
+
+    /* Creating the datatype to use for unpacking */
+    MPI_Type_indexed(COUNT, blk_arr, dsp_arr,
+                     MPI_CHAR, &tmp_dtype);
+    MPI_Type_commit(&tmp_dtype);
+    MPI_Type_indexed(COUNT, blk_arr, dsp_arr,
+                     tmp_dtype, &mem_dtype);
+    MPI_Type_free( &tmp_dtype );
+    MPI_Type_commit(&mem_dtype);
+
+    MPI_Type_size(mem_dtype, &mem_dtype_sz);
+    MPI_Type_extent(mem_dtype, &mem_dtype_ext);
+
+    mem_buf_sz    = 2 * mem_dtype_ext;
+    unpack_buf_sz = 2 * mem_dtype_sz;
+
+    if ((mem_buf = (char *) malloc(mem_buf_sz)) == NULL)
+    {
+       fprintf(stderr, "malloc mem_buf of size %d failed\n", mem_buf_sz);
+       return -1;
+    }
+    memset(mem_buf, '_', mem_buf_sz);
+
+    if ((unpack_buf = (char *) malloc(unpack_buf_sz)) == NULL)
+    {
+       fprintf(stderr, "malloc unpack_buf of size %d failed\n", 
+               unpack_buf_sz);
+       return -1;
+    }
+    
+    for (i = 0; i < unpack_buf_sz; i++)
+       unpack_buf[i] = 'a' + i;
+    
+    /* print_char_buf("mem_buf before unpack", mem_buf, 2 * mem_dtype_ext); */
+
+    MPI_Unpack(unpack_buf, unpack_buf_sz, &buf_pos,
+              mem_buf, 2, mem_dtype, MPI_COMM_SELF);
+    /* Note: Unpack without a Pack is not technically correct, but should work
+     * with MPICH. */
+
+    /* print_char_buf("mem_buf after unpack", mem_buf, 2 * mem_dtype_ext);
+       print_char_buf("correct buffer should be", 
+                       correct_buf, 2 * mem_dtype_ext); */
+
+    if (memcmp(mem_buf, correct_buf, 2 * mem_dtype_ext)) {
+       printf("Unpacked buffer does not match expected buffer\n");
+       errs++;
+    }
+
+    MPI_Type_free(&mem_dtype);
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c b/teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c
new file mode 100644 (file)
index 0000000..d6fd63c
--- /dev/null
@@ -0,0 +1,652 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <math.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+
+/* 
+   The default behavior of the test routines should be to briefly indicate
+   the cause of any errors - in this test, that means that verbose needs
+   to be set. Verbose should turn on output that is independent of error
+   levels.
+*/
+static int verbose = 1;
+
+int parse_args(int argc, char **argv);
+int struct_negdisp_test(void);
+int vector_negstride_test(void);
+int indexed_negdisp_test(void);
+int struct_struct_test(void);
+int flatten_test(void);
+
+int build_array_section_type(MPI_Aint aext, MPI_Aint astart, MPI_Aint aend, MPI_Datatype *datatype);
+
+int main(int argc, char *argv[])
+{
+    int err, errs = 0;
+
+    /* Initialize MPI */
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = struct_negdisp_test();
+    if (verbose && err) fprintf(stderr, "error in struct_negdisp_test\n");
+    errs += err;
+
+    err = vector_negstride_test();
+    if (verbose && err) fprintf(stderr, "error in vector_negstride_test\n");
+    errs += err;
+
+    err = indexed_negdisp_test();
+    if (verbose && err) fprintf(stderr, "error in indexed_negdisp_test\n");
+    errs += err;
+
+    err = struct_struct_test();
+    if (verbose && err) fprintf(stderr, "error in struct_struct_test\n");
+    errs += err;
+
+    err = flatten_test();
+    if (verbose && err) fprintf(stderr, "error in flatten_test\n");
+    errs += err;
+
+    /* print message and exit */
+    if (errs) {
+       fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+/* test uses a struct type that describes data that is contiguous,
+ * but processed in a noncontiguous way.
+ */
+int struct_negdisp_test(void)
+{
+    int err, errs = 0;
+    int sendbuf[6] = { 1, 2, 3, 4, 5, 6 };
+    int recvbuf[6] = { -1, -2, -3, -4, -5, -6 };
+    MPI_Datatype mystruct;
+    MPI_Request request;
+    MPI_Status status;
+
+    MPI_Aint disps[2]     = { 0,       -1*((int) sizeof(int)) };
+    int blks[2]           = { 1,       1, };
+    MPI_Datatype types[2] = { MPI_INT, MPI_INT };
+
+    err = MPI_Type_struct(2, blks, disps, types, &mystruct);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_struct returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&mystruct);
+
+    err = MPI_Irecv(recvbuf+1, 4, MPI_INT, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(sendbuf+2, 2, mystruct, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+
+    /* verify data */
+    if (recvbuf[0] != -1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[0] = %d; should be %d\n", recvbuf[0], -1);
+       }
+    }
+    if (recvbuf[1] != 3) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[1] = %d; should be %d\n", recvbuf[1], 3);
+       }
+    }
+    if (recvbuf[2] != 2) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[2] = %d; should be %d\n", recvbuf[2], 2);
+       }
+    }
+    if (recvbuf[3] != 5) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[3] = %d; should be %d\n", recvbuf[3], 5);
+       }
+    }
+    if (recvbuf[4] != 4) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[4] = %d; should be %d\n", recvbuf[4], 4);
+       }
+    }
+    if (recvbuf[5] != -6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[5] = %d; should be %d\n", recvbuf[5], -6);
+       }
+    }
+
+    MPI_Type_free(&mystruct);
+
+    return errs;
+}
+
+/* test uses a vector type that describes data that is contiguous,
+ * but processed in a noncontiguous way.  this is effectively the
+ * same type as in the struct_negdisp_test above.
+ */
+int vector_negstride_test(void)
+{
+    int err, errs = 0;
+    int sendbuf[6] = { 1, 2, 3, 4, 5, 6 };
+    int recvbuf[6] = { -1, -2, -3, -4, -5, -6 };
+    MPI_Datatype myvector;
+    MPI_Request request;
+    MPI_Status status;
+
+    err = MPI_Type_vector(2, 1, -1, MPI_INT, &myvector);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_vector returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&myvector);
+
+    err = MPI_Irecv(recvbuf+1, 4, MPI_INT, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(sendbuf+2, 2, myvector, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+
+    /* verify data */
+    if (recvbuf[0] != -1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[0] = %d; should be %d\n", recvbuf[0], -1);
+       }
+    }
+    if (recvbuf[1] != 3) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[1] = %d; should be %d\n", recvbuf[1], 3);
+       }
+    }
+    if (recvbuf[2] != 2) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[2] = %d; should be %d\n", recvbuf[2], 2);
+       }
+    }
+    if (recvbuf[3] != 5) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[3] = %d; should be %d\n", recvbuf[3], 5);
+       }
+    }
+    if (recvbuf[4] != 4) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[4] = %d; should be %d\n", recvbuf[4], 4);
+       }
+    }
+    if (recvbuf[5] != -6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[5] = %d; should be %d\n", recvbuf[5], -6);
+       }
+    }
+
+    MPI_Type_free(&myvector);
+
+    return errs;
+}
+
+/* test uses a indexed type that describes data that is contiguous,
+ * but processed in a noncontiguous way.  this is effectively the same
+ * type as in the two tests above.
+ */
+int indexed_negdisp_test(void)
+{
+    int err, errs = 0;
+    int sendbuf[6] = { 1, 2, 3, 4, 5, 6 };
+    int recvbuf[6] = { -1, -2, -3, -4, -5, -6 };
+    MPI_Datatype myindexed;
+    MPI_Request request;
+    MPI_Status status;
+
+    int disps[2]     = { 0, -1 };
+    int blks[2]           = { 1, 1 };
+
+    err = MPI_Type_indexed(2, blks, disps, MPI_INT, &myindexed);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Type_indexed returned error\n");
+       }
+    }
+
+    MPI_Type_commit(&myindexed);
+
+    err = MPI_Irecv(recvbuf+1, 4, MPI_INT, 0, 0, MPI_COMM_SELF, &request);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Irecv returned error\n");
+       }
+    }
+
+    err = MPI_Send(sendbuf+2, 2, myindexed, 0, 0, MPI_COMM_SELF);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Send returned error\n");
+       }
+    }
+
+    err = MPI_Wait(&request, &status);
+    if (err != MPI_SUCCESS) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "MPI_Wait returned error\n");
+       }
+    }
+
+    /* verify data */
+    if (recvbuf[0] != -1) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[0] = %d; should be %d\n", recvbuf[0], -1);
+       }
+    }
+    if (recvbuf[1] != 3) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[1] = %d; should be %d\n", recvbuf[1], 3);
+       }
+    }
+    if (recvbuf[2] != 2) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[2] = %d; should be %d\n", recvbuf[2], 2);
+       }
+    }
+    if (recvbuf[3] != 5) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[3] = %d; should be %d\n", recvbuf[3], 5);
+       }
+    }
+    if (recvbuf[4] != 4) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[4] = %d; should be %d\n", recvbuf[4], 4);
+       }
+    }
+    if (recvbuf[5] != -6) {
+       errs++;
+       if (verbose) {
+           fprintf(stderr, "recvbuf[5] = %d; should be %d\n", recvbuf[5], -6);
+       }
+    }
+
+    MPI_Type_free(&myindexed);
+
+    return errs;
+}
+
+#define check_err(fn_name_)                                                   \
+    do {                                                                      \
+        if (err != MPI_SUCCESS) {                                             \
+            errs++;                                                           \
+            if (verbose) {                                                    \
+                int len_;                                                     \
+                char err_str_[MPI_MAX_ERROR_STRING];                          \
+                MPI_Error_string(err, err_str_, &len_);                       \
+                fprintf(stderr, #fn_name_ " failed at line %d, err=%d: %s\n", \
+                        __LINE__, err, err_str_);                             \
+            }                                                                 \
+        }                                                                     \
+    } while (0)
+/* test case from tt#1030 ported to C
+ *
+ * Thanks to Matthias Lieber for reporting the bug and providing a good test
+ * program. */
+int struct_struct_test(void)
+{
+    int err, errs = 0;
+    int i, j, dt_size = 0;
+    MPI_Request req[2];
+
+
+#define COUNT (2)
+    MPI_Aint displ[COUNT];
+    int blens[COUNT];
+    MPI_Datatype types[COUNT];
+    MPI_Datatype datatype;
+
+    /* A slight difference from the F90 test: F90 arrays are column-major, C
+     * arrays are row-major.  So we invert the order of dimensions. */
+#define N (2)
+#define M (4)
+    int array[N][M] =    { {-1, -1, -1, -1}, {-1, -1, -1, -1} };
+    int expected[N][M] = { {-1,  1,  2,  5}, {-1,  3,  4,  6} };
+    int seq_array[N*M];
+    MPI_Aint astart, aend;
+    MPI_Aint size_exp = 0;
+
+    /* 1st section selects elements 1 and 2 out of 2nd dimension, complete 1st dim.
+     * should receive the values 1, 2, 3, 4 */
+    astart = 1;
+    aend   = 2;
+    err = build_array_section_type(M, astart, aend, &types[0]);
+    if (err) {
+        errs++;
+        if (verbose) fprintf(stderr, "build_array_section_type failed\n");
+        return errs;
+    }
+    blens[0] = N;
+    displ[0] = 0;
+    size_exp = size_exp + N * (aend-astart+1) * sizeof(int);
+
+    /* 2nd section selects last element of 2nd dimension, complete 1st dim.
+     * should receive the values 5, 6 */
+    astart = 3;
+    aend   = 3;
+    err = build_array_section_type(M, astart, aend, &types[1]);
+    if (err) {
+        errs++;
+        if (verbose) fprintf(stderr, "build_array_section_type failed\n");
+        return errs;
+    }
+    blens[1] = N;
+    displ[1] = 0;
+    size_exp = size_exp + N * (aend-astart+1) * sizeof(int);
+
+    /* create type */
+    err = MPI_Type_create_struct(COUNT, blens, displ, types, &datatype);
+    check_err(MPI_Type_create_struct);
+    err = MPI_Type_commit(&datatype);
+    check_err(MPI_Type_commit);
+
+    err = MPI_Type_size(datatype, &dt_size);
+    check_err(MPI_Type_size);
+    if (dt_size != size_exp) {
+        errs++;
+        if (verbose) fprintf(stderr, "unexpected type size\n");
+    }
+
+
+    /* send the type to ourselves to make sure that the type describes data correctly */
+    for (i = 0; i < (N*M) ; ++i)
+        seq_array[i] = i + 1; /* source values 1..(N*M) */
+    err = MPI_Isend(&seq_array[0], dt_size/sizeof(int), MPI_INT, 0, 42, MPI_COMM_SELF, &req[0]);
+    check_err(MPI_Isend);
+    err = MPI_Irecv(&array[0][0], 1, datatype, 0, 42, MPI_COMM_SELF, &req[1]);
+    check_err(MPI_Irecv);
+    err = MPI_Waitall(2, req, MPI_STATUSES_IGNORE);
+    check_err(MPI_Waitall);
+
+    /* check against expected */
+    for (i = 0; i < N; ++i) {
+        for (j = 0; j < M; ++j) {
+            if (array[i][j] != expected[i][j]) {
+                errs++;
+                if (verbose)
+                    fprintf(stderr, "array[%d][%d]=%d, should be %d\n", i, j, array[i][j], expected[i][j]);
+            }
+        }
+    }
+
+    err = MPI_Type_free(&datatype);
+    check_err(MPI_Type_free);
+    err = MPI_Type_free(&types[0]);
+    check_err(MPI_Type_free);
+    err = MPI_Type_free(&types[1]);
+    check_err(MPI_Type_free);
+
+    return errs;
+#undef M
+#undef N
+#undef COUNT
+}
+
+/*   create a datatype for a 1D int array subsection
+
+     - a subsection of the first dimension is defined via astart, aend
+     - indexes are assumed to start with 0, that means:
+       - 0 <= astart <= aend < aext
+     - astart and aend are inclusive
+
+     example:
+
+     aext = 8, astart=2, aend=4 would produce:
+
+     index     | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
+     1D array   ###############################
+     datatype   LB      ###########             UB
+ */
+int build_array_section_type(MPI_Aint aext, MPI_Aint astart, MPI_Aint aend, MPI_Datatype *datatype)
+{
+#define COUNT (3)
+    int err, errs = 0;
+    MPI_Aint displ[COUNT];
+    int blens[COUNT];
+    MPI_Datatype types[COUNT];
+
+    *datatype = MPI_DATATYPE_NULL;
+
+    /* lower bound marker */
+    types[0] = MPI_LB;
+    displ[0] = 0;
+    blens[0] = 1;
+
+    /* subsection starting at astart */
+    displ[1] = astart * sizeof(int);
+    types[1] = MPI_INT;
+    blens[1] = aend - astart + 1;
+
+    /* upper bound marker */
+    types[2] = MPI_UB;
+    displ[2] = aext * sizeof(int);
+    blens[2] = 1;
+
+    err = MPI_Type_create_struct(COUNT, blens, displ, types, datatype);
+    if (err != MPI_SUCCESS) {
+        errs++;
+        if (verbose) {
+            fprintf(stderr, "MPI_Type_create_struct failed, err=%d\n", err);
+        }
+    }
+
+    return errs;
+#undef COUNT
+}
+
+/* start_idx is the "zero" point for the unpack */
+static int pack_and_check_expected(MPI_Datatype type, const char *name,
+                                   int start_idx, int size,
+                                   int *array, int *expected)
+{
+    int i;
+    int err, errs = 0;
+    int pack_size = -1;
+    int *pack_buf = NULL;
+    int pos;
+    int type_size = -1;
+    int sendbuf[8] = {0,1,2,3,4,5,6,7};
+
+    err = MPI_Type_size(type, &type_size);
+    check_err(MPI_Type_size);
+    assert(sizeof(sendbuf) >= type_size);
+
+    err = MPI_Pack_size(type_size/sizeof(int), MPI_INT, MPI_COMM_SELF, &pack_size);
+    check_err(MPI_Pack_size);
+    pack_buf = malloc(pack_size);
+    assert(pack_buf);
+
+    pos = 0;
+    err = MPI_Pack(&sendbuf[0], type_size/sizeof(int), MPI_INT, pack_buf, pack_size, &pos, MPI_COMM_SELF);
+    check_err(MPI_Pack);
+    pos = 0;
+    err = MPI_Unpack(pack_buf, pack_size, &pos, &array[start_idx], 1, type, MPI_COMM_SELF);
+    check_err(MPI_Unpack);
+    free(pack_buf);
+
+    /* check against expected */
+    for (i = 0; i < size; ++i) {
+        if (array[i] != expected[i]) {
+            errs++;
+            if (verbose)
+                fprintf(stderr, "%s: array[%d]=%d, should be %d\n", name, i, array[i], expected[i]);
+        }
+    }
+
+    return errs;
+}
+
+/* regression for tt#1030, checks for bad offset math in the
+ * blockindexed and indexed dataloop flattening code */
+int flatten_test(void)
+{
+    int err, errs = 0;
+#define ARR_SIZE (9)
+    /* real indices              0  1  2  3  4  5  6  7  8
+     * indices w/ &array[3]     -3 -2 -1  0  1  2  3  4  5 */
+    int array[ARR_SIZE]      = {-1,-1,-1,-1,-1,-1,-1,-1,-1};
+    int expected[ARR_SIZE]   = {-1, 0, 1,-1, 2,-1, 3,-1, 4};
+    MPI_Datatype idx_type = MPI_DATATYPE_NULL;
+    MPI_Datatype blkidx_type = MPI_DATATYPE_NULL;
+    MPI_Datatype combo = MPI_DATATYPE_NULL;
+#define COUNT (2)
+    int displ[COUNT];
+    MPI_Aint adispl[COUNT];
+    int blens[COUNT];
+    MPI_Datatype types[COUNT];
+
+    /* indexed type layout:
+     * XX_X
+     * 2101  <-- pos (left of 0 is neg)
+     *
+     * different blens to prevent optimization into a blockindexed
+     */
+    blens[0] = 2;
+    displ[0] = -2; /* elements, puts byte after block end at 0 */
+    blens[1] = 1;
+    displ[1] = 1; /*elements*/
+
+    err = MPI_Type_indexed(COUNT, blens, displ, MPI_INT, &idx_type);
+    check_err(MPI_Type_indexed);
+    err = MPI_Type_commit(&idx_type);
+    check_err(MPI_Type_commit);
+
+    /* indexed type layout:
+     * _X_X
+     * 2101  <-- pos (left of 0 is neg)
+     */
+    displ[0] = -1;
+    displ[1] = 1;
+    err = MPI_Type_create_indexed_block(COUNT, 1, displ, MPI_INT, &blkidx_type);
+    check_err(MPI_Type_indexed_block);
+    err = MPI_Type_commit(&blkidx_type);
+    check_err(MPI_Type_commit);
+
+    /* struct type layout:
+     * II_I_B_B  (I=idx_type, B=blkidx_type)
+     * 21012345  <-- pos (left of 0 is neg)
+     */
+    blens[0]  = 1;
+    adispl[0] = 0; /*bytes*/
+    types[0]  = idx_type;
+
+    blens[1]  = 1;
+    adispl[1] = 4 * sizeof(int); /* bytes */
+    types[1]  = blkidx_type;
+
+    /* must be a struct in order to trigger flattening code */
+    err = MPI_Type_create_struct(COUNT, blens, adispl, types, &combo);
+    check_err(MPI_Type_indexed);
+    err = MPI_Type_commit(&combo);
+    check_err(MPI_Type_commit);
+
+    /* pack/unpack with &array[3] */
+    errs += pack_and_check_expected(combo, "combo", 3, ARR_SIZE, array, expected);
+
+    MPI_Type_free(&combo);
+    MPI_Type_free(&idx_type);
+    MPI_Type_free(&blkidx_type);
+
+    return errs;
+#undef COUNT
+}
+#undef check_err
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/zero-blklen-vector.c b/teshsuite/smpi/mpich3-test/datatype/zero-blklen-vector.c
new file mode 100644 (file)
index 0000000..ce51f19
--- /dev/null
@@ -0,0 +1,38 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */     
+
+#include <mpi.h>
+#include <stdio.h>
+int main(int argc, char* argv[])
+{
+       int iam, np;
+       int m = 2, n = 0, lda = 1;
+       double A[2];
+       MPI_Comm comm = MPI_COMM_WORLD;
+       MPI_Datatype type = MPI_DOUBLE, vtype;
+
+       MPI_Init(&argc,&argv);
+       MPI_Comm_size(comm, &np);
+       MPI_Comm_rank(comm, &iam);
+       if (np < 2) {
+               printf( "Should be at least 2 processes for the test\n");
+        } else {
+               MPI_Type_vector(n, m, lda, type, &vtype);
+               MPI_Type_commit(&vtype);
+               A[0] = -1.0-0.1*iam;
+               A[1] = 0.5+0.1*iam;
+               printf("In process %i of %i before Bcast: A = %f,%f\n",
+                      iam, np, A[0], A[1] );
+               MPI_Bcast(A, 1, vtype, 0, comm);
+               printf("In process %i of %i after Bcast: A = %f,%f\n",
+                      iam, np, A[0], A[1]);
+               MPI_Type_free(&vtype);
+       }
+
+       MPI_Finalize();
+   return(0);
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/zeroblks.c b/teshsuite/smpi/mpich3-test/datatype/zeroblks.c
new file mode 100644 (file)
index 0000000..0c5d390
--- /dev/null
@@ -0,0 +1,69 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int position, pack_size, i;
+    int dis[2], blklens[2];
+    MPI_Datatype type;
+    int send_buffer[60];
+    int recv_buffer[60];
+    int pack_buffer[1000];
+
+    MTest_Init( &argc, &argv );
+
+    /* Initialize data in the buffers */
+    for (i=0; i<60; i++) {
+       send_buffer[i] = i;
+       recv_buffer[i] = -1;
+       pack_buffer[i] = -2;
+    }
+
+    /* Create an indexed type with an empty first block */
+    dis[0] = 0;
+    dis[1] = 20;
+
+    blklens[0] = 0;
+    blklens[1] = 40;
+
+    MPI_Type_indexed(2, blklens, dis, MPI_INT, &type);
+    MPI_Type_commit(&type);
+
+    position = 0;
+    MPI_Pack( send_buffer, 1, type, pack_buffer, sizeof(pack_buffer), 
+             &position, MPI_COMM_WORLD );
+    pack_size = position;
+    position = 0;
+    MPI_Unpack( pack_buffer, pack_size, &position, recv_buffer, 1, type, 
+               MPI_COMM_WORLD );
+
+    /* Check that the last 40 entries of the recv_buffer have the corresponding
+       elements from the send buffer */
+    for (i=0; i<20; i++) {
+       if (recv_buffer[i] != -1) {
+           errs++;
+           fprintf( stderr, "recv_buffer[%d] = %d, should = -1\n", i, 
+                    recv_buffer[i] );
+       }
+    }
+    for (i=20; i<60; i++) {
+       if (recv_buffer[i] != i) {
+           errs++;
+           fprintf( stderr, "recv_buffer[%d] = %d, should = %d\n", i, 
+                    recv_buffer[i], i );
+       }
+    }
+    MPI_Type_free( &type );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+
+}
diff --git a/teshsuite/smpi/mpich3-test/datatype/zeroparms.c b/teshsuite/smpi/mpich3-test/datatype/zeroparms.c
new file mode 100644 (file)
index 0000000..2ad786f
--- /dev/null
@@ -0,0 +1,38 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+#include <stdio.h>
+
+int main( int argc, char *argv[] )
+{
+    MPI_Datatype newtype;
+    int b[1], d[1];
+
+    MPI_Init( &argc, &argv );
+
+    /* create a legitimate type to see that we don't 
+     * emit spurious errors.
+     */
+    MPI_Type_hvector( 0, 1, 10, MPI_DOUBLE, &newtype );
+    MPI_Type_commit( &newtype );
+    MPI_Type_free( &newtype );
+
+    MPI_Type_indexed( 0, b, d, MPI_DOUBLE, &newtype );
+    MPI_Type_commit( &newtype );
+
+    MPI_Sendrecv( b, 1, newtype, 0, 0, 
+                 d, 0, newtype, 0, 0, 
+                 MPI_COMM_WORLD, MPI_STATUS_IGNORE );
+
+    printf( " No Errors\n" );
+
+    MPI_Type_free( &newtype );
+    
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
new file mode 100644 (file)
index 0000000..46e9d88
--- /dev/null
@@ -0,0 +1,67 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../include/")
+
+  add_executable(attrmpi1f attrmpi1f.f ../util/mtestf.f)
+  add_executable(baseattr2f baseattr2f.f ../util/mtestf.f)
+  add_executable(baseattrf baseattrf.f ../util/mtestf.f)
+  add_executable(commattr2f commattr2f.f ../util/mtestf.f)
+  add_executable(commattr3f commattr3f.f ../util/mtestf.f)
+  add_executable(commattrf commattrf.f  ../util/mtestf.f)
+  add_executable(typeattr2f typeattr2f.f  ../util/mtestf.f)
+  add_executable(typeattr3f typeattr3f.f  ../util/mtestf.f)
+  add_executable(typeattrf typeattrf.f  ../util/mtestf.f)
+
+  target_link_libraries(attrmpi1f  simgrid)
+  target_link_libraries(baseattr2f  simgrid)
+  target_link_libraries(baseattrf  simgrid)
+  target_link_libraries(commattr2f  simgrid)
+  target_link_libraries(commattr3f  simgrid)
+  target_link_libraries(commattrf  simgrid)
+  target_link_libraries(typeattr2f  simgrid)
+  target_link_libraries(typeattr3f  simgrid)
+  target_link_libraries(typeattrf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/attraints.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/attrmpi1f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseattr2f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseattrf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/commattr2f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/commattr3f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/commattrf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typeattr2f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typeattr3f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typeattrf.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/attraints.h b/teshsuite/smpi/mpich3-test/f77/attr/attraints.h
new file mode 100644 (file)
index 0000000..182b045
--- /dev/null
@@ -0,0 +1,6 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       integer extrastate, valin, valout, val
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/attrmpi1f.f b/teshsuite/smpi/mpich3-test/f77/attr/attrmpi1f.f
new file mode 100644 (file)
index 0000000..44e5b5e
--- /dev/null
@@ -0,0 +1,62 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer value, wsize, wrank, extra, mykey
+      integer rvalue, svalue, ncomm
+      logical flag
+      integer ierr, errs
+C
+      errs = 0
+      call mtest_init( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, wsize, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
+C
+C     Simple attribute put and get
+C
+      call mpi_keyval_create( MPI_NULL_COPY_FN, MPI_NULL_DELETE_FN,
+     $     mykey, extra,ierr ) 
+      call mpi_attr_get( MPI_COMM_WORLD, mykey, value, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *,
+     $       "Did not get flag==.false. for attribute that was not set"
+      endif
+C
+      value = 1234567
+      svalue = value
+      call mpi_attr_put( MPI_COMM_WORLD, mykey, value, ierr )
+      value = -9876543
+      call mpi_attr_get( MPI_COMM_WORLD, mykey, rvalue, flag, ierr )
+      if (.not. flag) then
+         errs = errs + 1
+         print *, "Did not find attribute after set"
+      else
+         if (rvalue .ne. svalue) then
+            errs = errs + 1
+            print *, "Attribute value ", rvalue, " should be ", svalue
+         endif
+      endif
+      value = -123456
+      svalue = value
+      call mpi_attr_put( MPI_COMM_WORLD, mykey, value, ierr )
+      value = 987654
+      call mpi_attr_get( MPI_COMM_WORLD, mykey, rvalue, flag, ierr )
+      if (.not. flag) then
+         errs = errs + 1
+         print *, "Did not find attribute after set (neg)"
+      else
+         if (rvalue .ne. svalue) then
+            errs = errs + 1
+            print *, "Neg Attribute value ", rvalue," should be ",svalue
+         endif
+      endif
+C      
+      call mpi_keyval_free( mykey, ierr )
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/baseattr2f.f b/teshsuite/smpi/mpich3-test/f77/attr/baseattr2f.f
new file mode 100644 (file)
index 0000000..59d69bc
--- /dev/null
@@ -0,0 +1,113 @@
+C -*- Mode: Fortran; -*-
+C
+C
+C (C) 2001 by Argonne National Laboratory.
+C     See COPYRIGHT in top-level directory.
+C
+        program main
+        implicit none
+        include 'mpif.h'
+        integer ierr, errs
+        logical flag
+        integer value, commsize, commrank
+
+        errs = 0
+        call mpi_init( ierr )
+
+        call mpi_comm_size( MPI_COMM_WORLD, commsize, ierr )
+        call mpi_comm_rank( MPI_COMM_WORLD, commrank, ierr )
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_TAG_UB, value, flag, ierr
+     $       ) 
+        if (.not. flag) then
+           errs = errs + 1
+           print *, "Could not get TAG_UB"
+        else
+           if (value .lt. 32767) then
+              errs = errs + 1
+              print *, "Got too-small value (", value, ") for TAG_UB" 
+           endif
+        endif
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_HOST, value, flag, ierr )
+        if (.not. flag) then
+           errs = errs + 1
+           print *, "Could not get HOST"
+        else 
+           if ((value .lt. 0 .or. value .ge. commsize) .and. value .ne.
+     $          MPI_PROC_NULL) then 
+              errs = errs + 1
+              print *, "Got invalid value ", value, " for HOST"
+           endif
+        endif   
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_IO, value, flag, ierr )
+        if (.not. flag) then
+           errs = errs + 1
+           print *, "Could not get IO"
+        else
+           if ((value .lt. 0 .or. value .ge. commsize) .and. value .ne.
+     $          MPI_ANY_SOURCE .and. value .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, "Got invalid value ", value, " for IO"
+           endif
+        endif
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_WTIME_IS_GLOBAL, value,
+     $       flag, ierr )
+        if (flag) then
+C          Wtime need not be set
+           if (value .lt.  0 .or. value .gt. 1) then 
+              errs = errs + 1
+              print *, "Invalid value for WTIME_IS_GLOBAL (got ", value,
+     $             ")" 
+           endif
+        endif
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_APPNUM, value, flag, ierr
+     $       )
+C     appnum need not be set
+        if (flag) then
+           if (value .lt. 0) then
+              errs = errs + 1
+              print *, "MPI_APPNUM is defined as ", value,
+     $             " but must be nonnegative" 
+           endif
+        endif
+
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, value,
+     $       flag, ierr )
+C     MPI_UNIVERSE_SIZE need not be set
+        if (flag) then
+           if (value .lt. commsize) then
+              errs = errs + 1
+              print *, "MPI_UNIVERSE_SIZE = ", value,
+     $             ", less than comm world (", commsize, ")"
+           endif
+        endif
+    
+        call mpi_attr_get( MPI_COMM_WORLD, MPI_LASTUSEDCODE, value, flag
+     $       , ierr )
+C Last used code must be defined and >= MPI_ERR_LASTCODE
+        if (flag) then
+           if (value .lt. MPI_ERR_LASTCODE) then
+            errs = errs + 1
+            print *, "MPI_LASTUSEDCODE points to an integer (",
+     $           MPI_ERR_LASTCODE, ") smaller than MPI_ERR_LASTCODE (",
+     $           value, ")"
+            endif
+         else 
+            errs = errs + 1
+            print *, "MPI_LASTUSECODE is not defined"
+         endif
+
+C     Check for errors
+      if (errs .eq. 0) then
+         print *, " No Errors"
+      else
+         print *, " Found ", errs, " errors"
+      endif
+
+      call MPI_Finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/baseattrf.f b/teshsuite/smpi/mpich3-test/f77/attr/baseattrf.f
new file mode 100644 (file)
index 0000000..36f520d
--- /dev/null
@@ -0,0 +1,63 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer value, commsize
+      logical flag
+      integer ierr, errs
+
+      errs = 0
+      call mpi_init( ierr )
+
+      call mpi_comm_size( MPI_COMM_WORLD, commsize, ierr )
+      call mpi_attr_get( MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, value, flag
+     $     , ierr)
+      ! MPI_UNIVERSE_SIZE need not be set
+      if (flag) then
+         if (value .lt. commsize) then
+            print *, "MPI_UNIVERSE_SIZE is ", value, " less than world "
+     $           , commsize
+            errs = errs + 1
+         endif
+      endif
+
+      call mpi_attr_get( MPI_COMM_WORLD, MPI_LASTUSEDCODE, value, flag,
+     $     ierr )
+      ! Last used code must be defined and >= MPI_ERR_LASTCODE 
+      if (flag) then
+         if (value .lt. MPI_ERR_LASTCODE) then
+            errs = errs + 1
+            print *, "MPI_LASTUSEDCODE points to an integer
+     $           (", value, ") smaller than MPI_ERR_LASTCODE (",
+     $           MPI_ERR_LASTCODE, ")"
+         endif
+      else 
+         errs = errs + 1
+         print *, "MPI_LASTUSECODE is not defined"
+      endif
+
+      call mpi_attr_get( MPI_COMM_WORLD, MPI_APPNUM, value, flag, ierr )
+      ! appnum need not be set
+      if (flag) then
+         if (value .lt. 0) then
+            errs = errs + 1
+            print *, "MPI_APPNUM is defined as ", value,
+     $           " but must be nonnegative"
+         endif
+      endif
+
+      ! Check for errors
+      if (errs .eq. 0) then
+         print *, " No Errors"
+      else
+         print *, " Found ", errs, " errors"
+      endif
+
+      call MPI_Finalize( ierr )
+
+      end
+
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/commattr2f.f b/teshsuite/smpi/mpich3-test/f77/attr/commattr2f.f
new file mode 100644 (file)
index 0000000..92d47f9
--- /dev/null
@@ -0,0 +1,103 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C  This is a modified version of commattrf.f that uses two of the
+C  default functions
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer comm1, comm2
+      integer keyval
+      logical flag
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      call mtest_init( ierr )
+      call mpi_comm_dup( MPI_COMM_WORLD, comm1, ierr )
+C 
+      extrastate = 1001
+      call mpi_comm_create_keyval( MPI_COMM_DUP_FN, 
+     &                             MPI_COMM_NULL_DELETE_FN, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+      valin = 2003
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 2003) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2003)', valout, 
+     &            ' from attr'
+      endif
+      
+      valin = 2001
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 2001) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2001)', valout, 
+     &            ' from attr'
+      endif
+      
+C
+C Test the copy function
+      valin = 5001
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      call mpi_comm_dup( comm1, comm2, ierr )
+      flag = .false.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in comm ', valout
+      endif
+      flag = .false.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in comm2 ', valout
+      endif
+C Test the delete function      
+      call mpi_comm_free( comm2, ierr )
+C
+C Test the attr delete function
+      call mpi_comm_dup( comm1, comm2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_comm_set_attr( comm2, keyval, valin, ierr )
+      call mpi_comm_delete_attr( comm2, keyval, ierr )
+      flag = .true.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_comm_free( comm2, ierr )
+C
+      ierr = -1
+      call mpi_comm_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+      call mpi_comm_free( comm1, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/commattr3f.f b/teshsuite/smpi/mpich3-test/f77/attr/commattr3f.f
new file mode 100644 (file)
index 0000000..cfa5ffb
--- /dev/null
@@ -0,0 +1,84 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2004 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C  This tests the null copy function (returns flag false; thus the
+C  attribute should not be propagated to a dup'ed communicator
+C  This is must like the test in commattr2f
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer comm1, comm2
+      integer keyval
+      logical flag
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      call mtest_init( ierr )
+      call mpi_comm_dup( MPI_COMM_WORLD, comm1, ierr )
+C 
+      extrastate = 1001
+      call mpi_comm_create_keyval( MPI_COMM_NULL_COPY_FN, 
+     &                             MPI_COMM_NULL_DELETE_FN, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+C Test the null copy function
+      valin = 5001
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      call mpi_comm_dup( comm1, comm2, ierr )
+C Because we set NULL_COPY_FN, the attribute should not 
+C appear on the dup'ed communicator
+      flag = .false.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in comm ', valout
+      endif
+      flag = .true.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Attribute incorrectly present on dup communicator'
+      endif
+C Test the delete function      
+      call mpi_comm_free( comm2, ierr )
+C
+C Test the attr delete function
+      call mpi_comm_dup( comm1, comm2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_comm_set_attr( comm2, keyval, valin, ierr )
+      call mpi_comm_delete_attr( comm2, keyval, ierr )
+      flag = .true.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_comm_free( comm2, ierr )
+C
+      ierr = -1
+      call mpi_comm_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+      call mpi_comm_free( comm1, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/commattrf.f b/teshsuite/smpi/mpich3-test/f77/attr/commattrf.f
new file mode 100644 (file)
index 0000000..491ec88
--- /dev/null
@@ -0,0 +1,154 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer comm1, comm2
+      integer curcount, keyval
+      logical flag
+      external mycopyfn, mydelfn
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      callcount = 0
+      delcount  = 0
+      call mtest_init( ierr )
+      call mpi_comm_dup( MPI_COMM_WORLD, comm1, ierr )
+C 
+      extrastate = 1001
+      call mpi_comm_create_keyval( mycopyfn, mydelfn, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+      valin = 2003
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 2003) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2003)', valout, 
+     &            ' from attr'
+      endif
+      
+      valin = 2001
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 2001) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2001)', valout, 
+     &            ' from attr'
+      endif
+      
+C
+C Test the copy function
+      valin = 5001
+      call mpi_comm_set_attr( comm1, keyval, valin, ierr )
+      call mpi_comm_dup( comm1, comm2, ierr )
+      flag = .false.
+      call mpi_comm_get_attr( comm1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in comm ', valout
+      endif
+      flag = .false.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (valout .ne. 5003) then
+         errs = errs + 1
+         print *, 'Unexpected output value in comm2 ', valout
+      endif
+C Test the delete function      
+      curcount = delcount
+      call mpi_comm_free( comm2, ierr )
+      if (delcount .ne. curcount + 1) then
+         errs = errs + 1
+         print *, ' did not get expected value of delcount ', 
+     &          delcount, curcount + 1
+      endif
+C
+C Test the attr delete function
+      call mpi_comm_dup( comm1, comm2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_comm_set_attr( comm2, keyval, valin, ierr )
+      delcount   = 0
+      call mpi_comm_delete_attr( comm2, keyval, ierr )
+      if (delcount .ne. 1) then
+         errs = errs + 1
+         print *, ' Delete_attr did not call delete function'
+      endif
+      flag = .true.
+      call mpi_comm_get_attr( comm2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_comm_free( comm2, ierr )
+C
+      ierr = -1
+      call mpi_comm_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+      call mpi_comm_free( comm1, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+C
+      subroutine mycopyfn( oldcomm, keyval, extrastate, valin, valout,
+     &                     flag, ierr )
+      implicit none
+      include 'mpif.h'
+      integer oldcomm, keyval, ierr
+      include 'attraints.h'
+      logical flag
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+C increment the attribute by 2
+      valout = valin + 2
+      callcount = callcount + 1
+      if (extrastate .eq. 1001) then
+         flag = .true.
+         ierr = MPI_SUCCESS
+      else
+         print *, ' Unexpected value of extrastate = ', extrastate
+         flag = .false.
+         ierr = MPI_ERR_OTHER
+      endif
+      end
+C
+      subroutine mydelfn( comm, keyval, val, extrastate, ierr )
+      implicit none
+      include 'mpif.h'
+      integer comm, keyval, ierr
+      include 'attraints.h'
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+      delcount = delcount + 1
+      if (extrastate .eq. 1001) then
+         ierr = MPI_SUCCESS
+      else
+         print *, ' Unexpected value of extrastate = ', extrastate
+         ierr = MPI_ERR_OTHER
+      endif
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/testlist b/teshsuite/smpi/mpich3-test/f77/attr/testlist
new file mode 100644 (file)
index 0000000..27d9d59
--- /dev/null
@@ -0,0 +1,9 @@
+attrmpi1f 1
+baseattrf 1
+baseattr2f 1
+commattrf 1
+commattr2f 1
+commattr3f 1
+typeattrf 1
+typeattr2f 1
+typeattr3f 1
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/typeattr2f.f b/teshsuite/smpi/mpich3-test/f77/attr/typeattr2f.f
new file mode 100644 (file)
index 0000000..5fbbdbb
--- /dev/null
@@ -0,0 +1,102 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C  This is a modified version of typeattrf.f that uses two of the
+C  default functions
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer type1, type2
+      integer keyval
+      logical flag
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      call mtest_init( ierr )
+      type1 = MPI_INTEGER
+C 
+      extrastate = 1001
+      call mpi_type_create_keyval( MPI_TYPE_DUP_FN, 
+     &                             MPI_TYPE_NULL_DELETE_FN, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+      valin = 2003
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 2003) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2003)', valout, 
+     &            ' from attr'
+      endif
+      
+      valin = 2001
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 2001) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2001)', valout, 
+     &            ' from attr'
+      endif
+      
+C
+C Test the copy function
+      valin = 5001
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      call mpi_type_dup( type1, type2, ierr )
+      flag = .false.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in type ', valout
+      endif
+      flag = .false.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in type2 ', valout
+      endif
+C Test the delete function      
+      call mpi_type_free( type2, ierr )
+C
+C Test the attr delete function
+      call mpi_type_dup( type1, type2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_type_set_attr( type2, keyval, valin, ierr )
+      call mpi_type_delete_attr( type2, keyval, ierr )
+      flag = .true.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_type_free( type2, ierr )
+C
+      ierr = -1
+      call mpi_type_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/typeattr3f.f b/teshsuite/smpi/mpich3-test/f77/attr/typeattr3f.f
new file mode 100644 (file)
index 0000000..5d30e70
--- /dev/null
@@ -0,0 +1,83 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2004 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C  This tests the null copy function (returns flag false; thus the
+C  attribute should not be propagated to a dup'ed communicator
+C  This is much like the test in typeattr2f
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer type1, type2
+      integer keyval
+      logical flag
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      call mtest_init( ierr )
+      type1 = MPI_INTEGER
+C 
+      extrastate = 1001
+      call mpi_type_create_keyval( MPI_TYPE_NULL_COPY_FN, 
+     &                             MPI_TYPE_NULL_DELETE_FN, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+C Test the null copy function
+      valin = 5001
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      call mpi_type_dup( type1, type2, ierr )
+C Because we set NULL_COPY_FN, the attribute should not 
+C appear on the dup'ed communicator
+      flag = .false.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in type ', valout
+      endif
+      flag = .true.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Attribute incorrectly present on dup datatype'
+      endif
+C Test the delete function      
+      call mpi_type_free( type2, ierr )
+C
+C Test the attr delete function
+      call mpi_type_dup( type1, type2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_type_set_attr( type2, keyval, valin, ierr )
+      call mpi_type_delete_attr( type2, keyval, ierr )
+      flag = .true.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_type_free( type2, ierr )
+C
+      ierr = -1
+      call mpi_type_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/attr/typeattrf.f b/teshsuite/smpi/mpich3-test/f77/attr/typeattrf.f
new file mode 100644 (file)
index 0000000..78aaa35
--- /dev/null
@@ -0,0 +1,155 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      include 'attraints.h'
+      integer comm
+      integer type1, type2
+      integer curcount, keyval
+      logical flag
+      external mycopyfn, mydelfn
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+C
+C The only difference between the MPI-2 and MPI-1 attribute caching
+C routines in Fortran is that the take an address-sized integer
+C instead of a simple integer.  These still are not pointers,
+C so the values are still just integers. 
+C
+      errs      = 0
+      callcount = 0
+      delcount  = 0
+      call mtest_init( ierr )
+C 
+C Attach an attribute to a predefined object
+      type1 = MPI_INTEGER
+      extrastate = 1001
+      call mpi_type_create_keyval( mycopyfn, mydelfn, keyval, 
+     &                             extrastate, ierr )
+      flag = .true.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' get attr returned true when no attr set'
+      endif
+
+      valin = 2003
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 2003) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2003)', valout, 
+     &            ' from attr'
+      endif
+      
+      valin = 2001
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      flag = .false.
+      valout = -1
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 2001) then
+         errs = errs + 1
+         print *, 'Unexpected value (should be 2001)', valout, 
+     &            ' from attr'
+      endif
+      
+C
+C Test the copy function
+      valin = 5001
+      call mpi_type_set_attr( type1, keyval, valin, ierr )
+      call mpi_type_dup( type1, type2, ierr )
+      flag = .false.
+      call mpi_type_get_attr( type1, keyval, valout, flag, ierr )
+      if (valout .ne. 5001) then
+         errs = errs + 1
+         print *, 'Unexpected output value in type ', valout
+      endif
+      flag = .false.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (valout .ne. 5003) then
+         errs = errs + 1
+         print *, 'Unexpected output value in type2 ', valout
+      endif
+C Test the delete function      
+      curcount = delcount
+      call mpi_type_free( type2, ierr )
+      if (delcount .ne. curcount + 1) then
+         errs = errs + 1
+         print *, ' did not get expected value of delcount ', 
+     &          delcount, curcount + 1
+      endif
+C
+C Test the attr delete function
+      call mpi_type_dup( type1, type2, ierr )
+      valin      = 6001
+      extrastate = 1001
+      call mpi_type_set_attr( type2, keyval, valin, ierr )
+      delcount   = 0
+      call mpi_type_delete_attr( type2, keyval, ierr )
+      if (delcount .ne. 1) then
+         errs = errs + 1
+         print *, ' Delete_attr did not call delete function'
+      endif
+      flag = .true.
+      call mpi_type_get_attr( type2, keyval, valout, flag, ierr )
+      if (flag) then
+         errs = errs + 1
+         print *, ' Delete_attr did not delete attribute'
+      endif
+      call mpi_type_free( type2, ierr )
+
+      ierr = -1
+      call mpi_type_free_keyval( keyval, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         call mtestprinterror( ierr )
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+C
+      subroutine mycopyfn( oldtype, keyval, extrastate, valin, valout,
+     &                     flag, ierr )
+      implicit none
+      include 'mpif.h'
+      integer oldtype, keyval, ierr
+      include 'attraints.h'
+      logical flag
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+C increment the attribute by 2
+      valout = valin + 2
+      callcount = callcount + 1
+      if (extrastate .eq. 1001) then
+         flag = .true.
+         ierr = MPI_SUCCESS
+      else
+         print *, ' Unexpected value of extrastate = ', extrastate
+         flag = .false.
+         ierr = MPI_ERR_OTHER
+      endif
+      end
+C
+      subroutine mydelfn( type, keyval, val, extrastate, ierr )
+      implicit none
+      include 'mpif.h'
+      integer type, keyval, ierr
+      include 'attraints.h'
+      integer callcount, delcount
+      common /myattr/ callcount, delcount
+      delcount = delcount + 1
+      if (extrastate .eq. 1001) then
+         ierr = MPI_SUCCESS
+      else
+         print *, ' Unexpected value of extrastate = ', extrastate
+         ierr = MPI_ERR_OTHER
+      endif
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e7264dc
--- /dev/null
@@ -0,0 +1,81 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(allredint8f allredint8f.f ../util/mtestf.f)
+  add_executable(allredopttf allredopttf.f ../util/mtestf.f)
+  add_executable(alltoallvf alltoallvf.f ../util/mtestf.f)
+  add_executable(alltoallwf alltoallwf.f ../util/mtestf.f)
+  add_executable(exscanf exscanf.f ../util/mtestf.f)
+  add_executable(inplacef inplacef.f ../util/mtestf.f)
+ # add_executable(nonblockingf nonblockingf.f ../util/mtestf.f)
+ # add_executable(nonblocking_inpf nonblocking_inpf.f ../util/mtestf.f)
+  add_executable(red_scat_blockf red_scat_blockf.f ../util/mtestf.f)
+  add_executable(redscatf redscatf.f ../util/mtestf.f)
+  add_executable(reducelocalf reducelocalf.f ../util/mtestf.f)
+  add_executable(split_typef split_typef.f ../util/mtestf.f)
+  add_executable(uallreducef uallreducef.f ../util/mtestf.f)
+  add_executable(vw_inplacef vw_inplacef.f ../util/mtestf.f)
+
+  target_link_libraries(allredint8f  simgrid)
+  target_link_libraries(allredopttf  simgrid)
+  target_link_libraries(alltoallvf  simgrid)
+  target_link_libraries(alltoallwf  simgrid)
+  target_link_libraries(exscanf  simgrid)
+  target_link_libraries(inplacef  simgrid)
+ # target_link_libraries(nonblockingf  simgrid)
+ # target_link_libraries(nonblocking_inpf  simgrid)
+  target_link_libraries(red_scat_blockf  simgrid)
+  target_link_libraries(redscatf  simgrid)
+  target_link_libraries(reducelocalf  simgrid)
+  target_link_libraries(split_typef  simgrid)
+  target_link_libraries(uallreducef  simgrid)
+  target_link_libraries(vw_inplacef  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allredint8f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/allredopttf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallvf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallwf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/exscanf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/inplacef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/nonblockingf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking_inpf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_blockf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/redscatf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/reducelocalf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/split_typef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/uallreducef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/vw_inplacef.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/allredint8f.f b/teshsuite/smpi/mpich3-test/f77/coll/allredint8f.f
new file mode 100644 (file)
index 0000000..10ece87
--- /dev/null
@@ -0,0 +1,23 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2006 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer*8 inbuf, outbuf
+      integer errs, ierr
+
+      errs = 0
+      
+      call mtest_init( ierr )
+C
+C A simple test of allreduce for the optional integer*8 type
+
+      call mpi_allreduce(inbuf, outbuf, 1, MPI_INTEGER8, MPI_SUM, 
+     &                   MPI_COMM_WORLD, ierr)
+      
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/allredopttf.f b/teshsuite/smpi/mpich3-test/f77/coll/allredopttf.f
new file mode 100644 (file)
index 0000000..1b71c8d
--- /dev/null
@@ -0,0 +1,46 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2007 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer*8 inbuf, outbuf
+      double complex zinbuf, zoutbuf
+      integer wsize
+      integer errs, ierr
+
+      errs = 0
+      
+      call mtest_init( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, wsize, ierr )
+C
+C A simple test of allreduce for the optional integer*8 type
+
+      inbuf = 1
+      outbuf = 0
+      call mpi_allreduce(inbuf, outbuf, 1, MPI_INTEGER8, MPI_SUM, 
+     &                   MPI_COMM_WORLD, ierr)
+      if (outbuf .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with integer*8 = got ", outbuf, 
+     & " but should have ", wsize
+      endif
+      zinbuf = (1,1)
+      zoutbuf = (0,0)
+      call mpi_allreduce(zinbuf, zoutbuf, 1, MPI_DOUBLE_COMPLEX, 
+     &                   MPI_SUM,  MPI_COMM_WORLD, ierr)
+      if (dreal(zoutbuf) .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with double complex = got ", 
+     & outbuf, " but should have ", wsize
+      endif
+      if (dimag(zoutbuf) .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with double complex = got ", 
+     & outbuf, " but should have ", wsize
+      endif
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/alltoallvf.f b/teshsuite/smpi/mpich3-test/f77/coll/alltoallvf.f
new file mode 100644 (file)
index 0000000..0a2831a
--- /dev/null
@@ -0,0 +1,146 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2011 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer ierr, errs
+      integer i, ans, size, rank, color, comm, newcomm
+      integer maxSize, displ
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+
+      errs = 0
+      
+      call mtest_init( ierr )
+
+C Get a comm
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      if (size .gt. maxSize) then
+         call mpi_comm_rank( comm, rank, ierr )
+         color = 1
+         if (rank .lt. maxSize) color = 0
+         call mpi_comm_split( comm, color, rank, newcomm, ierr )
+         call mpi_comm_free( comm, ierr )
+         comm = newcomm
+         call mpi_comm_size( comm, size, ierr )
+      endif
+      call mpi_comm_rank( comm, rank, ierr )
+C      
+      if (size .le. maxSize) then
+C Initialize the data.  Just use this as an all to all
+C Use the same test as alltoallwf.c , except displacements are in units of
+C integers instead of bytes
+         do i=1, size
+            scounts(i) = 1
+            sdispls(i) = (i-1)
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = rank * size + i
+            rcounts(i) = 1
+            rdispls(i) = (i-1)
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+         call mpi_alltoallv( sbuf, scounts, sdispls, stypes,
+     &        rbuf, rcounts, rdispls, rtypes, comm, ierr )     
+C
+C check rbuf(i) = data from the ith location of the ith send buf, or
+C       rbuf(i) = (i-1) * size + i   
+         do i=1, size
+            ans = (i-1) * size + rank + 1
+            if (rbuf(i) .ne. ans) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(i), 
+     &               ' expected ', ans
+            endif
+         enddo
+C
+C     A halo-exchange example - mostly zero counts
+C
+         do i=1, size
+            scounts(i) = 0
+            sdispls(i) = 0
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = -1
+            rcounts(i) = 0
+            rdispls(i) = 0
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+
+C
+C     Note that the arrays are 1-origin
+         displ = 0
+         if (rank .gt. 0) then
+            scounts(1+rank-1) = 1
+            rcounts(1+rank-1) = 1
+            sdispls(1+rank-1) = displ
+            rdispls(1+rank-1) = rank - 1
+            sbuf(1+displ)     = rank
+            displ             = displ + 1
+         endif
+         scounts(1+rank)   = 1
+         rcounts(1+rank)   = 1
+         sdispls(1+rank)   = displ
+         rdispls(1+rank)   = rank
+         sbuf(1+displ)     = rank
+         displ           = displ + 1
+         if (rank .lt. size-1) then
+            scounts(1+rank+1) = 1 
+            rcounts(1+rank+1) = 1
+            sdispls(1+rank+1) = displ
+            rdispls(1+rank+1) = rank+1
+            sbuf(1+displ)     = rank
+            displ             = displ + 1
+         endif
+
+         call mpi_alltoallv( sbuf, scounts, sdispls, stypes,
+     &        rbuf, rcounts, rdispls, rtypes, comm, ierr )
+C
+C   Check the neighbor values are correctly moved
+C
+         if (rank .gt. 0) then
+            if (rbuf(1+rank-1) .ne. rank-1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(',1+rank-1, ') = ', rbuf(1+rank-1),
+     &              'expected ', rank-1
+            endif
+         endif
+         if (rbuf(1+rank) .ne. rank) then
+            errs = errs + 1
+            print *, rank, ' rbuf(', 1+rank, ') = ', rbuf(1+rank),
+     &           'expected ', rank
+         endif
+         if (rank .lt. size-1) then
+            if (rbuf(1+rank+1) .ne. rank+1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', 1+rank+1, ') = ',rbuf(1+rank+1),
+     &              'expected ', rank+1
+            endif
+         endif
+         do i=0,rank-2
+            if (rbuf(1+i) .ne. -1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', 1+i, ') = ', rbuf(1+i), 
+     &              'expected -1'
+            endif
+         enddo
+         do i=rank+2,size-1
+            if (rbuf(1+i) .ne. -1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(1+i), 
+     &              'expected -1'
+            endif
+         enddo
+      endif
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+      
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/alltoallwf.f b/teshsuite/smpi/mpich3-test/f77/coll/alltoallwf.f
new file mode 100644 (file)
index 0000000..7ab0d60
--- /dev/null
@@ -0,0 +1,67 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer ierr, errs
+      integer i, intsize, ans, size, rank, color, comm, newcomm
+      integer maxSize
+      parameter (maxSize=32)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+      errs = 0
+      
+      call mtest_init( ierr )
+
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+
+C Get a comm
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      if (size .gt. maxSize) then
+         call mpi_comm_rank( comm, rank, ierr )
+         color = 1
+         if (rank .lt. maxSize) color = 0
+         call mpi_comm_split( comm, color, rank, newcomm, ierr )
+         call mpi_comm_free( comm, ierr )
+         comm = newcomm
+         call mpi_comm_size( comm, size, ierr )
+      endif
+      call mpi_comm_rank( comm, rank, ierr )
+      
+      if (size .le. maxSize) then
+C Initialize the data.  Just use this as an all to all
+         do i=1, size
+            scounts(i) = 1
+            sdispls(i) = (i-1)*intsize
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = rank * size + i
+            rcounts(i) = 1
+            rdispls(i) = (i-1)*intsize
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+         call mpi_alltoallw( sbuf, scounts, sdispls, stypes,
+     &        rbuf, rcounts, rdispls, rtypes, comm, ierr )     
+C
+C check rbuf(i) = data from the ith location of the ith send buf, or
+C       rbuf(i) = (i-1) * size + i   
+         do i=1, size
+            ans = (i-1) * size + rank + 1
+            if (rbuf(i) .ne. ans) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(i), 
+     &               ' expected ', ans
+            endif
+         enddo
+      endif
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+      
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/exscanf.f b/teshsuite/smpi/mpich3-test/f77/coll/exscanf.f
new file mode 100644 (file)
index 0000000..5e6f64e
--- /dev/null
@@ -0,0 +1,107 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      subroutine uop( cin, cout, count, datatype )
+      implicit none
+      include 'mpif.h'
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+!      if (datatype .ne. MPI_INTEGER) then
+!         write(6,*) 'Invalid datatype passed to user_op()'
+!         return
+!      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer inbuf(2), outbuf(2)
+      integer ans, rank, size, comm
+      integer errs, ierr
+      integer sumop
+      external uop
+
+      errs = 0
+      
+      call mtest_init( ierr )
+C
+C A simple test of exscan
+      comm = MPI_COMM_WORLD
+
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, MPI_SUM, comm, 
+     &                 ierr )
+C this process has the sum of i from 0 to rank-1, which is
+C (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' Expected ', -ans, ' got ', outbuf(1)
+         endif
+      endif
+C
+C Try a user-defined operation 
+C
+      call mpi_op_create( uop, .true., sumop, ierr )
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, sumop, comm, 
+     &                 ierr )
+C this process has the sum of i from 0 to rank-1, which is
+C (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' sumop: Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' sumop: Expected ', -ans, ' got ', outbuf(1)
+         endif
+      endif
+      call mpi_op_free( sumop, ierr )
+      
+C
+C Try a user-defined operation (and don't claim it is commutative)
+C
+      call mpi_op_create( uop, .false., sumop, ierr )
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, sumop, comm, 
+     &                 ierr )
+C this process has the sum of i from 0 to rank-1, which is
+C (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' sumop2: Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' sumop2: Expected ', -ans, ' got ',outbuf(1)
+         endif
+      endif
+      call mpi_op_free( sumop, ierr )
+      
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/inplacef.f b/teshsuite/smpi/mpich3-test/f77/coll/inplacef.f
new file mode 100644 (file)
index 0000000..230cccb
--- /dev/null
@@ -0,0 +1,91 @@
+C -*- Mode: Fortran; -*- 
+C
+C (C) 2005 by Argonne National Laboratory.
+C     See COPYRIGHT in top-level directory.
+C
+C This is a simple test that Fortran support the MPI_IN_PLACE value
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer ierr, errs
+       integer comm, root
+       integer rank, size
+       integer i
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE), rdispls(MAX_SIZE), rcount(MAX_SIZE),
+     $      sbuf(MAX_SIZE) 
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+
+       root = 0
+C Gather with inplace
+       do i=1,size
+          rbuf(i) = - i
+       enddo
+       rbuf(1+root) = root
+       if (rank .eq. root) then
+          call mpi_gather( MPI_IN_PLACE, 1, MPI_INTEGER, rbuf, 1,
+     $         MPI_INTEGER, root, comm, ierr )
+          do i=1,size
+             if (rbuf(i) .ne. i-1) then
+                errs = errs + 1
+                print *, '[',rank,'] rbuf(', i, ') = ', rbuf(i), 
+     $                   ' in gather'  
+             endif
+          enddo
+       else
+          call mpi_gather( rank, 1, MPI_INTEGER, rbuf, 1, MPI_INTEGER,
+     $         root, comm, ierr )
+       endif   
+
+C Gatherv with inplace
+       do i=1,size
+          rbuf(i) = - i
+          rcount(i) = 1
+          rdispls(i) = i-1
+       enddo
+       rbuf(1+root) = root
+       if (rank .eq. root) then
+          call mpi_gatherv( MPI_IN_PLACE, 1, MPI_INTEGER, rbuf, rcount,
+     $         rdispls, MPI_INTEGER, root, comm, ierr )
+          do i=1,size
+             if (rbuf(i) .ne. i-1) then
+                errs = errs + 1
+                print *, '[', rank, '] rbuf(', i, ') = ', rbuf(i), 
+     $                ' in gatherv'
+             endif
+          enddo
+       else
+          call mpi_gatherv( rank, 1, MPI_INTEGER, rbuf, rcount, rdispls,
+     $         MPI_INTEGER, root, comm, ierr )
+       endif   
+
+C Scatter with inplace
+       do i=1,size
+          sbuf(i) = i
+       enddo
+       rbuf(1) = -1
+       if (rank .eq. root) then
+          call mpi_scatter( sbuf, 1, MPI_INTEGER, MPI_IN_PLACE, 1,
+     $         MPI_INTEGER, root, comm, ierr )
+       else
+          call mpi_scatter( sbuf, 1, MPI_INTEGER, rbuf, 1,
+     $         MPI_INTEGER, root, comm, ierr )
+          if (rbuf(1) .ne. rank+1) then
+             errs = errs + 1
+             print *, '[', rank, '] rbuf  = ', rbuf(1),
+     $            ' in scatter' 
+          endif
+       endif   
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/nonblocking_inpf.f b/teshsuite/smpi/mpich3-test/f77/coll/nonblocking_inpf.f
new file mode 100644 (file)
index 0000000..d2c3bbd
--- /dev/null
@@ -0,0 +1,124 @@
+C -*- Mode: Fortran; -*- 
+C
+C (C) 2012 by Argonne National Laboratory.
+C     See COPYRIGHT in top-level directory.
+C
+C A simple test for Fortran support of the MPI_IN_PLACE value in Alltoall[vw].
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer SIZEOFINT
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE)
+       integer rdispls(MAX_SIZE), rcounts(MAX_SIZE), rtypes(MAX_SIZE)
+       integer comm, rank, size, req
+       integer sumval, ierr, errs
+       integer iexpected, igot
+       integer i, j
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+       call mpi_type_size( MPI_INTEGER, SIZEOFINT, ierr )
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+          rbuf(i) = (i-1) * size + rank
+       enddo
+       call mpi_ialltoall( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL,
+     .                      rbuf, 1, MPI_INTEGER, comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+          if (rbuf(i) .ne. (rank*size + i - 1)) then
+             errs = errs + 1
+             print *, '[', rank, ']: IALLTOALL rbuf(', i, ') = ',
+     .             rbuf(i), ', should be', rank * size + i - 1
+          endif
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = i-1 + rank
+           rdispls(i) = (i-1) * (2*size)
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)+j+1) = 100 * rank + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_ialltoallv( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL,
+     .                       rbuf, rcounts, rdispls, MPI_INTEGER,
+     .                       comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, ']: IALLTOALLV got ', igot,
+     .                   ',but expected ', iexpected,
+     .                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = i-1 + rank
+           rdispls(i) = (i-1) * (2*size) * SIZEOFINT
+           rtypes(i)  = MPI_INTEGER
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)/SIZEOFINT+j+1) = 100 * rank
+     .                                        + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_ialltoallw( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL,
+     .                       rbuf, rcounts, rdispls, rtypes,
+     .                       comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)/SIZEOFINT+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, ']: IALLTOALLW got ', igot,
+     .                   ',but expected ', iexpected,
+     .                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i = 1, size
+           rbuf(i) = rank + (i-1)
+       enddo
+       call mpi_ireduce_scatter_block( MPI_IN_PLACE, rbuf, 1,
+     .                                  MPI_INTEGER, MPI_SUM, comm,
+     .                                  req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+
+       sumval = size * rank + ((size-1) * size)/2
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Ireduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']:', 'Got ', rbuf(1), ' but expected ',
+     .              sumval, '.'
+       endif
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f b/teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f
new file mode 100644 (file)
index 0000000..b912acd
--- /dev/null
@@ -0,0 +1,98 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2012 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer NUM_INTS
+      parameter (NUM_INTS=2)
+      integer maxSize
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize)
+      integer types(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+      integer comm, size, rank, req
+      integer ierr, errs
+      integer ii, ans
+
+      errs = 0
+
+      call mtest_init(ierr)
+
+      comm = MPI_COMM_WORLD
+      call MPI_Comm_size(comm, size, ierr)
+      call MPI_Comm_rank(comm, rank, ierr)
+C      
+      do ii = 1, size
+         sbuf(2*ii-1) = ii
+         sbuf(2*ii)   = ii
+         sbuf(2*ii-1) = ii
+         sbuf(2*ii)   = ii
+         scounts(ii)  = NUM_INTS
+         rcounts(ii)  = NUM_INTS
+         sdispls(ii)  = (ii-1) * NUM_INTS
+         rdispls(ii)  = (ii-1) * NUM_INTS
+         types(ii)    = MPI_INTEGER
+      enddo
+
+      call MPI_Ibarrier(comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ibcast(sbuf, NUM_INTS, MPI_INTEGER, 0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Igather(sbuf, NUM_INTS, MPI_INTEGER,
+     .                  rbuf, NUM_INTS, MPI_INTEGER,
+     .                  0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Igatherv(sbuf, NUM_INTS, MPI_INTEGER,
+     .                   rbuf, rcounts, rdispls, MPI_INTEGER,
+     .                   0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoall(sbuf, NUM_INTS, MPI_INTEGER,
+     .                    rbuf, NUM_INTS, MPI_INTEGER,
+     .                    comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoallv(sbuf, scounts, sdispls, MPI_INTEGER,
+     .                     rbuf, rcounts, rdispls, MPI_INTEGER,
+     .                     comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoallw(sbuf, scounts, sdispls, types,
+     .                     rbuf, rcounts, rdispls, types,
+     .                     comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INTEGER,
+     .                  MPI_SUM, 0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iallreduce(sbuf, rbuf, NUM_INTS, MPI_INTEGER,
+     .                     MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce_scatter(sbuf, rbuf, rcounts, MPI_INTEGER,
+     .                          MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce_scatter_block(sbuf, rbuf, NUM_INTS, MPI_INTEGER,
+     .                                MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iscan(sbuf, rbuf, NUM_INTS, MPI_INTEGER,
+     .                MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iexscan(sbuf, rbuf, NUM_INTS, MPI_INTEGER,
+     .                  MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/red_scat_blockf.f b/teshsuite/smpi/mpich3-test/f77/coll/red_scat_blockf.f
new file mode 100644 (file)
index 0000000..831f2fc
--- /dev/null
@@ -0,0 +1,56 @@
+C -*- Mode: Fortran; -*- 
+C
+C (C) 2012 by Argonne National Laboratory.
+C     See COPYRIGHT in top-level directory.
+C
+C A simple test for Fortran support of Reduce_scatter_block
+C with or withoutMPI_IN_PLACE.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer sbuf(MAX_SIZE), rbuf(MAX_SIZE)
+       integer comm, rank, size
+       integer sumval, ierr, errs, i
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+
+       do i = 1, size
+           sbuf(i) = rank + (i-1)
+       enddo
+
+       call MPI_Reduce_scatter_block(sbuf, rbuf, 1, MPI_INTEGER,
+     .                               MPI_SUM, comm, ierr)
+
+       sumval = size * rank + ((size-1) * size)/2
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Reduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']', 'Got ', rbuf(1), ' but expected ',
+     .              sumval, '.'
+       endif
+
+C Try MPI_IN_PLACE
+       do i = 1, size
+           rbuf(i) = rank + (i-1)
+       enddo
+       call MPI_Reduce_scatter_block(MPI_IN_PLACE, rbuf, 1, MPI_INTEGER,
+     .                               MPI_SUM, comm, ierr)
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Reduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']', 'Got ', rbuf(1), ' but expected ',
+     .              sumval, '.'
+       endif
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f b/teshsuite/smpi/mpich3-test/f77/coll/redscatf.f
new file mode 100644 (file)
index 0000000..b19b1e7
--- /dev/null
@@ -0,0 +1,85 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2011 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      subroutine uop( cin, cout, count, datatype )
+      implicit none
+      include 'mpif.h'
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+!      if (datatype .ne. MPI_INTEGER) then
+!         write(6,*) 'Invalid datatype ',datatype,' passed to user_op()'
+!         return
+!      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+C
+C Test of reduce scatter.
+C
+C Each processor contributes its rank + the index to the reduction, 
+C then receives the ith sum
+C
+C Can be called with any number of processors.
+C
+
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr, toterr
+      integer maxsize
+      parameter (maxsize=1024)
+      integer sendbuf(maxsize), recvbuf, recvcounts(maxsize)
+      integer size, rank, i, sumval
+      integer comm, sumop
+      external uop
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      comm = MPI_COMM_WORLD
+
+      call mpi_comm_size( comm, size, ierr )
+      call mpi_comm_rank( comm, rank, ierr )
+
+      if (size .gt. maxsize) then
+      endif
+      do i=1, size
+         sendbuf(i) = rank + i - 1
+         recvcounts(i) = 1
+      enddo
+
+      call mpi_reduce_scatter( sendbuf, recvbuf, recvcounts, 
+     &     MPI_INTEGER, MPI_SUM, comm, ierr )
+
+      sumval = size * rank + ((size - 1) * size)/2
+C recvbuf should be size * (rank + i) 
+      if (recvbuf .ne. sumval) then
+         errs = errs + 1
+         print *, "Did not get expected value for reduce scatter"
+         print *, rank, " Got ", recvbuf, " expected ", sumval
+      endif
+
+      call mpi_op_create( uop, .true., sumop, ierr )
+      call mpi_reduce_scatter( sendbuf, recvbuf, recvcounts, 
+     &     MPI_INTEGER, sumop, comm, ierr )
+
+      sumval = size * rank + ((size - 1) * size)/2
+C recvbuf should be size * (rank + i) 
+      if (recvbuf .ne. sumval) then
+         errs = errs + 1
+         print *, "sumop: Did not get expected value for reduce scatter"
+         print *, rank, " Got ", recvbuf, " expected ", sumval
+      endif
+      call mpi_op_free( sumop, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/reducelocalf.f b/teshsuite/smpi/mpich3-test/f77/coll/reducelocalf.f
new file mode 100644 (file)
index 0000000..6037308
--- /dev/null
@@ -0,0 +1,97 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2009 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C
+C Test Fortran MPI_Reduce_local with MPI_OP_SUM and with user-defined operation.
+C
+      subroutine user_op( invec, outvec, count, datatype )
+      implicit none
+      include 'mpif.h'
+      integer invec(*), outvec(*)
+      integer count, datatype
+      integer ii
+
+      if (datatype .ne. MPI_INTEGER) then
+         write(6,*) 'Invalid datatype passed to user_op()'
+         return
+      endif
+      
+      do ii=1, count
+         outvec(ii) = invec(ii) * 2 + outvec(ii)
+      enddo
+
+      end
+
+      program main
+      implicit none
+      include 'mpif.h'
+      integer max_buf_size
+      parameter (max_buf_size=65000)
+      integer vin(max_buf_size), vout(max_buf_size)
+      external user_op
+      integer ierr, errs
+      integer count, myop
+      integer ii
+      
+      errs = 0
+
+      call mtest_init(ierr)
+
+      count = 0
+      do while (count .le. max_buf_size )
+         do ii = 1,count
+            vin(ii) = ii
+            vout(ii) = ii
+         enddo 
+         call mpi_reduce_local( vin, vout, count,
+     &                          MPI_INTEGER, MPI_SUM, ierr )
+C        Check if the result is correct
+         do ii = 1,count
+            if ( vin(ii) .ne. ii ) then
+               errs = errs + 1
+            endif
+            if ( vout(ii) .ne. 2*ii ) then
+               errs = errs + 1
+            endif
+         enddo 
+         if ( count .gt. 0 ) then
+            count = count + count
+         else
+            count = 1
+         endif
+      enddo
+
+      call mpi_op_create( user_op, .false., myop, ierr )
+
+      count = 0
+      do while (count .le. max_buf_size) 
+         do ii = 1, count
+            vin(ii) = ii
+            vout(ii) = ii
+         enddo
+         call mpi_reduce_local( vin, vout, count,
+     &                          MPI_INTEGER, myop, ierr )
+C        Check if the result is correct
+         do ii = 1, count
+            if ( vin(ii) .ne. ii ) then
+               errs = errs + 1
+            endif
+            if ( vout(ii) .ne. 3*ii ) then
+               errs = errs + 1
+            endif
+         enddo
+         if ( count .gt. 0 ) then
+            count = count + count
+         else
+            count = 1
+         endif
+      enddo
+
+      call mpi_op_free( myop, ierr )
+
+      call mtest_finalize(errs)
+      call mpi_finalize(ierr)
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/split_typef.f b/teshsuite/smpi/mpich3-test/f77/coll/split_typef.f
new file mode 100644 (file)
index 0000000..3f3aa3e
--- /dev/null
@@ -0,0 +1,46 @@
+C -*- Mode: Fortran; -*-
+C
+C  (C) 2011 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer ierr, errs
+      integer i, ans, size, rank, color, comm, newcomm
+      integer maxSize, displ
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+
+      call mpi_comm_split_type( comm, MPI_COMM_TYPE_SHARED, rank,
+     &     MPI_INFO_NULL, newcomm, ierr )
+      call mpi_comm_rank( newcomm, rank, ierr )
+      call mpi_comm_size( newcomm, size, ierr )
+
+      do i=1, size
+         scounts(i) = 1
+         sdispls(i) = (i-1)
+         stypes(i)  = MPI_INTEGER
+         sbuf(i) = rank * size + i
+         rcounts(i) = 1
+         rdispls(i) = (i-1)
+         rtypes(i)  = MPI_INTEGER
+         rbuf(i) = -1
+      enddo
+      call mpi_alltoallv( sbuf, scounts, sdispls, stypes,
+     &     rbuf, rcounts, rdispls, rtypes, newcomm, ierr )
+
+      call mpi_comm_free( newcomm, ierr )
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/testlist b/teshsuite/smpi/mpich3-test/f77/coll/testlist
new file mode 100644 (file)
index 0000000..dd71163
--- /dev/null
@@ -0,0 +1,12 @@
+uallreducef 4
+exscanf 5
+#alltoallwf 7
+alltoallvf 7
+inplacef 4
+reducelocalf 2 mpiversion=2.2
+redscatf 4
+split_typef 4 mpiversion=3.0
+nonblockingf 4 mpiversion=3.0
+vw_inplacef 4 mpiversion=2.2
+red_scat_blockf 4 mpiversion=2.2
+nonblocking_inpf 4 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/uallreducef.f b/teshsuite/smpi/mpich3-test/f77/coll/uallreducef.f
new file mode 100644 (file)
index 0000000..566d294
--- /dev/null
@@ -0,0 +1,63 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C
+C Test user-defined operations.  This tests a simple commutative operation
+C
+      subroutine uop( cin, cout, count, datatype )
+      implicit none
+      include 'mpif.h'
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+C      if (datatype .ne. MPI_INTEGER) then
+C         print *, 'Invalid datatype (',datatype,') passed to user_op()'
+C         return
+C      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+
+      program main
+      implicit none
+      include 'mpif.h'
+      external uop
+      integer ierr, errs
+      integer count, sumop, vin(65000), vout(65000), i, size
+      integer comm
+      
+      errs = 0
+
+      call mtest_init(ierr)
+      call mpi_op_create( uop, .true., sumop, ierr )
+
+      comm = MPI_COMM_WORLD
+      call mpi_comm_size( comm, size, ierr )
+      count = 1
+      do while (count .lt. 65000) 
+         do i=1, count
+            vin(i) = i
+            vout(i) = -1
+         enddo
+         call mpi_allreduce( vin, vout, count, MPI_INTEGER, sumop, 
+     *                       comm, ierr )
+C         Check that all results are correct
+         do i=1, count
+            if (vout(i) .ne. i * size) then
+               errs = errs + 1
+               if (errs .lt. 10) print *, "vout(",i,") = ", vout(i)
+            endif
+         enddo
+         count = count + count
+      enddo
+
+      call mpi_op_free( sumop, ierr )
+
+      call mtest_finalize(errs)
+      call mpi_finalize(ierr)
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/coll/vw_inplacef.f b/teshsuite/smpi/mpich3-test/f77/coll/vw_inplacef.f
new file mode 100644 (file)
index 0000000..4ad1d4a
--- /dev/null
@@ -0,0 +1,109 @@
+C -*- Mode: Fortran; -*- 
+C
+C (C) 2012 by Argonne National Laboratory.
+C     See COPYRIGHT in top-level directory.
+C
+C A simple test for Fortran support of the MPI_IN_PLACE value in Alltoall[vw].
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer SIZEOFINT
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE)
+       integer rdispls(MAX_SIZE), rcounts(MAX_SIZE), rtypes(MAX_SIZE)
+       integer ierr, errs
+       integer comm, root
+       integer rank, size
+       integer iexpected, igot
+       integer i, j
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+       call mpi_type_size( MPI_INTEGER, SIZEOFINT, ierr )
+
+       if (size .gt. MAX_SIZE) then
+          print *, ' At most ', MAX_SIZE, ' processes allowed'
+          call mpi_abort( MPI_COMM_WORLD, 1, ierr )
+       endif
+C
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+          rbuf(i) = (i-1) * size + rank
+       enddo
+       call mpi_alltoall( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL,
+     $      rbuf, 1, MPI_INTEGER, comm, ierr )
+       do i=1,size
+          if (rbuf(i) .ne. (rank*size + i - 1)) then
+             errs = errs + 1
+             print *, '[', rank, '] rbuf(', i, ') = ', rbuf(i),
+     $             ', should be', rank * size + i - 1
+          endif
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = (i-1) + rank
+           rdispls(i) = (i-1) * (2*size)
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)+j+1) = 100 * rank + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_alltoallv( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL,
+     $                     rbuf, rcounts, rdispls, MPI_INTEGER,
+     $                     comm, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, '] ALLTOALLV got ', igot,
+     $                   ',but expected ', iexpected,
+     $                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+C          Alltoallw's displs[] are in bytes not in type extents.
+       do i=1,size
+           rcounts(i) = (i-1) + rank
+           rdispls(i) = (i-1) * (2*size) * SIZEOFINT
+           rtypes(i)  = MPI_INTEGER
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)/SIZEOFINT+j+1) = 100 * rank
+     $                                        + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_alltoallw( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL,
+     $                     rbuf, rcounts, rdispls, rtypes,
+     $                     comm, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)/SIZEOFINT+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, '] ALLTOALLW got ', igot,
+     $                   ',but expected ', iexpected,
+     $                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
new file mode 100644 (file)
index 0000000..60e5e9f
--- /dev/null
@@ -0,0 +1,45 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+ # add_executable(commerrf commerrf.f ../util/mtestf.f)
+  add_executable(commnamef commnamef.f ../util/mtestf.f)
+
+ # target_link_libraries(commerrf  simgrid)
+  target_link_libraries(commnamef  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/commerrf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/commnamef.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/comm/commerrf.f b/teshsuite/smpi/mpich3-test/f77/comm/commerrf.f
new file mode 100644 (file)
index 0000000..e58337f
--- /dev/null
@@ -0,0 +1,131 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer errs, ierr, code(2), newerrclass, eclass
+       character*(MPI_MAX_ERROR_STRING) errstring
+       integer comm, rlen
+       external myerrhanfunc
+CF90   INTERFACE 
+CF90   SUBROUTINE myerrhanfunc(vv0,vv1)
+CF90   INTEGER vv0,vv1
+CF90   END SUBROUTINE
+CF90   END INTERFACE
+       integer myerrhan, qerr
+       integer callcount, codesSeen(3)
+       common /myerrhan/ callcount, codesSeen
+
+       errs = 0
+       callcount = 0
+       call mtest_init( ierr )
+C
+C Setup some new codes and classes
+       call mpi_add_error_class( newerrclass, ierr )
+       call mpi_add_error_code( newerrclass, code(1), ierr )
+       call mpi_add_error_code( newerrclass, code(2), ierr )
+       call mpi_add_error_string( newerrclass, "New Class", ierr )
+       call mpi_add_error_string( code(1), "First new code", ierr )
+       call mpi_add_error_string( code(2), "Second new code", ierr )
+C
+C
+       call mpi_comm_create_errhandler( myerrhanfunc, myerrhan, ierr )
+C
+C Create a new communicator so that we can leave the default errors-abort
+C on MPI_COMM_WORLD
+       call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+C
+       call mpi_comm_set_errhandler( comm, myerrhan, ierr )
+
+       call mpi_comm_get_errhandler( comm, qerr, ierr )
+       if (qerr .ne. myerrhan) then
+          errs = errs + 1
+          print *, ' Did not get expected error handler'
+       endif
+       call mpi_errhandler_free( qerr, ierr )
+C We can free our error handler now
+       call mpi_errhandler_free( myerrhan, ierr )
+
+       call mpi_comm_call_errhandler( comm, newerrclass, ierr )
+       call mpi_comm_call_errhandler( comm, code(1), ierr )
+       call mpi_comm_call_errhandler( comm, code(2), ierr )
+       
+       if (callcount .ne. 3) then
+          errs = errs + 1
+          print *, ' Expected 3 calls to error handler, found ', 
+     &             callcount
+       else
+          if (codesSeen(1) .ne. newerrclass) then
+             errs = errs + 1
+             print *, 'Expected class ', newerrclass, ' got ', 
+     &                codesSeen(1)
+          endif
+          if (codesSeen(2) .ne. code(1)) then
+             errs = errs + 1
+             print *, 'Expected code ', code(1), ' got ', 
+     &                codesSeen(2)
+          endif
+          if (codesSeen(3) .ne. code(2)) then
+             errs = errs + 1
+             print *, 'Expected code ', code(2), ' got ', 
+     &                codesSeen(3)
+          endif
+       endif
+
+       call mpi_comm_free( comm, ierr )
+C
+C Check error strings while here...
+       call mpi_error_string( newerrclass, errstring, rlen, ierr )
+       if (errstring(1:rlen) .ne. "New Class") then
+          errs = errs + 1
+          print *, ' Wrong string for error class: ', errstring(1:rlen)
+       endif
+       call mpi_error_class( code(1), eclass, ierr )
+       if (eclass .ne. newerrclass) then
+          errs = errs + 1
+          print *, ' Class for new code is not correct'
+       endif
+       call mpi_error_string( code(1), errstring, rlen, ierr )
+       if (errstring(1:rlen) .ne. "First new code") then
+          errs = errs + 1
+          print *, ' Wrong string for error code: ', errstring(1:rlen)
+       endif
+       call mpi_error_class( code(2), eclass, ierr )
+       if (eclass .ne. newerrclass) then
+          errs = errs + 1
+          print *, ' Class for new code is not correct'
+       endif
+       call mpi_error_string( code(2), errstring, rlen, ierr )
+       if (errstring(1:rlen) .ne. "Second new code") then
+          errs = errs + 1
+          print *, ' Wrong string for error code: ', errstring(1:rlen)
+       endif
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
+C
+       subroutine myerrhanfunc( comm, errcode )
+       implicit none
+       include 'mpif.h'
+       integer comm, errcode
+       integer rlen, ierr
+       integer callcount, codesSeen(3)
+       character*(MPI_MAX_ERROR_STRING) errstring
+       common /myerrhan/ callcount, codesSeen
+
+       callcount = callcount + 1
+C Remember the code we've seen
+       if (callcount .le. 3) then
+          codesSeen(callcount) = errcode
+       endif
+       call mpi_error_string( errcode, errstring, rlen, ierr )
+       if (ierr .ne. MPI_SUCCESS) then
+          print *, ' Panic! could not get error string'
+          call mpi_abort( MPI_COMM_WORLD, 1, ierr )
+       endif
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/comm/commnamef.f b/teshsuite/smpi/mpich3-test/f77/comm/commnamef.f
new file mode 100644 (file)
index 0000000..4ff5caf
--- /dev/null
@@ -0,0 +1,82 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      integer comm(4), i, rlen, ln
+      integer ncomm
+      character*(MPI_MAX_OBJECT_NAME) inname(4), cname
+      logical MTestGetIntracomm
+
+      errs = 0
+      call mtest_init( ierr )
+      
+C Test the predefined communicators
+      do ln=1,MPI_MAX_OBJECT_NAME
+         cname(ln:ln) = 'X'
+      enddo
+      call mpi_comm_get_name( MPI_COMM_WORLD, cname, rlen, ierr )
+      do ln=MPI_MAX_OBJECT_NAME,1,-1
+         if (cname(ln:ln) .ne. ' ') then
+            if (ln .ne. rlen) then
+               errs = errs + 1
+               print *, 'result len ', rlen,' not equal to actual len ',
+     &              ln
+            endif
+            goto 110
+         endif
+      enddo
+      if (cname(1:rlen) .ne. 'MPI_COMM_WORLD') then
+         errs = errs + 1
+         print *, 'Did not get MPI_COMM_WORLD for world'
+      endif
+ 110  continue
+C
+      do ln=1,MPI_MAX_OBJECT_NAME
+         cname(ln:ln) = 'X'
+      enddo
+      call mpi_comm_get_name( MPI_COMM_SELF, cname, rlen, ierr )
+      do ln=MPI_MAX_OBJECT_NAME,1,-1
+         if (cname(ln:ln) .ne. ' ') then
+            if (ln .ne. rlen) then
+               errs = errs + 1
+               print *, 'result len ', rlen,' not equal to actual len ',
+     &              ln
+            endif
+            goto 120
+         endif
+      enddo
+      if (cname(1:rlen) .ne. 'MPI_COMM_SELF') then
+         errs = errs + 1
+         print *, 'Did not get MPI_COMM_SELF for world'
+      endif
+ 120  continue
+C
+      do i = 1, 4
+         if (MTestGetIntracomm( comm(i), 1, .true. )) then
+            ncomm = i
+            write( inname(i), '(a,i1)') 'myname',i
+            call mpi_comm_set_name( comm(i), inname(i), ierr )
+         else
+            goto 130
+         endif
+      enddo
+ 130   continue
+C
+C     Now test them all
+      do i=1, ncomm
+         call mpi_comm_get_name( comm(i), cname, rlen, ierr )
+         if (inname(i) .ne. cname) then
+            errs = errs + 1
+            print *, ' Expected ', inname(i), ' got ', cname
+         endif
+         call MTestFreeComm( comm(i) )
+      enddo
+C      
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/comm/testlist b/teshsuite/smpi/mpich3-test/f77/comm/testlist
new file mode 100644 (file)
index 0000000..6523065
--- /dev/null
@@ -0,0 +1,2 @@
+#commnamef 2
+#commerrf 2
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0b7c836
--- /dev/null
@@ -0,0 +1,76 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h @ONLY)
+
+  add_executable(allctypesf allctypesf.f ../util/mtestf.f)
+  add_executable(gaddressf gaddressf.f ../util/mtestf.f)
+  add_executable(hindex1f hindex1f.f ../util/mtestf.f)
+  add_executable(hindexed_blockf hindexed_blockf.f ../util/mtestf.f)
+  add_executable(packef packef.f ../util/mtestf.f)
+  add_executable(typecntsf typecntsf.f ../util/mtestf.f)
+  add_executable(typem2f typem2f.f ../util/mtestf.f)
+  add_executable(typename3f typename3f.f ../util/mtestf.f)
+  add_executable(typenamef typenamef.f ../util/mtestf.f)
+  add_executable(typesnamef typesnamef.f ../util/mtestf.f)
+  add_executable(typesubf typesubf.f ../util/mtestf.f)
+
+  target_link_libraries(allctypesf  simgrid)
+  target_link_libraries(gaddressf  simgrid)
+  target_link_libraries(hindex1f  simgrid)
+  target_link_libraries(hindexed_blockf  simgrid)
+  target_link_libraries(packef  simgrid)
+  target_link_libraries(typecntsf  simgrid)
+  target_link_libraries(typem2f  simgrid)
+  target_link_libraries(typename3f  simgrid)
+  target_link_libraries(typenamef  simgrid)
+  target_link_libraries(typesnamef  simgrid)
+  target_link_libraries(typesubf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allctypesf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/gaddressf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/hindex1f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/hindexed_blockf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/packef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in
+  ${CMAKE_CURRENT_SOURCE_DIR}/typecntsf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typem2f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typename3f.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typenamef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typesnamef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/typesubf.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  ${CMAKE_CURRENT_SOURCE_DIR}/../util/mtestf.f
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/allctypesf.f b/teshsuite/smpi/mpich3-test/f77/datatype/allctypesf.f
new file mode 100644 (file)
index 0000000..f4c5e3f
--- /dev/null
@@ -0,0 +1,138 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2004 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      include 'mpif.h'
+      integer atype, ierr
+C
+      call mtest_init(ierr)
+      call mpi_comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN, 
+     *                              ierr )
+C
+C     Check that all Ctypes are available in Fortran (MPI 2.1, p 483, line 46)
+C
+       call checkdtype( MPI_CHAR, "MPI_CHAR", ierr )
+       call checkdtype( MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR", ierr )
+       call checkdtype( MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR", ierr )
+       call checkdtype( MPI_BYTE, "MPI_BYTE", ierr )
+       call checkdtype( MPI_WCHAR, "MPI_WCHAR", ierr )
+       call checkdtype( MPI_SHORT, "MPI_SHORT", ierr )
+       call checkdtype( MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT", ierr )
+       call checkdtype( MPI_INT, "MPI_INT", ierr )
+       call checkdtype( MPI_UNSIGNED, "MPI_UNSIGNED", ierr )
+       call checkdtype( MPI_LONG, "MPI_LONG", ierr )
+       call checkdtype( MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG", ierr )
+       call checkdtype( MPI_FLOAT, "MPI_FLOAT", ierr )
+       call checkdtype( MPI_DOUBLE, "MPI_DOUBLE", ierr )
+       if (MPI_LONG_DOUBLE .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE", ierr )
+       endif
+       if (MPI_LONG_LONG_INT .ne. MPI_DATATYPE_NULL) then
+         call checkdtype2( MPI_LONG_LONG_INT, "MPI_LONG_LONG_INT", 
+     *                     "MPI_LONG_LONG", ierr )
+       endif
+       if (MPI_UNSIGNED_LONG_LONG .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_UNSIGNED_LONG_LONG, 
+     *                    "MPI_UNSIGNED_LONG_LONG", ierr )
+       endif
+       if (MPI_LONG_LONG .ne. MPI_DATATYPE_NULL) then
+         call checkdtype2( MPI_LONG_LONG, "MPI_LONG_LONG", 
+     *                     "MPI_LONG_LONG_INT", ierr )
+       endif
+       call checkdtype( MPI_PACKED, "MPI_PACKED", ierr )
+       call checkdtype( MPI_LB, "MPI_LB", ierr )
+       call checkdtype( MPI_UB, "MPI_UB", ierr )
+       call checkdtype( MPI_FLOAT_INT, "MPI_FLOAT_INT", ierr )
+       call checkdtype( MPI_DOUBLE_INT, "MPI_DOUBLE_INT", ierr )
+       call checkdtype( MPI_LONG_INT, "MPI_LONG_INT", ierr )
+       call checkdtype( MPI_SHORT_INT, "MPI_SHORT_INT", ierr )
+       call checkdtype( MPI_2INT, "MPI_2INT", ierr )
+       if (MPI_LONG_DOUBLE_INT .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT",
+     *                    ierr)
+       endif
+C
+C     Check that all Ctypes are available in Fortran (MPI 2.2)
+C     Note that because of implicit declarations in Fortran, this
+C     code should compile even with pre MPI 2.2 implementations.
+C
+       if (MPI_VERSION .gt. 2 .or. (MPI_VERSION .eq. 2 .and. 
+     *      MPI_SUBVERSION .ge. 2)) then
+          call checkdtype( MPI_INT8_T, "MPI_INT8_T", ierr )
+          call checkdtype( MPI_INT16_T, "MPI_INT16_T", ierr )
+          call checkdtype( MPI_INT32_T, "MPI_INT32_T", ierr )
+          call checkdtype( MPI_INT64_T, "MPI_INT64_T", ierr )
+          call checkdtype( MPI_UINT8_T, "MPI_UINT8_T", ierr )
+          call checkdtype( MPI_UINT16_T, "MPI_UINT16_T", ierr )
+          call checkdtype( MPI_UINT32_T, "MPI_UINT32_T", ierr )
+          call checkdtype( MPI_UINT64_T, "MPI_UINT64_T", ierr )
+C other C99 types
+          call checkdtype( MPI_C_BOOL, "MPI_C_BOOL", ierr )
+          call checkdtype( MPI_C_FLOAT_COMPLEX, "MPI_C_FLOAT_COMPLEX",
+     *                     ierr)
+          call checkdtype2( MPI_C_COMPLEX, "MPI_C_COMPLEX", 
+     *                      "MPI_C_FLOAT_COMPLEX", ierr )
+          call checkdtype( MPI_C_DOUBLE_COMPLEX, "MPI_C_DOUBLE_COMPLEX", 
+     *                     ierr )
+          if (MPI_C_LONG_DOUBLE_COMPLEX .ne. MPI_DATATYPE_NULL) then
+            call checkdtype( MPI_C_LONG_DOUBLE_COMPLEX, 
+     *                       "MPI_C_LONG_DOUBLE_COMPLEX", ierr )
+          endif
+C address/offset types 
+          call checkdtype( MPI_AINT, "MPI_AINT", ierr )
+          call checkdtype( MPI_OFFSET, "MPI_OFFSET", ierr )
+       endif
+C
+       call mtest_finalize( ierr )
+       call MPI_Finalize( ierr )
+       end
+C
+C Check name of datatype
+      subroutine CheckDtype( intype, name, ierr )
+      include 'mpif.h'
+      integer intype, ierr
+      character *(*) name
+      integer ir, rlen
+      character *(MPI_MAX_OBJECT_NAME) outname
+C     
+      outname = ""
+      call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
+      if (ir .ne. MPI_SUCCESS) then
+         print *, " Datatype ", name, " not available in Fortran"
+         ierr = ierr + 1
+      else
+         if (outname .ne. name) then
+            print *, " For datatype ", name, " found name ",
+     *           outname(1:rlen)
+            ierr = ierr + 1
+         endif
+      endif
+      
+      return
+      end
+C
+C Check name of datatype (allows alias)
+      subroutine CheckDtype2( intype, name, name2, ierr )
+      include 'mpif.h'
+      integer intype, ierr
+      character *(*) name, name2
+      integer ir, rlen
+      character *(MPI_MAX_OBJECT_NAME) outname
+C     
+      outname = ""
+      call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
+      if (ir .ne. MPI_SUCCESS) then
+         print *, " Datatype ", name, " not available in Fortran"
+         ierr = ierr + 1
+      else
+         if (outname .ne. name .and. outname .ne. name2) then
+            print *, " For datatype ", name, " found name ",
+     *           outname(1:rlen)
+            ierr = ierr + 1
+         endif
+      endif
+      
+      return
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/gaddressf.f b/teshsuite/smpi/mpich3-test/f77/datatype/gaddressf.f
new file mode 100644 (file)
index 0000000..4dba0f2
--- /dev/null
@@ -0,0 +1,38 @@
+C -*- Mode: Fortran; -*- 
+C
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer max_asizev
+      parameter (max_asizev=2)
+      include 'typeaints.h'
+      integer iarray(200), gap, intsize
+      integer ierr, errs
+
+      errs = 0
+
+      call MPI_Init(ierr)
+
+      call MPI_Get_address( iarray(1), aintv(1), ierr )
+      call MPI_Get_address( iarray(200), aintv(2), ierr )
+      gap = aintv(2) - aintv(1)
+
+      call MPI_Type_size( MPI_INTEGER, intsize, ierr )
+
+      if (gap .ne. 199 * intsize) then
+         errs = errs + 1
+         print *, ' Using get_address, computed a gap of ', gap
+         print *, ' Expected a gap of ', 199 * intsize
+      endif
+      if (errs .gt. 0) then
+          print *, ' Found ', errs, ' errors'
+      else
+          print *, ' No Errors'
+      endif
+
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/hindex1f.f b/teshsuite/smpi/mpich3-test/f77/datatype/hindex1f.f
new file mode 100644 (file)
index 0000000..1a689ed
--- /dev/null
@@ -0,0 +1,61 @@
+C -*- Mode: Fortran; -*- 
+C
+C
+C  (C) 2011 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr, intsize
+      integer i, displs(10), counts(10), dtype
+      integer bufsize
+      parameter (bufsize=100)
+      integer inbuf(bufsize), outbuf(bufsize), packbuf(bufsize)
+      integer position, len, psize
+C
+C     Test for hindexed; 
+C     
+      errs = 0
+      call mtest_init( ierr )
+
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+      
+      do i=1, 10
+         displs(i) = (10-i)*intsize
+         counts(i) = 1
+      enddo
+      call mpi_type_hindexed( 10, counts, displs, MPI_INTEGER, dtype,
+     &     ierr ) 
+      call mpi_type_commit( dtype, ierr )
+C
+      call mpi_pack_size( 1, dtype, MPI_COMM_WORLD, psize, ierr )
+      if (psize .gt. bufsize*intsize) then
+         errs = errs + 1
+      else
+         do i=1,10
+            inbuf(i)  = i
+            outbuf(i) = -i
+         enddo
+         position = 0
+         call mpi_pack( inbuf, 1, dtype, packbuf, psize, position,
+     $        MPI_COMM_WORLD, ierr )
+C
+         len      = position
+         position = 0
+         call mpi_unpack( packbuf, len, position, outbuf, 10,
+     $        MPI_INTEGER, MPI_COMM_WORLD, ierr )
+C     
+         do i=1, 10
+            if (outbuf(i) .ne. 11-i) then
+               errs = errs + 1
+               print *, 'outbuf(',i,')=',outbuf(i),', expected ', 10-i
+            endif
+         enddo
+      endif
+C
+      call mpi_type_free( dtype, ierr )
+C
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf.f b/teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf.f
new file mode 100644 (file)
index 0000000..8dc00a8
--- /dev/null
@@ -0,0 +1,178 @@
+C -*- Mode: Fortran; -*-
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr, i, intsize
+      integer type1, type2, type3, type4, type5
+      integer max_asizev
+      parameter (max_asizev = 10)
+      include 'typeaints.h'
+      integer blocklens(max_asizev), dtypes(max_asizev)
+      integer displs(max_asizev)
+      integer recvbuf(6*max_asizev)
+      integer sendbuf(max_asizev), status(MPI_STATUS_SIZE)
+      integer rank, size
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+C
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+C
+      aintv(1) = 0
+      aintv(2) = 3 * intsize
+      call mpi_type_create_resized( MPI_INTEGER, aintv(1), aintv(2),
+     &                              type1, ierr )
+      call mpi_type_commit( type1, ierr )
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected lb'
+      endif
+      if (aintv(2) .ne. 3*intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected extent'
+      endif
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_true_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected true lb'
+      endif
+      if (aintv(2) .ne. intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected true extent (', aintv(2), ') ',
+     &     ' expected ', intsize
+      endif
+C
+      do i=1,10
+         blocklens(i) = 1
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_hindexed( 10, blocklens, aintv,
+     &                               MPI_INTEGER, type2, ierr )
+      call mpi_type_commit( type2, ierr )
+C
+      aint = 3 * intsize
+      call mpi_type_create_hvector( 10, 1, aint, MPI_INTEGER, type3,
+     &                              ierr )
+      call mpi_type_commit( type3, ierr )
+C
+      do i=1,10
+         blocklens(i) = 1
+         dtypes(i)    = MPI_INTEGER
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_struct( 10, blocklens, aintv, dtypes,
+     &                             type4, ierr )
+      call mpi_type_commit( type4, ierr )
+
+      call mpi_type_get_extent(MPI_INTEGER, aintv(1), aint, ierr)
+      do i=1,10
+         aintv(i)    = (i-1) * 3 * aint
+      enddo
+      call mpi_type_create_hindexed_block( 10, 1, aintv,
+     &                               MPI_INTEGER, type5, ierr )
+      call mpi_type_commit( type5, ierr )
+C
+C Using each time, send and receive using these types
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,
+     &                   recvbuf, max_asizev, type1, rank, 0,
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type1:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,
+     &                   recvbuf, 1, type2, rank, 0,
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type2:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,
+     &                   recvbuf, 1, type3, rank, 0,
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type3:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,
+     &                   recvbuf, 1, type4, rank, 0,
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type4:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,
+     &                   recvbuf, 1, type5, rank, 0,
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type5:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      call mpi_type_free( type1, ierr )
+      call mpi_type_free( type2, ierr )
+      call mpi_type_free( type3, ierr )
+      call mpi_type_free( type4, ierr )
+      call mpi_type_free( type5, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/packef.f b/teshsuite/smpi/mpich3-test/f77/datatype/packef.f
new file mode 100644 (file)
index 0000000..f91e91f
--- /dev/null
@@ -0,0 +1,187 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer ierr, errs
+       integer inbuf(10), ioutbuf(10), inbuf2(10), ioutbuf2(10)
+       integer i, insize, rsize, csize, insize2
+       character*(16) cbuf, coutbuf
+       double precision rbuf(10), routbuf(10)
+       integer packbuf(1000), pbufsize, intsize
+       integer max_asizev
+       parameter (max_asizev = 3)
+       include 'typeaints.h'
+
+       errs = 0
+       call mtest_init( ierr )
+
+       call mpi_type_size( MPI_INTEGER, intsize, ierr )
+       pbufsize = 1000 * intsize
+
+       call mpi_pack_external_size( 'external32', 10, MPI_INTEGER, 
+     &                              aint, ierr ) 
+       if (aint .ne. 10 * 4) then
+          errs = errs + 1
+          print *, 'Expected 40 for size of 10 external32 integers',
+     &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 10, MPI_LOGICAL, 
+     &                              aint, ierr ) 
+       if (aint .ne. 10 * 4) then
+          errs = errs + 1
+          print *, 'Expected 40 for size of 10 external32 logicals',
+     &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 10, MPI_CHARACTER, 
+     &                              aint, ierr ) 
+       if (aint .ne. 10 * 1) then
+          errs = errs + 1
+          print *, 'Expected 10 for size of 10 external32 characters',
+     &       ', got ', aint
+       endif
+       
+       call mpi_pack_external_size( 'external32', 3, MPI_INTEGER2,
+     &                              aint, ierr )
+       if (aint .ne. 3 * 2) then
+          errs = errs + 1
+          print *, 'Expected 6 for size of 3 external32 INTEGER*2',
+     &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_INTEGER4,
+     &                              aint, ierr )
+       if (aint .ne. 3 * 4) then
+          errs = errs + 1
+          print *, 'Expected 12 for size of 3 external32 INTEGER*4',
+     &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_REAL4,
+     &                              aint, ierr )
+       if (aint .ne. 3 * 4) then
+          errs = errs + 1
+          print *, 'Expected 12 for size of 3 external32 REAL*4',
+     &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_REAL8,
+     &                              aint, ierr )
+       if (aint .ne. 3 * 8) then
+          errs = errs + 1
+          print *, 'Expected 24 for size of 3 external32 REAL*8',
+     &       ', got ', aint
+       endif
+       if (MPI_INTEGER1 .ne. MPI_DATATYPE_NULL) then
+          call mpi_pack_external_size( 'external32', 3, MPI_INTEGER1,
+     &                              aint, ierr )
+          if (aint .ne. 3 * 1) then
+             errs = errs + 1
+             print *, 'Expected 3 for size of 3 external32 INTEGER*1',
+     &            ', got ', aint
+          endif
+       endif
+       if (MPI_INTEGER8 .ne. MPI_DATATYPE_NULL) then
+          call mpi_pack_external_size( 'external32', 3, MPI_INTEGER8,
+     &                              aint, ierr )
+          if (aint .ne. 3 * 8) then
+             errs = errs + 1
+             print *, 'Expected 24 for size of 3 external32 INTEGER*8',
+     &            ', got ', aint
+          endif
+       endif
+
+C
+C Initialize values
+C
+       insize = 10
+       do i=1, insize
+          inbuf(i) = i
+       enddo
+       rsize = 3
+       do i=1, rsize
+          rbuf(i) = 1000.0 * i
+       enddo
+       cbuf  = 'This is a string'
+       csize = 16
+       insize2 = 7
+       do i=1, insize2
+          inbuf2(i) = 5000-i
+       enddo
+C
+       aintv(1) = pbufsize
+       aintv(2) = 0
+       aintv(3) = 0
+C One MPI implementation failed to increment the position; instead, 
+C it set the value with the amount of data packed in this call
+C We use aintv(3) to detect and report this specific error
+       call mpi_pack_external( 'external32', inbuf, insize, MPI_INTEGER,
+     &               packbuf, aintv(1), aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of integer!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', rbuf, rsize, 
+     &               MPI_DOUBLE_PRECISION, packbuf, aintv(1), 
+     &               aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of real!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', cbuf, csize, 
+     &               MPI_CHARACTER, packbuf, aintv(1), 
+     &               aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of character!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', inbuf2, insize2, 
+     &               MPI_INTEGER,
+     &               packbuf, aintv(1), aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of integer (2nd)!'
+       endif
+       aintv(3) = aintv(2)
+C
+C We could try sending this with MPI_BYTE...
+       aintv(2) = 0
+       call mpi_unpack_external( 'external32', packbuf, aintv(1),
+     &  aintv(2), ioutbuf, insize, MPI_INTEGER, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1),
+     &  aintv(2), routbuf, rsize, MPI_DOUBLE_PRECISION, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1),
+     &  aintv(2), coutbuf, csize, MPI_CHARACTER, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1),
+     &  aintv(2), ioutbuf2, insize2, MPI_INTEGER, ierr )
+C
+C Now, test the values
+C
+       do i=1, insize
+          if (ioutbuf(i) .ne. i) then
+             errs = errs + 1
+             print *, 'ioutbuf(',i,') = ', ioutbuf(i), ' expected ', i
+          endif
+       enddo
+       do i=1, rsize
+          if (routbuf(i) .ne. 1000.0 * i) then
+             errs = errs + 1
+             print *, 'routbuf(',i,') = ', routbuf(i), ' expected ',       & 
+     &                1000.0 * i
+          endif
+       enddo
+       if (coutbuf(1:csize) .ne. 'This is a string') then
+          errs = errs + 1
+          print *, 'coutbuf = ', coutbuf(1:csize), ' expected ',           &
+     &             'This is a string'
+       endif
+       do i=1, insize2
+          if (ioutbuf2(i) .ne. 5000-i) then
+             errs = errs + 1
+             print *, 'ioutbuf2(',i,') = ', ioutbuf2(i), ' expected ',     &
+     &              5000-i
+          endif
+       enddo
+C
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/testlist b/teshsuite/smpi/mpich3-test/f77/datatype/testlist
new file mode 100644 (file)
index 0000000..5da0524
--- /dev/null
@@ -0,0 +1,11 @@
+#typenamef 1
+#typename3f 1 mpiversion=3.0
+#typesnamef 1
+#typecntsf 1
+#typem2f 1
+#typesubf 1
+#packef 1
+gaddressf 1
+#allctypesf 1
+#hindex1f 1
+#hindexed_blockf 1 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in b/teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in
new file mode 100644 (file)
index 0000000..5cfae7b
--- /dev/null
@@ -0,0 +1,6 @@
+C -*- Mode: Fortran; -*-
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      integer*@MPI_ADDRESS_SIZE@ aint, aintv(max_asizev)
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typecntsf.f b/teshsuite/smpi/mpich3-test/f77/datatype/typecntsf.f
new file mode 100644 (file)
index 0000000..2bd194c
--- /dev/null
@@ -0,0 +1,91 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer errs, ierr
+       integer ntype1, ntype2
+C
+C This is a very simple test that just tests that the contents/envelope
+C routines can be called.  This should be upgraded to test the new 
+C MPI-2 datatype routines (which use address-sized integers)
+C
+
+       errs = 0
+       call mtest_init( ierr )
+
+       call explore( MPI_INTEGER, MPI_COMBINER_NAMED, errs )
+       call explore( MPI_BYTE, MPI_COMBINER_NAMED, errs )
+       call mpi_type_vector( 10, 1, 30, MPI_DOUBLE_PRECISION, ntype1, 
+     &                       ierr )
+       call explore( ntype1, MPI_COMBINER_VECTOR, errs )
+       call mpi_type_dup( ntype1, ntype2, ierr )
+       call explore( ntype2, MPI_COMBINER_DUP, errs )
+       call mpi_type_free( ntype2, ierr )
+       call mpi_type_free( ntype1, ierr )
+       
+C
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+       end
+C
+       subroutine explore( dtype, mycomb, errs )
+       implicit none
+       include 'mpif.h'
+       integer dtype, mycomb, errs
+       integer ierr
+       integer nints, nadds, ntype, combiner
+       integer max_nints, max_dtypes, max_asizev
+       parameter (max_nints = 10, max_dtypes = 10, max_asizev=10)
+       integer intv(max_nints), dtypesv(max_dtypes)
+       include 'typeaints.h'
+C
+       call mpi_type_get_envelope( dtype, nints, nadds, ntype,
+     &                             combiner, ierr )
+C
+       if (combiner .ne. MPI_COMBINER_NAMED) then
+          call mpi_type_get_contents( dtype, 
+     &         max_nints, max_asizev, max_dtypes,
+     &         intv, aintv, dtypesv, ierr )
+C
+C              dtypesv of constructed types must be free'd now
+C
+          if (combiner .eq. MPI_COMBINER_DUP) then
+             call mpi_type_free( dtypesv(1), ierr )
+          endif
+       endif
+       if (combiner .ne. mycomb) then
+          errs = errs + 1
+          print *, ' Expected combiner ', mycomb, ' but got ',
+     &             combiner
+       endif
+C
+C List all combiner types to check that they are defined in mpif.h
+       if (combiner .eq. MPI_COMBINER_NAMED) then
+       else if (combiner .eq. MPI_COMBINER_DUP) then
+       else if (combiner .eq. MPI_COMBINER_CONTIGUOUS) then
+       else if (combiner .eq. MPI_COMBINER_VECTOR) then
+       else if (combiner .eq. MPI_COMBINER_HVECTOR_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_HVECTOR) then
+       else if (combiner .eq. MPI_COMBINER_INDEXED) then
+       else if (combiner .eq. MPI_COMBINER_HINDEXED_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_HINDEXED) then
+       else if (combiner .eq. MPI_COMBINER_INDEXED_BLOCK) then
+       else if (combiner .eq. MPI_COMBINER_STRUCT_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_STRUCT) then
+       else if (combiner .eq. MPI_COMBINER_SUBARRAY) then
+       else if (combiner .eq. MPI_COMBINER_DARRAY) then
+       else if (combiner .eq. MPI_COMBINER_F90_REAL) then
+       else if (combiner .eq. MPI_COMBINER_F90_COMPLEX) then
+       else if (combiner .eq. MPI_COMBINER_F90_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_RESIZED) then
+       else
+          errs = errs + 1
+          print *, ' Unknown combiner ', combiner
+       endif
+       
+       return
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typem2f.f b/teshsuite/smpi/mpich3-test/f77/datatype/typem2f.f
new file mode 100644 (file)
index 0000000..32e9af4
--- /dev/null
@@ -0,0 +1,177 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr, i, intsize
+      integer type1, type2, type3, type4, type5
+      integer max_asizev
+      parameter (max_asizev = 10)
+      include 'typeaints.h'
+      integer blocklens(max_asizev), dtypes(max_asizev)
+      integer displs(max_asizev)
+      integer recvbuf(6*max_asizev)
+      integer sendbuf(max_asizev), status(MPI_STATUS_SIZE)
+      integer rank, size
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+C
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+C
+      aintv(1) = 0
+      aintv(2) = 3 * intsize
+      call mpi_type_create_resized( MPI_INTEGER, aintv(1), aintv(2), 
+     &                              type1, ierr )
+      call mpi_type_commit( type1, ierr )
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected lb'
+      endif
+      if (aintv(2) .ne. 3*intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected extent'
+      endif
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_true_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected true lb'
+      endif
+      if (aintv(2) .ne. intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected true extent (', aintv(2), ') ',
+     &     ' expected ', intsize
+      endif
+C
+      do i=1,10
+         blocklens(i) = 1
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_hindexed( 10, blocklens, aintv, 
+     &                               MPI_INTEGER, type2, ierr )
+      call mpi_type_commit( type2, ierr )
+C
+      aint = 3 * intsize
+      call mpi_type_create_hvector( 10, 1, aint, MPI_INTEGER, type3, 
+     &                              ierr )
+      call mpi_type_commit( type3, ierr )
+C
+      do i=1,10
+         blocklens(i) = 1
+         dtypes(i)    = MPI_INTEGER
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_struct( 10, blocklens, aintv, dtypes,
+     &                             type4, ierr )
+      call mpi_type_commit( type4, ierr )
+
+      do i=1,10
+         displs(i)    = (i-1) * 3
+      enddo
+      call mpi_type_create_indexed_block( 10, 1, displs, 
+     &                               MPI_INTEGER, type5, ierr )
+      call mpi_type_commit( type5, ierr )
+C
+C Using each time, send and receive using these types
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, 
+     &                   recvbuf, max_asizev, type1, rank, 0, 
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type1:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, 
+     &                   recvbuf, 1, type2, rank, 0, 
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type2:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, 
+     &                   recvbuf, 1, type3, rank, 0, 
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type3:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, 
+     &                   recvbuf, 1, type4, rank, 0, 
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type4:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, 
+     &                   recvbuf, 1, type5, rank, 0, 
+     &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type5:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+C
+      call mpi_type_free( type1, ierr )
+      call mpi_type_free( type2, ierr )
+      call mpi_type_free( type3, ierr )
+      call mpi_type_free( type4, ierr )
+      call mpi_type_free( type5, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typename3f.f b/teshsuite/smpi/mpich3-test/f77/datatype/typename3f.f
new file mode 100644 (file)
index 0000000..17414d0
--- /dev/null
@@ -0,0 +1,41 @@
+C -*- Mode: Fortran; -*- 
+C
+C
+C  (C) 2012 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      character*(MPI_MAX_OBJECT_NAME) name
+      integer namelen
+      integer ierr, errs
+
+      errs = 0
+
+      call mtest_init( ierr )
+C
+C Check each Fortran datatype, including the size-specific ones
+C See the C version (typename.c) for the relevant MPI sections
+
+      call MPI_Type_get_name( MPI_AINT, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_AINT") then
+           errs = errs + 1
+           print *, "Expected MPI_AINT but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_OFFSET, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_OFFSET") then
+           errs = errs + 1
+           print *, "Expected MPI_OFFSET but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_COUNT, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_COUNT") then
+           errs = errs + 1
+           print *, "Expected MPI_COUNT but got "//name(1:namelen)
+      endif
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typenamef.f b/teshsuite/smpi/mpich3-test/f77/datatype/typenamef.f
new file mode 100644 (file)
index 0000000..611fbcf
--- /dev/null
@@ -0,0 +1,205 @@
+C -*- Mode: Fortran; -*- 
+C
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      character*(MPI_MAX_OBJECT_NAME) name
+      integer namelen
+      integer ierr, errs
+
+      errs = 0
+
+      call mtest_init( ierr )
+C
+C Check each Fortran datatype, including the size-specific ones
+C See the C version (typename.c) for the relevant MPI sections
+
+      call MPI_Type_get_name( MPI_COMPLEX, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_COMPLEX") then
+           errs = errs + 1
+           print *, "Expected MPI_COMPLEX but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_DOUBLE_COMPLEX, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_DOUBLE_COMPLEX") then
+           errs = errs + 1
+           print *, "Expected MPI_DOUBLE_COMPLEX but got "//
+     &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_LOGICAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_LOGICAL") then
+           errs = errs + 1
+           print *, "Expected MPI_LOGICAL but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_REAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_REAL") then
+           errs = errs + 1
+           print *, "Expected MPI_REAL but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_DOUBLE_PRECISION, name, namelen, ierr)
+      if (name(1:namelen) .ne. "MPI_DOUBLE_PRECISION") then
+           errs = errs + 1
+           print *, "Expected MPI_DOUBLE_PRECISION but got "//
+     &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_INTEGER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_INTEGER") then
+           errs = errs + 1
+           print *, "Expected MPI_INTEGER but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_2INTEGER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_2INTEGER") then
+           errs = errs + 1
+           print *, "Expected MPI_2INTEGER but got "//name(1:namelen)
+      endif
+
+C 2COMPLEX was present only in MPI 1.0
+C      call MPI_Type_get_name( MPI_2COMPLEX, name, namelen, ierr )
+C      if (name(1:namelen) .ne. "MPI_2COMPLEX") then
+C           errs = errs + 1
+C           print *, "Expected MPI_2COMPLEX but got "//name(1:namelen)
+C      endif
+C
+      call MPI_Type_get_name(MPI_2DOUBLE_PRECISION, name, namelen, ierr)
+      if (name(1:namelen) .ne. "MPI_2DOUBLE_PRECISION") then
+           errs = errs + 1
+           print *, "Expected MPI_2DOUBLE_PRECISION but got "//
+     &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_2REAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_2REAL") then
+           errs = errs + 1
+           print *, "Expected MPI_2REAL but got "//name(1:namelen)
+      endif
+
+C 2DOUBLE_COMPLEX isn't in MPI 2.1
+C      call MPI_Type_get_name( MPI_2DOUBLE_COMPLEX, name, namelen, ierr )
+C      if (name(1:namelen) .ne. "MPI_2DOUBLE_COMPLEX") then
+C           errs = errs + 1
+C           print *, "Expected MPI_2DOUBLE_COMPLEX but got "//
+C     &          name(1:namelen)
+C      endif
+
+      call MPI_Type_get_name( MPI_CHARACTER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_CHARACTER") then
+           errs = errs + 1
+           print *, "Expected MPI_CHARACTER but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_BYTE, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_BYTE") then
+           errs = errs + 1
+           print *, "Expected MPI_BYTE but got "//name(1:namelen)
+      endif
+
+      if (MPI_REAL4 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL4, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL4") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL4 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_REAL8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL8") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL8 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_REAL16 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL16, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL16") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL16 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX8") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX8 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX16 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX16, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX16") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX16 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX32 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX32, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX32") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX32 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER1 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER1, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER1") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER1 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER2 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER2, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER2") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER2 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER4 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER4, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER4") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER4 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER8") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER8 but got "//
+     &              name(1:namelen)
+          endif
+      endif
+
+C MPI_INTEGER16 is in MPI 2.1, but it is missing from most tables
+C Some MPI implementations may not provide it
+C      if (MPI_INTEGER16 .ne. MPI_DATATYPE_NULL) then
+C          call MPI_Type_get_name( MPI_INTEGER16, name, namelen, ierr )
+C          if (name(1:namelen) .ne. "MPI_INTEGER16") then
+C               errs = errs + 1
+C               print *, "Expected MPI_INTEGER16 but got "//
+C     &              name(1:namelen)
+C          endif
+C      endif
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typesnamef.f b/teshsuite/smpi/mpich3-test/f77/datatype/typesnamef.f
new file mode 100644 (file)
index 0000000..b958c49
--- /dev/null
@@ -0,0 +1,67 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       character*(MPI_MAX_OBJECT_NAME) cname
+       integer rlen, ln
+       integer ntype1, ntype2, errs, ierr
+
+       errs = 0
+       
+       call MTest_Init( ierr )
+
+       call mpi_type_vector( 10, 1, 100, MPI_INTEGER, ntype1, ierr )
+       rlen = -1
+       cname = 'XXXXXX'
+       call mpi_type_get_name( ntype1, cname, rlen, ierr )
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' Expected length 0, got ', rlen
+       endif
+       rlen = 0
+       do ln=MPI_MAX_OBJECT_NAME,1,-1
+          if (cname(ln:ln) .ne. ' ') then
+             rlen = ln
+             goto 100
+          endif
+       enddo
+ 100   continue
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, 'Datatype name is not all blank'
+       endif
+C
+C now add a name, then dup
+       call mpi_type_set_name( ntype1, 'a vector type', ierr )
+       call mpi_type_dup( ntype1, ntype2, ierr )
+       rlen = -1
+       cname = 'XXXXXX'
+       call mpi_type_get_name( ntype2, cname, rlen, ierr )
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' (type2) Expected length 0, got ', rlen
+       endif
+       rlen = 0
+       do ln=MPI_MAX_OBJECT_NAME,1,-1
+          if (cname(ln:ln) .ne. ' ') then
+             rlen = ln
+             goto 110
+          endif
+       enddo
+ 110   continue
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' (type2) Datatype name is not all blank'
+       endif
+       
+       call mpi_type_free( ntype1, ierr )
+       call mpi_type_free( ntype2, ierr )
+       
+       call MTest_Finalize( errs )
+       call MPI_Finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/datatype/typesubf.f b/teshsuite/smpi/mpich3-test/f77/datatype/typesubf.f
new file mode 100644 (file)
index 0000000..f175149
--- /dev/null
@@ -0,0 +1,73 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, ierr
+      integer maxn, maxm
+      parameter (maxn=10,maxm=15)
+      integer fullsizes(2), subsizes(2), starts(2)
+      integer fullarr(maxn,maxm),subarr(maxn-3,maxm-4)
+      integer i,j, ssize
+      integer newtype, size, rank, ans
+
+      errs = 0
+      call mtest_init( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+C
+C Create a Fortran-style subarray
+      fullsizes(1) = maxn
+      fullsizes(2) = maxm
+      subsizes(1)  = maxn - 3
+      subsizes(2)  = maxm - 4
+C starts are from zero, even in Fortran
+      starts(1)    = 1
+      starts(2)    = 2
+C In Fortran 90 notation, the original array is
+C    integer a(maxn,maxm)
+C and the subarray is
+C    a(1+1:(maxn-3) +(1+1)-1,2+1:(maxm-4)+(2+1)-1)
+C i.e., a (start:(len + start - 1),...)
+      call mpi_type_create_subarray( 2, fullsizes, subsizes, starts, 
+     &         MPI_ORDER_FORTRAN, MPI_INTEGER, newtype, ierr )
+      call mpi_type_commit( newtype, ierr )
+C
+C Prefill the array
+      do j=1, maxm
+         do i=1, maxn
+            fullarr(i,j) = (i-1) + (j-1) * maxn
+         enddo
+      enddo
+      do j=1, subsizes(2)
+         do i=1, subsizes(1)
+            subarr(i,j) = -1
+         enddo
+      enddo
+      ssize = subsizes(1)*subsizes(2)
+      call mpi_sendrecv( fullarr, 1, newtype, rank, 0, 
+     &                   subarr, ssize, MPI_INTEGER, rank, 0, 
+     &                   MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr )
+C
+C Check the data
+      do j=1, subsizes(2)
+         do i=1, subsizes(1)
+            ans = (i+starts(1)-1) + (j+starts(2)-1) * maxn
+            if (subarr(i,j) .ne. ans) then
+               errs = errs + 1
+               if (errs .le. 10) then
+                  print *, rank, 'subarr(',i,',',j,') = ', subarr(i,j)
+               endif
+            endif
+         enddo
+      enddo
+
+      call mpi_type_free( newtype, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9a0a418
--- /dev/null
@@ -0,0 +1,54 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(add1size add1size.h ../util/mtestf.f)
+#  add_executable(allocmemf allocmemf.f ../util/mtestf.f)
+#  add_executable(c2f2cf c2f2cf.f c2f2c.c ../util/mtestf.f)
+#  add_executable(ctypesinf ctypesinf.f ctypesfromc.c ../util/mtestf.f)
+
+  target_link_libraries(add1size  simgrid)
+#  target_link_libraries(allocmemf  simgrid)
+#  target_link_libraries(c2f2cf  simgrid)
+#  target_link_libraries(ctypesinf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/add1size.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/allocmemf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/c2f2c.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/c2f2cf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/c2fmult.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/ctypesfromc.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/ctypesinf.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/add1size.h b/teshsuite/smpi/mpich3-test/f77/ext/add1size.h
new file mode 100644 (file)
index 0000000..940a4c3
--- /dev/null
@@ -0,0 +1,6 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+        integer asize
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/allocmemf.f b/teshsuite/smpi/mpich3-test/f77/ext/allocmemf.f
new file mode 100644 (file)
index 0000000..cc8792d
--- /dev/null
@@ -0,0 +1,41 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2004 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+        program main
+        implicit none
+        include 'mpif.h'
+C
+C This program makes use of a common (but not universal; g77 doesn't 
+C have it) extension: the "Cray" pointer.  This allows MPI_Alloc_mem
+C to allocate memory and return it to Fortran, where it can be used.
+C As this is not standard Fortran, this test is not run by default.
+C To run it, build (with a suitable compiler) and run with
+C   mpiexec -n 1 ./allocmemf
+C
+        real a
+        pointer (p,a(100,100))
+        include 'add1size.h'
+        integer ierr, sizeofreal, errs
+        integer i,j
+C
+        errs = 0
+        call mtest_init(ierr)
+        call mpi_type_size( MPI_REAL, sizeofreal, ierr )
+C Make sure we pass in an integer of the correct type
+        asize = sizeofreal * 100 * 100
+        call mpi_alloc_mem( asize,MPI_INFO_NULL,p,ierr )
+
+        do i=1,100
+            do j=1,100
+                a(i,j) = -1
+            enddo
+        enddo
+        a(3,5) = 10.0
+
+        call mpi_free_mem( a, ierr )
+        call mtest_finalize(errs)
+        call mpi_finalize(ierr)
+
+        end
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/c2f2c.c b/teshsuite/smpi/mpich3-test/f77/ext/c2f2c.c
new file mode 100644 (file)
index 0000000..4e048b2
--- /dev/null
@@ -0,0 +1,263 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+ * This file contains the C routines used in testing the c2f and f2c 
+ * handle conversion functions, except for MPI_File and MPI_Win (to
+ * allow working with MPI implementations that do not include those
+ * features).
+ *
+ * The tests follow this pattern:
+ *
+ *  Fortran main program
+ *     calls c routine with each handle type, with a prepared
+ *     and valid handle (often requires constructing an object)
+ *
+ *     C routine uses xxx_f2c routine to get C handle, checks some
+ *     properties (i.e., size and rank of communicator, contents of datatype)
+ *
+ *     Then the Fortran main program calls a C routine that provides
+ *     a handle, and the Fortran program performs similar checks.
+ *
+ * We also assume that a C int is a Fortran integer.  If this is not the
+ * case, these tests must be modified.
+ */
+
+/* style: allow:fprintf:10 sig:0 */
+#include <stdio.h>
+#include "mpi.h"
+#include "../../include/mpitestconf.h"
+#include <string.h>
+
+/* 
+   Name mapping.  All routines are created with names that are lower case
+   with a single trailing underscore.  This matches many compilers.
+   We use #define to change the name for Fortran compilers that do
+   not use the lowercase/underscore pattern 
+*/
+
+#ifdef F77_NAME_UPPER
+#define c2fcomm_ C2FCOMM
+#define c2fgroup_ C2FGROUP
+#define c2ftype_ C2FTYPE
+#define c2finfo_ C2FINFO
+#define c2frequest_ C2FREQUEST
+#define c2fop_ C2FOP
+#define c2ferrhandler_ C2FERRHANDLER
+
+#define f2ccomm_ F2CCOMM
+#define f2cgroup_ F2CGROUP
+#define f2ctype_ F2CTYPE
+#define f2cinfo_ F2CINFO
+#define f2crequest_ F2CREQUEST
+#define f2cop_ F2COP
+#define f2cerrhandler_ F2CERRHANDLER
+
+#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
+/* Mixed is ok because we use lowercase in all uses */
+#define c2fcomm_ c2fcomm
+#define c2fgroup_ c2fgroup
+#define c2ftype_ c2ftype
+#define c2finfo_ c2finfo
+#define c2frequest_ c2frequest
+#define c2fop_ c2fop
+#define c2ferrhandler_ c2ferrhandler
+
+#define f2ccomm_ f2ccomm
+#define f2cgroup_ f2cgroup
+#define f2ctype_ f2ctype
+#define f2cinfo_ f2cinfo
+#define f2crequest_ f2crequest
+#define f2cop_ f2cop
+#define f2cerrhandler_ f2cerrhandler
+
+#elif defined(F77_NAME_LOWER_2USCORE) || defined(F77_NAME_LOWER_USCORE) || \
+      defined(F77_NAME_MIXED_USCORE)
+/* Else leave name alone (routines have no underscore, so both
+   of these map to a lowercase, single underscore) */
+#else 
+#error 'Unrecognized Fortran name mapping'
+#endif
+
+/* Prototypes to keep compilers happy */
+MPI_Fint c2fcomm_( MPI_Fint * );
+MPI_Fint c2fgroup_( MPI_Fint * );
+MPI_Fint c2finfo_( MPI_Fint * );
+MPI_Fint c2frequest_( MPI_Fint * );
+MPI_Fint c2ftype_( MPI_Fint * );
+MPI_Fint c2fop_( MPI_Fint * );
+MPI_Fint c2ferrhandler_( MPI_Fint * );
+
+void f2ccomm_( MPI_Fint * );
+void f2cgroup_( MPI_Fint * );
+void f2cinfo_( MPI_Fint * );
+void f2crequest_( MPI_Fint * );
+void f2ctype_( MPI_Fint * );
+void f2cop_( MPI_Fint * );
+void f2cerrhandler_( MPI_Fint * );
+
+
+MPI_Fint c2fcomm_ (MPI_Fint *comm)
+{
+    MPI_Comm cComm = MPI_Comm_f2c(*comm);
+    int cSize, wSize, cRank, wRank;
+
+    MPI_Comm_size( MPI_COMM_WORLD, &wSize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wRank );
+    MPI_Comm_size( cComm, &cSize );
+    MPI_Comm_rank( cComm, &cRank );
+
+    if (wSize != cSize || wRank != cRank) {
+       fprintf( stderr, "Comm: Did not get expected size,rank (got %d,%d)",
+                cSize, cRank );
+       return 1;
+    }
+    return 0;
+}
+
+MPI_Fint c2fgroup_ (MPI_Fint *group)
+{
+    MPI_Group cGroup = MPI_Group_f2c(*group);
+    int cSize, wSize, cRank, wRank;
+
+    /* We pass in the group of comm world */
+    MPI_Comm_size( MPI_COMM_WORLD, &wSize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wRank );
+    MPI_Group_size( cGroup, &cSize );
+    MPI_Group_rank( cGroup, &cRank );
+
+    if (wSize != cSize || wRank != cRank) {
+       fprintf( stderr, "Group: Did not get expected size,rank (got %d,%d)",
+                cSize, cRank );
+       return 1;
+    }
+    return 0;
+}
+
+MPI_Fint c2ftype_ ( MPI_Fint *type )
+{
+    MPI_Datatype dtype = MPI_Type_f2c( *type );
+
+    if (dtype != MPI_INTEGER) {
+       fprintf( stderr, "Type: Did not get expected type\n" );
+       return 1;
+    }
+    return 0;
+}
+
+MPI_Fint c2finfo_ ( MPI_Fint *info )
+{
+    MPI_Info cInfo = MPI_Info_f2c( *info );
+    int flag;
+    char value[100];
+    MPI_Fint errs = 0;
+
+    MPI_Info_get( cInfo, (char*)"host", sizeof(value), value, &flag );
+    if (!flag || strcmp(value,"myname") != 0) {
+       fprintf( stderr, "Info: Wrong value or no value for host\n" );
+       errs++;
+    }
+    MPI_Info_get( cInfo, (char*)"wdir", sizeof(value), value, &flag );
+    if (!flag || strcmp( value, "/rdir/foo" ) != 0) {
+       fprintf( stderr, "Info: Wrong value of no value for wdir\n" );
+       errs++;
+    }
+
+    return errs;
+}
+
+MPI_Fint c2frequest_ ( MPI_Fint *request )
+{
+    MPI_Request req = MPI_Request_f2c( *request );
+    MPI_Status status;
+    int flag;
+    MPI_Test( &req, &flag, &status );
+    MPI_Test_cancelled( &status, &flag );
+    if (!flag) { 
+       fprintf( stderr, "Request: Wrong value for flag\n" );
+       return 1;
+    }
+    else {
+       *request = MPI_Request_c2f( req );
+    }
+    return 0;
+}
+
+MPI_Fint c2fop_ ( MPI_Fint *op )
+{
+    MPI_Op cOp = MPI_Op_f2c( *op );
+    
+    if (cOp != MPI_SUM) {
+       fprintf( stderr, "Op: did not get sum\n" );
+       return 1;
+    }
+    return 0;
+}
+
+MPI_Fint c2ferrhandler_ ( MPI_Fint *errh )
+{
+    MPI_Errhandler errhand = MPI_Errhandler_f2c( *errh );
+
+    if (errhand != MPI_ERRORS_RETURN) {
+       fprintf( stderr, "Errhandler: did not get errors return\n" );
+       return 1;
+    }
+       
+    return 0;
+}
+
+/* 
+ * The following routines provide handles to the calling Fortran program
+ */
+void f2ccomm_( MPI_Fint * comm )
+{
+    *comm = MPI_Comm_c2f( MPI_COMM_WORLD );
+}
+
+void f2cgroup_( MPI_Fint * group )
+{
+    MPI_Group wgroup;
+    MPI_Comm_group( MPI_COMM_WORLD, &wgroup );
+    *group = MPI_Group_c2f( wgroup );
+}
+
+void f2ctype_( MPI_Fint * type )
+{
+    *type = MPI_Type_c2f( MPI_INTEGER );
+}
+
+void f2cinfo_( MPI_Fint * info )
+{
+    MPI_Info cinfo;
+
+    MPI_Info_create( &cinfo );
+    MPI_Info_set( cinfo, (char*)"host", (char*)"myname" );
+    MPI_Info_set( cinfo, (char*)"wdir", (char*)"/rdir/foo" );
+
+    *info = MPI_Info_c2f( cinfo );
+}
+
+void f2crequest_( MPI_Fint * req )
+{
+    MPI_Request cReq;
+
+    MPI_Irecv( NULL, 0, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, 
+              MPI_COMM_WORLD, &cReq );
+    MPI_Cancel( &cReq );
+    *req = MPI_Request_c2f( cReq );
+    
+}
+
+void f2cop_( MPI_Fint * op )
+{
+    *op = MPI_Op_c2f( MPI_SUM );
+}
+
+void f2cerrhandler_( MPI_Fint *errh )
+{
+    *errh = MPI_Errhandler_c2f( MPI_ERRORS_RETURN );
+}
+
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/c2f2cf.f b/teshsuite/smpi/mpich3-test/f77/ext/c2f2cf.f
new file mode 100644 (file)
index 0000000..1755925
--- /dev/null
@@ -0,0 +1,121 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer errs, toterrs, ierr
+      integer wrank, wsize
+      integer wgroup, info, req
+      integer fsize, frank
+      integer comm, group, type, op, errh, result
+      integer c2fcomm, c2fgroup, c2ftype, c2finfo, c2frequest,
+     $     c2ferrhandler, c2fop
+      character value*100
+      logical   flag
+      errs = 0
+
+      call mpi_init( ierr )
+
+C
+C Test passing a Fortran MPI object to C
+      call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
+      errs = errs + c2fcomm( MPI_COMM_WORLD )
+      call mpi_comm_group( MPI_COMM_WORLD, wgroup, ierr )
+      errs = errs + c2fgroup( wgroup )
+      call mpi_group_free( wgroup, ierr )
+
+      call mpi_info_create( info, ierr )
+      call mpi_info_set( info, "host", "myname", ierr )
+      call mpi_info_set( info, "wdir", "/rdir/foo", ierr )
+      errs = errs + c2finfo( info )
+      call mpi_info_free( info, ierr )
+
+      errs = errs + c2ftype( MPI_INTEGER )
+
+      call mpi_irecv( 0, 0, MPI_INTEGER, MPI_ANY_SOURCE, MPI_ANY_TAG,
+     $     MPI_COMM_WORLD, req, ierr )
+      call mpi_cancel( req, ierr )
+      errs = errs + c2frequest( req )
+      call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+
+      errs = errs + c2ferrhandler( MPI_ERRORS_RETURN )
+
+      errs = errs + c2fop( MPI_SUM )
+
+C
+C Test using a C routine to provide the Fortran handle
+      call mpi_comm_size( MPI_COMM_WORLD, wsize, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
+
+      call f2ccomm( comm )
+      call mpi_comm_size( comm, fsize, ierr )
+      call mpi_comm_rank( comm, frank, ierr )
+      if (fsize.ne.wsize .or. frank.ne.wrank) then
+         errs = errs + 1
+         print *, "Comm(fortran) has wrong size or rank"
+      endif
+      
+      call f2cgroup( group )
+      call mpi_group_size( group, fsize, ierr )
+      call mpi_group_rank( group, frank, ierr )
+      if (fsize.ne.wsize .or. frank.ne.wrank) then
+         errs = errs + 1
+         print *, "Group(fortran) has wrong size or rank"
+      endif
+      call mpi_group_free( group, ierr )
+
+      call f2ctype( type )
+      if (type .ne. MPI_INTEGER) then
+         errs = errs + 1
+         print *, "Datatype(fortran) is not MPI_INT"
+      endif
+      
+      call f2cinfo( info )
+      call mpi_info_get( info, "host", 100, value, flag, ierr )
+      if (.not. flag) then
+         errs = errs + 1
+         print *, "Info test for host returned false"
+      else if (value .ne. "myname") then
+         errs = errs + 1
+         print *, "Info test for host returned ", value
+      endif
+      call mpi_info_get( info, "wdir", 100, value, flag, ierr )
+      if (.not. flag) then
+         errs = errs + 1
+         print *, "Info test for wdir returned false"
+      else if (value .ne. "/rdir/foo") then
+         errs = errs + 1
+         print *, "Info test for wdir returned ", value
+      endif
+      call mpi_info_free( info, ierr )
+
+      call f2cop( op )
+      if (op .ne. MPI_SUM) then
+          errs = errs + 1
+          print *, "Fortran MPI_SUM not MPI_SUM in C"
+      endif
+
+      call f2cerrhandler( errh )
+      if (errh .ne. MPI_ERRORS_RETURN) then
+          errs = errs + 1
+          print *,"Fortran MPI_ERRORS_RETURN not MPI_ERRORS_RETURN in C"
+      endif
+C
+C Summarize the errors
+C
+      call mpi_allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,
+     $     MPI_COMM_WORLD, ierr )
+      if (wrank .eq. 0) then
+         if (toterrs .eq. 0) then
+            print *, ' No Errors'
+         else
+            print *, ' Found ', toterrs, ' errors'
+         endif
+      endif
+
+      call mpi_finalize( ierr )
+      end
+      
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/c2fmult.c b/teshsuite/smpi/mpich3-test/f77/ext/c2fmult.c
new file mode 100644 (file)
index 0000000..07c21d6
--- /dev/null
@@ -0,0 +1,60 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*
+  Check that MPI_xxxx_c2f, applied to the same object several times,
+  yields the same handle.  We do this because when MPI handles in 
+  C are a different length than those in Fortran, care needs to 
+  be exercised to ensure that the mapping from one to another is unique.
+  (Test added to test a potential problem in ROMIO for handling MPI_File
+  on 64-bit systems)
+*/
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    MPI_Fint handleA, handleB;
+    int      rc;
+    int      errs = 0;
+    int      buf[1];
+    MPI_Request cRequest;
+    MPI_Status st;
+    int        tFlag;
+
+    MTest_Init( &argc, &argv );
+
+    /* Request */
+    rc = MPI_Irecv( buf, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &cRequest );
+    if (rc) {
+       errs++;
+       printf( "Unable to create request\n" );
+    }
+    else {
+       handleA = MPI_Request_c2f( cRequest );
+       handleB = MPI_Request_c2f( cRequest );
+       if (handleA != handleB) {
+           errs++;
+           printf( "MPI_Request_c2f does not give the same handle twice on the same MPI_Request\n" );
+       }
+    }
+    MPI_Cancel( &cRequest );
+    MPI_Test( &cRequest, &tFlag, &st );
+    MPI_Test_cancelled( &st, &tFlag );
+    if (!tFlag) {
+       errs++;
+       printf( "Unable to cancel MPI_Irecv request\n" );
+    }
+    /* Using MPI_Request_free should be ok, but some MPI implementations
+       object to it imediately after the cancel and that isn't essential to
+       this test */
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/ctypesfromc.c b/teshsuite/smpi/mpich3-test/f77/ext/ctypesfromc.c
new file mode 100644 (file)
index 0000000..51015da
--- /dev/null
@@ -0,0 +1,118 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+/*
+ * This file contains the C routines used in testing that all C datatypes
+ * are available in Fortran and have the correct values.
+ *
+ * The tests follow this pattern:
+ *
+ *  Fortran main program
+ *     calls the c routine f2ctype with each of the C types and the name of 
+ *     the type.  That c routine using MPI_Type_f2c to convert the 
+ *     Fortran handle to a C handle, and then compares it to the corresponding
+ *     C type, which is found by looking up the C handle by name
+ *
+ *     C routine uses xxx_f2c routine to get C handle, checks some
+ *     properties (i.e., size and rank of communicator, contents of datatype)
+ *
+ *     Then the Fortran main program calls a C routine that provides
+ *     a handle, and the Fortran program performs similar checks.
+ *
+ * We also assume that a C int is a Fortran integer.  If this is not the
+ * case, these tests must be modified.
+ */
+
+/* style: allow:fprintf:10 sig:0 */
+#include <stdio.h>
+#include "mpi.h"
+#include "../../include/mpitestconf.h"
+#include <string.h>
+
+/* Create an array with all of the MPI names in it */
+/* This is extracted from the test in test/mpi/types/typename.c ; only the
+   C types are included. */
+
+typedef struct mpi_names_t { MPI_Datatype dtype; const char *name; } mpi_names_t;
+
+/* The MPI standard specifies that the names must be the MPI names,
+   not the related language names (e.g., MPI_CHAR, not char) */
+
+static mpi_names_t mpi_names[] = {
+    { MPI_CHAR, "MPI_CHAR" },
+    { MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR" },
+    { MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR" },
+    { MPI_WCHAR, "MPI_WCHAR" },
+    { MPI_SHORT, "MPI_SHORT" },
+    { MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT" },
+    { MPI_INT, "MPI_INT" },
+    { MPI_UNSIGNED, "MPI_UNSIGNED" },
+    { MPI_LONG, "MPI_LONG" },
+    { MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG" },
+    { MPI_FLOAT, "MPI_FLOAT" },
+    { MPI_DOUBLE, "MPI_DOUBLE" },
+    { MPI_FLOAT_INT, "MPI_FLOAT_INT" },
+    { MPI_DOUBLE_INT, "MPI_DOUBLE_INT" },
+    { MPI_LONG_INT, "MPI_LONG_INT" },
+    { MPI_SHORT_INT, "MPI_SHORT_INT" },
+    { MPI_2INT, "MPI_2INT" },
+    { MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE" },
+    { MPI_LONG_LONG_INT, "MPI_LONG_LONG_INT" }, 
+    { MPI_LONG_LONG, "MPI_LONG_LONG" },
+    { MPI_UNSIGNED_LONG_LONG, "MPI_UNSIGNED_LONG_LONG" }, 
+    { MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT" },
+    { 0, (char *)0 },  /* Sentinal used to indicate the last element */
+};
+
+/* 
+   Name mapping.  All routines are created with names that are lower case
+   with a single trailing underscore.  This matches many compilers.
+   We use #define to change the name for Fortran compilers that do
+   not use the lowercase/underscore pattern 
+*/
+
+#ifdef F77_NAME_UPPER
+#define f2ctype_ F2CTYPE
+
+#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
+/* Mixed is ok because we use lowercase in all uses */
+#define f2ctype_ f2ctype
+
+#elif defined(F77_NAME_LOWER_2USCORE) || defined(F77_NAME_LOWER_USCORE) || \
+      defined(F77_NAME_MIXED_USCORE)
+/* Else leave name alone (routines have no underscore, so both
+   of these map to a lowercase, single underscore) */
+#else 
+#error 'Unrecognized Fortran name mapping'
+#endif
+
+/* Prototypes to keep compilers happy */
+int f2ctype_( MPI_Fint *, MPI_Fint * );
+
+/* */
+int f2ctype_( MPI_Fint *fhandle, MPI_Fint *typeidx )
+{
+    int errs = 0;
+    MPI_Datatype ctype;
+
+    /* printf( "Testing %s\n", mpi_names[*typeidx].name ); */
+    ctype = MPI_Type_f2c( *fhandle );
+    if (ctype != mpi_names[*typeidx].dtype) {
+       char mytypename[MPI_MAX_OBJECT_NAME];
+       int mytypenamelen;
+       /* An implementation is not *required* to deliver the 
+          corresponding C version of the MPI Datatype bit-for-bit.  But 
+          if *must* act like it - e.g., the datatype name must be the same */
+       MPI_Type_get_name( ctype, mytypename, &mytypenamelen );
+       if (strcmp( mytypename, mpi_names[*typeidx].name ) != 0) {
+           errs++;
+           printf( "C and Fortran types for %s (c name is %s) do not match f=%d, ctof=%d.\n",
+                   mpi_names[*typeidx].name, mytypename, *fhandle, MPI_Type_c2f( ctype ) );
+       }
+    }
+    
+    return errs;
+}
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/ctypesinf.f b/teshsuite/smpi/mpich3-test/f77/ext/ctypesinf.f
new file mode 100644 (file)
index 0000000..4693bc8
--- /dev/null
@@ -0,0 +1,49 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2010 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      include 'mpif.h'
+      integer ierr
+      integer errs, wrank
+      integer f2ctype
+C
+      call mtest_init( ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
+C
+      errs = 0
+C
+      errs = errs + f2ctype( MPI_CHAR, 0 )
+      errs = errs + f2ctype( MPI_SIGNED_CHAR, 1 )
+      errs = errs + f2ctype( MPI_UNSIGNED_CHAR, 2 )
+      errs = errs + f2ctype( MPI_WCHAR, 3 )
+      errs = errs + f2ctype( MPI_SHORT, 4 )
+      errs = errs + f2ctype( MPI_UNSIGNED_SHORT, 5 )
+      errs = errs + f2ctype( MPI_INT, 6 )
+      errs = errs + f2ctype( MPI_UNSIGNED, 7 )
+      errs = errs + f2ctype( MPI_LONG, 8 )
+      errs = errs + f2ctype( MPI_UNSIGNED_LONG, 9 )
+      errs = errs + f2ctype( MPI_FLOAT, 10 )
+      errs = errs + f2ctype( MPI_DOUBLE, 11 )
+      errs = errs + f2ctype( MPI_FLOAT_INT, 12 )
+      errs = errs + f2ctype( MPI_DOUBLE_INT, 13 )
+      errs = errs + f2ctype( MPI_LONG_INT, 14 )
+      errs = errs + f2ctype( MPI_SHORT_INT, 15 )
+      errs = errs + f2ctype( MPI_2INT, 16 )
+      if (MPI_LONG_DOUBLE .ne. MPI_TYPE_NULL) then
+          errs = errs + f2ctype( MPI_LONG_DOUBLE, 17 )
+          errs = errs + f2ctype( MPI_LONG_DOUBLE_INT, 21 )
+      endif
+      if (MPI_LONG_LONG .ne. MPI_TYPE_NULL) then
+          errs = errs + f2ctype( MPI_LONG_LONG_INT, 18 )
+          errs = errs + f2ctype( MPI_LONG_LONG, 19 )
+          errs = errs + f2ctype( MPI_UNSIGNED_LONG_LONG, 20 )
+      endif
+C
+C Summarize the errors
+C
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end 
diff --git a/teshsuite/smpi/mpich3-test/f77/ext/testlist b/teshsuite/smpi/mpich3-test/f77/ext/testlist
new file mode 100644 (file)
index 0000000..745768e
--- /dev/null
@@ -0,0 +1,4 @@
+#c2f2cf 1
+#c2fmult 1
+#ctypesinf 1
+
diff --git a/teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c307f82
--- /dev/null
@@ -0,0 +1,42 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(baseenvf baseenvf.f ../util/mtestf.f)
+  target_link_libraries(baseenvf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseenvf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/checksizes.c
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/init/baseenvf.f b/teshsuite/smpi/mpich3-test/f77/init/baseenvf.f
new file mode 100644 (file)
index 0000000..b8b1f6c
--- /dev/null
@@ -0,0 +1,90 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer ierr, provided, errs, rank, size
+       integer iv, isubv, qprovided
+       logical flag
+
+       errs = 0
+       flag = .true.
+       call mpi_finalized( flag, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Returned true for finalized before init'
+       endif
+       flag = .true.
+       call mpi_initialized( flag, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Return true for initialized before init'
+       endif
+
+       provided = -1
+       call mpi_init_thread( MPI_THREAD_MULTIPLE, provided, ierr )
+
+       if (provided .ne. MPI_THREAD_MULTIPLE .and. 
+     &     provided .ne. MPI_THREAD_SERIALIZED .and.
+     &     provided .ne. MPI_THREAD_FUNNELED .and.
+     &     provided .ne. MPI_THREAD_SINGLE) then
+          errs = errs + 1
+          print *, ' Unrecognized value for provided = ', provided
+       endif
+
+       iv    = -1
+       isubv = -1
+       call mpi_get_version( iv, isubv, ierr )
+       if (iv .ne. MPI_VERSION .or. isubv .ne. MPI_SUBVERSION) then
+          errs = errs + 1
+          print *, 'Version in mpif.h and get_version do not agree'
+          print *, 'Version in mpif.h is ', MPI_VERSION, '.', 
+     &              MPI_SUBVERSION
+          print *, 'Version in get_version is ', iv, '.', isubv
+       endif
+       if (iv .lt. 1 .or. iv .gt. 3) then
+          errs = errs + 1
+          print *, 'Version of MPI is invalid (=', iv, ')'
+       endif
+       if (isubv.lt.0 .or. isubv.gt.2) then
+          errs = errs + 1
+          print *, 'Subversion of MPI is invalid (=', isubv, ')'
+       endif
+
+       call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+       call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+
+       flag = .false.
+       call mpi_is_thread_main( flag, ierr )
+       if (.not.flag) then
+          errs = errs + 1
+          print *, 'is_thread_main returned false for main thread'
+       endif
+          
+       call mpi_query_thread( qprovided, ierr )
+       if (qprovided .ne. provided) then
+          errs = errs + 1
+          print *,'query thread and init thread disagree on'//
+     &           ' thread level'
+       endif
+
+       call mpi_finalize( ierr )
+       flag = .false.
+       call mpi_finalized( flag, ierr )
+       if (.not. flag) then
+          errs = errs + 1
+          print *, 'finalized returned false after finalize'
+       endif
+
+       if (rank .eq. 0) then
+          if (errs .eq. 0) then 
+             print *, ' No Errors'
+          else
+             print *, ' Found ', errs, ' errors'
+          endif
+       endif
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f77/init/checksizes.c b/teshsuite/smpi/mpich3-test/f77/init/checksizes.c
new file mode 100644 (file)
index 0000000..e91dc8d
--- /dev/null
@@ -0,0 +1,23 @@
+#include "mpi.h"
+#include <stdio.h>
+int main( int argc, char **argv )
+{
+  int fsizeof_aint   = ;
+  int fsizeof_offset = ;
+  int err = 0, rc = 0;
+
+  MPI_Init( &argc, &argv );
+  if (sizeof(MPI_Aint) != fsizeof_aint) {
+     printf( "Sizeof MPI_Aint is %d but Fortran thinks it is %d\n",
+             (int)sizeof(MPI_Aint), fsizeof_aint );
+     err++;
+  }
+  if (sizeof(MPI_Offset) != fsizeof_offset) {
+     printf( "Sizeof MPI_Offset is %d but Fortran thinks it is %d\n",
+             (int)sizeof(MPI_Offset), fsizeof_offset );
+     err++;
+  }
+  MPI_Finalize( );
+  if (err > 0) rc = 1;
+  return rc;
+}
diff --git a/teshsuite/smpi/mpich3-test/f77/init/testlist b/teshsuite/smpi/mpich3-test/f77/init/testlist
new file mode 100644 (file)
index 0000000..0b0b623
--- /dev/null
@@ -0,0 +1 @@
+baseenvf 1
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7ccf420
--- /dev/null
@@ -0,0 +1,54 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(allpairf allpairf.f ../util/mtestf.f)
+  add_executable(greqf greqf.f dummyf.f ../util/mtestf.f)
+  #add_executable(mprobef mprobef.f ../util/mtestf.f)
+  add_executable(statusesf statusesf.f ../util/mtestf.f)
+
+  target_link_libraries(allpairf  simgrid)
+  target_link_libraries(greqf  simgrid)
+  #target_link_libraries(mprobef  simgrid)
+  target_link_libraries(statusesf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allpairf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/attr1aints.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/dummyf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/greqf.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/mprobef.f
+  ${CMAKE_CURRENT_SOURCE_DIR}/statusesf.f
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f
new file mode 100644 (file)
index 0000000..ddc5164
--- /dev/null
@@ -0,0 +1,1024 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2012 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C This program is based on the allpair.f test from the MPICH-1 test
+C (test/pt2pt/allpair.f), which in turn was inspired by a bug report from
+C fsset@corelli.lerc.nasa.gov (Scott Townsend)
+
+      program allpair
+      implicit none
+      include 'mpif.h'
+      integer ierr, errs, comm
+      logical mtestGetIntraComm
+      logical verbose
+      common /flags/ verbose
+      
+      errs = 0
+      verbose = .false.
+C      verbose = .true.
+      call MTest_Init( ierr )
+
+      do while ( mtestGetIntraComm( comm, 2, .false. ) )
+         call test_pair_send( comm, errs )
+         call test_pair_ssend( comm, errs )
+         !call test_pair_rsend( comm, errs )
+         call test_pair_isend( comm, errs )
+         !call test_pair_irsend( comm, errs )
+         call test_pair_issend( comm, errs )
+         !call test_pair_psend( comm, errs )
+         !call test_pair_prsend( comm, errs )
+         call test_pair_pssend( comm, errs )
+         call test_pair_sendrecv( comm, errs )
+         call test_pair_sendrecvrepl( comm, errs )
+         call mtestFreeComm( comm )
+      enddo
+C         
+      call MTest_Finalize( errs )
+      call MPI_Finalize(ierr)
+C
+      end
+C
+      subroutine test_pair_send( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Send and recv'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 1123
+      count = TEST_SIZE / 5
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Send(send_buf, count, MPI_REAL, next, tag,
+     .        comm, ierr) 
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, status, ierr)
+C
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE,
+     .                   'send and recv', errs )
+      else if (prev .eq. 0)  then
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'send and recv', errs )
+C
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag, comm, ierr) 
+      end if
+C
+      end
+C
+      subroutine test_pair_rsend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(1)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Rsend and recv'
+      endif
+C
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 1456
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C        
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
+     .                  comm, status, ierr )
+C
+         call MPI_Rsend(send_buf, count, MPI_REAL, next, tag,
+     .                  comm, ierr) 
+C
+         call MPI_Probe(MPI_ANY_SOURCE, tag, comm, status, ierr) 
+C
+         if (status(MPI_SOURCE) .ne. next) then
+            print *, 'Rsend: Incorrect source, expected', next,
+     .               ', got', status(MPI_SOURCE)
+            errs = errs + 1
+         end if
+C
+         if (status(MPI_TAG) .ne. tag) then
+            print *, 'Rsend: Incorrect tag, expected', tag,
+     .               ', got', status(MPI_TAG)
+            errs = errs + 1
+         end if
+C
+         call MPI_Get_count(status, MPI_REAL, i, ierr)
+C
+         if (i .ne. count) then
+            print *, 'Rsend: Incorrect count, expected', count,
+     .               ', got', i
+            errs = errs + 1
+         end if
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, 
+     .                 status, ierr)
+C
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE,
+     .                   'rsend and recv', errs )
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 requests(1), ierr)
+         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, prev, tag, 
+     .                  comm, ierr )
+         call MPI_Wait( requests(1), status, ierr )
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'rsend and recv', errs )
+C
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag,
+     .                  comm, ierr) 
+      end if
+C
+      end
+C
+      subroutine test_pair_ssend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Ssend and recv'
+      endif
+C
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 1789
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Iprobe(MPI_ANY_SOURCE, tag,
+     .                   comm, flag, status, ierr) 
+C
+         if (flag) then
+            print *, 'Ssend: Iprobe succeeded! source', 
+     .               status(MPI_SOURCE),
+     .               ', tag', status(MPI_TAG)
+            errs = errs + 1
+         end if
+C
+         call MPI_Ssend(send_buf, count, MPI_REAL, next, tag,
+     .                  comm, ierr) 
+C
+         do while (.not. flag)
+            call MPI_Iprobe(MPI_ANY_SOURCE, tag,
+     .                      comm, flag, status, ierr) 
+         end do
+C           
+         if (status(MPI_SOURCE) .ne. next) then
+            print *, 'Ssend: Incorrect source, expected', next,
+     .               ', got', status(MPI_SOURCE)
+            errs = errs + 1
+         end if
+C
+         if (status(MPI_TAG) .ne. tag) then
+            print *, 'Ssend: Incorrect tag, expected', tag,
+     .               ', got', status(MPI_TAG)
+            errs = errs + 1
+         end if
+C
+         call MPI_Get_count(status, MPI_REAL, i, ierr)
+C
+         if (i .ne. count) then
+            print *, 'Ssend: Incorrect count, expected', count,
+     .               ', got', i
+            errs = errs + 1
+         end if
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+C
+         call msg_check( recv_buf, next, tag, count, status,
+     .        TEST_SIZE, 'ssend and recv', errs ) 
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+C
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'ssend and recv', errs )
+C
+         call MPI_Ssend(recv_buf, count, MPI_REAL, prev, tag,
+     .                  comm, ierr) 
+      end if
+C
+      end
+C
+      subroutine test_pair_isend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' isend and irecv'
+      endif
+C
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 2123
+      count = TEST_SIZE / 5
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                  requests(1), ierr)
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Isend(send_buf, count, MPI_REAL, next, tag,
+     .                  comm, requests(2), ierr) 
+C
+         call MPI_Waitall(2, requests, statuses, ierr)
+C
+         call rq_check( requests, 2, 'isend and irecv' )
+C
+         call msg_check( recv_buf, next, tag, count, statuses(1,1),
+     .        TEST_SIZE, 'isend and irecv', errs )
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+C
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'isend and irecv', errs )
+C
+         call MPI_Isend(recv_buf, count, MPI_REAL, prev, tag,
+     .                  comm, requests(1), ierr) 
+C
+         call MPI_Wait(requests(1), status, ierr)
+C
+C         call rq_check( requests(1), 1, 'isend and irecv' )
+C
+      end if
+C
+      end
+C
+      subroutine test_pair_irsend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer TEST_SIZE
+      integer dupcom
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Irsend and irecv'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      call mpi_comm_dup( comm, dupcom, ierr )
+C
+      tag = 2456
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                  requests(1), ierr)
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
+     .                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0, 
+     .                      dupcom, status, ierr )
+C
+         call MPI_Irsend(send_buf, count, MPI_REAL, next, tag,
+     .                   comm, requests(2), ierr) 
+C
+         index = -1
+         do while (index .ne. 1)
+            call MPI_Waitany(2, requests, index, statuses, ierr)
+         end do
+C
+         call rq_check( requests(1), 1, 'irsend and irecv' )
+C
+         call msg_check( recv_buf, next, tag, count, statuses,
+     .           TEST_SIZE, 'irsend and irecv', errs )
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                  requests(1), ierr)
+C
+         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, prev, 0, 
+     .                      MPI_BOTTOM, 0, MPI_INTEGER, prev, 0, 
+     .                      dupcom, status, ierr )
+C
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Test(requests(1), flag, status, ierr)
+         end do
+C
+         call rq_check( requests, 1, 'irsend and irecv (test)' )
+C
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'irsend and irecv', errs )
+C
+         call MPI_Irsend(recv_buf, count, MPI_REAL, prev, tag,
+     .                   comm, requests(1), ierr) 
+C
+         call MPI_Waitall(1, requests, statuses, ierr)
+C
+         call rq_check( requests, 1, 'irsend and irecv' )
+C
+      end if
+C
+      call mpi_comm_free( dupcom, ierr )
+C
+      end
+C
+      subroutine test_pair_issend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' issend and irecv (testall)'
+      endif
+C
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 2789
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      if (rank .eq. 0) then
+C
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                  requests(1), ierr)
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Issend(send_buf, count, MPI_REAL, next, tag,
+     .                   comm, requests(2), ierr) 
+C
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testall(2, requests, flag, statuses, ierr)
+         end do
+C
+         call rq_check( requests, 2, 'issend and irecv (testall)' )
+C
+         call msg_check( recv_buf, next, tag, count, statuses(1,1),
+     .           TEST_SIZE, 'issend and recv (testall)', errs )
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'issend and recv', errs )
+
+         call MPI_Issend(recv_buf, count, MPI_REAL, prev, tag,
+     .                   comm, requests(1), ierr) 
+C
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testany(1, requests(1), index, flag,
+     .                       statuses(1,1), ierr)
+         end do
+C
+         call rq_check( requests, 1, 'issend and recv (testany)' )
+C
+      end if
+C
+      end
+C
+      subroutine test_pair_psend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Persistent send and recv'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 3123
+      count = TEST_SIZE / 5
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
+     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                   requests(2), ierr)
+C
+      if (rank .eq. 0) then
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Send_init(send_buf, count, MPI_REAL, next, tag,
+     .                      comm, requests(1), ierr) 
+C
+         call MPI_Startall(2, requests, ierr) 
+         call MPI_Waitall(2, requests, statuses, ierr)
+C
+         call msg_check( recv_buf, next, tag, count, statuses(1,2),
+     .        TEST_SIZE, 'persistent send/recv', errs )
+C
+         call MPI_Request_free(requests(1), ierr)
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Send_init(send_buf, count, MPI_REAL, prev, tag,
+     .                      comm, requests(1), ierr) 
+         call MPI_Start(requests(2), ierr) 
+         call MPI_Wait(requests(2), status, ierr)
+C
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     *                   'persistent send/recv', errs )
+C
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+C
+         call MPI_Start(requests(1), ierr) 
+         call MPI_Wait(requests(1), status, ierr)
+C
+         call MPI_Request_free(requests(1), ierr)
+      end if
+C
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(2), ierr)
+C
+      end
+C
+      subroutine test_pair_prsend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer outcount, indices(2)
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Persistent Rsend and recv'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 3456
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
+     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                   requests(2), ierr)
+C
+      if (rank .eq. 0) then
+C
+         call MPI_Rsend_init(send_buf, count, MPI_REAL, next, tag,
+     .                       comm, requests(1), ierr) 
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag, 
+     .                  comm, status, ierr )
+C
+         call MPI_Startall(2, requests, ierr)
+C
+         index = -1
+C
+         do while (index .ne. 2)
+            call MPI_Waitsome(2, requests, outcount,
+     .                        indices, statuses, ierr)
+            do i = 1,outcount
+               if (indices(i) .eq. 2) then
+                  call msg_check( recv_buf, next, tag, count,
+     .                 statuses(1,i), TEST_SIZE, 'waitsome', errs )
+                  index = 2
+               end if
+            end do
+         end do
+C
+         call MPI_Request_free(requests(1), ierr)
+      else if (prev .eq. 0) then
+C
+         call MPI_Rsend_init(send_buf, count, MPI_REAL, prev, tag,
+     .                       comm, requests(1), ierr) 
+C
+         call MPI_Start(requests(2), ierr)
+C
+         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, prev, tag, 
+     .                  comm, ierr )
+C
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Test(requests(2), flag, status, ierr)
+         end do
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'test', errs )
+C
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+C
+         call MPI_Start(requests(1), ierr)
+         call MPI_Wait(requests(1), status, ierr)
+C
+         call MPI_Request_free(requests(1), ierr)
+      end if
+C
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(2), ierr)
+C
+      end
+C
+      subroutine test_pair_pssend( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer outcount, indices(2)
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Persistent Ssend and recv'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 3789
+      count = TEST_SIZE / 3
+C
+      call clear_test_data(recv_buf,TEST_SIZE)
+C
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL,
+     .                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                   requests(1), ierr)
+C
+      if (rank .eq. 0) then
+C
+         call MPI_Ssend_init(send_buf, count, MPI_REAL, next, tag,
+     .                       comm, requests(2), ierr) 
+C
+         call init_test_data(send_buf,TEST_SIZE)
+C
+         call MPI_Startall(2, requests, ierr)
+C
+         index = -1
+         do while (index .ne. 1)
+            call MPI_Testsome(2, requests, outcount,
+     .                        indices, statuses, ierr)
+            do i = 1,outcount
+               if (indices(i) .eq. 1) then
+                  call msg_check( recv_buf, next, tag, count,
+     .                 statuses(1,i), TEST_SIZE, 'testsome', errs )
+                  index = 1
+               end if
+            end do
+         end do
+C
+         call MPI_Request_free(requests(2), ierr)
+C
+      else if (prev .eq. 0) then
+C
+         call MPI_Ssend_init(send_buf, count, MPI_REAL, prev, tag,
+     .                       comm, requests(2), ierr) 
+C
+         call MPI_Start(requests(1), ierr)
+C
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testany(1, requests(1), index, flag,
+     .                       statuses(1,1), ierr)
+         end do
+         call msg_check( recv_buf, prev, tag, count, statuses(1,1),
+     .           TEST_SIZE, 'testany', errs )
+
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+C
+         call MPI_Start(requests(2), ierr)
+         call MPI_Wait(requests(2), status, ierr)
+C
+         call MPI_Request_free(requests(2), ierr)
+C
+      end if
+C
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(1), ierr)
+C
+      end
+C
+      subroutine test_pair_sendrecv( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Sendrecv'
+      endif
+C
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 4123
+      count = TEST_SIZE / 5
+
+      call clear_test_data(recv_buf,TEST_SIZE)
+
+      if (rank .eq. 0) then
+
+         call init_test_data(send_buf,TEST_SIZE)
+
+         call MPI_Sendrecv(send_buf, count, MPI_REAL, next, tag,
+     .                     recv_buf, count, MPI_REAL, next, tag,
+     .                     comm, status, ierr) 
+
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE,
+     .                   'sendrecv', errs )
+
+      else if (prev .eq. 0) then
+
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'recv/send', errs )
+
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag,
+     .                 comm, ierr) 
+      end if
+C
+      end
+C
+      subroutine test_pair_sendrecvrepl( comm, errs )
+      implicit none
+      include 'mpif.h'
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+C
+      if (verbose) then
+         print *, ' Sendrecv replace'
+      endif
+C
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+C
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+C
+      tag = 4456
+      count = TEST_SIZE / 3
+
+      if (rank .eq. 0) then
+C
+         call init_test_data(recv_buf, TEST_SIZE)
+C
+         do 11 i = count+1,TEST_SIZE
+            recv_buf(i) = 0.0
+ 11      continue
+C
+         call MPI_Sendrecv_replace(recv_buf, count, MPI_REAL,
+     .                             next, tag, next, tag,
+     .                             comm, status, ierr)  
+
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE,
+     .                   'sendrecvreplace', errs )
+
+      else if (prev .eq. 0) then
+
+         call clear_test_data(recv_buf,TEST_SIZE)
+
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL,
+     .                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,
+     .                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE,
+     .                   'recv/send for replace', errs )
+
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag,
+     .                 comm, ierr) 
+      end if
+C
+      end
+C
+c------------------------------------------------------------------------------
+c
+c  Check for correct source, tag, count, and data in test message.
+c
+c------------------------------------------------------------------------------
+      subroutine msg_check( recv_buf, source, tag, count, status, n, 
+     *                      name, errs )
+      implicit none
+      include 'mpif.h'
+      integer n, errs
+      real    recv_buf(n)
+      integer source, tag, count, rank, status(MPI_STATUS_SIZE)
+      character*(*) name
+
+      integer ierr, recv_src, recv_tag, recv_count
+
+      recv_src = status(MPI_SOURCE)
+      recv_tag = status(MPI_TAG)
+      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
+      call MPI_Get_count(status, MPI_REAL, recv_count, ierr)
+
+      if (recv_src .ne. source) then
+         print *, '[', rank, '] Unexpected source:', recv_src, 
+     *            ' in ', name
+         errs       = errs + 1
+      end if
+
+      if (recv_tag .ne. tag) then
+         print *, '[', rank, '] Unexpected tag:', recv_tag, ' in ', name
+         errs       = errs + 1
+      end if
+
+      if (recv_count .ne. count) then
+         print *, '[', rank, '] Unexpected count:', recv_count,
+     *            ' in ', name
+         errs       = errs + 1
+      end if
+         
+      call verify_test_data(recv_buf, count, n, name, errs )
+
+      end
+c------------------------------------------------------------------------------
+c
+c  Check that requests have been set to null
+c
+c------------------------------------------------------------------------------
+      subroutine rq_check( requests, n, msg )
+      include 'mpif.h'
+      integer n, requests(n)
+      character*(*) msg
+      integer i
+c
+      do 10 i=1, n
+         if (requests(i) .ne. MPI_REQUEST_NULL) then
+            print *, 'Nonnull request in ', msg
+         endif
+ 10   continue
+c      
+      end
+c------------------------------------------------------------------------------
+c
+c  Initialize test data buffer with integral sequence.
+c
+c------------------------------------------------------------------------------
+      subroutine init_test_data(buf,n)
+      integer n
+      real buf(n)
+      integer i
+
+      do 10 i = 1, n
+         buf(i) = REAL(i)
+ 10    continue
+      end
+
+c------------------------------------------------------------------------------
+c
+c  Clear test data buffer
+c
+c------------------------------------------------------------------------------
+      subroutine clear_test_data(buf, n)
+      integer n
+      real buf(n)
+      integer i
+
+      do 10 i = 1, n
+         buf(i) = 0.
+ 10   continue
+
+      end
+
+c------------------------------------------------------------------------------
+c
+c  Verify test data buffer
+c
+c------------------------------------------------------------------------------
+      subroutine verify_test_data( buf, count, n, name, errs )
+      implicit none
+      include 'mpif.h'
+      integer n, errs
+      real buf(n)
+      character *(*) name
+      integer count, ierr, i
+C
+      do 10 i = 1, count
+         if (buf(i) .ne. REAL(i)) then
+            print 100, buf(i), i, count, name
+            errs = errs + 1
+         endif
+ 10   continue
+C
+      do 20 i = count + 1, n
+         if (buf(i) .ne. 0.) then
+            print 100, buf(i), i, n, name
+            errs = errs + 1
+         endif
+ 20   continue
+C      
+100   format('Invalid data', f6.1, ' at ', i4, ' of ', i4, ' in ', a)
+C
+      end
+C
+C    This routine is used to prevent the compiler from deallocating the 
+C    array "a", which may happen in some of the tests (see the text in 
+C    the MPI standard about why this may be a problem in valid Fortran 
+C    codes).  Without this, for example, tests fail with the Cray ftn
+C    compiler.
+C
+      subroutine dummyRef( a, n, ie )
+      integer n, ie
+      real    a(n)
+C This condition will never be true, but the compile won't know that
+      if (ie .eq. -1) then
+          print *, a(n)
+      endif
+      return
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/attr1aints.h b/teshsuite/smpi/mpich3-test/f77/pt2pt/attr1aints.h
new file mode 100644 (file)
index 0000000..182b045
--- /dev/null
@@ -0,0 +1,6 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+       integer extrastate, valin, valout, val
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/dummyf.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/dummyf.f
new file mode 100644 (file)
index 0000000..7524a19
--- /dev/null
@@ -0,0 +1,18 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2010 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+C
+C This file is used to disable certain compiler optimizations that
+C can cause incorrect results with the test in greqf.f.  It provides a 
+C point where extrastate may be modified, limiting the compilers ability
+C to move code around.
+C The include of mpif.h is not needed in the F77 case but in the 
+C F90 case it is, because in that case, extrastate is defined as an
+C integer (kind=MPI_ADDRESS_KIND), and the script that creates the
+C F90 tests from the F77 tests looks for mpif.h
+      subroutine dummyupdate( extrastate )
+      include 'mpif.h'
+      include 'attr1aints.h'
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/greqf.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/greqf.f
new file mode 100644 (file)
index 0000000..163f079
--- /dev/null
@@ -0,0 +1,111 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      subroutine query_fn( extrastate, status, ierr )
+      implicit none
+      include 'mpif.h'
+      integer status(MPI_STATUS_SIZE), ierr
+      include 'attr1aints.h'
+C
+C    set a default status
+      status(MPI_SOURCE) = MPI_UNDEFINED
+      status(MPI_TAG)    = MPI_UNDEFINED
+      call mpi_status_set_cancelled( status, .false., ierr)
+      call mpi_status_set_elements( status, MPI_BYTE, 0, ierr )
+      ierr = MPI_SUCCESS
+      end
+C
+      subroutine free_fn( extrastate, ierr )
+      implicit none
+      include 'mpif.h'
+      integer value, ierr
+      include 'attr1aints.h'
+      integer freefncall
+      common /fnccalls/ freefncall
+C
+C   For testing purposes, the following print can be used to check whether
+C   the free_fn is called
+C      print *, 'Free_fn called'
+C
+      extrastate = extrastate - 1
+C   The value returned by the free function is the error code
+C   returned by the wait/test function 
+      ierr = MPI_SUCCESS
+      end
+C
+      subroutine cancel_fn( extrastate, complete, ierr )
+      implicit none
+      include 'mpif.h'
+      integer ierr
+      logical complete
+      include 'attr1aints.h'
+
+      ierr = MPI_SUCCESS
+      end
+C
+C
+C This is a very simple test of generalized requests.  Normally, the
+C MPI_Grequest_complete function would be called from another routine,
+C often running in a separate thread.  This simple code allows us to
+C check that requests can be created, tested, and waited on in the
+C case where the request is complete before the wait is called.  
+C
+C Note that MPI did *not* define a routine that can be called within
+C test or wait to advance the state of a generalized request.  
+C Most uses of generalized requests will need to use a separate thread.
+C
+       program main
+       implicit none
+       include 'mpif.h'
+       integer errs, ierr
+       logical flag
+       integer status(MPI_STATUS_SIZE)
+       integer request
+       external query_fn, free_fn, cancel_fn
+       include 'attr1aints.h'
+       integer freefncall
+       common /fnccalls/ freefncall
+
+       errs = 0
+       freefncall = 0
+       
+       call MTest_Init( ierr )
+
+       extrastate = 0
+       call mpi_grequest_start( query_fn, free_fn, cancel_fn, 
+     &            extrastate, request, ierr )
+       call mpi_test( request, flag, status, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Generalized request marked as complete'
+       endif
+       
+       call mpi_grequest_complete( request, ierr )
+
+       call MPI_Wait( request, status, ierr )
+
+       extrastate = 1
+       call mpi_grequest_start( query_fn, free_fn, cancel_fn, 
+     &                          extrastate, request, ierr )
+       call mpi_grequest_complete( request, ierr )
+       call mpi_wait( request, MPI_STATUS_IGNORE, ierr )
+C       
+C      The following routine may prevent an optimizing compiler from 
+C      just remembering that extrastate was set in grequest_start
+       call dummyupdate(extrastate)
+       if (extrastate .ne. 0) then
+          errs = errs + 1
+          if (freefncall .eq. 0) then
+              print *, 'Free routine not called'
+          else 
+              print *, 'Free routine did not update extra_data'
+              print *, 'extrastate = ', extrastate
+          endif
+       endif
+C
+       call MTest_Finalize( errs )
+       call mpi_finalize( ierr )
+       end
+C
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/mprobef.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/mprobef.f
new file mode 100644 (file)
index 0000000..e1e554f
--- /dev/null
@@ -0,0 +1,667 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2012 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+      include 'mpif.h'
+      integer idx, ierr, rank, size, count
+      integer sendbuf(8), recvbuf(8)
+      integer s1(MPI_STATUS_SIZE), s2(MPI_STATUS_SIZE)
+      integer msg, errs
+      integer rreq
+      logical found, flag
+
+      ierr = -1
+      errs = 0
+      call mpi_init( ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+          errs = errs + 1
+          print *, ' Unexpected return from MPI_INIT', ierr 
+      endif
+
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      if (size .lt. 2) then
+          errs = errs + 1
+          print *, ' This test requires at least 2 processes' 
+C         Abort now - do not continue in this case.          
+          call mpi_abort( MPI_COMM_WORLD, 1, ierr )
+      endif
+      if (size .gt. 2) then
+          print *, ' This test is running with ', size, ' processes,'
+          print *, ' only 2 processes are used.' 
+      endif
+
+C Test 0: simple Send and Mprobe+Mrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER,
+     .                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(0, 5, MPI_COMM_WORLD, msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T0 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T0 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T0 Mprobe().'
+          endif
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T0 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T0 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T0 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T0 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T0 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T0 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T0 Mrecv().'
+          endif
+      endif
+
+C Test 1: simple Send and Mprobe+Imrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER,
+     .                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(0, 5, MPI_COMM_WORLD, msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T1 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T1 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T1 Mprobe().'
+          endif
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T1 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq is unmodified at T1 Imrecv().'
+          endif 
+          call MPI_Wait(rreq, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T1 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T1 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T1 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T1 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T1 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T1 Imrecv().'
+          endif
+      endif
+
+C Test 2: simple Send and Improbe+Mrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER,
+     .                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(0, 5, MPI_COMM_WORLD, found, msg, s1, ierr)
+          do while (.not. found)
+              call MPI_Improbe(0, 5, MPI_COMM_WORLD,
+     .                          found, msg, s1, ierr)
+          enddo
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T2 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T2 Improbe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T2 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T2 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T2 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T2 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T2 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T2 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T2 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T2 Mrecv().'
+          endif
+      endif
+
+C Test 3: simple Send and Improbe+Imrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER,
+     .                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(0, 5, MPI_COMM_WORLD, found, msg, s1, ierr)
+          do while (.not. found)
+              call MPI_Improbe(0, 5, MPI_COMM_WORLD,
+     .                          found, msg, s1, ierr)
+          enddo
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T3 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T3 Improbe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T3 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T3 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq is unmodified at T3 Imrecv().'
+          endif 
+          call MPI_Wait(rreq, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T3 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T3 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T3 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T3 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T3 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T3 Imrecv().'
+          endif
+      endif
+
+C Test 4: Mprobe+Mrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD,
+     .                     msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T4 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T4 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T4 Mprobe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T4 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+C         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T4 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T4 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T4 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T4 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T4 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T4 Mrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+C Test 5: Mprobe+Imrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD,
+     .                     msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T5 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T5 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T5 Mprobe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T5 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq == MPI_REQUEST_NULL at T5 Imrecv().'
+          endif
+          flag = .false.
+          call MPI_Test(rreq, flag, s2, ierr)
+          if (.not. flag) then
+              errs = errs + 1
+              print *, 'flag is false at T5 Imrecv().'
+          endif
+C         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T5 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T5 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T5 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T5 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T5 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T5 Imrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+C Test 6: Improbe+Mrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          found = .false.
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD,
+     .                      found, msg, s1, ierr)
+          if (.not. found) then
+              errs = errs + 1
+              print *, 'found is false at T6 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T6 Improbe()'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T6 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T6 Improbe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T6 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+C         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T6 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T6 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T6 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T6 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T6 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T6 Mrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+C Test 7: Improbe+Imrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+C         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          found = .false.
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD,
+     .                      found, msg, s1, ierr)
+          if (.not. found) then
+              errs = errs + 1
+              print *, 'found is false at T7 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T7 Improbe()'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T7 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T7 Improbe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T7 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq == MPI_REQUEST_NULL at T7 Imrecv().'
+          endif
+          flag = .false.
+          call MPI_Test(rreq, flag, s2, ierr)
+          if (.not. flag) then
+              errs = errs + 1
+              print *, 'flag is false at T7 Imrecv().'
+          endif
+C         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T7 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T7 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T7 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T7 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T7 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T7 Imrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/statusesf.f b/teshsuite/smpi/mpich3-test/f77/pt2pt/statusesf.f
new file mode 100644 (file)
index 0000000..b01d26b
--- /dev/null
@@ -0,0 +1,56 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+      program main
+      implicit none
+C     Test support for MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE
+      include 'mpif.h'
+      integer nreqs
+      parameter (nreqs = 100)
+      integer reqs(nreqs)
+      integer ierr, rank, i
+      integer errs
+
+      ierr = -1
+      errs = 0
+      call mpi_init( ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_INIT', ierr 
+      endif
+
+      ierr = -1
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_COMM_WORLD', ierr 
+      endif
+      do i=1, nreqs, 2
+         ierr = -1
+         call mpi_isend( MPI_BOTTOM, 0, MPI_BYTE, rank, i,
+     $        MPI_COMM_WORLD, reqs(i), ierr )
+         if (ierr .ne. MPI_SUCCESS) then
+            errs = errs + 1
+            print *, 'Unexpected return from MPI_ISEND', ierr 
+         endif
+         ierr = -1
+         call mpi_irecv( MPI_BOTTOM, 0, MPI_BYTE, rank, i,
+     $        MPI_COMM_WORLD, reqs(i+1), ierr )
+         if (ierr .ne. MPI_SUCCESS) then
+            errs = errs + 1
+            print *, 'Unexpected return from MPI_IRECV', ierr 
+         endif
+      enddo
+
+      ierr = -1
+      call mpi_waitall( nreqs, reqs, MPI_STATUSES_IGNORE, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_WAITALL', ierr 
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f77/pt2pt/testlist b/teshsuite/smpi/mpich3-test/f77/pt2pt/testlist
new file mode 100644 (file)
index 0000000..3385b9d
--- /dev/null
@@ -0,0 +1,4 @@
+#statusesf 1
+#greqf 1
+allpairf 2
+#mprobef 2 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/f77/testlist b/teshsuite/smpi/mpich3-test/f77/testlist
new file mode 100644 (file)
index 0000000..e7d9214
--- /dev/null
@@ -0,0 +1,12 @@
+#attr
+coll
+datatype
+pt2pt
+#info
+#spawn
+#io
+#
+init
+#comm
+ext
+#topo
diff --git a/teshsuite/smpi/mpich3-test/f77/util/mtestf.f b/teshsuite/smpi/mpich3-test/f77/util/mtestf.f
new file mode 100644 (file)
index 0000000..9bef6e1
--- /dev/null
@@ -0,0 +1,113 @@
+C -*- Mode: Fortran; -*- 
+C
+C  (C) 2003 by Argonne National Laboratory.
+C      See COPYRIGHT in top-level directory.
+C
+        subroutine MTest_Init( ierr )
+C       Place the include first so that we can automatically create a
+C       Fortran 90 version that uses the mpi module instead.  If
+C       the module is in a different place, the compiler can complain
+C       about out-of-order statements
+        implicit none
+        include 'mpif.h'
+        integer ierr
+        logical flag
+        logical dbgflag
+        integer wrank
+        common /mtest/ dbgflag, wrank
+
+        call MPI_Initialized( flag, ierr )
+        if (.not. flag) then
+           call MPI_Init( ierr )
+        endif
+
+        dbgflag = .false.
+        call MPI_Comm_rank( MPI_COMM_WORLD, wrank, ierr )
+        end
+C
+        subroutine MTest_Finalize( errs )
+        implicit none
+        include 'mpif.h'
+        integer errs
+        integer rank, toterrs, ierr
+        
+        call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
+
+        call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, 
+     *        MPI_COMM_WORLD, ierr ) 
+        
+        if (rank .eq. 0) then
+           if (toterrs .gt. 0) then 
+                print *, " Found ", toterrs, " errors"
+           else
+                print *, " No Errors"
+           endif
+        endif
+        end
+C
+C A simple get intracomm for now
+        logical function MTestGetIntracomm( comm, min_size, qsmaller )
+        implicit none
+        include 'mpif.h'
+        integer ierr
+        integer comm, min_size, size, rank
+        logical qsmaller
+        integer myindex
+        common /grr/ myindex 
+
+        comm = MPI_COMM_NULL
+        if (myindex .eq. 0) then
+           comm = MPI_COMM_WORLD
+        else if (myindex .eq. 1) then
+           call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+        else if (myindex .eq. 2) then
+           call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+           call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+           call mpi_comm_split( MPI_COMM_WORLD, 0, size - rank, comm, 
+     &                                 ierr )
+        else
+           if (min_size .eq. 1 .and. myindex .eq. 3) then
+              comm = MPI_COMM_SELF
+           endif
+        endif
+        myindex = mod( myindex, 4 ) + 1
+        MTestGetIntracomm = comm .ne. MPI_COMM_NULL
+        qsmaller=.true.
+        end
+C
+        subroutine MTestFreeComm( comm )
+        implicit none
+        include 'mpif.h'
+        integer comm, ierr
+        if (comm .ne. MPI_COMM_WORLD .and.
+     &      comm .ne. MPI_COMM_SELF  .and.
+     &      comm .ne. MPI_COMM_NULL) then
+           call mpi_comm_free( comm, ierr )
+        endif
+        end
+C
+        subroutine MTestPrintError( errcode )
+        implicit none
+        include 'mpif.h'
+        integer errcode
+        integer errclass, slen, ierr
+        character*(MPI_MAX_ERROR_STRING) string
+
+        call MPI_Error_class( errcode, errclass, ierr )
+        call MPI_Error_string( errcode, string, slen, ierr )
+        print *, "Error class ", errclass, "(", string(1:slen), ")"
+        end
+C
+        subroutine MTestPrintErrorMsg( msg, errcode )
+        implicit none
+        include 'mpif.h'
+        character*(*) msg
+        integer errcode
+        integer errclass, slen, ierr
+        character*(MPI_MAX_ERROR_STRING) string
+
+        call MPI_Error_class( errcode, errclass, ierr )
+        call MPI_Error_string( errcode, string, slen, ierr )
+        print *, msg, ": Error class ", errclass, "
+     $       (", string(1:slen), ")" 
+        end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1d9cc9e
--- /dev/null
@@ -0,0 +1,80 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+
+  add_executable(allredint8f90 allredint8f90.f90 ../util/mtestf90.f90)
+  add_executable(allredopttf90 allredopttf90.f90 ../util/mtestf90.f90)
+  add_executable(alltoallvf90 alltoallvf90.f90 ../util/mtestf90.f90)
+  add_executable(alltoallwf90 alltoallwf90.f90 ../util/mtestf90.f90)
+  add_executable(exscanf90 exscanf90.f90 ../util/mtestf90.f90)
+  add_executable(inplacef90 inplacef90.f90 ../util/mtestf90.f90)
+ # add_executable(nonblockingf90 nonblockingf90.f90 ../util/mtestf90.f90)
+ # add_executable(nonblocking_inpf90 nonblocking_inpf90.f90 ../util/mtestf90.f90)
+  add_executable(red_scat_blockf90 red_scat_blockf90.f90 ../util/mtestf90.f90)
+  add_executable(redscatf90 redscatf90.f90 ../util/mtestf90.f90)
+  add_executable(reducelocalf90 reducelocalf90.f90 ../util/mtestf90.f90)
+  add_executable(split_typef90 split_typef90.f90 ../util/mtestf90.f90)
+  add_executable(uallreducef90 uallreducef90.f90 ../util/mtestf90.f90)
+  add_executable(vw_inplacef90 vw_inplacef90.f90 ../util/mtestf90.f90)
+  target_link_libraries(allredint8f90  simgrid)
+  target_link_libraries(allredopttf90  simgrid)
+  target_link_libraries(alltoallvf90  simgrid)
+  target_link_libraries(alltoallwf90  simgrid)
+  target_link_libraries(exscanf90  simgrid)
+  target_link_libraries(inplacef90  simgrid)
+ # target_link_libraries(nonblockingf90  simgrid)
+ # target_link_libraries(nonblocking_inpf90  simgrid)
+  target_link_libraries(red_scat_blockf90  simgrid)
+  target_link_libraries(redscatf90  simgrid)
+  target_link_libraries(reducelocalf90  simgrid)
+  target_link_libraries(split_typef90  simgrid)
+  target_link_libraries(uallreducef90  simgrid)
+  target_link_libraries(vw_inplacef90  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allredint8f90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/allredopttf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallvf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallwf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/exscanf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/inplacef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/nonblockingf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/nonblocking_inpf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/red_scat_blockf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/redscatf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/reducelocalf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/split_typef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/uallreducef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/vw_inplacef90.f90
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/../util/mtestf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/allredint8f90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/allredint8f90.f90
new file mode 100644 (file)
index 0000000..d91ec1a
--- /dev/null
@@ -0,0 +1,23 @@
+! This file created from test/mpi/f77/coll/allredint8f.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2006 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer*8 inbuf, outbuf
+      integer errs, ierr
+
+      errs = 0
+      
+      call mtest_init( ierr )
+!
+! A simple test of allreduce for the optional integer*8 type
+
+      call mpi_allreduce(inbuf, outbuf, 1, MPI_INTEGER8, MPI_SUM,  &
+      &                   MPI_COMM_WORLD, ierr)
+      
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/allredopttf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/allredopttf90.f90
new file mode 100644 (file)
index 0000000..ffe1ffc
--- /dev/null
@@ -0,0 +1,46 @@
+! This file created from test/mpi/f77/coll/allredopttf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2007 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer*8 inbuf, outbuf
+      double complex zinbuf, zoutbuf
+      integer wsize
+      integer errs, ierr
+
+      errs = 0
+      
+      call mtest_init( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, wsize, ierr )
+!
+! A simple test of allreduce for the optional integer*8 type
+
+      inbuf = 1
+      outbuf = 0
+      call mpi_allreduce(inbuf, outbuf, 1, MPI_INTEGER8, MPI_SUM,  &
+      &                   MPI_COMM_WORLD, ierr)
+      if (outbuf .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with integer*8 = got ", outbuf,  &
+      & " but should have ", wsize
+      endif
+      zinbuf = (1,1)
+      zoutbuf = (0,0)
+      call mpi_allreduce(zinbuf, zoutbuf, 1, MPI_DOUBLE_COMPLEX,  &
+      &                   MPI_SUM,  MPI_COMM_WORLD, ierr)
+      if (dreal(zoutbuf) .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with double complex = got ",  &
+      & outbuf, " but should have ", wsize
+      endif
+      if (dimag(zoutbuf) .ne. wsize ) then
+         errs = errs + 1
+         print *, "result wrong for sum with double complex = got ",  &
+      & outbuf, " but should have ", wsize
+      endif
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/alltoallvf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/alltoallvf90.f90
new file mode 100644 (file)
index 0000000..0c535e6
--- /dev/null
@@ -0,0 +1,146 @@
+! This file created from test/mpi/f77/coll/alltoallvf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer ierr, errs
+      integer i, ans, size, rank, color, comm, newcomm
+      integer maxSize, displ
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+
+      errs = 0
+      
+      call mtest_init( ierr )
+
+! Get a comm
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      if (size .gt. maxSize) then
+         call mpi_comm_rank( comm, rank, ierr )
+         color = 1
+         if (rank .lt. maxSize) color = 0
+         call mpi_comm_split( comm, color, rank, newcomm, ierr )
+         call mpi_comm_free( comm, ierr )
+         comm = newcomm
+         call mpi_comm_size( comm, size, ierr )
+      endif
+      call mpi_comm_rank( comm, rank, ierr )
+!      
+      if (size .le. maxSize) then
+! Initialize the data.  Just use this as an all to all
+! Use the same test as alltoallwf.c , except displacements are in units of
+! integers instead of bytes
+         do i=1, size
+            scounts(i) = 1
+            sdispls(i) = (i-1)
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = rank * size + i
+            rcounts(i) = 1
+            rdispls(i) = (i-1)
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+         call mpi_alltoallv( sbuf, scounts, sdispls, stypes, &
+      &        rbuf, rcounts, rdispls, rtypes, comm, ierr )     
+!
+! check rbuf(i) = data from the ith location of the ith send buf, or
+!       rbuf(i) = (i-1) * size + i   
+         do i=1, size
+            ans = (i-1) * size + rank + 1
+            if (rbuf(i) .ne. ans) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(i),  &
+      &               ' expected ', ans
+            endif
+         enddo
+!
+!     A halo-exchange example - mostly zero counts
+!
+         do i=1, size
+            scounts(i) = 0
+            sdispls(i) = 0
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = -1
+            rcounts(i) = 0
+            rdispls(i) = 0
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+
+!
+!     Note that the arrays are 1-origin
+         displ = 0
+         if (rank .gt. 0) then
+            scounts(1+rank-1) = 1
+            rcounts(1+rank-1) = 1
+            sdispls(1+rank-1) = displ
+            rdispls(1+rank-1) = rank - 1
+            sbuf(1+displ)     = rank
+            displ             = displ + 1
+         endif
+         scounts(1+rank)   = 1
+         rcounts(1+rank)   = 1
+         sdispls(1+rank)   = displ
+         rdispls(1+rank)   = rank
+         sbuf(1+displ)     = rank
+         displ           = displ + 1
+         if (rank .lt. size-1) then
+            scounts(1+rank+1) = 1 
+            rcounts(1+rank+1) = 1
+            sdispls(1+rank+1) = displ
+            rdispls(1+rank+1) = rank+1
+            sbuf(1+displ)     = rank
+            displ             = displ + 1
+         endif
+
+         call mpi_alltoallv( sbuf, scounts, sdispls, stypes, &
+      &        rbuf, rcounts, rdispls, rtypes, comm, ierr )
+!
+!   Check the neighbor values are correctly moved
+!
+         if (rank .gt. 0) then
+            if (rbuf(1+rank-1) .ne. rank-1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(',1+rank-1, ') = ', rbuf(1+rank-1), &
+      &              'expected ', rank-1
+            endif
+         endif
+         if (rbuf(1+rank) .ne. rank) then
+            errs = errs + 1
+            print *, rank, ' rbuf(', 1+rank, ') = ', rbuf(1+rank), &
+      &           'expected ', rank
+         endif
+         if (rank .lt. size-1) then
+            if (rbuf(1+rank+1) .ne. rank+1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', 1+rank+1, ') = ',rbuf(1+rank+1), &
+      &              'expected ', rank+1
+            endif
+         endif
+         do i=0,rank-2
+            if (rbuf(1+i) .ne. -1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', 1+i, ') = ', rbuf(1+i),  &
+      &              'expected -1'
+            endif
+         enddo
+         do i=rank+2,size-1
+            if (rbuf(1+i) .ne. -1) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(1+i),  &
+      &              'expected -1'
+            endif
+         enddo
+      endif
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+      
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/alltoallwf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/alltoallwf90.f90
new file mode 100644 (file)
index 0000000..45456ba
--- /dev/null
@@ -0,0 +1,67 @@
+! This file created from test/mpi/f77/coll/alltoallwf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer ierr, errs
+      integer i, intsize, ans, size, rank, color, comm, newcomm
+      integer maxSize
+      parameter (maxSize=32)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+      errs = 0
+      
+      call mtest_init( ierr )
+
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+
+! Get a comm
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      if (size .gt. maxSize) then
+         call mpi_comm_rank( comm, rank, ierr )
+         color = 1
+         if (rank .lt. maxSize) color = 0
+         call mpi_comm_split( comm, color, rank, newcomm, ierr )
+         call mpi_comm_free( comm, ierr )
+         comm = newcomm
+         call mpi_comm_size( comm, size, ierr )
+      endif
+      call mpi_comm_rank( comm, rank, ierr )
+      
+      if (size .le. maxSize) then
+! Initialize the data.  Just use this as an all to all
+         do i=1, size
+            scounts(i) = 1
+            sdispls(i) = (i-1)*intsize
+            stypes(i)  = MPI_INTEGER
+            sbuf(i) = rank * size + i
+            rcounts(i) = 1
+            rdispls(i) = (i-1)*intsize
+            rtypes(i)  = MPI_INTEGER
+            rbuf(i) = -1
+         enddo
+         call mpi_alltoallw( sbuf, scounts, sdispls, stypes, &
+      &        rbuf, rcounts, rdispls, rtypes, comm, ierr )     
+!
+! check rbuf(i) = data from the ith location of the ith send buf, or
+!       rbuf(i) = (i-1) * size + i   
+         do i=1, size
+            ans = (i-1) * size + rank + 1
+            if (rbuf(i) .ne. ans) then
+               errs = errs + 1
+               print *, rank, ' rbuf(', i, ') = ', rbuf(i),  &
+      &               ' expected ', ans
+            endif
+         enddo
+      endif
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
+      
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/exscanf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/exscanf90.f90
new file mode 100644 (file)
index 0000000..1f1ec51
--- /dev/null
@@ -0,0 +1,108 @@
+! This file created from test/mpi/f77/coll/exscanf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      subroutine uop( cin, cout, count, datatype )
+      use mpi
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+!      if (datatype .ne. MPI_INTEGER) then
+!         write(6,*) 'Invalid datatype passed to user_op()'
+!         return
+!      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+!
+      program main
+      use mpi
+      integer, dimension(:), allocatable :: inbuf, outbuf
+      integer ans, rank, size, comm
+      integer errs, ierr
+      integer sumop, status
+      external uop
+      allocate(inbuf(2), STAT=status)
+      allocate(outbuf(2), STAT=status)
+      errs = 0
+      
+      call mtest_init( ierr )
+!
+! A simple test of exscan
+      comm = MPI_COMM_WORLD
+
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, MPI_SUM, comm,  &
+      &                 ierr )
+! this process has the sum of i from 0 to rank-1, which is
+! (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' Expected ', -ans, ' got ', outbuf(1)
+         endif
+      endif
+!
+! Try a user-defined operation 
+!
+      call mpi_op_create( uop, .true., sumop, ierr )
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, sumop, comm,  &
+      &                 ierr )
+! this process has the sum of i from 0 to rank-1, which is
+! (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' sumop: Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' sumop: Expected ', -ans, ' got ', outbuf(1)
+         endif
+      endif
+      call mpi_op_free( sumop, ierr )
+      
+!
+! Try a user-defined operation (and don't claim it is commutative)
+!
+      call mpi_op_create( uop, .false., sumop, ierr )
+      inbuf(1) = rank
+      inbuf(2) = -rank
+      call mpi_exscan( inbuf, outbuf, 2, MPI_INTEGER, sumop, comm,  &
+      &                 ierr )
+! this process has the sum of i from 0 to rank-1, which is
+! (rank)(rank-1)/2 and -i
+      ans = (rank * (rank - 1))/2
+      if (rank .gt. 0) then
+         if (outbuf(1) .ne. ans) then
+            errs = errs + 1
+            print *, rank, ' sumop2: Expected ', ans, ' got ', outbuf(1)
+         endif
+         if (outbuf(2) .ne. -ans) then
+            errs = errs + 1
+            print *, rank, ' sumop2: Expected ', -ans, ' got ',outbuf(1)
+         endif
+      endif
+      call mpi_op_free( sumop, ierr )
+      deallocate(inbuf)
+      deallocate(outbuf)
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/inplacef90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/inplacef90.f90
new file mode 100644 (file)
index 0000000..e9716cf
--- /dev/null
@@ -0,0 +1,91 @@
+! This file created from test/mpi/f77/coll/inplacef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+! (C) 2005 by Argonne National Laboratory.
+!     See COPYRIGHT in top-level directory.
+!
+! This is a simple test that Fortran support the MPI_IN_PLACE value
+!
+       program main
+       use mpi
+       integer ierr, errs
+       integer comm, root
+       integer rank, size
+       integer i
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE), rdispls(MAX_SIZE), rcount(MAX_SIZE), &
+      &      sbuf(MAX_SIZE) 
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+
+       root = 0
+! Gather with inplace
+       do i=1,size
+          rbuf(i) = - i
+       enddo
+       rbuf(1+root) = root
+       if (rank .eq. root) then
+          call mpi_gather( MPI_IN_PLACE, 1, MPI_INTEGER, rbuf, 1, &
+      &         MPI_INTEGER, root, comm, ierr )
+          do i=1,size
+             if (rbuf(i) .ne. i-1) then
+                errs = errs + 1
+                print *, '[',rank,'] rbuf(', i, ') = ', rbuf(i),  &
+      &                   ' in gather'  
+             endif
+          enddo
+       else
+          call mpi_gather( rank, 1, MPI_INTEGER, rbuf, 1, MPI_INTEGER, &
+      &         root, comm, ierr )
+       endif   
+
+! Gatherv with inplace
+       do i=1,size
+          rbuf(i) = - i
+          rcount(i) = 1
+          rdispls(i) = i-1
+       enddo
+       rbuf(1+root) = root
+       if (rank .eq. root) then
+          call mpi_gatherv( MPI_IN_PLACE, 1, MPI_INTEGER, rbuf, rcount, &
+      &         rdispls, MPI_INTEGER, root, comm, ierr )
+          do i=1,size
+             if (rbuf(i) .ne. i-1) then
+                errs = errs + 1
+                print *, '[', rank, '] rbuf(', i, ') = ', rbuf(i),  &
+      &                ' in gatherv'
+             endif
+          enddo
+       else
+          call mpi_gatherv( rank, 1, MPI_INTEGER, rbuf, rcount, rdispls, &
+      &         MPI_INTEGER, root, comm, ierr )
+       endif   
+
+! Scatter with inplace
+       do i=1,size
+          sbuf(i) = i
+       enddo
+       rbuf(1) = -1
+       if (rank .eq. root) then
+          call mpi_scatter( sbuf, 1, MPI_INTEGER, MPI_IN_PLACE, 1, &
+      &         MPI_INTEGER, root, comm, ierr )
+       else
+          call mpi_scatter( sbuf, 1, MPI_INTEGER, rbuf, 1, &
+      &         MPI_INTEGER, root, comm, ierr )
+          if (rbuf(1) .ne. rank+1) then
+             errs = errs + 1
+             print *, '[', rank, '] rbuf  = ', rbuf(1), &
+      &            ' in scatter' 
+          endif
+       endif   
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/nonblocking_inpf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/nonblocking_inpf90.f90
new file mode 100644 (file)
index 0000000..c9aed02
--- /dev/null
@@ -0,0 +1,124 @@
+! This file created from test/mpi/f77/coll/nonblocking_inpf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+! (C) 2012 by Argonne National Laboratory.
+!     See COPYRIGHT in top-level directory.
+!
+! A simple test for Fortran support of the MPI_IN_PLACE value in Alltoall[vw].
+!
+       program main
+       use mpi
+       integer SIZEOFINT
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE)
+       integer rdispls(MAX_SIZE), rcounts(MAX_SIZE), rtypes(MAX_SIZE)
+       integer comm, rank, size, req
+       integer sumval, ierr, errs
+       integer iexpected, igot
+       integer i, j
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+       call mpi_type_size( MPI_INTEGER, SIZEOFINT, ierr )
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+          rbuf(i) = (i-1) * size + rank
+       enddo
+       call mpi_ialltoall( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, &
+      &                      rbuf, 1, MPI_INTEGER, comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+          if (rbuf(i) .ne. (rank*size + i - 1)) then
+             errs = errs + 1
+             print *, '[', rank, ']: IALLTOALL rbuf(', i, ') = ', &
+      &             rbuf(i), ', should be', rank * size + i - 1
+          endif
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = i-1 + rank
+           rdispls(i) = (i-1) * (2*size)
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)+j+1) = 100 * rank + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_ialltoallv( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL, &
+      &                       rbuf, rcounts, rdispls, MPI_INTEGER, &
+      &                       comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, ']: IALLTOALLV got ', igot, &
+      &                   ',but expected ', iexpected, &
+      &                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = i-1 + rank
+           rdispls(i) = (i-1) * (2*size) * SIZEOFINT
+           rtypes(i)  = MPI_INTEGER
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)/SIZEOFINT+j+1) = 100 * rank &
+      &                                        + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_ialltoallw( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL, &
+      &                       rbuf, rcounts, rdispls, rtypes, &
+      &                       comm, req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)/SIZEOFINT+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, ']: IALLTOALLW got ', igot, &
+      &                   ',but expected ', iexpected, &
+      &                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i = 1, size
+           rbuf(i) = rank + (i-1)
+       enddo
+       call mpi_ireduce_scatter_block( MPI_IN_PLACE, rbuf, 1, &
+      &                                  MPI_INTEGER, MPI_SUM, comm, &
+      &                                  req, ierr )
+       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
+
+       sumval = size * rank + ((size-1) * size)/2
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Ireduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']:', 'Got ', rbuf(1), ' but expected ', &
+      &              sumval, '.'
+       endif
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/nonblockingf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/nonblockingf90.f90
new file mode 100644 (file)
index 0000000..a07df71
--- /dev/null
@@ -0,0 +1,98 @@
+! This file created from test/mpi/f77/coll/nonblockingf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2012 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer NUM_INTS
+      parameter (NUM_INTS=2)
+      integer maxSize
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize)
+      integer types(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+      integer comm, size, rank, req
+      integer ierr, errs
+      integer ii, ans
+
+      errs = 0
+
+      call mtest_init(ierr)
+
+      comm = MPI_COMM_WORLD
+      call MPI_Comm_size(comm, size, ierr)
+      call MPI_Comm_rank(comm, rank, ierr)
+!      
+      do ii = 1, size
+         sbuf(2*ii-1) = ii
+         sbuf(2*ii)   = ii
+         sbuf(2*ii-1) = ii
+         sbuf(2*ii)   = ii
+         scounts(ii)  = NUM_INTS
+         rcounts(ii)  = NUM_INTS
+         sdispls(ii)  = (ii-1) * NUM_INTS
+         rdispls(ii)  = (ii-1) * NUM_INTS
+         types(ii)    = MPI_INTEGER
+      enddo
+
+      call MPI_Ibarrier(comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ibcast(sbuf, NUM_INTS, MPI_INTEGER, 0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Igather(sbuf, NUM_INTS, MPI_INTEGER, &
+      &                  rbuf, NUM_INTS, MPI_INTEGER, &
+      &                  0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Igatherv(sbuf, NUM_INTS, MPI_INTEGER, &
+      &                   rbuf, rcounts, rdispls, MPI_INTEGER, &
+      &                   0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoall(sbuf, NUM_INTS, MPI_INTEGER, &
+      &                    rbuf, NUM_INTS, MPI_INTEGER, &
+      &                    comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoallv(sbuf, scounts, sdispls, MPI_INTEGER, &
+      &                     rbuf, rcounts, rdispls, MPI_INTEGER, &
+      &                     comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ialltoallw(sbuf, scounts, sdispls, types, &
+      &                     rbuf, rcounts, rdispls, types, &
+      &                     comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INTEGER, &
+      &                  MPI_SUM, 0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iallreduce(sbuf, rbuf, NUM_INTS, MPI_INTEGER, &
+      &                     MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce_scatter(sbuf, rbuf, rcounts, MPI_INTEGER, &
+      &                          MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Ireduce_scatter_block(sbuf, rbuf, NUM_INTS, MPI_INTEGER, &
+      &                                MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iscan(sbuf, rbuf, NUM_INTS, MPI_INTEGER, &
+      &                MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iexscan(sbuf, rbuf, NUM_INTS, MPI_INTEGER, &
+      &                  MPI_SUM, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/red_scat_blockf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/red_scat_blockf90.f90
new file mode 100644 (file)
index 0000000..35a1546
--- /dev/null
@@ -0,0 +1,56 @@
+! This file created from test/mpi/f77/coll/red_scat_blockf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+! (C) 2012 by Argonne National Laboratory.
+!     See COPYRIGHT in top-level directory.
+!
+! A simple test for Fortran support of Reduce_scatter_block
+! with or withoutMPI_IN_PLACE.
+!
+       program main
+       use mpi
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer sbuf(MAX_SIZE), rbuf(MAX_SIZE)
+       integer comm, rank, size
+       integer sumval, ierr, errs, i
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+
+       do i = 1, size
+           sbuf(i) = rank + (i-1)
+       enddo
+
+       call MPI_Reduce_scatter_block(sbuf, rbuf, 1, MPI_INTEGER, &
+      &                               MPI_SUM, comm, ierr)
+
+       sumval = size * rank + ((size-1) * size)/2
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Reduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']', 'Got ', rbuf(1), ' but expected ', &
+      &              sumval, '.'
+       endif
+
+! Try MPI_IN_PLACE
+       do i = 1, size
+           rbuf(i) = rank + (i-1)
+       enddo
+       call MPI_Reduce_scatter_block(MPI_IN_PLACE, rbuf, 1, MPI_INTEGER, &
+      &                               MPI_SUM, comm, ierr)
+       if ( rbuf(1) .ne. sumval ) then
+           errs = errs + 1
+           print *, 'Reduce_scatter_block does not get expected value.'
+           print *, '[', rank, ']', 'Got ', rbuf(1), ' but expected ', &
+      &              sumval, '.'
+       endif
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90
new file mode 100644 (file)
index 0000000..66339f2
--- /dev/null
@@ -0,0 +1,88 @@
+! This file created from test/mpi/f77/coll/redscatf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      subroutine uop( cin, cout, count, datatype )
+      use mpi
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+!      if (datatype .ne. MPI_INTEGER) then
+!         write(6,*) 'Invalid datatype ',datatype,' passed to user_op()'
+!         return
+!      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+!
+! Test of reduce scatter.
+!
+! Each processor contributes its rank + the index to the reduction, 
+! then receives the ith sum
+!
+! Can be called with any number of processors.
+!
+
+      program main
+      use mpi
+      integer errs, ierr, toterr
+      integer maxsize
+      parameter (maxsize=1024)
+      integer recvbuf
+      integer size, rank, i, sumval
+      integer comm, sumop
+      external uop
+      integer status
+      integer, dimension(:),allocatable :: sendbuf,recvcounts
+      ALLOCATE(sendbuf(maxsize), STAT=status)
+      ALLOCATE(recvcounts(maxsize), STAT=status)
+      errs = 0
+
+      call mtest_init( ierr )
+
+      comm = MPI_COMM_WORLD
+
+      call mpi_comm_size( comm, size, ierr )
+      call mpi_comm_rank( comm, rank, ierr )
+
+      if (size .gt. maxsize) then
+      endif
+      do i=1, size
+         sendbuf(i) = rank + i - 1
+         recvcounts(i) = 1
+      enddo
+
+      call mpi_reduce_scatter( sendbuf, recvbuf, recvcounts,  &
+      &     MPI_INTEGER, MPI_SUM, comm, ierr )
+
+      sumval = size * rank + ((size - 1) * size)/2
+! recvbuf should be size * (rank + i) 
+      if (recvbuf .ne. sumval) then
+         errs = errs + 1
+         print *, "Did not get expected value for reduce scatter"
+         print *, rank, " Got ", recvbuf, " expected ", sumval
+      endif
+
+      call mpi_op_create( uop, .true., sumop, ierr )
+      call mpi_reduce_scatter( sendbuf, recvbuf, recvcounts,  &
+      &     MPI_INTEGER, sumop, comm, ierr )
+
+      sumval = size * rank + ((size - 1) * size)/2
+! recvbuf should be size * (rank + i) 
+      if (recvbuf .ne. sumval) then
+         errs = errs + 1
+         print *, "sumop: Did not get expected value for reduce scatter"
+         print *, rank, " Got ", recvbuf, " expected ", sumval
+      endif
+      call mpi_op_free( sumop, ierr )
+      DEALLOCATE(sendbuf)
+      DEALLOCATE(recvcounts)
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/reducelocalf90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/reducelocalf90.f90
new file mode 100644 (file)
index 0000000..1422952
--- /dev/null
@@ -0,0 +1,96 @@
+! This file created from test/mpi/f77/coll/reducelocalf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2009 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+!
+! Test Fortran MPI_Reduce_local with MPI_OP_SUM and with user-defined operation.
+!
+      subroutine user_op( invec, outvec, count, datatype )
+      use mpi
+      integer invec(*), outvec(*)
+      integer count, datatype
+      integer ii
+
+      if (datatype .ne. MPI_INTEGER) then
+         write(6,*) 'Invalid datatype passed to user_op()'
+         return
+      endif
+      
+      do ii=1, count
+         outvec(ii) = invec(ii) * 2 + outvec(ii)
+      enddo
+
+      end
+
+      program main
+      use mpi
+      integer max_buf_size
+      parameter (max_buf_size=65000)
+      integer vin(max_buf_size), vout(max_buf_size)
+      external user_op
+      integer ierr, errs
+      integer count, myop
+      integer ii
+      
+      errs = 0
+
+      call mtest_init(ierr)
+
+      count = 0
+      do while (count .le. max_buf_size )
+         do ii = 1,count
+            vin(ii) = ii
+            vout(ii) = ii
+         enddo 
+         call mpi_reduce_local( vin, vout, count, &
+      &                          MPI_INTEGER, MPI_SUM, ierr )
+!        Check if the result is correct
+         do ii = 1,count
+            if ( vin(ii) .ne. ii ) then
+               errs = errs + 1
+            endif
+            if ( vout(ii) .ne. 2*ii ) then
+               errs = errs + 1
+            endif
+         enddo 
+         if ( count .gt. 0 ) then
+            count = count + count
+         else
+            count = 1
+         endif
+      enddo
+
+      call mpi_op_create( user_op, .false., myop, ierr )
+
+      count = 0
+      do while (count .le. max_buf_size) 
+         do ii = 1, count
+            vin(ii) = ii
+            vout(ii) = ii
+         enddo
+         call mpi_reduce_local( vin, vout, count, &
+      &                          MPI_INTEGER, myop, ierr )
+!        Check if the result is correct
+         do ii = 1, count
+            if ( vin(ii) .ne. ii ) then
+               errs = errs + 1
+            endif
+            if ( vout(ii) .ne. 3*ii ) then
+               errs = errs + 1
+            endif
+         enddo
+         if ( count .gt. 0 ) then
+            count = count + count
+         else
+            count = 1
+         endif
+      enddo
+
+      call mpi_op_free( myop, ierr )
+
+      call mtest_finalize(errs)
+      call mpi_finalize(ierr)
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/split_typef90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/split_typef90.f90
new file mode 100644 (file)
index 0000000..9dbea6c
--- /dev/null
@@ -0,0 +1,46 @@
+! This file created from test/mpi/f77/coll/split_typef.f with f77tof90
+! -*- Mode: Fortran; -*-
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer ierr, errs
+      integer i, size, rank, comm, newcomm
+      integer maxSize
+      parameter (maxSize=128)
+      integer scounts(maxSize), sdispls(maxSize), stypes(maxSize)
+      integer rcounts(maxSize), rdispls(maxSize), rtypes(maxSize)
+      integer sbuf(maxSize), rbuf(maxSize)
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+
+      call mpi_comm_split_type( comm, MPI_COMM_TYPE_SHARED, rank, &
+      &     MPI_INFO_NULL, newcomm, ierr )
+      call mpi_comm_rank( newcomm, rank, ierr )
+      call mpi_comm_size( newcomm, size, ierr )
+
+      do i=1, size
+         scounts(i) = 1
+         sdispls(i) = (i-1)
+         stypes(i)  = MPI_INTEGER
+         sbuf(i) = rank * size + i
+         rcounts(i) = 1
+         rdispls(i) = (i-1)
+         rtypes(i)  = MPI_INTEGER
+         rbuf(i) = -1
+      enddo
+      call mpi_alltoallv( sbuf, scounts, sdispls, stypes, &
+      &     rbuf, rcounts, rdispls, rtypes, newcomm, ierr )
+
+      call mpi_comm_free( newcomm, ierr )
+      call mpi_comm_free( comm, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/testlist b/teshsuite/smpi/mpich3-test/f90/coll/testlist
new file mode 100644 (file)
index 0000000..522e1a1
--- /dev/null
@@ -0,0 +1,13 @@
+# This file generated by f77tof90
+uallreducef90 4
+exscanf90 5
+#alltoallwf90 7
+alltoallvf90 7
+inplacef90 4
+reducelocalf90 2 mpiversion=2.2
+redscatf90 4
+split_typef90 4 mpiversion=3.0
+#nonblockingf90 4 mpiversion=3.0
+vw_inplacef90 4 mpiversion=2.2
+red_scat_blockf90 4 mpiversion=2.2
+#nonblocking_inpf90 4 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/uallreducef90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/uallreducef90.f90
new file mode 100644 (file)
index 0000000..bc42b54
--- /dev/null
@@ -0,0 +1,67 @@
+! This file created from test/mpi/f77/coll/uallreducef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+!
+! Test user-defined operations.  This tests a simple commutative operation
+!
+      subroutine uop( cin, cout, count, datatype )
+      use mpi
+      integer cin(*), cout(*)
+      integer count, datatype
+      integer i
+      
+      if (datatype .eq. MPI_INTEGER) then
+         print *, 'Invalid datatype (',datatype,') passed to user_op()'
+         return
+      endif
+
+      do i=1, count
+         cout(i) = cin(i) + cout(i)
+      enddo
+      end
+
+      program main
+      use mpi
+      external uop
+      integer ierr, errs
+      integer count, sumop, i, size
+      integer, DIMENSION(:), ALLOCATABLE :: vin, vout
+      integer comm
+      integer status
+      
+      errs = 0
+      ALLOCATE(vin(65000), STAT=status)
+      ALLOCATE(vout(65000), STAT=status)
+
+      call mtest_init(ierr)
+      call mpi_op_create( uop, .true., sumop, ierr )
+
+      comm = MPI_COMM_WORLD
+      call mpi_comm_size( comm, size, ierr )
+      count = 1
+      do while (count .lt. 65000) 
+         do i=1, count
+            vin(i) = i
+            vout(i) = -1
+         enddo
+         call mpi_allreduce( vin, vout, count, MPI_INTEGER, sumop,  &
+      &                       comm, ierr )
+!         Check that all results are correct
+         do i=1, count
+            if (vout(i) .ne. i * size) then
+               errs = errs + 1
+               if (errs .lt. 10) print *, "vout(",i,") = ", vout(i)
+            endif
+         enddo
+         count = count + count
+      enddo
+
+      call mpi_op_free( sumop, ierr )
+      DEALLOCATE(vout)
+      DEALLOCATE(vin)
+      call mtest_finalize(errs)
+      call mpi_finalize(ierr)
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90.f90 b/teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90.f90
new file mode 100644 (file)
index 0000000..192cb02
--- /dev/null
@@ -0,0 +1,109 @@
+! This file created from test/mpi/f77/coll/vw_inplacef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+! (C) 2012 by Argonne National Laboratory.
+!     See COPYRIGHT in top-level directory.
+!
+! A simple test for Fortran support of the MPI_IN_PLACE value in Alltoall[vw].
+!
+       program main
+       use mpi
+       integer SIZEOFINT
+       integer MAX_SIZE
+       parameter (MAX_SIZE=1024)
+       integer rbuf(MAX_SIZE)
+       integer rdispls(MAX_SIZE), rcounts(MAX_SIZE), rtypes(MAX_SIZE)
+       integer ierr, errs
+       integer comm
+       integer rank, size
+       integer iexpected, igot
+       integer i, j
+
+       errs = 0
+       call mtest_init( ierr )
+
+       comm = MPI_COMM_WORLD
+       call mpi_comm_rank( comm, rank, ierr )
+       call mpi_comm_size( comm, size, ierr )
+       call mpi_type_size( MPI_INTEGER, SIZEOFINT, ierr )
+
+       if (size .gt. MAX_SIZE) then
+          print *, ' At most ', MAX_SIZE, ' processes allowed'
+          call mpi_abort( MPI_COMM_WORLD, 1, ierr )
+       endif
+!
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+          rbuf(i) = (i-1) * size + rank
+       enddo
+       call mpi_alltoall( MPI_IN_PLACE, -1, MPI_DATATYPE_NULL, &
+      &      rbuf, 1, MPI_INTEGER, comm, ierr )
+       do i=1,size
+          if (rbuf(i) .ne. (rank*size + i - 1)) then
+             errs = errs + 1
+             print *, '[', rank, '] rbuf(', i, ') = ', rbuf(i), &
+      &             ', should be', rank * size + i - 1
+          endif
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+       do i=1,size
+           rcounts(i) = (i-1) + rank
+           rdispls(i) = (i-1) * (2*size)
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)+j+1) = 100 * rank + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_alltoallv( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL, &
+      &                     rbuf, rcounts, rdispls, MPI_INTEGER, &
+      &                     comm, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, '] ALLTOALLV got ', igot, &
+      &                   ',but expected ', iexpected, &
+      &                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       do i=1,MAX_SIZE
+           rbuf(i) = -1
+       enddo
+!          Alltoallw's displs[] are in bytes not in type extents.
+       do i=1,size
+           rcounts(i) = (i-1) + rank
+           rdispls(i) = (i-1) * (2*size) * SIZEOFINT
+           rtypes(i)  = MPI_INTEGER
+           do j=0,rcounts(i)-1
+               rbuf(rdispls(i)/SIZEOFINT+j+1) = 100 * rank &
+      &                                        + 10 * (i-1) + j
+           enddo
+       enddo
+       call mpi_alltoallw( MPI_IN_PLACE, 0, 0, MPI_DATATYPE_NULL, &
+      &                     rbuf, rcounts, rdispls, rtypes, &
+      &                     comm, ierr )
+       do i=1,size
+           do j=0,rcounts(i)-1
+               iexpected = 100 * (i-1) + 10 * rank + j
+               igot      = rbuf(rdispls(i)/SIZEOFINT+j+1)
+               if ( igot .ne. iexpected ) then
+                   errs = errs + 1
+                   print *, '[', rank, '] ALLTOALLW got ', igot, &
+      &                   ',but expected ', iexpected, &
+      &                   ' for block=', i-1, ' element=', j
+               endif
+           enddo
+       enddo
+
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a8a0b84
--- /dev/null
@@ -0,0 +1,94 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+
+  add_executable(allctypesf90 allctypesf90.f90 ../util/mtestf90.f90)
+ # add_executable(createf90 createf90.f90 ../util/mtestf90.f90)
+  add_executable(gaddressf90 gaddressf90.f90 ../util/mtestf90.f90)
+ # add_executable(get_elem_d get_elem_d.f90 ../util/mtestf90.f90)
+ # add_executable(get_elem_u get_elem_u.f90 ../util/mtestf90.f90)
+  add_executable(hindex1f90 hindex1f90.f90 ../util/mtestf90.f90)
+  add_executable(hindexed_blockf90 hindexed_blockf90.f90 ../util/mtestf90.f90)
+  add_executable(indtype indtype.f90 ../util/mtestf90.f90)
+  add_executable(kinds kinds.f90 ../util/mtestf90.f90)
+  add_executable(packef90 packef90.f90 ../util/mtestf90.f90)
+ # add_executable(sizeof sizeof.f90 ../util/mtestf90.f90)
+ # add_executable(structf structf.f90 ../util/mtestf90.f90)
+ # add_executable(trf90 trf90.f90 ../util/mtestf90.f90)
+  add_executable(typecntsf90 typecntsf90.f90 ../util/mtestf90.f90)
+  add_executable(typem2f90 typem2f90.f90 ../util/mtestf90.f90)
+  add_executable(typename3f90 typename3f90.f90 ../util/mtestf90.f90)
+  add_executable(typenamef90 typenamef90.f90 ../util/mtestf90.f90)
+  add_executable(typesnamef90 typesnamef90.f90 ../util/mtestf90.f90)
+  add_executable(typesubf90 typesubf90.f90 ../util/mtestf90.f90)
+  target_link_libraries(allctypesf90  simgrid)
+ # target_link_libraries(createf90  simgrid)
+  target_link_libraries(gaddressf90  simgrid)
+ # target_link_libraries(get_elem_d  simgrid)
+ # target_link_libraries(get_elem_u  simgrid)
+  target_link_libraries(hindex1f90  simgrid)
+  target_link_libraries(hindexed_blockf90  simgrid)
+  target_link_libraries(indtype  simgrid)
+  target_link_libraries(kinds  simgrid)
+  target_link_libraries(packef90  simgrid)
+ # target_link_libraries(sizeof  simgrid)
+ # target_link_libraries(structf  simgrid)
+ # target_link_libraries(trf90  simgrid)
+  target_link_libraries(typecntsf90  simgrid)
+  target_link_libraries(typem2f90  simgrid)
+  target_link_libraries(typename3f90  simgrid)
+  target_link_libraries(typenamef90  simgrid)
+  target_link_libraries(typesnamef90  simgrid)
+  target_link_libraries(typesubf90  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allctypesf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/createf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/gaddressf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/get_elem_d.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/get_elem_u.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/hindex1f90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/hindexed_blockf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/indtype.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/kinds.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/packef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/sizeof.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/structf.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/trf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typecntsf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typem2f90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typename3f90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typenamef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typesnamef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/typesubf90.f90
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90.f90
new file mode 100644 (file)
index 0000000..a150618
--- /dev/null
@@ -0,0 +1,139 @@
+! This file created from test/mpi/f77/datatype/allctypesf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2004 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer ierr
+!
+      call mtest_init(ierr)
+      call mpi_comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN,  &
+      &                              ierr )
+!
+!     Check that all Ctypes are available in Fortran (MPI 2.1, p 483, line 46)
+!
+       call checkdtype( MPI_CHAR, "MPI_CHAR", ierr )
+       call checkdtype( MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR", ierr )
+       call checkdtype( MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR", ierr )
+       call checkdtype( MPI_BYTE, "MPI_BYTE", ierr )
+       call checkdtype( MPI_WCHAR, "MPI_WCHAR", ierr )
+       call checkdtype( MPI_SHORT, "MPI_SHORT", ierr )
+       call checkdtype( MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT", ierr )
+       call checkdtype( MPI_INT, "MPI_INT", ierr )
+       call checkdtype( MPI_UNSIGNED, "MPI_UNSIGNED", ierr )
+       call checkdtype( MPI_LONG, "MPI_LONG", ierr )
+       call checkdtype( MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG", ierr )
+       call checkdtype( MPI_FLOAT, "MPI_FLOAT", ierr )
+       call checkdtype( MPI_DOUBLE, "MPI_DOUBLE", ierr )
+       if (MPI_LONG_DOUBLE .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE", ierr )
+       endif
+       if (MPI_LONG_LONG_INT .ne. MPI_DATATYPE_NULL) then
+         call checkdtype2( MPI_LONG_LONG_INT, "MPI_LONG_LONG_INT",  &
+      &                     "MPI_LONG_LONG", ierr )
+       endif
+       if (MPI_UNSIGNED_LONG_LONG .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_UNSIGNED_LONG_LONG,  &
+      &                    "MPI_UNSIGNED_LONG_LONG", ierr )
+       endif
+       if (MPI_LONG_LONG .ne. MPI_DATATYPE_NULL) then
+         call checkdtype2( MPI_LONG_LONG, "MPI_LONG_LONG",  &
+      &                     "MPI_LONG_LONG_INT", ierr )
+       endif
+       call checkdtype( MPI_PACKED, "MPI_PACKED", ierr )
+       call checkdtype( MPI_LB, "MPI_LB", ierr )
+       call checkdtype( MPI_UB, "MPI_UB", ierr )
+       call checkdtype( MPI_FLOAT_INT, "MPI_FLOAT_INT", ierr )
+       call checkdtype( MPI_DOUBLE_INT, "MPI_DOUBLE_INT", ierr )
+       call checkdtype( MPI_LONG_INT, "MPI_LONG_INT", ierr )
+       call checkdtype( MPI_SHORT_INT, "MPI_SHORT_INT", ierr )
+       call checkdtype( MPI_2INT, "MPI_2INT", ierr )
+       if (MPI_LONG_DOUBLE_INT .ne. MPI_DATATYPE_NULL) then
+         call checkdtype( MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT", &
+      &                    ierr)
+       endif
+!
+!     Check that all Ctypes are available in Fortran (MPI 2.2)
+!     Note that because of implicit declarations in Fortran, this
+!     code should compile even with pre MPI 2.2 implementations.
+!
+       if (MPI_VERSION .gt. 2 .or. (MPI_VERSION .eq. 2 .and.  &
+      &      MPI_SUBVERSION .ge. 2)) then
+          call checkdtype( MPI_INT8_T, "MPI_INT8_T", ierr )
+          call checkdtype( MPI_INT16_T, "MPI_INT16_T", ierr )
+          call checkdtype( MPI_INT32_T, "MPI_INT32_T", ierr )
+          call checkdtype( MPI_INT64_T, "MPI_INT64_T", ierr )
+          call checkdtype( MPI_UINT8_T, "MPI_UINT8_T", ierr )
+          call checkdtype( MPI_UINT16_T, "MPI_UINT16_T", ierr )
+          call checkdtype( MPI_UINT32_T, "MPI_UINT32_T", ierr )
+          call checkdtype( MPI_UINT64_T, "MPI_UINT64_T", ierr )
+! other C99 types
+          call checkdtype( MPI_C_BOOL, "MPI_C_BOOL", ierr )
+          call checkdtype( MPI_C_FLOAT_COMPLEX, "MPI_C_FLOAT_COMPLEX", &
+      &                     ierr)
+          call checkdtype2( MPI_C_COMPLEX, "MPI_C_COMPLEX",  &
+      &                      "MPI_C_FLOAT_COMPLEX", ierr )
+          call checkdtype( MPI_C_DOUBLE_COMPLEX, "MPI_C_DOUBLE_COMPLEX",  &
+      &                     ierr )
+          if (MPI_C_LONG_DOUBLE_COMPLEX .ne. MPI_DATATYPE_NULL) then
+            call checkdtype( MPI_C_LONG_DOUBLE_COMPLEX,  &
+      &                       "MPI_C_LONG_DOUBLE_COMPLEX", ierr )
+          endif
+! address/offset types 
+          call checkdtype( MPI_AINT, "MPI_AINT", ierr )
+          call checkdtype( MPI_OFFSET, "MPI_OFFSET", ierr )
+       endif
+!
+       call mtest_finalize( ierr )
+       call MPI_Finalize( ierr )
+       end
+!
+! Check name of datatype
+      subroutine CheckDtype( intype, name, ierr )
+      use mpi
+      integer intype, ierr
+      character *(*) name
+      integer ir, rlen
+      character *(MPI_MAX_OBJECT_NAME) outname
+!     
+      outname = ""
+      call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
+      if (ir .ne. MPI_SUCCESS) then
+         print *, " Datatype ", name, " not available in Fortran"
+         ierr = ierr + 1
+      else
+         if (outname .ne. name) then
+            print *, " For datatype ", name, " found name ", &
+      &           outname(1:rlen)
+            ierr = ierr + 1
+         endif
+      endif
+      
+      return
+      end
+!
+! Check name of datatype (allows alias)
+      subroutine CheckDtype2( intype, name, name2, ierr )
+      use mpi
+      integer intype, ierr
+      character *(*) name, name2
+      integer ir, rlen
+      character *(MPI_MAX_OBJECT_NAME) outname
+!     
+      outname = ""
+      call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
+      if (ir .ne. MPI_SUCCESS) then
+         print *, " Datatype ", name, " not available in Fortran"
+         ierr = ierr + 1
+      else
+         if (outname .ne. name .and. outname .ne. name2) then
+            print *, " For datatype ", name, " found name ", &
+      &           outname(1:rlen)
+            ierr = ierr + 1
+         endif
+      endif
+      
+      return
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/createf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/createf90.f90
new file mode 100644 (file)
index 0000000..b2edf87
--- /dev/null
@@ -0,0 +1,68 @@
+!  
+!  (C) 2004 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+        program main
+        use mpi
+        integer ierr
+        integer errs
+        integer nints, nadds, ndtypes, combiner
+        integer nparms(2), dummy(1)
+        integer (kind=MPI_ADDRESS_KIND) adummy(1)
+        integer ntype1, nsize, ntype2, ntype3, i
+!
+!       Test the Type_create_f90_xxx routines
+!
+        errs = 0
+        call mtest_init( ierr )
+
+! integers with upto 9 are 4 bytes integers; r of 4 are 2 byte,
+! and r of 2 is 1 byte
+        call mpi_type_create_f90_integer( 9, ntype1, ierr )
+!
+!       Check with get contents and envelope...
+        call mpi_type_get_envelope( ntype1, nints, nadds, ndtypes, &
+                                    combiner, ierr )
+        if (nadds .ne. 0) then
+           errs = errs + 1
+           print *, "There should be no addresses on created type (r=9)"
+        endif
+        if (ndtypes .ne. 0) then
+           errs = errs + 1
+           print *, "There should be no datatypes on created type (r=9)"
+        endif
+        if (nints .ne. 1) then
+           errs = errs + 1
+           print *, "There should be exactly 1 integer on create type (r=9)"
+        endif
+        if (combiner .ne. MPI_COMBINER_F90_INTEGER) then
+           errs = errs + 1
+           print *, "The combiner should be INTEGER, not ", combiner
+        endif
+        if (nints .eq. 1) then
+           call mpi_type_get_contents( ntype1, 1, 0, 0, &
+                                       nparms, adummy, dummy, ierr )
+           if (nparms(1) .ne. 9) then
+              errs = errs + 1
+              print *, "parameter was ", nparms(1), " should be 9"
+           endif
+        endif
+           
+        call mpi_type_create_f90_integer( 8, ntype2, ierr )
+        if (ntype1 .eq. ntype2) then
+           errs = errs + 1
+           print *, "Types with r = 8 and r = 9 are the same, ", &
+                "should be distinct"
+        endif
+
+!
+! Check that we don't create new types each time.  This test will fail only
+! if the MPI implementation checks for un-freed types or runs out of space
+        do i=1, 100000
+           call mpi_type_create_f90_integer( 8, ntype3, ierr )
+        enddo
+
+        call mtest_finalize( errs )
+        call mpi_finalize( ierr )
+        
+        end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90.f90
new file mode 100644 (file)
index 0000000..bf23687
--- /dev/null
@@ -0,0 +1,39 @@
+! This file created from test/mpi/f77/datatype/gaddressf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer max_asizev
+      parameter (max_asizev=2)
+      integer (kind=MPI_ADDRESS_KIND) aintv(max_asizev), gap
+
+      integer iarray(200), intsize
+      integer ierr, errs
+
+      errs = 0
+
+      call MPI_Init(ierr)
+
+      call MPI_Get_address( iarray(1), aintv(1), ierr )
+      call MPI_Get_address( iarray(200), aintv(2), ierr )
+      gap = aintv(2) - aintv(1)
+
+      call MPI_Type_size( MPI_INTEGER, intsize, ierr )
+
+      if (gap .ne. 199 * intsize) then
+         errs = errs + 1
+         print *, ' Using get_address, computed a gap of ', gap
+         print *, ' Expected a gap of ', 199 * intsize
+      endif
+      if (errs .gt. 0) then
+          print *, ' Found ', errs, ' errors'
+      else
+          print *, ' No Errors'
+      endif
+
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/get_elem_d.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/get_elem_d.f90
new file mode 100644 (file)
index 0000000..00c1123
--- /dev/null
@@ -0,0 +1,124 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2013 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+
+! Based on a test written by Jim Hoekstra on behalf of Cray, Inc.
+! see ticket #884 https://trac.mpich.org/projects/mpich/ticket/884
+
+program get_elem_d
+
+  use mpi
+!  implicit none
+
+  integer, parameter :: verbose=0
+  integer, parameter :: cmax=100,dmax=100,imax=60
+  integer, parameter :: nb=2
+  integer :: comm,rank,size,dest,ierror,errs=0
+  integer :: status(MPI_STATUS_SIZE)
+  integer :: i,ii,count,ka,j,jj,k,kj,krat,tag=100
+  integer :: blklen(nb)=(/2,2/)
+  integer :: types(nb)=(/MPI_DOUBLE_PRECISION,MPI_INTEGER/)
+  integer(kind=MPI_ADDRESS_KIND) :: disp(nb)
+  integer :: newtype,ntlen,ians(0:23),ians0(0:3),ians1(20),ians2(20)
+  double precision :: dbuff(dmax), a
+  integer :: ibuff(imax)
+  character :: cbuff(cmax)='X'
+
+  call MPI_Init(ierror)
+  comm=MPI_COMM_WORLD
+  call MPI_Comm_size(comm, size, ierror)
+  dest=size-1
+  call MPI_Comm_rank(comm, rank, ierror)
+  call MPI_Sizeof (j, kj, ierror)
+  call MPI_Sizeof (a, ka, ierror)
+  ntlen=2*ka+2*kj
+  krat=ntlen/kj
+  disp=(/0,2*ka/)
+
+  !  calculate answers for expected i values for Get_elements with derived type
+  ians0(0)=ka
+  ians0(1)=2*ka
+  ians0(2)=2*ka+kj
+  ians0(3)=2*ka+2*kj
+  ii=0
+  do i=1,24
+     if (i .eq. ians0(ii)) ii=ii+1
+     ians1(i)=ii
+  enddo
+  if (rank == 0 .and. verbose > 0) print *, (ians1(k),k=1,24)
+  jj=0
+  do j=0,19,4
+     ians(j)=jj+ka/kj
+     ians(j+1)=jj+2*(ka/kj)
+     ians(j+2)=jj+2*(ka/kj)+1
+     ians(j+3)=jj+2*(ka/kj)+2
+     if (rank == 0 .and. verbose > 0) print *, (ians(k),k=j,j+3)
+     jj=jj+ntlen/kj
+  enddo
+  ii=0
+  do i=1,20
+     if (i .eq. ians(ii)) ii=ii+1
+     ians2(i)=ii
+  enddo
+  if (rank == 0 .and. verbose > 0) print *, (ians2(k),k=1,20)
+
+  if (verbose > 0) print *, MPI_UNDEFINED
+
+  call MPI_Type_create_struct(nb, blklen, disp, types, newtype, ierror)
+  call MPI_Type_commit(newtype, ierror)
+
+  do i=1,24
+     if (rank == 0) then
+        call MPI_Send(cbuff, i, MPI_BYTE, dest, 100, comm, ierror)
+
+     else if (rank == dest) then
+
+        !     first receive
+        call MPI_Recv(dbuff, dmax, newtype, 0, 100, comm, status, ierror)
+        !       check on MPI_Get_elements
+        call MPI_Get_elements(status, newtype, count, ierror)
+        if (count .ne. ians1(i)) then
+           errs=errs+1
+           write (*,fmt="(i2,'  R1 Get_elements  count=',i3,&
+                &'  but should be ',i3)") i,count,ians1(i)
+        endif
+
+     else
+        !     other ranks do not participate
+     endif
+  enddo
+
+  do i=1,20
+     if (rank == 0) then
+        call MPI_Send(ibuff, i, MPI_INTEGER, dest, 100, comm, ierror)
+
+     else if (rank == dest) then
+
+        !     second receive
+        call MPI_Recv(dbuff, dmax, newtype, 0, 100, comm, status, ierror)
+        !       check on MPI_Get_elements
+        call MPI_Get_elements(status, newtype, count, ierror)
+        if (count .ne. ians2(i)) then
+           errs=errs+1
+           write (*,fmt="(i2,'  R2 Get_elements  count=',i3,&
+                &'  but should be ',i3)") i,count,ians2(i)
+        endif
+     else
+        !     other ranks do not participate
+     endif
+  enddo
+
+  if (rank .eq. dest) then
+     if (errs .eq. 0) then
+        write (*,*) " No Errors"
+     else
+        print *, 'errs=',errs
+     endif
+  endif
+
+  call MPI_Type_free(newtype, ierror)
+  call MPI_Finalize(ierror)
+
+end program get_elem_d
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/get_elem_u.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/get_elem_u.f90
new file mode 100644 (file)
index 0000000..aa9f8fe
--- /dev/null
@@ -0,0 +1,72 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2013 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+
+! Based on a test written by Jim Hoekstra on behalf of Cray, Inc.
+! see ticket #884 https://trac.mpich.org/projects/mpich/ticket/884
+
+PROGRAM get_elem_u
+
+  USE mpi 
+  IMPLICIT NONE 
+  INTEGER    RANK, SIZE, IERR, COMM, errs 
+  INTEGER    MAX, I, K, dest
+  INTEGER   STATUS(MPI_STATUS_SIZE)
+
+  INTEGER, PARAMETER :: nb=2
+  INTEGER :: blklen(nb)=(/1,1/)
+  INTEGER :: types(nb)=(/MPI_DOUBLE_PRECISION,MPI_CHAR/)
+  INTEGER(kind=MPI_ADDRESS_KIND) :: disp(nb)=(/0,8/)
+
+  INTEGER, PARAMETER :: amax=200
+  INTEGER :: type1, type2, extent
+  REAL    :: a(amax)
+
+  errs = 0 
+  CALL MPI_Init( ierr ) 
+  COMM = MPI_COMM_WORLD 
+  CALL MPI_Comm_rank(COMM,RANK,IERR) 
+  CALL MPI_Comm_size(COMM,SIZE,IERR) 
+  dest=size-1
+
+  CALL MPI_Type_create_struct(nb, blklen, disp, types, type1, ierr)
+  CALL MPI_Type_commit(type1, ierr)
+  CALL MPI_Type_extent(type1, extent, ierr)
+
+  CALL MPI_Type_contiguous(4, Type1, Type2, ierr) 
+  CALL MPI_Type_commit(Type2, ierr) 
+  CALL MPI_Type_extent(Type2, extent, ierr)
+
+  DO k=1,17
+
+     IF(rank .EQ. 0) THEN 
+
+        !       send k copies of datatype Type1
+        CALL MPI_Send(a, k, Type1, dest, 0, comm, ierr) 
+
+     ELSE IF (rank == dest) THEN
+
+        CALL MPI_Recv(a, 200, Type2, 0, 0, comm, status, ierr) 
+        CALL MPI_Get_elements(status, Type2, i, ierr)
+        IF (i .NE. 2*k) THEN
+           errs = errs+1
+           PRINT *, "k=",k,"  MPI_Get_elements returns", i, ", but it should be", 2*k
+        END IF
+
+     ELSE
+        !       thix rank does not particupate
+     END IF
+  enddo
+
+  CALL MPI_Type_free(type1, ierr)
+  CALL MPI_Type_free(type2, ierr)
+
+  CALL MPI_Finalize( ierr )
+
+  IF(rank .EQ. 0 .AND. errs .EQ. 0) THEN
+     PRINT *, " No Errors"
+  END IF
+
+END PROGRAM get_elem_u
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/hindex1f90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/hindex1f90.f90
new file mode 100644 (file)
index 0000000..7941ced
--- /dev/null
@@ -0,0 +1,61 @@
+! This file created from test/mpi/f77/datatype/hindex1f.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer errs, ierr, intsize
+      integer i, displs(10), counts(10), dtype
+      integer bufsize
+      parameter (bufsize=100)
+      integer inbuf(bufsize), outbuf(bufsize), packbuf(bufsize)
+      integer position, len, psize
+!
+!     Test for hindexed; 
+!     
+      errs = 0
+      call mtest_init( ierr )
+
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+      
+      do i=1, 10
+         displs(i) = (10-i)*intsize
+         counts(i) = 1
+      enddo
+      call mpi_type_hindexed( 10, counts, displs, MPI_INTEGER, dtype, &
+      &     ierr ) 
+      call mpi_type_commit( dtype, ierr )
+!
+      call mpi_pack_size( 1, dtype, MPI_COMM_WORLD, psize, ierr )
+      if (psize .gt. bufsize*intsize) then
+         errs = errs + 1
+      else
+         do i=1,10
+            inbuf(i)  = i
+            outbuf(i) = -i
+         enddo
+         position = 0
+         call mpi_pack( inbuf, 1, dtype, packbuf, psize, position, &
+      &        MPI_COMM_WORLD, ierr )
+!
+         len      = position
+         position = 0
+         call mpi_unpack( packbuf, len, position, outbuf, 10, &
+      &        MPI_INTEGER, MPI_COMM_WORLD, ierr )
+!     
+         do i=1, 10
+            if (outbuf(i) .ne. 11-i) then
+               errs = errs + 1
+               print *, 'outbuf(',i,')=',outbuf(i),', expected ', 10-i
+            endif
+         enddo
+      endif
+!
+      call mpi_type_free( dtype, ierr )
+!
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90.f90
new file mode 100644 (file)
index 0000000..f2977fa
--- /dev/null
@@ -0,0 +1,178 @@
+! This file created from test/mpi/f77/datatype/hindexed_blockf.f with f77tof90
+! -*- Mode: Fortran; -*-
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer errs, ierr, i, intsize
+      integer type1, type2, type3, type4, type5
+      integer max_asizev
+      parameter (max_asizev = 10)
+      integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
+
+      integer blocklens(max_asizev), dtypes(max_asizev)
+      integer recvbuf(6*max_asizev)
+      integer sendbuf(max_asizev), status(MPI_STATUS_SIZE)
+      integer rank, size
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+!
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+!
+      aintv(1) = 0
+      aintv(2) = 3 * intsize
+      call mpi_type_create_resized( MPI_INTEGER, aintv(1), aintv(2), &
+      &                              type1, ierr )
+      call mpi_type_commit( type1, ierr )
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected lb'
+      endif
+      if (aintv(2) .ne. 3*intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected extent'
+      endif
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_true_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected true lb'
+      endif
+      if (aintv(2) .ne. intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected true extent (', aintv(2), ') ', &
+      &     ' expected ', intsize
+      endif
+!
+      do i=1,10
+         blocklens(i) = 1
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_hindexed( 10, blocklens, aintv, &
+      &                               MPI_INTEGER, type2, ierr )
+      call mpi_type_commit( type2, ierr )
+!
+      aint = 3 * intsize
+      call mpi_type_create_hvector( 10, 1, aint, MPI_INTEGER, type3, &
+      &                              ierr )
+      call mpi_type_commit( type3, ierr )
+!
+      do i=1,10
+         blocklens(i) = 1
+         dtypes(i)    = MPI_INTEGER
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_struct( 10, blocklens, aintv, dtypes, &
+      &                             type4, ierr )
+      call mpi_type_commit( type4, ierr )
+
+      call mpi_type_get_extent(MPI_INTEGER, aintv(1), aint, ierr)
+      do i=1,10
+         aintv(i)    = (i-1) * 3 * aint
+      enddo
+      call mpi_type_create_hindexed_block( 10, 1, aintv, &
+      &                               MPI_INTEGER, type5, ierr )
+      call mpi_type_commit( type5, ierr )
+!
+! Using each time, send and receive using these types
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, &
+      &                   recvbuf, max_asizev, type1, rank, 0, &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type1:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, &
+      &                   recvbuf, 1, type2, rank, 0, &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type2:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, &
+      &                   recvbuf, 1, type3, rank, 0, &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type3:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, &
+      &                   recvbuf, 1, type4, rank, 0, &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type4:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0, &
+      &                   recvbuf, 1, type5, rank, 0, &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type5:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      call mpi_type_free( type1, ierr )
+      call mpi_type_free( type2, ierr )
+      call mpi_type_free( type3, ierr )
+      call mpi_type_free( type4, ierr )
+      call mpi_type_free( type5, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/indtype.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/indtype.f90
new file mode 100644 (file)
index 0000000..79829e7
--- /dev/null
@@ -0,0 +1,117 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! This test contributed by Kim McMahon, Cray
+!
+      program main
+      implicit none
+      use mpi
+
+      integer ierr, i, j, type, count,errs
+      parameter (count = 4)
+      integer rank, size, xfersize
+      integer status(MPI_STATUS_SIZE)
+      integer blocklens(count), displs(count)
+      double precision,dimension(:,:),allocatable :: sndbuf, rcvbuf
+      logical verbose
+
+      verbose = .false. 
+      call mtest_init ( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      if (size .lt. 2) then
+         print *, "Must have at least 2 processes"
+         call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
+      endif
+
+      errs = 0
+      allocate(sndbuf(7,100))
+      allocate(rcvbuf(7,100))
+
+      do j=1,100
+        do i=1,7
+           sndbuf(i,j) = (i+j) * 1.0
+         enddo
+      enddo
+
+      do i=1,count
+         blocklens(i) = 7
+      enddo
+
+! bug occurs when first two displacements are 0
+      displs(1) = 0 
+      displs(2) = 0 
+      displs(3) = 10
+      displs(4) = 10 
+
+      call mpi_type_indexed( count, blocklens, displs*blocklens(1),  &
+      &                         MPI_DOUBLE_PRECISION, type, ierr )
+
+      call mpi_type_commit( type, ierr )
+
+! send using this new type
+
+      if (rank .eq. 0) then
+
+          call mpi_send( sndbuf(1,1), 1, type, 1, 0, MPI_COMM_WORLD,ierr )
+
+      else if (rank .eq. 1) then
+       
+          xfersize=count * blocklens(1)
+          call mpi_recv( rcvbuf(1,1), xfersize, MPI_DOUBLE_PRECISION, 0, 0, &
+           &   MPI_COMM_WORLD,status, ierr )
+
+
+! Values that should be sent
+
+        if (verbose) then
+!       displacement = 0
+            j=1
+            do i=1, 7
+               print*,'sndbuf(',i,j,') = ',sndbuf(i,j)
+            enddo
+
+!       displacement = 10
+            j=11
+            do i=1,7
+               print*,'sndbuf(',i,j,') = ',sndbuf(i,j)
+            enddo
+            print*,' '
+
+! Values received
+            do j=1,count
+                do i=1,7
+                    print*,'rcvbuf(',i,j,') = ',rcvbuf(i,j)
+                enddo
+            enddo
+        endif
+
+! Error checking
+        do j=1,2
+           do i=1,7
+             if (rcvbuf(i,j) .ne. sndbuf(i,1)) then
+                print*,'ERROR in rcvbuf(',i,j,')'
+                print*,'Received ', rcvbuf(i,j),' expected ',sndbuf(i,11)
+                errs = errs+1
+             endif
+           enddo
+        enddo
+
+        do j=3,4
+           do i=1,7
+              if (rcvbuf(i,j) .ne. sndbuf(i,11)) then
+                print*,'ERROR in rcvbuf(',i,j,')'
+                print*,'Received ', rcvbuf(i,j),' expected ',sndbuf(i,11)
+                errs = errs+1
+              endif
+           enddo
+        enddo
+      endif
+!
+      call mpi_type_free( type, ierr )
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/kinds.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/kinds.f90
new file mode 100644 (file)
index 0000000..3d42946
--- /dev/null
@@ -0,0 +1,115 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! This program tests that all of the integer kinds defined in MPI 2.2 are
+! available.
+!
+  program main
+  use mpi
+  integer (kind=MPI_ADDRESS_KIND) aint, taint
+  integer (kind=MPI_OFFSET_KIND) oint, toint
+  integer (kind=MPI_INTEGER_KIND) iint, tiint
+  integer s(MPI_STATUS_SIZE)
+  integer i, wsize, wrank, ierr, errs
+!
+  errs = 0
+!
+  call MTEST_INIT(ierr)
+  call MPI_COMM_SIZE(MPI_COMM_WORLD,wsize,ierr)
+  call MPI_COMM_RANK(MPI_COMM_WORLD,wrank,ierr)
+  if (wsize .lt. 2) then
+     print *, "This test requires at least 2 processes"
+     call MPI_ABORT( MPI_COMM_WORLD, 1, ierr )
+  endif
+!
+! Some compilers (e.g., gfortran) will issue an error if, at compile time,
+! an assignment would cause overflow, even if appropriated guarded.  To
+! avoid this problem, we must compute the value in the integer (the
+! code here is simple; there are faster fixes for this but this is easy
+  if (wrank .eq. 0) then
+     if (range(aint) .ge. 10) then
+        aint = 1
+        do i=1, range(aint)-1
+           aint = aint * 10
+        enddo
+        aint = aint - 1
+     else
+        aint = 12345678
+     endif
+     if (range(oint) .ge. 10) then
+        oint = 1
+        do i=1, range(oint)-1
+           oint = oint * 10
+        enddo
+        oint = oint - 1
+     else
+        oint = 12345678
+     endif
+     if (range(iint) .ge. 10) then
+        iint = 1
+        do i=1, range(iint)-1
+           iint = iint * 10
+        enddo
+        iint = iint - 1
+     else
+        iint = 12345678
+     endif
+     call MPI_SEND( aint, 1, MPI_AINT, 1, 0, MPI_COMM_WORLD, ierr )
+     call MPI_SEND( oint, 1, MPI_OFFSET, 1, 1, MPI_COMM_WORLD, ierr )
+     call MPI_SEND( iint, 1, MPI_INTEGER, 1, 2, MPI_COMM_WORLD, ierr )
+!     
+  else if (wrank .eq. 1) then
+     if (range(taint) .ge. 10) then
+        taint = 1
+        do i=1, range(taint)-1
+           taint = taint * 10
+        enddo
+        taint = taint - 1
+     else
+        taint = 12345678
+     endif
+     if (range(toint) .ge. 10) then
+        toint = 1
+        do i=1, range(toint)-1
+           toint = toint * 10
+        enddo
+        toint = toint - 1
+     else
+        toint = 12345678
+     endif
+     if (range(tiint) .ge. 10) then
+        tiint = 1
+        do i=1, range(tiint)-1
+           tiint = tiint * 10
+        enddo
+        tiint = tiint - 1
+     else
+        tiint = 12345678
+     endif
+     call MPI_RECV( aint, 1, MPI_AINT, 0, 0, MPI_COMM_WORLD, s, ierr )
+     if (taint .ne. aint) then
+        print *, "Address-sized int not correctly transfered"
+        print *, "Value should be ", taint, " but is ", aint
+        errs = errs + 1
+     endif
+     call MPI_RECV( oint, 1, MPI_OFFSET, 0, 1, MPI_COMM_WORLD, s, ierr )
+     if (toint .ne. oint) then
+        print *, "Offset-sized int not correctly transfered"
+        print *, "Value should be ", toint, " but is ", oint
+        errs = errs + 1
+     endif
+     call MPI_RECV( iint, 1, MPI_INTEGER, 0, 2, MPI_COMM_WORLD, s, ierr )
+     if (tiint .ne. iint) then
+        print *, "Integer (by kind) not correctly transfered"
+        print *, "Value should be ", tiint, " but is ", iint
+        errs = errs + 1
+     endif
+!
+  endif
+!
+  call MTEST_FINALIZE(errs)
+  call MPI_FINALIZE(ierr)
+
+  end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/packef90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/packef90.f90
new file mode 100644 (file)
index 0000000..801f1aa
--- /dev/null
@@ -0,0 +1,188 @@
+! This file created from test/mpi/f77/datatype/packef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+       program main
+       use mpi
+       integer ierr, errs
+       integer inbuf(10), ioutbuf(10), inbuf2(10), ioutbuf2(10)
+       integer i, insize, rsize, csize, insize2
+       character*(16) cbuf, coutbuf
+       double precision rbuf(10), routbuf(10)
+       integer packbuf(1000), pbufsize, intsize
+       integer max_asizev
+       parameter (max_asizev = 3)
+       integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
+
+
+       errs = 0
+       call mtest_init( ierr )
+
+       call mpi_type_size( MPI_INTEGER, intsize, ierr )
+       pbufsize = 1000 * intsize
+
+       call mpi_pack_external_size( 'external32', 10, MPI_INTEGER,  &
+      &                              aint, ierr ) 
+       if (aint .ne. 10 * 4) then
+          errs = errs + 1
+          print *, 'Expected 40 for size of 10 external32 integers', &
+      &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 10, MPI_LOGICAL,  &
+      &                              aint, ierr ) 
+       if (aint .ne. 10 * 4) then
+          errs = errs + 1
+          print *, 'Expected 40 for size of 10 external32 logicals', &
+      &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 10, MPI_CHARACTER,  &
+      &                              aint, ierr ) 
+       if (aint .ne. 10 * 1) then
+          errs = errs + 1
+          print *, 'Expected 10 for size of 10 external32 characters', &
+      &       ', got ', aint
+       endif
+       
+       call mpi_pack_external_size( 'external32', 3, MPI_INTEGER2, &
+      &                              aint, ierr )
+       if (aint .ne. 3 * 2) then
+          errs = errs + 1
+          print *, 'Expected 6 for size of 3 external32 INTEGER*2', &
+      &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_INTEGER4, &
+      &                              aint, ierr )
+       if (aint .ne. 3 * 4) then
+          errs = errs + 1
+          print *, 'Expected 12 for size of 3 external32 INTEGER*4', &
+      &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_REAL4, &
+      &                              aint, ierr )
+       if (aint .ne. 3 * 4) then
+          errs = errs + 1
+          print *, 'Expected 12 for size of 3 external32 REAL*4', &
+      &       ', got ', aint
+       endif
+       call mpi_pack_external_size( 'external32', 3, MPI_REAL8, &
+      &                              aint, ierr )
+       if (aint .ne. 3 * 8) then
+          errs = errs + 1
+          print *, 'Expected 24 for size of 3 external32 REAL*8', &
+      &       ', got ', aint
+       endif
+       if (MPI_INTEGER1 .ne. MPI_DATATYPE_NULL) then
+          call mpi_pack_external_size( 'external32', 3, MPI_INTEGER1, &
+      &                              aint, ierr )
+          if (aint .ne. 3 * 1) then
+             errs = errs + 1
+             print *, 'Expected 3 for size of 3 external32 INTEGER*1', &
+      &            ', got ', aint
+          endif
+       endif
+       if (MPI_INTEGER8 .ne. MPI_DATATYPE_NULL) then
+          call mpi_pack_external_size( 'external32', 3, MPI_INTEGER8, &
+      &                              aint, ierr )
+          if (aint .ne. 3 * 8) then
+             errs = errs + 1
+             print *, 'Expected 24 for size of 3 external32 INTEGER*8', &
+      &            ', got ', aint
+          endif
+       endif
+
+!
+! Initialize values
+!
+       insize = 10
+       do i=1, insize
+          inbuf(i) = i
+       enddo
+       rsize = 3
+       do i=1, rsize
+          rbuf(i) = 1000.0 * i
+       enddo
+       cbuf  = 'This is a string'
+       csize = 16
+       insize2 = 7
+       do i=1, insize2
+          inbuf2(i) = 5000-i
+       enddo
+!
+       aintv(1) = pbufsize
+       aintv(2) = 0
+       aintv(3) = 0
+! One MPI implementation failed to increment the position; instead, 
+! it set the value with the amount of data packed in this call
+! We use aintv(3) to detect and report this specific error
+       call mpi_pack_external( 'external32', inbuf, insize, MPI_INTEGER, &
+      &               packbuf, aintv(1), aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of integer!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', rbuf, rsize,  &
+      &               MPI_DOUBLE_PRECISION, packbuf, aintv(1),  &
+      &               aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of real!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', cbuf, csize,  &
+      &               MPI_CHARACTER, packbuf, aintv(1),  &
+      &               aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of character!'
+       endif
+       aintv(3) = aintv(2)
+       call mpi_pack_external( 'external32', inbuf2, insize2,  &
+      &               MPI_INTEGER, &
+      &               packbuf, aintv(1), aintv(2), ierr )
+       if (aintv(2) .le. aintv(3)) then
+            print *, ' Position decreased after pack of integer (2nd)!'
+       endif
+       aintv(3) = aintv(2)
+!
+! We could try sending this with MPI_BYTE...
+       aintv(2) = 0
+       call mpi_unpack_external( 'external32', packbuf, aintv(1), &
+      &  aintv(2), ioutbuf, insize, MPI_INTEGER, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1), &
+      &  aintv(2), routbuf, rsize, MPI_DOUBLE_PRECISION, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1), &
+      &  aintv(2), coutbuf, csize, MPI_CHARACTER, ierr )
+       call mpi_unpack_external( 'external32', packbuf, aintv(1), &
+      &  aintv(2), ioutbuf2, insize2, MPI_INTEGER, ierr )
+!
+! Now, test the values
+!
+       do i=1, insize
+          if (ioutbuf(i) .ne. i) then
+             errs = errs + 1
+             print *, 'ioutbuf(',i,') = ', ioutbuf(i), ' expected ', i
+          endif
+       enddo
+       do i=1, rsize
+          if (routbuf(i) .ne. 1000.0 * i) then
+             errs = errs + 1
+             print *, 'routbuf(',i,') = ', routbuf(i), ' expected ',       & 
+      &                1000.0 * i
+          endif
+       enddo
+       if (coutbuf(1:csize) .ne. 'This is a string') then
+          errs = errs + 1
+          print *, 'coutbuf = ', coutbuf(1:csize), ' expected ',           &
+      &             'This is a string'
+       endif
+       do i=1, insize2
+          if (ioutbuf2(i) .ne. 5000-i) then
+             errs = errs + 1
+             print *, 'ioutbuf2(',i,') = ', ioutbuf2(i), ' expected ',     &
+      &              5000-i
+          endif
+       enddo
+!
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/sizeof.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/sizeof.f90
new file mode 100644 (file)
index 0000000..7ace5f2
--- /dev/null
@@ -0,0 +1,128 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2007 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! This program tests that the MPI_SIZEOF routine is implemented for the 
+! predefined scalar Fortran types.  It confirms that the size of these
+! types matches the size of the corresponding MPI datatypes.
+!
+      program main
+      use mpi
+      integer ierr, errs
+      integer rank, size, mpisize
+      logical verbose
+      real    r1,r1v(2)
+      double precision d1,d1v(3)
+      complex c1,c1v(4)
+      integer i1,i1v(5)
+      character ch1,ch1v(6)
+      logical l1,l1v(7)
+
+      verbose = .false.
+      errs = 0
+      call mtest_init ( ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+
+! Test of scalar types
+      call mpi_sizeof( r1, size, ierr )
+      call mpi_type_size( MPI_REAL, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_REAL = ", mpisize,                         &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( d1, size, ierr )
+      call mpi_type_size( MPI_DOUBLE_PRECISION, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_DOUBLE_PRECISION = ", mpisize, &
+              " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( i1, size, ierr )
+      call mpi_type_size( MPI_INTEGER, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_INTEGER = ", mpisize,                      &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( c1, size, ierr )
+      call mpi_type_size( MPI_COMPLEX, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_COMPLEX = ", mpisize,                      &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( ch1, size, ierr )
+      call mpi_type_size( MPI_CHARACTER, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_CHARACTER = ", mpisize, &
+              " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( l1, size, ierr )
+      call mpi_type_size( MPI_LOGICAL, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_LOGICAL = ", mpisize,                        &
+     &        " but MPI_SIZEOF gives ", size
+      endif
+!
+! Test of vector types (1-dimensional)
+      call mpi_sizeof( r1v, size, ierr )
+      call mpi_type_size( MPI_REAL, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_REAL = ", mpisize,                         &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( d1v, size, ierr )
+      call mpi_type_size( MPI_DOUBLE_PRECISION, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_DOUBLE_PRECISION = ", mpisize, &
+              " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( i1v, size, ierr )
+      call mpi_type_size( MPI_INTEGER, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_INTEGER = ", mpisize,                      &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( c1v, size, ierr )
+      call mpi_type_size( MPI_COMPLEX, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_COMPLEX = ", mpisize,                      &
+     &            " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( ch1v, size, ierr )
+      call mpi_type_size( MPI_CHARACTER, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_CHARACTER = ", mpisize, &
+              " but MPI_SIZEOF gives ", size
+      endif
+
+      call mpi_sizeof( l1v, size, ierr )
+      call mpi_type_size( MPI_LOGICAL, mpisize, ierr )
+      if (size .ne. mpisize) then
+         errs = errs + 1
+         print *, "Size of MPI_LOGICAL = ", mpisize,                        &
+     &        " but MPI_SIZEOF gives ", size
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/structf.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/structf.f90
new file mode 100644 (file)
index 0000000..abc17da
--- /dev/null
@@ -0,0 +1,113 @@
+!  
+!  (C) 2004 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! Thanks to 
+! William R. Magro
+! for this test
+!
+! It has been modifiedly slightly to work with the automated MPI
+! tests.
+!  WDG.
+!
+! It was further modified to use MPI_Get_address instead of MPI_Address
+! for MPICH, and to fit in the MPICH test harness - WDG
+!
+      program bustit
+      implicit none
+      use mpi
+      
+      integer comm
+      integer newtype
+      integer me
+      integer position
+      integer type(5)
+      integer length(5)
+      integer (kind=MPI_ADDRESS_KIND) disp(5)
+      integer bufsize
+      integer errs, toterrs
+      parameter (bufsize=100)
+      character buf(bufsize)
+      character name*(10)
+      integer status(MPI_STATUS_SIZE)
+      integer i, size
+      double precision x
+      integer src, dest
+      integer ierr
+
+      errs = 0
+!     Enroll in MPI
+      call mpi_init(ierr)
+
+!     get my rank
+      call mpi_comm_rank(MPI_COMM_WORLD, me, ierr)
+      call mpi_comm_size(MPI_COMM_WORLD, size, ierr )
+      if (size .lt. 2) then
+         print *, "Must have at least 2 processes"
+         call MPI_Abort( 1, MPI_COMM_WORLD, ierr )
+      endif
+
+      comm = MPI_COMM_WORLD
+      src = 0
+      dest = 1
+
+      if(me.eq.src) then
+          i=5
+          x=5.1234d0
+          name="Hello"
+
+          type(1)=MPI_CHARACTER
+          length(1)=5
+          call mpi_get_address(name,disp(1),ierr)
+
+          type(2)=MPI_DOUBLE_PRECISION
+          length(2)=1
+          call mpi_get_address(x,disp(2),ierr)
+
+          call mpi_type_create_struct(2,length,disp,type,newtype,ierr)
+          call mpi_type_commit(newtype,ierr)
+          call mpi_barrier( MPI_COMM_WORLD, ierr )
+          call mpi_send(MPI_BOTTOM,1,newtype,dest,1,comm,ierr)
+          call mpi_type_free(newtype,ierr)
+!         write(*,*) "Sent ",name(1:5),x
+      else 
+!         Everyone calls barrier incase size > 2
+          call mpi_barrier( MPI_COMM_WORLD, ierr )
+          if (me.eq.dest) then
+             position=0
+
+             name = " "
+             x    = 0.0d0
+             call mpi_recv(buf,bufsize,MPI_PACKED, src,                    &
+     &            1, comm, status, ierr)
+             
+             call mpi_unpack(buf,bufsize,position,                         &
+     &            name,5,MPI_CHARACTER, comm,ierr)
+             call mpi_unpack(buf,bufsize,position,                         &
+     &            x,1,MPI_DOUBLE_PRECISION, comm,ierr)
+!            Check the return values (/= is not-equal in F90)
+             if (name /= "Hello") then
+                errs = errs + 1
+                print *, "Received ", name, " but expected Hello"
+             endif
+             if (abs(x-5.1234) .gt. 1.0e-6) then
+                errs = errs + 1
+                print *, "Received ", x, " but expected 5.1234"
+             endif
+          endif
+      endif
+!
+!     Sum up errs and report the result
+      call mpi_reduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM, 0,         &
+     &                 MPI_COMM_WORLD, ierr )
+      if (me .eq. 0) then
+         if (toterrs .eq. 0) then
+            print *, " No Errors"
+         else
+            print *, " Found ", toterrs, " errors"
+         endif
+      endif
+
+      call mpi_finalize(ierr)
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/testlist b/teshsuite/smpi/mpich3-test/f90/datatype/testlist
new file mode 100644 (file)
index 0000000..715c66a
--- /dev/null
@@ -0,0 +1,20 @@
+# This file generated by f77tof90
+#typenamef90 1
+#typename3f90 1 mpiversion=3.0
+#typesnamef90 1
+#typecntsf90 1
+#typem2f90 1
+#typesubf90 1
+#packef90 1
+gaddressf90 1
+#allctypesf90 1
+#hindex1f90 1
+#hindexed_blockf90 1 mpiversion=1.0
+#structf 2
+indtype 2
+#createf90 1
+#sizeof 1
+kinds 2 mpiversion=1.0
+#trf90 1
+#get_elem_d 2
+#get_elem_u 2
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/trf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/trf90.f90
new file mode 100644 (file)
index 0000000..946e4cd
--- /dev/null
@@ -0,0 +1,25 @@
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2011 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! Based on a sample program that triggered a segfault in MPICH
+program testf90_mpi
+  implicit none
+  use mpi
+
+  integer errs
+  integer :: rk_mpi, ierr, ctype
+
+  errs = 0
+  call mtest_init(ierr)
+
+  call MPI_Type_create_f90_real(15, MPI_UNDEFINED, rk_mpi, ierr)
+  call MPI_Type_contiguous(19, rk_mpi, ctype, ierr)
+  call MPI_Type_commit(ctype, ierr)
+  call MPI_Type_free(ctype, ierr)
+
+  call mtest_finalize(errs)
+  call MPI_Finalize(ierr)
+
+end program testf90_mpi
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90.f90
new file mode 100644 (file)
index 0000000..8eb870a
--- /dev/null
@@ -0,0 +1,91 @@
+! This file created from test/mpi/f77/datatype/typecntsf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+       program main
+       use mpi
+       integer errs, ierr
+       integer ntype1, ntype2
+!
+! This is a very simple test that just tests that the contents/envelope
+! routines can be called.  This should be upgraded to test the new 
+! MPI-2 datatype routines (which use address-sized integers)
+!
+
+       errs = 0
+       call mtest_init( ierr )
+
+       call explore( MPI_INTEGER, MPI_COMBINER_NAMED, errs )
+       call explore( MPI_BYTE, MPI_COMBINER_NAMED, errs )
+       call mpi_type_vector( 10, 1, 30, MPI_DOUBLE_PRECISION, ntype1,  &
+      &                       ierr )
+       call explore( ntype1, MPI_COMBINER_VECTOR, errs )
+       call mpi_type_dup( ntype1, ntype2, ierr )
+       call explore( ntype2, MPI_COMBINER_DUP, errs )
+       call mpi_type_free( ntype2, ierr )
+       call mpi_type_free( ntype1, ierr )
+       
+!
+       call mtest_finalize( errs )
+       call mpi_finalize( ierr )
+       end
+!
+       subroutine explore( dtype, mycomb, errs )
+       use mpi
+       integer dtype, mycomb, errs
+       integer ierr
+       integer nints, nadds, ntype, combiner
+       integer max_nints, max_dtypes, max_asizev
+       parameter (max_nints = 10, max_dtypes = 10, max_asizev=10)
+       integer intv(max_nints), dtypesv(max_dtypes)
+       integer (kind=MPI_ADDRESS_KIND) aintv(max_asizev)
+
+!
+       call mpi_type_get_envelope( dtype, nints, nadds, ntype, &
+      &                             combiner, ierr )
+!
+       if (combiner .ne. MPI_COMBINER_NAMED) then
+          call mpi_type_get_contents( dtype,  &
+      &         max_nints, max_asizev, max_dtypes, &
+      &         intv, aintv, dtypesv, ierr )
+!
+!              dtypesv of constructed types must be free'd now
+!
+          if (combiner .eq. MPI_COMBINER_DUP) then
+             call mpi_type_free( dtypesv(1), ierr )
+          endif
+       endif
+       if (combiner .ne. mycomb) then
+          errs = errs + 1
+          print *, ' Expected combiner ', mycomb, ' but got ', &
+      &             combiner
+       endif
+!
+! List all combiner types to check that they are defined in mpif.h
+       if (combiner .eq. MPI_COMBINER_NAMED) then
+       else if (combiner .eq. MPI_COMBINER_DUP) then
+       else if (combiner .eq. MPI_COMBINER_CONTIGUOUS) then
+       else if (combiner .eq. MPI_COMBINER_VECTOR) then
+       else if (combiner .eq. MPI_COMBINER_HVECTOR_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_HVECTOR) then
+       else if (combiner .eq. MPI_COMBINER_INDEXED) then
+       else if (combiner .eq. MPI_COMBINER_HINDEXED_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_HINDEXED) then
+       else if (combiner .eq. MPI_COMBINER_INDEXED_BLOCK) then
+       else if (combiner .eq. MPI_COMBINER_STRUCT_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_STRUCT) then
+       else if (combiner .eq. MPI_COMBINER_SUBARRAY) then
+       else if (combiner .eq. MPI_COMBINER_DARRAY) then
+       else if (combiner .eq. MPI_COMBINER_F90_REAL) then
+       else if (combiner .eq. MPI_COMBINER_F90_COMPLEX) then
+       else if (combiner .eq. MPI_COMBINER_F90_INTEGER) then
+       else if (combiner .eq. MPI_COMBINER_RESIZED) then
+       else
+          errs = errs + 1
+          print *, ' Unknown combiner ', combiner
+       endif
+       
+       return
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typem2f90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typem2f90.f90
new file mode 100644 (file)
index 0000000..c5eb8e5
--- /dev/null
@@ -0,0 +1,178 @@
+! This file created from test/mpi/f77/datatype/typem2f.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer errs, ierr, i, intsize
+      integer type1, type2, type3, type4, type5
+      integer max_asizev
+      parameter (max_asizev = 10)
+      integer (kind=MPI_ADDRESS_KIND) aint, aintv(max_asizev)
+
+      integer blocklens(max_asizev), dtypes(max_asizev)
+      integer displs(max_asizev)
+      integer recvbuf(6*max_asizev)
+      integer sendbuf(max_asizev), status(MPI_STATUS_SIZE)
+      integer rank, size
+
+      errs = 0
+
+      call mtest_init( ierr )
+
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+!
+      call mpi_type_size( MPI_INTEGER, intsize, ierr )
+!
+      aintv(1) = 0
+      aintv(2) = 3 * intsize
+      call mpi_type_create_resized( MPI_INTEGER, aintv(1), aintv(2),  &
+      &                              type1, ierr )
+      call mpi_type_commit( type1, ierr )
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected lb'
+      endif
+      if (aintv(2) .ne. 3*intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected extent'
+      endif
+      aintv(1) = -1
+      aintv(2) = -1
+      call mpi_type_get_true_extent( type1, aintv(1), aintv(2), ierr )
+      if (aintv(1) .ne. 0) then
+         errs = errs + 1
+         print *, 'Did not get expected true lb'
+      endif
+      if (aintv(2) .ne. intsize) then
+         errs = errs + 1
+         print *, 'Did not get expected true extent (', aintv(2), ') ', &
+      &     ' expected ', intsize
+      endif
+!
+      do i=1,10
+         blocklens(i) = 1
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_hindexed( 10, blocklens, aintv,  &
+      &                               MPI_INTEGER, type2, ierr )
+      call mpi_type_commit( type2, ierr )
+!
+      aint = 3 * intsize
+      call mpi_type_create_hvector( 10, 1, aint, MPI_INTEGER, type3,  &
+      &                              ierr )
+      call mpi_type_commit( type3, ierr )
+!
+      do i=1,10
+         blocklens(i) = 1
+         dtypes(i)    = MPI_INTEGER
+         aintv(i)    = (i-1) * 3 * intsize
+      enddo
+      call mpi_type_create_struct( 10, blocklens, aintv, dtypes, &
+      &                             type4, ierr )
+      call mpi_type_commit( type4, ierr )
+
+      do i=1,10
+         displs(i)    = (i-1) * 3
+      enddo
+      call mpi_type_create_indexed_block( 10, 1, displs,  &
+      &                               MPI_INTEGER, type5, ierr )
+      call mpi_type_commit( type5, ierr )
+!
+! Using each time, send and receive using these types
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,  &
+      &                   recvbuf, max_asizev, type1, rank, 0,  &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type1:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,  &
+      &                   recvbuf, 1, type2, rank, 0,  &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type2:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,  &
+      &                   recvbuf, 1, type3, rank, 0,  &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type3:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,  &
+      &                   recvbuf, 1, type4, rank, 0,  &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type4:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      do i=1, max_asizev*3
+         recvbuf(i) = -1
+      enddo
+      do i=1, max_asizev
+         sendbuf(i) = i
+      enddo
+      call mpi_sendrecv( sendbuf, max_asizev, MPI_INTEGER, rank, 0,  &
+      &                   recvbuf, 1, type5, rank, 0,  &
+      &                   MPI_COMM_WORLD, status, ierr )
+      do i=1, max_asizev
+         if (recvbuf(1+(i-1)*3) .ne. i ) then
+            errs = errs + 1
+            print *, 'type5:', i, 'th element = ', recvbuf(1+(i-1)*3)
+         endif
+      enddo
+!
+      call mpi_type_free( type1, ierr )
+      call mpi_type_free( type2, ierr )
+      call mpi_type_free( type3, ierr )
+      call mpi_type_free( type4, ierr )
+      call mpi_type_free( type5, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typename3f90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typename3f90.f90
new file mode 100644 (file)
index 0000000..4e91774
--- /dev/null
@@ -0,0 +1,41 @@
+! This file created from test/mpi/f77/datatype/typename3f.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!
+!  (C) 2012 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      character*(MPI_MAX_OBJECT_NAME) name
+      integer namelen
+      integer ierr, errs
+
+      errs = 0
+
+      call mtest_init( ierr )
+!
+! Check each Fortran datatype, including the size-specific ones
+! See the C version (typename.c) for the relevant MPI sections
+
+      call MPI_Type_get_name( MPI_AINT, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_AINT") then
+           errs = errs + 1
+           print *, "Expected MPI_AINT but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_OFFSET, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_OFFSET") then
+           errs = errs + 1
+           print *, "Expected MPI_OFFSET but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_COUNT, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_COUNT") then
+           errs = errs + 1
+           print *, "Expected MPI_COUNT but got "//name(1:namelen)
+      endif
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typenamef90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typenamef90.f90
new file mode 100644 (file)
index 0000000..eda12dd
--- /dev/null
@@ -0,0 +1,205 @@
+! This file created from test/mpi/f77/datatype/typenamef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      character*(MPI_MAX_OBJECT_NAME) name
+      integer namelen
+      integer ierr, errs
+
+      errs = 0
+
+      call mtest_init( ierr )
+!
+! Check each Fortran datatype, including the size-specific ones
+! See the C version (typename.c) for the relevant MPI sections
+
+      call MPI_Type_get_name( MPI_COMPLEX, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_COMPLEX") then
+           errs = errs + 1
+           print *, "Expected MPI_COMPLEX but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_DOUBLE_COMPLEX, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_DOUBLE_COMPLEX") then
+           errs = errs + 1
+           print *, "Expected MPI_DOUBLE_COMPLEX but got "// &
+      &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_LOGICAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_LOGICAL") then
+           errs = errs + 1
+           print *, "Expected MPI_LOGICAL but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_REAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_REAL") then
+           errs = errs + 1
+           print *, "Expected MPI_REAL but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_DOUBLE_PRECISION, name, namelen, ierr)
+      if (name(1:namelen) .ne. "MPI_DOUBLE_PRECISION") then
+           errs = errs + 1
+           print *, "Expected MPI_DOUBLE_PRECISION but got "// &
+      &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_INTEGER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_INTEGER") then
+           errs = errs + 1
+           print *, "Expected MPI_INTEGER but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_2INTEGER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_2INTEGER") then
+           errs = errs + 1
+           print *, "Expected MPI_2INTEGER but got "//name(1:namelen)
+      endif
+
+! 2COMPLEX was present only in MPI 1.0
+!      call MPI_Type_get_name( MPI_2COMPLEX, name, namelen, ierr )
+!      if (name(1:namelen) .ne. "MPI_2COMPLEX") then
+!           errs = errs + 1
+!           print *, "Expected MPI_2COMPLEX but got "//name(1:namelen)
+!      endif
+!
+      call MPI_Type_get_name(MPI_2DOUBLE_PRECISION, name, namelen, ierr)
+      if (name(1:namelen) .ne. "MPI_2DOUBLE_PRECISION") then
+           errs = errs + 1
+           print *, "Expected MPI_2DOUBLE_PRECISION but got "// &
+      &          name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_2REAL, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_2REAL") then
+           errs = errs + 1
+           print *, "Expected MPI_2REAL but got "//name(1:namelen)
+      endif
+
+! 2DOUBLE_COMPLEX isn't in MPI 2.1
+!      call MPI_Type_get_name( MPI_2DOUBLE_COMPLEX, name, namelen, ierr )
+!      if (name(1:namelen) .ne. "MPI_2DOUBLE_COMPLEX") then
+!           errs = errs + 1
+!           print *, "Expected MPI_2DOUBLE_COMPLEX but got "//
+!     &          name(1:namelen)
+!      endif
+
+      call MPI_Type_get_name( MPI_CHARACTER, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_CHARACTER") then
+           errs = errs + 1
+           print *, "Expected MPI_CHARACTER but got "//name(1:namelen)
+      endif
+
+      call MPI_Type_get_name( MPI_BYTE, name, namelen, ierr )
+      if (name(1:namelen) .ne. "MPI_BYTE") then
+           errs = errs + 1
+           print *, "Expected MPI_BYTE but got "//name(1:namelen)
+      endif
+
+      if (MPI_REAL4 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL4, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL4") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL4 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_REAL8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL8") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL8 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_REAL16 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_REAL16, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_REAL16") then
+               errs = errs + 1
+               print *, "Expected MPI_REAL16 but got "//name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX8") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX8 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX16 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX16, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX16") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX16 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_COMPLEX32 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_COMPLEX32, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_COMPLEX32") then
+               errs = errs + 1
+               print *, "Expected MPI_COMPLEX32 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER1 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER1, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER1") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER1 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER2 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER2, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER2") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER2 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER4 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER4, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER4") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER4 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+      if (MPI_INTEGER8 .ne. MPI_DATATYPE_NULL) then
+          call MPI_Type_get_name( MPI_INTEGER8, name, namelen, ierr )
+          if (name(1:namelen) .ne. "MPI_INTEGER8") then
+               errs = errs + 1
+               print *, "Expected MPI_INTEGER8 but got "// &
+      &              name(1:namelen)
+          endif
+      endif
+
+! MPI_INTEGER16 is in MPI 2.1, but it is missing from most tables
+! Some MPI implementations may not provide it
+!      if (MPI_INTEGER16 .ne. MPI_DATATYPE_NULL) then
+!          call MPI_Type_get_name( MPI_INTEGER16, name, namelen, ierr )
+!          if (name(1:namelen) .ne. "MPI_INTEGER16") then
+!               errs = errs + 1
+!               print *, "Expected MPI_INTEGER16 but got "//
+!     &              name(1:namelen)
+!          endif
+!      endif
+
+      call mtest_finalize( errs )
+      call MPI_Finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typesnamef90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typesnamef90.f90
new file mode 100644 (file)
index 0000000..27f6a03
--- /dev/null
@@ -0,0 +1,67 @@
+! This file created from test/mpi/f77/datatype/typesnamef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+       program main
+       use mpi
+       character*(MPI_MAX_OBJECT_NAME) cname
+       integer rlen, ln
+       integer ntype1, ntype2, errs, ierr
+
+       errs = 0
+       
+       call MTest_Init( ierr )
+
+       call mpi_type_vector( 10, 1, 100, MPI_INTEGER, ntype1, ierr )
+       rlen = -1
+       cname = 'XXXXXX'
+       call mpi_type_get_name( ntype1, cname, rlen, ierr )
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' Expected length 0, got ', rlen
+       endif
+       rlen = 0
+       do ln=MPI_MAX_OBJECT_NAME,1,-1
+          if (cname(ln:ln) .ne. ' ') then
+             rlen = ln
+             goto 100
+          endif
+       enddo
+ 100   continue
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, 'Datatype name is not all blank'
+       endif
+!
+! now add a name, then dup
+       call mpi_type_set_name( ntype1, 'a vector type', ierr )
+       call mpi_type_dup( ntype1, ntype2, ierr )
+       rlen = -1
+       cname = 'XXXXXX'
+       call mpi_type_get_name( ntype2, cname, rlen, ierr )
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' (type2) Expected length 0, got ', rlen
+       endif
+       rlen = 0
+       do ln=MPI_MAX_OBJECT_NAME,1,-1
+          if (cname(ln:ln) .ne. ' ') then
+             rlen = ln
+             goto 110
+          endif
+       enddo
+ 110   continue
+       if (rlen .ne. 0) then
+          errs = errs + 1
+          print *, ' (type2) Datatype name is not all blank'
+       endif
+       
+       call mpi_type_free( ntype1, ierr )
+       call mpi_type_free( ntype2, ierr )
+       
+       call MTest_Finalize( errs )
+       call MPI_Finalize( ierr )
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/typesubf90.f90 b/teshsuite/smpi/mpich3-test/f90/datatype/typesubf90.f90
new file mode 100644 (file)
index 0000000..aea04d9
--- /dev/null
@@ -0,0 +1,73 @@
+! This file created from test/mpi/f77/datatype/typesubf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer errs, ierr
+      integer maxn, maxm
+      parameter (maxn=10,maxm=15)
+      integer fullsizes(2), subsizes(2), starts(2)
+      integer fullarr(maxn,maxm),subarr(maxn-3,maxm-4)
+      integer i,j, ssize
+      integer newtype, size, rank, ans
+
+      errs = 0
+      call mtest_init( ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+!
+! Create a Fortran-style subarray
+      fullsizes(1) = maxn
+      fullsizes(2) = maxm
+      subsizes(1)  = maxn - 3
+      subsizes(2)  = maxm - 4
+! starts are from zero, even in Fortran
+      starts(1)    = 1
+      starts(2)    = 2
+! In Fortran 90 notation, the original array is
+!    integer a(maxn,maxm)
+! and the subarray is
+!    a(1+1:(maxn-3) +(1+1)-1,2+1:(maxm-4)+(2+1)-1)
+! i.e., a (start:(len + start - 1),...)
+      call mpi_type_create_subarray( 2, fullsizes, subsizes, starts,  &
+      &         MPI_ORDER_FORTRAN, MPI_INTEGER, newtype, ierr )
+      call mpi_type_commit( newtype, ierr )
+!
+! Prefill the array
+      do j=1, maxm
+         do i=1, maxn
+            fullarr(i,j) = (i-1) + (j-1) * maxn
+         enddo
+      enddo
+      do j=1, subsizes(2)
+         do i=1, subsizes(1)
+            subarr(i,j) = -1
+         enddo
+      enddo
+      ssize = subsizes(1)*subsizes(2)
+      call mpi_sendrecv( fullarr, 1, newtype, rank, 0,  &
+      &                   subarr, ssize, MPI_INTEGER, rank, 0,  &
+      &                   MPI_COMM_WORLD, MPI_STATUS_IGNORE, ierr )
+!
+! Check the data
+      do j=1, subsizes(2)
+         do i=1, subsizes(1)
+            ans = (i+starts(1)-1) + (j+starts(2)-1) * maxn
+            if (subarr(i,j) .ne. ans) then
+               errs = errs + 1
+               if (errs .le. 10) then
+                  print *, rank, 'subarr(',i,',',j,') = ', subarr(i,j)
+               endif
+            endif
+         enddo
+      enddo
+
+      call mpi_type_free( newtype, ierr )
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d64be2f
--- /dev/null
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+
+  add_executable(baseenvf90 baseenvf90.f90 ../util/mtestf90.f90)
+  target_link_libraries(baseenvf90  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/baseenvf90.f90
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f90/init/baseenvf90.f90 b/teshsuite/smpi/mpich3-test/f90/init/baseenvf90.f90
new file mode 100644 (file)
index 0000000..a206c43
--- /dev/null
@@ -0,0 +1,90 @@
+! This file created from test/mpi/f77/init/baseenvf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+       program main
+       use mpi
+       integer ierr, provided, errs, rank, size
+       integer iv, isubv, qprovided
+       logical flag
+
+       errs = 0
+       flag = .true.
+       call mpi_finalized( flag, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Returned true for finalized before init'
+       endif
+       flag = .true.
+       call mpi_initialized( flag, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Return true for initialized before init'
+       endif
+
+       provided = -1
+       call mpi_init_thread( MPI_THREAD_MULTIPLE, provided, ierr )
+
+       if (provided .ne. MPI_THREAD_MULTIPLE .and.  &
+      &     provided .ne. MPI_THREAD_SERIALIZED .and. &
+      &     provided .ne. MPI_THREAD_FUNNELED .and. &
+      &     provided .ne. MPI_THREAD_SINGLE) then
+          errs = errs + 1
+          print *, ' Unrecognized value for provided = ', provided
+       endif
+
+       iv    = -1
+       isubv = -1
+       call mpi_get_version( iv, isubv, ierr )
+       if (iv .ne. MPI_VERSION .or. isubv .ne. MPI_SUBVERSION) then
+          errs = errs + 1
+          print *, 'Version in mpif.h and get_version do not agree'
+          print *, 'Version in mpif.h is ', MPI_VERSION, '.',  &
+      &              MPI_SUBVERSION
+          print *, 'Version in get_version is ', iv, '.', isubv
+       endif
+       if (iv .lt. 1 .or. iv .gt. 3) then
+          errs = errs + 1
+          print *, 'Version of MPI is invalid (=', iv, ')'
+       endif
+       if (isubv.lt.0 .or. isubv.gt.2) then
+          errs = errs + 1
+          print *, 'Subversion of MPI is invalid (=', isubv, ')'
+       endif
+
+       call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+       call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+
+       flag = .false.
+       call mpi_is_thread_main( flag, ierr )
+       if (.not.flag) then
+          errs = errs + 1
+          print *, 'is_thread_main returned false for main thread'
+       endif
+          
+       call mpi_query_thread( qprovided, ierr )
+       if (qprovided .ne. provided) then
+          errs = errs + 1
+          print *,'query thread and init thread disagree on'// &
+      &           ' thread level'
+       endif
+
+       call mpi_finalize( ierr )
+       flag = .false.
+       call mpi_finalized( flag, ierr )
+       if (.not. flag) then
+          errs = errs + 1
+          print *, 'finalized returned false after finalize'
+       endif
+
+       if (rank .eq. 0) then
+          if (errs .eq. 0) then 
+             print *, ' No Errors'
+          else
+             print *, ' Found ', errs, ' errors'
+          endif
+       endif
+
+       end
diff --git a/teshsuite/smpi/mpich3-test/f90/init/testlist b/teshsuite/smpi/mpich3-test/f90/init/testlist
new file mode 100644 (file)
index 0000000..bee590b
--- /dev/null
@@ -0,0 +1,2 @@
+# This file generated by f77tof90
+baseenvf90 1
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
new file mode 100644 (file)
index 0000000..682e23c
--- /dev/null
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+
+  add_executable(allpairf90 allpairf90.f90 ../util/mtestf90.f90)
+  add_executable(greqf90 greqf90.f90 dummyf90.f90 ../util/mtestf90.f90)
+#  add_executable(mprobef90 mprobef90.f90 ../util/mtestf90.f90)
+  add_executable(statusesf90 statusesf90.f90 ../util/mtestf90.f90)
+  target_link_libraries(allpairf90  simgrid)
+  target_link_libraries(greqf90  simgrid)
+#  target_link_libraries(mprobef90  simgrid)
+  target_link_libraries(statusesf90  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/allpairf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/dummyf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/greqf90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/mprobef90.f90
+  ${CMAKE_CURRENT_SOURCE_DIR}/statusesf90.f90
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90
new file mode 100644 (file)
index 0000000..70f5c51
--- /dev/null
@@ -0,0 +1,1016 @@
+! This file created from test/mpi/f77/pt2pt/allpairf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2012 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+! This program is based on the allpair.f test from the MPICH-1 test
+! (test/pt2pt/allpair.f), which in turn was inspired by a bug report from
+! fsset@corelli.lerc.nasa.gov (Scott Townsend)
+
+      program allpair
+      use mpi
+      integer ierr, errs, comm
+      logical mtestGetIntraComm
+      logical verbose
+      common /flags/ verbose
+      
+      errs = 0
+      verbose = .false.
+!      verbose = .true.
+      call MTest_Init( ierr )
+
+      do while ( mtestGetIntraComm( comm, 2, .false. ) )
+         call test_pair_send( comm, errs )
+         call test_pair_ssend( comm, errs )
+         !call test_pair_rsend( comm, errs )
+         call test_pair_isend( comm, errs )
+         !call test_pair_irsend( comm, errs )
+         call test_pair_issend( comm, errs )
+         call test_pair_psend( comm, errs )
+         !call test_pair_prsend( comm, errs )
+         call test_pair_pssend( comm, errs )
+         call test_pair_sendrecv( comm, errs )
+         call test_pair_sendrecvrepl( comm, errs )
+         call mtestFreeComm( comm )
+      enddo
+!         
+      call MTest_Finalize( errs )
+      call MPI_Finalize(ierr)
+!
+      end
+!
+      subroutine test_pair_send( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Send and recv'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 1123
+      count = TEST_SIZE / 5
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Send(send_buf, count, MPI_REAL, next, tag, &
+      &        comm, ierr) 
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, status, ierr)
+!
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE, &
+      &                   'send and recv', errs )
+      else if (prev .eq. 0)  then
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'send and recv', errs )
+!
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag, comm, ierr) 
+      end if
+!
+      end
+!
+      subroutine test_pair_rsend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(1)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Rsend and recv'
+      endif
+!
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 1456
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!        
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag,  &
+      &                  comm, status, ierr )
+!
+         call MPI_Rsend(send_buf, count, MPI_REAL, next, tag, &
+      &                  comm, ierr) 
+!
+         call MPI_Probe(MPI_ANY_SOURCE, tag, comm, status, ierr) 
+!
+         if (status(MPI_SOURCE) .ne. next) then
+            print *, 'Rsend: Incorrect source, expected', next, &
+      &               ', got', status(MPI_SOURCE)
+            errs = errs + 1
+         end if
+!
+         if (status(MPI_TAG) .ne. tag) then
+            print *, 'Rsend: Incorrect tag, expected', tag, &
+      &               ', got', status(MPI_TAG)
+            errs = errs + 1
+         end if
+!
+         call MPI_Get_count(status, MPI_REAL, i, ierr)
+!
+         if (i .ne. count) then
+            print *, 'Rsend: Incorrect count, expected', count, &
+      &               ', got', i
+            errs = errs + 1
+         end if
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm,  &
+      &                 status, ierr)
+!
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE, &
+      &                   'rsend and recv', errs )
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 requests(1), ierr)
+         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, prev, tag,  &
+      &                  comm, ierr )
+         call MPI_Wait( requests(1), status, ierr )
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'rsend and recv', errs )
+!
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag, &
+      &                  comm, ierr) 
+      end if
+!
+      end
+!
+      subroutine test_pair_ssend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Ssend and recv'
+      endif
+!
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 1789
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Iprobe(MPI_ANY_SOURCE, tag, &
+      &                   comm, flag, status, ierr) 
+!
+         if (flag) then
+            print *, 'Ssend: Iprobe succeeded! source',  &
+      &               status(MPI_SOURCE), &
+      &               ', tag', status(MPI_TAG)
+            errs = errs + 1
+         end if
+!
+         call MPI_Ssend(send_buf, count, MPI_REAL, next, tag, &
+      &                  comm, ierr) 
+!
+         do while (.not. flag)
+            call MPI_Iprobe(MPI_ANY_SOURCE, tag, &
+      &                      comm, flag, status, ierr) 
+         end do
+!           
+         if (status(MPI_SOURCE) .ne. next) then
+            print *, 'Ssend: Incorrect source, expected', next, &
+      &               ', got', status(MPI_SOURCE)
+            errs = errs + 1
+         end if
+!
+         if (status(MPI_TAG) .ne. tag) then
+            print *, 'Ssend: Incorrect tag, expected', tag, &
+      &               ', got', status(MPI_TAG)
+            errs = errs + 1
+         end if
+!
+         call MPI_Get_count(status, MPI_REAL, i, ierr)
+!
+         if (i .ne. count) then
+            print *, 'Ssend: Incorrect count, expected', count, &
+      &               ', got', i
+            errs = errs + 1
+         end if
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+!
+         call msg_check( recv_buf, next, tag, count, status, &
+      &        TEST_SIZE, 'ssend and recv', errs ) 
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+!
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'ssend and recv', errs )
+!
+         call MPI_Ssend(recv_buf, count, MPI_REAL, prev, tag, &
+      &                  comm, ierr) 
+      end if
+!
+      end
+!
+      subroutine test_pair_isend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' isend and irecv'
+      endif
+!
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 2123
+      count = TEST_SIZE / 5
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                  requests(1), ierr)
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Isend(send_buf, count, MPI_REAL, next, tag, &
+      &                  comm, requests(2), ierr) 
+!
+         call MPI_Waitall(2, requests, statuses, ierr)
+!
+         call rq_check( requests, 2, 'isend and irecv' )
+!
+         call msg_check( recv_buf, next, tag, count, statuses(1,1), &
+      &        TEST_SIZE, 'isend and irecv', errs )
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+!
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'isend and irecv', errs )
+!
+         call MPI_Isend(recv_buf, count, MPI_REAL, prev, tag, &
+      &                  comm, requests(1), ierr) 
+!
+         call MPI_Wait(requests(1), status, ierr)
+!
+         call rq_check( requests(1), 1, 'isend and irecv' )
+!
+      end if
+!
+      end
+!
+      subroutine test_pair_irsend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index
+      integer TEST_SIZE
+      integer dupcom
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Irsend and irecv'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      call mpi_comm_dup( comm, dupcom, ierr )
+!
+      tag = 2456
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                  requests(1), ierr)
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, next, 0,  &
+      &                      MPI_BOTTOM, 0, MPI_INTEGER, next, 0,  &
+      &                      dupcom, status, ierr )
+!
+         call MPI_Irsend(send_buf, count, MPI_REAL, next, tag, &
+      &                   comm, requests(2), ierr) 
+!
+         index = -1
+         do while (index .ne. 1)
+            call MPI_Waitany(2, requests, index, statuses, ierr)
+         end do
+!
+         call rq_check( requests(1), 1, 'irsend and irecv' )
+!
+         call msg_check( recv_buf, next, tag, count, statuses, &
+      &           TEST_SIZE, 'irsend and irecv', errs )
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                  requests(1), ierr)
+!
+         call MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INTEGER, prev, 0,  &
+      &                      MPI_BOTTOM, 0, MPI_INTEGER, prev, 0,  &
+      &                      dupcom, status, ierr )
+!
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Test(requests(1), flag, status, ierr)
+         end do
+!
+         call rq_check( requests, 1, 'irsend and irecv (test)' )
+!
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'irsend and irecv', errs )
+!
+         call MPI_Irsend(recv_buf, count, MPI_REAL, prev, tag, &
+      &                   comm, requests(1), ierr) 
+!
+         call MPI_Waitall(1, requests, statuses, ierr)
+!
+         call rq_check( requests, 1, 'irsend and irecv' )
+!
+      end if
+!
+      call mpi_comm_free( dupcom, ierr )
+!
+      end
+!
+      subroutine test_pair_issend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE), requests(2)
+      integer statuses(MPI_STATUS_SIZE,2)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' issend and irecv (testall)'
+      endif
+!
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 2789
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      if (rank .eq. 0) then
+!
+         call MPI_Irecv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                  MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                  requests(1), ierr)
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Issend(send_buf, count, MPI_REAL, next, tag, &
+      &                   comm, requests(2), ierr) 
+!
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testall(2, requests, flag, statuses, ierr)
+         end do
+!
+         call rq_check( requests, 2, 'issend and irecv (testall)' )
+!
+         call msg_check( recv_buf, next, tag, count, statuses(1,1), &
+      &           TEST_SIZE, 'issend and recv (testall)', errs )
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'issend and recv', errs )
+
+         call MPI_Issend(recv_buf, count, MPI_REAL, prev, tag, &
+      &                   comm, requests(1), ierr) 
+!
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testany(1, requests(1), index, flag, &
+      &                       statuses(1,1), ierr)
+         end do
+!
+         call rq_check( requests, 1, 'issend and recv (testany)' )
+!
+      end if
+!
+      end
+!
+      subroutine test_pair_psend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Persistent send and recv'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 3123
+      count = TEST_SIZE / 5
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                   requests(2), ierr)
+!
+      if (rank .eq. 0) then
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Send_init(send_buf, count, MPI_REAL, next, tag, &
+      &                      comm, requests(1), ierr) 
+!
+         call MPI_Startall(2, requests, ierr) 
+         call MPI_Waitall(2, requests, statuses, ierr)
+!
+         call msg_check( recv_buf, next, tag, count, statuses(1,2), &
+      &        TEST_SIZE, 'persistent send/recv', errs )
+!
+         call MPI_Request_free(requests(1), ierr)
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Send_init(send_buf, count, MPI_REAL, prev, tag, &
+      &                      comm, requests(1), ierr) 
+         call MPI_Start(requests(2), ierr) 
+         call MPI_Wait(requests(2), status, ierr)
+!
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'persistent send/recv', errs )
+!
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+!
+         call MPI_Start(requests(1), ierr) 
+         call MPI_Wait(requests(1), status, ierr)
+!
+         call MPI_Request_free(requests(1), ierr)
+      end if
+!
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(2), ierr)
+!
+      end
+!
+      subroutine test_pair_prsend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer outcount, indices(2)
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Persistent Rsend and recv'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 3456
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                   requests(2), ierr)
+!
+      if (rank .eq. 0) then
+!
+         call MPI_Rsend_init(send_buf, count, MPI_REAL, next, tag, &
+      &                       comm, requests(1), ierr) 
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Recv( MPI_BOTTOM, 0, MPI_INTEGER, next, tag,  &
+      &                  comm, status, ierr )
+!
+         call MPI_Startall(2, requests, ierr)
+!
+         index = -1
+!
+         do while (index .ne. 2)
+            call MPI_Waitsome(2, requests, outcount, &
+      &                        indices, statuses, ierr)
+            do i = 1,outcount
+               if (indices(i) .eq. 2) then
+                  call msg_check( recv_buf, next, tag, count, &
+      &                 statuses(1,i), TEST_SIZE, 'waitsome', errs )
+                  index = 2
+               end if
+            end do
+         end do
+!
+         call MPI_Request_free(requests(1), ierr)
+      else if (prev .eq. 0) then
+!
+         call MPI_Rsend_init(send_buf, count, MPI_REAL, prev, tag, &
+      &                       comm, requests(1), ierr) 
+!
+         call MPI_Start(requests(2), ierr)
+!
+         call MPI_Send( MPI_BOTTOM, 0, MPI_INTEGER, prev, tag,  &
+      &                  comm, ierr )
+!
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Test(requests(2), flag, status, ierr)
+         end do
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'test', errs )
+!
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+!
+         call MPI_Start(requests(1), ierr)
+         call MPI_Wait(requests(1), status, ierr)
+!
+         call MPI_Request_free(requests(1), ierr)
+      end if
+!
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(2), ierr)
+!
+      end
+!
+      subroutine test_pair_pssend( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, index, i
+      integer outcount, indices(2)
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer statuses(MPI_STATUS_SIZE,2), requests(2)
+      integer status(MPI_STATUS_SIZE)
+      logical flag
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Persistent Ssend and recv'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 3789
+      count = TEST_SIZE / 3
+!
+      call clear_test_data(recv_buf,TEST_SIZE)
+!
+      call MPI_Recv_init(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                   MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                   requests(1), ierr)
+!
+      if (rank .eq. 0) then
+!
+         call MPI_Ssend_init(send_buf, count, MPI_REAL, next, tag, &
+      &                       comm, requests(2), ierr) 
+!
+         call init_test_data(send_buf,TEST_SIZE)
+!
+         call MPI_Startall(2, requests, ierr)
+!
+         index = -1
+         do while (index .ne. 1)
+            call MPI_Testsome(2, requests, outcount, &
+      &                        indices, statuses, ierr)
+            do i = 1,outcount
+               if (indices(i) .eq. 1) then
+                  call msg_check( recv_buf, next, tag, count, &
+      &                 statuses(1,i), TEST_SIZE, 'testsome', errs )
+                  index = 1
+               end if
+            end do
+         end do
+!
+         call MPI_Request_free(requests(2), ierr)
+!
+      else if (prev .eq. 0) then
+!
+         call MPI_Ssend_init(send_buf, count, MPI_REAL, prev, tag, &
+      &                       comm, requests(2), ierr) 
+!
+         call MPI_Start(requests(1), ierr)
+!
+         flag = .FALSE.
+         do while (.not. flag)
+            call MPI_Testany(1, requests(1), index, flag, &
+      &                       statuses(1,1), ierr)
+         end do
+         call msg_check( recv_buf, prev, tag, count, statuses(1,1), &
+      &           TEST_SIZE, 'testany', errs )
+
+         do i = 1,count
+            send_buf(i) = recv_buf(i)
+         end do
+!
+         call MPI_Start(requests(2), ierr)
+         call MPI_Wait(requests(2), status, ierr)
+!
+         call MPI_Request_free(requests(2), ierr)
+!
+      end if
+!
+      call dummyRef( send_buf, count, ierr )
+      call MPI_Request_free(requests(1), ierr)
+!
+      end
+!
+      subroutine test_pair_sendrecv( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real send_buf(TEST_SIZE), recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Sendrecv'
+      endif
+!
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 4123
+      count = TEST_SIZE / 5
+
+      call clear_test_data(recv_buf,TEST_SIZE)
+
+      if (rank .eq. 0) then
+
+         call init_test_data(send_buf,TEST_SIZE)
+
+         call MPI_Sendrecv(send_buf, count, MPI_REAL, next, tag, &
+      &                     recv_buf, count, MPI_REAL, next, tag, &
+      &                     comm, status, ierr) 
+
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE, &
+      &                   'sendrecv', errs )
+
+      else if (prev .eq. 0) then
+
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'recv/send', errs )
+
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag, &
+      &                 comm, ierr) 
+      end if
+!
+      end
+!
+      subroutine test_pair_sendrecvrepl( comm, errs )
+      use mpi
+      integer comm, errs
+      integer rank, size, ierr, next, prev, tag, count, i
+      integer TEST_SIZE
+      parameter (TEST_SIZE=2000)
+      integer status(MPI_STATUS_SIZE)
+      real recv_buf(TEST_SIZE)
+      logical verbose
+      common /flags/ verbose
+!
+      if (verbose) then
+         print *, ' Sendrecv replace'
+      endif
+!
+      call mpi_comm_rank( comm, rank, ierr )
+      call mpi_comm_size( comm, size, ierr )
+      next = rank + 1
+      if (next .ge. size) next = 0
+!
+      prev = rank - 1
+      if (prev .lt. 0) prev = size - 1
+!
+      tag = 4456
+      count = TEST_SIZE / 3
+
+      if (rank .eq. 0) then
+!
+         call init_test_data(recv_buf, TEST_SIZE)
+!
+         do 11 i = count+1,TEST_SIZE
+            recv_buf(i) = 0.0
+ 11      continue
+!
+         call MPI_Sendrecv_replace(recv_buf, count, MPI_REAL, &
+      &                             next, tag, next, tag, &
+      &                             comm, status, ierr)  
+
+         call msg_check( recv_buf, next, tag, count, status, TEST_SIZE, &
+      &                   'sendrecvreplace', errs )
+
+      else if (prev .eq. 0) then
+
+         call clear_test_data(recv_buf,TEST_SIZE)
+
+         call MPI_Recv(recv_buf, TEST_SIZE, MPI_REAL, &
+      &                 MPI_ANY_SOURCE, MPI_ANY_TAG, comm, &
+      &                 status, ierr)
+
+         call msg_check( recv_buf, prev, tag, count, status, TEST_SIZE, &
+      &                   'recv/send for replace', errs )
+
+         call MPI_Send(recv_buf, count, MPI_REAL, prev, tag, &
+      &                 comm, ierr) 
+      end if
+!
+      end
+!
+!------------------------------------------------------------------------------
+!
+!  Check for correct source, tag, count, and data in test message.
+!
+!------------------------------------------------------------------------------
+      subroutine msg_check( recv_buf, source, tag, count, status, n,  &
+      &                      name, errs )
+      use mpi
+      integer n, errs
+      real    recv_buf(n)
+      integer source, tag, count, rank, status(MPI_STATUS_SIZE)
+      character*(*) name
+      logical foundError
+
+      integer ierr, recv_src, recv_tag, recv_count
+
+      foundError = .false.
+      recv_src = status(MPI_SOURCE)
+      recv_tag = status(MPI_TAG)
+      call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
+      call MPI_Get_count(status, MPI_REAL, recv_count, ierr)
+
+      if (recv_src .ne. source) then
+         print *, '[', rank, '] Unexpected source:', recv_src,  &
+      &            ' in ', name
+         errs       = errs + 1
+         foundError = .true.
+      end if
+
+      if (recv_tag .ne. tag) then
+         print *, '[', rank, '] Unexpected tag:', recv_tag, ' in ', name
+         errs       = errs + 1
+         foundError = .true.
+      end if
+
+      if (recv_count .ne. count) then
+         print *, '[', rank, '] Unexpected count:', recv_count, &
+      &            ' in ', name
+         errs       = errs + 1
+         foundError = .true.
+      end if
+         
+      call verify_test_data(recv_buf, count, n, name, errs )
+
+      end
+!------------------------------------------------------------------------------
+!
+!  Check that requests have been set to null
+!
+!------------------------------------------------------------------------------
+      subroutine rq_check( requests, n, msg )
+      use mpi
+      integer n, requests(n)
+      character*(*) msg
+      integer i
+!
+      do 10 i=1, n
+         if (requests(i) .ne. MPI_REQUEST_NULL) then
+            print *, 'Nonnull request in ', msg
+         endif
+ 10   continue
+!      
+      end
+!------------------------------------------------------------------------------
+!
+!  Initialize test data buffer with integral sequence.
+!
+!------------------------------------------------------------------------------
+      subroutine init_test_data(buf,n)
+      integer n
+      real buf(n)
+      integer i
+
+      do 10 i = 1, n
+         buf(i) = REAL(i)
+ 10    continue
+      end
+
+!------------------------------------------------------------------------------
+!
+!  Clear test data buffer
+!
+!------------------------------------------------------------------------------
+      subroutine clear_test_data(buf, n)
+      integer n
+      real buf(n)
+      integer i
+
+      do 10 i = 1, n
+         buf(i) = 0.
+ 10   continue
+
+      end
+
+!------------------------------------------------------------------------------
+!
+!  Verify test data buffer
+!
+!------------------------------------------------------------------------------
+      subroutine verify_test_data( buf, count, n, name, errs )
+      use mpi
+      integer n, errs
+      real buf(n)
+      character *(*) name
+      integer count, i
+!
+      do 10 i = 1, count
+         if (buf(i) .ne. REAL(i)) then
+            print 100, buf(i), i, count, name
+            errs = errs + 1
+         endif
+ 10   continue
+!
+      do 20 i = count + 1, n
+         if (buf(i) .ne. 0.) then
+            print 100, buf(i), i, n, name
+            errs = errs + 1
+         endif
+ 20   continue
+!      
+100   format('Invalid data', f6.1, ' at ', i4, ' of ', i4, ' in ', a)
+!
+      end
+!
+!    This routine is used to prevent the compiler from deallocating the 
+!    array "a", which may happen in some of the tests (see the text in 
+!    the MPI standard about why this may be a problem in valid Fortran 
+!    codes).  Without this, for example, tests fail with the Cray ftn
+!    compiler.
+!
+      subroutine dummyRef( a, n, ie )
+      integer n, ie
+      real    a(n)
+! This condition will never be true, but the compile won't know that
+      if (ie .eq. -1) then
+          print *, a(n)
+      endif
+      return
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/dummyf90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/dummyf90.f90
new file mode 100644 (file)
index 0000000..4db2b95
--- /dev/null
@@ -0,0 +1,20 @@
+! This file created from test/mpi/f77/pt2pt/dummyf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2010 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+!
+! This file is used to disable certain compiler optimizations that
+! can cause incorrect results with the test in greqf.f.  It provides a 
+! point where extrastate may be modified, limiting the compilers ability
+! to move code around.
+! The include of mpif.h is not needed in the F77 case but in the 
+! F90 case it is, because in that case, extrastate is defined as an
+! integer (kind=MPI_ADDRESS_KIND), and the script that creates the
+! F90 tests from the F77 tests looks for mpif.h
+      subroutine dummyupdate( extrastate )
+      use mpi
+      integer (kind=MPI_ADDRESS_KIND) extrastate
+      extrastate=extrastate
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90.f90
new file mode 100644 (file)
index 0000000..e82027e
--- /dev/null
@@ -0,0 +1,115 @@
+! This file created from test/mpi/f77/pt2pt/greqf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      subroutine query_fn( extrastate, status, ierr )
+      use mpi
+      integer status(MPI_STATUS_SIZE), ierr
+      integer (kind=MPI_ADDRESS_KIND) extrastate
+
+!
+!    set a default status
+      status(MPI_SOURCE) = MPI_UNDEFINED
+      status(MPI_TAG)    = MPI_UNDEFINED
+      call mpi_status_set_cancelled( status, .false., ierr)
+      call mpi_status_set_elements( status, MPI_BYTE, 0, ierr )
+      ierr = MPI_SUCCESS
+      extrastate = extrastate
+      end
+!
+      subroutine free_fn( extrastate, ierr )
+      use mpi
+      integer ierr
+      integer (kind=MPI_ADDRESS_KIND) extrastate
+
+      integer freefncall
+      common /fnccalls/ freefncall
+!
+!   For testing purposes, the following print can be used to check whether
+!   the free_fn is called
+!      print *, 'Free_fn called'
+!
+      extrastate = extrastate - 1
+!   The value returned by the free function is the error code
+!   returned by the wait/test function 
+      ierr = MPI_SUCCESS
+      end
+!
+      subroutine cancel_fn( extrastate, complete, ierr )
+      use mpi
+      integer ierr
+      logical complete
+      integer (kind=MPI_ADDRESS_KIND) extrastate
+
+
+      ierr = MPI_SUCCESS
+      complete=.true.
+      extrastate=extrastate
+      end
+!
+!
+! This is a very simple test of generalized requests.  Normally, the
+! MPI_Grequest_complete function would be called from another routine,
+! often running in a separate thread.  This simple code allows us to
+! check that requests can be created, tested, and waited on in the
+! case where the request is complete before the wait is called.  
+!
+! Note that MPI did *not* define a routine that can be called within
+! test or wait to advance the state of a generalized request.  
+! Most uses of generalized requests will need to use a separate thread.
+!
+       program main
+       use mpi
+       integer errs, ierr
+       logical flag
+       integer status(MPI_STATUS_SIZE)
+       integer request
+       external query_fn, free_fn, cancel_fn
+       integer (kind=MPI_ADDRESS_KIND) extrastate
+
+       integer freefncall
+       common /fnccalls/ freefncall
+
+       errs = 0
+       freefncall = 0
+       
+       call MTest_Init( ierr )
+
+       extrastate = 0
+       call mpi_grequest_start( query_fn, free_fn, cancel_fn,  &
+      &            extrastate, request, ierr )
+       call mpi_test( request, flag, status, ierr )
+       if (flag) then
+          errs = errs + 1
+          print *, 'Generalized request marked as complete'
+       endif
+       
+       call mpi_grequest_complete( request, ierr )
+
+       call MPI_Wait( request, status, ierr )
+
+       extrastate = 1
+       call mpi_grequest_start( query_fn, free_fn, cancel_fn,  &
+      &                          extrastate, request, ierr )
+       call mpi_grequest_complete( request, ierr )
+       call mpi_wait( request, MPI_STATUS_IGNORE, ierr )
+!       
+!      The following routine may prevent an optimizing compiler from 
+!      just remembering that extrastate was set in grequest_start
+       call dummyupdate(extrastate)
+       if (extrastate .ne. 0) then
+          errs = errs + 1
+          if (freefncall .eq. 0) then
+              print *, 'Free routine not called'
+          else 
+              print *, 'Free routine did not update extra_data'
+              print *, 'extrastate = ', extrastate
+          endif
+       endif
+!
+       call MTest_Finalize( errs )
+       call mpi_finalize( ierr )
+       end
+!
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/mprobef90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/mprobef90.f90
new file mode 100644 (file)
index 0000000..0ba759b
--- /dev/null
@@ -0,0 +1,667 @@
+! This file created from test/mpi/f77/pt2pt/mprobef.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2012 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+      use mpi
+      integer idx, ierr, rank, size, count
+      integer sendbuf(8), recvbuf(8)
+      integer s1(MPI_STATUS_SIZE), s2(MPI_STATUS_SIZE)
+      integer msg, errs
+      integer rreq
+      logical found, flag
+
+      ierr = -1
+      errs = 0
+      call mpi_init( ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+          errs = errs + 1
+          print *, ' Unexpected return from MPI_INIT', ierr 
+      endif
+
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+      if (size .lt. 2) then
+          errs = errs + 1
+          print *, ' This test requires at least 2 processes' 
+!         Abort now - do not continue in this case.          
+          call mpi_abort( MPI_COMM_WORLD, 1, ierr )
+      endif
+      if (size .gt. 2) then
+          print *, ' This test is running with ', size, ' processes,'
+          print *, ' only 2 processes are used.' 
+      endif
+
+! Test 0: simple Send and Mprobe+Mrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER, &
+      &                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(0, 5, MPI_COMM_WORLD, msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T0 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T0 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T0 Mprobe().'
+          endif
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T0 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T0 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T0 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T0 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T0 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T0 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T0 Mrecv().'
+          endif
+      endif
+
+! Test 1: simple Send and Mprobe+Imrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER, &
+      &                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(0, 5, MPI_COMM_WORLD, msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T1 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T1 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T1 Mprobe().'
+          endif
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T1 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq is unmodified at T1 Imrecv().'
+          endif 
+          call MPI_Wait(rreq, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T1 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T1 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T1 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T1 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T1 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T1 Imrecv().'
+          endif
+      endif
+
+! Test 2: simple Send and Improbe+Mrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER, &
+      &                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(0, 5, MPI_COMM_WORLD, found, msg, s1, ierr)
+          do while (.not. found)
+              call MPI_Improbe(0, 5, MPI_COMM_WORLD, &
+      &                          found, msg, s1, ierr)
+          enddo
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T2 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T2 Improbe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T2 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T2 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T2 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T2 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T2 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T2 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T2 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T2 Mrecv().'
+          endif
+      endif
+
+! Test 3: simple Send and Improbe+Imrecv.
+      if (rank .eq. 0) then
+          sendbuf(1) = 1735928559
+          sendbuf(2) = 1277009102
+          call MPI_Send(sendbuf, 2, MPI_INTEGER, &
+      &                  1, 5, MPI_COMM_WORLD, ierr)
+      else
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(0, 5, MPI_COMM_WORLD, found, msg, s1, ierr)
+          do while (.not. found)
+              call MPI_Improbe(0, 5, MPI_COMM_WORLD, &
+      &                          found, msg, s1, ierr)
+          enddo
+          if (msg .eq. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg == MPI_MESSAGE_NULL at T3 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != 0 at T3 Improbe().'
+          endif
+          if (s1(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != 5 at T3 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T3 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 2) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 2 MPI_INTEGERs.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq is unmodified at T3 Imrecv().'
+          endif 
+          call MPI_Wait(rreq, s2, ierr)
+          if (recvbuf(1) .ne. 1735928559) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T3 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1277009102) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T3 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. 0) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != 0 at T3 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. 5) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != 5 at T3 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T3 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T3 Imrecv().'
+          endif
+      endif
+
+! Test 4: Mprobe+Mrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &
+      &                     msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T4 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T4 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T4 Mprobe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T4 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+!         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T4 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T4 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T4 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T4 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T4 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T4 Mrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+! Test 5: Mprobe+Imrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          msg = MPI_MESSAGE_NULL
+          call MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &
+      &                     msg, s1, ierr)
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T5 Mprobe().'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T5 Mprobe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T5 Mprobe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T5 Mprobe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq == MPI_REQUEST_NULL at T5 Imrecv().'
+          endif
+          flag = .false.
+          call MPI_Test(rreq, flag, s2, ierr)
+          if (.not. flag) then
+              errs = errs + 1
+              print *, 'flag is false at T5 Imrecv().'
+          endif
+!         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T5 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T5 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T5 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T5 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T5 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T5 Imrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+! Test 6: Improbe+Mrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          found = .false.
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &
+      &                      found, msg, s1, ierr)
+          if (.not. found) then
+              errs = errs + 1
+              print *, 'found is false at T6 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T6 Improbe()'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T6 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T6 Improbe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T6 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Mrecv(recvbuf, count, MPI_INTEGER, msg, s2, ierr)
+!         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T6 Mrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T6 Mrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T6 Mrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T6 Mrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T6 Mrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T6 Mrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+! Test 7: Improbe+Imrecv with MPI_PROC_NULL
+      if (.true.) then
+          do idx = 1, MPI_STATUS_SIZE
+              s1(idx) = 0
+              s2(idx) = 0
+          enddo
+!         the error fields are initialized for modification check.
+          s1(MPI_ERROR) = MPI_ERR_DIMS
+          s2(MPI_ERROR) = MPI_ERR_OTHER
+
+          found = .false.
+          msg = MPI_MESSAGE_NULL
+          call MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &
+      &                      found, msg, s1, ierr)
+          if (.not. found) then
+              errs = errs + 1
+              print *, 'found is false at T7 Improbe().'
+          endif
+          if (s1(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's1(MPI_SOURCE) != MPI_PROC_NULL at T7 Improbe()'
+          endif
+          if (s1(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's1(MPI_TAG) != MPI_ANY_TAG at T7 Improbe().'
+          endif
+          if (s1(MPI_ERROR) .ne. MPI_ERR_DIMS) then
+              errs = errs + 1
+              print *, 's1(MPI_ERROR) != MPI_ERR_DIMS at T7 Improbe().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NO_PROC) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NO_PROC at T7 Improbe().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s1, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'probed buffer does not have 0 MPI_INTEGER.'
+          endif
+
+          rreq = MPI_REQUEST_NULL
+          recvbuf(1) = 19088743
+          recvbuf(2) = 1309737967
+          call MPI_Imrecv(recvbuf, count, MPI_INTEGER, msg, rreq, ierr)
+          if (rreq .eq. MPI_REQUEST_NULL) then
+              errs = errs + 1
+              print *, 'rreq == MPI_REQUEST_NULL at T7 Imrecv().'
+          endif
+          flag = .false.
+          call MPI_Test(rreq, flag, s2, ierr)
+          if (.not. flag) then
+              errs = errs + 1
+              print *, 'flag is false at T7 Imrecv().'
+          endif
+!         recvbuf() should remain unmodified
+          if (recvbuf(1) .ne. 19088743) then
+              errs = errs + 1
+              print *, 'recvbuf(1) is corrupted at T7 Imrecv().'
+          endif
+          if (recvbuf(2) .ne. 1309737967) then
+              errs = errs + 1
+              print *, 'recvbuf(2) is corrupted at T7 Imrecv().'
+          endif
+          if (s2(MPI_SOURCE) .ne. MPI_PROC_NULL) then
+              errs = errs + 1
+              print *, 's2(MPI_SOURCE) != MPI_PROC_NULL at T7 Imrecv().'
+          endif
+          if (s2(MPI_TAG) .ne. MPI_ANY_TAG) then
+              errs = errs + 1
+              print *, 's2(MPI_TAG) != MPI_ANY_TAG at T7 Imrecv().'
+          endif
+          if (s2(MPI_ERROR) .ne. MPI_ERR_OTHER) then
+              errs = errs + 1
+              print *, 's2(MPI_ERROR) != MPI_ERR_OTHER at T7 Imrecv().'
+          endif
+          if (msg .ne. MPI_MESSAGE_NULL) then
+              errs = errs + 1
+              print *, 'msg != MPI_MESSAGE_NULL at T7 Imrecv().'
+          endif
+
+          count = -1
+          call MPI_Get_count(s2, MPI_INTEGER, count, ierr)
+          if (count .ne. 0) then
+              errs = errs + 1
+              print *, 'recv buffer does not have 0 MPI_INTEGER.'
+          endif
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/statusesf90.f90 b/teshsuite/smpi/mpich3-test/f90/pt2pt/statusesf90.f90
new file mode 100644 (file)
index 0000000..9405554
--- /dev/null
@@ -0,0 +1,56 @@
+! This file created from test/mpi/f77/pt2pt/statusesf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+      program main
+!     Test support for MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE
+      use mpi
+      integer nreqs
+      parameter (nreqs = 100)
+      integer reqs(nreqs)
+      integer ierr, rank, i
+      integer errs
+
+      ierr = -1
+      errs = 0
+      call mpi_init( ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_INIT', ierr 
+      endif
+
+      ierr = -1
+      call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_COMM_WORLD', ierr 
+      endif
+      do i=1, nreqs, 2
+         ierr = -1
+         call mpi_isend( MPI_BOTTOM, 0, MPI_BYTE, rank, i, &
+      &        MPI_COMM_WORLD, reqs(i), ierr )
+         if (ierr .ne. MPI_SUCCESS) then
+            errs = errs + 1
+            print *, 'Unexpected return from MPI_ISEND', ierr 
+         endif
+         ierr = -1
+         call mpi_irecv( MPI_BOTTOM, 0, MPI_BYTE, rank, i, &
+      &        MPI_COMM_WORLD, reqs(i+1), ierr )
+         if (ierr .ne. MPI_SUCCESS) then
+            errs = errs + 1
+            print *, 'Unexpected return from MPI_IRECV', ierr 
+         endif
+      enddo
+
+      ierr = -1
+      call mpi_waitall( nreqs, reqs, MPI_STATUSES_IGNORE, ierr )
+      if (ierr .ne. MPI_SUCCESS) then
+         errs = errs + 1
+         print *, 'Unexpected return from MPI_WAITALL', ierr 
+      endif
+
+      call mtest_finalize( errs )
+      call mpi_finalize( ierr )
+      end
diff --git a/teshsuite/smpi/mpich3-test/f90/pt2pt/testlist b/teshsuite/smpi/mpich3-test/f90/pt2pt/testlist
new file mode 100644 (file)
index 0000000..b39a1a0
--- /dev/null
@@ -0,0 +1,5 @@
+# This file generated by f77tof90
+statusesf90 1
+#greqf90 1
+#allpairf90 2
+mprobef90 2 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/f90/testlist b/teshsuite/smpi/mpich3-test/f90/testlist
new file mode 100644 (file)
index 0000000..bfe6f29
--- /dev/null
@@ -0,0 +1,15 @@
+#attr
+coll
+#comm
+#ext
+#info
+init
+#io
+#misc
+pt2pt
+datatype
+#f90types
+#
+#spawn
+#timer
+#topo
diff --git a/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90 b/teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90
new file mode 100644 (file)
index 0000000..8e44792
--- /dev/null
@@ -0,0 +1,125 @@
+! This file created from test/mpi/f77/util/mtestf.f with f77tof90
+! -*- Mode: Fortran; -*- 
+!
+!  (C) 2003 by Argonne National Laboratory.
+!      See COPYRIGHT in top-level directory.
+!
+        subroutine MTest_Init( ierr )
+!       Place the include first so that we can automatically create a
+!       Fortran 90 version that uses the mpi module instead.  If
+!       the module is in a different place, the compiler can complain
+!       about out-of-order statements
+        use mpi
+        integer ierr
+        logical flag
+        logical dbgflag
+        integer wrank
+        common /mtest/ dbgflag, wrank
+
+        call MPI_Initialized( flag, ierr )
+        if (.not. flag) then
+           call MPI_Init( ierr )
+        endif
+
+        dbgflag = .false.
+        call MPI_Comm_rank( MPI_COMM_WORLD, wrank, ierr )
+        end
+!
+        subroutine MTest_Finalize( errs )
+        use mpi
+        integer errs
+        integer rank, toterrs, ierr
+        
+        call MPI_Comm_rank( MPI_COMM_WORLD, rank, ierr )
+
+        call MPI_Allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,  &
+      &        MPI_COMM_WORLD, ierr ) 
+        
+        if (rank .eq. 0) then
+           if (toterrs .gt. 0) then 
+                print *, " Found ", toterrs, " errors"
+           else
+                print *, " No Errors"
+           endif
+        endif
+        end
+
+module array
+        integer, dimension(:), allocatable :: myindex
+end module
+
+!
+! A simple get intracomm for now
+        logical function MTestGetIntracomm( comm, min_size, qsmaller )
+        use array
+        use mpi
+
+        integer ierr
+        integer comm, min_size, size, rank
+        logical qsmaller
+
+        integer status
+        call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+        
+        if(.not. allocated(myindex)) then
+            allocate(myindex(size), STAT=status)
+            call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+            myindex(rank+1)=0
+        endif
+
+        !data myindex /0/
+        
+        
+
+        if (myindex(rank+1) .eq. 0) then
+           comm = MPI_COMM_WORLD
+        else if (myindex(rank+1) .eq. 1) then
+           call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
+        else if (myindex(rank+1) .eq. 2) then
+           call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
+           call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
+           call mpi_comm_split( MPI_COMM_WORLD, 0, size - rank, comm,  &
+      &                                 ierr )
+        else
+           if (min_size .eq. 1 .and. myindex(rank+1) .eq. 3) then
+              comm = MPI_COMM_SELF
+           endif
+        endif
+        myindex(rank+1) = mod( myindex(rank+1), 4 ) + 1
+        MTestGetIntracomm = comm .ne. MPI_COMM_NULL
+        qsmaller=.true.
+        end
+!
+        subroutine MTestFreeComm( comm )
+        use mpi
+        integer comm, ierr
+        if (comm .ne. MPI_COMM_WORLD .and. &
+      &      comm .ne. MPI_COMM_SELF  .and. &
+      &      comm .ne. MPI_COMM_NULL) then
+           call mpi_comm_free( comm, ierr )
+        endif
+        end
+!
+        subroutine MTestPrintError( errcode )
+        use mpi
+        integer errcode
+        integer errclass, slen, ierr
+        character*(MPI_MAX_ERROR_STRING) string
+
+        call MPI_Error_class( errcode, errclass, ierr )
+        call MPI_Error_string( errcode, string, slen, ierr )
+        print *, "Error class ", errclass, "(", string(1:slen), ")"
+        end
+!
+        subroutine MTestPrintErrorMsg( msg, errcode )
+        use mpi
+        character*(*) msg
+        integer errcode
+        integer errclass, slen, ierr
+        character*(MPI_MAX_ERROR_STRING) string
+
+        call MPI_Error_class( errcode, errclass, ierr )
+        call MPI_Error_string( errcode, string, slen, ierr )
+        print *, msg, ": Error class ", errclass, " &
+      &       (", string(1:slen), ")" 
+        end
diff --git a/teshsuite/smpi/mpich3-test/group/CMakeLists.txt b/teshsuite/smpi/mpich3-test/group/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e67ccca
--- /dev/null
@@ -0,0 +1,57 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(groupcreate groupcreate.c ../util/mtest.c)
+  add_executable(groupnullincl groupnullincl.c ../util/mtest.c)
+  add_executable(grouptest2 grouptest2.c ../util/mtest.c)
+  add_executable(grouptest grouptest.c ../util/mtest.c)
+  add_executable(gtranks gtranks.c ../util/mtest.c)
+  add_executable(gtranksperf gtranksperf.c ../util/mtest.c)
+
+  target_link_libraries(groupcreate  simgrid)
+  target_link_libraries(groupnullincl  simgrid)
+  target_link_libraries(grouptest2  simgrid)
+  target_link_libraries(grouptest  simgrid)
+  target_link_libraries(gtranks  simgrid)
+  target_link_libraries(gtranksperf  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/groupcreate.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/groupnullincl.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/grouptest2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/grouptest.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gtranks.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/gtranksperf.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
@@ -1,17 +1,21 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
 #include "mpi.h"
 #include <stdio.h>
 /* stdlib.h Needed for malloc declaration */
 #include <stdlib.h>
-#include "test.h"
 
 int main( int argc, char **argv )
 {
     int i, n, n_goal = 2048, n_all, rc, n_ranks, *ranks, rank, size, len;
+    int group_size;
     MPI_Group *group_array, world_group;
     char msg[MPI_MAX_ERROR_STRING];
 
     MPI_Init( &argc, &argv );
-    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     n = n_goal;
@@ -24,6 +28,7 @@ int main( int argc, char **argv )
     ranks = (int *)malloc( size * sizeof(int) );
     for (i=0; i<size; i++) ranks[i] = i;
 
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
     for (i=0; i<n; i++) {
        rc = MPI_Group_incl( world_group, n_ranks, ranks, group_array + i );
        if (rc) {
@@ -33,6 +38,17 @@ int main( int argc, char **argv )
            n = i + 1;
            break;
        }
+       else {
+           /* Check that the group was created (and that any errors were
+              caught) */
+           rc = MPI_Group_size( group_array[i], &group_size );
+           if (group_size != size) {
+               fprintf( stderr, "Group number %d not correct (size = %d)\n", 
+                        i, size );
+               n = i + 1; 
+               break;
+           }
+       }
        
     }
 
@@ -45,7 +61,8 @@ int main( int argc, char **argv )
            break;
        }
     }
-    
+
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
     MPI_Group_free( &world_group );
 
     MPI_Reduce( &n, &n_all, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD );
@@ -62,6 +79,8 @@ implementation\n" );
        }
     }
 
+    free( group_array );
+
     MPI_Finalize( );
     return 0;
 }
diff --git a/teshsuite/smpi/mpich3-test/group/groupnullincl.c b/teshsuite/smpi/mpich3-test/group/groupnullincl.c
new file mode 100644 (file)
index 0000000..029471b
--- /dev/null
@@ -0,0 +1,72 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rc, result;
+    int ranks[1];
+    MPI_Group group, outgroup;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    while (MTestGetComm( &comm, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       MPI_Comm_group( comm, &group );
+       rc = MPI_Group_incl( group, 0, 0, &outgroup );
+       if (rc) {
+           errs++;
+           MTestPrintError( rc );
+           printf( "Error in creating an empty group with (0,0)\n" );
+           
+           /* Some MPI implementations may reject a null "ranks" pointer */
+           rc = MPI_Group_incl( group, 0, ranks, &outgroup );
+           if (rc) {
+               errs++;
+               MTestPrintError( rc );
+               printf( "Error in creating an empty group with (0,ranks)\n" );
+           }
+       }
+
+       if (outgroup != MPI_GROUP_EMPTY) {
+           /* Is the group equivalent to group empty? */
+           rc = MPI_Group_compare( outgroup, MPI_GROUP_EMPTY, &result );
+           if (result != MPI_IDENT) {
+               errs++;
+               MTestPrintError( rc );
+               printf( "Did not create a group equivalent to an empty group\n" );
+           }
+       }
+       rc = MPI_Group_free( &group );
+       if (rc) {
+           errs++;
+           MTestPrintError( rc );
+       }           
+       if (outgroup != MPI_GROUP_NULL) {
+           rc = MPI_Group_free( &outgroup );
+           if (rc) {
+               errs++;
+               MTestPrintError( rc );
+           }
+       }
+
+       MTestFreeComm( &comm );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/group/grouptest.c b/teshsuite/smpi/mpich3-test/group/grouptest.c
new file mode 100644 (file)
index 0000000..e0e2d93
--- /dev/null
@@ -0,0 +1,177 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main( int argc, char *argv[] )
+{
+    MPI_Group g1, g2, g4, g5, g45, selfgroup, g6;
+    int ranks[16], size, rank, myrank, range[1][3];
+    int errs = 0;
+    int i, rin[16], rout[16], result;
+
+    MPI_Init(&argc,&argv);
+
+       MPI_Comm_group( MPI_COMM_WORLD, &g1 );
+       MPI_Comm_rank( MPI_COMM_WORLD, &myrank );
+       MPI_Comm_size( MPI_COMM_WORLD, &size );
+       if (size < 8) {
+           fprintf( stderr, 
+                 "Test requires 8 processes (16 prefered) only %d provided\n",
+                    size );
+           errs++;
+       }
+
+       /* 16 members, this process is rank 0, return in group 1 */
+       ranks[0] = myrank; ranks[1] = 2; ranks[2] = 7;
+       if (myrank == 2) ranks[1] = 3;
+       if (myrank == 7) ranks[2] = 6;
+       MPI_Group_incl( g1, 3, ranks, &g2 );
+       
+       /* Check the resulting group */
+       MPI_Group_size( g2, &size );
+       MPI_Group_rank( g2, &rank );
+       
+       if (size != 3) {
+           fprintf( stderr, "Size should be %d, is %d\n", 3, size );
+           errs++;
+       }
+       if (rank != 0) {
+           fprintf( stderr, "Rank should be %d, is %d\n", 0, rank );
+           errs++;
+       }
+
+       rin[0] = 0; rin[1] = 1; rin[2] = 2;
+       MPI_Group_translate_ranks( g2, 3, rin, g1, rout );
+       for (i=0; i<3; i++) {
+           if (rout[i] != ranks[i]) {
+               fprintf( stderr, "translated rank[%d] %d should be %d\n", 
+                        i, rout[i], ranks[i] );
+               errs++;
+           }
+       }
+       
+       /* Translate the process of the self group against another group */
+       MPI_Comm_group( MPI_COMM_SELF, &selfgroup );
+       rin[0] = 0;
+       MPI_Group_translate_ranks( selfgroup, 1, rin, g1, rout );
+       if (rout[0] != myrank) {
+           fprintf( stderr, "translated of self is %d should be %d\n", 
+                        rout[0], myrank );
+           errs++;
+       }
+
+       for (i=0; i<size; i++) 
+           rin[i] = i;
+       MPI_Group_translate_ranks( g1, size, rin, selfgroup, rout );
+       for (i=0; i<size; i++) {
+           if (i == myrank && rout[i] != 0) {
+               fprintf( stderr, "translated world to self of %d is %d\n",
+                        i, rout[i] );
+               errs++;
+           }
+           else if (i != myrank && rout[i] != MPI_UNDEFINED) {
+               fprintf( stderr, "translated world to self of %d should be undefined, is %d\n",
+                        i, rout[i] );
+               errs++;
+           }
+       }
+       MPI_Group_free( &selfgroup );
+
+       /* Exclude everyone in our group */
+       {
+           int ii, *lranks, g1size;
+
+           MPI_Group_size( g1, &g1size );
+           
+           lranks = (int *)malloc( g1size * sizeof(int) );
+           for (ii=0; ii<g1size; ii++) lranks[ii] = ii;
+           MPI_Group_excl( g1, g1size, lranks, &g6 );
+           if (g6 != MPI_GROUP_EMPTY) {
+               fprintf( stderr, "Group formed by excluding all ranks not empty\n" );
+               errs++;
+               MPI_Group_free( &g6 );
+           }
+           free( lranks );
+       }
+       
+       /* Add tests for additional group operations */
+       /* 
+          g2 = incl 1,3,7
+          g3 = excl 1,3,7
+          intersect ( w, g2 ) => g2
+          intersect ( w, g3 ) => g3
+          intersect ( g2, g3 ) => empty
+          
+          g4 = rincl 1:n-1:2
+          g5 = rexcl 1:n-1:2
+          union( g4, g5 ) => world
+          g6 = rincl n-1:1:-1 
+          g7 = rexcl n-1:1:-1
+          union( g6, g7 ) => concat of entries, similar to world
+          diff( w, g2 ) => g3
+       */
+       MPI_Group_free( &g2 );
+
+       range[0][0] = 1;
+       range[0][1] = size-1;
+       range[0][2] = 2;
+       MPI_Group_range_excl( g1, 1, range, &g5 );
+
+       range[0][0] = 1;
+       range[0][1] = size-1;
+       range[0][2] = 2;
+       MPI_Group_range_incl( g1, 1, range, &g4 );
+       MPI_Group_union( g4, g5, &g45 );
+       MPI_Group_compare( MPI_GROUP_EMPTY, g4, &result );
+       if (result != MPI_UNEQUAL) {
+           errs++;
+           fprintf( stderr, "Comparison with empty group gave %d, not 3\n",
+                    result );
+       }
+       MPI_Group_free( &g4 );
+       MPI_Group_free( &g5 );
+       MPI_Group_free( &g45 );
+
+       /* Now, duplicate the test, but using negative strides */
+       range[0][0] = size-1;
+       range[0][1] = 1;
+       range[0][2] = -2;
+       MPI_Group_range_excl( g1, 1, range, &g5 );
+
+       range[0][0] = size-1;
+       range[0][1] = 1;
+       range[0][2] = -2;
+       MPI_Group_range_incl( g1, 1, range, &g4 );
+
+       MPI_Group_union( g4, g5, &g45 );
+
+       MPI_Group_compare( MPI_GROUP_EMPTY, g4, &result );
+       if (result != MPI_UNEQUAL) {
+           errs++;
+           fprintf( stderr, "Comparison with empty group (formed with negative strides) gave %d, not 3\n",
+                    result );
+       }
+       MPI_Group_free( &g4 );
+       MPI_Group_free( &g5 );
+       MPI_Group_free( &g45 );
+        MPI_Group_free( &g1 );
+
+    if (myrank == 0) 
+    {
+       if (errs == 0) {
+           printf( " No Errors\n" );
+       }
+       else {
+           printf( "Found %d errors\n", errs );
+       }
+    }
+
+    MPI_Finalize();
+    return 0;
+}
@@ -1,3 +1,10 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
 /*
    Test the group routines
    (some tested elsewere)
@@ -10,25 +17,23 @@ MPI_Group_rank
 MPI_Group_size
 MPI_Group_translate_ranks
 MPI_Group_union
-MPI_Group_range_incl
-MPI_Group_incl
 
  */
 #include "mpi.h"
 #include <stdio.h>
 /* stdlib.h Needed for malloc declaration */
 #include <stdlib.h>
-#include "test.h"
 
 int main( int argc, char **argv )
 {
     int errs=0, toterr;
     MPI_Group basegroup;
-    MPI_Group g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11, g12;
+    MPI_Group g1, g2, g3, g4, g5, g6, g7, g8, g9, g10;
+    MPI_Group g3a, g3b;
     MPI_Comm  comm, newcomm, splitcomm, dupcomm;
     int       i, grp_rank, rank, grp_size, size, result;
     int       nranks, *ranks, *ranks_out;
-    int       range[2][3];
+    int       range[1][3];
     int       worldrank;
 
     MPI_Init( &argc, &argv );
@@ -37,17 +42,17 @@ int main( int argc, char **argv )
     comm = MPI_COMM_WORLD;
 
     MPI_Comm_group( comm, &basegroup );
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
 
 /* Get the basic information on this group */
     MPI_Group_rank( basegroup, &grp_rank );
-    MPI_Comm_rank( comm, &rank );
     if (grp_rank != rank) {
        errs++;
        fprintf( stdout, "group rank %d != comm rank %d\n", grp_rank, rank );
     }
 
     MPI_Group_size( basegroup, &grp_size );
-    MPI_Comm_size( comm, &size );
     if (grp_size != size) {
        errs++;
        fprintf( stdout, "group size %d != comm size %d\n", grp_size, size );
@@ -93,93 +98,97 @@ int main( int argc, char **argv )
        fprintf( stdout, "Group compare should have been unequal, was %d\n",
                 result );
     }
-MPI_Barrier(MPI_COMM_WORLD);
+
+    /* Build two groups that have this process and one other, but do not
+       have the same processes */
+    ranks[0] = rank;
+    ranks[1] = (rank + 1) % size;
+    MPI_Group_incl( basegroup, 2, ranks, &g3a );
+    ranks[1] = (rank + size - 1) % size;
+    MPI_Group_incl( basegroup, 2, ranks, &g3b );
+    MPI_Group_compare( g3a, g3b, &result );
+    if (result != MPI_UNEQUAL) {
+        errs++;
+       fprintf( stdout, "Group compare of equal sized but different groups should have been unequal, was %d\n", result );
+    }
+    
+
 /* Build two new groups by excluding members; use Union to put them
    together again */
 
 /* Exclude 0 */
+    for (i=0; i<size; i++) ranks[i] = i;
     MPI_Group_excl( basegroup, 1, ranks, &g4 );
 /* Exclude 1-(size-1) */
     MPI_Group_excl( basegroup, size-1, ranks+1, &g5 );
     MPI_Group_union( g5, g4, &g6 );
     MPI_Group_compare( basegroup, g6, &result );
     if (result != MPI_IDENT) {
+       int usize;
        errs++;
        /* See ordering requirements on union */
        fprintf( stdout, "Group excl and union did not give ident groups\n" );
+       fprintf( stdout, "[%d] result of compare was %d\n", rank, result );
+       MPI_Group_size( g6, &usize );
+       fprintf( stdout, "Size of union is %d, should be %d\n", usize, size );
     }
     MPI_Group_union( basegroup, g4, &g7 );
     MPI_Group_compare( basegroup, g7, &result );
     if (result != MPI_IDENT) {
+       int usize;
        errs++;
        fprintf( stdout, "Group union of overlapping groups failed\n" );
+       fprintf( stdout, "[%d] result of compare was %d\n", rank, result );
+       MPI_Group_size( g7, &usize );
+       fprintf( stdout, "Size of union is %d, should be %d\n", usize, size );
     }
 
 /* Use range_excl instead of ranks */
+    /* printf ("range excl\n" ); fflush( stdout ); */
     range[0][0] = 1;
     range[0][1] = size-1;
     range[0][2] = 1;
     MPI_Group_range_excl( basegroup, 1, range, &g8 );
+    /* printf( "out  of range excl\n" ); fflush( stdout ); */
     MPI_Group_compare( g5, g8, &result );
+    /* printf( "out of compare\n" ); fflush( stdout ); */
     if (result != MPI_IDENT) {
        errs++;
        fprintf( stdout, "Group range excl did not give ident groups\n" );
     }
 
-    MPI_Group_intersection(g4, basegroup, &g9 );
+    /* printf( "intersection\n" ); fflush( stdout ); */
+    MPI_Group_intersection( basegroup, g4, &g9 );
     MPI_Group_compare( g9, g4, &result );
     if (result != MPI_IDENT) {
        errs++;
        fprintf( stdout, "Group intersection did not give ident groups\n" );
     }
-    
-    MPI_Group_intersection(basegroup, g4 , &g9 );
-    MPI_Group_compare( g9, g4, &result );
-    if (result != MPI_IDENT) {
-       errs++;
-       fprintf( stdout, "Group intersection 2 did not give ident groups\n" );
-    }
-    
-        MPI_Group_intersection(basegroup, basegroup, &g9 );
-    MPI_Group_compare( g9, basegroup, &result );
-    if (result != MPI_IDENT) {
-       errs++;
-       fprintf( stdout, "Group intersection 3 did not give ident groups\n" );
-    }
 
 /* Exclude EVERYTHING and check against MPI_GROUP_EMPTY */
+    /* printf( "range excl all\n" ); fflush( stdout ); */
     range[0][0] = 0;
     range[0][1] = size-1;
     range[0][2] = 1;
     MPI_Group_range_excl( basegroup, 1, range, &g10 );
+
+    /* printf( "done range excl all\n" ); fflush(stdout); */
     MPI_Group_compare( g10, MPI_GROUP_EMPTY, &result );
+    /* printf( "done compare to MPI_GROUP_EMPTY\n" ); fflush(stdout); */
+
     if (result != MPI_IDENT) {
        errs++;
        fprintf( stdout, 
                 "MPI_GROUP_EMPTY didn't compare against empty group\n");
     }
 
-/* Grouptest usually runs with 4 processes.  Pick a range that specifies
-   1, size-1, but where "last" is size.  This checks for an 
-   error case that MPICH2 got wrong */
-    range[0][0] = 1;
-    range[0][1] = size ;
-    range[0][2] = size - 2;
-    MPI_Group_range_incl( basegroup, 1, range, &g11 );
-    ranks[0] = 1;
-    ranks[1] = size-1;
-    MPI_Group_incl( basegroup, 2, ranks, &g12 );
-    MPI_Group_compare( g11, g12, &result );
-    if (result != MPI_IDENT) {
-       errs++;
-       fprintf( stderr, 
-                "MPI_Group_range_incl didn't compare against MPI_Group_incl\n" );
-    }
-
+    /* printf( "freeing groups\n" ); fflush( stdout ); */
     MPI_Group_free( &basegroup );
     MPI_Group_free( &g1 );
     MPI_Group_free( &g2 );
     MPI_Group_free( &g3 );
+    MPI_Group_free( &g3a );
+    MPI_Group_free( &g3b );
     MPI_Group_free( &g4 );
     MPI_Group_free( &g5 );
     MPI_Group_free( &g6 );
@@ -187,8 +196,6 @@ MPI_Barrier(MPI_COMM_WORLD);
     MPI_Group_free( &g8 );
     MPI_Group_free( &g9 );
     MPI_Group_free( &g10 );
-    MPI_Group_free( &g11 );
-    MPI_Group_free( &g12 );
     MPI_Comm_free( &dupcomm );
     MPI_Comm_free( &splitcomm );
     MPI_Comm_free( &newcomm );
diff --git a/teshsuite/smpi/mpich3-test/group/gtranks.c b/teshsuite/smpi/mpich3-test/group/gtranks.c
new file mode 100644 (file)
index 0000000..e5f032f
--- /dev/null
@@ -0,0 +1,168 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+#define MAX_WORLD_SIZE 1024
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int ranks[MAX_WORLD_SIZE], ranksout[MAX_WORLD_SIZE], 
+       ranksin[MAX_WORLD_SIZE];
+    int range[1][3];
+    MPI_Group gworld, gself, ngroup, galt;
+    MPI_Comm  comm;
+    int rank, size, i, nelms;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_group( MPI_COMM_SELF, &gself );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+    if (size > MAX_WORLD_SIZE) {
+       fprintf( stderr, 
+        "This test requires a comm world with no more than %d processes\n", 
+                MAX_WORLD_SIZE );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    if (size < 4) {
+       fprintf( stderr, "This test requiers at least 4 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    MPI_Comm_group( comm, &gworld );
+    for (i=0; i<size; i++) {
+       ranks[i] = i;
+       ranksout[i] = -1;
+    }
+    /* Try translating ranks from comm world compared against
+       comm self, so most will be UNDEFINED */
+    MPI_Group_translate_ranks( gworld, size, ranks, gself, ranksout );
+    
+    for (i=0; i<size; i++) {
+       if (i == rank) {
+           if (ranksout[i] != 0) {
+               printf( "[%d] Rank %d is %d but should be 0\n", rank, 
+                       i, ranksout[i] );
+               errs++;
+           }
+       }
+       else {
+           if (ranksout[i] != MPI_UNDEFINED) {
+               printf( "[%d] Rank %d is %d but should be undefined\n", rank, 
+                       i, ranksout[i] );
+               errs++;
+           }
+       }
+    }
+
+    /* MPI-2 Errata requires that MPI_PROC_NULL is mapped to MPI_PROC_NULL */
+    ranks[0] = MPI_PROC_NULL;
+    ranks[1] = 1;
+    ranks[2] = rank;
+    ranks[3] = MPI_PROC_NULL;
+    for (i=0; i<4; i++) ranksout[i] = -1;
+
+    MPI_Group_translate_ranks( gworld, 4, ranks, gself, ranksout );
+    if (ranksout[0] != MPI_PROC_NULL) {
+       printf( "[%d] Rank[0] should be MPI_PROC_NULL but is %d\n",
+               rank, ranksout[0] );
+       errs++;
+    }
+    if (rank != 1 && ranksout[1] != MPI_UNDEFINED) {
+       printf( "[%d] Rank[1] should be MPI_UNDEFINED but is %d\n",
+               rank, ranksout[1] );
+       errs++;
+    }
+    if (rank == 1 && ranksout[1] != 0) {
+       printf( "[%d] Rank[1] should be 0 but is %d\n",
+               rank, ranksout[1] );
+       errs++;
+    }
+    if (ranksout[2] != 0) {
+       printf( "[%d] Rank[2] should be 0 but is %d\n",
+               rank, ranksout[2] );
+       errs++;
+    }
+    if (ranksout[3] != MPI_PROC_NULL) {
+       printf( "[%d] Rank[3] should be MPI_PROC_NULL but is %d\n",
+               rank, ranksout[3] );
+       errs++;
+    }
+
+    MPI_Group_free(&gself);
+
+    /* Now, try comparing small groups against larger groups, and use groups
+       with irregular members (to bypass optimizations in group_translate_ranks
+       for simple groups)
+     */
+    nelms = 0;
+    ranks[nelms++] = size - 2;
+    ranks[nelms++] = 0;
+    if (rank != 0 && rank != size - 2) {
+       ranks[nelms++] = rank; 
+    }
+
+    MPI_Group_incl( gworld, nelms, ranks, &ngroup );
+
+    for (i=0; i<nelms; i++) ranksout[i] = -1;
+    ranksin[0] = 1;
+    ranksin[1] = 0;
+    ranksin[2] = MPI_PROC_NULL;
+    ranksin[3] = 2;
+    MPI_Group_translate_ranks( ngroup, nelms+1, ranksin, gworld, ranksout );
+    for (i=0; i<nelms+1; i++) {
+       if (ranksin[i] == MPI_PROC_NULL) {
+           if (ranksout[i] != MPI_PROC_NULL) {
+               fprintf( stderr, "Input rank for proc_null but output was %d\n",
+                        ranksout[i] );
+               errs++;
+           }
+       }
+       else if (ranksout[i] != ranks[ranksin[i]]) {
+           fprintf( stderr, "Expected ranksout[%d] = %d but found %d\n",
+                    i, ranks[ranksin[i]], ranksout[i] );
+           errs++;
+       }
+    }
+    
+    range[0][0] = size -1 ;
+    range[0][1] = 0;
+    range[0][2] = -1;
+    MPI_Group_range_incl( gworld, 1, range, &galt);
+    for (i=0; i<nelms+1; i++) ranksout[i] = -1;
+    MPI_Group_translate_ranks( ngroup, nelms+1, ranksin, galt, ranksout );
+    for (i=0; i<nelms+1; i++) {
+       if (ranksin[i] == MPI_PROC_NULL) {
+           if (ranksout[i] != MPI_PROC_NULL) {
+               fprintf( stderr, "Input rank for proc_null but output was %d\n",
+                        ranksout[i] );
+               errs++;
+           }
+       }
+       else if (ranksout[i] != (size-1)-ranks[ranksin[i]]) {
+           fprintf( stderr, "Expected ranksout[%d] = %d but found %d\n",
+                    i, (size-1)-ranks[ranksin[i]], ranksout[i] );
+           errs++;
+       }
+    }
+    
+    
+    MPI_Group_free(&gworld);
+    MPI_Group_free(&galt);
+    MPI_Group_free(&ngroup);
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/group/gtranksperf.c b/teshsuite/smpi/mpich3-test/group/gtranksperf.c
new file mode 100644 (file)
index 0000000..98b79d2
--- /dev/null
@@ -0,0 +1,135 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+#include <math.h> /* for fabs(3) */
+
+/* Measure and compare the relative performance of MPI_Group_translate_ranks
+ * with small and large group2 sizes but a constant number of ranks.  This
+ * serves as a performance sanity check for the Scalasca use case where we
+ * translate to MPI_COMM_WORLD ranks.  The performance should only depend on the
+ * number of ranks passed, not the size of either group (especially group2).
+ *
+ * This test is probably only meaningful for large-ish process counts, so we may
+ * not be able to run this test by default in the nightlies. */
+
+/* number of iterations used for timing */
+#define NUM_LOOPS (1000000)
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int *ranks;
+    int *ranksout;
+    MPI_Group gworld, grev, gself;
+    MPI_Comm  comm;
+    MPI_Comm  commrev;
+    int rank, size, i;
+    double start, end, time1, time2;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+    ranks    = malloc(size*sizeof(int));
+    ranksout = malloc(size*sizeof(int));
+    if (!ranks || !ranksout) {
+        fprintf(stderr, "out of memory\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+    /* generate a comm with the rank order reversed */
+    MPI_Comm_split(comm, 0, (size-rank-1), &commrev);
+    MPI_Comm_group(commrev, &grev);
+    MPI_Comm_group(MPI_COMM_SELF, &gself);
+    MPI_Comm_group(comm, &gworld);
+
+    /* sanity check correctness first */
+    for (i=0; i < size; i++) {
+        ranks[i] = i;
+        ranksout[i] = -1;
+    }
+    MPI_Group_translate_ranks(grev, size, ranks, gworld, ranksout);
+    for (i=0; i < size; i++) {
+        if (ranksout[i] != (size-i-1)) {
+            if (rank == 0)
+                printf("%d: (gworld) expected ranksout[%d]=%d, got %d\n", rank, i, (size-rank-1), ranksout[i]);
+            ++errs;
+        }
+    }
+    MPI_Group_translate_ranks(grev, size, ranks, gself, ranksout);
+    for (i=0; i < size; i++) {
+        int expected = (i == (size-rank-1) ? 0 : MPI_UNDEFINED);
+        if (ranksout[i] != expected) {
+            if (rank == 0)
+                printf("%d: (gself) expected ranksout[%d]=%d, got %d\n", rank, i, expected, ranksout[i]);
+            ++errs;
+        }
+    }
+
+    /* now compare relative performance */
+
+    /* we needs lots of procs to get a group large enough to have meaningful
+     * numbers.  On most testing machines this means that we're oversubscribing
+     * cores in a big way, which might perturb the timing results.  So we make
+     * sure everyone started up and then everyone but rank 0 goes to sleep to
+     * let rank 0 do all the timings. */
+    MPI_Barrier(comm);
+
+    if (rank != 0) {
+        MTestSleep(10);
+    }
+    else /* rank==0 */ {
+        MTestSleep(1); /* try to avoid timing while everyone else is making syscalls */
+
+        MPI_Group_translate_ranks(grev, size, ranks, gworld, ranksout); /*throwaway iter*/
+        start = MPI_Wtime();
+        for (i = 0; i < NUM_LOOPS; ++i) {
+            MPI_Group_translate_ranks(grev, size, ranks, gworld, ranksout);
+        }
+        end = MPI_Wtime();
+        time1 = end - start;
+
+        MPI_Group_translate_ranks(grev, size, ranks, gself, ranksout); /*throwaway iter*/
+        start = MPI_Wtime();
+        for (i = 0; i < NUM_LOOPS; ++i) {
+            MPI_Group_translate_ranks(grev, size, ranks, gself, ranksout);
+        }
+        end = MPI_Wtime();
+        time2 = end - start;
+
+        /* complain if the "gworld" time exceeds 2x the "gself" time */
+        if (fabs(time1 - time2) > (2.00 * time2)) {
+            printf("too much difference in MPI_Group_translate_ranks performance:\n");
+            printf("time1=%f time2=%f\n", time1, time2);
+            printf("(fabs(time1-time2)/time2)=%f\n", (fabs(time1-time2)/time2));
+            if (time1 < time2) {
+                printf("also, (time1<time2) is surprising...\n");
+            }
+            ++errs;
+        }
+    }
+
+    free(ranks);
+    free(ranksout);
+
+    MPI_Group_free(&grev);
+    MPI_Group_free(&gself);
+    MPI_Group_free(&gworld);
+
+    MPI_Comm_free(&commrev);
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/group/testlist b/teshsuite/smpi/mpich3-test/group/testlist
new file mode 100644 (file)
index 0000000..86b05c3
--- /dev/null
@@ -0,0 +1,9 @@
+groupcreate 4
+grouptest 8
+grouptest2 4
+#needs MPI_Intercomm_create
+#groupnullincl 4
+gtranks 8
+# this may be too many processes for some systems, but the test needs a 
+# large-ish number of processes to yield an effective performance check
+#gtranksperf 20
diff --git a/teshsuite/smpi/mpich3-test/hostfile b/teshsuite/smpi/mpich3-test/hostfile
new file mode 100644 (file)
index 0000000..016949f
--- /dev/null
@@ -0,0 +1,30 @@
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
+Tremblay
+Jupiter
+Fafard
+Ginette
+Bourassa
diff --git a/teshsuite/smpi/mpich3-test/include/mpitest.h b/teshsuite/smpi/mpich3-test/include/mpitest.h
new file mode 100644 (file)
index 0000000..056e333
--- /dev/null
@@ -0,0 +1,103 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#ifndef MPITEST_H_INCLUDED
+#define MPITEST_H_INCLUDED
+
+#include "mpitestconf.h"
+
+/*
+ * Init and finalize test 
+ */
+void MTest_Init( int *, char *** );
+void MTest_Init_thread( int *, char ***, int, int * );
+void MTest_Finalize( int );
+void MTestPrintError( int );
+void MTestPrintErrorMsg( const char [], int );
+void MTestPrintfMsg( int, const char [], ... );
+void MTestError( const char [] );
+int MTestReturnValue( int );
+
+/*
+ * Utilities
+ */
+void MTestSleep( int );
+
+/*
+ * This structure contains the information used to test datatypes
+ * buf is set to null when an MTestDatatype is created; the
+ * InitBuf routine will allocate (if necessary) and initialize
+ * the data.  InitBuf may be called multiple times (this is particularly
+ * important for recv bufs), in which case the buffer will only 
+ * be allocated if it has not already been created.
+ */
+typedef struct _MTestDatatype {
+    MPI_Datatype datatype;
+    void *buf;              /* buffer to use in communication */
+    int  count;             /* count to use for this datatype */
+    int  isBasic;           /* true if the type is predefined */
+    int  printErrors;       /* true if errors should be printed
+                              (used by the CheckBuf routines) */
+    /* The following is optional data that is used by some of
+       the derived datatypes */
+    int  stride, nelm, blksize, *index;
+    /* stride, nelm, and blksize are in bytes */
+    int *displs, basesize;
+    /* displacements are in multiples of base type; basesize is the
+       size of that type*/
+    void *(*InitBuf)( struct _MTestDatatype * );
+    void *(*FreeBuf)( struct _MTestDatatype * );
+    int   (*CheckBuf)( struct _MTestDatatype * );
+} MTestDatatype;
+
+int MTestCheckRecv( MPI_Status *, MTestDatatype * );
+int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, int );
+void MTestResetDatatypes( void );
+void MTestFreeDatatype( MTestDatatype * );
+const char *MTestGetDatatypeName( MTestDatatype * );
+int MTestGetDatatypeIndex( void );
+
+int MTestGetIntracomm( MPI_Comm *, int );
+int MTestGetIntracommGeneral( MPI_Comm *, int, int );
+int MTestGetIntercomm( MPI_Comm *, int *, int );
+int MTestGetComm( MPI_Comm *, int );
+const char *MTestGetIntracommName( void );
+const char *MTestGetIntercommName( void );
+void MTestFreeComm( MPI_Comm * );
+
+#ifdef HAVE_MPI_WIN_CREATE
+int MTestGetWin( MPI_Win *, int );
+const char *MTestGetWinName( void );
+void MTestFreeWin( MPI_Win * );
+#endif
+
+/* These macros permit overrides via:
+ *     make CPPFLAGS='-DMTEST_MPI_VERSION=X -DMTEST_MPI_SUBVERSION=Y'
+ * where X and Y are the major and minor versions of the MPI standard that is
+ * being tested.  The override should work similarly if added to the CPPFLAGS at
+ * configure time. */
+#ifndef MTEST_MPI_VERSION
+#define MTEST_MPI_VERSION MPI_VERSION
+#endif
+#ifndef MTEST_MPI_SUBVERSION
+#define MTEST_MPI_SUBVERSION MPI_SUBVERSION
+#endif
+
+/* Makes it easier to conditionally compile test code for a particular minimum
+ * version of the MPI Standard.  Right now there is only a MIN flavor but it
+ * would be easy to add MAX or EXACT flavors if they become necessary at some
+ * point.  Example usage:
+ ------8<-------
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+... test for some feature that is only available in MPI-2.2 or later ...
+#endif
+ ------8<-------
+ */
+#define MTEST_HAVE_MIN_MPI_VERSION(major_,minor_) \
+    ((MTEST_MPI_VERSION == (major_) && MTEST_MPI_SUBVERSION >= (minor_)) ||   \
+    (MTEST_MPI_VERSION > (major_)))
+
+#endif
diff --git a/teshsuite/smpi/mpich3-test/include/mpitestconf.h b/teshsuite/smpi/mpich3-test/include/mpitestconf.h
new file mode 100644 (file)
index 0000000..4eb4bb2
--- /dev/null
@@ -0,0 +1,287 @@
+/* include/mpitestconf.h.  Generated from mpitestconf.h.in by configure.  */
+/* include/mpitestconf.h.in.  Generated from configure.ac by autoheader.  */
+
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*  
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#ifndef MPITESTCONF_H_INCLUDED
+#define MPITESTCONF_H_INCLUDED
+
+
+/* Fortran names are lowercase with no trailing underscore */
+/* #undef F77_NAME_LOWER */
+
+/* Fortran names are lowercase with two trailing underscores */
+#define F77_NAME_LOWER_2USCORE 1
+
+/* Fortran names are lowercase with two trailing underscores in stdcall */
+/* #undef F77_NAME_LOWER_2USCORE_STDCALL */
+
+/* Fortran names are lowercase with no trailing underscore in stdcall */
+/* #undef F77_NAME_LOWER_STDCALL */
+
+/* Fortran names are lowercase with one trailing underscore */
+/* #undef F77_NAME_LOWER_USCORE */
+
+/* Fortran names are lowercase with one trailing underscore in stdcall */
+/* #undef F77_NAME_LOWER_USCORE_STDCALL */
+
+/* Fortran names preserve the original case */
+/* #undef F77_NAME_MIXED */
+
+/* Fortran names preserve the original case in stdcall */
+/* #undef F77_NAME_MIXED_STDCALL */
+
+/* Fortran names preserve the original case with one trailing underscore */
+/* #undef F77_NAME_MIXED_USCORE */
+
+/* Fortran names preserve the original case with one trailing underscore in
+   stdcall */
+/* #undef F77_NAME_MIXED_USCORE_STDCALL */
+
+/* Fortran names are uppercase */
+/* #undef F77_NAME_UPPER */
+
+/* Fortran names are uppercase in stdcall */
+/* #undef F77_NAME_UPPER_STDCALL */
+
+/* Define to 1 if the system has the type `double _Complex'. */
+#define HAVE_DOUBLE__COMPLEX 1
+
+/* Define to 1 if the system has the type `float _Complex'. */
+#define HAVE_FLOAT__COMPLEX 1
+
+/* Define if Fortran is supported */
+//#define HAVE_FORTRAN_BINDING 0
+
+/* Define to 1 if you have the `getrusage' function. */
+#ifndef WIN32
+#define HAVE_GETRUSAGE 1
+#endif
+/* Define if struct hostent contains h_addr_list */
+#define HAVE_H_ADDR_LIST 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if iostream is available */
+#define HAVE_IOSTREAM 1
+
+/* Define to 1 if you have the <iostream.h> header file. */
+/* #undef HAVE_IOSTREAM_H */
+
+/* Define if long double is supported */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define to 1 if the system has the type `long double _Complex'. */
+#define HAVE_LONG_DOUBLE__COMPLEX 1
+
+/* Define if compiler supports long long */
+#define HAVE_LONG_LONG 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if MPI_2COMPLEX is available */
+/* #undef HAVE_MPI_2COMPLEX */
+
+/* Define if MPI_2DOUBLE_COMPLEX is available */
+/* #undef HAVE_MPI_2DOUBLE_COMPLEX */
+
+/* Define to 1 if you have the `MPI_Init_thread' function. */
+/* #undef HAVE_MPI_INIT_THREAD */
+
+/* Define if MPI_INTEGER16 is available */
+/* #undef HAVE_MPI_INTEGER16 */
+
+/* Define if MPI-IO (really ROMIO) is included */
+//#define HAVE_MPI_IO 1
+
+/* Define if Dynamic Process functionality is available */
+#define HAVE_MPI_SPAWN 1
+
+/* Define if MPI_Win_create is available */
+//#define HAVE_MPI_WIN_CREATE 1
+
+/* define if the compiler implements namespaces */
+#define HAVE_NAMESPACES /**/
+
+/* define if the compiler implements namespace std */
+#define HAVE_NAMESPACE_STD /**/
+
+/* Define to 1 if you have the `pthread_barrier_init' function. */
+/* #undef HAVE_PTHREAD_BARRIER_INIT */
+
+/* Define to 1 if you have the `pthread_barrier_wait' function. */
+/* #undef HAVE_PTHREAD_BARRIER_WAIT */
+
+/* Define to 1 if you have the `pthread_create' function. */
+/* #undef HAVE_PTHREAD_CREATE */
+
+/* Define to 1 if you have the <pthread.h> header file. */
+/* #undef HAVE_PTHREAD_H */
+
+/* Define to 1 if you have the `pthread_yield' function. */
+/* #undef HAVE_PTHREAD_YIELD */
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#ifndef WIN32
+#define HAVE_SYS_RESOURCE_H 1
+#endif
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type `_Bool'. */
+#define HAVE__BOOL 1
+
+/* Define if MPI IO uses MPI_Request */
+#define MPIO_USES_MPI_REQUEST /**/
+
+/* Name of package */
+#define PACKAGE "mpich-testsuite"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "mpich-testsuite"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "mpich-testsuite 1.2"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "mpich-testsuite"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.2"
+
+/* POINTERINT_t is a pointer-sized integer */
+#define POINTERINT_t int
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 
+
+/* The size of `long', as computed by sizeof. */
+#define SIZEOF_LONG 
+
+/* The size of `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 
+
+/* The size of `MPI_Offset', as computed by sizeof. */
+#define SIZEOF_MPI_OFFSET 
+
+/* The size of `short', as computed by sizeof. */
+#define SIZEOF_SHORT 
+
+/* The size of `void *', as computed by sizeof. */
+#define SIZEOF_VOID_P 
+
+/* Define calling convention */
+#define STDCALL 
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if tests with long double complex should be included */
+#define USE_LONG_DOUBLE_COMPLEX 1
+
+/* Define if only operations defined in MPI should be tested */
+/* #undef USE_STRICT_MPI */
+
+/* Version number of package */
+#define VERSION "1.2"
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int16_t */
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+   a type exists and the standard includes do not define it. */
+/* #undef int8_t */
+
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+   nothing if this is not supported.  Do not define if restrict is
+   supported directly.  */
+#define restrict __restrict
+/* Work around a bug in Sun C++: it does not support _Restrict or
+   __restrict__, even though the corresponding Sun C compiler ends up with
+   "#define restrict _Restrict" or "#define restrict __restrict__" in the
+   previous line.  Perhaps some future version of Sun C++ will work with
+   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
+#endif
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
+
+#endif
diff --git a/teshsuite/smpi/mpich3-test/init/CMakeLists.txt b/teshsuite/smpi/mpich3-test/init/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c84f088
--- /dev/null
@@ -0,0 +1,66 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(attrself attrself.c ../util/mtest.c)
+  add_executable(exitst1 exitst1.c ../util/mtest.c)
+  add_executable(exitst2 exitst2.c ../util/mtest.c)
+  add_executable(exitst3 exitst3.c ../util/mtest.c)
+  add_executable(finalized finalized.c ../util/mtest.c)
+  add_executable(initstat initstat.c ../util/mtest.c)
+  add_executable(library_version library_version.c ../util/mtest.c)
+  add_executable(timeout timeout.c ../util/mtest.c)
+  add_executable(version version.c ../util/mtest.c)
+
+  target_link_libraries(attrself  simgrid)
+  target_link_libraries(exitst1  simgrid)
+  target_link_libraries(exitst2  simgrid)
+  target_link_libraries(exitst3  simgrid)
+  target_link_libraries(finalized  simgrid)
+  target_link_libraries(initstat  simgrid)
+  target_link_libraries(library_version  simgrid)
+  target_link_libraries(timeout  simgrid)
+  target_link_libraries(version  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/attrself.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/exitst1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/exitst2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/exitst3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/finalized.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/initstat.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/library_version.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/timeout.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/version.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/init/attrself.c b/teshsuite/smpi/mpich3-test/init/attrself.c
new file mode 100644 (file)
index 0000000..2339805
--- /dev/null
@@ -0,0 +1,141 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTestDescrip[] = "Test creating and inserting attributes in \
+different orders to ensure that the list management code handles all cases.";
+*/
+
+int checkAttrs( MPI_Comm, int, int [], int [] );
+int delete_fn( MPI_Comm, int, void *, void *);
+
+#define NKEYS 5
+static int key[NKEYS];      /* Keys in creation order */
+static int keyorder[NKEYS]; /* Index (into key) of keys in order added to comm 
+                           (key[keyorder[0]] is first set) */
+static int nkeys = 0;
+static int ncall = 0;
+static int errs  = 0;
+/* 
+ * Test that attributes on comm self are deleted in LIFO order 
+ */
+
+int main( int argc, char *argv[] )
+{
+    int      attrval[10];
+    int      wrank, i;
+    MPI_Comm comm;
+
+    MPI_Init( &argc, &argv );
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    comm = MPI_COMM_SELF;
+    
+    /* Create key values */
+    for (nkeys=0; nkeys<NKEYS; nkeys++) {
+       MPI_Comm_create_keyval( MPI_NULL_COPY_FN, delete_fn,
+                               &key[nkeys], (void *)0 );
+       attrval[nkeys] = 1024 * nkeys;
+    }
+    
+    /* Insert attribute in several orders.  Test after put with get,
+       then delete, then confirm delete with get. */
+    
+    MPI_Comm_set_attr( comm, key[3], &attrval[3] ); keyorder[0] = 3;
+    MPI_Comm_set_attr( comm, key[2], &attrval[2] ); keyorder[1] = 2;
+    MPI_Comm_set_attr( comm, key[0], &attrval[0] ); keyorder[2] = 0;
+    MPI_Comm_set_attr( comm, key[1], &attrval[1] ); keyorder[3] = 1;
+    MPI_Comm_set_attr( comm, key[4], &attrval[4] ); keyorder[4] = 4;
+    
+    errs += checkAttrs( comm, NKEYS, key, attrval );
+    
+    for (i=0; i<NKEYS; i++) {
+       /* Save the key value so that we can compare it in the 
+          delete function */
+       int keyval = key[i];
+       MPI_Comm_free_keyval( &keyval );
+    }
+       
+    MPI_Finalize();
+    
+    if (wrank == 0) {
+       if (ncall != nkeys) {
+           printf( "Deleted %d keys but should have deleted %d\n", 
+                   ncall, nkeys );
+           errs++;
+       }
+       if (errs == 0) printf( " No Errors\n" );
+       else printf( " Found %d errors\n", errs );
+    }
+    return 0;
+  
+}
+
+int checkAttrs( MPI_Comm comm, int n, int lkey[], int attrval[] )
+{
+    int lerrs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Comm_get_attr( comm, lkey[i], &val_p, &flag );
+       if (!flag) {
+           lerrs++;
+           fprintf( stderr, "Attribute for key %d not set\n", i );
+       }
+       else if (val_p != &attrval[i]) {
+           lerrs++;
+           fprintf( stderr, "Attribute value for key %d not correct\n",
+                    i );
+       }
+    }
+
+    return lerrs;
+}
+
+/* We *should* be deleting key[keyorder[nkeys-ncall]] */
+int delete_fn( MPI_Comm comm, int keyval, void *attribute_val, 
+              void *extra_state)
+{
+    if (ncall >= nkeys) {
+       printf( "delete function called too many times!\n" );
+       errs++;
+    }
+
+    /* As of MPI 2.2, the order of deletion of attributes on 
+       MPI_COMM_SELF is defined */
+    if (MPI_VERSION > 2 || (MPI_VERSION == 2 && MPI_SUBVERSION >= 2)) {
+       if (keyval != key[keyorder[nkeys-1-ncall]]) {
+           printf( "Expected key # %d but found key with value %d\n", 
+                   keyorder[nkeys-1-ncall], keyval );
+           errs++;
+       }
+    }
+    ncall++;
+    return MPI_SUCCESS;
+}
+
+/*
+int checkNoAttrs( MPI_Comm comm, int n, int lkey[] )
+{
+    int lerrs = 0;
+    int i, flag, *val_p;
+
+    for (i=0; i<n; i++) {
+       MPI_Comm_get_attr( comm, lkey[i], &val_p, &flag );
+       if (flag) {
+           lerrs++;
+           fprintf( stderr, "Attribute for key %d set but should be deleted\n", i );
+       }
+    }
+
+    return lerrs;
+}
+*/
diff --git a/teshsuite/smpi/mpich3-test/init/exitst1.c b/teshsuite/smpi/mpich3-test/init/exitst1.c
new file mode 100644 (file)
index 0000000..3ea4e46
--- /dev/null
@@ -0,0 +1,17 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+/* 
+ * This is a special test to check that mpiexec handles zero/non-zero 
+ * return status from an application
+ */
+int main( int argc, char *argv[] )
+{
+    MPI_Init( 0, 0 );
+    MPI_Finalize( );
+    return 1;
+}
diff --git a/teshsuite/smpi/mpich3-test/init/exitst2.c b/teshsuite/smpi/mpich3-test/init/exitst2.c
new file mode 100644 (file)
index 0000000..7a9b19c
--- /dev/null
@@ -0,0 +1,20 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+/* 
+ * This is a special test to check that mpiexec handles zero/non-zero 
+ * return status from an application.  In this case, each process 
+ * returns a different return status
+ */
+int main( int argc, char *argv[] )
+{
+    int rank;
+    MPI_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Finalize( );
+    return rank;
+}
diff --git a/teshsuite/smpi/mpich3-test/init/exitst3.c b/teshsuite/smpi/mpich3-test/init/exitst3.c
new file mode 100644 (file)
index 0000000..9943e3b
--- /dev/null
@@ -0,0 +1,26 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+/* 
+ * This is a special test to check that mpiexec handles the death of
+ * some processes without an Abort or clean exit
+ */
+int main( int argc, char *argv[] )
+{
+    int rank, size;
+    MPI_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Barrier( MPI_COMM_WORLD );
+    if (rank == size-1) {
+       /* Cause some processes to exit */
+       int *p =0 ;
+       *p = rank;
+    }
+    MPI_Finalize( );
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/init/finalized.c b/teshsuite/smpi/mpich3-test/init/finalized.c
new file mode 100644 (file)
index 0000000..32ac134
--- /dev/null
@@ -0,0 +1,116 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+
+/* FIXME: This test program assumes that MPI_Error_string will work even
+   if MPI is not initialized.  That is not guaranteed.  */
+
+/* Normally, when checking for error returns from MPI calls, you must ensure 
+   that the error handler on the relevant object (communicator, file, or
+   window) has been set to MPI_ERRORS_RETURN.  The tests in this 
+   program are a special case, as either a failure or an abort will
+   indicate a problem */
+
+int main( int argc, char *argv[] )
+{
+    int error;
+    int flag;
+    char err_string[1024];
+    int length = 1024;
+    int rank;
+
+    flag = 0;
+    error = MPI_Finalized(&flag);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Finalized failed: %s\n", err_string);
+       fflush(stdout);
+       return error;
+    }
+    if (flag)
+    {
+       printf("MPI_Finalized returned true before MPI_Init.\n");
+       return -1;
+    }
+
+    error = MPI_Init(&argc, &argv);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Init failed: %s\n", err_string);
+       fflush(stdout);
+       return error;
+    }
+
+    error = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Comm_rank failed: %s\n", err_string);
+       fflush(stdout);
+       MPI_Abort(MPI_COMM_WORLD, error);
+       return error;
+    }
+
+    flag = 0;
+    error = MPI_Finalized(&flag);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Finalized failed: %s\n", err_string);
+       fflush(stdout);
+       MPI_Abort(MPI_COMM_WORLD, error);
+       return error;
+    }
+    if (flag)
+    {
+       printf("MPI_Finalized returned true before MPI_Finalize.\n");
+       fflush(stdout);
+       MPI_Abort(MPI_COMM_WORLD, error);
+       return -1;
+    }
+
+    error = MPI_Barrier(MPI_COMM_WORLD);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Barrier failed: %s\n", err_string);
+       fflush(stdout);
+       MPI_Abort(MPI_COMM_WORLD, error);
+       return error;
+    }
+
+    error = MPI_Finalize();
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Finalize failed: %s\n", err_string);
+       fflush(stdout);
+       return error;
+    }
+
+    flag = 0;
+    error = MPI_Finalized(&flag);
+    if (error != MPI_SUCCESS)
+    {
+       MPI_Error_string(error, err_string, &length);
+       printf("MPI_Finalized failed: %s\n", err_string);
+       fflush(stdout);
+       return error;
+    }
+    if (!flag)
+    {
+       printf("MPI_Finalized returned false after MPI_Finalize.\n");
+       return -1;
+    }
+    if (rank == 0)
+    {
+       printf(" No Errors\n");
+    }
+    return 0;  
+}
diff --git a/teshsuite/smpi/mpich3-test/init/initstat.c b/teshsuite/smpi/mpich3-test/init/initstat.c
new file mode 100644 (file)
index 0000000..f3d42e1
--- /dev/null
@@ -0,0 +1,36 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int provided, flag, claimed;
+
+    /* MTest_Init( &argc, &argv ); */
+
+    MPI_Init_thread( &argc, &argv, MPI_THREAD_MULTIPLE, &provided );
+    
+    MPI_Is_thread_main( &flag );
+    if (!flag) {
+       errs++;
+       printf( "This thread called init_thread but Is_thread_main gave false\n" );
+    }
+    MPI_Query_thread( &claimed );
+    if (claimed != provided) {
+       errs++;
+       printf( "Query thread gave thread level %d but Init_thread gave %d\n",
+               claimed, provided );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/init/library_version.c b/teshsuite/smpi/mpich3-test/init/library_version.c
new file mode 100644 (file)
index 0000000..132e135
--- /dev/null
@@ -0,0 +1,34 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+static int verbose = 0;
+
+int main(int argc, char *argv[])
+{
+    int errs = 0, resultlen = -1;
+    char version[MPI_MAX_LIBRARY_VERSION_STRING];
+
+    MTest_Init(&argc, &argv);
+
+    MPI_Get_library_version(version, &resultlen);
+    if (resultlen < 0) {
+        errs++;
+        printf("Resultlen is %d\n", resultlen);
+    }
+    else {
+        if (verbose)
+            printf("%s\n", version);
+    }
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+    return 0;
+
+}
diff --git a/teshsuite/smpi/mpich3-test/init/testlist b/teshsuite/smpi/mpich3-test/init/testlist
new file mode 100644 (file)
index 0000000..b2e20fb
--- /dev/null
@@ -0,0 +1,9 @@
+exitst1 2 resultTest=TestStatus
+exitst2 4 resultTest=TestStatus
+initstat 1
+#timeout 2 resultTest=TestTimeout timeLimit=10
+version 1
+finalized 1
+#needs PMPI_Comm_free_keyval
+#attrself 1
+library_version 1 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/init/timeout.c b/teshsuite/smpi/mpich3-test/init/timeout.c
new file mode 100644 (file)
index 0000000..912619f
--- /dev/null
@@ -0,0 +1,20 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+
+/* This is a program that tests the ability of mpiexec to timeout a process
+   after no more than 3 minutes.  By default, it will run for 5 minutes */
+int main( int argc, char *argv[] )
+{
+    double t1;
+    double deltaTime = 300;
+
+    MPI_Init( &argc, &argv );
+    t1 = MPI_Wtime();
+    while (MPI_Wtime() - t1 < deltaTime) ;
+    MPI_Finalize( );
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/init/version.c b/teshsuite/smpi/mpich3-test/init/version.c
new file mode 100644 (file)
index 0000000..40c5895
--- /dev/null
@@ -0,0 +1,34 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int majversion, subversion;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Get_version( &majversion, &subversion );
+    if (majversion != MPI_VERSION) {
+       errs++;
+       printf( "Major version is %d but is %d in the mpi.h file\n", 
+               majversion, MPI_VERSION );
+    }
+    if (subversion != MPI_SUBVERSION) {
+       errs++;
+       printf( "Minor version is %d but is %d in the mpi.h file\n", 
+               subversion, MPI_SUBVERSION );
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b705367
--- /dev/null
@@ -0,0 +1,147 @@
+cmake_minimum_required(VERSION 2.6)
+
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
+  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  add_executable(anyall anyall.c ../util/mtest.c)
+  add_executable(bottom bottom.c ../util/mtest.c)
+  add_executable(bsend1 bsend1.c ../util/mtest.c)
+  add_executable(bsend2 bsend2.c ../util/mtest.c)
+  add_executable(bsend3 bsend3.c ../util/mtest.c)
+  add_executable(bsend4 bsend4.c ../util/mtest.c)
+  add_executable(bsend5 bsend5.c ../util/mtest.c)
+  add_executable(bsendalign bsendalign.c ../util/mtest.c)
+  add_executable(bsendfrag bsendfrag.c ../util/mtest.c)
+  add_executable(bsendpending bsendpending.c ../util/mtest.c)
+  add_executable(cancelrecv cancelrecv.c ../util/mtest.c)
+  add_executable(eagerdt eagerdt.c ../util/mtest.c)
+  add_executable(greq1 greq1.c ../util/mtest.c)
+  add_executable(icsend icsend.c ../util/mtest.c)
+  add_executable(inactivereq inactivereq.c ../util/mtest.c)
+  add_executable(isendself isendself.c ../util/mtest.c)
+  add_executable(isendselfprobe isendselfprobe.c ../util/mtest.c)
+  add_executable(large_message large_message.c ../util/mtest.c)
+  add_executable(mprobe mprobe.c ../util/mtest.c)
+  add_executable(pingping pingping.c ../util/mtest.c)
+  add_executable(probenull probenull.c ../util/mtest.c)
+  add_executable(probe-unexp probe-unexp.c ../util/mtest.c)
+  add_executable(pscancel pscancel.c ../util/mtest.c)
+  add_executable(rcancel rcancel.c ../util/mtest.c)
+  add_executable(rqfreeb rqfreeb.c ../util/mtest.c)
+  add_executable(rqstatus rqstatus.c ../util/mtest.c)
+  add_executable(scancel2 scancel2.c ../util/mtest.c)
+  add_executable(scancel scancel.c ../util/mtest.c)
+  add_executable(sendall sendall.c ../util/mtest.c)
+  add_executable(sendflood sendflood.c ../util/mtest.c)
+  add_executable(sendrecv1 sendrecv1.c ../util/mtest.c)
+  add_executable(sendrecv2 sendrecv2.c ../util/mtest.c)
+  add_executable(sendrecv3 sendrecv3.c ../util/mtest.c)
+  add_executable(sendself sendself.c ../util/mtest.c)
+  add_executable(waitany-null waitany-null.c ../util/mtest.c)
+  add_executable(waittestnull waittestnull.c ../util/mtest.c)
+
+  target_link_libraries(anyall  simgrid)
+  target_link_libraries(bottom  simgrid)
+  target_link_libraries(bsend1  simgrid)
+  target_link_libraries(bsend2  simgrid)
+  target_link_libraries(bsend3  simgrid)
+  target_link_libraries(bsend4  simgrid)
+  target_link_libraries(bsend5  simgrid)
+  target_link_libraries(bsendalign  simgrid)
+  target_link_libraries(bsendfrag  simgrid)
+  target_link_libraries(bsendpending  simgrid)
+  target_link_libraries(cancelrecv  simgrid)
+  target_link_libraries(eagerdt  simgrid)
+  target_link_libraries(greq1  simgrid)
+  target_link_libraries(icsend  simgrid)
+  target_link_libraries(inactivereq  simgrid)
+  target_link_libraries(isendself  simgrid)
+  target_link_libraries(isendselfprobe  simgrid)
+  target_link_libraries(large_message  simgrid)
+  target_link_libraries(mprobe  simgrid)
+  target_link_libraries(pingping  simgrid)
+  target_link_libraries(probenull  simgrid)
+  target_link_libraries(probe-unexp  simgrid)
+  target_link_libraries(pscancel  simgrid)
+  target_link_libraries(rcancel  simgrid)
+  target_link_libraries(rqfreeb  simgrid)
+  target_link_libraries(rqstatus  simgrid)
+  target_link_libraries(scancel2  simgrid)
+  target_link_libraries(scancel  simgrid)
+  target_link_libraries(sendall  simgrid)
+  target_link_libraries(sendflood  simgrid)
+  target_link_libraries(sendrecv1  simgrid)
+  target_link_libraries(sendrecv2  simgrid)
+  target_link_libraries(sendrecv3  simgrid)
+  target_link_libraries(sendself  simgrid)
+  target_link_libraries(waitany-null  simgrid)
+  target_link_libraries(waittestnull  simgrid)
+
+endif()
+
+set(tesh_files
+  ${tesh_files}
+  PARENT_SCOPE
+  )
+set(xml_files
+  ${xml_files}
+  PARENT_SCOPE
+  )
+set(examples_src
+  ${examples_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/anyall.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bottom.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsend1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsend2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsend3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsend4.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsend5.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsendalign.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsendfrag.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/bsendpending.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/cancelrecv.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/eagerdt.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/greq1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/icsend.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/inactivereq.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/isendself.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/isendselfprobe.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/large_message.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/mprobe.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/pingping.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/probenull.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/probe-unexp.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/pscancel.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/rcancel.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/rqfreeb.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/rqstatus.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scancel2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/scancel.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendall.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendflood.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv1.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv2.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendrecv3.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/sendself.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/waitany-null.c 
+ ${CMAKE_CURRENT_SOURCE_DIR}/waittestnull.c 
+  PARENT_SCOPE
+  )
+set(bin_files
+  ${bin_files}
+  PARENT_SCOPE
+  )
+set(txt_files
+  ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
+  PARENT_SCOPE
+  )
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/anyall.c b/teshsuite/smpi/mpich3-test/pt2pt/anyall.c
new file mode 100644 (file)
index 0000000..b54b13a
--- /dev/null
@@ -0,0 +1,88 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+#define MAX_MSGS 30
+
+/*
+static char MTEST_Descrip[] = "One implementation delivered incorrect data when an MPI recieve uses both ANY_SOURCE and ANY_TAG";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int         wrank, wsize, master, worker, i, j, idx, count;
+    int         errs = 0;
+    MPI_Request r[MAX_MSGS];
+    int         buf[MAX_MSGS][MAX_MSGS];
+    MPI_Comm    comm;
+    MPI_Status  status;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+
+    comm = MPI_COMM_WORLD;
+    master = 0;
+    worker = 1;
+
+    /* The test takes advantage of the ordering rules for messages*/
+
+    if (wrank == master) {
+       /* Initialize the send buffer */
+       for (i=0; i<MAX_MSGS; i++) {
+           for (j=0; j<MAX_MSGS; j++) {
+               buf[i][j] = i*MAX_MSGS + j;
+           }
+       }
+       MPI_Barrier( MPI_COMM_WORLD );
+       for (i=0; i<MAX_MSGS; i++) {
+           MPI_Send( buf[i], MAX_MSGS-i, MPI_INT, worker, 3, comm );
+       }
+    }
+    else if (wrank == worker) {
+       /* Initialize the recv buffer */
+       for (i=0; i<MAX_MSGS; i++) {
+           for (j=0; j<MAX_MSGS; j++) {
+               buf[i][j] = -1;
+           }
+       }
+       for (i=0; i<MAX_MSGS; i++) {
+           MPI_Irecv( buf[i], MAX_MSGS-i, MPI_INT, MPI_ANY_SOURCE, 
+                      MPI_ANY_TAG, comm, &r[i] );
+       }
+       MPI_Barrier( MPI_COMM_WORLD );
+       for (i=0; i<MAX_MSGS; i++) {
+           MPI_Waitany( MAX_MSGS, r, &idx, &status );
+           /* Message idx should have length MAX_MSGS-idx */
+           MPI_Get_count( &status, MPI_INT, &count );
+           if (count != MAX_MSGS-idx) {
+               errs++;
+           }
+           else {
+               /* Check for the correct answers */
+               for (j=0; j < MAX_MSGS-idx; j++) {
+                   if (buf[idx][j] != idx * MAX_MSGS + j) {
+                       errs ++;
+                       printf( "Message %d [%d] is %d, should be %d\n",
+                               idx, j, buf[idx][j], idx * MAX_MSGS + j );
+                   }
+               }
+           }
+       }
+    }
+    else {
+       MPI_Barrier( MPI_COMM_WORLD );
+    }
+       
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bottom.c b/teshsuite/smpi/mpich3-test/pt2pt/bottom.c
new file mode 100644 (file)
index 0000000..3c085fd
--- /dev/null
@@ -0,0 +1,80 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Use of MPI_BOTTOM in communication";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size, source, dest, len, ii;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Datatype  newtype, oldtype;
+    MPI_Aint      disp;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Get_address( &ii, &disp );
+
+    len     = 1;
+    oldtype = MPI_INT;
+    MPI_Type_create_struct( 1, &len, &disp, &oldtype, &newtype );
+    MPI_Type_commit( &newtype );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+
+    if (size < 2) {
+       errs++;
+       fprintf( stderr, "This test requires at least two processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    source = 0;
+    dest = 1;
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+    if (rank == source) {
+       ii = 2;
+       err = MPI_Send( MPI_BOTTOM, 1, newtype, dest, 0, comm );
+       if (err) {
+           errs++;
+           MTestPrintError( err );
+           printf( "MPI_Send did not return MPI_SUCCESS\n" );
+       }
+    }
+    else if (rank == dest) {
+       ii = -1;
+       err = MPI_Recv( MPI_BOTTOM, 1, newtype, source, 0, comm, &status );
+       if (err) {
+           MTestPrintError( err );
+           errs++;
+           printf( "MPI_Recv did not return MPI_SUCCESS\n" );
+       }
+       if (ii != 2) {
+           errs++;
+           printf( "Received %d but expected %d\n", ii, 2 );
+       }
+    }
+
+    MPI_Comm_set_errhandler( comm, MPI_ERRORS_ARE_FATAL );
+
+    MPI_Type_free( &newtype );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsend1.c b/teshsuite/smpi/mpich3-test/pt2pt/bsend1.c
new file mode 100644 (file)
index 0000000..8ef0062
--- /dev/null
@@ -0,0 +1,84 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* 
+ * This is a simple program that tests bsend.  It may be run as a single
+ * process to simplify debugging; in addition, bsend allows send-to-self
+ * programs.
+ */
+int main( int argc, char *argv[] )
+{
+    MPI_Comm comm = MPI_COMM_WORLD;
+    int dest = 0, src = 0, tag = 1;
+    int s1, s2, s3;
+    char *buf, *bbuf;
+    char msg1[7], msg3[17];
+    double msg2[2];
+    char rmsg1[64], rmsg3[64];
+    double rmsg2[64];
+    int errs = 0, rank;
+    int bufsize, bsize;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    /* According to the standard, we must use the PACK_SIZE length of each
+       message in the computation of the message buffer size */
+    MPI_Pack_size( 7, MPI_CHAR, comm, &s1 );
+    MPI_Pack_size( 2, MPI_DOUBLE, comm, &s2 );
+    MPI_Pack_size( 17, MPI_CHAR, comm, &s3 );
+    bufsize = 3 * MPI_BSEND_OVERHEAD + s1 + s2 + s3;
+    buf = (char *)malloc( bufsize );
+    MPI_Buffer_attach( buf, bufsize );
+
+    strncpy( msg1, "012345", 7 );
+    strncpy( msg3, "0123401234012341", 17 );
+    msg2[0] = 1.23; msg2[1] = 3.21;
+
+    if (rank == src) {
+       /* These message sizes are chosen to expose any alignment problems */
+       MPI_Bsend( msg1, 7, MPI_CHAR, dest, tag, comm );
+       MPI_Bsend( msg2, 2, MPI_DOUBLE, dest, tag, comm );
+       MPI_Bsend( msg3, 17, MPI_CHAR, dest, tag, comm );
+    }
+
+    if (rank == dest) {
+       MPI_Recv( rmsg1, 7, MPI_CHAR, src, tag, comm, MPI_STATUS_IGNORE );
+       MPI_Recv( rmsg2, 10, MPI_DOUBLE, src, tag, comm, MPI_STATUS_IGNORE );
+       MPI_Recv( rmsg3, 17, MPI_CHAR, src, tag, comm, MPI_STATUS_IGNORE );
+
+       if (strcmp( rmsg1, msg1 ) != 0) {
+           errs++;
+           fprintf( stderr, "message 1 (%s) should be %s\n", rmsg1, msg1 );
+       }
+       if (rmsg2[0] != msg2[0] || rmsg2[1] != msg2[1]) {
+           errs++;
+           fprintf( stderr, 
+         "message 2 incorrect, values are (%f,%f) but should be (%f,%f)\n",
+                    rmsg2[0], rmsg2[1], msg2[0], msg2[1] );
+       }
+       if (strcmp( rmsg3, msg3 ) != 0) {
+           errs++;
+           fprintf( stderr, "message 3 (%s) should be %s\n", rmsg3, msg3 );
+       }
+    }
+
+    /* We can't guarantee that messages arrive until the detach */
+    MPI_Buffer_detach( &bbuf, &bsize );
+
+    MTest_Finalize( errs );
+    
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsend2.c b/teshsuite/smpi/mpich3-test/pt2pt/bsend2.c
new file mode 100644 (file)
index 0000000..4f6ad93
--- /dev/null
@@ -0,0 +1,61 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+#define BUFSIZE 2000
+int main( int argc, char *argv[] )
+{
+    MPI_Status status;
+    int a[10], b[10];
+    int buf[BUFSIZE], *bptr, bl, i, j, rank, size;
+    int errs = 0;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Buffer_attach( buf, BUFSIZE );
+    
+    for (j=0; j<10; j++) {
+       for (i=0; i<10; i++) {
+           a[i] = (rank + 10 * j) * size + i;
+       }
+       MPI_Bsend( a, 10, MPI_INT, 0, 27+j, MPI_COMM_WORLD );
+    }
+    if (rank == 0) {
+
+       for (i=0; i<size; i++) {
+           for (j=0; j<10; j++) {
+               int k;
+               status.MPI_TAG = -10;
+               status.MPI_SOURCE = -20;
+               MPI_Recv( b, 10, MPI_INT, i, 27+j, MPI_COMM_WORLD, &status );
+    
+               if (status.MPI_TAG != 27+j) { 
+                   errs ++;
+                   printf( "Wrong tag = %d\n", status.MPI_TAG );
+               }
+               if (status.MPI_SOURCE != i) {
+                   errs++;
+                   printf( "Wrong source = %d\n", status.MPI_SOURCE );
+               }
+               for (k=0; k<10; k++) {
+                   if (b[k] != (i + 10 * j) * size + k) {
+                       errs++;
+                       printf( "received b[%d] = %d from %d tag %d\n",
+                               k, b[k], i, 27+j );
+                   }
+               }
+           }
+       }
+    }
+    MPI_Buffer_detach( &bptr, &bl );
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsend3.c b/teshsuite/smpi/mpich3-test/pt2pt/bsend3.c
new file mode 100644 (file)
index 0000000..975b686
--- /dev/null
@@ -0,0 +1,65 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+#define BUFSIZE 2000
+int main( int argc, char *argv[] )
+{
+    MPI_Status status;
+    MPI_Request request;
+    int a[10], b[10];
+    int buf[BUFSIZE], *bptr, bl, i, j, rank, size;
+    int errs = 0;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Buffer_attach( buf, BUFSIZE );
+
+    for (j=0; j<10; j++) {
+       MPI_Bsend_init( a, 10, MPI_INT, 0, 27+j, MPI_COMM_WORLD, &request );
+       for (i=0; i<10; i++) {
+           a[i] = (rank + 10 * j) * size + i;
+       }
+       MPI_Start( &request );
+       MPI_Wait( &request, &status );
+       MPI_Request_free( &request );
+    }
+    if (rank == 0) {
+
+       for (i=0; i<size; i++) {
+           for (j=0; j<10; j++) {
+               int k;
+               status.MPI_TAG = -10;
+               status.MPI_SOURCE = -20;
+               MPI_Recv( b, 10, MPI_INT, i, 27+j, MPI_COMM_WORLD, &status );
+    
+               if (status.MPI_TAG != 27+j) {
+                   errs++;
+                   printf( "Wrong tag = %d\n", status.MPI_TAG );
+               }
+               if (status.MPI_SOURCE != i) {
+                   errs++;
+                   printf( "Wrong source = %d\n", status.MPI_SOURCE );
+               }
+               for (k=0; k<10; k++) {
+                   if (b[k] != (i + 10 * j) * size + k) {
+                       errs++;
+                       printf( "received b[%d] = %d from %d tag %d\n",
+                               k, b[k], i, 27+j );
+                   }
+               }
+           }
+       }
+    }
+    MPI_Buffer_detach( &bptr, &bl );
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsend4.c b/teshsuite/smpi/mpich3-test/pt2pt/bsend4.c
new file mode 100644 (file)
index 0000000..c1ced9c
--- /dev/null
@@ -0,0 +1,62 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h" 
+
+#define BUFSIZE 2000
+int main( int argc, char *argv[] )
+{
+    MPI_Status status;
+    MPI_Request request;
+    int a[10], b[10];
+    int buf[BUFSIZE], *bptr, bl, i, j, rank, size, errs=0;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Buffer_attach( buf, BUFSIZE );
+
+    for (j=0; j<10; j++) {
+       for (i=0; i<10; i++) {
+           a[i] = (rank + 10 * j) * size + i;
+       }
+       MPI_Ibsend( a, 10, MPI_INT, 0, 27+j, MPI_COMM_WORLD, &request );
+       MPI_Wait( &request, &status );
+    }
+    if (rank == 0) {
+
+       for (i=0; i<size; i++) {
+           for (j=0; j<10; j++) {
+               int k;
+               status.MPI_TAG = -10;
+               status.MPI_SOURCE = -20;
+               MPI_Recv( b, 10, MPI_INT, i, 27+j, MPI_COMM_WORLD, &status );
+    
+               if (status.MPI_TAG != 27+j) {
+                   errs++;
+                   printf( "Wrong tag = %d\n", status.MPI_TAG );
+               }
+               if (status.MPI_SOURCE != i) {
+                   errs++;
+                   printf( "Wrong source = %d\n", status.MPI_SOURCE );
+               }
+               for (k=0; k<10; k++) {
+                   if (b[k] != (i + 10 * j) * size + k) {
+                       errs ++;
+                       printf( "received b[%d] = %d from %d tag %d\n",
+                               k, b[k], i, 27+j );
+                   }
+               }
+           }
+       }
+    }
+    MPI_Buffer_detach( &bptr, &bl );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsend5.c b/teshsuite/smpi/mpich3-test/pt2pt/bsend5.c
new file mode 100644 (file)
index 0000000..767a586
--- /dev/null
@@ -0,0 +1,69 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h" 
+
+#define BUFSIZE 2000
+int main( int argc, char *argv[] )
+{
+    MPI_Status status;
+    MPI_Comm comm,scomm;
+    int a[10], b[10];
+    int buf[BUFSIZE], *bptr, bl, i, j, rank, size, color, errs=0;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    color = rank % 2;
+    MPI_Comm_split( MPI_COMM_WORLD, color, rank, &scomm );
+    MPI_Intercomm_create( scomm, 0, MPI_COMM_WORLD, 1-color, 52, &comm);
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_remote_size( comm, &size );
+    MPI_Buffer_attach( buf, BUFSIZE );
+    
+    for (j=0; j<10; j++) {
+       for (i=0; i<10; i++) {
+           a[i] = (rank + 10 * j) * size + i;
+       }
+       MPI_Bsend( a, 10, MPI_INT, 0, 27+j, comm );
+    }
+    if (rank == 0) {
+
+       for (i=0; i<size; i++) {
+           for (j=0; j<10; j++) {
+               int k;
+               status.MPI_TAG = -10;
+               status.MPI_SOURCE = -20;
+               MPI_Recv( b, 10, MPI_INT, i, 27+j, comm, &status );
+    
+               if (status.MPI_TAG != 27+j) {
+                   errs++;
+                   printf( "Wrong tag = %d\n", status.MPI_TAG );
+               }
+               if (status.MPI_SOURCE != i) {
+                   errs++;
+                   printf( "Wrong source = %d\n", status.MPI_SOURCE );
+               }
+               for (k=0; k<10; k++) {
+                   if (b[k] != (i + 10 * j) * size + k) {
+                       errs++;
+                       printf( "received b[%d] = %d from %d tag %d\n",
+                               k, b[k], i, 27+j );
+                   }
+               }
+           }
+       }
+    }
+    MPI_Buffer_detach( &bptr, &bl );
+
+    MPI_Comm_free(&scomm);
+    MPI_Comm_free(&comm);
+
+    MTest_Finalize( errs );
+    
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsendalign.c b/teshsuite/smpi/mpich3-test/pt2pt/bsendalign.c
new file mode 100644 (file)
index 0000000..fdea000
--- /dev/null
@@ -0,0 +1,71 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* Test bsend with a buffer with arbitrary alignment */
+#define BUFSIZE 2000*4
+int main( int argc, char *argv[] )
+{
+    MPI_Status status;
+    int a[10], b[10];
+    int align;
+    char buf[BUFSIZE+8], *bptr;
+    int bl, i, j, rank, size;
+    int errs = 0;
+
+    MTest_Init( 0, 0 );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    for (align = 0; align < 7; align++) {
+       MPI_Buffer_attach( buf+align, BUFSIZE);
+       
+       for (j=0; j<10; j++) {
+           for (i=0; i<10; i++) {
+               a[i] = (rank + 10 * j) * size + i;
+           }
+           MPI_Bsend( a, 10, MPI_INT, 0, 27+j, MPI_COMM_WORLD );
+       }
+       if (rank == 0) {
+           
+           for (i=0; i<size; i++) {
+               for (j=0; j<10; j++) {
+                   int k;
+                   status.MPI_TAG = -10;
+                   status.MPI_SOURCE = -20;
+                   MPI_Recv( b, 10, MPI_INT, i, 27+j, MPI_COMM_WORLD, &status );
+                   
+                   if (status.MPI_TAG != 27+j) { 
+                       errs ++;
+                       printf( "Wrong tag = %d\n", status.MPI_TAG );
+                   }
+                   if (status.MPI_SOURCE != i) {
+                       errs++;
+                       printf( "Wrong source = %d\n", status.MPI_SOURCE );
+                   }
+                   for (k=0; k<10; k++) {
+                       if (b[k] != (i + 10 * j) * size + k) {
+                           errs++;
+                           printf( "(Align=%d) received b[%d] = %d (expected %d) from %d tag %d\n",
+                                   align, k, b[k], (i+10*j), i, 27+j );
+                       }
+                   }
+               }
+           }
+       }
+       MPI_Buffer_detach( &bptr, &bl );
+       if (bptr != buf+align) {
+           errs++;
+           printf( "Did not recieve the same buffer on detach that was provided on init (%p vs %p)\n", bptr, buf );
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c b/teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c
new file mode 100644 (file)
index 0000000..8f22959
--- /dev/null
@@ -0,0 +1,121 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test bsend message handling where \
+different messages are received in different orders";
+*/
+
+/*
+ * Notes on the test.
+ *
+ * To ensure that messages remain in the bsend buffer until received,
+ * messages are sent with size MSG_SIZE (ints).  
+ */
+
+#define MSG_SIZE 17000
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int b1[MSG_SIZE], b2[MSG_SIZE], b3[MSG_SIZE], b4[MSG_SIZE];
+    int src, dest, size, rank, i;
+    MPI_Comm comm;
+    MPI_Status status;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    if (size < 2) {
+       errs++;
+       fprintf( stderr, "At least 2 processes required\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    src  = 0;
+    dest = 1;
+
+    if (rank == src) {
+       int *buf, bufsize, bsize;
+
+       bufsize = 4 * (MSG_SIZE * sizeof(int) + MPI_BSEND_OVERHEAD);
+       buf = (int *)malloc( bufsize );
+       if (!buf) {
+           fprintf( stderr, "Could not allocate buffer of %d bytes\n", 
+                    bufsize );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+       MPI_Buffer_attach( buf, bufsize );
+
+       /* Initialize data */
+       for (i=0; i<MSG_SIZE; i++) {
+           b1[i] = i;
+           b2[i] = MSG_SIZE + i;
+           b3[i] = 2 * MSG_SIZE + i;
+           b4[i] = 3 * MSG_SIZE + i;
+       }
+       /* Send and reset buffers after bsend returns */
+       MPI_Bsend( b1, MSG_SIZE, MPI_INT, dest, 0, comm );
+       for (i=0; i<MSG_SIZE; i++) b1[i] = -b1[i];
+       MPI_Bsend( b2, MSG_SIZE, MPI_INT, dest, 1, comm );
+       for (i=0; i<MSG_SIZE; i++) b2[i] = -b2[i];
+       MPI_Bsend( b3, MSG_SIZE, MPI_INT, dest, 2, comm );
+       for (i=0; i<MSG_SIZE; i++) b3[i] = -b3[i];
+       MPI_Bsend( b4, MSG_SIZE, MPI_INT, dest, 3, comm );
+       for (i=0; i<MSG_SIZE; i++) b4[i] = -b4[i];
+
+       MPI_Barrier( comm );
+       /* Detach waits until all messages received */
+       MPI_Buffer_detach( &buf, &bsize );
+    }
+    else if (rank == dest) {
+       
+       MPI_Barrier( comm );
+       MPI_Recv( b2, MSG_SIZE, MPI_INT, src, 1, comm, &status );
+       MPI_Recv( b1, MSG_SIZE, MPI_INT, src, 0, comm, &status );
+       MPI_Recv( b4, MSG_SIZE, MPI_INT, src, 3, comm, &status );
+       MPI_Recv( b3, MSG_SIZE, MPI_INT, src, 2, comm, &status );
+
+       /* Check received data */
+       for (i=0; i<MSG_SIZE; i++) {
+           if (b1[i] != i) {
+               errs++;
+               if (errs < 16) printf( "b1[%d] is %d\n", i, b1[i] );
+           }
+           if (b2[i] != MSG_SIZE + i) {
+               errs++;
+               if (errs < 16) printf( "b2[%d] is %d\n", i, b2[i] );
+           }
+           if (b3[i] != 2 * MSG_SIZE + i) {
+               errs++;
+               if (errs < 16) printf( "b3[%d] is %d\n", i, b3[i] );
+           }
+           if (b4[i] != 3 * MSG_SIZE + i) {
+               errs++;
+               if (errs < 16) printf( "b4[%d] is %d\n", i, b4[i] );
+           }
+       }
+    }
+    else {
+       MPI_Barrier( comm );
+    }
+
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+  
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c b/teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c
new file mode 100644 (file)
index 0000000..cc7cc5a
--- /dev/null
@@ -0,0 +1,142 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test the handling of BSend operations when a detach occurs before the bsend data has been sent.";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest;
+    unsigned char *buf, *bufp;
+    int minsize = 2; 
+    int i, msgsize, bufsize, outsize;
+    unsigned char *msg1, *msg2, *msg3;
+    MPI_Comm      comm;
+    MPI_Status    status1, status2, status3;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    msgsize = 128 * 1024;
+    msg1 = (unsigned char *)malloc( 3 * msgsize );
+    msg2 = msg1 + msgsize;
+    msg3 = msg2 + msgsize;
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       source = 0;
+       dest   = size - 1;
+
+       /* Here is the test:  The sender */
+       if (rank == source) {
+           /* Get a bsend buffer.  Make it large enough that the Bsend
+              internals will (probably) not use a eager send for the data.
+              Have three such messages */
+           bufsize = 3 * (MPI_BSEND_OVERHEAD + msgsize);
+           buf     = (unsigned char *)malloc( bufsize );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate a buffer of %d bytes\n",
+                        bufsize );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           
+           MPI_Buffer_attach( buf, bufsize );
+
+           /* Initialize the buffers */
+           for (i=0; i<msgsize; i++) {
+               msg1[i] = 0xff ^ (i & 0xff);
+               msg2[i] = 0xff ^ (3*i & 0xff);
+               msg3[i] = 0xff ^ (5*i & 0xff);
+           }
+
+           /* Initiate the bsends */
+           MPI_Bsend( msg1, msgsize, MPI_CHAR, dest, 0, comm );
+           MPI_Bsend( msg2, msgsize, MPI_CHAR, dest, 0, comm );
+           MPI_Bsend( msg3, msgsize, MPI_CHAR, dest, 0, comm );
+
+           /* Synchronize with our partner */
+           MPI_Sendrecv( 0, 0, MPI_CHAR, dest, 10, 
+                         0, 0, MPI_CHAR, dest, 10, comm, MPI_STATUS_IGNORE );
+
+           /* Detach the buffers.  There should be pending operations */
+           MPI_Buffer_detach ( &bufp, &outsize );
+           if (bufp != buf) {
+               fprintf( stderr, "Wrong buffer returned\n" );
+               errs++;
+           }
+           if (outsize != bufsize) {
+               fprintf( stderr, "Wrong buffer size returned\n" );
+               errs++;
+           }
+       }
+       else if (rank == dest) {
+           double tstart;
+
+           /* Clear the message buffers */
+           for (i=0; i<msgsize; i++) {
+               msg1[i] = 0;
+               msg2[i] = 0;
+               msg3[i] = 0;
+           }
+
+           /* Wait for the synchronize */
+           MPI_Sendrecv( 0, 0, MPI_CHAR, source, 10, 
+                         0, 0, MPI_CHAR, source, 10, comm, MPI_STATUS_IGNORE );
+
+           /* Wait 2 seconds */
+           tstart = MPI_Wtime();
+           while (MPI_Wtime() - tstart < 2.0) ;
+
+           /* Now receive the messages */
+           MPI_Recv( msg1, msgsize, MPI_CHAR, source, 0, comm, &status1 );
+           MPI_Recv( msg2, msgsize, MPI_CHAR, source, 0, comm, &status2 );
+           MPI_Recv( msg3, msgsize, MPI_CHAR, source, 0, comm, &status3 );
+
+           /* Check that we have the correct data */
+           for (i=0; i<msgsize; i++) {
+               if (msg1[i] != (0xff ^ (i & 0xff))) { 
+                   if (errs < 10) {
+                       fprintf( stderr, "msg1[%d] = %d\n", i, msg1[i] );
+                   }
+                   errs++;
+               }
+               if (msg2[i] != (0xff ^ (3*i & 0xff))) {
+                   if (errs < 10) {
+                       fprintf( stderr, "msg2[%d] = %d\n", i, msg2[i] );
+                   }
+                   errs++;
+               }
+               if (msg3[i] != (0xff ^ (5*i & 0xff))) {
+                   if (errs < 10) {
+                       fprintf( stderr, "msg2[%d] = %d\n", i, msg2[i] );
+                   }
+                   errs++;
+               }
+           }
+           
+       }
+               
+       
+       MTestFreeComm( &comm );
+    }
+    free( msg1 );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/cancelrecv.c b/teshsuite/smpi/mpich3-test/pt2pt/cancelrecv.c
new file mode 100644 (file)
index 0000000..2744748
--- /dev/null
@@ -0,0 +1,138 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include <string.h>   /* For memset */
+
+int main( int argc, char *argv[] )
+{
+    MPI_Request r[3];
+    MPI_Status  s[3];
+    int *buf0, *buf1, *buf2;
+    int rank, size, src, dest, flag, errs = 0;
+    int n0, n1, n2;
+    MPI_Comm comm;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    if (size < 2) {
+       fprintf( stderr, "Must run with at least 2 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    dest = 0;
+    src  = 1;
+    comm = MPI_COMM_WORLD;
+
+    n0 = n1 = n2 = 65536;
+    buf0 = (int *)malloc( n0 * sizeof(int) );
+    buf1 = (int *)malloc( n1 * sizeof(int) );
+    buf2 = (int *)malloc( n2 * sizeof(int) );
+    if (!buf0 || !buf1 || !buf2) {
+       fprintf( stderr, "Unable to allocate buffers of size %d\n", 
+                n0 * (int)sizeof(int) );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+    memset( buf0, -1, n0 * sizeof(int) );
+    memset( buf1, -1, n0 * sizeof(int) );
+    memset( buf2, -1, n0 * sizeof(int) );
+
+    if (rank == dest) {
+       MPI_Irecv( buf0, n0, MPI_INT, src, 0, comm, &r[0] );
+       MPI_Irecv( buf1, n1, MPI_INT, src, 1, comm, &r[1] );
+       MPI_Irecv( buf2, n2, MPI_INT, src, 2, comm, &r[2] );
+       
+       MPI_Barrier( comm );
+
+       MPI_Cancel( &r[1] );
+       MPI_Barrier( comm );
+       memset( s, -1, sizeof(s) );
+       MPI_Waitall( 3, r, s );
+        MPI_Test_cancelled( &s[0], &flag );
+        if (flag) {
+           errs++;
+           printf( "request 0 was cancelled!\n" );
+       }
+        MPI_Test_cancelled( &s[1], &flag );
+        if (!flag) {
+           errs++;
+           printf( "request 1 was not cancelled!\n" );
+       }
+        MPI_Test_cancelled( &s[2], &flag );
+        if (flag) {
+           errs++;
+           printf( "request 2 was cancelled!\n" );
+       }
+       MPI_Barrier( comm );
+    }
+    if (rank == src) {
+       int tflag;
+       MPI_Barrier( comm );
+       MPI_Barrier( comm );
+       MPI_Send( buf0, n0, MPI_INT, dest, 0, comm );
+       MPI_Isend( buf2, n2, MPI_INT, dest, 2, comm, &r[1] );
+       MPI_Isend( buf1, n1, MPI_INT, dest, 4, comm, &r[0] );
+       MPI_Cancel( &r[0] );
+       memset( s, -3, sizeof(s) );
+       s[0].MPI_ERROR = -3;
+       s[1].MPI_ERROR = -3;
+       MPI_Testall( 2, r, &tflag, s );
+       if (tflag) {
+           MPI_Test_cancelled( &s[0], &flag );
+           if (!flag) {
+               errs++;
+               printf( "send request 0 was not cancelled!\n" );
+           }
+           MPI_Test_cancelled( &s[1], &flag );
+           if (flag) {
+               errs++;
+               printf( "send request 1 was cancelled!\n" );
+           }
+       }
+       else {
+           /* If all requests are not complete, then neither r nor s 
+              may be changed */
+           if ( (s[0].MPI_ERROR) != -3) {
+               errs++;
+               printf( "Send request status 0 modified. s[0].MPI_ERROR = %x\n",
+                       s[0].MPI_ERROR );
+           }
+           if ( (s[1].MPI_ERROR) != -3) {
+               errs++;
+               printf( "Send request status 1 modified. s[1].MPI_ERROR = %x\n",
+                       s[1].MPI_ERROR );
+           }
+       }
+       MPI_Barrier( comm );
+       while (!tflag) {
+           MPI_Testall( 2, r, &tflag, s );
+       }
+       MPI_Test_cancelled( &s[0], &flag );
+       if (!flag) {
+           errs++;
+           printf( "send request 0 was not cancelled!\n" );
+       }
+       MPI_Test_cancelled( &s[1], &flag );
+       if (flag) {
+           errs++;
+           printf( "send request 1 was cancelled!\n" );
+       }
+    }
+    if (rank != src && rank != dest) {
+       MPI_Barrier( comm );
+       MPI_Barrier( comm );
+       MPI_Barrier( comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/eagerdt.c b/teshsuite/smpi/mpich3-test/pt2pt/eagerdt.c
new file mode 100644 (file)
index 0000000..4adc26c
--- /dev/null
@@ -0,0 +1,77 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of a large number of derived-datatype messages eagerly, with no preposted receive so that an MPI implementation may have to queue up messages on the sending side";
+*/
+
+#define MAX_MSGS 30
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, dest, source;
+    int i, indices[40];
+    MPI_Aint extent;
+    int *buf, *bufs[MAX_MSGS];
+    MPI_Comm      comm;
+    MPI_Datatype  dtype;
+    MPI_Request   req[MAX_MSGS];
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    source = 0;
+    dest   = size - 1;
+    
+    /* Setup by creating a blocked datatype that is likely to be processed
+       in a piecemeal fashion */
+    for (i=0; i<30; i++) {
+       indices[i] = i*40;
+    }
+
+    /* 30 blocks of size 10 */
+    MPI_Type_create_indexed_block( 30, 10, indices, MPI_INT, &dtype );
+    MPI_Type_commit( &dtype );
+    
+    /* Create the corresponding message buffers */
+    MPI_Type_extent( dtype, &extent );
+    for (i=0; i<MAX_MSGS; i++) {
+       bufs[i] = (int *)malloc( extent );
+       if (!bufs[i]) {
+           fprintf( stderr, "Unable to allocate buffer %d of size %ld\n", 
+                       i, (long)extent );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+    }
+    buf = (int *)malloc( 10 * 30 * sizeof(int) );
+    
+    MPI_Barrier( MPI_COMM_WORLD );
+    if (rank == dest) {
+       MTestSleep( 2 );
+       for (i=0; i<MAX_MSGS; i++) {
+           MPI_Recv( buf, 10*30, MPI_INT, source, i, comm, 
+                     MPI_STATUS_IGNORE );
+       }
+    }
+    else if (rank == source ) {
+       for (i=0; i<MAX_MSGS; i++) {
+           MPI_Isend( bufs[i], 1, dtype, dest, i, comm, &req[i] );
+       }
+       MPI_Waitall( MAX_MSGS, req, MPI_STATUSES_IGNORE );
+    }
+
+    MPI_Type_free( &dtype );
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/greq1.c b/teshsuite/smpi/mpich3-test/pt2pt/greq1.c
new file mode 100644 (file)
index 0000000..675f072
--- /dev/null
@@ -0,0 +1,86 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple test of generalized requests";
+*/
+
+
+int query_fn( void *extra_state, MPI_Status *status );
+int query_fn( void *extra_state, MPI_Status *status )
+{
+    /* Set a default status */
+    status->MPI_SOURCE = MPI_UNDEFINED;
+    status->MPI_TAG    = MPI_UNDEFINED;
+    MPI_Status_set_cancelled( status, 0 );
+    MPI_Status_set_elements( status, MPI_BYTE, 0 );
+    return 0;
+}
+int free_fn( void *extra_state );
+int free_fn( void *extra_state )
+{
+    int *b = (int *)extra_state;
+    if (b) *b = *b - 1;
+    /* The value returned by the free function is the error code
+       returned by the wait/test function */
+    return 0;
+}
+int cancel_fn( void *extra_state, int complete );
+int cancel_fn( void *extra_state, int complete )
+{
+    return 0;
+}
+
+/*
+ * This is a very simple test of generalized requests.  Normally, the
+ * MPI_Grequest_complete function would be called from another routine,
+ * often running in a separate thread.  This simple code allows us to
+ * check that requests can be created, tested, and waited on in the
+ * case where the request is complete before the wait is called.  
+ *
+ * Note that MPI did *not* define a routine that can be called within
+ * test or wait to advance the state of a generalized request.  
+ * Most uses of generalized requests will need to use a separate thread.
+ */
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int counter, flag;
+    MPI_Status    status;
+    MPI_Request   request;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Grequest_start( query_fn, free_fn, cancel_fn, NULL, &request );
+    
+    MPI_Test( &request, &flag, &status );
+    if (flag) {
+       errs++;
+       fprintf( stderr, "Generalized request marked as complete\n" );
+    }
+
+    MPI_Grequest_complete( request );
+
+    MPI_Wait( &request, &status );
+
+    counter = 1;
+    MPI_Grequest_start( query_fn, free_fn, cancel_fn, &counter, &request );
+    MPI_Grequest_complete( request );
+    MPI_Wait( &request, MPI_STATUS_IGNORE );
+    
+    if (counter) {
+       errs++;
+       fprintf( stderr, "Free routine not called, or not called with extra_data" );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/icsend.c b/teshsuite/smpi/mpich3-test/pt2pt/icsend.c
new file mode 100644 (file)
index 0000000..ae196ef
--- /dev/null
@@ -0,0 +1,72 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Simple test of intercommunicator send and receive";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int leftGroup, buf, rank, remote_size, i;
+    MPI_Comm comm;
+    MPI_Status status;
+
+    MTest_Init( &argc, &argv );
+
+    while (MTestGetIntercomm( &comm, &leftGroup, 4 )) {
+        if (comm == MPI_COMM_NULL) continue;
+
+       if (leftGroup) {
+           MPI_Comm_rank( comm, &rank );
+           buf = rank;
+           MPI_Send( &buf, 1, MPI_INT, 0, 0, comm );
+       }
+       else {
+           MPI_Comm_remote_size( comm, &remote_size );
+           MPI_Comm_rank( comm, &rank );
+           if (rank == 0) {
+               for (i=0; i<remote_size; i++) {
+                   buf = -1;
+                   MPI_Recv( &buf, 1, MPI_INT, i, 0, comm, &status );
+                   if (buf != i) {
+                       errs++;
+                       fprintf( stderr, "buf = %d, should be %d\n", buf, i );
+                   }
+               }
+           }
+       }
+       /* Now, reverse it and send back */
+       if (!leftGroup) {
+           MPI_Comm_rank( comm, &rank );
+           buf = rank;
+           MPI_Send( &buf, 1, MPI_INT, 0, 0, comm );
+       }
+       else {
+           MPI_Comm_remote_size( comm, &remote_size );
+           MPI_Comm_rank( comm, &rank );
+           if (rank == 0) {
+               for (i=0; i<remote_size; i++) {
+                   buf = -1;
+                   MPI_Recv( &buf, 1, MPI_INT, i, 0, comm, &status );
+                   if (buf != i) {
+                       errs++;
+                       fprintf( stderr, "buf = %d, should be %d\n", buf, i );
+                   }
+               }
+           }
+       }
+        MTestFreeComm(&comm);
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/inactivereq.c b/teshsuite/smpi/mpich3-test/pt2pt/inactivereq.c
new file mode 100644 (file)
index 0000000..1f4b6af
--- /dev/null
@@ -0,0 +1,166 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2005 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/* This test program checks that the point-to-point completion routines
+   can be applied to an inactive persistent request, as required by the 
+   MPI-1 standard. See section 3.7.3, for example, 
+
+   One is allowed to call MPI TEST with a null or inactive request argument. 
+   In such a case the operation returns with flag = true and empty status.
+
+*/
+
+int StatusEmpty( MPI_Status *s );
+int StatusEmpty( MPI_Status *s )
+{
+    int errs = 0;
+    int count = 10;
+
+    if (s->MPI_TAG != MPI_ANY_TAG) {
+       errs++;
+       printf( "MPI_TAG not MPI_ANY_TAG in status\n" );
+    }
+    if (s->MPI_SOURCE != MPI_ANY_SOURCE) {
+       errs++;
+       printf( "MPI_SOURCE not MPI_ANY_SOURCE in status\n" );
+    }
+    MPI_Get_count( s, MPI_INT, &count );
+    if (count != 0) {
+       errs++;
+       printf( "count in status is not 0\n" );
+    }
+    /* Return true only if status passed all tests */
+    return errs ? 0 : 1;
+}
+
+int main(int argc, char *argv[])
+{
+    MPI_Request r;
+    MPI_Status  s;
+    int errs = 0;
+    int flag;
+    int buf[10];
+    int rbuf[10];
+    int tag = 27;
+    int dest = 0;
+    int rank, size;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+
+    /* Create a persistent send request */
+    MPI_Send_init( buf, 10, MPI_INT, dest, tag, MPI_COMM_WORLD, &r );
+
+    flag = 0;
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Test( &r, &flag, &s );
+    if (!flag) {
+       errs++;
+       printf( "Flag not true after MPI_Test (send)\n" );
+       printf( "Aborting further tests to avoid hanging in MPI_Wait\n" );
+       MTest_Finalize( errs );
+       MPI_Finalize();
+       return 0;
+    }
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Test (send)\n" );
+    }
+
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Wait( &r, &s );
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Wait (send)\n" );
+    }
+
+    /* Now try to use that request, then check again */
+    if (rank == 0) {
+       int i;
+       MPI_Request *rr = (MPI_Request *)malloc(size * sizeof(MPI_Request));
+       for (i=0; i<size; i++) {
+           MPI_Irecv( rbuf, 10, MPI_INT, i, tag, MPI_COMM_WORLD, &rr[i] );
+       }
+       MPI_Start( &r );
+       MPI_Wait( &r, &s );
+       MPI_Waitall( size, rr, MPI_STATUSES_IGNORE );
+    }
+    else {
+       MPI_Start( &r );
+       MPI_Wait( &r, &s );
+    }
+
+    flag = 0;
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Test( &r, &flag, &s );
+    if (!flag) {
+       errs++;
+       printf( "Flag not true after MPI_Test (send)\n" );
+       printf( "Aborting further tests to avoid hanging in MPI_Wait\n" );
+       MTest_Finalize( errs );
+       MPI_Finalize();
+       return 0;
+    }
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Test (send)\n" );
+    }
+
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Wait( &r, &s );
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Wait (send)\n" );
+    }
+
+    
+
+    MPI_Request_free( &r );
+
+    /* Create a persistent receive request */
+    MPI_Recv_init( buf, 10, MPI_INT, dest, tag, MPI_COMM_WORLD, &r );
+
+    flag = 0;
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Test( &r, &flag, &s );
+    if (!flag) {
+       errs++;
+       printf( "Flag not true after MPI_Test (recv)\n" );
+       printf( "Aborting further tests to avoid hanging in MPI_Wait\n" );
+       MTest_Finalize( errs );
+       MPI_Finalize();
+       return 0;
+    }
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Test (recv)\n" );
+    }
+
+    s.MPI_TAG = 10;
+    s.MPI_SOURCE = 10;
+    MPI_Wait( &r, &s );
+    if (!StatusEmpty( &s )) {
+       errs++;
+       printf( "Status not empty after MPI_Wait (recv)\n" );
+    }
+
+    MPI_Request_free( &r );
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/isendself.c b/teshsuite/smpi/mpich3-test/pt2pt/isendself.c
new file mode 100644 (file)
index 0000000..29f98ce
--- /dev/null
@@ -0,0 +1,58 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int main( int argc, char *argv[] )
+{
+    int a[10], b[10], i;
+    MPI_Status status;
+    MPI_Request request;
+    int rank, count;
+    int errs = 0;
+    
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    
+    for (i=0; i<10; i++) a[i] = i+1;
+
+    status.MPI_ERROR = 0;
+    MPI_Isend( a, 0, MPI_INT, rank, 0, MPI_COMM_WORLD, &request );
+    MPI_Recv( b, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
+             &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (status.MPI_SOURCE != rank ||
+       status.MPI_TAG != 0 ||
+       status.MPI_ERROR != 0 ||
+       count != 0) {
+       errs++;
+       printf ("1 status = %d %d %d %d\n", status.MPI_SOURCE, status.MPI_TAG,
+               status.MPI_ERROR, count );
+    }
+    /* printf( "b[0] = %d\n", b[0] );*/
+    MPI_Wait( &request, &status );
+
+    MPI_Isend( 0, 0, MPI_INT, rank, 0, MPI_COMM_WORLD, &request );
+    MPI_Recv( 0, 0, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD,
+             &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (status.MPI_SOURCE != rank ||
+       status.MPI_TAG != 0 ||
+       status.MPI_ERROR != 0 ||
+       count != 0) {
+       errs++;
+       printf ("2 status = %d %d %d %d\n", status.MPI_SOURCE, status.MPI_TAG,
+               status.MPI_ERROR, count );
+    }
+    MPI_Wait( &request, &status );
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/isendselfprobe.c b/teshsuite/smpi/mpich3-test/pt2pt/isendselfprobe.c
new file mode 100644 (file)
index 0000000..1b3c6c0
--- /dev/null
@@ -0,0 +1,47 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+int main( int argc, char * argv[] )
+{
+    int rank;
+    int sendMsg = 123;
+    int recvMsg = 0;
+    int flag = 0;
+    int count;
+    MPI_Status status;
+    MPI_Request request;
+    int errs = 0;
+
+    MTest_Init( &argc, &argv );
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if(rank == 0)
+    {
+       MPI_Isend( &sendMsg, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &request );
+       while(!flag)
+       {
+           MPI_Iprobe( 0, 0, MPI_COMM_WORLD, &flag, &status );
+       }
+       MPI_Get_count( &status, MPI_INT, &count );
+       if(count != 1)
+       {
+           errs++;
+       }
+       MPI_Recv( &recvMsg, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &status );
+       if(recvMsg != 123)
+       {
+           errs++;
+       }
+       MPI_Wait( &request, &status );
+    }
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/large_message.c b/teshsuite/smpi/mpich3-test/pt2pt/large_message.c
new file mode 100644 (file)
index 0000000..b8a6d09
--- /dev/null
@@ -0,0 +1,69 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2010 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/* tests send/recv of a message > 2GB. count=270M, type=long long 
+   run with 3 processes to exercise both shared memory and TCP in Nemesis tests*/
+
+int main(int argc, char *argv[]) 
+{
+  int        /* ierr, */ i,size,rank;
+  int        cnt = 270000000;
+  MPI_Status status;
+  long long  *cols;
+  int errs = 0;
+
+
+  MTest_Init(&argc,&argv); 
+
+/* need large memory */
+  if (sizeof(void *) < 8) {
+      MTest_Finalize(errs);
+      MPI_Finalize();
+      return 0;
+  }
+
+  /* ierr = */ MPI_Comm_size(MPI_COMM_WORLD,&size);
+  /* ierr = */ MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+  if (size != 3) {
+    fprintf(stderr,"[%d] usage: mpiexec -n 3 %s\n",rank,argv[0]);
+    MPI_Abort(MPI_COMM_WORLD,1);
+  }
+
+  cols = malloc(cnt*sizeof(long long));
+  if (cols == NULL) {
+      printf("malloc of >2GB array failed\n");
+      errs++;
+      MTest_Finalize(errs);
+      MPI_Finalize();
+      return 0;
+  }
+
+  if (rank == 0) {
+    for (i=0; i<cnt; i++) cols[i] = i;
+    /* printf("[%d] sending...\n",rank);*/
+    /* ierr = */ MPI_Send(cols,cnt,MPI_LONG_LONG_INT,1,0,MPI_COMM_WORLD);
+    /* ierr = */ MPI_Send(cols,cnt,MPI_LONG_LONG_INT,2,0,MPI_COMM_WORLD);
+  } else {
+      /* printf("[%d] receiving...\n",rank); */
+    for (i=0; i<cnt; i++) cols[i] = -1;
+    /* ierr = */ MPI_Recv(cols,cnt,MPI_LONG_LONG_INT,0,0,MPI_COMM_WORLD,&status);
+    /* ierr = MPI_Get_count(&status,MPI_LONG_LONG_INT,&cnt);
+       Get_count still fails because status.count is not 64 bit */
+    for (i=0; i<cnt; i++) {
+        if (cols[i] != i) {
+            /*printf("Rank %d, cols[i]=%lld, should be %d\n", rank, cols[i], i);*/
+            errs++;
+        }
+    }
+  }
+  MTest_Finalize(errs);
+  MPI_Finalize();
+  return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/mprobe.c b/teshsuite/smpi/mpich3-test/pt2pt/mprobe.c
new file mode 100644 (file)
index 0000000..c48d871
--- /dev/null
@@ -0,0 +1,397 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* This is a temporary #ifdef to control whether we test this functionality.  A
+ * configure-test or similar would be better.  Eventually the MPI-3 standard
+ * will be released and this can be gated on a MPI_VERSION check */
+#if !defined(USE_STRICT_MPI) && defined(MPICH)
+#define TEST_MPROBE_ROUTINES 1
+#endif
+
+/* assert-like macro that bumps the err count and emits a message */
+#define check(x_)                                                                 \
+    do {                                                                          \
+        if (!(x_)) {                                                              \
+            ++errs;                                                               \
+            if (errs < 10) {                                                      \
+                fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
+            }                                                                     \
+        }                                                                         \
+    } while (0)
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+    int rank, size;
+#ifdef TEST_MPROBE_ROUTINES
+    int found, completed;
+    int sendbuf[8], recvbuf[8];
+    int count;
+    MPI_Message msg;
+    MPI_Request rreq;
+    MPI_Status s1, s2;
+#endif
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    if (size < 2) {
+        printf("this test requires at least 2 processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+    /* all processes besides ranks 0 & 1 aren't used by this test */
+    if (rank >= 2) {
+        goto epilogue;
+    }
+
+#ifdef TEST_MPROBE_ROUTINES
+    /* test 0: simple send & mprobe+mrecv */
+    if (rank == 0) {
+        sendbuf[0] = 0xdeadbeef;
+        sendbuf[1] = 0xfeedface;
+        MPI_Send(sendbuf, 2, MPI_INT, 1, 5, MPI_COMM_WORLD);
+    }
+    else {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        MPI_Mprobe(0, 5, MPI_COMM_WORLD, &msg, &s1);
+        check(s1.MPI_SOURCE == 0);
+        check(s1.MPI_TAG == 5);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        check(msg != MPI_MESSAGE_NULL);
+
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 2);
+
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Mrecv(recvbuf, count, MPI_INT, &msg, &s2);
+        check(recvbuf[0] == 0xdeadbeef);
+        check(recvbuf[1] == 0xfeedface);
+        check(s2.MPI_SOURCE == 0);
+        check(s2.MPI_TAG == 5);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+    }
+
+    /* test 1: simple send & mprobe+imrecv */
+    if (rank == 0) {
+        sendbuf[0] = 0xdeadbeef;
+        sendbuf[1] = 0xfeedface;
+        MPI_Send(sendbuf, 2, MPI_INT, 1, 5, MPI_COMM_WORLD);
+    }
+    else {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        MPI_Mprobe(0, 5, MPI_COMM_WORLD, &msg, &s1);
+        check(s1.MPI_SOURCE == 0);
+        check(s1.MPI_TAG == 5);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        check(msg != MPI_MESSAGE_NULL);
+
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 2);
+
+        rreq = MPI_REQUEST_NULL;
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Imrecv(recvbuf, count, MPI_INT, &msg, &rreq);
+        check(rreq != MPI_REQUEST_NULL);
+        MPI_Wait(&rreq, &s2);
+        check(recvbuf[0] == 0xdeadbeef);
+        check(recvbuf[1] == 0xfeedface);
+        check(s2.MPI_SOURCE == 0);
+        check(s2.MPI_TAG == 5);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+    }
+
+    /* test 2: simple send & improbe+mrecv */
+    if (rank == 0) {
+        sendbuf[0] = 0xdeadbeef;
+        sendbuf[1] = 0xfeedface;
+        MPI_Send(sendbuf, 2, MPI_INT, 1, 5, MPI_COMM_WORLD);
+    }
+    else {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        do {
+            check(msg == MPI_MESSAGE_NULL);
+            MPI_Improbe(0, 5, MPI_COMM_WORLD, &found, &msg, &s1);
+        } while (!found);
+        check(msg != MPI_MESSAGE_NULL);
+        check(s1.MPI_SOURCE == 0);
+        check(s1.MPI_TAG == 5);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 2);
+
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Mrecv(recvbuf, count, MPI_INT, &msg, &s2);
+        check(recvbuf[0] == 0xdeadbeef);
+        check(recvbuf[1] == 0xfeedface);
+        check(s2.MPI_SOURCE == 0);
+        check(s2.MPI_TAG == 5);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+    }
+
+    /* test 3: simple send & improbe+imrecv */
+    if (rank == 0) {
+        sendbuf[0] = 0xdeadbeef;
+        sendbuf[1] = 0xfeedface;
+        MPI_Send(sendbuf, 2, MPI_INT, 1, 5, MPI_COMM_WORLD);
+    }
+    else {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        do {
+            check(msg == MPI_MESSAGE_NULL);
+            MPI_Improbe(0, 5, MPI_COMM_WORLD, &found, &msg, &s1);
+        } while (!found);
+        check(msg != MPI_MESSAGE_NULL);
+        check(s1.MPI_SOURCE == 0);
+        check(s1.MPI_TAG == 5);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 2);
+
+        rreq = MPI_REQUEST_NULL;
+        MPI_Imrecv(recvbuf, count, MPI_INT, &msg, &rreq);
+        check(rreq != MPI_REQUEST_NULL);
+        MPI_Wait(&rreq, &s2);
+        check(recvbuf[0] == 0xdeadbeef);
+        check(recvbuf[1] == 0xfeedface);
+        check(s2.MPI_SOURCE == 0);
+        check(s2.MPI_TAG == 5);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+    }
+
+    /* test 4: mprobe+mrecv with MPI_PROC_NULL */
+    {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &msg, &s1);
+        check(s1.MPI_SOURCE == MPI_PROC_NULL);
+        check(s1.MPI_TAG == MPI_ANY_TAG);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        check(msg == MPI_MESSAGE_NO_PROC);
+
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 0);
+
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Mrecv(recvbuf, count, MPI_INT, &msg, &s2);
+        /* recvbuf should remain unmodified */
+        check(recvbuf[0] == 0x01234567);
+        check(recvbuf[1] == 0x89abcdef);
+        /* should get back "proc null status" */
+        check(s2.MPI_SOURCE == MPI_PROC_NULL);
+        check(s2.MPI_TAG == MPI_ANY_TAG);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+        count = -1;
+        MPI_Get_count(&s2, MPI_INT, &count);
+        check(count == 0);
+    }
+
+    /* test 5: mprobe+imrecv with MPI_PROC_NULL */
+    {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        MPI_Mprobe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &msg, &s1);
+        check(s1.MPI_SOURCE == MPI_PROC_NULL);
+        check(s1.MPI_TAG == MPI_ANY_TAG);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        check(msg == MPI_MESSAGE_NO_PROC);
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 0);
+
+        rreq = MPI_REQUEST_NULL;
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Imrecv(recvbuf, count, MPI_INT, &msg, &rreq);
+        check(rreq != MPI_REQUEST_NULL);
+        completed = 0;
+        MPI_Test(&rreq, &completed, &s2); /* single test should always succeed */
+        check(completed);
+        /* recvbuf should remain unmodified */
+        check(recvbuf[0] == 0x01234567);
+        check(recvbuf[1] == 0x89abcdef);
+        /* should get back "proc null status" */
+        check(s2.MPI_SOURCE == MPI_PROC_NULL);
+        check(s2.MPI_TAG == MPI_ANY_TAG);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+        count = -1;
+        MPI_Get_count(&s2, MPI_INT, &count);
+        check(count == 0);
+    }
+
+    /* test 6: improbe+mrecv with MPI_PROC_NULL */
+    {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        found = 0;
+        MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &found, &msg, &s1);
+        check(found);
+        check(msg == MPI_MESSAGE_NO_PROC);
+        check(s1.MPI_SOURCE == MPI_PROC_NULL);
+        check(s1.MPI_TAG == MPI_ANY_TAG);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 0);
+
+        recvbuf[0] = 0x01234567;
+        recvbuf[1] = 0x89abcdef;
+        MPI_Mrecv(recvbuf, count, MPI_INT, &msg, &s2);
+        /* recvbuf should remain unmodified */
+        check(recvbuf[0] == 0x01234567);
+        check(recvbuf[1] == 0x89abcdef);
+        /* should get back "proc null status" */
+        check(s2.MPI_SOURCE == MPI_PROC_NULL);
+        check(s2.MPI_TAG == MPI_ANY_TAG);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+        count = -1;
+        MPI_Get_count(&s2, MPI_INT, &count);
+        check(count == 0);
+    }
+
+    /* test 7: improbe+imrecv */
+    {
+        memset(&s1, 0xab, sizeof(MPI_Status));
+        memset(&s2, 0xab, sizeof(MPI_Status));
+        /* the error field should remain unmodified */
+        s1.MPI_ERROR = MPI_ERR_DIMS;
+        s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
+
+        msg = MPI_MESSAGE_NULL;
+        MPI_Improbe(MPI_PROC_NULL, 5, MPI_COMM_WORLD, &found, &msg, &s1);
+        check(found);
+        check(msg == MPI_MESSAGE_NO_PROC);
+        check(s1.MPI_SOURCE == MPI_PROC_NULL);
+        check(s1.MPI_TAG == MPI_ANY_TAG);
+        check(s1.MPI_ERROR == MPI_ERR_DIMS);
+        count = -1;
+        MPI_Get_count(&s1, MPI_INT, &count);
+        check(count == 0);
+
+        rreq = MPI_REQUEST_NULL;
+        MPI_Imrecv(recvbuf, count, MPI_INT, &msg, &rreq);
+        check(rreq != MPI_REQUEST_NULL);
+        completed = 0;
+        MPI_Test(&rreq, &completed, &s2); /* single test should always succeed */
+        check(completed);
+        /* recvbuf should remain unmodified */
+        check(recvbuf[0] == 0x01234567);
+        check(recvbuf[1] == 0x89abcdef);
+        /* should get back "proc null status" */
+        check(s2.MPI_SOURCE == MPI_PROC_NULL);
+        check(s2.MPI_TAG == MPI_ANY_TAG);
+        check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
+        check(msg == MPI_MESSAGE_NULL);
+        count = -1;
+        MPI_Get_count(&s2, MPI_INT, &count);
+        check(count == 0);
+    }
+
+    /* TODO MPI_ANY_SOURCE and MPI_ANY_TAG should be tested as well */
+    /* TODO a full range of message sizes should be tested too */
+    /* TODO threaded tests are also needed, but they should go in a separate
+     * program */
+
+    /* simple test to ensure that c2f/f2c routines are present (initially missed
+     * in MPICH impl) */
+    {
+        MPI_Fint f_handle = 0xdeadbeef;
+        f_handle = MPI_Message_c2f(MPI_MESSAGE_NULL);
+        msg = MPI_Message_f2c(f_handle);
+        check(f_handle != 0xdeadbeef);
+        check(msg == MPI_MESSAGE_NULL);
+
+        /* PMPI_ versions should also exists */
+        f_handle = 0xdeadbeef;
+        f_handle = PMPI_Message_c2f(MPI_MESSAGE_NULL);
+        msg = PMPI_Message_f2c(f_handle);
+        check(f_handle != 0xdeadbeef);
+        check(msg == MPI_MESSAGE_NULL);
+    }
+
+#endif /* TEST_MPROBE_ROUTINES */
+
+epilogue:
+    MPI_Reduce((rank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+    if (rank == 0) {
+        if (errs) {
+            printf("found %d errors\n", errs);
+        }
+        else {
+            printf(" No errors\n");
+        }
+    }
+
+    MPI_Finalize();
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/pingping.c b/teshsuite/smpi/mpich3-test/pt2pt/pingping.c
new file mode 100644 (file)
index 0000000..95f6e39
--- /dev/null
@@ -0,0 +1,111 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Send flood test";
+*/
+
+#define MAX_MSG_SIZE 40000000
+#define MAX_COUNT    4000
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size, source, dest;
+    int minsize = 2, count, nmsg, maxmsg; 
+    MPI_Comm      comm;
+    MTestDatatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       source = 0;
+       dest   = size - 1;
+       
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < MAX_COUNT; count = count * 2) {
+           while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
+               int nbytes;
+               MPI_Type_size( sendtype.datatype, &nbytes );
+
+               /* We may want to limit the total message size sent */
+               if (nbytes > MAX_MSG_SIZE) {
+                   /* We do not need to free, as we haven't 
+                      initialized any of the buffers (?) */
+                   continue;
+               }
+               maxmsg = MAX_COUNT - count;
+               MTestPrintfMsg( 1, "Sending count = %d of sendtype %s of total size %d bytes\n", 
+                               count, MTestGetDatatypeName( &sendtype ), 
+                               nbytes*count );
+               /* Make sure that everyone has a recv buffer */
+               recvtype.InitBuf( &recvtype );
+
+               if (rank == source) {
+                   sendtype.InitBuf( &sendtype );
+                   
+                   for (nmsg=1; nmsg<maxmsg; nmsg++) {
+                       err = MPI_Send( sendtype.buf, sendtype.count, 
+                                       sendtype.datatype, dest, 0, comm);
+                       if (err) {
+                           errs++;
+                           if (errs < 10) {
+                               MTestPrintError( err );
+                           }
+                       }
+                   }
+               }
+               else if (rank == dest) {
+                   for (nmsg=1; nmsg<maxmsg; nmsg++) {
+                       err = MPI_Recv( recvtype.buf, recvtype.count, 
+                                       recvtype.datatype, source, 0, 
+                                       comm, MPI_STATUS_IGNORE);
+                       if (err) {
+                           errs++;
+                           if (errs < 10) {
+                               MTestPrintError( err );
+                           }
+                       }
+
+                       err = MTestCheckRecv( 0, &recvtype );
+                       if (err) {
+                           if (errs < 10) {
+                               printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d, message iteration %d of %d\n", 
+                                       MTestGetDatatypeName( &recvtype ),
+                                       MTestGetDatatypeName( &sendtype ),
+                                       count, nmsg, maxmsg );
+                               recvtype.printErrors = 1;
+                               (void)MTestCheckRecv( 0, &recvtype );
+                           }
+                           errs += err;
+                       }
+                   }
+               }
+               MTestFreeDatatype( &recvtype );
+               MTestFreeDatatype( &sendtype );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/probe-unexp.c b/teshsuite/smpi/mpich3-test/pt2pt/probe-unexp.c
new file mode 100644 (file)
index 0000000..43e2ed8
--- /dev/null
@@ -0,0 +1,160 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+#define MAX_BUF_SIZE_LG 22
+#define NUM_MSGS_PER_BUF_SIZE 5
+char buf[1 << MAX_BUF_SIZE_LG];
+
+/* 
+ * This program verifies that MPI_Probe() is operating properly in the face of
+ * unexpected messages arriving after MPI_Probe() has
+ * been called.  This program may hang if MPI_Probe() does not return when the
+ * message finally arrives (see req #375).
+ */
+int main(int argc, char **argv)
+{
+    int p_size;
+    int p_rank;
+    int msg_size_lg;
+    int errs = 0;
+    int mpi_errno;
+    
+    MTest_Init(&argc, &argv);
+
+    MPI_Comm_size(MPI_COMM_WORLD, &p_size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &p_rank);
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+
+    for (msg_size_lg = 0; msg_size_lg <= MAX_BUF_SIZE_LG; msg_size_lg++)
+    {
+       const int msg_size = 1 << msg_size_lg;
+       int msg_cnt;
+
+       MTestPrintfMsg( 2, "testing messages of size %d\n", msg_size );
+       for (msg_cnt = 0; msg_cnt < NUM_MSGS_PER_BUF_SIZE; msg_cnt++)
+        {
+           MPI_Status status;
+           const int tag = msg_size_lg * NUM_MSGS_PER_BUF_SIZE + msg_cnt;
+           
+           MTestPrintfMsg( 2, "Message count %d\n", msg_cnt );
+           if (p_rank == 0)
+           {
+               int p;
+               
+               for (p = 1; p < p_size; p ++)
+               {
+                   /* Wait for synchronization message */
+                   mpi_errno = MPI_Recv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE, 
+                                        tag, MPI_COMM_WORLD, &status);
+                   if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+                   {
+                       MTestPrintError(mpi_errno);
+                   }
+                   
+                   if (status.MPI_TAG != tag && errs++ < 10)
+                   {
+                       printf("ERROR: unexpected message tag from MPI_Recv(): lp=0, rp=%d, expected=%d, actual=%d, count=%d\n",
+                              status.MPI_SOURCE, status.MPI_TAG, tag, msg_cnt);
+                   }
+
+#                  if defined(VERBOSE)
+                   {
+                       printf("sending message: p=%d s=%d c=%d\n", 
+                              status.MPI_SOURCE, msg_size, msg_cnt);
+                   }
+#                  endif
+                   
+                   /* Send unexpected message which hopefully MPI_Probe() is 
+                      already waiting for at the remote process */
+                   mpi_errno = MPI_Send (buf, msg_size, MPI_BYTE, 
+                           status.MPI_SOURCE, status.MPI_TAG, MPI_COMM_WORLD);
+                   if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+                   {
+                       MTestPrintError(mpi_errno);
+                   }
+               }
+           }
+           else
+           {
+               int incoming_msg_size;
+
+               /* Send synchronization message */
+               mpi_errno = MPI_Send(NULL, 0, MPI_BYTE, 0, tag, MPI_COMM_WORLD);
+               if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+               {
+                   MTestPrintError(mpi_errno);
+               }
+
+               /* Perform probe, hopefully before the master process can 
+                  send its reply */
+               mpi_errno = MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, 
+                                     MPI_COMM_WORLD, &status);
+               if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+               {
+                   MTestPrintError(mpi_errno);
+               }
+               mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
+               if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+               {
+                   MTestPrintError(mpi_errno);
+               }
+               if (status.MPI_SOURCE != 0 && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message source from MPI_Probe(): p=%d, expected=0, actual=%d, count=%d\n",
+                          p_rank, status.MPI_SOURCE, msg_cnt);
+               }
+               if (status.MPI_TAG != tag && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message tag from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
+                          p_rank, tag, status.MPI_TAG, msg_cnt);
+               }
+               if (incoming_msg_size != msg_size && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message size from MPI_Probe(): p=%d, expected=%d, actual=%d, count=%d\n",
+                          p_rank, msg_size, incoming_msg_size, msg_cnt);
+               }
+
+               /* Receive the probed message from the master process */
+               mpi_errno = MPI_Recv(buf, msg_size, MPI_BYTE, 0, tag, 
+                                    MPI_COMM_WORLD, &status);
+               if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+               {
+                   MTestPrintError(mpi_errno);
+               }
+               mpi_errno = MPI_Get_count(&status, MPI_BYTE, &incoming_msg_size);
+               if (mpi_errno != MPI_SUCCESS && errs++ < 10)
+               {
+                   MTestPrintError(mpi_errno);
+               }
+               if (status.MPI_SOURCE != 0 && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message source from MPI_Recv(): p=%d, expected=0, actual=%d, count=%d\n",
+                          p_rank, status.MPI_SOURCE, msg_cnt);
+               }
+               if (status.MPI_TAG != tag && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message tag from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
+                          p_rank, tag, status.MPI_TAG, msg_cnt);
+               }
+               if (incoming_msg_size != msg_size && errs++ < 10)
+               {
+                   printf("ERROR: unexpected message size from MPI_Recv(): p=%d, expected=%d, actual=%d, count=%d\n",
+                          p_rank, msg_size, incoming_msg_size, msg_cnt);
+               }
+           }
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/probenull.c b/teshsuite/smpi/mpich3-test/pt2pt/probenull.c
new file mode 100644 (file)
index 0000000..5479605
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2005 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* 
+ * This program checks that MPI_Iprobe and MPI_Probe correctly handle
+ * a source of MPI_PROC_NULL
+ */
+
+int main(int argc, char **argv)
+{
+    int flag;
+    int errs = 0;
+    MPI_Status status;
+
+    MTest_Init(&argc, &argv);
+
+    MPI_Iprobe( MPI_PROC_NULL, 10, MPI_COMM_WORLD, &flag, &status );
+    if (!flag) {
+       errs++;
+       printf( "Iprobe of source=MPI_PROC_NULL returned flag=false\n" );
+    }
+    else {
+       if (status.MPI_SOURCE != MPI_PROC_NULL) {
+           printf( "Status.MPI_SOURCE was %d, should be MPI_PROC_NULL\n",
+                   status.MPI_SOURCE );
+           errs++;
+       }
+       if (status.MPI_TAG    != MPI_ANY_TAG) {
+           printf( "Status.MPI_TAG was %d, should be MPI_ANY_TAGL\n",
+                   status.MPI_TAG );
+           errs++;
+       }
+    }
+    /* If Iprobe failed, probe is likely to as well.  Avoid a possible hang 
+       by testing Probe only if Iprobe test passed */
+    if (errs == 0) {
+       MPI_Probe(  MPI_PROC_NULL, 10, MPI_COMM_WORLD, &status );
+       if (status.MPI_SOURCE != MPI_PROC_NULL) {
+           printf( "Status.MPI_SOURCE was %d, should be MPI_PROC_NULL\n",
+                   status.MPI_SOURCE );
+           errs++;
+       }
+       if (status.MPI_TAG    != MPI_ANY_TAG) {
+           printf( "Status.MPI_TAG was %d, should be MPI_ANY_TAGL\n",
+                   status.MPI_TAG );
+           errs++;
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/pscancel.c b/teshsuite/smpi/mpich3-test/pt2pt/pscancel.c
new file mode 100644 (file)
index 0000000..e32e5f1
--- /dev/null
@@ -0,0 +1,273 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of various send cancel calls";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, /* source, */ dest;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Request   req;
+    static int bufsizes[4] = { 1, 100, 10000, 1000000 };
+    char *buf;
+    int  cs, flag, n;
+#ifdef TEST_IRSEND
+    int veryPicky = 0;   /* Set to 1 to test "quality of implementation" in
+                           a tricky part of cancel */
+#endif
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* source = 0; */
+    dest   = size - 1;
+
+    for (cs=0; cs<4; cs++) {
+       if (rank == 0) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MPI_Send_init( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
+           MPI_Start( &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel a persistent send request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           MPI_Request_free( &req );
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+1;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+
+       if (rank == 0) {
+           char *bsendbuf;
+           int bsendbufsize;
+           int bf, bs;
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           bsendbufsize = n + MPI_BSEND_OVERHEAD;
+           bsendbuf = (char *)malloc( bsendbufsize );
+           if (!bsendbuf) {
+               fprintf( stderr, "Unable to allocate %d bytes for bsend\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MPI_Buffer_attach( bsendbuf, bsendbufsize );
+           MPI_Bsend_init( buf, n, MPI_CHAR, dest, cs+n+2, comm, &req );
+           MPI_Start( &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel a persistent bsend request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           MPI_Request_free( &req );
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+2;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+           MPI_Buffer_detach( &bf, &bs );
+           free( bsendbuf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+
+       /* Because this test is erroneous, we do not perform it unless
+          TEST_IRSEND is defined.  */
+#ifdef TEST_IRSEND
+       /* We avoid ready send to self because an implementation
+          is free to detect the error in delivering a message to
+          itself without a pending receive; we could also check
+          for an error return from the MPI_Irsend */
+       if (rank == 0 && dest != rank) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MPI_Rsend_init( buf, n, MPI_CHAR, dest, cs+n+3, comm, &req );
+           MPI_Start( &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           /* This can be pretty ugly.  The standard is clear (Section 3.8)
+              that either a sent message is received or the 
+              sent message is successfully cancelled.  Since this message
+              can never be received, the cancel must complete
+              successfully.  
+
+              However, since there is no matching receive, this
+              program is erroneous.  In this case, we can't really
+              flag this as an error */
+           if (!flag && veryPicky) {
+               errs ++;
+               printf( "Failed to cancel a persistent rsend request\n" );
+               fflush(stdout);
+           }
+           if (flag)
+           {
+               n = 0;
+           }
+           MPI_Request_free( &req );
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+3;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int n, tag;
+           char *btemp;
+           MPI_Recv( &n, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (n > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( n );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", n);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, n, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+#endif
+
+       if (rank == 0) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MPI_Ssend_init( buf, n, MPI_CHAR, dest, cs+n+4, comm, &req );
+           MPI_Start( &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel a persistent ssend request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           MPI_Request_free( &req );
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+4;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/rcancel.c b/teshsuite/smpi/mpich3-test/pt2pt/rcancel.c
new file mode 100644 (file)
index 0000000..398ed9a
--- /dev/null
@@ -0,0 +1,86 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of various receive cancel calls, with multiple requests to cancel";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Request   req[4];
+    static int bufsizes[4] = { 1, 100, 10000, 1000000 };
+    char *bufs[4];
+    int  flag, i;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    source = 0;
+    dest   = size - 1;
+
+    if (rank == source) {
+       MPI_Send( MPI_BOTTOM, 0, MPI_CHAR, dest, 1, MPI_COMM_WORLD );
+    }
+    else if (rank == dest) {
+       /* Create 3 requests to cancel, plus one to use.  
+          Then receive one message and exit */ 
+       for (i=0; i<4; i++) {
+           bufs[i] = (char *) malloc( bufsizes[i] );
+           MPI_Irecv( bufs[i], bufsizes[i], MPI_CHAR, source, 
+                      i, MPI_COMM_WORLD, &req[i] );
+       }
+       /* Now, cancel them in a more interesting order, to ensure that the
+          queue operation work properly */
+       MPI_Cancel( &req[2] );
+       MPI_Wait( &req[2], &status );
+       MTestPrintfMsg( 1, "Completed wait on irecv[2]\n" );
+       MPI_Test_cancelled( &status, &flag );
+       if (!flag) {
+           errs ++;
+           printf( "Failed to cancel a Irecv[2] request\n" );
+           fflush(stdout);
+       }
+       MPI_Cancel( &req[3] );
+       MPI_Wait( &req[3], &status );
+       MTestPrintfMsg( 1, "Completed wait on irecv[3]\n" );
+       MPI_Test_cancelled( &status, &flag );
+       if (!flag) {
+           errs ++;
+           printf( "Failed to cancel a Irecv[3] request\n" );
+           fflush(stdout);
+       }
+       MPI_Cancel( &req[0] );
+       MPI_Wait( &req[0], &status );
+       MTestPrintfMsg( 1, "Completed wait on irecv[0]\n" );
+       MPI_Test_cancelled( &status, &flag );
+       if (!flag) {
+           errs ++;
+           printf( "Failed to cancel a Irecv[0] request\n" );
+           fflush(stdout);
+       }
+       MPI_Wait( &req[1], &status );
+       MPI_Test_cancelled( &status, &flag );
+       if (flag) {
+           errs ++;
+           printf( "Incorrectly cancelled Irecv[1]\n" ); fflush(stdout);
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/rqfreeb.c b/teshsuite/smpi/mpich3-test/pt2pt/rqfreeb.c
new file mode 100644 (file)
index 0000000..1a6eab1
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/* Test Ibsend and Request_free */
+int main( int argc, char *argv[] )
+{
+    MPI_Comm comm = MPI_COMM_WORLD;
+    int dest = 1, src = 0, tag = 1;
+    int s1;
+    char *buf, *bbuf;
+    int smsg[5], rmsg[5];
+    int errs = 0, rank, size;
+    int bufsize, bsize;
+
+    MTest_Init( &argc, &argv );
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    MPI_Comm_size( MPI_COMM_WORLD, &size );
+    if (src >= size || dest >= size) {
+       int r = src;
+       if (dest > r) r = dest;
+       fprintf( stderr, "This program requires %d processes\n", r-1 );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    if (rank == src) {
+       MPI_Request r;
+
+       MPI_Barrier( MPI_COMM_WORLD );
+
+       /* According to the standard, we must use the PACK_SIZE length of each
+          message in the computation of the message buffer size */
+       MPI_Pack_size( 5, MPI_INT, comm, &s1 );
+       bufsize = MPI_BSEND_OVERHEAD + s1 + 2000;
+       buf = (char *)malloc( bufsize );
+       MPI_Buffer_attach( buf, bufsize );
+
+       MTestPrintfMsg( 10, "About create and free Isend request\n" );
+       smsg[0] = 10;
+       MPI_Isend( &smsg[0], 1, MPI_INT, dest, tag, comm, &r );
+       MPI_Request_free( &r );
+       if (r != MPI_REQUEST_NULL) {
+           errs++;
+           fprintf( stderr, "Request not set to NULL after request free\n" );
+       }
+       MTestPrintfMsg( 10, "About create and free Ibsend request\n" );
+       smsg[1] = 11;
+       MPI_Ibsend( &smsg[1], 1, MPI_INT, dest, tag+1, comm, &r );
+       MPI_Request_free( &r );
+       if (r != MPI_REQUEST_NULL) {
+           errs++;
+           fprintf( stderr, "Request not set to NULL after request free\n" );
+       }
+       MTestPrintfMsg( 10, "About create and free Issend request\n" );
+       smsg[2] = 12;
+       MPI_Issend( &smsg[2], 1, MPI_INT, dest, tag+2, comm, &r );
+       MPI_Request_free( &r );
+       if (r != MPI_REQUEST_NULL) {
+           errs++;
+           fprintf( stderr, "Request not set to NULL after request free\n" );
+       }
+       MTestPrintfMsg( 10, "About create and free Irsend request\n" );
+       smsg[3] = 13;
+       MPI_Irsend( &smsg[3], 1, MPI_INT, dest, tag+3, comm, &r );
+       MPI_Request_free( &r );
+       if (r != MPI_REQUEST_NULL) {
+           errs++;
+           fprintf( stderr, "Request not set to NULL after request free\n" );
+       }
+       smsg[4] = 14;
+       MPI_Isend( &smsg[4], 1, MPI_INT, dest, tag+4, comm, &r );
+       MPI_Wait( &r, MPI_STATUS_IGNORE );
+
+       /* We can't guarantee that messages arrive until the detach */
+       MPI_Buffer_detach( &bbuf, &bsize ); 
+    }
+
+    if (rank == dest) {
+       MPI_Request r[5];
+       int i;
+
+       for (i=0; i<5; i++) {
+           MPI_Irecv( &rmsg[i], 1, MPI_INT, src, tag+i, comm, &r[i] );
+       }
+       if (rank != src) /* Just in case rank == src */
+           MPI_Barrier( MPI_COMM_WORLD );
+
+       for (i=0; i<4; i++) {
+           MPI_Wait( &r[i], MPI_STATUS_IGNORE );
+           if (rmsg[i] != 10+i) {
+               errs++;
+               fprintf( stderr, "message %d (%d) should be %d\n", i, rmsg[i], 10+i );
+           }
+       }
+       /* The MPI standard says that there is no way to use MPI_Request_free
+          safely with receive requests.  A strict MPI implementation may
+          choose to consider these erroreous (an IBM MPI implementation
+          does so)  */
+#ifdef USE_STRICT_MPI
+       MPI_Wait( &r[4], MPI_STATUS_IGNORE );
+#else
+       MTestPrintfMsg( 10, "About  free Irecv request\n" );
+       MPI_Request_free( &r[4] ); 
+#endif
+    }
+
+    if (rank != dest && rank != src) {
+       MPI_Barrier( MPI_COMM_WORLD );
+    }
+
+
+    MTest_Finalize( errs );
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/rqstatus.c b/teshsuite/smpi/mpich3-test/pt2pt/rqstatus.c
new file mode 100644 (file)
index 0000000..102e9f8
--- /dev/null
@@ -0,0 +1,114 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test Request_get_status";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest;
+    int buf[2], flag, count;
+    MPI_Comm      comm;
+    MPI_Status    status, status2;
+    MPI_Request   req;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    /* Determine the sender and receiver */
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    source = 0;
+    dest   = size - 1;
+
+
+    /* Handling MPI_REQUEST_NULL in MPI_Request_get_status was only required
+       starting with MPI-2.2. */
+#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
+    MPI_Request_get_status( MPI_REQUEST_NULL, &flag, &status );
+    if (!flag) {
+        errs++;
+        fprintf( stderr, "flag not true for MPI_REQUEST_NULL, flag=%d\n", flag );
+    }
+    if ((status.MPI_SOURCE != MPI_ANY_SOURCE) ||
+        (status.MPI_TAG != MPI_ANY_TAG) ||
+        (status.MPI_ERROR != MPI_SUCCESS))
+    {
+        errs++;
+        fprintf( stderr, "non-empty MPI_Status returned for MPI_REQUEST_NULL\n" );
+    }
+
+    /* also pass MPI_STATUS_IGNORE to make sure the implementation doesn't
+     * blow up when it is passed as the status argument */
+    MPI_Request_get_status( MPI_REQUEST_NULL, &flag, MPI_STATUS_IGNORE );
+    if (!flag) {
+        errs++;
+        fprintf( stderr, "flag not true for MPI_REQUEST_NULL with MPI_STATUS_IGNORE, flag=%d\n", flag );
+    }
+#endif
+
+    if (rank == source) {
+       buf[0] = size;
+       buf[1] = 3;
+       MPI_Ssend( buf, 2, MPI_INT, dest, 10, comm );
+    }
+    if (rank == dest) {
+       MPI_Irecv( buf, 2, MPI_INT, source, 10, comm, &req );
+    }
+    MPI_Barrier( comm );
+    /* At this point, we know that the receive has at least started,
+       because of the Ssend.  Check the status on the request */
+    if (rank == dest) {
+       status.MPI_SOURCE = -1;
+       status.MPI_TAG    = -1;
+       MPI_Request_get_status( req, &flag, &status );
+       if (flag) {
+           if (status.MPI_TAG != 10) {
+               errs++;
+               fprintf( stderr, "Tag value %d should be 10\n", status.MPI_TAG );
+           }
+           if (status.MPI_SOURCE != source) {
+               errs++;
+               fprintf( stderr, "Source value %d should be %d\n", status.MPI_SOURCE, source );
+           }
+           MPI_Get_count( &status, MPI_INT, &count );
+           if (count != 2) {
+               errs++;
+               fprintf( stderr, "Count value %d should be 2\n", count );
+           }
+       }
+       else {
+           errs++;
+           fprintf( stderr, "Unexpected flag value from get_status\n" );
+       }
+       /* Now, complete the request */
+       MPI_Wait( &req, &status2 );
+       /* Check that the status is correct */
+       if (status2.MPI_TAG != 10) {
+           errs++;
+           fprintf( stderr, "(wait)Tag value %d should be 10\n", status2.MPI_TAG );
+       }
+       if (status2.MPI_SOURCE != source) {
+           errs++;
+           fprintf( stderr, "(wait)Source value %d should be %d\n", status2.MPI_SOURCE, source );
+       }
+       MPI_Get_count( &status2, MPI_INT, &count );
+       if (count != 2) {
+           errs++;
+           fprintf( stderr, "(wait)Count value %d should be 2\n", count );
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/scancel.c b/teshsuite/smpi/mpich3-test/pt2pt/scancel.c
new file mode 100644 (file)
index 0000000..7c8cf65
--- /dev/null
@@ -0,0 +1,271 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of various send cancel calls";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, /* source, */ dest;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Request   req;
+    static int bufsizes[4] = { 1, 100, 10000, 1000000 };
+    char *buf;
+#ifdef TEST_IRSEND
+    int veryPicky = 0;   /* Set to 1 to test "quality of implementation" in
+                           a tricky part of cancel */
+#endif
+    int  cs, flag, n;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* source = 0; */
+    dest   = size - 1;
+
+    MTestPrintfMsg( 1, "Starting scancel test\n" );
+    for (cs=0; cs<4; cs++) {
+       if (rank == 0) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MTestPrintfMsg( 1, "(%d) About to create isend and cancel\n",cs );
+           MPI_Isend( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MTestPrintfMsg( 1, "Completed wait on isend\n" );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel an Isend request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+1;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn );
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+
+       if (rank == 0) {
+           char *bsendbuf;
+           int bsendbufsize;
+           int bf, bs;
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           bsendbufsize = n + MPI_BSEND_OVERHEAD;
+           bsendbuf = (char *)malloc( bsendbufsize );
+           if (!bsendbuf) {
+               fprintf( stderr, "Unable to allocate %d bytes for bsend\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MPI_Buffer_attach( bsendbuf, bsendbufsize );
+           MTestPrintfMsg( 1, "About to create and cancel ibsend\n" );
+           MPI_Ibsend( buf, n, MPI_CHAR, dest, cs+n+2, comm, &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel an Ibsend request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+2;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+           MPI_Buffer_detach( &bf, &bs );
+           free( bsendbuf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+
+       /* Because this test is erroneous, we do not perform it unless
+          TEST_IRSEND is defined.  */
+#ifdef TEST_IRSEND
+       /* We avoid ready send to self because an implementation
+          is free to detect the error in delivering a message to
+          itself without a pending receive; we could also check
+          for an error return from the MPI_Irsend */
+       if (rank == 0 && dest != rank) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MTestPrintfMsg( 1, "About to create and cancel irsend\n" );
+           MPI_Irsend( buf, n, MPI_CHAR, dest, cs+n+3, comm, &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           /* This can be pretty ugly.  The standard is clear (Section 3.8)
+              that either a sent message is received or the 
+              sent message is successfully cancelled.  Since this message
+              can never be received, the cancel must complete
+              successfully.  
+
+              However, since there is no matching receive, this
+              program is erroneous.  In this case, we can't really
+              flag this as an error */
+           if (!flag && veryPicky) {
+               errs ++;
+               printf( "Failed to cancel an Irsend request\n" );
+               fflush(stdout);
+           }
+           if (flag)
+           {
+               n = 0;
+           }
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+3;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int n, tag;
+           char *btemp;
+           MPI_Recv( &n, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (n > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( n );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", n);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, n, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+#endif
+
+       if (rank == 0) {
+           n = bufsizes[cs];
+           buf = (char *)malloc( n );
+           if (!buf) {
+               fprintf( stderr, "Unable to allocate %d bytes\n", n );
+               MPI_Abort( MPI_COMM_WORLD, 1 );
+           }
+           MTestPrintfMsg( 1, "About to create and cancel issend\n" );
+           MPI_Issend( buf, n, MPI_CHAR, dest, cs+n+4, comm, &req );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MPI_Test_cancelled( &status, &flag );
+           if (!flag) {
+               errs ++;
+               printf( "Failed to cancel an Issend request\n" );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           /* Send the size, zero for successfully cancelled */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           /* Send the tag so the message can be received */
+           n = cs+n+4;
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+           free( buf );
+       }
+       else if (rank == dest)
+       {
+           int nn, tag;
+           char *btemp;
+           MPI_Recv( &nn, 1, MPI_INT, 0, 123, comm, &status );
+           MPI_Recv( &tag, 1, MPI_INT, 0, 123, comm, &status );
+           if (nn > 0)
+           {
+               /* If the message was not cancelled, receive it here */
+               btemp = (char*)malloc( nn );
+               if (!btemp)
+               {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", nn);
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+               MPI_Recv( btemp, nn, MPI_CHAR, 0, tag, comm, &status );
+               free(btemp);
+           }
+       }
+       MPI_Barrier( comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/scancel2.c b/teshsuite/smpi/mpich3-test/pt2pt/scancel2.c
new file mode 100644 (file)
index 0000000..b027f0b
--- /dev/null
@@ -0,0 +1,83 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of send cancel (failure) calls";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest;
+    MPI_Comm      comm;
+    MPI_Status    status;
+    MPI_Request   req;
+    static int bufsizes[4] = { 1, 100, 10000, 1000000 };
+    char *buf;
+    int  cs, flag, n;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    source = 0;
+    dest   = size - 1;
+
+    MTestPrintfMsg( 1, "Starting scancel test\n" );
+
+    for (cs=0; cs<4; cs++) {
+       n = bufsizes[cs];
+       buf = (char *)malloc( n );
+       if (!buf) {
+           fprintf( stderr, "Unable to allocate %d bytes\n", n );
+           MPI_Abort( MPI_COMM_WORLD, 1 );
+       }
+
+       if (rank == source) {
+           MTestPrintfMsg( 1, "(%d) About to create isend and cancel\n",cs );
+           MPI_Isend( buf, n, MPI_CHAR, dest, cs+n+1, comm, &req );
+           MPI_Barrier( comm );
+           MPI_Cancel( &req );
+           MPI_Wait( &req, &status );
+           MTestPrintfMsg( 1, "Completed wait on isend\n" );
+           MPI_Test_cancelled( &status, &flag );
+           if (flag) {
+               errs ++;
+               printf( "Cancelled a matched Isend request (msg size = %d)!\n",
+                       n );
+               fflush(stdout);
+           }
+           else
+           {
+               n = 0;
+           }
+           /* Send the size, zero for not cancelled (success) */
+           MPI_Send( &n, 1, MPI_INT, dest, 123, comm );
+       }
+       else if (rank == dest)
+       {
+           MPI_Recv( buf, n, MPI_CHAR, source, cs+n+1, comm, &status );
+           MPI_Barrier( comm );
+           MPI_Recv( &n, 1, MPI_INT, source, 123, comm, &status );
+       }
+       else {
+           MPI_Barrier( comm );
+       }
+
+       MPI_Barrier( comm );
+       free( buf );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendall.c b/teshsuite/smpi/mpich3-test/pt2pt/sendall.c
new file mode 100644 (file)
index 0000000..eba48e6
--- /dev/null
@@ -0,0 +1,82 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2007 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* 
+ * This test makes sure that each process can send to each other process.
+ * If there are bugs in the handling of request completions or in 
+ * queue operations, then this test may fail on them (it did with
+ * early EagerShort handling).
+ */
+
+#define MAXPES 32
+#define MYBUFSIZE 16*1024
+static int buffer[MAXPES][MYBUFSIZE];
+
+#define NUM_RUNS 10
+
+int main ( int argc, char *argv[] )
+{
+  int i;
+  int count, size;
+  int self, npes;
+  double secs;
+  MPI_Request request[MAXPES];
+  MPI_Status status;
+
+  MTest_Init (&argc, &argv);
+  MPI_Comm_rank (MPI_COMM_WORLD, &self);
+  MPI_Comm_size (MPI_COMM_WORLD, &npes);
+
+  if (npes > MAXPES) {
+    fprintf( stderr, "This program requires a comm_world no larger than %d",
+            MAXPES );
+    MPI_Abort( MPI_COMM_WORLD, 1 );
+  }
+
+  for (size = 1; size  <= MYBUFSIZE ; size += size) {
+      secs = -MPI_Wtime ();
+      for (count = 0; count < NUM_RUNS; count++) {
+         MPI_Barrier (MPI_COMM_WORLD);
+
+         for (i = 0; i < npes; i++) {
+             if (i != self)
+               MPI_Irecv (buffer[i], size, MPI_INT, i,
+                        MPI_ANY_TAG, MPI_COMM_WORLD, &request[i]);
+           }
+
+         for (i = 0; i < npes; i++) {
+             if (i != self)
+               MPI_Send (buffer[self], size, MPI_INT, i, 0, MPI_COMM_WORLD);
+           }
+
+         for (i = 0; i < npes; i++) {
+             if (i != self)
+               MPI_Wait (&request[i], &status);
+           }
+
+       }
+      MPI_Barrier (MPI_COMM_WORLD);
+      secs += MPI_Wtime ();
+
+      if (self == 0) {
+         secs = secs / (double) NUM_RUNS;
+         MTestPrintfMsg( 1, "length = %d ints\n", size );
+       }
+    }
+
+  /* Simple completion is all that we normally ask of this program */
+
+  MTest_Finalize( 0 );
+
+  MPI_Finalize();
+  return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendflood.c b/teshsuite/smpi/mpich3-test/pt2pt/sendflood.c
new file mode 100644 (file)
index 0000000..e2fed07
--- /dev/null
@@ -0,0 +1,156 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2008 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "mpi.h"
+
+/*
+ * Run this test with 8 processes.  This test was submitted by xxx
+ * as a result of problems seen with the ch3:shm device on a Solaris 
+ * system.  The symptom is that the test hangs; this is due to losing 
+ * a message, probably due to a race condition in a message-queue update.
+ * As a test for race conditions, it may need to be run multiple times
+ * to expose a problem if a problem does exist.
+ */
+
+#define LOOP_COUNT  10000
+#define DATA_SIZE   4
+#define MP_TAG      999
+
+#define PROGRESS_COUNT 0xfff
+static int verbose = 0;
+static int loopProgress = 0;
+
+int main( int argc, char *argv[] )
+{
+    int     nProc, rank ;
+    int     i, j, status ;
+    FILE    *pf=0 ;
+
+    MPI_Init( &argc, &argv ) ;
+    MPI_Comm_size( MPI_COMM_WORLD, &nProc ) ;
+    MPI_Comm_rank( MPI_COMM_WORLD, &rank ) ;
+
+    for (i=1; i<argc; i++) {
+       if (strcmp(argv[i],"-v") == 0 ||
+           strcmp(argv[i],"--verbose") == 0) verbose = 1;
+       else if (strcmp(argv[i],"-p") == 0 ||
+                strcmp(argv[i],"--progress") == 0) loopProgress = 1;
+       else {
+           if (rank == 0) {
+               fprintf( stderr, "%s: [ -v | --verbose ] [ -p | --progress ]\n",
+                        argv[0] );
+               fflush(stderr);
+           }
+       }
+    }
+
+    if (verbose) {
+       char    buf[ 128 ] ;
+       sprintf( buf, "fast_mpi_%d.dmp", rank ) ;
+       pf = fopen( buf, "w" ) ;
+    }
+    else if (loopProgress) {
+       pf = stdout;
+    }
+
+    if( !rank ) {
+       int      **psend ;
+       int      **precv ;
+       psend = (int**)calloc( nProc, sizeof( int *) ) ;
+       precv = (int**)calloc( nProc, sizeof( int *) ) ;
+       for( i = 0 ; i < nProc ; i++ ) {
+           psend[ i ] = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
+           precv[ i ] = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
+       }
+       for( i = 0 ; i < LOOP_COUNT ; i++ ) {
+          if (verbose) {
+              fprintf( pf, "Master : loop %d\n", i ) ;
+              fflush( pf ) ;
+          }
+          else if (loopProgress && (i & PROGRESS_COUNT) == 0) {
+            fprintf( pf, "Master: loop %d\n", i ); fflush( pf );
+          }
+          for( j = 1 ; j < nProc ; j++ ) {
+             if (verbose) {
+                 fprintf( pf, "  read from child %d\n", j ) ;
+                 fflush( pf ) ;
+             }
+             status = MPI_Recv( precv[ j ], DATA_SIZE, MPI_INT, j, MP_TAG,
+                               MPI_COMM_WORLD, MPI_STATUS_IGNORE ) ;
+            if (verbose) {
+                fprintf( pf, "  read from child %d done, status = %d\n", j,
+                         status ) ;
+                fflush( pf ) ;
+            }
+          }
+          for( j = 1 ; j < nProc ; j++ ) {
+             if (verbose) {
+                 fprintf( pf, "  send to child %d\n", j ) ;
+                 fflush( pf ) ;
+             }
+             status = MPI_Send( psend[ j ], DATA_SIZE - 1, MPI_INT, j,
+                               MP_TAG, MPI_COMM_WORLD ) ;
+            if (verbose) {
+                fprintf( pf, "  send to child %d done, status = %d\n", j,
+                         status ) ;
+                fflush( pf ) ;
+            }
+          }
+       }
+       for( i = 0 ; i < nProc ; i++ ) {
+          free( psend[ i ] );
+          free( precv[ i ] );
+       }
+       free( psend );
+       free( precv );
+    } else {
+       int  *psend ;
+       int  *precv ;
+       psend = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
+       precv = (int*)calloc( DATA_SIZE, sizeof( int ) ) ;
+       for( i = 0 ; i < LOOP_COUNT ; i++ ) {
+          if (verbose) {
+              fprintf( pf, "  send to master\n" ) ;
+              fflush( pf ) ;
+          }
+          /*
+          else if (loopProgress && (i & PROGRESS_COUNT) == 0) {
+            fprintf( pf, "Slave: loop %d\n", i ); fflush( pf );
+          }
+          */
+          status = MPI_Send( psend, DATA_SIZE - 1, MPI_INT, 0, MP_TAG,
+                             MPI_COMM_WORLD ) ;
+          if (verbose) {
+              fprintf( pf, "  send to master done, status = %d\n", status ) ;
+              fflush( pf ) ;
+              fprintf( pf, "  read from master\n" ) ;
+              fflush( pf ) ;
+          }
+          status = MPI_Recv( precv, DATA_SIZE, MPI_INT, 0, MP_TAG,
+                             MPI_COMM_WORLD, MPI_STATUS_IGNORE ) ;
+          if (verbose) {
+              fprintf( pf, "  read from master done, status = %d\n", status ) ;
+              fflush( pf ) ;
+          }
+       }
+       free( psend );
+       free( precv );
+    }
+    if (verbose) {
+       fclose( pf ) ;
+    }
+    MPI_Finalize() ;
+
+    /* This test fails if it hangs */
+    if (rank == 0) {
+       printf( " No Errors\n" );
+    }
+
+    return 0;
+}
+
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendrecv1.c b/teshsuite/smpi/mpich3-test/pt2pt/sendrecv1.c
new file mode 100644 (file)
index 0000000..13f1dd2
--- /dev/null
@@ -0,0 +1,92 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Send-Recv";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size, source, dest;
+    int minsize = 2, count; 
+    MPI_Comm      comm;
+    MTestDatatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    /* The following illustrates the use of the routines to 
+       run through a selection of communicators and datatypes.
+       Use subsets of these for tests that do not involve combinations 
+       of communicators, datatypes, and counts of datatypes */
+    while (MTestGetIntracommGeneral( &comm, minsize, 1 )) {
+       if (comm == MPI_COMM_NULL) continue;
+
+       /* Determine the sender and receiver */
+       MPI_Comm_rank( comm, &rank );
+       MPI_Comm_size( comm, &size );
+       source = 0;
+       dest   = size - 1;
+
+       /* To improve reporting of problems about operations, we
+          change the error handler to errors return */
+       MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+
+       for (count = 1; count < 65000; count = count * 2) {
+           while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
+               /* Make sure that everyone has a recv buffer */
+               recvtype.InitBuf( &recvtype );
+
+               if (rank == source) {
+                   sendtype.InitBuf( &sendtype );
+                   
+                   err = MPI_Send( sendtype.buf, sendtype.count, 
+                                   sendtype.datatype, dest, 0, comm);
+                   if (err) {
+                       errs++;
+                       if (errs < 10) {
+                           MTestPrintError( err );
+                       }
+                   }
+               }
+               else if (rank == dest) {
+                   err = MPI_Recv( recvtype.buf, recvtype.count, 
+                                   recvtype.datatype, source, 0, comm, MPI_STATUS_IGNORE);
+                   if (err) {
+                       errs++;
+                       if (errs < 10) {
+                           MTestPrintError( err );
+                       }
+                   }
+
+                   err = MTestCheckRecv( 0, &recvtype );
+                   if (err) {
+                       if (errs < 10) {
+                           printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
+                                   MTestGetDatatypeName( &recvtype ),
+                                   MTestGetDatatypeName( &sendtype ),
+                                   count );
+                           recvtype.printErrors = 1;
+                           (void)MTestCheckRecv( 0, &recvtype );
+                       }
+                       errs += err;
+                   }
+               }
+               MTestFreeDatatype( &sendtype );
+               MTestFreeDatatype( &recvtype );
+           }
+       }
+       MTestFreeComm( &comm );
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendrecv2.c b/teshsuite/smpi/mpich3-test/pt2pt/sendrecv2.c
new file mode 100644 (file)
index 0000000..f4845c6
--- /dev/null
@@ -0,0 +1,136 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static int verbose = 0;
+
+static int parse_args(int argc, char **argv);
+
+int main( int argc, char *argv[] )
+{
+    int i, j, errs = 0;
+    int rank, size;
+    MPI_Datatype newtype;
+    char *buf = NULL;
+
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    if (size < 2) {
+       if (verbose) fprintf(stderr, "comm size must be > 1\n");
+       errs++;
+       goto fn_exit;
+    }
+
+    buf = malloc(64 * 129);
+    if (buf == NULL) {
+       if (verbose) fprintf(stderr, "error allocating buffer\n");
+       errs++;
+       goto fn_exit;
+    }
+
+    for (i = 8; i < 64; i += 4) {
+       MPI_Type_vector(i, 128, 129, MPI_CHAR, &newtype);
+
+       MPI_Type_commit(&newtype);
+       memset(buf, 0, 64*129);
+
+       if (rank == 0) {
+           /* init buffer */
+           for (j=0; j < i; j++) {
+               int k;
+               for (k=0; k < 129; k++) {
+                   buf[129*j + k] = (char) j;
+               }
+           }
+
+           /* send */
+           MPI_Send(buf, 1, newtype, 1, i, MPI_COMM_WORLD);
+       }
+       else if (rank == 1) {
+           /* recv */
+           MPI_Recv(buf, 1, newtype, 0, i, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+
+           /* check buffer */
+           for (j=0; j < i; j++) {
+               int k;
+               for (k=0; k < 129; k++) {
+                   if (k < 128 && buf[129*j + k] != (char) j) {
+                       if (verbose) fprintf(stderr,
+                                            "(i=%d, pos=%d) should be %d but is %d\n",
+                                            i, 129*j + k, j, (int) buf[129*j + k]);
+                       errs++;
+                   }
+                   else if (k == 128 && buf[129*j + k] != (char) 0) {
+                       if (verbose) fprintf(stderr,
+                                            "(i=%d, pos=%d) should be %d but is %d\n",
+                                            i, 129*j + k, 0, (int) buf[129*j + k]);
+                       errs++;
+                   }
+               }
+           }
+       }
+
+       MPI_Type_free(&newtype);
+    }
+
+    if (rank == 0) {
+       int recv_errs = 0;
+
+       MPI_Recv(&recv_errs, 1, MPI_INT, 1, 0, MPI_COMM_WORLD,
+                MPI_STATUS_IGNORE);
+       if (recv_errs) {
+           if (verbose) fprintf(stderr, "%d errors reported from receiver\n",
+                                recv_errs);
+           errs += recv_errs;
+       }
+    }
+    else if (rank == 1) {
+       MPI_Send(&errs, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
+    }
+       
+ fn_exit:
+
+    free(buf);
+    /* print message and exit */
+    if (errs) {
+       if (rank == 0) fprintf(stderr, "Found %d errors\n", errs);
+    }
+    else {
+       if (rank == 0) printf(" No Errors\n");
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+static int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendrecv3.c b/teshsuite/smpi/mpich3-test/pt2pt/sendrecv3.c
new file mode 100644 (file)
index 0000000..e0c21a7
--- /dev/null
@@ -0,0 +1,105 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Head to head send-recv to test backoff in device when large messages are being transferred";
+*/
+
+#define  MAX_NMSGS 100
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int rank, size, source, dest, partner;
+    int i, testnum; 
+    double tsend;
+    static int msgsizes[] = { 100, 1000, 10000, 100000, -1 };
+    static int nmsgs[]    = { 100, 10,   10,    4 };
+    MPI_Comm      comm;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+    source = 0;
+    dest   = 1;
+    if (size < 2) {
+       printf( "This test requires at least 2 processes\n" );
+       MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    for (testnum=0; msgsizes[testnum] > 0; testnum++) {
+       if (rank == source || rank == dest) {
+           int nmsg = nmsgs[testnum];
+           int msgSize = msgsizes[testnum];
+           MPI_Request r[MAX_NMSGS];
+           int *buf[MAX_NMSGS];
+
+           for (i=0; i<nmsg; i++) {
+               buf[i] = (int *)malloc( msgSize );
+               if (!buf[i]) {
+                   fprintf( stderr, "Unable to allocate %d bytes\n", 
+                            msgSize );
+                   MPI_Abort( MPI_COMM_WORLD, 1 );
+               }
+           }
+           partner = (rank + 1) % size;
+
+           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 10, 
+                         MPI_BOTTOM, 0, MPI_INT, partner, 10, comm, 
+                         MPI_STATUS_IGNORE );
+           /* Try to fill up the outgoing message buffers */
+           for (i=0; i<nmsg; i++) {
+               MPI_Isend( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+                          &r[i] );
+           }
+           for (i=0; i<nmsg; i++) {
+               MPI_Recv( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+                         MPI_STATUS_IGNORE );
+           }
+           MPI_Waitall( nmsg, r, MPI_STATUSES_IGNORE );
+
+           /* Repeat the test, but make one of the processes sleep */
+           MPI_Sendrecv( MPI_BOTTOM, 0, MPI_INT, partner, 10, 
+                         MPI_BOTTOM, 0, MPI_INT, partner, 10, comm, 
+                         MPI_STATUS_IGNORE );
+           if (rank == dest) MTestSleep( 1 );
+           /* Try to fill up the outgoing message buffers */
+           tsend = MPI_Wtime();
+           for (i=0; i<nmsg; i++) {
+               MPI_Isend( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+                          &r[i] );
+           }
+           tsend = MPI_Wtime() - tsend;
+           for (i=0; i<nmsg; i++) {
+               MPI_Recv( buf[i], msgSize, MPI_CHAR, partner, testnum, comm,
+                         MPI_STATUS_IGNORE );
+           }
+           MPI_Waitall( nmsg, r, MPI_STATUSES_IGNORE );
+
+           if (tsend > 0.5) {
+               printf( "Isends for %d messages of size %d took too long (%f seconds)\n", nmsg, msgSize, tsend );
+               errs++;
+           }
+           MTestPrintfMsg( 1, "%d Isends for size = %d took %f seconds\n", 
+                           nmsg, msgSize, tsend );
+
+           for (i=0; i<nmsg; i++) {
+               free( buf[i] );
+           }
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/sendself.c b/teshsuite/smpi/mpich3-test/pt2pt/sendself.c
new file mode 100644 (file)
index 0000000..5286272
--- /dev/null
@@ -0,0 +1,141 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test of sending to self (with a preposted receive)";
+*/
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0, err;
+    int rank, size;
+    int count;
+    MPI_Comm      comm;
+    MPI_Request   req;
+    MTestDatatype sendtype, recvtype;
+
+    MTest_Init( &argc, &argv );
+
+    comm = MPI_COMM_WORLD;
+    MPI_Comm_rank( comm, &rank );
+    MPI_Comm_size( comm, &size );
+
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( comm, MPI_ERRORS_RETURN );
+    
+    for (count = 1; count < 65000; count = count * 2) {
+       while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
+           
+           sendtype.InitBuf( &sendtype );
+           recvtype.InitBuf( &recvtype );
+           
+           err = MPI_Irecv( recvtype.buf, recvtype.count, 
+                           recvtype.datatype, rank, 0, comm, &req );
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           
+           err = MPI_Send( sendtype.buf, sendtype.count, 
+                           sendtype.datatype, rank, 0, comm);
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           err = MPI_Wait( &req, MPI_STATUS_IGNORE );
+           err = MTestCheckRecv( 0, &recvtype );
+           if (err) {
+               if (errs < 10) {
+                   printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
+                           MTestGetDatatypeName( &recvtype ),
+                           MTestGetDatatypeName( &sendtype ),
+                           count );
+                   recvtype.printErrors = 1;
+                   (void)MTestCheckRecv( 0, &recvtype );
+               }
+               errs += err;
+           }
+
+           err = MPI_Irecv( recvtype.buf, recvtype.count, 
+                           recvtype.datatype, rank, 0, comm, &req );
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           
+           err = MPI_Ssend( sendtype.buf, sendtype.count, 
+                            sendtype.datatype, rank, 0, comm);
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           err = MPI_Wait( &req, MPI_STATUS_IGNORE );
+           err = MTestCheckRecv( 0, &recvtype );
+           if (err) {
+               if (errs < 10) {
+                   printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
+                           MTestGetDatatypeName( &recvtype ),
+                           MTestGetDatatypeName( &sendtype ),
+                           count );
+                   recvtype.printErrors = 1;
+                   (void)MTestCheckRecv( 0, &recvtype );
+               }
+               errs += err;
+           }
+
+           err = MPI_Irecv( recvtype.buf, recvtype.count, 
+                           recvtype.datatype, rank, 0, comm, &req );
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           
+           err = MPI_Rsend( sendtype.buf, sendtype.count, 
+                            sendtype.datatype, rank, 0, comm);
+           if (err) {
+               errs++;
+               if (errs < 10) {
+                   MTestPrintError( err );
+               }
+           }
+           err = MPI_Wait( &req, MPI_STATUS_IGNORE );
+           err = MTestCheckRecv( 0, &recvtype );
+           if (err) {
+               if (errs < 10) {
+                   printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n", 
+                           MTestGetDatatypeName( &recvtype ),
+                           MTestGetDatatypeName( &sendtype ),
+                           count );
+                   recvtype.printErrors = 1;
+                   (void)MTestCheckRecv( 0, &recvtype );
+               }
+               errs += err;
+           }
+
+           MTestFreeDatatype( &sendtype );
+           MTestFreeDatatype( &recvtype );
+       }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/testlist b/teshsuite/smpi/mpich3-test/pt2pt/testlist
new file mode 100644 (file)
index 0000000..1f16ded
--- /dev/null
@@ -0,0 +1,52 @@
+#needs MPI_Type_dup, MPI_Type_set_name
+#sendrecv1 4
+sendrecv2 2
+sendrecv3 2
+sendflood 8 timeLimit=600
+#needs rsend
+#sendself 1
+sendall 4
+anyall 2
+eagerdt 2
+#needs MPI_Type_get_name, MPI_Type_dup
+#pingping 2
+bottom 2
+#needs MPI_Bsend
+#bsend1 1
+#bsend2 1
+#bsend3 1
+#bsend4 1
+#bsend5 4
+#bsendalign 2
+#bsendpending 2
+isendself 1
+#needs MPI_Buffer_attach, MPI_Bsend, MPI_Buffer_detach
+#bsendfrag 2
+#needs MPI_Intercomm_create
+#icsend 4
+#needs MPI_Request_get_status
+#rqstatus 2
+#needs MPI_Pack, MPI_Buffer_attach, MPI_Buffer_detach, MPI_Irsend, MPI_Ibsend
+#rqfreeb 4
+#needs MPI_Grequest_start MPI_Grequest_complete
+#greq1 1
+probe-unexp 4
+probenull 1
+# For testing, scancel will run with 1 process as well
+#needs MPI_Cancel, MPI_Test_cancelled, MPI_Ibsend
+#scancel 2 xfail=ticket287
+#needs MPI_Cancel, MPI_Test_cancelled
+#scancel2 2
+#pscancel 2 xfail=ticket287
+#needs MPI_Cancel
+#rcancel 2
+#cancelrecv 2 xfail=ticket287
+isendselfprobe 1
+inactivereq 1
+#needs MPI_Error_string, but fails with testany
+waittestnull 1
+waitany-null 1
+# this should be run only on machines with large amount of memory (>=8GB)
+# perhaps disable in the release tarball
+#large_message 3
+mprobe 2 mpiversion=3.0
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c b/teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c
new file mode 100644 (file)
index 0000000..98df8ef
--- /dev/null
@@ -0,0 +1,84 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#include "mpi.h"
+
+static int verbose = 0;
+
+int parse_args(int argc, char **argv);
+
+int main(int argc, char *argv[])
+{
+    int i, err, errs = 0, rank, toterrs;
+
+    int         index;
+    MPI_Request requests[10];
+    MPI_Status  statuses[10];
+
+    MPI_Init(&argc, &argv);
+    parse_args(argc, argv);
+
+    for (i=0; i < 10; i++) {
+       requests[i] = MPI_REQUEST_NULL;
+    }
+
+    /* begin testing */
+    /* To improve reporting of problems about operations, we
+       change the error handler to errors return */
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    err = MPI_Waitany(10, requests, &index, statuses);
+
+    if (err != MPI_SUCCESS) {
+       errs++;
+       fprintf(stderr, "MPI_Waitany did not return MPI_SUCCESS\n");
+    }
+
+    if (index != MPI_UNDEFINED) {
+       errs++;
+       fprintf(stderr, "MPI_Waitany did not set index to MPI_UNDEFINED\n");
+    }
+
+    /* end testing */
+    
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL );
+    MPI_Comm_rank( MPI_COMM_WORLD, & rank );
+    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+    if (rank == 0) {
+       if (toterrs) {
+           fprintf(stderr, " Found %d errors\n", toterrs);
+       }
+       else {
+           printf(" No Errors\n");
+       }
+    }
+    MPI_Finalize();
+    return 0;
+}
+
+int parse_args(int argc, char **argv)
+{
+    /*
+    int ret;
+
+    while ((ret = getopt(argc, argv, "v")) >= 0)
+    {
+       switch (ret) {
+           case 'v':
+               verbose = 1;
+               break;
+       }
+    }
+    */
+    if (argc > 1 && strcmp(argv[1], "-v") == 0)
+       verbose = 1;
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/pt2pt/waittestnull.c b/teshsuite/smpi/mpich3-test/pt2pt/waittestnull.c
new file mode 100644 (file)
index 0000000..d23c91d
--- /dev/null
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2005 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <stdio.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* 
+ * This program checks that the various MPI_Test and MPI_Wait routines 
+ * allow both null requests and in the multiple completion cases, empty
+ * lists of requests.
+ */
+
+int main(int argc, char **argv)
+{
+    int errs = 0;
+    MPI_Status status, *status_array = 0;
+    int count = 0, flag, idx, rc, errlen, *indices=0, outcnt;
+    MPI_Request *reqs = 0;
+    char errmsg[MPI_MAX_ERROR_STRING];
+
+    MTest_Init(&argc, &argv);
+
+    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+
+    rc = MPI_Testall( count, reqs, &flag, status_array );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Testall returned failure: %s\n", errmsg );
+       errs ++;
+    }
+    else if (!flag) {
+       printf( "MPI_Testall( 0, ... ) did not return a true flag\n") ;
+       errs++;
+    }
+
+    rc = MPI_Waitall( count, reqs, status_array );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Waitall returned failure: %s\n", errmsg );
+       errs ++;
+    }
+
+    rc = MPI_Testany( count, reqs, &idx, &flag, &status );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Testany returned failure: %s\n", errmsg );
+       errs ++;
+    }
+    else if (!flag) {
+       printf( "MPI_Testany( 0, ... ) did not return a true flag\n") ;
+       errs++;
+    }
+
+    rc = MPI_Waitany( count, reqs, &idx, &status );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Waitany returned failure: %s\n", errmsg );
+       errs ++;
+    }
+
+    rc = MPI_Testsome( count, reqs, &outcnt, indices, status_array );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Testsome returned failure: %s\n", errmsg );
+       errs ++;
+    }
+
+    rc = MPI_Waitsome( count, reqs, &outcnt, indices, status_array );
+    if (rc != MPI_SUCCESS) {
+       MPI_Error_string( rc, errmsg, &errlen );
+       printf( "MPI_Waitsome returned failure: %s\n", errmsg );
+       errs ++;
+    }
+    
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/runtests b/teshsuite/smpi/mpich3-test/runtests
new file mode 100755 (executable)
index 0000000..88188fe
--- /dev/null
@@ -0,0 +1,1080 @@
+#! /usr/bin/perl
+# -*- Mode: perl; -*-
+#
+# This script is the beginnings of a script to run a sequence of test 
+# programs.  See the MPICH document for a description of the test
+# strategy and requirements.
+#
+# Description
+#   Tests are controlled by a file listing test programs; if the file is
+#   a directory, then all of the programs in the directory and subdirectories
+#   are run
+#
+#   To run a test, the following steps are executed
+#   Build the executable:
+#      make programname
+#   Run the executable
+#      mpiexec -n <np> ./programname >out 2>err
+#   Check the return code (non zero is failure)
+#   Check the stderr output (non empty is failure)
+#   Check the stdout output (No Errors or Test passed are the only valid
+#      output)
+#   Remove executable, out, err files
+#
+# The format of a list file is
+# programname number-of-processes
+# If number-of-processes is missing, $np_default is used (this is 2 but can
+# be overridden with -np=new-value)
+#
+# Special feature:
+# Because these tests can take a long time to run, there is an
+# option to cause the tests to stop is a "stopfile" is found.
+# The stopfile can be created by a separate, watchdog process, to ensure that
+# tests end at a certain time.
+# The name of this file is (by default) .stoptest
+# in the  top-level run directory.  The environment variable
+#    MPITEST_STOPTEST
+# can specify a different file name.
+#
+# Import the mkpath command
+use File::Path;
+
+# Global variables
+$MPIMajorVersion = "1";
+$MPIMinorVersion = "1";
+$mpiexec = "smpirun";    # Name of mpiexec program (including path, if necessary)
+$testIsStrict = "true";
+$MPIhasMPIX   = "no";
+$np_arg  = "-np";         # Name of argument to specify the number of processes
+$err_count = 0;          # Number of programs that failed.
+$total_run = 0;          # Number of programs tested
+$total_seen = 0;         # Number of programs considered for testing
+$np_default = 2;         # Default number of processes to use
+$np_max     = -1;        # Maximum number of processes to use (overrides any
+                         # value in the test list files.  -1 is Infinity
+$defaultTimeLimit = 180; # default timeout
+
+$srcdir = ".";           # Used to set the source dir for testlist files
+
+$curdir = ".";           # used to track the relative current directory
+
+# Output forms
+$xmloutput = 0;          # Set to true to get xml output (also specify file)
+$closeXMLOutput = 1;     # Set to false to leave XML output file open to
+                         # accept additional data
+$verbose = 1;            # Set to true to get more output
+$showProgress = 0;       # Set to true to get a "." with each run program.
+$newline = "\r\n";       # Set to \r\n for Windows-friendly, \n for Unix only
+$batchRun = 0;           # Set to true to batch the execution of the tests
+                         # (i.e., run them together, then test output, 
+                         # rather than build/run/check for each test)
+$testCount = 0;          # Used with batchRun to count tests.
+$batrundir = ".";        # Set to the directory into which to run the examples
+
+$execarg="";
+# TAP (Test Anything Protocol) output
+my $tapoutput = 0;
+my $tapfile = '';
+my $tapfullfile = '';
+
+$debug = 1;
+
+$depth = 0;              # This is used to manage multiple open list files
+
+# Build flags
+$remove_this_pgm = 0;
+$clean_pgms      = 0;
+
+my $program_wrapper = '';
+
+#---------------------------------------------------------------------------
+# Get some arguments from the environment
+#   Currently, only the following are understood:
+#   VERBOSE
+#   RUNTESTS_VERBOSE  (an alias for VERBOSE in case you want to 
+#                      reserve VERBOSE)
+#   RUNTESTS_SHOWPROGRESS
+#   MPITEST_STOPTEST
+#   MPITEST_TIMEOUT
+#   MPITEST_PROGRAM_WRAPPER (Value is added after -np but before test
+#                            executable.  Tools like valgrind may be inserted
+#                            this way.)
+#---------------------------------------------------------------------------
+if ( defined($ENV{"VERBOSE"}) || defined($ENV{"V"}) || defined($ENV{"RUNTESTS_VERBOSE"}) ) {
+    $verbose = 1;
+}
+if ( defined($ENV{"RUNTESTS_SHOWPROGRESS"} ) ) {
+    $showProgress = 1;       
+}
+if (defined($ENV{"MPITEST_STOPTEST"})) {
+    $stopfile = $ENV{"MPITEST_STOPTEST"};
+}
+else {
+    $stopfile = `pwd` . "/.stoptest";
+    $stopfile =~ s/\r*\n*//g;    # Remove any newlines (from pwd)
+}
+
+if (defined($ENV{"MPITEST_TIMEOUT"})) {
+    $defaultTimeLimit = $ENV{"MPITEST_TIMEOUT"};
+}
+# Define this to leave the XML output file open to receive additional data
+if (defined($ENV{'NOXMLCLOSE'}) && $ENV{'NOXMLCLOSE'} eq 'YES') {
+    $closeXMLOutput = 0;
+}
+
+if (defined($ENV{'MPITEST_PROGRAM_WRAPPER'})) {
+    $program_wrapper = $ENV{'MPITEST_PROGRAM_WRAPPER'};
+}
+
+if (defined($ENV{'MPITEST_BATCH'})) {
+    if ($ENV{'MPITEST_BATCH'} eq 'YES' || $ENV{'MPITEST_BATCH'} eq 'yes') {
+       $batchRun = 1;
+    } elsif ($ENV{'MPITEST_BATCH'} eq 'NO' || $ENV{'MPITEST_BATCH'} eq 'no') {
+       $batchRun = 0;
+    }
+    else {
+       print STDERR "Unrecognized value for MPITEST_BATCH = $ENV{'MPITEST_BATCH'}\n";
+    }
+}
+if (defined($ENV{'MPITEST_BATCHDIR'})) {
+    $batrundir = $ENV{'MPITEST_BATCHDIR'};
+}
+
+#---------------------------------------------------------------------------
+# Process arguments and override any defaults
+#---------------------------------------------------------------------------
+foreach $_ (@ARGV) {
+    if (/--?mpiexec=(.*)/) { 
+       # Use mpiexec as given - it may be in the path, and 
+       # we don't want to bother to try and find it.
+       $mpiexec = $1; 
+    }
+    elsif (/--?np=(.*)/)   { $np_default = $1; }
+    elsif (/--?maxnp=(.*)/) { $np_max = $1; }
+    elsif (/--?tests=(.*)/) { $listfiles = $1; }
+    elsif (/--?srcdir=(.*)/) { $srcdir = $1;
+       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../hostfile --log=root.thr:critical --cfg=smpi/running_power:1e9"; }
+    elsif (/--?verbose/) { $verbose = 1; }
+    elsif (/--?showprogress/) { $showProgress = 1; }
+    elsif (/--?debug/) { $debug = 1; }
+    elsif (/--?batch/) { $batchRun = 1; }
+    elsif (/--?batchdir=(.*)/) { $batrundir = $1; }
+    elsif (/--?timeoutarg=(.*)/) { $timeoutArgPattern = $1; }
+    elsif (/--?execarg=(.*)/) { $execarg = "$execarg $1"; }
+    elsif (/--?xmlfile=(.*)/) {
+       $xmlfile   = $1;
+       if (! ($xmlfile =~ /^\//)) {
+           $thisdir = `pwd`;
+           chop $thisdir;
+           $xmlfullfile = $thisdir . "/" . $xmlfile ;
+       }
+       else {
+           $xmlfullfile = $xmlfile;
+       }
+       $xmloutput = 1;
+       open( XMLOUT, ">$xmlfile" ) || die "Cannot open $xmlfile\n";
+       my $date = `date "+%Y-%m-%d-%H-%M"`;
+       $date =~ s/\r?\n//;
+       # MPISOURCE can be used to describe the source of MPI for this
+       # test.
+       print XMLOUT "<?xml version='1.0' ?>$newline";
+       print XMLOUT "<?xml-stylesheet href=\"TestResults.xsl\" type=\"text/xsl\" ?>$newline";
+       print XMLOUT "<MPITESTRESULTS>$newline";
+       print XMLOUT "<DATE>$date</DATE>$newline";
+       print XMLOUT "<MPISOURCE></MPISOURCE>$newline";
+    }
+    elsif (/--?noxmlclose/) {
+       $closeXMLOutput = 0;
+    }
+    elsif (/--?tapfile=(.*)/) {
+        $tapfile = $1;
+        if ($tapfile !~ m|^/|) {
+            $thisdir = `pwd`;
+            chomp $thisdir;
+            $tapfullfile = $thisdir . "/" . $tapfile ;
+        }
+        else {
+            $tapfullfile = $tapfile;
+        }
+        $tapoutput = 1;
+        open( TAPOUT, ">$tapfile" ) || die "Cannot open $tapfile\n";
+        my $date = `date "+%Y-%m-%d-%H-%M"`;
+        $date =~ s/\r?\n//;
+        print TAPOUT "TAP version 13\n";
+        print TAPOUT "# MPICH test suite results (TAP format)\n";
+        print TAPOUT "# date ${date}\n";
+        # we do not know at this point how many tests will be run, so do
+        # not print a test plan line like "1..450" until the very end
+    }
+    else {
+       print STDERR "Unrecognized argument $_\n";
+       print STDERR "runtests [-tests=testfile] [-np=nprocesses] \
+        [-maxnp=max-nprocesses] [-srcdir=location-of-tests] \
+        [-xmlfile=filename ] [-noxmlclose] \
+        [-verbose] [-showprogress] [-debug] [-batch]\n";
+       exit(1);
+    }
+}
+
+# Perform any post argument processing
+if ($batchRun) {
+    if (! -d $batrundir) {
+       mkpath $batrundir || die "Could not create $batrundir\n";
+    }
+    open( BATOUT, ">$batrundir/runtests.batch" ) || die "Could not open $batrundir/runtests.batch\n";
+}
+else {
+    # We must have mpiexec
+    if ("$mpiexec" eq "") {
+       print STDERR "No mpiexec found!\n";
+       exit(1);
+    }
+}
+
+#
+# Process any files
+if ($listfiles eq "") {
+    if ($batchRun) {
+       print STDERR "An implicit list of tests is not permitted in batch mode\n";
+       exit(1);
+    } 
+    else {
+       &ProcessImplicitList;
+    }
+}
+elsif (-d $listfiles) { 
+    print STDERR "Testing by directories not yet supported\n";
+}
+else {
+    &RunList( $listfiles );
+}
+
+if ($xmloutput && $closeXMLOutput) { 
+    print XMLOUT "</MPITESTRESULTS>$newline";
+    close XMLOUT; 
+}
+
+if ($tapoutput) {
+    print TAPOUT "1..$total_seen\n";
+    close TAPOUT;
+}
+
+# Output a summary:
+if ($batchRun) {
+    print "Programs created along with a runtest.batch file in $batrundir\n";
+    print "Run that script and then use checktests to summarize the results\n";
+}
+else {
+    if ($err_count) {
+       print "$err_count tests failed out of $total_run\n";
+       if ($xmloutput) {
+           print "Details in $xmlfullfile\n";
+       }
+    }
+    else {
+       print " All $total_run tests passed!\n";
+    }
+    if ($tapoutput) {
+        print "TAP formatted results in $tapfullfile\n";
+    }
+}
+#\f
+# ---------------------------------------------------------------------------
+# Routines
+# 
+# Enter a new directory and process a list file.  
+#  ProcessDir( directory-name, list-file-name )
+sub ProcessDir {
+    my $dir = $_[0]; $dir =~ s/\/$//;
+    my $listfile = $_[1];
+    my $savedir = `pwd`;
+    my $savecurdir = $curdir;
+    my $savesrcdir = $srcdir;
+
+    chop $savedir;
+    if (substr($srcdir,0,3) eq "../") {
+      $srcdir = "../$srcdir";
+    }
+
+    print "Processing directory $dir\n" if ($verbose || $debug);
+    chdir $dir;
+    if ($dir =~ /\//) {
+       print STDERR "only direct subdirectories allowed in list files";
+    }
+    $curdir .= "/$dir";
+
+    &RunList( $listfile );
+    print "\n" if $showProgress; # Terminate line from progress output
+    chdir $savedir;
+    $curdir = $savecurdir;
+    $srcdir = $savesrcdir;
+}
+# ---------------------------------------------------------------------------
+# Run the programs listed in the file given as the argument. 
+# This file describes the tests in the format
+#  programname number-of-processes [ key=value ... ]
+# If the second value is not given, the default value is used.
+# 
+sub RunList { 
+    my $LIST = "LIST$depth"; $depth++;
+    my $listfile = $_[0];
+    my $ResultTest = "";
+    my $InitForRun = "";
+    my $listfileSource = $listfile;
+
+    print "Looking in $curdir/$listfile\n" if $debug;
+    if (! -s "$listfile" && -s "$srcdir/$curdir/$listfile" ) {
+       $listfileSource = "$srcdir/$curdir/$listfile";
+    }
+    open( $LIST, "<$listfileSource" ) || 
+       die "Could not open $listfileSource\n";
+    while (<$LIST>) {
+       # Check for stop file
+       if (-s $stopfile) {
+           # Exit because we found a stopfile
+           print STDERR "Terminating test because stopfile $stopfile found\n";
+           last;
+       }
+       # Skip comments
+       s/#.*//g;
+       # Remove any trailing newlines/returns
+       s/\r?\n//;
+        # Remove any leading whitespace
+        s/^\s*//;
+       # Some tests require that support routines are built first
+       # This is specified with !<dir>:<target>
+       if (/^\s*\!([^:]*):(.*)/) {
+           # Hack: just execute in a subshell.  This discards any 
+           # output.
+           `cd $1 && make $2`;
+           next;
+       }
+       # List file entries have the form:
+       # program [ np [ name=value ... ] ]
+       # See files errhan/testlist, init/testlist, and spawn/testlist
+       # for examples of using the key=value form
+       my @args = split(/\s+/,$_);
+       my $programname = $args[0];
+       my $np = "";
+       my $ResultTest = "";
+       my $InitForRun = "";
+       my $timeLimit  = "";
+       my $progArgs   = "";
+       my $mpiexecArgs = "$execarg";
+       my $requiresStrict = "";
+       my $requiresMPIX   = "";
+       my $progEnv    = "";
+       my $mpiVersion = "";
+        my $xfail = "";
+       if ($#args >= 1) { $np = $args[1]; }
+       # Process the key=value arguments
+       for (my $i=2; $i <= $#args; $i++) {
+           if ($args[$i] =~ /([^=]+)=(.*)/) {
+               my $key = $1;
+               my $value = $2;
+               if ($key eq "resultTest") {
+                   $ResultTest = $value;
+               }
+               elsif ($key eq "init") {
+                   $InitForRun = $value;
+               }
+               elsif ($key eq "timeLimit") {
+                   $timeLimit = $value;
+               }
+               elsif ($key eq "arg") {
+                   $progArgs = "$progArgs $value";
+               }
+               elsif ($key eq "mpiexecarg") {
+                   $mpiexecArgs = "$mpiexecArgs $value";
+               }
+               elsif ($key eq "env") {
+                   $progEnv = "$progEnv $value";
+               }
+               elsif ($key eq "mpiversion") {
+                   $mpiVersion = $value;
+               }
+               elsif ($key eq "strict") {
+                   $requiresStrict = $value
+               }
+               elsif ($key eq "mpix") {
+                   $requiresMPIX = $value
+               }
+                elsif ($key eq "xfail") {
+                    if ($value eq "") {
+                        print STDERR "\"xfail=\" requires an argument\n";
+                    }
+                    $xfail = $value;
+                }
+               else {
+                   print STDERR "Unrecognized key $key in $listfileSource\n";
+               }
+           }
+       }
+
+       # skip empty lines
+       if ($programname eq "") { next; }
+
+       if ($np eq "") { $np = $np_default; }
+       if ($np_max > 0 && $np > $np_max) { $np = $np_max; }
+
+        # allows us to accurately output TAP test numbers without disturbing the
+        # original totals that have traditionally been reported
+        #
+        # These "unless" blocks are ugly, but permit us to honor skipping
+        # criteria for directories as well without counting directories as tests
+        # in our XML/TAP output.
+        unless (-d $programname) {
+            $total_seen++;
+        }
+
+       # If a minimum MPI version is specified, check against the
+       # available MPI.  If the version is unknown, we ignore this
+       # test (thus, all tests will be run).  
+       if ($mpiVersion ne "" && $MPIMajorVersion ne "unknown" &&
+           $MPIMinorVersion ne "unknown") {
+           my ($majorReq,$minorReq) = split(/\./,$mpiVersion);
+            if ($majorReq > $MPIMajorVersion or
+                ($majorReq == $MPIMajorVersion && $minorReq > $MPIMinorVersion))
+            {
+                unless (-d $programname) {
+                    SkippedTest($programname, $np, $workdir, "requires MPI version $mpiVersion");
+                }
+                next;
+            }
+       }
+       # Check whether strict is required by MPI but not by the
+       # test (use strict=false for tests that use non-standard extensions)
+        if (lc($requiresStrict) eq "false" && lc($testIsStrict) eq "true") {
+            unless (-d $programname) {
+                SkippedTest($programname, $np, $workdir, "non-strict test, strict MPI mode requested");
+            }
+            next;
+        }
+
+        if (lc($testIsStrict) eq "true") {
+            # Strict MPI testing was requested, so assume that a non-MPICH MPI
+            # implementation is being tested and the "xfail" implementation
+            # assumptions do not hold.
+            $xfail = '';
+        }
+
+        if (lc($requiresMPIX) eq "true" && lc($MPIHasMPIX) eq "no") {
+            unless (-d $programname) {
+                SkippedTest($programname, $np, $workdir, "tests MPIX extensions, MPIX testing disabled");
+            }
+            next;
+        }
+
+       if (-d $programname) {
+           # If a directory, go into the that directory and 
+           # look for a new list file
+           &ProcessDir( $programname, $listfile );
+       }
+       else {
+           $total_run++;
+           if (&BuildMPIProgram( $programname, $xfail ) == 0) {
+               if ($batchRun == 1) {
+                   &AddMPIProgram( $programname, $np, $ResultTest, 
+                                   $InitForRun, $timeLimit, $progArgs,
+                                   $progEnv, $mpiexecArgs, $xfail );
+               }
+               else {
+                   &RunMPIProgram( $programname, $np, $ResultTest, 
+                                   $InitForRun, $timeLimit, $progArgs, 
+                                   $progEnv, $mpiexecArgs, $xfail );
+               }
+           }
+           elsif ($xfail ne '') {
+               # We expected to run this program, so failure to build
+               # is an error
+               $found_error = 1;
+               $err_count++;
+           }
+           if ($batchRun == 0) {
+               &CleanUpAfterRun( $programname );
+           }
+       }
+    }
+    close( $LIST );
+}
+#
+# This routine tries to run all of the files in the current
+# directory
+sub ProcessImplicitList {
+    # The default is to run every file in the current directory.
+    # If there are no built programs, build and run every file
+    # WARNING: This assumes that anything executable should be run as
+    # an MPI test.
+    $found_exec = 0;
+    $found_src  = 0;
+    open (PGMS, "ls -1 |" ) || die "Cannot list directory\n";
+    while (<PGMS>) {
+       s/\r?\n//;
+       $programname = $_;
+       if (-d $programname) { next; }  # Ignore directories
+       if ($programname eq "runtests") { next; } # Ignore self
+       if ($programname eq "checktests") { next; } # Ignore helper
+       if ($programname eq "configure") { next; } # Ignore configure script
+       if ($programname eq "config.status") { next; } # Ignore configure helper
+       if (-x $programname) { $found_exec++; }
+       if ($programname =~ /\.[cf]$/) { $found_src++; } 
+    }
+    close PGMS;
+    
+    if ($found_exec) {
+       print "Found executables\n" if $debug;
+       open (PGMS, "ls -1 |" ) || die "Cannot list programs\n";
+       while (<PGMS>) {
+           # Check for stop file
+           if (-s $stopfile) {
+               # Exit because we found a stopfile
+               print STDERR "Terminating test because stopfile $stopfile found\n";
+               last;
+           }
+           s/\r?\n//;
+           $programname = $_;
+           if (-d $programname) { next; }  # Ignore directories
+           if ($programname eq "runtests") { next; } # Ignore self
+           if (-x $programname) {
+               $total_run++;
+               &RunMPIProgram( $programname, $np_default, "", "", "", "", "", "", "" );
+           }
+       }
+       close PGMS;
+    }
+    elsif ($found_src) { 
+       print "Found source files\n" if $debug;
+       open (PGMS, "ls -1 *.c |" ) || die "Cannot list programs\n";
+       while (<PGMS>) {
+           if (-s $stopfile) {
+               # Exit because we found a stopfile
+               print STDERR "Terminating test because stopfile $stopfile found\n";
+               last;
+           }
+           s/\r?\n//;
+           $programname = $_;
+           # Skip messages from ls about no files
+           if (! -s $programname) { next; }
+           $programname =~ s/\.c//;
+           $total_run++;
+           if (&BuildMPIProgram( $programname, "") == 0) {
+               &RunMPIProgram( $programname, $np_default, "", "", "", "", "", "", "" );
+           }
+           else {
+               # We expected to run this program, so failure to build
+               # is an error
+               $found_error = 1;
+               $err_count++;
+           }
+           &CleanUpAfterRun( $programname );
+       }
+       close PGMS;
+    }
+}
+# Run the program.  
+# ToDo: Add a way to limit the time that any particular program may run.
+# The arguments are
+#    name of program, number of processes, name of routine to check results
+#    init for testing, timelimit, and any additional program arguments
+# If the 3rd arg is not present, the a default that simply checks that the
+# return status is 0 and that the output is " No Errors" is used.
+sub RunMPIProgram {
+    my ($programname,$np,$ResultTest,$InitForTest,$timeLimit,$progArgs,$progEnv,$mpiexecArgs,$xfail) = @_;
+    my $found_error   = 0;
+    my $found_noerror = 0;
+    my $inline = "";
+
+    &RunPreMsg( $programname, $np, $curdir );
+
+    unlink "err";
+
+    # Set a default timeout on tests (3 minutes for now)
+    my $timeout = $defaultTimeLimit;
+    if (defined($timeLimit) && $timeLimit =~ /^\d+$/) {
+       $timeout = $timeLimit;
+    }
+    $ENV{"MPIEXEC_TIMEOUT"} = $timeout;
+    
+    # Run the optional setup routine. For example, the timeout tests could
+    # be set to a shorter timeout.
+    if ($InitForTest ne "") {
+       &$InitForTest();
+    }
+    print STDOUT "Env includes $progEnv\n" if $verbose;
+    print STDOUT "$mpiexec $mpiexecArgs $np_arg $np $program_wrapper ./$programname $progArgs\n" if $verbose;
+    print STDOUT "." if $showProgress;
+    # Save and restore the environment if necessary before running mpiexec.
+    if ($progEnv ne "") {
+       %saveEnv = %ENV;
+       foreach $val (split(/\s+/, $progEnv)) {
+           if ($val =~ /([^=]+)=(.*)/) {
+               $ENV{$1} = $2;
+           }
+           else {
+               print STDERR "Environment variable/value $val not in a=b form\n";
+           }
+       }
+    }
+    open ( MPIOUT, "$mpiexec $np_arg $np $mpiexecArgs $program_wrapper ./$programname $progArgs 2>&1 |" ) ||
+       die "Could not run ./$programname\n";
+    if ($progEnv ne "") {
+       %ENV = %saveEnv;
+    }
+    if ($ResultTest ne "") {
+       # Read and process the output
+       ($found_error, $inline) = &$ResultTest( MPIOUT, $programname );
+    }
+    else {
+       if ($verbose) {
+           $inline = "$mpiexec $np_arg $np $program_wrapper ./$programname\n";
+       }
+       else {
+           $inline = "";
+       }
+       while (<MPIOUT>) {
+           print STDOUT $_ if $verbose;
+           # Skip FORTRAN STOP
+           if (/FORTRAN STOP/) { next; }
+           $inline .= $_;
+           if (/^\s*No [Ee]rrors\s*$/ && $found_noerror == 0) {
+               $found_noerror = 1;
+           }
+           if (! /^\s*No [Ee]rrors\s*$/ && !/^\s*Test Passed\s*$/) {
+               print STDERR "Unexpected output in $programname: $_";
+               if (!$found_error) {
+                   $found_error = 1;
+                   $err_count ++;
+               }
+           }
+       }
+       if ($found_noerror == 0) {
+           print STDERR "Program $programname exited without No Errors\n";
+           if (!$found_error) {
+               $found_error = 1;
+               $err_count ++;
+           }
+       }
+       $rc = close ( MPIOUT );
+       if ($rc == 0) {
+           # Only generate a message if we think that the program
+           # passed the test.
+           if (!$found_error) {
+               $run_status = $?;
+               $signal_num = $run_status & 127;
+               if ($run_status > 255) { $run_status >>= 8; }
+               print STDERR "Program $programname exited with non-zero status $run_status\n";
+               if ($signal_num != 0) {
+                   print STDERR "Program $programname exited with signal $signal_num\n";
+               }
+               $found_error = 1;
+               $err_count ++;
+           }
+       }
+    }
+    if ($found_error) {
+       &RunTestFailed( $programname, $np, $curdir, $inline, $xfail );
+    }
+    else { 
+       &RunTestPassed( $programname, $np, $curdir, $xfail );
+    }
+    &RunPostMsg( $programname, $np, $curdir );
+}
+
+# This version simply writes the mpiexec command out, with the output going
+# into a file, and recording the output status of the run.
+sub AddMPIProgram {
+    my ($programname,$np,$ResultTest,$InitForTest,$timeLimit,$progArgs,$progEnv,$mpiexecArgs, $xfail) = @_;
+
+    if (! -x $programname) {
+       print STDERR "Could not find $programname!";
+       return;
+    }
+
+    if ($ResultTest ne "") {
+       # This test really needs to be run manually, with this test
+       # Eventually, we can update this to include handleing in checktests.
+       print STDERR "Run $curdir/$programname with $np processes and use $ResultTest to check the results\n";
+       return;
+    }
+
+    # Set a default timeout on tests (3 minutes for now)
+    my $timeout = $defaultTimeLimit;
+    if (defined($timeLimit) && $timeLimit =~ /^\d+$/) {
+       # On some systems, there is no effective time limit on 
+       # individual mpi program runs.  In that case, we may
+       # want to treat these also as "run manually".
+       $timeout = $timeLimit;
+    }
+    print BATOUT "export MPIEXEC_TIMEOUT=$timeout\n";
+    
+    # Run the optional setup routine. For example, the timeout tests could
+    # be set to a shorter timeout.
+    if ($InitForTest ne "") {
+       &$InitForTest();
+    }
+
+    # For non-MPICH versions of mpiexec, a timeout may require a different
+    # environment variable or command line option (e.g., for Cray aprun, 
+    # the option -t <sec> must be given, there is no environment variable 
+    # to set the timeout.
+    $extraArgs = "";
+    if (defined($timeoutArgPattern) && $timeoutArgPattern ne "") {
+       my $timeArg = $timeoutArgPattern;
+       $timeoutArg =~ s/<SEC>/$timeout/;
+       $extraArgs .= $timeoutArg
+    }
+
+    print STDOUT "Env includes $progEnv\n" if $verbose;
+    print STDOUT "$mpiexec $np_arg $np $extraArgs $program_wrapper ./$programname $progArgs\n" if $verbose;
+    print STDOUT "." if $showProgress;
+    # Save and restore the environment if necessary before running mpiexec.
+    if ($progEnv ne "") {
+       # Need to fix: 
+       # save_NAME_is_set=is old name set
+       # save_NAME=oldValue
+       # export NAME=newvalue
+       # (run) 
+       # export NAME=oldValue (if set!)
+       print STDERR "Batch output does not permit changes to environment\n";
+    }
+    # The approach here is to move the test codes to a single directory from
+    # which they can be run; this avoids complex code to change directories
+    # and ensure that the output goes "into the right place".
+    $testCount++;
+    rename $programname, "$batrundir/$programname";
+    print BATOUT "echo \"# $mpiexec $np_arg $np $extraArgs $mpiexecArgs $program_wrapper $curdir/$programname $progArgs\" > runtests.$testCount.out\n";
+    # Some programs expect to run in the same directory as the executable
+    print BATOUT "$mpiexec $np_arg $np $extraArgs $mpiexecArgs $program_wrapper ./$programname $progArgs >> runtests.$testCount.out 2>&1\n";
+    print BATOUT "echo \$? > runtests.$testCount.status\n";
+}
+
+# 
+# Return value is 0 on success, non zero on failure
+sub BuildMPIProgram {
+    my $programname = shift;
+    if (! -x $programname) {
+        die "Could not find $programname. Aborting.\n";
+    }
+    return 0;
+    # THE FOLLOWING IS DISABLED.
+    my $xfail = shift;
+    my $rc = 0;
+    if ($verbose) { print STDERR "making $programname\n"; }
+    if (! -x $programname) { $remove_this_pgm = 1; }
+    else { $remove_this_pgm = 0; }
+    my $output = `make $programname 2>&1`;
+    $rc = $?;
+    if ($rc > 255) { $rc >>= 8; }
+    if (! -x $programname) {
+       print STDERR "Failed to build $programname; $output\n";
+       if ($rc == 0) {
+           $rc = 1;
+       }
+       # Add a line to the summary file describing the failure
+       # This will ensure that failures to build will end up 
+       # in the summary file (which is otherwise written by the
+       # RunMPIProgram step)
+       &RunPreMsg( $programname, $np, $curdir );
+       &RunTestFailed( $programname, $np, $curdir, "Failed to build $programname; $output", $xfail );
+       &RunPostMsg( $programname, $np, $curdir );
+    }
+    return $rc;
+}
+
+sub CleanUpAfterRun {
+    my $programname = $_[0];
+    
+    # Check for that this program has exited.  If it is still running,
+    # issue a warning and leave the application.  Of course, this
+    # check is complicated by the lack of a standard access to the 
+    # running processes for this user in Unix.
+    @stillRunning = &FindRunning( $programname );
+
+    if ($#stillRunning > -1) {
+       print STDERR "Some programs ($programname) may still be running:\npids = ";
+       for (my $i=0; $i <= $#stillRunning; $i++ ) {
+           print STDERR $stillRunning[$i] . " ";
+       }
+       print STDERR "\n";
+       # Remind the user that the executable remains; we leave it around
+       # to allow the programmer to debug the running program, for which
+       # the executable is needed.
+       print STDERR "The executable ($programname) will not be removed.\n";
+    }
+    else {
+       if ($remove_this_pgm && $clean_pgms) {
+           unlink $programname, "$programname.o";
+       }
+       $remove_this_pgm = 0;
+    }
+}
+# ----------------------------------------------------------------------------
+sub FindRunning { 
+    my $programname = $_[0];
+    my @pids = ();
+
+    my $logname = $ENV{'USER'};
+    my $pidloc = 1;
+    my $rc = open PSFD, "ps auxw -U $logname 2>&1 |";
+
+    if ($rc == 0) { 
+       $rc = open PSFD, "ps -fu $logname 2>&1 |";
+    }
+    if ($rc == 0) {
+       print STDERR "Could not execute ps command\n";
+       return @pids;
+    }
+
+    while (<PSFD>) {
+       if (/$programname/) {
+           @fields = split(/\s+/);
+           my $pid = $fields[$pidloc];
+           # Check that we've found a numeric pid
+           if ($pid =~ /^\d+$/) {
+               $pids[$#pids + 1] = $pid;
+           }
+       }
+    }
+    close PSFD;
+
+    return @pids;
+}
+# ----------------------------------------------------------------------------
+#
+# TestStatus is a special test that reports success *only* when the 
+# status return is NONZERO
+sub TestStatus {
+    my $MPIOUT = $_[0];
+    my $programname = $_[1];
+    my $found_error = 0;
+
+    my $inline = "";
+    while (<$MPIOUT>) {
+       #print STDOUT $_ if $verbose;
+       # Skip FORTRAN STOP
+       if (/FORTRAN STOP/) { next; }
+       $inline .= $_;
+       # ANY output is an error. We have the following output
+       # exception for the Hydra process manager.
+       if (/=*/) { last; }
+       if (! /^\s*$/) {
+           print STDERR "Unexpected output in $programname: $_";
+           if (!$found_error) {
+               $found_error = 1;
+               $err_count ++;
+           }
+       }
+    }
+    $rc = close ( MPIOUT );
+    if ($rc == 0) {
+       $run_status = $?;
+       $signal_num = $run_status & 127;
+       if ($run_status > 255) { $run_status >>= 8; }
+    }
+    else {
+       # This test *requires* non-zero return codes
+        if (!$found_error) {
+           $found_error = 1;
+           $err_count ++;
+        }
+       $inline .= "$mpiexec returned a zero status but the program returned a nonzero status\n";
+    }
+    return ($found_error,$inline);
+}
+#
+# TestTimeout is a special test that reports success *only* when the 
+# status return is NONZERO and there are no processes left over.
+# This test currently checks only for the return status.
+sub TestTimeout {
+    my $MPIOUT = $_[0];
+    my $programname = $_[1];
+    my $found_error = 0;
+
+    my $inline = "";
+    while (<$MPIOUT>) {
+       #print STDOUT $_ if $verbose;
+       # Skip FORTRAN STOP
+       if (/FORTRAN STOP/) { next; }
+       $inline .= $_;
+       if (/[Tt]imeout/) { next; }
+       # Allow 'signaled with Interrupt' (see gforker mpiexec)
+       if (/signaled with Interrupt/) { next; }
+       # Allow 'job ending due to env var MPIEXEC_TIMEOUT' (mpd)
+       if (/job ending due to env var MPIEXEC_TIMEOUT/) { next; }
+       # Allow 'APPLICATION TIMED OUT' (hydra)
+       if (/\[mpiexec@.*\] APPLICATION TIMED OUT/) { last; }
+       # ANY output is an error (other than timeout) 
+       if (! /^\s*$/) {
+           print STDERR "Unexpected output in $programname: $_";
+           if (!$found_error) {
+               $found_error = 1;
+               $err_count ++;
+           }
+       }
+    }
+    $rc = close ( MPIOUT );
+    if ($rc == 0) {
+       $run_status = $?;
+       $signal_num = $run_status & 127;
+       if ($run_status > 255) { $run_status >>= 8; }
+    }
+    else {
+       # This test *requires* non-zero return codes
+       if (!$found_error) {
+           $found_error = 1;
+           $err_count ++;
+        }
+       $inline .= "$mpiexec returned a zero status but the program returned a nonzero status\n";
+    }
+    #
+    # Here should go a check of the processes
+    # open( PFD, "ps -fu $LOGNAME | grep -v grep | grep $programname |" );
+    # while (<PFD>) {
+    #     
+    # }
+    # close PFD;
+    return ($found_error,$inline);
+}
+#
+# TestErrFatal is a special test that reports success *only* when the 
+# status return is NONZERO; it ignores error messages
+sub TestErrFatal {
+    my $MPIOUT = $_[0];
+    my $programname = $_[1];
+    my $found_error = 0;
+
+    my $inline = "";
+    while (<$MPIOUT>) {
+       #print STDOUT $_ if $verbose;
+       # Skip FORTRAN STOP
+       if (/FORTRAN STOP/) { next; }
+       $inline .= $_;
+       # ALL output is allowed.
+    }
+    $rc = close ( MPIOUT );
+    if ($rc == 0) {
+       $run_status = $?;
+       $signal_num = $run_status & 127;
+       if ($run_status > 255) { $run_status >>= 8; }
+    }
+    else {
+       # This test *requires* non-zero return codes
+       if (!$found_error) {
+           $found_error = 1;
+           $err_count ++;
+       }
+       $inline .= "$mpiexec returned a zero status but the program returned a nonzero status\n";
+    }
+    return ($found_error,$inline);
+}
+
+# ----------------------------------------------------------------------------
+# Output routines:
+#  RunPreMsg( programname, np, workdir ) - Call before running a program
+#  RunTestFailed, RunTestPassed - Call after test
+#  RunPostMsg               - Call at end of each test
+#
+sub RunPreMsg {
+    my ($programname,$np,$workdir) = @_;
+    if ($xmloutput) {
+       print XMLOUT "<MPITEST>$newline<NAME>$programname</NAME>$newline";
+       print XMLOUT "<NP>$np</NP>$newline";
+       print XMLOUT "<WORKDIR>$workdir</WORKDIR>$newline";
+    }
+}
+sub RunPostMsg {
+    my ($programname, $np, $workdir) = @_;
+    if ($xmloutput) {
+       print XMLOUT "</MPITEST>$newline";
+    }
+}
+sub RunTestPassed {
+    my ($programname, $np, $workdir, $xfail) = @_;
+    if ($xmloutput) {
+       print XMLOUT "<STATUS>pass</STATUS>$newline";
+    }
+    if ($tapoutput) {
+        my $xfailstr = '';
+        if ($xfail ne '') {
+            $xfailstr = " # TODO $xfail";
+        }
+        print TAPOUT "ok ${total_run} - $workdir/$programname ${np}${xfailstr}\n";
+    }
+}
+sub RunTestFailed {
+    my $programname = shift;
+    my $np = shift;
+    my $workdir = shift;
+    my $output = shift;
+    my $xfail = shift;
+
+    if ($xmloutput) {
+        my $xout = $output;
+        # basic escapes that wreck the XML output
+        $xout =~ s/</\*AMP\*lt;/g;
+        $xout =~ s/>/\*AMP\*gt;/g;
+        $xout =~ s/&/\*AMP\*amp;/g;
+        $xout =~ s/\*AMP\*/&/g;
+        # TODO: Also capture any non-printing characters (XML doesn't like them
+        # either).
+       print XMLOUT "<STATUS>fail</STATUS>$newline";
+       print XMLOUT "<TESTDIFF>$newline$xout</TESTDIFF>$newline";
+    }
+
+    if ($tapoutput) {
+        my $xfailstr = '';
+        if ($xfail ne '') {
+            $xfailstr = " # TODO $xfail";
+        }
+        print TAPOUT "not ok ${total_run} - $workdir/$programname ${np}${xfailstr}\n";
+        print TAPOUT "  ---\n";
+        print TAPOUT "  Directory: $workdir\n";
+        print TAPOUT "  File: $programname\n";
+        print TAPOUT "  Num-procs: $np\n";
+        print TAPOUT "  Date: \"" . localtime . "\"\n";
+
+        # The following would be nice, but it leads to unfortunate formatting in
+        # the Jenkins web output for now.  Using comment lines instead, since
+        # they are easier to read/find in a browser.
+##        print TAPOUT "  Output: |\n";
+##        # using block literal format, requires that all chars are printable
+##        # UTF-8 (or UTF-16, but we won't encounter that)
+##        foreach my $line (split m/\r?\n/, $output) {
+##            chomp $line;
+##            # 4 spaces, 2 for TAP indent, 2 more for YAML block indent
+##            print TAPOUT "    $line\n";
+##        }
+
+        print TAPOUT "  ...\n";
+
+        # Alternative to the "Output:" YAML block literal above.  Do not put any
+        # spaces before the '#', this causes some TAP parsers (including Perl's
+        # TAP::Parser) to treat the line as "unknown" instead of a proper
+        # comment.
+        print TAPOUT "## Test output (expected 'No Errors'):\n";
+        foreach my $line (split m/\r?\n/, $output) {
+            chomp $line;
+            print TAPOUT "## $line\n";
+        }
+    }
+}
+
+sub SkippedTest {
+    my $programname = shift;
+    my $np = shift;
+    my $workdir = shift;
+    my $reason = shift;
+
+    # simply omit from the XML output
+
+    if ($tapoutput) {
+        print TAPOUT "ok ${total_seen} - $workdir/$programname $np  # SKIP $reason\n";
+    }
+}
+
+# ----------------------------------------------------------------------------
+# Alternate init routines
+sub InitQuickTimeout {
+    $ENV{"MPIEXEC_TIMEOUT"} = 10;
+}
diff --git a/teshsuite/smpi/mpich3-test/testlist b/teshsuite/smpi/mpich3-test/testlist
new file mode 100644 (file)
index 0000000..2110a22
--- /dev/null
@@ -0,0 +1,23 @@
+# The next item ensures that the support routines are built first
+!util:all
+attr 
+#basic
+coll
+comm
+datatype
+#errhan
+group
+#info
+init
+#mpi_t
+pt2pt
+#
+#spawn
+#topo
+#perf
+#io
+f77
+#cxx
+#
+#
+
diff --git a/teshsuite/smpi/mpich3-test/util/mtest.c b/teshsuite/smpi/mpich3-test/util/mtest.c
new file mode 100644 (file)
index 0000000..6f40201
--- /dev/null
@@ -0,0 +1,1712 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2001 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include "mpitest.h"
+#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
+#include <stdio.h>
+#endif
+#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS)
+#include <stdlib.h>
+#endif
+#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
+#include <string.h>
+#endif
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+/* The following two includes permit the collection of resource usage
+   data in the tests
+ */
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+#include <errno.h>
+
+
+/*
+ * Utility routines for writing MPI tests.
+ *
+ * We check the return codes on all MPI routines (other than INIT)
+ * to allow the program that uses these routines to select MPI_ERRORS_RETURN
+ * as the error handler.  We do *not* set MPI_ERRORS_RETURN because
+ * the code that makes use of these routines may not check return
+ * codes.
+ * 
+ */
+
+static void MTestRMACleanup( void );
+static void MTestResourceSummary( FILE * );
+
+/* Here is where we could put the includes and definitions to enable
+   memory testing */
+
+static int dbgflag = 0;         /* Flag used for debugging */
+static int wrank = -1;          /* World rank */
+static int verbose = 0;         /* Message level (0 is none) */
+static int returnWithVal = 0;   /* Allow programs to return with a non-zero 
+                                  if there was an error (may cause problems
+                                  with some runtime systems) */
+static int usageOutput = 0;     /* */
+
+/* Provide backward portability to MPI 1 */
+#ifndef MPI_VERSION
+#define MPI_VERSION 1
+#endif
+#if MPI_VERSION < 2
+#define MPI_THREAD_SINGLE 0
+#endif
+
+/* 
+ * Initialize and Finalize MTest
+ */
+
+/*
+   Initialize MTest, initializing MPI if necessary.  
+
+ Environment Variables:
++ MPITEST_DEBUG - If set (to any value), turns on debugging output
+. MPITEST_THREADLEVEL_DEFAULT - If set, use as the default "provided"
+                                level of thread support.  Applies to 
+                                MTest_Init but not MTest_Init_thread.
+- MPITEST_VERBOSE - If set to a numeric value, turns on that level of
+  verbose output.  This is used by the routine 'MTestPrintfMsg'
+
+*/
+void MTest_Init_thread( int *argc, char ***argv, int required, int *provided )
+{
+    int flag;
+    char *envval = 0;
+
+    MPI_Initialized( &flag );
+    if (!flag) {
+       /* Permit an MPI that claims only MPI 1 but includes the 
+          MPI_Init_thread routine (e.g., IBM MPI) */
+#if MPI_VERSION >= 2 || defined(HAVE_MPI_INIT_THREAD)
+       MPI_Init_thread( argc, argv, required, provided );
+#else
+       MPI_Init( argc, argv );
+       *provided = -1;
+#endif
+    }
+    /* Check for debugging control */
+    if (getenv( "MPITEST_DEBUG" )) {
+       dbgflag = 1;
+       MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+    }
+
+    /* Check for verbose control */
+    envval = getenv( "MPITEST_VERBOSE" );
+    if (envval) {
+       char *s;
+       long val = strtol( envval, &s, 0 );
+       if (s == envval) {
+           /* This is the error case for strtol */
+           fprintf( stderr, "Warning: %s not valid for MPITEST_VERBOSE\n", 
+                    envval );
+           fflush( stderr );
+       }
+       else {
+           if (val >= 0) {
+               verbose = val;
+           }
+           else {
+               fprintf( stderr, "Warning: %s not valid for MPITEST_VERBOSE\n", 
+                        envval );
+               fflush( stderr );
+           }
+       }
+    }
+    /* Check for option to return success/failure in the return value of main */
+    envval = getenv( "MPITEST_RETURN_WITH_CODE" );
+    if (envval) {
+       if (strcmp( envval, "yes" ) == 0 ||
+           strcmp( envval, "YES" ) == 0 ||
+           strcmp( envval, "true" ) == 0 ||
+           strcmp( envval, "TRUE" ) == 0) {
+           returnWithVal = 1;
+       }
+       else if (strcmp( envval, "no" ) == 0 ||
+           strcmp( envval, "NO" ) == 0 ||
+           strcmp( envval, "false" ) == 0 ||
+           strcmp( envval, "FALSE" ) == 0) {
+           returnWithVal = 0;
+       }
+       else {
+           fprintf( stderr, 
+                    "Warning: %s not valid for MPITEST_RETURN_WITH_CODE\n", 
+                    envval );
+           fflush( stderr );
+       }
+    }
+    
+    /* Print rusage data if set */
+    if (getenv( "MPITEST_RUSAGE" )) {
+       usageOutput = 1;
+    }
+}
+/* 
+ * Initialize the tests, using an MPI-1 style init.  Supports 
+ * MTEST_THREADLEVEL_DEFAULT to test with user-specified thread level
+ */
+void MTest_Init( int *argc, char ***argv )
+{
+    int provided;
+#if MPI_VERSION >= 2 || defined(HAVE_MPI_INIT_THREAD)
+    const char *str = 0;
+    int        threadLevel;
+
+    threadLevel = MPI_THREAD_SINGLE;
+    str = getenv( "MTEST_THREADLEVEL_DEFAULT" );
+    if (!str) str = getenv( "MPITEST_THREADLEVEL_DEFAULT" );
+    if (str && *str) {
+       if (strcmp(str,"MULTIPLE") == 0 || strcmp(str,"multiple") == 0) {
+           threadLevel = MPI_THREAD_MULTIPLE;
+       }
+       else if (strcmp(str,"SERIALIZED") == 0 || 
+                strcmp(str,"serialized") == 0) {
+           threadLevel = MPI_THREAD_SERIALIZED;
+       }
+       else if (strcmp(str,"FUNNELED") == 0 || strcmp(str,"funneled") == 0) {
+           threadLevel = MPI_THREAD_FUNNELED;
+       }
+       else if (strcmp(str,"SINGLE") == 0 || strcmp(str,"single") == 0) {
+           threadLevel = MPI_THREAD_SINGLE;
+       }
+       else {
+           fprintf( stderr, "Unrecognized thread level %s\n", str );
+           /* Use exit since MPI_Init/Init_thread has not been called. */
+           exit(1);
+       }
+    }
+    MTest_Init_thread( argc, argv, threadLevel, &provided );
+#else
+    /* If the MPI_VERSION is 1, there is no MPI_THREAD_xxx defined */
+    MTest_Init_thread( argc, argv, 0, &provided );
+#endif    
+}
+
+/*
+  Finalize MTest.  errs is the number of errors on the calling process; 
+  this routine will write the total number of errors over all of MPI_COMM_WORLD
+  to the process with rank zero, or " No Errors".
+  It does *not* finalize MPI.
+ */
+void MTest_Finalize( int errs )
+{
+    int rank, toterrs, merr;
+
+    merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+    if (merr) MTestPrintError( merr );
+
+    merr = MPI_Reduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, 
+                     0, MPI_COMM_WORLD );
+    if (merr) MTestPrintError( merr );
+    if (rank == 0) {
+       if (toterrs) {
+           printf( " Found %d errors\n", toterrs );
+       }
+       else {
+           printf( " No Errors\n" );
+       }
+       fflush( stdout );
+    }
+    
+    if (usageOutput) 
+       MTestResourceSummary( stdout );
+
+
+    /* Clean up any persistent objects that we allocated */
+    MTestRMACleanup();
+}
+/* ------------------------------------------------------------------------ */
+/* This routine may be used instead of "return 0;" at the end of main; 
+   it allows the program to use the return value to signal success or failure. 
+ */
+int MTestReturnValue( int errors )
+{
+    if (returnWithVal) return errors ? 1 : 0;
+    return 0;
+}
+/* ------------------------------------------------------------------------ */
+
+/*
+ * Miscellaneous utilities, particularly to eliminate OS dependencies
+ * from the tests.
+ * MTestSleep( seconds )
+ */
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+void MTestSleep( int sec )
+{
+    Sleep( 1000 * sec );
+}
+#else
+#include <unistd.h>
+void MTestSleep( int sec )
+{
+    sleep( sec );
+}
+#endif
+
+/*
+ * Datatypes
+ *
+ * Eventually, this could read a description of a file.  For now, we hard 
+ * code the choices.
+ *
+ * Each kind of datatype has the following functions:
+ *    MTestTypeXXXInit     - Initialize a send buffer for that type
+ *    MTestTypeXXXInitRecv - Initialize a receive buffer for that type
+ *    MTestTypeXXXFree     - Free any buffers associate with that type
+ *    MTestTypeXXXCheckbuf - Check that the buffer contains the expected data
+ * These routines work with (nearly) any datatype that is of type XXX, 
+ * allowing the test codes to create a variety of contiguous, vector, and
+ * indexed types, then test them by calling these routines.
+ *
+ * Available types (for the XXX) are
+ *    Contig   - Simple contiguous buffers
+ *    Vector   - Simple strided "vector" type
+ *    Indexed  - Indexed datatype.  Only for a count of 1 instance of the 
+ *               datatype
+ */
+static int datatype_index = 0;
+
+/* ------------------------------------------------------------------------ */
+/* Datatype routines for contiguous datatypes                               */
+/* ------------------------------------------------------------------------ */
+/* 
+ * Setup contiguous buffers of n copies of a datatype.
+ */
+static void *MTestTypeContigInit( MTestDatatype *mtype )
+{
+    MPI_Aint size;
+    int merr;
+
+    if (mtype->count > 0) {
+       signed char *p;
+       int  i, totsize;
+       merr = MPI_Type_extent( mtype->datatype, &size );
+       if (merr) MTestPrintError( merr );
+       totsize = size * mtype->count;
+       if (!mtype->buf) {
+           mtype->buf = (void *) malloc( totsize );
+       }
+       p = (signed char *)(mtype->buf);
+       if (!p) {
+           /* Error - out of memory */
+           MTestError( "Out of memory in type buffer init" );
+       }
+       for (i=0; i<totsize; i++) {
+           p[i] = 0xff ^ (i & 0xff);
+       }
+    }
+    else {
+       if (mtype->buf) {
+           free( mtype->buf );
+       }
+       mtype->buf = 0;
+    }
+    return mtype->buf;
+}
+
+/* 
+ * Setup contiguous buffers of n copies of a datatype.  Initialize for
+ * reception (e.g., set initial data to detect failure)
+ */
+static void *MTestTypeContigInitRecv( MTestDatatype *mtype )
+{
+    MPI_Aint size;
+    int      merr;
+
+    if (mtype->count > 0) {
+       signed char *p;
+       int  i, totsize;
+       merr = MPI_Type_extent( mtype->datatype, &size );
+       if (merr) MTestPrintError( merr );
+       totsize = size * mtype->count;
+       if (!mtype->buf) {
+           mtype->buf = (void *) malloc( totsize );
+       }
+       p = (signed char *)(mtype->buf);
+       if (!p) {
+           /* Error - out of memory */
+           MTestError( "Out of memory in type buffer init" );
+       }
+       for (i=0; i<totsize; i++) {
+           p[i] = 0xff;
+       }
+    }
+    else {
+       if (mtype->buf) {
+           free( mtype->buf );
+       }
+       mtype->buf = 0;
+    }
+    return mtype->buf;
+}
+static void *MTestTypeContigFree( MTestDatatype *mtype )
+{
+    if (mtype->buf) {
+       free( mtype->buf );
+       mtype->buf = 0;
+    }
+    return 0;
+}
+static int MTestTypeContigCheckbuf( MTestDatatype *mtype )
+{
+    unsigned char *p;
+    unsigned char expected;
+    int  i, totsize, err = 0, merr;
+    MPI_Aint size;
+
+    p = (unsigned char *)mtype->buf;
+    if (p) {
+       merr = MPI_Type_extent( mtype->datatype, &size );
+       if (merr) MTestPrintError( merr );
+       totsize = size * mtype->count;
+       for (i=0; i<totsize; i++) {
+           expected = (0xff ^ (i & 0xff));
+           if (p[i] != expected) {
+               err++;
+               if (mtype->printErrors && err < 10) {
+                   printf( "Data expected = %x but got p[%d] = %x\n",
+                           expected, i, p[i] );
+                   fflush( stdout );
+               }
+           }
+       }
+    }
+    return err;
+}
+
+/* ------------------------------------------------------------------------ */
+/* Datatype routines for vector datatypes                                   */
+/* ------------------------------------------------------------------------ */
+
+static void *MTestTypeVectorInit( MTestDatatype *mtype )
+{
+    MPI_Aint size;
+    int      merr;
+
+    if (mtype->count > 0) {
+       unsigned char *p;
+       int  i, j, k, nc, totsize;
+
+       merr = MPI_Type_extent( mtype->datatype, &size );
+       if (merr) MTestPrintError( merr );
+       totsize    = mtype->count * size;
+       if (!mtype->buf) {
+           mtype->buf = (void *) malloc( totsize );
+       }
+       p          = (unsigned char *)(mtype->buf);
+       if (!p) {
+           /* Error - out of memory */
+           MTestError( "Out of memory in type buffer init" );
+       }
+
+       /* First, set to -1 */
+       for (i=0; i<totsize; i++) p[i] = 0xff;
+
+       /* Now, set the actual elements to the successive values.
+          To do this, we need to run 3 loops */
+       nc = 0;
+       /* count is usually one for a vector type */
+       for (k=0; k<mtype->count; k++) {
+           /* For each element (block) */
+           for (i=0; i<mtype->nelm; i++) {
+               /* For each value */
+               for (j=0; j<mtype->blksize; j++) {
+                   p[j] = (0xff ^ (nc & 0xff));
+                   nc++;
+               }
+               p += mtype->stride;
+           }
+       }
+    }
+    else {
+       mtype->buf = 0;
+    }
+    return mtype->buf;
+}
+
+static void *MTestTypeVectorFree( MTestDatatype *mtype )
+{
+    if (mtype->buf) {
+       free( mtype->buf );
+       mtype->buf = 0;
+    }
+    return 0;
+}
+
+/* ------------------------------------------------------------------------ */
+/* Datatype routines for indexed block datatypes                            */
+/* ------------------------------------------------------------------------ */
+
+/* 
+ * Setup a buffer for one copy of an indexed datatype. 
+ */
+static void *MTestTypeIndexedInit( MTestDatatype *mtype )
+{
+    MPI_Aint totsize;
+    int      merr;
+    
+    if (mtype->count > 1) {
+       MTestError( "This datatype is supported only for a single count" );
+    }
+    if (mtype->count == 1) {
+       signed char *p;
+       int  i, k, offset, j;
+
+       /* Allocate the send/recv buffer */
+       merr = MPI_Type_extent( mtype->datatype, &totsize );
+       if (merr) MTestPrintError( merr );
+       if (!mtype->buf) {
+           mtype->buf = (void *) malloc( totsize );
+       }
+       p = (signed char *)(mtype->buf);
+       if (!p) {
+           MTestError( "Out of memory in type buffer init\n" );
+       }
+       /* Initialize the elements */
+       /* First, set to -1 */
+       for (i=0; i<totsize; i++) p[i] = 0xff;
+
+       /* Now, set the actual elements to the successive values.
+          We require that the base type is a contiguous type */
+       k = 0;
+       for (i=0; i<mtype->nelm; i++) {
+           int b;
+           /* Compute the offset: */
+           offset = mtype->displs[i] * mtype->basesize;
+           /* For each element in the block */
+           for (b=0; b<mtype->index[i]; b++) {
+               for (j=0; j<mtype->basesize; j++) {
+                   p[offset+j] = 0xff ^ (k++ & 0xff);
+               }
+               offset += mtype->basesize;
+           }
+       }
+    }
+    else {
+       /* count == 0 */
+       if (mtype->buf) {
+           free( mtype->buf );
+       }
+       mtype->buf = 0;
+    }
+    return mtype->buf;
+}
+
+/* 
+ * Setup indexed buffers for 1 copy of a datatype.  Initialize for
+ * reception (e.g., set initial data to detect failure)
+ */
+static void *MTestTypeIndexedInitRecv( MTestDatatype *mtype )
+{
+    MPI_Aint totsize;
+    int      merr;
+
+    if (mtype->count > 1) {
+       MTestError( "This datatype is supported only for a single count" );
+    }
+    if (mtype->count == 1) {
+       signed char *p;
+       int  i;
+       merr = MPI_Type_extent( mtype->datatype, &totsize );
+       if (merr) MTestPrintError( merr );
+       if (!mtype->buf) {
+           mtype->buf = (void *) malloc( totsize );
+       }
+       p = (signed char *)(mtype->buf);
+       if (!p) {
+           /* Error - out of memory */
+           MTestError( "Out of memory in type buffer init\n" );
+       }
+       for (i=0; i<totsize; i++) {
+           p[i] = 0xff;
+       }
+    }
+    else {
+       /* count == 0 */
+       if (mtype->buf) {
+           free( mtype->buf );
+       }
+       mtype->buf = 0;
+    }
+    return mtype->buf;
+}
+
+static void *MTestTypeIndexedFree( MTestDatatype *mtype )
+{
+    if (mtype->buf) {
+       free( mtype->buf );
+       free( mtype->displs );
+       free( mtype->index );
+       mtype->buf    = 0;
+       mtype->displs = 0;
+       mtype->index  = 0;
+    }
+    return 0;
+}
+
+static int MTestTypeIndexedCheckbuf( MTestDatatype *mtype )
+{
+    unsigned char *p;
+    unsigned char expected;
+    int  i, err = 0, merr;
+    MPI_Aint totsize;
+
+    p = (unsigned char *)mtype->buf;
+    if (p) {
+       int j, k, offset;
+       merr = MPI_Type_extent( mtype->datatype, &totsize );
+       if (merr) MTestPrintError( merr );
+       
+       k = 0;
+       for (i=0; i<mtype->nelm; i++) {
+           int b;
+           /* Compute the offset: */
+           offset = mtype->displs[i] * mtype->basesize;
+           for (b=0; b<mtype->index[i]; b++) {
+               for (j=0; j<mtype->basesize; j++) {
+                   expected = (0xff ^ (k & 0xff));
+                   if (p[offset+j] != expected) {
+                       err++;
+                       if (mtype->printErrors && err < 10) {
+                           printf( "Data expected = %x but got p[%d,%d] = %x\n",
+                                   expected, i,j, p[offset+j] );
+                           fflush( stdout );
+                       }
+                   }
+                   k++;
+               }
+               offset += mtype->basesize;
+           }
+       }
+    }
+    return err;
+}
+
+
+/* ------------------------------------------------------------------------ */
+/* Routines to select a datatype and associated buffer create/fill/check    */
+/* routines                                                                 */
+/* ------------------------------------------------------------------------ */
+
+/* 
+   Create a range of datatypes with a given count elements.
+   This uses a selection of types, rather than an exhaustive collection.
+   It allocates both send and receive types so that they can have the same
+   type signature (collection of basic types) but different type maps (layouts
+   in memory) 
+ */
+int MTestGetDatatypes( MTestDatatype *sendtype, MTestDatatype *recvtype,
+                      int count )
+{
+    int merr;
+    int i;
+
+    sendtype->InitBuf    = 0;
+    sendtype->FreeBuf    = 0;
+    sendtype->CheckBuf   = 0;
+    sendtype->datatype   = 0;
+    sendtype->isBasic    = 0;
+    sendtype->printErrors = 0;
+    recvtype->InitBuf    = 0;
+    recvtype->FreeBuf    = 0;
+
+    recvtype->CheckBuf   = 0;
+    recvtype->datatype   = 0;
+    recvtype->isBasic    = 0;
+    recvtype->printErrors = 0;
+
+    sendtype->buf        = 0;
+    recvtype->buf        = 0;
+
+    /* Set the defaults for the message lengths */
+    sendtype->count      = count;
+    recvtype->count      = count;
+    /* Use datatype_index to choose a datatype to use.  If at the end of the
+       list, return 0 */
+    switch (datatype_index) {
+    case 0:
+       sendtype->datatype = MPI_INT;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_INT;
+       recvtype->isBasic  = 1;
+       break;
+    case 1:
+       sendtype->datatype = MPI_DOUBLE;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_DOUBLE;
+       recvtype->isBasic  = 1;
+       break;
+    case 2:
+       sendtype->datatype = MPI_FLOAT_INT;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_FLOAT_INT;
+       recvtype->isBasic  = 1;
+       break;
+    case 3:
+       merr = MPI_Type_dup( MPI_INT, &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( sendtype->datatype,
+                                  (char*)"dup of MPI_INT" );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_dup( MPI_INT, &recvtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( recvtype->datatype,
+                                  (char*)"dup of MPI_INT" );
+       if (merr) MTestPrintError( merr );
+       /* dup'ed types are already committed if the original type 
+          was committed (MPI-2, section 8.8) */
+       break;
+    case 4:
+       /* vector send type and contiguous receive type */
+       /* These sizes are in bytes (see the VectorInit code) */
+       sendtype->stride   = 3 * sizeof(int);
+       sendtype->blksize  = sizeof(int);
+       sendtype->nelm     = recvtype->count;
+
+       merr = MPI_Type_vector( recvtype->count, 1, 3, MPI_INT, 
+                               &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+        merr = MPI_Type_commit( &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( sendtype->datatype,
+                                  (char*)"int-vector" );
+       if (merr) MTestPrintError( merr );
+       sendtype->count    = 1;
+       recvtype->datatype = MPI_INT;
+       recvtype->isBasic  = 1;
+       sendtype->InitBuf  = MTestTypeVectorInit;
+       recvtype->InitBuf  = MTestTypeContigInitRecv;
+       sendtype->FreeBuf  = MTestTypeVectorFree;
+       recvtype->FreeBuf  = MTestTypeContigFree;
+       sendtype->CheckBuf = 0;
+       recvtype->CheckBuf = MTestTypeContigCheckbuf;
+       break;
+
+    case 5:
+       /* Indexed send using many small blocks and contig receive */
+       sendtype->blksize  = sizeof(int);
+       sendtype->nelm     = recvtype->count;
+       sendtype->basesize = sizeof(int);
+       sendtype->displs   = (int *)malloc( sendtype->nelm * sizeof(int) );
+       sendtype->index    = (int *)malloc( sendtype->nelm * sizeof(int) );
+       if (!sendtype->displs || !sendtype->index) {
+           MTestError( "Out of memory in type init\n" );
+       }
+       /* Make the sizes larger (4 ints) to help push the total
+          size to over 256k in some cases, as the MPICH code as of
+          10/1/06 used large internal buffers for packing non-contiguous
+          messages */
+       for (i=0; i<sendtype->nelm; i++) {
+           sendtype->index[i]   = 4;
+           sendtype->displs[i]  = 5*i;
+       }
+       merr = MPI_Type_indexed( sendtype->nelm,
+                                sendtype->index, sendtype->displs, 
+                                MPI_INT, &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+        merr = MPI_Type_commit( &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( sendtype->datatype,
+                                  (char*)"int-indexed(4-int)" );
+       if (merr) MTestPrintError( merr );
+       sendtype->count    = 1;
+       sendtype->InitBuf  = MTestTypeIndexedInit;
+       sendtype->FreeBuf  = MTestTypeIndexedFree;
+       sendtype->CheckBuf = 0;
+
+       recvtype->datatype = MPI_INT;
+       recvtype->isBasic  = 1;
+       recvtype->count    = count * 4;
+       recvtype->InitBuf  = MTestTypeContigInitRecv;
+       recvtype->FreeBuf  = MTestTypeContigFree;
+       recvtype->CheckBuf = MTestTypeContigCheckbuf;
+       break;
+
+    case 6:
+       /* Indexed send using 2 large blocks and contig receive */
+       sendtype->blksize  = sizeof(int);
+       sendtype->nelm     = 2;
+       sendtype->basesize = sizeof(int);
+       sendtype->displs   = (int *)malloc( sendtype->nelm * sizeof(int) );
+       sendtype->index    = (int *)malloc( sendtype->nelm * sizeof(int) );
+       if (!sendtype->displs || !sendtype->index) {
+           MTestError( "Out of memory in type init\n" );
+       }
+       /* index -> block size */
+       sendtype->index[0]   = (recvtype->count + 1) / 2;
+       sendtype->displs[0]  = 0;
+       sendtype->index[1]   = recvtype->count - sendtype->index[0];
+       sendtype->displs[1]  = sendtype->index[0] + 1; 
+       /* There is a deliberate gap here */
+
+       merr = MPI_Type_indexed( sendtype->nelm,
+                                sendtype->index, sendtype->displs, 
+                                MPI_INT, &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+        merr = MPI_Type_commit( &sendtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( sendtype->datatype,
+                                  (char*)"int-indexed(2 blocks)" );
+       if (merr) MTestPrintError( merr );
+       sendtype->count    = 1;
+       sendtype->InitBuf  = MTestTypeIndexedInit;
+       sendtype->FreeBuf  = MTestTypeIndexedFree;
+       sendtype->CheckBuf = 0;
+
+       recvtype->datatype = MPI_INT;
+       recvtype->isBasic  = 1;
+       recvtype->count    = sendtype->index[0] + sendtype->index[1];
+       recvtype->InitBuf  = MTestTypeContigInitRecv;
+       recvtype->FreeBuf  = MTestTypeContigFree;
+       recvtype->CheckBuf = MTestTypeContigCheckbuf;
+       break;
+
+    case 7:
+       /* Indexed receive using many small blocks and contig send */
+       recvtype->blksize  = sizeof(int);
+       recvtype->nelm     = recvtype->count;
+       recvtype->basesize = sizeof(int);
+       recvtype->displs   = (int *)malloc( recvtype->nelm * sizeof(int) );
+       recvtype->index    = (int *)malloc( recvtype->nelm * sizeof(int) );
+       if (!recvtype->displs || !recvtype->index) {
+           MTestError( "Out of memory in type recv init\n" );
+       }
+       /* Make the sizes larger (4 ints) to help push the total
+          size to over 256k in some cases, as the MPICH code as of
+          10/1/06 used large internal buffers for packing non-contiguous
+          messages */
+       /* Note that there are gaps in the indexed type */
+       for (i=0; i<recvtype->nelm; i++) {
+           recvtype->index[i]   = 4;
+           recvtype->displs[i]  = 5*i;
+       }
+       merr = MPI_Type_indexed( recvtype->nelm,
+                                recvtype->index, recvtype->displs, 
+                                MPI_INT, &recvtype->datatype );
+       if (merr) MTestPrintError( merr );
+        merr = MPI_Type_commit( &recvtype->datatype );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Type_set_name( recvtype->datatype,
+                                  (char*)"recv-int-indexed(4-int)" );
+       if (merr) MTestPrintError( merr );
+       recvtype->count    = 1;
+       recvtype->InitBuf  = MTestTypeIndexedInitRecv;
+       recvtype->FreeBuf  = MTestTypeIndexedFree;
+       recvtype->CheckBuf = MTestTypeIndexedCheckbuf;
+
+       sendtype->datatype = MPI_INT;
+       sendtype->isBasic  = 1;
+       sendtype->count    = count * 4;
+       sendtype->InitBuf  = MTestTypeContigInit;
+       sendtype->FreeBuf  = MTestTypeContigFree;
+       sendtype->CheckBuf = 0;
+       break;
+
+       /* Less commonly used but still simple types */
+    case 8:
+       sendtype->datatype = MPI_SHORT;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_SHORT;
+       recvtype->isBasic  = 1;
+       break;
+    case 9:
+       sendtype->datatype = MPI_LONG;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_LONG;
+       recvtype->isBasic  = 1;
+       break;
+    case 10:
+       sendtype->datatype = MPI_CHAR;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_CHAR;
+       recvtype->isBasic  = 1;
+       break;
+    case 11:
+       sendtype->datatype = MPI_UINT64_T;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_UINT64_T;
+       recvtype->isBasic  = 1;
+       break;
+    case 12:
+       sendtype->datatype = MPI_FLOAT;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_FLOAT;
+       recvtype->isBasic  = 1;
+       break;
+
+#ifndef USE_STRICT_MPI
+       /* MPI_BYTE may only be used with MPI_BYTE in strict MPI */
+    case 13:
+       sendtype->datatype = MPI_INT;
+       sendtype->isBasic  = 1;
+       recvtype->datatype = MPI_BYTE;
+       recvtype->isBasic  = 1;
+       recvtype->count    *= sizeof(int);
+       break;
+#endif
+    default:
+       datatype_index = -1;
+    }
+
+    if (!sendtype->InitBuf) {
+       sendtype->InitBuf  = MTestTypeContigInit;
+       recvtype->InitBuf  = MTestTypeContigInitRecv;
+       sendtype->FreeBuf  = MTestTypeContigFree;
+       recvtype->FreeBuf  = MTestTypeContigFree;
+       sendtype->CheckBuf = MTestTypeContigCheckbuf;
+       recvtype->CheckBuf = MTestTypeContigCheckbuf;
+    }
+    datatype_index++;
+
+    if (dbgflag && datatype_index > 0) {
+       int typesize;
+       fprintf( stderr, "%d: sendtype is %s\n", wrank, MTestGetDatatypeName( sendtype ) );
+       merr = MPI_Type_size( sendtype->datatype, &typesize );
+       if (merr) MTestPrintError( merr );
+       fprintf( stderr, "%d: sendtype size = %d\n", wrank, typesize );
+       fprintf( stderr, "%d: recvtype is %s\n", wrank, MTestGetDatatypeName( recvtype ) );
+       merr = MPI_Type_size( recvtype->datatype, &typesize );
+       if (merr) MTestPrintError( merr );
+       fprintf( stderr, "%d: recvtype size = %d\n", wrank, typesize );
+       fflush( stderr );
+       
+    }
+    else if (verbose && datatype_index > 0) {
+       printf( "Get new datatypes: send = %s, recv = %s\n", 
+               MTestGetDatatypeName( sendtype ), 
+               MTestGetDatatypeName( recvtype ) );
+       fflush( stdout );
+    }
+
+    return datatype_index;
+}
+
+/* Reset the datatype index (start from the initial data type.
+   Note: This routine is rarely needed; MTestGetDatatypes automatically
+   starts over after the last available datatype is used.
+*/
+void MTestResetDatatypes( void )
+{
+    datatype_index = 0;
+}
+/* Return the index of the current datatype.  This is rarely needed and
+   is provided mostly to enable debugging of the MTest package itself */
+int MTestGetDatatypeIndex( void )
+{
+    return datatype_index;
+}
+
+/* Free the storage associated with a datatype */
+void MTestFreeDatatype( MTestDatatype *mtype )
+{
+    int merr;
+    /* Invoke a datatype-specific free function to handle
+       both the datatype and the send/receive buffers */
+    if (mtype->FreeBuf) {
+       (mtype->FreeBuf)( mtype );
+    }
+    /* Free the datatype itself if it was created */
+    if (!mtype->isBasic) {
+       merr = MPI_Type_free( &mtype->datatype );
+       if (merr) MTestPrintError( merr );
+    }
+}
+
+/* Check that a message was received correctly.  Returns the number of
+   errors detected.  Status may be NULL or MPI_STATUS_IGNORE */
+int MTestCheckRecv( MPI_Status *status, MTestDatatype *recvtype )
+{
+    int count;
+    int errs = 0, merr;
+
+    if (status && status != MPI_STATUS_IGNORE) {
+       merr = MPI_Get_count( status, recvtype->datatype, &count );
+       if (merr) MTestPrintError( merr );
+       
+       /* Check count against expected count */
+       if (count != recvtype->count) {
+           errs ++;
+       }
+    }
+
+    /* Check received data */
+    if (!errs && recvtype->CheckBuf( recvtype )) {
+       errs++;
+    }
+    return errs;
+}
+
+/* This next routine uses a circular buffer of static name arrays just to
+   simplify the use of the routine */
+const char *MTestGetDatatypeName( MTestDatatype *dtype )
+{
+    static char name[4][MPI_MAX_OBJECT_NAME];
+    static int sp=0;
+    int rlen, merr;
+
+    if (sp >= 4) sp = 0;
+    merr = MPI_Type_get_name( dtype->datatype, name[sp], &rlen );
+    if (merr) MTestPrintError( merr );
+    return (const char *)name[sp++];
+}
+/* ----------------------------------------------------------------------- */
+
+/* 
+ * Create communicators.  Use separate routines for inter and intra
+ * communicators (there is a routine to give both)
+ * Note that the routines may return MPI_COMM_NULL, so code should test for
+ * that return value as well.
+ * 
+ */
+static __thread int interCommIdx = 0;
+static __thread int intraCommIdx = 0;
+static __thread const char *intraCommName = 0;
+static __thread const char *interCommName = 0;
+
+/* 
+ * Get an intracommunicator with at least min_size members.  If "allowSmaller"
+ * is true, allow the communicator to be smaller than MPI_COMM_WORLD and
+ * for this routine to return MPI_COMM_NULL for some values.  Returns 0 if
+ * no more communicators are available.
+ */
+int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
+{
+    int size, rank, merr;
+    int done2, done=0;
+    int isBasic = 0;
+
+    /* The while loop allows us to skip communicators that are too small.
+       MPI_COMM_NULL is always considered large enough */
+    while (!done) {
+       isBasic = 0;
+       intraCommName = "";
+       switch (intraCommIdx) {
+       case 0:
+           *comm = MPI_COMM_WORLD;
+           isBasic = 1;
+           intraCommName = "MPI_COMM_WORLD";
+           break;
+       case 1:
+           /* dup of world */
+           merr = MPI_Comm_dup(MPI_COMM_WORLD, comm );
+           if (merr) MTestPrintError( merr );
+           intraCommName = "Dup of MPI_COMM_WORLD";
+           break;
+       case 2:
+           /* reverse ranks */
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_split( MPI_COMM_WORLD, 0, size-rank, comm );
+           if (merr) MTestPrintError( merr );
+           intraCommName = "Rank reverse of MPI_COMM_WORLD";
+           break;
+       case 3:
+           /* subset of world, with reversed ranks */
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_split( MPI_COMM_WORLD, ((rank < size/2) ? 1 : MPI_UNDEFINED),
+                                  size-rank, comm );
+           if (merr) MTestPrintError( merr );
+           intraCommName = "Rank reverse of half of MPI_COMM_WORLD";
+           break;
+       case 4:
+           *comm = MPI_COMM_SELF;
+           isBasic = 1;
+           intraCommName = "MPI_COMM_SELF";
+           break;
+
+           /* These next cases are communicators that include some
+              but not all of the processes */
+       case 5:
+       case 6:
+       case 7:
+       case 8:
+       {
+           int newsize;
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           newsize = size - (intraCommIdx - 4);
+           
+           if (allowSmaller && newsize >= min_size) {
+               merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+               if (merr) MTestPrintError( merr );
+               merr = MPI_Comm_split( MPI_COMM_WORLD, rank < newsize, rank, 
+                                      comm );
+               if (merr) MTestPrintError( merr );
+               if (rank >= newsize) {
+                   merr = MPI_Comm_free( comm );
+                   if (merr) MTestPrintError( merr );
+                   *comm = MPI_COMM_NULL;
+               }
+               else {
+                   intraCommName = "Split of WORLD";
+               }
+           }
+           else {
+               /* Act like default */
+               *comm = MPI_COMM_NULL;
+               intraCommIdx = -1;
+           }
+       }
+       break;
+           
+           /* Other ideas: dup of self, cart comm, graph comm */
+       default:
+           *comm = MPI_COMM_NULL;
+           intraCommIdx = -1;
+           break;
+       }
+
+       if (*comm != MPI_COMM_NULL) {
+           merr = MPI_Comm_size( *comm, &size );
+           if (merr) MTestPrintError( merr );
+           if (size >= min_size)
+               done = 1;
+       }
+        else {
+            intraCommName = "MPI_COMM_NULL";
+            isBasic = 1;
+            done = 1;
+        }
+done2=done;
+        /* we are only done if all processes are done */
+        MPI_Allreduce(&done2, &done, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
+
+        /* Advance the comm index whether we are done or not, otherwise we could
+         * spin forever trying to allocate a too-small communicator over and
+         * over again. */
+        intraCommIdx++;
+
+        if (!done && !isBasic && *comm != MPI_COMM_NULL) {
+            /* avoid leaking communicators */
+            merr = MPI_Comm_free(comm);
+            if (merr) MTestPrintError(merr);
+        }
+    }
+
+    return intraCommIdx;
+}
+
+/* 
+ * Get an intracommunicator with at least min_size members.
+ */
+int MTestGetIntracomm( MPI_Comm *comm, int min_size ) 
+{
+    return MTestGetIntracommGeneral( comm, min_size, 0 );
+}
+
+/* Return the name of an intra communicator */
+const char *MTestGetIntracommName( void )
+{
+    return intraCommName;
+}
+
+/* 
+ * Return an intercomm; set isLeftGroup to 1 if the calling process is 
+ * a member of the "left" group.
+ */
+int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
+{
+    int size, rank, remsize, merr;
+    int done=0;
+    MPI_Comm mcomm  = MPI_COMM_NULL;
+    MPI_Comm mcomm2 = MPI_COMM_NULL;
+    int rleader;
+
+    /* The while loop allows us to skip communicators that are too small.
+       MPI_COMM_NULL is always considered large enough.  The size is
+       the sum of the sizes of the local and remote groups */
+    while (!done) {
+        *comm = MPI_COMM_NULL;
+        *isLeftGroup = 0;
+        interCommName = "MPI_COMM_NULL";
+
+       switch (interCommIdx) {
+       case 0:
+           /* Split comm world in half */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size > 1) {
+               merr = MPI_Comm_split( MPI_COMM_WORLD, (rank < size/2), rank, 
+                                      &mcomm );
+               if (merr) MTestPrintError( merr );
+               if (rank == 0) {
+                   rleader = size/2;
+               }
+               else if (rank == size/2) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < size/2;
+               merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader,
+                                            12345, comm );
+               if (merr) MTestPrintError( merr );
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD";
+           }
+           else 
+               *comm = MPI_COMM_NULL;
+           break;
+       case 1:
+           /* Split comm world in to 1 and the rest */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size > 1) {
+               merr = MPI_Comm_split( MPI_COMM_WORLD, rank == 0, rank, 
+                                      &mcomm );
+               if (merr) MTestPrintError( merr );
+               if (rank == 0) {
+                   rleader = 1;
+               }
+               else if (rank == 1) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank == 0;
+               merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, 
+                                            rleader, 12346, comm );
+               if (merr) MTestPrintError( merr );
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD into 1, rest";
+           }
+           else
+               *comm = MPI_COMM_NULL;
+           break;
+
+       case 2:
+           /* Split comm world in to 2 and the rest */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size > 3) {
+               merr = MPI_Comm_split( MPI_COMM_WORLD, rank < 2, rank, 
+                                      &mcomm );
+               if (merr) MTestPrintError( merr );
+               if (rank == 0) {
+                   rleader = 2;
+               }
+               else if (rank == 2) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < 2;
+               merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, 
+                                            rleader, 12347, comm );
+               if (merr) MTestPrintError( merr );
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD into 2, rest";
+           }
+           else 
+               *comm = MPI_COMM_NULL;
+           break;
+
+       case 3:
+           /* Split comm world in half, then dup */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size > 1) {
+               merr = MPI_Comm_split( MPI_COMM_WORLD, (rank < size/2), rank, 
+                                      &mcomm );
+               if (merr) MTestPrintError( merr );
+               if (rank == 0) {
+                   rleader = size/2;
+               }
+               else if (rank == size/2) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < size/2;
+               merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader,
+                                            12345, comm );
+               if (merr) MTestPrintError( merr );
+                /* avoid leaking after assignment below */
+               merr = MPI_Comm_free( &mcomm );
+               if (merr) MTestPrintError( merr );
+
+               /* now dup, some bugs only occur for dup's of intercomms */
+               mcomm = *comm;
+               merr = MPI_Comm_dup(mcomm, comm);
+               if (merr) MTestPrintError( merr );
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD then dup'ing";
+           }
+           else 
+               *comm = MPI_COMM_NULL;
+           break;
+
+       case 4:
+           /* Split comm world in half, form intercomm, then split that intercomm */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size > 1) {
+               merr = MPI_Comm_split( MPI_COMM_WORLD, (rank < size/2), rank, 
+                                      &mcomm );
+               if (merr) MTestPrintError( merr );
+               if (rank == 0) {
+                   rleader = size/2;
+               }
+               else if (rank == size/2) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < size/2;
+               merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader,
+                                            12345, comm );
+               if (merr) MTestPrintError( merr );
+                /* avoid leaking after assignment below */
+               merr = MPI_Comm_free( &mcomm );
+               if (merr) MTestPrintError( merr );
+
+               /* now split, some bugs only occur for splits of intercomms */
+               mcomm = *comm;
+               rank = MPI_Comm_rank(mcomm, &rank);
+               if (merr) MTestPrintError( merr );
+               /* this split is effectively a dup but tests the split code paths */
+               merr = MPI_Comm_split(mcomm, 0, rank, comm);
+               if (merr) MTestPrintError( merr );
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD then then splitting again";
+           }
+           else
+               *comm = MPI_COMM_NULL;
+           break;
+
+       case 5:
+            /* split comm world in half discarding rank 0 on the "left"
+             * communicator, then form them into an intercommunicator */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size >= 4) {
+                int color = (rank < size/2 ? 0 : 1);
+                if (rank == 0)
+                    color = MPI_UNDEFINED;
+
+               merr = MPI_Comm_split( MPI_COMM_WORLD, color, rank, &mcomm );
+               if (merr) MTestPrintError( merr );
+
+               if (rank == 1) {
+                   rleader = size/2;
+               }
+               else if (rank == (size/2)) {
+                   rleader = 1;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < size/2;
+                if (rank != 0) { /* 0's mcomm is MPI_COMM_NULL */
+                    merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm );
+                    if (merr) MTestPrintError( merr );
+                }
+                interCommName = "Intercomm by splitting MPI_COMM_WORLD (discarding rank 0 in the left group) then MPI_Intercomm_create'ing";
+            }
+            else {
+                *comm = MPI_COMM_NULL;
+            }
+            break;
+
+        case 6:
+            /* Split comm world in half then form them into an
+             * intercommunicator.  Then discard rank 0 from each group of the
+             * intercomm via MPI_Comm_create. */
+           merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
+           if (merr) MTestPrintError( merr );
+           if (size >= 4) {
+                MPI_Group oldgroup, newgroup;
+                int ranks[1];
+                int color = (rank < size/2 ? 0 : 1);
+
+               merr = MPI_Comm_split( MPI_COMM_WORLD, color, rank, &mcomm );
+               if (merr) MTestPrintError( merr );
+
+               if (rank == 0) {
+                   rleader = size/2;
+               }
+               else if (rank == (size/2)) {
+                   rleader = 0;
+               }
+               else {
+                   /* Remote leader is signficant only for the processes
+                      designated local leaders */
+                   rleader = -1;
+               }
+               *isLeftGroup = rank < size/2;
+                merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader, 12345, &mcomm2 );
+                if (merr) MTestPrintError( merr );
+
+                /* We have an intercomm between the two halves of comm world. Now create
+                 * a new intercomm that removes rank 0 on each side. */
+                merr = MPI_Comm_group(mcomm2, &oldgroup);
+                if (merr) MTestPrintError( merr );
+                ranks[0] = 0;
+                merr = MPI_Group_excl(oldgroup, 1, ranks, &newgroup);
+                if (merr) MTestPrintError( merr );
+                merr = MPI_Comm_create(mcomm2, newgroup, comm);
+                if (merr) MTestPrintError( merr );
+
+                merr = MPI_Group_free(&oldgroup);
+                if (merr) MTestPrintError( merr );
+                merr = MPI_Group_free(&newgroup);
+                if (merr) MTestPrintError( merr );
+
+                interCommName = "Intercomm by splitting MPI_COMM_WORLD then discarding 0 ranks with MPI_Comm_create";
+            }
+            else {
+                *comm = MPI_COMM_NULL;
+            }
+            break;
+
+       default:
+           *comm = MPI_COMM_NULL;
+           interCommIdx = -1;
+           break;
+       }
+
+       if (*comm != MPI_COMM_NULL) {
+           merr = MPI_Comm_size( *comm, &size );
+           if (merr) MTestPrintError( merr );
+           merr = MPI_Comm_remote_size( *comm, &remsize );
+           if (merr) MTestPrintError( merr );
+           if (size + remsize >= min_size) done = 1;
+       }
+       else {
+           interCommName = "MPI_COMM_NULL";
+           done = 1;
+        }
+
+        /* we are only done if all processes are done */
+        MPI_Allreduce(MPI_IN_PLACE, &done, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
+
+        /* Advance the comm index whether we are done or not, otherwise we could
+         * spin forever trying to allocate a too-small communicator over and
+         * over again. */
+        interCommIdx++;
+
+        if (!done && *comm != MPI_COMM_NULL) {
+            /* avoid leaking communicators */
+            merr = MPI_Comm_free(comm);
+            if (merr) MTestPrintError(merr);
+        }
+
+        /* cleanup for common temp objects */
+        if (mcomm != MPI_COMM_NULL) {
+            merr = MPI_Comm_free(&mcomm);
+            if (merr) MTestPrintError( merr );
+        }
+        if (mcomm2 != MPI_COMM_NULL) {
+            merr = MPI_Comm_free(&mcomm2);
+            if (merr) MTestPrintError( merr );
+        }
+    }
+
+    return interCommIdx;
+}
+/* Return the name of an intercommunicator */
+const char *MTestGetIntercommName( void )
+{
+    return interCommName;
+}
+
+/* Get a communicator of a given minimum size.  Both intra and inter 
+   communicators are provided */
+int MTestGetComm( MPI_Comm *comm, int min_size )
+{
+    int idx=0;
+    static __thread int getinter = 0;
+
+    if (!getinter) {
+       idx = MTestGetIntracomm( comm, min_size );
+       if (idx == 0) {
+           getinter = 1;
+       }
+    }
+    if (getinter) {
+       int isLeft;
+       idx = MTestGetIntercomm( comm, &isLeft, min_size );
+       if (idx == 0) {
+           getinter = 0;
+       }
+    }
+
+    return idx;
+}
+
+/* Free a communicator.  It may be called with a predefined communicator
+ or MPI_COMM_NULL */
+void MTestFreeComm( MPI_Comm *comm )
+{
+    int merr;
+    if (*comm != MPI_COMM_WORLD &&
+       *comm != MPI_COMM_SELF &&
+       *comm != MPI_COMM_NULL) {
+       merr = MPI_Comm_free( comm );
+       if (merr) MTestPrintError( merr );
+    }
+}
+
+/* ------------------------------------------------------------------------ */
+void MTestPrintError( int errcode )
+{
+    int errclass, slen;
+    char string[MPI_MAX_ERROR_STRING];
+    
+    MPI_Error_class( errcode, &errclass );
+    MPI_Error_string( errcode, string, &slen );
+    printf( "Error class %d (%s)\n", errclass, string );
+    fflush( stdout );
+}
+void MTestPrintErrorMsg( const char msg[], int errcode )
+{
+    int errclass, slen;
+    char string[MPI_MAX_ERROR_STRING];
+    
+    MPI_Error_class( errcode, &errclass );
+    MPI_Error_string( errcode, string, &slen );
+    printf( "%s: Error class %d (%s)\n", msg, errclass, string ); 
+    fflush( stdout );
+}
+/* ------------------------------------------------------------------------ */
+/* 
+ If verbose output is selected and the level is at least that of the
+ value of the verbose flag, then perform printf( format, ... );
+ */
+void MTestPrintfMsg( int level, const char format[], ... )
+{
+    va_list list;
+
+    if (verbose && level >= verbose) {
+       va_start(list,format);
+       vprintf( format, list );
+       va_end(list);
+       fflush(stdout);
+    }
+}
+/* Fatal error.  Report and exit */
+void MTestError( const char *msg )
+{
+    fprintf( stderr, "%s\n", msg );
+    fflush( stderr );
+    MPI_Abort( MPI_COMM_WORLD, 1 );
+}
+/* ------------------------------------------------------------------------ */
+static void MTestResourceSummary( FILE *fp )
+{
+#ifdef HAVE_GETRUSAGE
+    struct rusage ru;
+    static __thread int pfThreshold = -2;
+    int doOutput = 1;
+    if (getrusage( RUSAGE_SELF, &ru ) == 0) {
+       /* There is an option to generate output only when a resource
+          exceeds a threshold.  To date, only page faults supported. */
+       if (pfThreshold == -2) {
+           char *p = getenv("MPITEST_RUSAGE_PF");
+           pfThreshold = -1;
+           if (p) {
+               pfThreshold = strtol( p, 0, 0 );
+           }
+       }
+       if (pfThreshold > 0) {
+           doOutput = ru.ru_minflt > pfThreshold;
+       }
+       if (doOutput) {
+           /* Cast values to long in case some system has defined them
+              as another integer type */
+           fprintf( fp, "RUSAGE: max resident set = %ldKB\n", 
+                    (long)ru.ru_maxrss );
+           fprintf( fp, "RUSAGE: page faults = %ld : %ld\n", 
+                    (long)ru.ru_minflt, (long)ru.ru_majflt );
+           /* Not every Unix provides useful information for the xxrss fields */
+           fprintf( fp, "RUSAGE: memory in text/data/stack = %ld : %ld : %ld\n", 
+                    (long)ru.ru_ixrss, (long)ru.ru_idrss, (long)ru.ru_isrss );
+           fprintf( fp, "RUSAGE: I/O in and out = %ld : %ld\n", 
+                    (long)ru.ru_inblock, (long)ru.ru_oublock );
+           fprintf( fp, "RUSAGE: context switch = %ld : %ld\n", 
+                    (long)ru.ru_nvcsw, (long)ru.ru_nivcsw );
+       }
+    }
+    else {
+       fprintf( fp, "RUSAGE: return error %d\n", errno );
+    }
+#endif
+}
+/* ------------------------------------------------------------------------ */
+#ifdef HAVE_MPI_WIN_CREATE
+/*
+ * Create MPI Windows
+ */
+static __thread int win_index = 0;
+static const char *winName;
+/* Use an attribute to remember the type of memory allocation (static,
+   malloc, or MPI_Alloc_mem) */
+static __thread int mem_keyval = MPI_KEYVAL_INVALID;
+int MTestGetWin( MPI_Win *win, int mustBePassive )
+{
+    static char actbuf[1024];
+    static char *pasbuf;
+    char        *buf;
+    int         n, rank, merr;
+    MPI_Info    info;
+
+    if (mem_keyval == MPI_KEYVAL_INVALID) {
+       /* Create the keyval */
+       merr = MPI_Win_create_keyval( MPI_WIN_NULL_COPY_FN, 
+                                     MPI_WIN_NULL_DELETE_FN, 
+                                     &mem_keyval, 0 );
+       if (merr) MTestPrintError( merr );
+
+    }
+
+    switch (win_index) {
+    case 0:
+       /* Active target window */
+       merr = MPI_Win_create( actbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
+                              win );
+       if (merr) MTestPrintError( merr );
+       winName = "active-window";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)0 );
+       if (merr) MTestPrintError( merr );
+       break;
+    case 1:
+       /* Passive target window */
+       merr = MPI_Alloc_mem( 1024, MPI_INFO_NULL, &pasbuf );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Win_create( pasbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
+                              win );
+       if (merr) MTestPrintError( merr );
+       winName = "passive-window";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)2 );
+       if (merr) MTestPrintError( merr );
+       break;
+    case 2:
+       /* Active target; all windows different sizes */
+       merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+       if (merr) MTestPrintError( merr );
+       n = rank * 64;
+       if (n) 
+           buf = (char *)malloc( n );
+       else
+           buf = 0;
+       merr = MPI_Win_create( buf, n, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
+                              win );
+       if (merr) MTestPrintError( merr );
+       winName = "active-all-different-win";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)1 );
+       if (merr) MTestPrintError( merr );
+       break;
+    case 3:
+       /* Active target, no locks set */
+       merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
+       if (merr) MTestPrintError( merr );
+       n = rank * 64;
+       if (n) 
+           buf = (char *)malloc( n );
+       else
+           buf = 0;
+       merr = MPI_Info_create( &info );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Info_set( info, (char*)"nolocks", (char*)"true" );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Win_create( buf, n, 1, info, MPI_COMM_WORLD, win );
+       if (merr) MTestPrintError( merr );
+       merr = MPI_Info_free( &info );
+       if (merr) MTestPrintError( merr );
+       winName = "active-nolocks-all-different-win";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)1 );
+       if (merr) MTestPrintError( merr );
+       break;
+    default:
+       win_index = -1;
+    }
+    win_index++;
+    return win_index;
+}
+/* Return a pointer to the name associated with a window object */
+const char *MTestGetWinName( void )
+{
+    return winName;
+}
+/* Free the storage associated with a window object */
+void MTestFreeWin( MPI_Win *win )
+{
+    void *addr;
+    int  flag, merr;
+
+    merr = MPI_Win_get_attr( *win, MPI_WIN_BASE, &addr, &flag );
+    if (merr) MTestPrintError( merr );
+    if (!flag) {
+       MTestError( "Could not get WIN_BASE from window" );
+    }
+    if (addr) {
+       void *val;
+       merr = MPI_Win_get_attr( *win, mem_keyval, &val, &flag );
+       if (merr) MTestPrintError( merr );
+       if (flag) {
+           if (val == (void *)1) {
+               free( addr );
+           }
+           else if (val == (void *)2) {
+               merr = MPI_Free_mem( addr );
+               if (merr) MTestPrintError( merr );
+           }
+           /* if val == (void *)0, then static data that must not be freed */
+       }
+    }
+    merr = MPI_Win_free(win);
+    if (merr) MTestPrintError( merr );
+}
+static void MTestRMACleanup( void )
+{
+    if (mem_keyval != MPI_KEYVAL_INVALID) {
+       MPI_Win_free_keyval( &mem_keyval );
+    }
+}
+#else 
+static void MTestRMACleanup( void ) {}
+#endif
index 10dc336..e7cb94f 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple example pingpong pogram to test MPI_Send and MPI_Recv */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 8f424ef..a90ee02 100644 (file)
@@ -1,7 +1,7 @@
 p Test dsend
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./dsend -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./dsend -q
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
@@ -15,7 +15,7 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 p Test pingpong
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ./pingpong -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 4 ./pingpong -q
 > *** Ping-pong test (MPI_Send/MPI_Recv) ***
 > == pivot=0 : pingpong [0] <--> [1]
 > == pivot=1 : pingpong [1] <--> [2]
index 2946edc..84203e9 100644 (file)
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
     else
       printf("failed.\n");
     if (!quiet)
-      printf("Elapsed time=%lf s\n", MPI_Wtime() - start_timer);
+      printf("Elapsed time=%f s\n", MPI_Wtime() - start_timer);
   }
 
   MPI_Barrier(MPI_COMM_WORLD);
index aa7dec0..8e73331 100644 (file)
@@ -2,7 +2,7 @@
 # (since we want to pass it to the child, it has to be redefined before each command)
 # Go for the first test
 p Test Reduce with 3 processes
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./reduce -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 3 ./reduce -q
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
@@ -22,7 +22,7 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 # second test
 ! setenv LD_LIBRARY_PATH=../../lib
 p Test Reduce with 5 processes
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./reduce -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 5 ./reduce -q
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
@@ -46,7 +46,7 @@ $ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/
 # third test
 ! setenv LD_LIBRARY_PATH=../../lib
 p Test Reduce with 12 processes
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./reduce -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 12 ./reduce -q
 > You requested to use 12 processes, but there is only 5 processes in your hostfile...
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
index df40dc2..3b28457 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -34,16 +34,16 @@ int main(int argc, char *argv[])
     sb[i] = rank*size + i;
     rb[i] = 0;
   }
-
   printf("[%d] sndbuf=[", rank);
   for (i = 0; i < size; i++)
     printf("%d ", sb[i]);
   printf("]\n");
-
-  status = MPI_Reduce(sb, rb, size, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
+  
+  int root=0;
+  status = MPI_Reduce(sb, rb, size, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD);
   MPI_Barrier(MPI_COMM_WORLD);
 
-  if (rank == 0) {
+  if (rank == root) {
     printf("[%d] rcvbuf=[", rank);
     for (i = 0; i < size; i++)
       printf("%d ", rb[i]);
@@ -53,6 +53,27 @@ int main(int argc, char *argv[])
       fflush(stdout);
     }
   }
+  
+  
+  printf("[%d] second sndbuf=[", rank);
+  for (i = 0; i < 1; i++)
+    printf("%d ", sb[i]);
+  printf("]\n");
+  
+  root=size-1;
+  status = MPI_Reduce(sb, rb, 1, MPI_INT, MPI_PROD, root, MPI_COMM_WORLD);
+  MPI_Barrier(MPI_COMM_WORLD);
+
+  if (rank == root) {
+    printf("[%d] rcvbuf=[", rank);
+    for (i = 0; i < 1; i++)
+      printf("%d ", rb[i]);
+    printf("]\n");
+    if (status != MPI_SUCCESS) {
+      printf("all_to_all returned %d\n", status);
+      fflush(stdout);
+    }
+  }
   free(sb);
   free(rb);
   MPI_Finalize();
index ae94a6c..65e3575 100644 (file)
@@ -3,39 +3,57 @@
 ! output sort
 
 p Test allreduce
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_coll
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_coll
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
-> [rank 0] -> Tremblay
-> [rank 1] -> Jupiter
-> [rank 2] -> Fafard
-> [rank 3] -> Ginette
-> [rank 4] -> Bourassa
-> [rank 5] -> Tremblay
-> [rank 6] -> Jupiter
-> [rank 7] -> Fafard
-> [rank 8] -> Ginette
-> [rank 9] -> Bourassa
-> [rank 10] -> Tremblay
-> [rank 11] -> Jupiter
-> [rank 12] -> Fafard
-> [rank 13] -> Ginette
-> [rank 14] -> Bourassa
-> [rank 15] -> Tremblay
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
+> [0] second sndbuf=[0 ]
 > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]
+> [10] second sndbuf=[160 ]
+> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 ]
+> [11] second sndbuf=[176 ]
+> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ]
+> [12] second sndbuf=[192 ]
+> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 ]
+> [13] second sndbuf=[208 ]
+> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ]
+> [14] second sndbuf=[224 ]
+> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ]
+> [15] rcvbuf=[0 ]
+> [15] second sndbuf=[240 ]
+> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ]
+> [1] second sndbuf=[16 ]
 > [1] sndbuf=[16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ]
+> [2] second sndbuf=[32 ]
 > [2] sndbuf=[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 ]
+> [3] second sndbuf=[48 ]
 > [3] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ]
+> [4] second sndbuf=[64 ]
 > [4] sndbuf=[64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 ]
+> [5] second sndbuf=[80 ]
 > [5] sndbuf=[80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ]
+> [6] second sndbuf=[96 ]
 > [6] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 ]
+> [7] second sndbuf=[112 ]
 > [7] sndbuf=[112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ]
+> [8] second sndbuf=[128 ]
 > [8] sndbuf=[128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 ]
+> [9] second sndbuf=[144 ]
 > [9] sndbuf=[144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 ]
-> [10] sndbuf=[160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 ]
-> [11] sndbuf=[176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 ]
-> [12] sndbuf=[192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 ]
-> [13] sndbuf=[208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ]
-> [14] sndbuf=[224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 ]
-> [15] sndbuf=[240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 ]
-> [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
+> [rank 0] -> Tremblay
+> [rank 10] -> Tremblay
+> [rank 11] -> Jupiter
+> [rank 12] -> Fafard
+> [rank 13] -> Ginette
+> [rank 14] -> Bourassa
+> [rank 15] -> Tremblay
+> [rank 1] -> Jupiter
+> [rank 2] -> Fafard
+> [rank 3] -> Ginette
+> [rank 4] -> Bourassa
+> [rank 5] -> Tremblay
+> [rank 6] -> Jupiter
+> [rank 7] -> Fafard
+> [rank 8] -> Ginette
+> [rank 9] -> Bourassa
+
index cba19bc..f8d9fb3 100644 (file)
@@ -28,7 +28,7 @@ int main( int argc, char **argv )
     for (i=0; i<size; i++) 
        sendbuf[i] = rank + i;
     recvcounts = (int *)malloc( size * sizeof(int) );
-        recvbuf = (int *)malloc( size * sizeof(int) );
+    recvbuf = (int *)malloc( size * sizeof(int) );
     for (i=0; i<size; i++) 
     recvcounts[i] = 1;
     MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
@@ -44,6 +44,10 @@ int main( int argc, char **argv )
     if (rank == 0 && toterr == 0) {
        printf( " No Errors\n" );
     }
+    free(sendbuf);
+    free(recvcounts);
+    free(recvbuf);
+    
     MPI_Finalize( );
 
     return toterr;
index 8c4a278..d2b6c79 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test reduce_scatter
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_scatter_coll 
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./reduce_scatter_coll 
 > No Errors
 > You requested to use 16 processes, but there is only 5 processes in your hostfile...
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
index e4a6303..0096064 100644 (file)
@@ -87,6 +87,9 @@ static int small_test(int rank, int size)
   retval =
       MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount,
                   MPI_DOUBLE, root, MPI_COMM_WORLD);
+  if (root == rank) {
+    free(sndbuf);
+    }
   if (retval != MPI_SUCCESS) {
     fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__,
             __LINE__, retval);
@@ -94,7 +97,7 @@ static int small_test(int rank, int size)
   }
   // verification
   if ((double) rank != rcvd) {
-    fprintf(stderr, "[%d] has %lf instead of %d\n", rank, rcvd, rank);
+    fprintf(stderr, "[%d] has %f instead of %d\n", rank, rcvd, rank);
     success = 0;
   }
   return (success);
index f5d2c79..d5ef00d 100644 (file)
@@ -3,7 +3,7 @@
 ! output sort
 
 p Test scatter
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./scatter 
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ./scatter 
 >      [0] ok.
 >      [0] ok.
 >      [10] ok.
index 1e4962d..6a1bf0e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 66fe0b7..132bf9a 100644 (file)
@@ -1,6 +1,6 @@
 /* A simple example pingpong pogram to test MPI_Send and MPI_Recv */
 
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/teshsuite/smpi/shared.c b/teshsuite/smpi/shared.c
new file mode 100644 (file)
index 0000000..b1536c5
--- /dev/null
@@ -0,0 +1,63 @@
+/* Copyright (c) 2009-2013. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* This example should be instructive to learn about SMPI_SAMPLE_LOCAL and 
+   SMPI_SAMPLE_GLOBAL macros for execution sampling */
+
+#include <stdio.h>
+#include <mpi.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+void* hash(char *str, uint64_t* ans);
+
+void* hash(char *str, uint64_t* ans)
+{
+  *ans=5381;
+  int c;
+  printf("hashing !\n");
+  while ((c = *str++)!=0)
+    *ans = ((*ans << 5) + *ans) + c; /* hash * 33 + c */
+  return NULL;
+}
+
+
+int main(int argc, char *argv[])
+{
+  MPI_Init(&argc, &argv);
+  int rank, size;
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+  MPI_Comm_size(MPI_COMM_WORLD, &size);
+  //Let's Allocate a shared memory buffer
+  uint64_t* buf = SMPI_SHARED_MALLOC(sizeof(uint64_t));
+  //one writes data in it
+  if(rank==0){
+    *buf=size;  
+  }
+  
+  MPI_Barrier(MPI_COMM_WORLD);
+  //everyobne reads from it. 
+  printf("[%d] The value in the shared buffer is: %" PRIu64"\n", rank, *buf);
+  
+  
+  MPI_Barrier(MPI_COMM_WORLD);
+  //Try SMPI_SHARED_CALL function, which should call hash only once and for all.
+  char *str = strdup("onceandforall");
+  if(rank==size-1){
+    SMPI_SHARED_CALL(hash,str,str,buf);  
+  }
+  
+  MPI_Barrier(MPI_COMM_WORLD);
+  
+  printf("[%d] After change, the value in the shared buffer is: %" PRIu64"\n", rank, *buf);
+  
+  SMPI_SHARED_FREE(buf);  
+  buf=NULL;  
+  free(str);
+    
+  MPI_Finalize();
+  return 0;
+}
diff --git a/teshsuite/smpi/shared.tesh b/teshsuite/smpi/shared.tesh
new file mode 100644 (file)
index 0000000..f9ad65f
--- /dev/null
@@ -0,0 +1,20 @@
+p Test compute
+! setenv LD_LIBRARY_PATH=../../lib
+! output sort
+! timeout 5
+$ ../../smpi_script/bin/smpirun -platform ${srcdir:=.}/../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir:=.}/hostfile -np 4 ./shared 
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304'
+> [0] After change, the value in the shared buffer is: 16053117601147974045
+> [0] The value in the shared buffer is: 4
+> [1] After change, the value in the shared buffer is: 16053117601147974045
+> [1] The value in the shared buffer is: 4
+> [2] After change, the value in the shared buffer is: 16053117601147974045
+> [2] The value in the shared buffer is: 4
+> [3] After change, the value in the shared buffer is: 16053117601147974045
+> [3] The value in the shared buffer is: 4
+> hashing !
+
+
index a3bb58f..0a41c47 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 2fd7c71..804954b 100644 (file)
@@ -1,7 +1,7 @@
 p Test struct
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./struct_test -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./struct_test -q
 > Process 0 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 
 > Process 1 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
index 11827c6..1159b93 100644 (file)
@@ -51,7 +51,7 @@ char **argv;
 
     MPI_Bcast( &value, 1, mystruct, 0, MPI_COMM_WORLD );
 
-    printf( "Process %d got %d (-2?) and %lf (8.0?), tab (should be all 0): ", rank, value.a, value.b );
+    printf( "Process %d got %d (-2?) and %f (8.0?), tab (should be all 0): ", rank, value.a, value.b );
    
     for(j=0; j<2;j++ )
       for(i=0; i<3;i++ )
index 981d2a2..5ffb0fd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 83d4939..9df5dd2 100644 (file)
@@ -1,7 +1,7 @@
 p Test vector
 ! setenv LD_LIBRARY_PATH=../../lib
 ! output sort
-$ ../../bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./vector_test -q
+$ ../../smpi_script/bin/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../examples/msg/small_platform.xml -np 2 ./vector_test -q
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'maxmin/precision' to '1e-9'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI'
index 0a4b766..a181c6d 100644 (file)
@@ -1,24 +1,22 @@
 cmake_minimum_required(VERSION 2.6)
 
 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-if(NOT WIN32)
-  add_executable(log_large_test log_large_test.c)
-  add_executable(parallel_log_crashtest parallel_log_crashtest.c)
-  if(HAVE_MMAP)
-    add_executable(mmalloc_test mmalloc_test.c)
-  endif()
-  add_executable(parmap_test parmap_test.c)
+
+add_executable(log_large_test log_large_test.c)
+add_executable(parallel_log_crashtest parallel_log_crashtest.c)
+if(HAVE_MMAP)
+  add_executable(mmalloc_test mmalloc_test.c)
 endif()
+add_executable(parmap_test parmap_test.c)
+
 
 ### Add definitions for compile
-if(NOT WIN32)
-  target_link_libraries(log_large_test simgrid m pthread )
-  target_link_libraries(parallel_log_crashtest simgrid m pthread )
-  if(HAVE_MMAP)
-    target_link_libraries(mmalloc_test simgrid m pthread )
-  endif()
-  target_link_libraries(parmap_test simgrid m pthread )
+target_link_libraries(log_large_test simgrid)
+target_link_libraries(parallel_log_crashtest simgrid)
+if(HAVE_MMAP)
+  target_link_libraries(mmalloc_test simgrid)
 endif()
+target_link_libraries(parmap_test simgrid)
 
 set(tesh_files
   ${tesh_files}
index 20c4bbc..cd3ade7 100644 (file)
@@ -1,6 +1,6 @@
 /* log_large_test -- log a very large string to test the dynamic variants   */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 6da3d56..b64d9ec 100644 (file)
 $ ./xbt/mmalloc_test --log=root.fmt:%m%n
 > Allocating a new heap
 > HeapA allocated
-> 100 bytes allocated with offset 65000
-> 200 bytes allocated with offset 66000
-> 300 bytes allocated with offset 67000
-> 400 bytes allocated with offset 67200
-> 500 bytes allocated with offset 67400
-> 600 bytes allocated with offset 68000
-> 700 bytes allocated with offset 68400
-> 800 bytes allocated with offset 68800
-> 900 bytes allocated with offset 68c00
-> 1000 bytes allocated with offset 69000
-> 1100 bytes allocated with offset 6a000
-> 1200 bytes allocated with offset 6a800
-> 1300 bytes allocated with offset 6b000
-> 1400 bytes allocated with offset 6b800
-> 1500 bytes allocated with offset 6c000
-> 1600 bytes allocated with offset 6c800
-> 1700 bytes allocated with offset 6d000
-> 1800 bytes allocated with offset 6d800
-> 1900 bytes allocated with offset 6e000
-> 2000 bytes allocated with offset 6e800
-> 2100 bytes allocated with offset 6f000
-> 2200 bytes allocated with offset 70000
-> 2300 bytes allocated with offset 71000
-> 2400 bytes allocated with offset 72000
-> 2500 bytes allocated with offset 73000
-> 2600 bytes allocated with offset 74000
-> 2700 bytes allocated with offset 75000
-> 2800 bytes allocated with offset 76000
-> 2900 bytes allocated with offset 77000
-> 3000 bytes allocated with offset 78000
-> 3100 bytes allocated with offset 79000
-> 3200 bytes allocated with offset 7a000
-> 3300 bytes allocated with offset 7b000
-> 3400 bytes allocated with offset 7c000
-> 3500 bytes allocated with offset 7d000
-> 3600 bytes allocated with offset 7e000
-> 3700 bytes allocated with offset 7f000
-> 3800 bytes allocated with offset 80000
-> 3900 bytes allocated with offset 81000
-> 4000 bytes allocated with offset 82000
-> 4100 bytes allocated with offset 83000
-> 4200 bytes allocated with offset 85000
-> 4300 bytes allocated with offset 87000
-> 4400 bytes allocated with offset 89000
-> 4500 bytes allocated with offset 8b000
-> 4600 bytes allocated with offset 8d000
-> 4700 bytes allocated with offset 8f000
-> 4800 bytes allocated with offset 91000
-> 4900 bytes allocated with offset 93000
-> 5000 bytes allocated with offset 95000
-> 100 bytes allocated with offset 65080
-> 200 bytes allocated with offset 66100
-> 300 bytes allocated with offset 67600
-> 400 bytes allocated with offset 67800
-> 500 bytes allocated with offset 67a00
-> 600 bytes allocated with offset 69400
-> 700 bytes allocated with offset 69800
-> 800 bytes allocated with offset 69c00
-> 900 bytes allocated with offset 97000
-> 1000 bytes allocated with offset 97400
-> 1100 bytes allocated with offset 98000
-> 1200 bytes allocated with offset 98800
-> 1300 bytes allocated with offset 99000
-> 1400 bytes allocated with offset 99800
-> 1500 bytes allocated with offset 9a000
-> 1600 bytes allocated with offset 9a800
-> 1700 bytes allocated with offset 9b000
-> 1800 bytes allocated with offset 9b800
-> 1900 bytes allocated with offset 9c000
-> 2000 bytes allocated with offset 9c800
-> 2100 bytes allocated with offset 9d000
-> 2200 bytes allocated with offset 9e000
-> 2300 bytes allocated with offset 9f000
-> 2400 bytes allocated with offset a0000
-> 2500 bytes allocated with offset a1000
-> 2600 bytes allocated with offset a2000
-> 2700 bytes allocated with offset a3000
-> 2800 bytes allocated with offset a4000
-> 2900 bytes allocated with offset a5000
-> 3000 bytes allocated with offset a6000
-> 3100 bytes allocated with offset a7000
-> 3200 bytes allocated with offset a8000
-> 3300 bytes allocated with offset a9000
-> 3400 bytes allocated with offset aa000
-> 3500 bytes allocated with offset ab000
-> 3600 bytes allocated with offset ac000
-> 3700 bytes allocated with offset ad000
-> 3800 bytes allocated with offset ae000
-> 3900 bytes allocated with offset af000
-> 4000 bytes allocated with offset b0000
-> 4100 bytes allocated with offset b1000
-> 4200 bytes allocated with offset b3000
-> 4300 bytes allocated with offset b5000
-> 4400 bytes allocated with offset b7000
-> 4500 bytes allocated with offset b9000
-> 4600 bytes allocated with offset bb000
-> 4700 bytes allocated with offset bd000
-> 4800 bytes allocated with offset bf000
-> 4900 bytes allocated with offset c1000
-> 5000 bytes allocated with offset c3000
+> 100 bytes allocated with offset 45000
+> 200 bytes allocated with offset 46000
+> 300 bytes allocated with offset 47000
+> 400 bytes allocated with offset 47200
+> 500 bytes allocated with offset 47400
+> 600 bytes allocated with offset 48000
+> 700 bytes allocated with offset 48400
+> 800 bytes allocated with offset 48800
+> 900 bytes allocated with offset 48c00
+> 1000 bytes allocated with offset 49000
+> 1100 bytes allocated with offset 4a000
+> 1200 bytes allocated with offset 4a800
+> 1300 bytes allocated with offset 4b000
+> 1400 bytes allocated with offset 4b800
+> 1500 bytes allocated with offset 4c000
+> 1600 bytes allocated with offset 4c800
+> 1700 bytes allocated with offset 4d000
+> 1800 bytes allocated with offset 4d800
+> 1900 bytes allocated with offset 4e000
+> 2000 bytes allocated with offset 4e800
+> 2100 bytes allocated with offset 4f000
+> 2200 bytes allocated with offset 50000
+> 2300 bytes allocated with offset 51000
+> 2400 bytes allocated with offset 52000
+> 2500 bytes allocated with offset 53000
+> 2600 bytes allocated with offset 54000
+> 2700 bytes allocated with offset 55000
+> 2800 bytes allocated with offset 56000
+> 2900 bytes allocated with offset 57000
+> 3000 bytes allocated with offset 58000
+> 3100 bytes allocated with offset 59000
+> 3200 bytes allocated with offset 5a000
+> 3300 bytes allocated with offset 5b000
+> 3400 bytes allocated with offset 5c000
+> 3500 bytes allocated with offset 5d000
+> 3600 bytes allocated with offset 5e000
+> 3700 bytes allocated with offset 5f000
+> 3800 bytes allocated with offset 60000
+> 3900 bytes allocated with offset 61000
+> 4000 bytes allocated with offset 62000
+> 4100 bytes allocated with offset 63000
+> 4200 bytes allocated with offset 65000
+> 4300 bytes allocated with offset 67000
+> 4400 bytes allocated with offset 69000
+> 4500 bytes allocated with offset 6b000
+> 4600 bytes allocated with offset 6d000
+> 4700 bytes allocated with offset 6f000
+> 4800 bytes allocated with offset 71000
+> 4900 bytes allocated with offset 73000
+> 5000 bytes allocated with offset 75000
+> 100 bytes allocated with offset 45080
+> 200 bytes allocated with offset 46100
+> 300 bytes allocated with offset 47600
+> 400 bytes allocated with offset 47800
+> 500 bytes allocated with offset 47a00
+> 600 bytes allocated with offset 49400
+> 700 bytes allocated with offset 49800
+> 800 bytes allocated with offset 49c00
+> 900 bytes allocated with offset 77000
+> 1000 bytes allocated with offset 77400
+> 1100 bytes allocated with offset 78000
+> 1200 bytes allocated with offset 78800
+> 1300 bytes allocated with offset 79000
+> 1400 bytes allocated with offset 79800
+> 1500 bytes allocated with offset 7a000
+> 1600 bytes allocated with offset 7a800
+> 1700 bytes allocated with offset 7b000
+> 1800 bytes allocated with offset 7b800
+> 1900 bytes allocated with offset 7c000
+> 2000 bytes allocated with offset 7c800
+> 2100 bytes allocated with offset 7d000
+> 2200 bytes allocated with offset 7e000
+> 2300 bytes allocated with offset 7f000
+> 2400 bytes allocated with offset 80000
+> 2500 bytes allocated with offset 81000
+> 2600 bytes allocated with offset 82000
+> 2700 bytes allocated with offset 83000
+> 2800 bytes allocated with offset 84000
+> 2900 bytes allocated with offset 85000
+> 3000 bytes allocated with offset 86000
+> 3100 bytes allocated with offset 87000
+> 3200 bytes allocated with offset 88000
+> 3300 bytes allocated with offset 89000
+> 3400 bytes allocated with offset 8a000
+> 3500 bytes allocated with offset 8b000
+> 3600 bytes allocated with offset 8c000
+> 3700 bytes allocated with offset 8d000
+> 3800 bytes allocated with offset 8e000
+> 3900 bytes allocated with offset 8f000
+> 4000 bytes allocated with offset 90000
+> 4100 bytes allocated with offset 91000
+> 4200 bytes allocated with offset 93000
+> 4300 bytes allocated with offset 95000
+> 4400 bytes allocated with offset 97000
+> 4500 bytes allocated with offset 99000
+> 4600 bytes allocated with offset 9b000
+> 4700 bytes allocated with offset 9d000
+> 4800 bytes allocated with offset 9f000
+> 4900 bytes allocated with offset a1000
+> 5000 bytes allocated with offset a3000
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
index 77be118..83108e6 100644 (file)
 $ ./xbt/mmalloc_test --log=root.fmt:%m%n
 > Allocating a new heap
 > HeapA allocated
-> 100 bytes allocated with offset 59000
-> 200 bytes allocated with offset 59100
-> 300 bytes allocated with offset 5a000
-> 400 bytes allocated with offset 5a200
-> 500 bytes allocated with offset 5a400
-> 600 bytes allocated with offset 5b000
-> 700 bytes allocated with offset 5b400
-> 800 bytes allocated with offset 5b800
-> 900 bytes allocated with offset 5bc00
-> 1000 bytes allocated with offset 5c000
-> 1100 bytes allocated with offset 5d000
-> 1200 bytes allocated with offset 5d800
-> 1300 bytes allocated with offset 5e000
-> 1400 bytes allocated with offset 5e800
-> 1500 bytes allocated with offset 5f000
-> 1600 bytes allocated with offset 5f800
-> 1700 bytes allocated with offset 60000
-> 1800 bytes allocated with offset 60800
-> 1900 bytes allocated with offset 61000
-> 2000 bytes allocated with offset 61800
-> 2100 bytes allocated with offset 62000
-> 2200 bytes allocated with offset 63000
-> 2300 bytes allocated with offset 64000
-> 2400 bytes allocated with offset 65000
-> 2500 bytes allocated with offset 66000
-> 2600 bytes allocated with offset 67000
-> 2700 bytes allocated with offset 68000
-> 2800 bytes allocated with offset 69000
-> 2900 bytes allocated with offset 6a000
-> 3000 bytes allocated with offset 6b000
-> 3100 bytes allocated with offset 6c000
-> 3200 bytes allocated with offset 6d000
-> 3300 bytes allocated with offset 6e000
-> 3400 bytes allocated with offset 6f000
-> 3500 bytes allocated with offset 70000
-> 3600 bytes allocated with offset 71000
-> 3700 bytes allocated with offset 72000
-> 3800 bytes allocated with offset 73000
-> 3900 bytes allocated with offset 74000
-> 4000 bytes allocated with offset 75000
-> 4100 bytes allocated with offset 76000
-> 4200 bytes allocated with offset 78000
-> 4300 bytes allocated with offset 7a000
-> 4400 bytes allocated with offset 7c000
-> 4500 bytes allocated with offset 7e000
-> 4600 bytes allocated with offset 80000
-> 4700 bytes allocated with offset 82000
-> 4800 bytes allocated with offset 84000
-> 4900 bytes allocated with offset 86000
-> 5000 bytes allocated with offset 88000
-> 100 bytes allocated with offset 59200
-> 200 bytes allocated with offset 59300
-> 300 bytes allocated with offset 5a600
-> 400 bytes allocated with offset 5a800
-> 500 bytes allocated with offset 5aa00
-> 600 bytes allocated with offset 5c400
-> 700 bytes allocated with offset 5c800
-> 800 bytes allocated with offset 5cc00
-> 900 bytes allocated with offset 8a000
-> 1000 bytes allocated with offset 8a400
-> 1100 bytes allocated with offset 8b000
-> 1200 bytes allocated with offset 8b800
-> 1300 bytes allocated with offset 8c000
-> 1400 bytes allocated with offset 8c800
-> 1500 bytes allocated with offset 8d000
-> 1600 bytes allocated with offset 8d800
-> 1700 bytes allocated with offset 8e000
-> 1800 bytes allocated with offset 8e800
-> 1900 bytes allocated with offset 8f000
-> 2000 bytes allocated with offset 8f800
-> 2100 bytes allocated with offset 90000
-> 2200 bytes allocated with offset 91000
-> 2300 bytes allocated with offset 92000
-> 2400 bytes allocated with offset 93000
-> 2500 bytes allocated with offset 94000
-> 2600 bytes allocated with offset 95000
-> 2700 bytes allocated with offset 96000
-> 2800 bytes allocated with offset 97000
-> 2900 bytes allocated with offset 98000
-> 3000 bytes allocated with offset 99000
-> 3100 bytes allocated with offset 9a000
-> 3200 bytes allocated with offset 9b000
-> 3300 bytes allocated with offset 9c000
-> 3400 bytes allocated with offset 9d000
-> 3500 bytes allocated with offset 9e000
-> 3600 bytes allocated with offset 9f000
-> 3700 bytes allocated with offset a0000
-> 3800 bytes allocated with offset a1000
-> 3900 bytes allocated with offset a2000
-> 4000 bytes allocated with offset a3000
-> 4100 bytes allocated with offset a4000
-> 4200 bytes allocated with offset a6000
-> 4300 bytes allocated with offset a8000
-> 4400 bytes allocated with offset aa000
-> 4500 bytes allocated with offset ac000
-> 4600 bytes allocated with offset ae000
-> 4700 bytes allocated with offset b0000
-> 4800 bytes allocated with offset b2000
-> 4900 bytes allocated with offset b4000
-> 5000 bytes allocated with offset b6000
+> 100 bytes allocated with offset 39000
+> 200 bytes allocated with offset 39100
+> 300 bytes allocated with offset 3a000
+> 400 bytes allocated with offset 3a200
+> 500 bytes allocated with offset 3a400
+> 600 bytes allocated with offset 3b000
+> 700 bytes allocated with offset 3b400
+> 800 bytes allocated with offset 3b800
+> 900 bytes allocated with offset 3bc00
+> 1000 bytes allocated with offset 3c000
+> 1100 bytes allocated with offset 3d000
+> 1200 bytes allocated with offset 3d800
+> 1300 bytes allocated with offset 3e000
+> 1400 bytes allocated with offset 3e800
+> 1500 bytes allocated with offset 3f000
+> 1600 bytes allocated with offset 3f800
+> 1700 bytes allocated with offset 40000
+> 1800 bytes allocated with offset 40800
+> 1900 bytes allocated with offset 41000
+> 2000 bytes allocated with offset 41800
+> 2100 bytes allocated with offset 42000
+> 2200 bytes allocated with offset 43000
+> 2300 bytes allocated with offset 44000
+> 2400 bytes allocated with offset 45000
+> 2500 bytes allocated with offset 46000
+> 2600 bytes allocated with offset 47000
+> 2700 bytes allocated with offset 48000
+> 2800 bytes allocated with offset 49000
+> 2900 bytes allocated with offset 4a000
+> 3000 bytes allocated with offset 4b000
+> 3100 bytes allocated with offset 4c000
+> 3200 bytes allocated with offset 4d000
+> 3300 bytes allocated with offset 4e000
+> 3400 bytes allocated with offset 4f000
+> 3500 bytes allocated with offset 50000
+> 3600 bytes allocated with offset 51000
+> 3700 bytes allocated with offset 52000
+> 3800 bytes allocated with offset 53000
+> 3900 bytes allocated with offset 54000
+> 4000 bytes allocated with offset 55000
+> 4100 bytes allocated with offset 56000
+> 4200 bytes allocated with offset 58000
+> 4300 bytes allocated with offset 5a000
+> 4400 bytes allocated with offset 5c000
+> 4500 bytes allocated with offset 5e000
+> 4600 bytes allocated with offset 60000
+> 4700 bytes allocated with offset 62000
+> 4800 bytes allocated with offset 64000
+> 4900 bytes allocated with offset 66000
+> 5000 bytes allocated with offset 68000
+> 100 bytes allocated with offset 39200
+> 200 bytes allocated with offset 39300
+> 300 bytes allocated with offset 3a600
+> 400 bytes allocated with offset 3a800
+> 500 bytes allocated with offset 3aa00
+> 600 bytes allocated with offset 3c400
+> 700 bytes allocated with offset 3c800
+> 800 bytes allocated with offset 3cc00
+> 900 bytes allocated with offset 6a000
+> 1000 bytes allocated with offset 6a400
+> 1100 bytes allocated with offset 6b000
+> 1200 bytes allocated with offset 6b800
+> 1300 bytes allocated with offset 6c000
+> 1400 bytes allocated with offset 6c800
+> 1500 bytes allocated with offset 6d000
+> 1600 bytes allocated with offset 6d800
+> 1700 bytes allocated with offset 6e000
+> 1800 bytes allocated with offset 6e800
+> 1900 bytes allocated with offset 6f000
+> 2000 bytes allocated with offset 6f800
+> 2100 bytes allocated with offset 70000
+> 2200 bytes allocated with offset 71000
+> 2300 bytes allocated with offset 72000
+> 2400 bytes allocated with offset 73000
+> 2500 bytes allocated with offset 74000
+> 2600 bytes allocated with offset 75000
+> 2700 bytes allocated with offset 76000
+> 2800 bytes allocated with offset 77000
+> 2900 bytes allocated with offset 78000
+> 3000 bytes allocated with offset 79000
+> 3100 bytes allocated with offset 7a000
+> 3200 bytes allocated with offset 7b000
+> 3300 bytes allocated with offset 7c000
+> 3400 bytes allocated with offset 7d000
+> 3500 bytes allocated with offset 7e000
+> 3600 bytes allocated with offset 7f000
+> 3700 bytes allocated with offset 80000
+> 3800 bytes allocated with offset 81000
+> 3900 bytes allocated with offset 82000
+> 4000 bytes allocated with offset 83000
+> 4100 bytes allocated with offset 84000
+> 4200 bytes allocated with offset 86000
+> 4300 bytes allocated with offset 88000
+> 4400 bytes allocated with offset 8a000
+> 4500 bytes allocated with offset 8c000
+> 4600 bytes allocated with offset 8e000
+> 4700 bytes allocated with offset 90000
+> 4800 bytes allocated with offset 92000
+> 4900 bytes allocated with offset 94000
+> 5000 bytes allocated with offset 96000
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
index cc70aa6..7c1864b 100644 (file)
@@ -38,7 +38,6 @@ int main(int argc, char**argv)
   }
   XBT_INFO("All blocks were correctly allocated. Free every second block");
   for (i = 0; i < TESTSIZE; i+=2) {
-    size = size_of_block(i);
     mfree(heapA,pointers[i]);
   }
   XBT_INFO("Memset every second block to zero (yeah, they are not currently allocated :)");
index f181bdf..920784f 100644 (file)
@@ -1,6 +1,6 @@
 /* synchro_crashtest -- tries to crash the logging mecanism by doing // logs*/
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 06b41e1..52c4050 100644 (file)
@@ -1,6 +1,6 @@
 /* parmap_test -- test parmap                                               */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 37bb41e..d9d7a01 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the maxmin library                                       */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0d46aa5..f08e322 100644 (file)
@@ -1,6 +1,6 @@
 /* A crash few tests for the maxmin library                                 */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index ab011c2..1fb6436 100644 (file)
@@ -1,6 +1,6 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 9ff6cb8..d07a552 100644 (file)
@@ -1,6 +1,6 @@
 /* A few basic tests for the surf library                                   */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 5b1de6d..b41a667 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the trace library                                       */
 
-/* Copyright (c) 2004, 2005, 2006, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2006, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e49db05..965c1e5 100644 (file)
@@ -1,6 +1,6 @@
 /* A few basic tests for the graphxml library                               */
 
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -79,7 +79,7 @@ void test(char *graph_file)
     buf = xbt_new0(char, n * 20);
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
-        sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]);
+        sprintf(buf + strlen(buf), "%e\t", adj[i * n + j]);
       }
       XBT_INFO("%s", buf);
       buf[0] = '\000';
index b873e1b..5cca0cb 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the xbt_heap module                                      */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2010, 2012, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@ void test_heap_validity(int size)
   qsort(tab, size, sizeof(double), compare_double);
 
   for (i = 0; i < size; i++) {
-    /*     printf("%lg" " ", xbt_heap_maxkey(heap)); */
+    /*     printf("%g" " ", xbt_heap_maxkey(heap)); */
     if (xbt_heap_maxkey(heap) != tab[i]) {
       fprintf(stderr, "Problem !\n");
       exit(1);
index bc50ddd..ebc77e4 100644 (file)
@@ -1,6 +1,6 @@
 /* log_usage - A test of normal usage of the log facilities                 */
 
-/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 147c734..ae1ccd2 100644 (file)
@@ -19,6 +19,7 @@ set(bin_files
 
 set(txt_files
   ${txt_files}
+  ${CMAKE_CURRENT_SOURCE_DIR}/simgrid.supp
   ${CMAKE_CURRENT_SOURCE_DIR}/simgrid2vite.sed
   PARENT_SCOPE
   )
index d282149..92092ea 100755 (executable)
@@ -97,7 +97,7 @@ EOF
     fi
 }
 
-colordiff=$(type -p colordiff)
+colordiff=$(type -p colordiff || true) 
 colorless() {
     if [ -x "$colordiff" ]; then
         "$colordiff" | less -R -F -X
index 4ded2ab..6112c8f 100644 (file)
@@ -8,8 +8,10 @@
 - Makefile
 - doc/html/.*
 
++ \.classpath
 + \.cproject
 + \.gitignore
++ \.project
 + README\.(coding|git)
 + mk_win-dist.sh
 
 + src/smpi/replace_globals\.cocci
 + src/smpi/replace_static\.cocci
 
-+ teshsuite/smpi/mpich-test/coll/bcast2\.f
-+ teshsuite/smpi/mpich-test/coll/nbcoll\.c
-+ teshsuite/smpi/mpich-test/coll/shortint\.c
-+ teshsuite/smpi/mpich-test/coll/temprun
-+ teshsuite/smpi/mpich-test/context/attrt\.c
-+ teshsuite/smpi/mpich-test/context/commnames\.c
-+ teshsuite/smpi/mpich-test/env/argstest\.c
-+ teshsuite/smpi/mpich-test/env/cmdline\.c
-+ teshsuite/smpi/mpich-test/env/errhand2\.c
-+ teshsuite/smpi/mpich-test/env/hang\.c
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/README
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness-euih\.c
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness\.c
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2\.c
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/fairness2m\.c
-+ teshsuite/smpi/mpich-test/pt2pt/fairness/fairnessm\.c
-+ teshsuite/smpi/mpich-test/pt2pt/isndrcv2\.c
-+ teshsuite/smpi/mpich-test/pt2pt/mpitest\.h
-+ teshsuite/smpi/mpich-test/pt2pt/systest\.c
-+ teshsuite/smpi/mpich-test/pt2pt/systest1\.c
-+ teshsuite/smpi/mpich-test/pt2pt/testhetero
-+ teshsuite/smpi/mpich-test/topol/cart\.c
-+ teshsuite/smpi/mpich-test/topol/cart1f\.f
-+ teshsuite/smpi/mpich-test/topol/cart2\.c
-+ teshsuite/smpi/mpich-test/topol/cart2f\.f
-+ teshsuite/smpi/mpich-test/topol/cartc\.f90
-+ teshsuite/smpi/mpich-test/topol/cartf\.f
-+ teshsuite/smpi/mpich-test/topol/cartf\.std
-+ teshsuite/smpi/mpich-test/topol/cartmap\.c
-+ teshsuite/smpi/mpich-test/topol/cartmap\.std
-+ teshsuite/smpi/mpich-test/topol/cartorder\.c
-+ teshsuite/smpi/mpich-test/topol/dims\.c
-+ teshsuite/smpi/mpich-test/topol/graphtest\.c
-+ teshsuite/smpi/mpich-test/topol/graphtest\.std
-+ teshsuite/smpi/mpich-test/topol/test\.c
-+ teshsuite/smpi/mpich-test/topol/test\.h
-+ teshsuite/smpi/mpich-test/topol/twod\.f
-+ teshsuite/smpi/mpich-test/topol/twod2\.f
++ teshsuite/smpi/mpich3-test/f77/attr/.*
 
 + tools/check_dist_archive
 + tools/check_dist_archive\.exclude
+
++ tools/spell/.*
index e7522cc..858e611 100755 (executable)
@@ -40,13 +40,13 @@ print OUTPUT <<EOF;
 This file was generated by tools/doxygen/index_create.pl. DO NOT EDIT.
 
 /** \\defgroup API_index Full Index
-  * \\brief The alphabetical list of all functions, macros and types 
 *  defined by SimGrid
 *
 * List of all functions, variables, defines, enums, and typedefs with
-  * links to the files they belong to. 
 *
 * \\htmlonly Altough completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
+ * \\brief The alphabetical list of all functions, macros and types
+ *  defined by SimGrid
+ *
+ * List of all functions, variables, defines, enums, and typedefs with
+ * links to the files they belong to.
+ *
* \\htmlonly Although completely useless, the complete list of structures defined can be found <a href="annotated.html">here</a> \\endhtmlonly
 
 
 EOF
index 4f24150..cebd30d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
diff --git a/tools/simgrid.supp b/tools/simgrid.supp
new file mode 100644 (file)
index 0000000..7c2feea
--- /dev/null
@@ -0,0 +1,82 @@
+# Valgrind suppressions for stuff that we cannot control
+
+# Memory leak in dash
+# dash is actually used when checking the "mkfile" command in tesh
+{
+   Memory leak in /bin/dash
+   Memcheck:Leak
+   ...
+   obj:/bin/dash
+}
+
+# We also don't want to be annoyed by leaks in /usr/bin/tail
+{
+   Memory leak in /usr/bin/tail
+   Memcheck:Leak
+   ...
+   obj:/usr/bin/tail
+}
+
+# There's a constant leak of 56 bytes in the depths of libc which
+# manifests, for example, when using backtrace()
+{
+   Memory leak in libc/dlopen with -pthread
+   Memcheck:Leak
+   fun:malloc
+   fun:_dl_map_object_deps
+   fun:dl_open_worker
+   fun:_dl_catch_error
+   fun:_dl_open
+   fun:do_dlopen
+   fun:_dl_catch_error
+   fun:dlerror_run
+   fun:__libc_dlopen_mode
+}
+
+# Memory leaks appearing to be in libcgraph.  They can be seen with the
+# following simple program:
+# ,----
+# | #include <stdio.h>
+# | #include <graphviz/cgraph.h>
+# | int main(int argc, char *argv[])
+# | {
+# |     if (argc == 1) {
+# |         printf("Usage: %s <dotfile>\n", argv[0]);
+# |         return 1;
+# |     }
+# |     Agraph_t *g;
+# |     FILE *inf = fopen(argv[1], "r");
+# |     g = agread(inf, 0);
+# |     fclose(inf);
+# |     agclose(g);
+# |     return 0;
+# | }
+# `----
+{
+   Memory leak in libcgraph (1/2)
+   Memcheck:Leak
+   fun:malloc
+   ...
+   obj:/usr/lib/libcgraph.so*
+   fun:aaglex
+   fun:aagparse
+   fun:agconcat
+}
+{
+   Memory leak in libcgraph (2/2)
+   Memcheck:Leak
+   fun:malloc
+   ...
+   fun:agnode
+   obj:/usr/lib/libcgraph.so*
+   fun:aagparse
+   fun:agconcat
+}
+
+# We're not interested by memory leaks in the Lua interpreter
+{
+   Memory leak in lua
+   Memcheck:Leak
+   ...
+   fun:luaD_precall
+}
index 507a46e..22bf4b3 100755 (executable)
@@ -5,7 +5,8 @@ eval 'exec perl -S $0 ${1+"$@"}'
 # This script updates the simgrid XML file passed as argument (modification in place)
 # It is built to do the conversion incrementally.
 
-# Copyright (C) 2006-2011. The SimGrid team. All rights reserved.
+# Copyright (c) 2006-2012. The SimGrid Team.
+# All rights reserved.
 #
 # This file is part of the SimGrid project. This is free software:
 # You can redistribute and/or modify it under the terms of the
@@ -95,7 +96,7 @@ Several tags were renamed (for sake of XML sanity):
   
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011. The SimGrid team. All rights reserved.
+Copyright (c) 2006-2012. The SimGrid Team. All rights reserved.
   
 This program is free software; you may redistribute it and/or modify it
 under the terms of GNU LGPL (v2.1) license.
diff --git a/tools/spell/lspell.pl b/tools/spell/lspell.pl
new file mode 100644 (file)
index 0000000..ef09839
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/perl
+
+# C comment spell checker
+# For each given source file, print the filename, a colon, and the number
+# of misspelled words, then a list of misspelled words.
+# Words contained in the file stopwords.txt are not considered spelling errors.
+# Copyright 2003, Dan Kegel.  Licensed under GPL.  See the file ../COPYING for details.
+
+sub check_content($) {
+       my $content = shift;
+       $content =~ tr/*/ /;
+       print POUT "$content\n";
+}
+
+$TEMPFILE="/tmp/spell.tmp";
+$STOPFILE=shift(@ARGV);
+
+open(STOPFILE, $STOPFILE) || die "can't open stopword file $STOPFILE";
+while (<STOPFILE>) {
+       chomp;
+       $stopped{$_}++;
+}
+close(STOPFILE);
+
+foreach $file (@ARGV) {
+       open (FI, $file) || die $file;
+       $content = join ("", <FI>);
+       close (FI);
+
+       open(POUT, "> $TEMPFILE") || die;
+       $content =~ s!//(.+)$!check_content($1)!egm;
+       $content =~ s!/\*(.+?)\*/!check_content($1)!egs;
+       close(POUT);
+
+       open(PIN, "ispell -d american -l < $TEMPFILE | sort -uf |") || die;
+       undef @badwords;
+       while (<PIN>) {
+               chomp;
+               if ($stopped{$_} == 0) {
+                       push(@badwords, $_);
+               }
+       }
+       close(PIN) || die;
+
+       if (@badwords) {
+               print "$file: ".scalar(@badwords)."\n\n";
+               print join(" ",@badwords)."\n\n";
+       }
+}
diff --git a/tools/spell/lspell2.pl b/tools/spell/lspell2.pl
new file mode 100644 (file)
index 0000000..2532575
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/perl
+
+# C noncomment spell checker
+# For each given source file, print the filename, a colon, and the number
+# of misspelled words, then a list of misspelled words.
+# Words contained in the file stopwords.txt are not considered spelling errors.
+# Copyright 2003, Dan Kegel.  Licensed under GPL.  See the file ../COPYING for details.
+
+sub check_content($) {
+       my $content = shift;
+       $content =~ tr/*/ /;
+       print POUT "$content\n";
+}
+
+$TEMPFILE="/tmp/spell.tmp";
+$STOPFILE=shift(@ARGV);
+
+open(STOPFILE, $STOPFILE) || die "can't open stopword file $STOPFILE";
+while (<STOPFILE>) {
+       chomp;
+       $stopped{$_}++;
+}
+close(STOPFILE);
+
+foreach $file (@ARGV) {
+       open (FI, $file) || die $file;
+       $content = join ("", <FI>);
+       close (FI);
+
+       open(POUT, "> $TEMPFILE") || die;
+       $content =~ s!//(.+)$! !gm;
+       $content =~ s!/\*(.+?)\*/! !gs;
+       print POUT $content;
+       close(POUT);
+
+       open(PIN, "ispell -d american -l < $TEMPFILE | sort -uf |") || die;
+       undef @badwords;
+       while (<PIN>) {
+               chomp;
+               if ($stopped{$_} == 0) {
+                       push(@badwords, $_);
+               }
+       }
+       close(PIN) || die;
+
+       if (@badwords) {
+               print "$file: ".scalar(@badwords)."\n\n";
+               print join(" ",@badwords)."\n\n";
+       }
+}
diff --git a/tools/spell/sg_stopwords.txt b/tools/spell/sg_stopwords.txt
new file mode 100644 (file)
index 0000000..bbb97a5
--- /dev/null
@@ -0,0 +1,5408 @@
+aa
+aadb
+abcd
+abortMsg
+abs
+abstrusegoose
+ac
+Accessor
+accumbuf
+accure
+Acecpts
+actbuf
+actionA
+actionB
+actionC
+adag
+addem
+addl
+addlen
+addmult
+addq
+addr
+ADDR
+AddrBStore
+ADDRESSOFFSET
+AddrFrame
+addrline
+AddrMode
+AddrModeFlat
+AddrModeReal
+AddrPC
+AddrReturn
+addrs
+AddrStack
+addtest
+addtogroup
+addVariable
+AddVariable
+ADI
+adisp
+adispl
+adj
+ADJ
+adjsize
+Adrien
+ADSP
+ADSPBLACKFIN
+ADSPTS
+adst
+AdvanceState
+aend
+aext
+afc
+afd
+aff
+agclose
+Agdisc
+Agedge
+agfstin
+agfstnode
+agfstout
+agget
+aghead
+agnameof
+Agnode
+agnxtin
+agnxtnode
+agnxtout
+AGRAPH
+agread
+AGSEQ
+agtail
+aint
+Aint
+AINT
+aintv
+ainv
+AIX
+aka
+al
+alegrand
+algo
+algorihtm
+Algorithmica
+alice
+aliceTimes
+allContainers
+allgather
+Allgather
+ALLGATHER
+ALLGATHERS
+allgatherv
+Allgatherv
+ALLGATHERV
+ALLGATHERVS
+alloc
+Alloc
+AllocateGrid
+allocs
+Allocs
+allof
+allowSmaller
+allred
+allreduce
+allReduce
+Allreduce
+ALLREDUCE
+ALLREDUCES
+AllReqsValid
+alltoall
+allToAll
+Alltoall
+ALLTOALL
+ALLTOALLS
+alltoallv
+allToAllv
+allToAllV
+Alltoallv
+ALLTOALLV
+ALLTOALLVS
+alltoallw
+Alltoallw
+alltypes
+ALTIX
+amd
+AMDExtendedCpuFeatures
+amdahl
+Amdahl
+aName
+anl
+annuli
+aNode
+ans
+ansi
+antibcast
+anwser
+ap
+api
+app
+appender's
+appnum
+APPNUM
+apps
+ar
+archs
+arcId
+arcShow
+arctan
+arecv
+arg
+ARG
+argc
+ARGN
+args
+ARGS
+argsused
+argv
+ARGV
+ARGVS
+arity
+Arity
+armageddon
+Arnaud
+arr
+Arr
+ARR
+ARray
+ARRAYINDEXTYPEID
+arrShow
+ars
+asap
+ascii
+AsciiTraceHelperForDevice
+AsciiTraceUserHelperForDevice
+ASes
+asg
+asize
+asizev
+asm
+ASN
+asnprintf
+ASNPRINTF
+asprintf
+ASPRINTF
+aspx
+asr
+ASR
+asrc
+ASroute
+assoc
+astart
+async
+atan
+atexit
+atfork
+atof
+atoi
+atol
+att
+AttachArc
+AttachCurrentThread
+AttachNode
+ATTLIST
+attr
+Attr
+ATTR
+AttributeValue
+attrs
+ATTRS
+attrt
+attrval
+atype
+Auther
+autoconf
+autoheader
+automagically
+autorestart
+Autorestart
+autorestarting
+autoschedule
+autotest
+autotuning
+aux
+Aux
+AUX
+AVAILCPU
+aval
+avg
+Avg
+AvgCalc
+AvgFromIdleTime
+AvgFromNonIdleTime
+avpkt
+avval
+AXP
+@@@@@@@@@@@@@@@@@@@@@@@@@@@ STOPPED CHECKKING HERE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ba
+backboneNode
+BackingStoreBase
+BackingStoreEnd
+BackingStoreOffset
+backoff
+backsub
+backtrace
+Backtrace
+BACKTRACE
+backtraces
+Bailling
+barabasi
+Barabasi
+baseaddr
+BASEADDR
+basecount
+basegroup
+basename
+BaseOfImage
+basesize
+BASETYPE
+bb
+bbuf
+bc
+bcast
+Bcast
+BCAST
+bcasting
+BCASTS
+Bconnection
+bdebug
+bdw
+begining
+beginreceive
+behaviour
+benchs
+BeOS
+BEOS
+bestprac
+bewtween
+bf
+bfef
+bg
+Bg
+BH
+BIGENDIAN
+bigunsigned
+binimoal
+bintree
+bionomial
+bitcount
+Bitcount
+bitfield
+BITFIELD
+bithacks
+bitmask
+BITPOSITION
+bittorrent
+Bittorrent
+bitval
+bl
+Blackfin
+blankline
+blen
+blens
+blimit
+blk
+blkidx
+blklen
+blklens
+blks
+blksize
+blockcnt
+blockcount
+BLOCKCOUNT
+BLOCKIFY
+blockindex
+blockindexed
+blockinfo
+blocklen
+blocklength
+blocklengths
+blocklens
+BLOCKLOG
+blocksize
+BLOCKSIZE
+blocksizes
+BM
+bmname
+bmsk
+bmtree
+BMTREE
+bName
+bnext
+bNode
+bobTimes
+Boivin
+bol
+booktitle
+bool
+Bool
+BOOL
+BOOOOOUUUHHH
+BOR
+borken
+Borland
+BORLAND
+BORLANDC
+BORLANDDC
+Bourassa
+bp
+bprintf
+bps
+Bps
+bptr
+breakeven
+breakval
+breg
+bregister
+brillant
+brokenpipe
+bruck
+Bruck
+bs
+bsdos
+bsection
+bsend
+Bsend
+BSend
+BSEND
+bsendbuf
+bsendbufsize
+bsends
+bsize
+bss
+BSS
+bt
+BT
+btemp
+btio
+BTLs
+btype
+buchi
+bucklet
+bucklets
+buf
+BUF
+bufd
+buffbegin
+BUFFERDONE
+bufferedBytes
+BUFFERLIT
+BUFFERLITERAL
+BUFFERPUTC
+BUFFERSET
+buffersize
+BufferSize
+bufferstack
+BUFFERSTACKSIZE
+buffout
+BUFFSIZE
+buffstr
+bufin
+BUFLEN
+bufmem
+bufname
+bufout
+bufp
+bufs
+bufsize
+BUFSIZE
+bufsizes
+BUGREPORT
+buildBH
+BuildComm
+BuildNumber
+buildSH
+buildtools
+buildWH
+builtin
+BUILTIN
+builtins
+bupass
+bval
+bVerify
+bvprintf
+bw
+Bw
+Bwrite
+bx
+BXOR
+BYBANDWIDTH
+BYLATENCY
+bypassASroute
+BYPASSERROR
+bypassroute
+bypassRoute
+bypassRoutes
+bytesInQueue
+bytesread
+bzero
+ca
+cacc
+cairo
+calc
+calcule
+callback
+Callback
+CALLBACK
+CallbackParam
+CallbackRoutine
+callbacks
+Callbacks
+CallbackType
+CALLBACKW
+CallObjectMethod
+calloc
+callocation
+CallStaticObjectMethod
+CallStaticVoidMethod
+CallVoidMethod
+Caolan
+capa
+caract
+caracteristic
+cardA
+cardB
+carefuly
+carfull
+carole
+cartdim
+Cartdim
+cartesian
+cas
+Cas
+CAS
+casanova
+castless
+catched
+Catched
+catname
+catName
+catv
+cb
+CBA
+cbarg
+cblas
+CblasNoTrans
+CblasRowMajor
+cbrt
+cc
+CC
+ccgrid
+ccmake
+ccomm
+CCRITICAL
+CCRITICALn
+cd
+CDATA
+CDEBUG
+cdecl
+ce
+ceid
+ceil
+cerrcnt
+cerrhandler
+CERROR
+c'est
+cf
+cfg
+cfgelm
+cflags
+CFunction
+cg
+Cg
+CGRAPH
+cgroup
+ch
+Chaine
+CHAINE
+chainsend
+ChangeLog
+changeset
+channelFactory
+chartype
+chdir
+checkany
+checkAttrs
+checkB
+CheckBuf
+checkD
+CheckData
+checkint
+checkinteger
+checkNoAttrs
+checknumber
+checkParameters
+checkResult
+CheckSeed
+checkstring
+CheckSum
+CheckThresh
+checktype
+checkudata
+CheckVal
+childCount
+ChildId
+CHILDRENCOUNT
+childs
+childsize
+chk
+chksum
+choosed
+choosen
+chrono
+chunck
+cin
+cinbuf
+cinfo
+CINFO
+cinPtr
+ck
+classname
+ClassNotFoundException
+classp
+CLASSPARENTID
+ClassType
+Clauss
+clearerr
+ClientPointers
+clinkflags
+CLM
+cloest
+CloseHandle
+cls
+clust
+cmake
+Cmake
+CMake
+CMAKE
+cmd
+cmdline
+C'mon
+cmp
+cmpi
+cmpstringp
+cname
+cnamelen
+cnst
+cnsts
+cnt
+cnts
+co
+coccinelle
+coclass
+CODEGEARC
+coef
+coeficient
+coeur
+COFF
+CoffSymbols
+cojava
+COJAVA
+col
+coldim
+coll
+COLL
+collbuf
+colls
+COLLS
+colomn
+colori
+columntype
+colwise
+com
+CombineStreams
+comm
+Comm
+COMM
+commande
+commandline
+CommentStreamA
+CommentStreamW
+comming
+COMMITED
+commname
+commok
+commrev
+comms
+COMMS
+commslice
+Communic
+commutivity
+commuttive
+comp
+Comp
+COMP
+compar
+compiletime
+completedTasks
+CompleteInFiles
+comput
+computationAmount
+ComputeDuration
+computeDurations
+Comunication
+comz
+concat
+CONCAT
+cond
+COND
+conf
+CONF
+config
+Config
+CONFIG
+configurability
+conftestval
+congruential
+connexion
+consequetive
+consequtive
+const
+Const
+CONST
+consts
+constu
+cont
+ContainerType
+containg
+contening
+contextes
+ContextFlags
+contidion
+contig
+Contig
+contignous
+contiuing
+Contraintes
+controlflow
+convers
+convertable
+convertdouble
+conz
+coord
+COORD
+coords
+cOp
+copybomb
+CopyStream
+coreAmount
+CoroutineSupport
+corre
+correponding
+corresonding
+countelems
+courant
+cout
+coutbuf
+coutPtr
+cp
+cplusplus
+CPLUSPLUSCAST
+cpos
+cpp
+CPP
+CPPFLAGS
+CPS
+cpt
+cpu
+Cpu
+cpuA
+cpuB
+CpuInfo
+cpus
+cpusetsize
+CpuTI
+CPUTIME
+cputimer
+CPUTTIME
+CpuUsedTask
+CpuUsedVm
+cpvoid
+cpy
+cRank
+crashtest
+CRAYC
+CREAT
+Creata
+createContainer
+CreateContainer
+createDottyFile
+createEnvironment
+CreateEvent
+create'ing
+CreateSemaphore
+CreateStream
+CreateThread
+creationTime
+creq
+cReq
+crequest
+cRequest
+crosstraffic
+crt
+crypto
+c's
+CSDVersionRva
+cSize
+csma
+csn
+csum
+ctask
+Ctask
+ctg
+ction
+CTL
+ctn
+ctof
+CTOR
+ctr
+Ctrl
+CTRL
+ctx
+CTX
+ctxs
+ctype
+cuf
+cunit
+CUNIT
+curr
+currcell
+currentContainer
+currentHost
+currentProcess
+currentQueueLen
+currentThread
+currj
+currusecs
+cv
+CV
+cval
+CVData
+CVERB
+CVREC
+CvRecord
+CVSig
+cw
+CWARN
+CXX
+CYCLECNTR
+cycleval
+cygnus
+CYGWIN
+da
+Da
+dag
+Dalcin
+damnit
+Damnit
+DARG
+dargs
+darray
+DARRAY
+darrays
+darraytype
+darwin
+darwins
+dat
+dataext
+DATAKIND
+dataloop
+Dataloop
+datarep
+DATAREP
+datasize
+dataSize
+DataSize
+datastructure
+datastructures
+DATATOSENT
+datatype
+Datatype
+DATATYPE
+datatypes
+Datatypes
+DATATYPES
+dataype
+dax
+daxFile
+daxload
+daxparse
+db
+dbf
+dbg
+dbgflag
+dbghelp
+DBGHELP
+DbgUnmatched
+DBHHEADER
+DBHLPAPI
+DBL
+dc
+dcb
+dd
+DD
+ddfs
+DDFS
+de
+dealed
+debbugging
+DEBUGDIRS
+debuged
+DebugHelp
+debuging
+debugsynch
+DECC
+decl
+DECL
+declspec
+def
+DEF
+DEFFILE
+defgroup
+defineContainerType
+DefineContainerType
+defineEntityValue
+DefineEntityValue
+defineEventType
+DefineEventType
+defineLinkType
+DefineLinkType
+defineStateType
+DefineStateType
+defineVariableType
+DefineVariableType
+degub
+delect
+deletebomb
+deleteCalled
+DeleteCriticalSection
+DeleteGlobalRef
+DeleteLocalRef
+DeleteStream
+DELIM
+delm
+deltap
+deltat
+deltaTime
+Denable
+denom
+dep
+depafter
+depbefore
+depcnt
+deployApplication
+deployement
+deployer
+deploymentFile
+deref
+DEREGISTER
+derouted
+des
+desactivated
+desc
+DESC
+descp
+Descp
+descr
+descrip
+Descrip
+Descrp
+dest
+destArray
+destContainer
+DestContainer
+DestContainerType
+destroyContainer
+DestroyContainer
+Destroyes
+DetachCurrentThread
+DetailsLevel
+dev
+developper
+deviatinon
+deviceFactory
+DEVZERO
+Df
+dflt
+DFLT
+DFS
+dg
+DGArc
+dgemm
+DGNode
+DGraph
+DGRAPH
+Dichotomic
+dichotomyal
+dict
+DICT
+dictelm
+dicti
+dictionnaries
+dictionnary
+Dictionnary
+dicts
+diff
+differents
+diffmax
+diffmin
+dijkstra
+dijkstracache
+DijkstraCache
+DIJKSTRACACHE
+dinbuf
+dir
+DIR
+discret
+disemmination
+disp
+displ
+displs
+disponible
+disps
+dist
+DIST
+distrib
+distribs
+div
+djb
+DJB
+DL
+dlerror
+dlfcn
+DLFCN
+DLjava
+dll
+DLL
+dllexport
+dllimport
+DllMain
+dlsym
+dmesh
+dmp
+DMPICH
+DMTEST
+dn
+DNDEBUG
+DNLOG
+dnxm
+dnym
+dnzm
+DOCTYPE
+docummentation
+DoDequeue
+DoEnqueue
+doesnt
+doexception
+dogbone
+doit
+dolog
+Donahoo
+donc
+dont
+DONT
+dontinclude
+doOutput
+dopar
+DoPeek
+doTest
+dotload
+dotloader
+dotout
+dotparse
+doublecircle
+doubleint
+doublering
+doubleValue
+doule
+doutbuf
+doxygen
+DOXYGEN
+dp
+dpor
+DPOR
+dprintf
+dpx
+drand
+DRAND
+DropPacket
+DS
+dsend
+dsendBounded
+dsize
+dsp
+DSP
+DSPs
+dssp
+dst
+DST
+dsts
+dt
+DT
+dtd
+DTD
+dtdssp
+dth
+dttx
+dtty
+dttz
+dtype
+DTYPES
+dum
+DUMMYSTRUCTNAME
+DUMMYUNIONNAME
+d'un
+dup
+Dup
+DUP
+dupcomm
+dup'ed
+dup'ing
+dupplicates
+dupported
+dups
+dup's
+duptype
+dupWorld
+dur
+Duy
+dval
+dvfs
+dw
+DW
+dwHighDateTime
+dwLowDateTime
+dwNumberOfProcessors
+DWORD
+DWORDPTR
+dx
+DXBT
+dxmax
+dy
+dymax
+dyn
+DYNamic
+dynar
+Dynar
+DYNAR
+DynArr
+dynars
+Dynars
+dynar's
+dynat
+dynlib
+dynlinker
+dz
+dzmax
+EAGAIN
+EagerShort
+eash
+eax
+eb
+ebp
+Ebp
+EBUSY
+ebx
+ec
+Ecuyer
+ecx
+edi
+edu
+edwiny
+edx
+ee
+EEXIST
+Ef
+EFAIL
+EFT
+egcs
+EINPROGRESS
+EINTR
+EINVAL
+Eip
+elem
+ELEM
+elems
+elif
+elmi
+elmsize
+elmts
+elsewere
+eltext
+elts
+Emden
+EmptyAttributeValue
+en
+En
+EnableAsciiInternal
+EnablePcapInternal
+ename
+ENAMETOOLONG
+endcode
+EndContainer
+EndContainerType
+EndEventDef
+endhtmlonly
+endian
+ENDIAN
+EndIdlePeriod
+endif
+endLink
+EndLink
+endmark
+endptr
+endverbatim
+Engelschall
+englobing
+ENOBUFS
+ENOMEM
+ENOSYS
+ENT
+EnterCriticalSection
+ENTITYTEXT
+EntityType
+EntriesFilled
+EntriesMatched
+entrycpy
+enum
+ENUM
+EnumDirTree
+EnumDirTreeW
+EnumerateLoadedModules
+EnumerateLoadedModulesW
+ENUMERATESYMBOLS
+ENUMLINES
+ENUMMODULES
+ENUMSOURCEFILES
+ENUMSYMBOLS
+env
+ENV
+envFile
+environmentGetRoutingRoot
+envval
+EOB
+EOB's
+eof
+EOF's
+eol
+EOL
+EOS
+EOVERFLOW
+ep
+EP
+EPASS
+EPIO
+EPIPE
+eq
+equiv
+EQUIV
+erand
+ERANGE
+errcat
+errclass
+errcnt
+errcode
+errcodes
+ERRCODES
+errh
+errhand
+errhandler
+Errhandler
+ERRHANDLER
+errhandlers
+errlen
+ERRLIMIT
+errmsg
+ERRMSG
+errno
+ERRNO
+erro
+errorclass
+errorcode
+errorcodes
+erroreous
+esi
+esp
+Etag
+ETag
+ETIMEDOUT
+euclidean
+EuroMPI
+ev
+evalEwma
+evalIdleDamping
+evalP
+evalue
+EventDef
+EventType
+everyobne
+eviltype
+evp
+evt
+evtname
+ewma
+EWOULDBLOCK
+exaflops
+exc
+ExceptionAddress
+ExceptionClear
+ExceptionCode
+ExceptionFlags
+ExceptionInformation
+ExceptionOccurred
+ExceptionPointers
+ExceptionRecord
+ExceptionStream
+excl
+EXCL
+EXE
+execinfo
+EXECINFO
+execlp
+execve
+exemple
+Exemple
+exepeted
+exibitionist
+existant
+exitcode
+ExitThread
+exitTime
+exp
+Exp
+explicitely
+explicitFilename
+expon
+expr
+EXPR
+exptr
+exscal
+exscan
+Exscan
+ext
+exted
+externs
+extrastate
+fabs
+Factorise
+Fafard
+fallback
+FALLTHROUGH
+fap
+Faraj
+FATPIPE
+fb
+fBps
+fbreg
+fbregister
+fced
+fclose
+fcntl
+fcomm
+fct
+fd
+FD
+fdim
+fDOSImage
+FDs
+fdwReason
+feasability
+featnum
+featp
+FeatureInformation
+feeded
+feof
+ferrhandler
+ferror
+fflags
+fflush
+FFLUSH
+ffs
+FFT
+fftblock
+fftblockpad
+fftcopy
+fftlow
+ffts
+fftx
+ffty
+fftz
+fg
+fgetc
+fgets
+fgroup
+fh
+fhandle
+FI
+FIBO
+fibonacci
+fictiv
+fielddim
+fieldID
+fifo
+FIFOs
+fileCount
+FileHeader
+fileName
+FileName
+filenm
+fileno
+filepos
+FILETIME
+filtrage
+FIMXE
+finalizer
+finaltype
+finbuf
+FINDCHILDREN
+FindClass
+FindClose
+FindDebugInfoFile
+FindDebugInfoFileEx
+FindDebugInfoFileExW
+FINDENT
+FindExecutableImage
+FindExecutableImageEx
+FindExecutableImageExW
+FindFileInPath
+FindFirstFile
+finfo
+Fint
+firstChild
+firstChildIdx
+firstLayerNode
+firt
+fisrt
+FIXEDFILEINFO
+fixedsize
+Fixme
+FIXME
+fjac
+flatifier
+flattree
+FLEXINT
+flexml
+FleXML
+FLEXML
+flink
+flinkflags
+floatint
+floyd
+Floydâ
+fmpi
+fmt
+fn
+FN
+fname
+fnf
+FNV
+fo
+focusNode
+foffset
+FOLD's
+Fonction
+fonctions
+fontcolor
+fontsize
+foo
+FOO
+fopen
+forcedDrop
+forcedMark
+foreach
+Foreach
+FOREACH
+foreachInNeighbor
+foreachOutNeighbor
+forestgreen
+formated
+fortran
+forumula
+foundError
+foutbuf
+fp
+FP
+fpi
+fprintf
+fputs
+fr
+fraghead
+FrameOffset
+FramePointer
+FRAMEREL
+FRAMERELATIVE
+fread
+fReadOnly
+Freebsd
+FreeBSD
+FreeBuf
+free'd
+freehook
+freeitem
+FreeLibrary
+freing
+frequest
+Frgamented
+FromContainer
+fromPID
+Frumkin
+fs
+fscanf
+fsizeof
+fstat
+fSystemImage
+ftime
+ftnlen
+ftruncate
+ftype
+fucntion
+fucntions
+fuction
+FULLDUPLEX
+fullname
+FullPath
+func
+FUNC
+FUNCENTRY
+FuncTableEntry
+functionnality
+functionName
+functionning
+FunctionTableStream
+funs
+funtion
+futex
+FUTEX
+fwrite
+galt
+Gansner
+gantt
+Gantt
+garbageCollector
+gatherv
+Gatherv
+GATHERV
+Gaussain
+gaussian
+GBps
+Gbytes
+gc
+GCB
+gcc
+GCC
+GCH
+GCM
+gcov
+gd
+gdb
+GEF
+Geier
+Gemm
+gen
+Genaud
+genericity
+getaffinity
+getarg
+GetArrayLength
+GetAverageQueueSize
+Getb
+GetBooleanField
+getbound
+getByName
+getc
+getClock
+getComputeDuration
+getcontext
+getCoreNumber
+getCoroutineSupport
+getCount
+GetCurrentDirectory
+GetCurrentProcess
+GetCurrentThread
+GetDoubleArrayElements
+GetDoubleField
+getdtablesize
+GETDTABLESIZE
+Getelements
+getenv
+GetExitCodeThread
+GetFeatureNum
+getfield
+GetFieldID
+getfirst
+getFirst
+getFirstitem
+getFirstItem
+GetFNumDPar
+getglobal
+getHosts
+getHostVariablesName
+GetIntArrayRegion
+getinter
+GetIP
+getItemcontent
+GetJavaVM
+getkey
+getlast
+GetLastError
+getline
+getLinkVariablesName
+getLoad
+GetLongField
+getmetatable
+GetMethodID
+GetMode
+getModel
+getName
+getNext
+getNextitem
+getNextItem
+GetObjectArrayElement
+GetObjectField
+getopt
+getopts
+getpagesize
+getparam
+getpid
+getPrev
+getPrevitem
+getPrevItem
+GetProcAddress
+GetProcessTimes
+getProperty
+getRemainingDuration
+getrusage
+GETRUSAGE
+getSender
+GETSET
+getSons
+getSource
+getspecific
+getSpeed
+getstacksize
+GetState
+GetStaticMethodID
+GetStringUTFChars
+GetSystemInfo
+GetSystemTimeAsFileTime
+gettable
+GetThreadContext
+GetThreadTimes
+gettime
+GETTIME
+gettimeofday
+GETTIMEOFDAY
+GetTimestampForLoadedLibrary
+gettop
+GetTypeId
+getupvalue
+getvalue
+geven
+GEY
+Gf
+GFcs
+Gflop
+GFlops
+gforge
+ghigh
+GiB
+GiBps
+gigaflops
+gige
+Ginette
+github
+gl
+glibc
+globalcontext
+GLOBALSINDEX
+GLOBALSONLY
+GlobalSymbols
+globl
+Gloups
+gM
+gN
+gname
+gnuc
+GNUC
+gnuld
+gnuplot
+godd
+goodell
+goodval
+gos
+gotit
+gov
+GPL
+gpu
+GPU
+gr
+grank
+graphdims
+Graphdims
+graphicator
+GRAPHICATOR
+graphname
+GraphName
+graphShow
+graphviz
+GraphViz
+GRAPHVIZ
+graphvizFile
+graphxml
+GraphXML
+GRAPHXML
+gras
+GRAS
+grep
+grequest
+Grequest
+grev
+Grig
+growsdown
+grp
+gself
+gsize
+gsizes
+gtnets
+GTNets
+GTNetS
+GTNETS
+GTSim
+GUID
+GUIDPTR
+gurantee
+Gurer
+gw
+gworld
+gz
+hacc
+hackish
+Hadjidoukas
+Haertel
+hal
+halfing
+handbuilt
+handleA
+handleB
+HandleDataStream
+handside
+hardcoded
+hashtable
+havenots
+hd
+hdBase
+Hdd
+HDD
+hdf
+HDF
+hdMax
+hdrstop
+hdSrc
+hdSym
+headersize
+heapA
+heapbase
+heapify
+heapindex
+heapinfo
+heaplimit
+heapsize
+heapstats
+heavytailed
+HelloWorld
+HEREUNDER
+het
+hexa
+hFile
+hideinitializer
+hier
+highpc
+hindex
+hindexed
+Hindexed
+HINDEXED
+HINSTANCE
+hinstDLL
+hist
+hlp
+hlrs
+HMODULE
+hndl
+Hoekstra
+Hofmann
+hoser
+hostcount
+hostent
+HostFailureException
+hostgroup
+hostid
+hostlist
+HostNotFoundException
+hostPopState
+hostPushState
+hostSetState
+hostStateDeclare
+hostStateDeclareValue
+hostVariableAdd
+hostVariableAddWithTime
+hostVariableDeclare
+hostVariableDeclareWithColor
+hostVariableSet
+hostVariableSetWithTime
+hostVariableSub
+hostVariableSubWithTime
+hotpink
+hp
+HPC
+HPCASIA
+hppa
+hProcess
+hpua
+hpux
+HPUX
+hr
+href
+ht
+html
+htmlonly
+http
+https
+hval
+hvector
+HVECTOR
+HW
+HWND
+hy
+ia
+IA
+Iallgather
+Iallgatherv
+Iallreduce
+Ialltoall
+Ialltoallv
+Ialltoallw
+iam
+iar
+ib
+Ibarrier
+Ibcast
+ibm
+IBMC
+ibsend
+Ibsend
+ic
+iccreate
+icomms
+ICS
+i'dea
+idem
+IDENT
+Identificator
+idleStart
+idrss
+IDs
+idump
+idup
+IDUP
+idx
+Idx
+ie
+Ie
+IEC
+ieee
+ierr
+Iexscan
+ifdef
+iff
+ifndef
+Ig
+Igather
+Igatherv
+IGN
+iinbuf
+ijs
+ik
+iksemel
+ilimit
+IllegalArgumentException
+ilog
+im
+IM
+i'm
+imag
+IMAGEAPI
+ImageBase
+IMAGEDIR
+ImageDirectoryEntryToData
+ImageDirectoryEntryToDataEx
+ImageFileName
+ImageFilePath
+IMAGEHLP
+ImagehlpApiVersion
+ImagehlpApiVersionEx
+ImageName
+ImageNtHeader
+ImageRvaToSection
+ImageRvaToVa
+ImageSize
+imax
+IMAX
+IMAXP
+imediately
+immediatly
+immu
+impl
+implem
+implicitely
+impls
+improbe
+Improbe
+imrecv
+Imrecv
+imx
+inArc
+inbetween
+inbi
+inblock
+inbuf
+inc
+incl
+IncludeModule
+IncludeModuleCallback
+IncludeThread
+IncludeThreadCallback
+INCOMMENT
+incomming
+incount
+incp
+IncPrec
+incr
+INCR
+IncreasedPrecis
+ind
+inDegree
+independant
+indexstack
+INDEXSTACKSIZE
+indicacates
+indice
+indicies
+inducedLoad
+inet
+inext
+infomations
+infos
+InfoState
+INFOW
+infrastucture
+ingroup
+iniates
+init
+Init
+INIT
+InitBuf
+initDynamicThrottling
+inited
+initialisation
+Initialisation
+Initialise
+initialising
+InitializeCriticalSection
+InitializeRoutes
+initMat
+inlined
+inlining
+inode
+Inode
+inOptional
+inorm
+inout
+inoutbuf
+inoutvec
+INPI
+inplace
+Inproceedings
+InProceedings
+inria
+insize
+inspirated
+instanciate
+instr
+INSTR
+InstructionOffset
+InstrUserVariable
+int
+INT
+interate
+interation
+intercomm
+Intercomm
+interCommIdx
+interCommName
+intercomms
+intercommunicator
+intercommunicators
+interconnexion
+INTERFAC
+INTERMEDIAT
+intermidiate
+interoperation
+InterRedist
+inthandler
+intilialize
+intptr
+intraCommIdx
+intraCommName
+intracommunicator
+IntraRedist
+ints
+INTs
+INTS
+inttype
+inttypes
+INTTYPES
+InvA
+inVal
+invalide
+invec
+io
+IOLBF
+iosize
+iostream
+IOSTREAM
+iotimer
+iotype
+iotypes
+ioutbuf
+ip
+ipdps
+ipow
+ipowMod
+iprobe
+Iprobe
+IPROBE
+iptr
+ipv
+IPV
+ir
+irecv
+Irecv
+IRecv
+IRECV
+irecvBounded
+irecvs
+irecv's
+Ireduce
+ireqs
+IRGRP
+IRIX
+iro
+IROTH
+irsend
+Irsend
+IRSEND
+IRUSR
+isatty
+isAvail
+isBasic
+Iscan
+Iscatter
+Iscatterv
+iscfunction
+isdefault
+isdigit
+isDirected
+iseek
+isenabled
+ISENABLED
+ISENABLEDV
+isend
+Isend
+ISend
+ISEND
+isendBounded
+isends
+Isends
+isend's
+isfinite
+isfunction
+ish
+isi
+isIdentity
+IsIdling
+isiz
+isleft
+isLeft
+isLeftGroup
+isnil
+isnt
+isnumber
+isPermutedIdentity
+isqrt
+isrc
+isRoot
+isrss
+isRunning
+issend
+Issend
+isset
+isShiftLeft
+isspace
+isstring
+isSuspended
+istable
+isThreshInherited
+isum
+isused
+Itemcontent
+itemp
+iter
+ITER
+iters
+ith
+itmax
+ival
+ivalue
+iwannadie
+IWGRP
+IWUSR
+ixrss
+ja
+Jacquelin
+jalias
+jargs
+jas
+JAS
+jauto
+java
+JavaVM
+Jave
+jb
+jboolean
+jclass
+jclassname
+jcomm
+JCOMM
+jcomputeDuration
+jcomputeDurations
+jcoreamount
+jcoroutine
+jdeploymentFile
+jdouble
+jdoubleArray
+jed
+jedule
+Jedule
+JEDULE
+Jehoshua
+jenv
+jfield
+jfieldID
+jfile
+JFILE
+jhi
+jhost
+JHOST
+jhostname
+jhostName
+jhosts
+Jin
+jint
+jintArray
+jitted
+jj
+jkill
+jkilltime
+jlo
+jlong
+jmailbox
+JMAX
+JMAXP
+jmessageSize
+jmessageSizes
+jmethod
+jmethodID
+jmillis
+jmp
+jmsg
+jname
+jnanos
+jni
+JNI
+JNICALL
+JNIEnv
+JniException
+JNIEXPORT
+jobCount
+jobject
+jobjectArray
+joinable
+jpath
+JPG
+jplatformFile
+jprocess
+JPROCESS
+jproperty
+jreceiving
+jresetPID
+jrngstream
+js
+jseconds
+jseed
+jsize
+jstorage
+jstring
+jsut
+JSYNCHRO
+jsyncro
+jtable
+jtask
+Jtask
+JTASK
+jthread
+jthrowable
+jtimeout
+jtrace
+junkarea
+juste
+jval
+jvalue
+jvm
+JVM
+jxbt
+JXBT
+kademlia
+KADEMLIA
+KADEPLOY
+kBps
+KCCFLN
+KDHELP
+kernelTime
+KeUserCallbackDispatcher
+keyname
+keyorder
+keyval
+Keyval
+KEYVAL
+keyvals
+keyvalue
+kf
+kflop
+kgn
+Kib
+KiB
+KiBps
+KiCallUserMode
+kilkil
+killall
+killAll
+KILLALL
+killTime
+kiloflops
+kk
+kluges
+kmax
+KMAX
+kmin
+kn
+Ko
+kolay
+Kristoffer
+ktm
+Kuznetsov's
+Lâ
+Lacage
+Ladd
+lagrange
+LagrangeVelho
+lagrangian
+lang
+larr
+lastblocks
+LASTCODE
+lasti
+lastj
+LastReservedStream
+LastRvaSection
+LASTUSECODE
+LASTUSEDCODE
+lat
+Latham
+lauxlib
+lbl
+lc
+LC
+lchild
+lcoords
+lcs
+ld
+LD
+lda
+ldb
+ldc
+ldinbuf
+ldKB
+ldl
+ldoutbuf
+le
+LeaveCriticalSection
+lecuyer
+L'Ecuyer
+leechers
+leftGroup
+Legout
+LegrandVelho
+len
+leng
+lenght
+lenhi
+lenlo
+leq
+lerrclass
+lerrcnt
+lerrs
+les
+l'etter
+lexer
+LEXICALPARENT
+lf
+Lf
+lfields
+lg
+LG
+lgp
+LGPL
+lhs
+lhsa
+lhsb
+lhsc
+libc
+libcgraph
+libex
+libf
+libgen
+libs
+Libs
+libsimgrid
+libtool
+libunwind
+Lieber
+lightblue
+lightuserdata
+lin
+linbuf
+linecount
+linelen
+LINELEN
+lineno
+linenum
+lineNum
+LineNumber
+LineNumbers
+lineptr
+LINEW
+LinkA
+linkContainers
+linkid
+linkp
+linkSrcDstVariableAdd
+linkSrcdstVariableAddWithTime
+linkSrcDstVariableSet
+linkSrcDstVariableSetWithTime
+linkSrcDstVariableSub
+linkSrcDstVariableSubWithTime
+LinkType
+linkVariableAdd
+linkVariableAddWithTime
+linkVariableDeclare
+linkVariableDeclareWithColor
+linkVariableSet
+linkVariableSetWithTime
+linkVariableSub
+linkVariableSubWithTime
+linux
+Lisandro
+listenFrom
+listenFromHost
+listenning
+ListStream
+LITT
+Ljava
+lkey
+ll
+LL
+llb
+lld
+llinbuf
+LLONG
+lloutbuf
+llp
+llu
+LLx
+LLX
+lm
+lmlast
+lmm
+lmpi
+ln
+lnlast
+loadbuffer
+LoadedImageName
+LoadedPdbName
+LoadLibraryA
+LOADW
+loc
+localA
+localB
+localcomm
+Localcopy
+localrank
+localtime
+loclist
+logEvent
+LogEvent's
+Loggings
+LogOPSim
+logprocs
+LOGV
+longdesc
+longdoubleint
+longint
+longjmp
+LONGLONG
+loopback
+loopcount
+loopProgress
+LOR
+Lorg
+loria
+Loris
+loutbuf
+lowestCommonAncestor
+lowpc
+lp
+LPADDRESS
+LPAPI
+lpos
+LPSTACKFRAME
+LPTHREAD
+LPVOID
+lpvReserved
+lr
+lrank
+lranks
+lroot
+LSB
+lseek
+Lsimgrid
+lsit
+lsize
+lt
+ltl
+LTL
+ltrim
+LTriming
+ltype
+lu
+lua
+Lua
+LUA
+luaL
+lualib
+luaopen
+lua's
+lucas
+LV
+lvalue
+LVALUE
+lx
+Lx
+LXOR
+mac
+MACOS
+Macs
+madcat
+madre
+maestrotbs
+maetro
+MaintainerMode
+majflt
+MajorVersion
+majversion
+makecontext
+MAKECONTEXT
+makeHDF
+MakeSureDirectoryPathExists
+malloc
+Malloc
+MALLOC
+mallocated
+mallocator
+MALLOCATOR
+mallocators
+Mallocators
+malloced
+mallocex
+Mallocing
+mallocs
+Manber
+maner
+mapbytes
+MapDebugInformation
+MappedAddress
+mapsize
+mapto
+MarkProbability
+Martinec
+MASKOBJS
+masterargv
+masternames
+masterslave
+mathieu
+MatMatModM
+matmult
+MatPowModM
+matrics
+matSize
+MatTwoPowModM
+mattype
+MatVecModM
+maxArcs
+maxBytes
+maxcells
+maxchainlen
+MAXCOL
+maxcontent
+MAXDEPTH
+maxdim
+maxdims
+maxedges
+Maximiliano
+maxInDeg
+maxInDegree
+maxindex
+maxkey
+MAXL
+maxlen
+MAXLEN
+maxlevel
+maxloc
+MAXLOC
+maxmin
+Maxmin
+MAXMIN
+maxmsg
+MaxNameLen
+MaxNameLength
+maxneighbors
+maxNodes
+maxOutDegree
+maxP
+maxPackets
+MAXPES
+maxpid
+maxprocs
+maxrate
+maxrss
+maxsize
+maxTh
+maxtime
+MAXTREEFANOUT
+maxval
+maxWidth
+maya
+mbase
+mbname
+mbox
+Mbps
+MBps
+MBytes
+mc
+MC
+mca
+MCA
+mcalloc
+mcomm
+mcontext
+mcs
+MCSC
+mctx
+MCTX
+md
+mdesc
+mdescs
+mdict
+MDMP
+mdp
+MDP
+mdptemp
+mdptr
+meassage
+mecanism
+mecanisms
+megaflops
+mem
+memchr
+memcmp
+memcpy
+memleaks
+memmove
+MemoryBase
+MemoryCallback
+MemoryInfoListStream
+MemoryListStream
+MemoryRanges
+MemorySize
+memreg
+memset
+Memset
+memuse
+ment
+mergesort
+MERGESORT
+merr
+messageSize
+messageSizes
+mesure
+metacommand
+metadata
+metamethod
+Metamethods
+METASIMGRID
+metatable
+metaxml
+methodID
+methos
+Mf
+Mflop
+Mflops
+MFlops
+mfree
+mg
+mgmt
+mgr
+mheap
+MiB
+MiBps
+microsecondes
+microsoft
+Microsystems
+millitm
+min
+minflt
+MINGW
+MiniDUMP
+MINIDUMP
+MiniDumpFilterMemory
+MiniDumpFilterModulePaths
+MiniDumpNormal
+MiniDumpReadDumpStream
+MiniDumpScanMemory
+MiniDumpWithCodeSegs
+MiniDumpWithDataSegs
+MiniDumpWithFullMemory
+MiniDumpWithFullMemoryInfo
+MiniDumpWithHandleData
+MiniDumpWithIndirectlyReferencedMemory
+MiniDumpWithoutOptionalData
+MiniDumpWithPrivateReadWriteMemory
+MiniDumpWithProcessThreadData
+MiniDumpWithThreadInfo
+MiniDumpWithUnloadedModules
+MiniDumpWriteDump
+minimun
+minloc
+MINLOC
+MinorVersion
+mins
+minsize
+minTh
+MIPS
+MIPSpro
+misc
+MISC
+MiscInfoStream
+MiscRecord
+MissingKeyval
+mixins
+mk
+mkfile
+mmalloc
+MMALLOC
+mmalloced
+mman
+mmap
+MMAP
+mmap'd
+mmap'ed
+mmcheckf
+mmem
+Mmh
+Mmmh
+mmorecore
+mmprivate
+MMPRIVATE
+mmrpc
+mmstats
+mnt
+ModBase
+moddata
+modelcheck
+modelchecker
+MODELCHECKER
+modinter
+MODINTER
+MODLOAD
+ModuleCallback
+ModuleListStream
+ModuleName
+ModuleNameRva
+ModuleReferencedByMemory
+MODULEW
+ModuleWriteCodeSegs
+ModuleWriteCvRecord
+ModuleWriteDataSeg
+ModuleWriteFlags
+ModuleWriteMiscRecord
+ModuleWriteModule
+ModuleWriteTlsData
+Moffett
+mon
+morecore
+mov
+moveto
+movl
+movq
+MP
+MPE
+mpi
+MPI
+MPIC
+mpicc
+mpich
+MPICH
+MPICH's
+MPID
+MPIDU
+mpiexec
+mpif
+MPIH
+MPIO
+MPIR
+mpirun
+MPIs
+mpistuff
+mpitest
+MPITEST
+mpitestconf
+MPITESTCONF
+MPIU
+MPMD
+MPRAS
+mprobe
+MPROBE
+mq
+mquinson
+mrealloc
+mrecv
+Mrecv
+MRG
+mrtype
+MSC
+msdn
+MSDN
+msg
+Msg
+msgload
+MSGS
+msgsize
+msgSize
+msgsizes
+msmark
+mspx
+mstats
+mstorage
+mstype
+MSVC
+mt
+mtemp
+MTest
+MTEST
+MTestCheckRecv
+MTestDatatype
+MTestDescrip
+MTestError
+MTestFreeComm
+MTestFreeDatatype
+MTestFreeWin
+MTestGetComm
+MTestGetDatatypeIndex
+MTestGetDatatypeName
+MTestGetDatatypes
+MTestGetIntercomm
+MTestGetIntercommName
+MTestGetIntracomm
+MTestGetIntracommGeneral
+MTestGetIntracommName
+MTestGetWin
+MTestGetWinName
+MTestPrintError
+MTestPrintErrorMsg
+MTestPrintfMsg
+MTestResetDatatypes
+MTestResourceSummary
+MTestReturnValue
+MTestRMACleanup
+MTestSleep
+MTestTypeContigCheckbuf
+MTestTypeContigFree
+MTestTypeContigInit
+MTestTypeContigInitRecv
+MTestTypeIndexedCheckbuf
+MTestTypeIndexedFree
+MTestTypeIndexedInit
+MTestTypeIndexedInitRecv
+MTestTypeVectorFree
+MTestTypeVectorInit
+MTestTypeXXXCheckbuf
+MTestTypeXXXFree
+MTestTypeXXXInit
+MTestTypeXXXInitRecv
+mtype
+mul
+mult
+MULTICPUS
+multidict
+Multipoint
+Multiport
+MultModM
+munmap
+mupad
+mustBePassive
+mutex
+Mutex
+MUTEX
+mutexes
+mutex's
+MX
+mxm
+mxn
+MxN
+MXN
+myargc
+myargv
+MYBUFSIZE
+MyCat
+mycmp
+mycol
+mycount
+mydict
+myhost
+MyHost
+myid
+myindexed
+myjob
+mylogfile
+mymailbox
+myname
+myop
+myordering
+myorg
+MyPointToPointHelper
+myqueue
+myrank
+myreduce
+Myrinet
+myrow
+myset
+MySocket
+mystruct
+mysum
+mytask
+mytest
+mytrace
+mytype
+mytypename
+mytypenamelen
+mytypes
+myvector
+na
+nadds
+Nah
+nameCompareHosts
+namedspace
+namelen
+NameLen
+nameout
+nameR
+nan
+NaN
+nancy
+nanosleep
+NANOSLEEP
+nar
+nas
+NAS
+nasa
+nativaly
+NativeException
+nativeInit
+naud
+navarro
+NAVBAR
+nb
+nbAlice
+nbBob
+nbprocess
+nbr
+nbytes
+nc
+ncall
+ncells
+ncol
+NCOMM
+NCPU
+NDEBUG
+ndid
+ndim
+ndims
+ndir
+ndoff
+nds
+nedges
+neg
+negdisp
+negextent
+negstride
+negstrided
+neighborexchange
+neighborood
+NEIGHBOURS
+NELEM
+nelm
+NELM
+nelms
+NELT
+nEP
+nEtat
+NetBSD
+netcste
+NetDevice
+NetDeviceContainer
+nevermind
+Nevermind
+newact
+newArc
+newArr
+newbuf
+newcmd
+newcnt
+newcomm
+newdata
+newdatatype
+newDGraph
+newdst
+newenv
+neweq
+newEvent
+NewEvent
+newfile
+NewGlobalRef
+newgroup
+newid
+newinfo
+newitem
+NewLocalRef
+newmd
+newmetatable
+newNode
+newNumber
+NewObject
+NewObjectArray
+newoption
+NewProp
+newrank
+newreno
+NewReno
+newroot
+newset
+newsize
+newstate
+NewStringUTF
+newtable
+newtype
+newType
+newused
+newuserdata
+newval
+newValue
+NextCallback
+nextlevel
+nextSeed
+nextSibling
+nextsize
+nf
+nfg
+nflow
+nfree
+ngroup
+ni
+NIC
+nightlies
+nints
+nitems
+nivcsw
+njac
+nk
+nkeys
+NKEYS
+nlines
+nlink
+nListe
+NLOG
+nLong
+nLoop
+nmat
+nmemb
+nmsg
+NMSGS
+nn
+nname
+nneighbors
+nnode
+nnodes
+nnul
+nocheck
+NOCOPY
+NodeContainer
+nodeid
+nodeShow
+noexist
+NOK
+NOLIMIT
+nolocks
+noncomm
+noncommutative
+NONCOMMUTE
+noncummutative
+nonintegral
+nonoverlapping
+nonzer
+noop
+nop
+NOPRECEDE
+NoProp
+noramlized
+NORETURN
+NOsep
+notbound
+notinterested
+NOTINTERESTED
+NOTSET
+NotSuchFieldException
+NotSuchMethodException
+notverified
+nov
+novalidate
+noverify
+np
+NPB
+npbparams
+npbsize
+npbversion
+npes
+npm
+nProc
+NPROCESSORS
+nprocs
+NPROCS
+nprocsp
+nq
+nr
+nrank
+nranks
+nread
+nreqs
+nres
+nrow
+ns
+NS
+nsec
+NSGetEnviron
+nsize
+nsleeps
+nstime
+nt
+NT
+NTASKS
+ntdivnp
+nthkey
+nthreads
+ntimer
+ntotal
+NTS
+NTSB
+NTSL
+NTSLR
+ntype
+ntypes
+NTYPES
+nul
+NUL
+nulldata
+NullPointerException
+NUL's
+num
+NUM
+numArcs
+NumberOfDups
+NumberOfMemoryRanges
+NumberOfModules
+NumberOfProcessors
+NumberOfSections
+NumberOfStreams
+NumberOfThreads
+NumberParameters
+numchain
+numChildren
+numcores
+NumIds
+numLayerNodes
+numNodes
+numOfLayers
+numPrevLayerNodes
+numprocs
+numreqs
+NumReqs
+NumReqsValid
+numSources
+NumSyms
+NumSymTypes
+NUMTHREADS
+nUsage
+nuser
+nv
+nval
+nvcsw
+nw
+nworkstations
+nx
+Nx
+nxg
+nxt
+ny
+nyg
+nz
+nzg
+oaumage
+obj
+Obj
+OBJDIR
+objdump
+ObjectFactory
+objet
+objlen
+occured
+occurence
+occurences
+occures
+oct
+oerrno
+offsetof
+oin
+ois
+ok
+Ok
+ol
+oldact
+oldbuf
+oldcomm
+oldgroup
+OLDGUIDPTR
+oldinfo
+oldlimit
+oldrank
+oldranks
+oldsize
+oldtype
+oldtypes
+OMAP
+ommunication
+ompi
+Ompi
+onceandforall
+onehop
+onelink
+ONELINK
+onelinks
+oneslice
+onetimer
+onexit
+ONLN
+onstack
+OO
+OOP
+op
+Op
+OP
+OpenBSD
+opengroup
+openlib
+openlibs
+openmpi
+Openmpi
+openmpi's
+ops
+optarg
+optim
+optimisation
+optimizable
+optimizition
+optind
+optionlist
+optionnal
+optype
+org
+organisation
+orig
+os
+osf
+ossp
+OSSP
+OSX
+ot
+OtherCpuInfo
+otherqueue
+ouais
+oublock
+oucp
+oustanding
+outArc
+outbuf
+outcnt
+outcount
+outDegree
+outedge
+outedges
+outgroup
+outputfiles
+OutputStreamWrapper
+outter
+outtype
+outVal
+overflooding
+overriden
+oversubscribing
+Ozen
+packArray
+packbuf
+packsize
+PackUnpack
+paction
+padc
+pagebase
+pagemask
+pagesize
+pairtype
+pairtypes
+paje
+Paje
+PAJE
+pajeAddVariable
+PajeAddVariable
+pajeCreateContainer
+PajeCreateContainer
+pajeDefineContainerType
+PajeDefineContainerType
+pajeDefineEntityValue
+PajeDefineEntityValue
+pajeDefineEventType
+PajeDefineEventType
+pajeDefineLinkType
+PajeDefineLinkType
+pajeDefineStateType
+PajeDefineStateType
+pajeDefineVariableType
+PajeDefineVariableType
+pajeDestroyContainer
+PajeDestroyContainer
+pajeEndLink
+PajeEndLink
+pajeNewEvent
+PajeNewEvent
+pajeng
+PajeNG
+pajePopState
+PajePopState
+pajePushState
+PajePushState
+pajeResetState
+PajeResetState
+pajeSetState
+PajeSetState
+pajeSetVariable
+PajeSetVariable
+pajeStartLink
+PajeStartLink
+pajeSubVariable
+PajeSubVariable
+Panagiotis
+pangram
+paralle
+parallelCreate
+param
+PARAM
+paramater
+parametre
+params
+Params
+paramsâ
+PARAMTYPE
+ParComp
+parenrt
+ParentCat
+PARENTWIN
+pareto
+pariticipate
+parmap
+PARMAP
+parserPromela
+partask
+particulary
+pasbuf
+Patarasuk
+PATARASUK
+patchlevel
+PATCHLEVEL
+PATERN
+PATHCC
+PathScale
+PATHSCALE
+pb
+pc
+pcall
+pcap
+PcapHelperForDevice
+PcapUserHelperForDevice
+pcdata
+PCHAR
+pclose
+pcontext
+pcontrol
+Pcontrol
+pcount
+PCSTR
+PCWSTR
+pd
+PdbAge
+PdbSig
+PdbUnmatched
+PDF
+pdgemm
+pdrop
+PDWORD
+PEBKAC
+peername
+peerport
+pegasus
+PENUMDIRTREE
+PENUMLOADED
+perf
+perl
+perror
+petaflops
+PEXCEPTION
+pf
+Pf
+PF
+PFIND
+PFINDFILEINPATHCALLBACK
+PFINDFILEINPATHCALLBACKW
+pfn
+PFPO
+pfThreshold
+PFUNCTION
+pg
+PGET
+PGI
+PGIC
+phadjido
+phane
+phys
+pid
+PID
+PIDs
+PIMAGE
+PIMAGEHLP
+pingpong
+pipelength
+pipermail
+PIs
+PJ
+PKDHELP
+pkg
+pl
+Plaftorm
+platf
+PLATF
+platformFile
+PlatformId
+platfrom
+plib
+plist
+PLOADED
+pLog
+Plog
+PLONG
+PLS
+plt
+pm
+PMINIDUMP
+pml
+PML
+pmm
+PMODLOAD
+pmpi
+PMPI
+pof
+pogram
+POINTERINT
+pointn
+PointToPointChannel
+PointToPointNetDevice
+policyfor
+polimorfism
+pong
+pongs
+popbuffer
+poped
+popen
+POPEN
+popl
+poppack
+popq
+popState
+PopState
+pos
+posix
+Posix
+posr
+postexit
+postfini
+postition
+postparse
+postset
+posw
+pote
+Pouech
+pourcentage
+pown
+pp
+ppc
+ppf
+ppid
+PPID
+pprev
+ppvoid
+pqueue
+pr
+pragma
+PRAGMA
+pragram
+prcv
+pre
+Pre
+PREAD
+precv
+pred
+PRED
+predCS
+predecesor
+predicat
+predR
+prefered
+preinit
+preparse
+preposted
+preq
+prerm
+presolve
+prev
+prevblock
+prevcount
+prevsize
+pri
+printErrors
+printf
+PRINTF
+printRedOpt
+printStats
+PrintTable
+printTasks
+prio
+prioritarily
+PriorityClass
+PRIu
+priv
+PRN
+PRNG
+prob
+PROB
+proba
+probDrop
+probMark
+proc
+Proc
+PROC
+proccess
+procdata
+ProcessCreateTime
+ProcessHandle
+processid
+ProcessId
+ProcessKernelTime
+ProcessKilledError
+ProcessNodes
+ProcessNotFoundException
+ProcessorArchitecture
+ProcessorFeatures
+ProcessorLevel
+ProcessorRevision
+processt
+ProcessUserTime
+procgrid
+procmig
+procname
+procs
+PROCS
+proc's
+procstate
+PROCTREE
+ProductType
+prog
+Programatically
+promela
+proportionnal
+prot
+PROT
+protmoting
+PROTO
+protos
+ps
+pseed
+psend
+pseudorandom
+pshpack
+psize
+psizes
+psnd
+PSOURCEFILE
+PSOURCEFILEW
+PSRCCODEINFO
+PSRCCODEINFOW
+pstat
+pstate
+Pstate
+pstates
+PSTATES
+PSTR
+pSym
+PSYM
+PSYMBOL
+PSYMBOLSERVERCALLBACKPROC
+PSYMBOLSERVERCLOSEPROC
+PSYMBOLSERVERGETOPTIONSPROC
+PSYMBOLSERVEROPENPROC
+PSYMBOLSERVERPINGPROC
+PSYMBOLSERVERPINGPROCA
+PSYMBOLSERVERPINGPROCW
+PSYMBOLSERVERPROC
+PSYMBOLSERVERPROCA
+PSYMBOLSERVERPROCW
+PSYMBOLSERVERSETOPTIONSPROC
+pt
+ptask
+ptg
+PTG
+pth
+PTH
+pthread
+pthreads
+ptime
+ptmp
+PtoP
+PtoPComm
+ptp
+ptr
+Ptr
+PTR
+PTRANSLATE
+ptrdiff
+ptrs
+ptype
+PUCHAR
+PULONG
+PUs
+pushboolean
+pushbuffer
+pushcclosure
+pushcfunction
+pushfstring
+pushinteger
+pushl
+pushlightuserdata
+pushline
+pushliteral
+pushnil
+pushnumber
+pushq
+pushState
+PushState
+pushstring
+pushthread
+pushvalue
+Puta
+putc
+pvelho
+PVM
+pvoid
+PVOID
+pw
+PWCHAR
+PWSTR
+px
+py
+pyjamas
+qavg
+qMax
+qmin
+QNX
+QNXNTO
+qq
+qreq
+qs
+qsort
+QUERYCANCEL
+queueFactory
+quinson
+ra
+rab
+Rabenseifner's
+Radclif
+Ralf
+rall
+rand
+randdp
+randfile
+randInt
+RandInt
+randlc
+RANDLC
+randNum
+RandomFeatures
+randU
+RandU
+randval
+rankdir
+rankmap
+ranksep
+ranksin
+ranksout
+RAS
+rastro
+ratetimeparse
+rawctx
+RAWCTX
+rawequal
+rawget
+rawgeti
+rawset
+rax
+rb
+rbp
+rbuf
+rbuff
+rbx
+rc
+rchild
+rchksum
+rcond
+rcount
+rcounts
+rctx
+RCV
+rcvbuf
+rcvd
+rcvinc
+rcx
+rdb
+rdcount
+rdi
+rdir
+rdisp
+rdispls
+rdisps
+RDONLY
+rdtype
+rdv
+RDV
+RDWR
+rdx
+readed
+readv
+READV
+realloc
+realloced
+reallocing
+realmain
+realsegsize
+REALTIME
+reasking
+rec
+REC
+receieved
+receiveBounded
+receve
+recieve
+recieved
+Recieved
+recursiveDestroyContainer
+recursiveDestroyType
+recursivedoubling
+recursiveGraphExtraction
+recursivehalving
+recursiveNewUserStateType
+recursiveNewUserVariableType
+recursiveNewValueForUserStateType
+recursiveNewVariableType
+recursiveXBTGraphExtraction
+recv
+Recv
+RECV
+recvbuf
+recvcnts
+recvcontext
+recvcount
+recvcounts
+recvd
+recvdispl
+recvdispls
+recvdisps
+recv'ed
+recvext
+recvfrom
+recvlen
+recvMsg
+recvptr
+recvs
+recvstatus
+recvtag
+recvtype
+recvtypes
+redbcast
+redist
+Redistibution
+RedQueue
+REDQueue
+RedRandom
+reducescatter
+ReduceStreams
+reenable
+reenables
+refcount
+refcounter
+referene
+refernce
+reg
+Reg
+regex
+registred
+REGISTRYINDEX
+REGREL
+REGRELATIVE
+reinit
+reinited
+reinitialise
+reinitialization
+Reinits
+rel
+ReleaseDoubleArrayElements
+ReleaseSemaphore
+ReleaseStringUTFChars
+relink
+relm
+relock
+relrank
+relstderr
+rem
+remaint
+remalloc
+remaning
+remeber
+remoteChannelFactory
+removeChildContainer
+remsize
+rendez
+Rendez
+renitialize
+reorded
+Reparse
+representating
+req
+ReqKinds
+ReqOffsets
+reqq
+reqs
+ReqSizes
+ReqStride
+ReqsValid
+requets
+requiers
+resa
+Resample
+ReservedCharacteristics
+ReservedCheckSum
+ReservedCodeViewSymbols
+ReservedDebugDirectory
+ReservedDebugFilePath
+ReservedExportedNames
+ReservedExportedNamesSize
+ReservedFpoTableEntries
+ReservedFunctionTableEntries
+ReservedHighestFunctionEndingAddress
+ReservedLowestFunctionStartingAddress
+ReservedMachine
+ReservedMappedBase
+ReservedNumberOfDebugDirectories
+ReservedNumberOfFpoTableEntries
+ReservedNumberOfFunctionTableEntries
+ReservedNumberOfSections
+ReservedOriginalFunctionTableBaseAddress
+ReservedRomImage
+ReservedSections
+ReservedSize
+ReservedSizeOfCodeViewSymbols
+ReservedStream
+ReservedTimeDateStamp
+ResetEvent
+resetNextSubstream
+ResetNextSubstream
+resetStart
+ResetStartStream
+resetStartSubstream
+ResetStartSubstream
+resetState
+ResetState
+resfeat
+resid
+resizedtype
+resp
+responsability
+resultlen
+resultLen
+ret
+retask
+retcode
+rethrow
+RETHROW
+RETHROWF
+rethrown
+retl
+retq
+Retrive
+retrived
+Retrun
+ReturnOffset
+returnWithVal
+retv
+retval
+retvalue
+rexcl
+rext
+rextent
+RGB
+rhon
+rhoq
+rhos
+rhs
+rhv
+ric
+ridicullously
+rightsize
+rin
+rincl
+riscos
+rlb
+rleader
+rlen
+rm
+RM
+RMA
+Rmask
+RMGR
+rms
+rmsg
+rmsm
+rmutex
+rname
+rnd
+rndnum
+rndval
+rng
+RngSream
+rngstream
+RngStream
+RNGSTREAM
+rnm
+robl
+ROMIO
+rootContainer
+rootprocs
+rootType
+routearg
+routerNode
+RoutingManual
+rowwise
+rp
+rpc
+rpos
+rr
+RR
+rrank
+rreq
+rrequest
+rsag
+rse
+rsend
+Rsend
+rset
+rsi
+rsize
+rsp
+Rsp
+rsz
+rt
+rtfs
+rtime
+RTLD
+rtrim
+rtrue
+RTT
+rtype
+ru
+rulebased
+runall
+runfile
+rusage
+RUSAGE
+rv
+RVA
+rvp
+rvpoint
+rw
+rx
+ry
+sa
+sA
+SA
+sascha
+SavedReq
+saveKeyval
+sb
+sB
+sbrk
+sbuf
+sbuff
+sC
+Scalasca
+scancel
+SCANF
+scatterv
+Scatterv
+SCATTERV
+scdispls
+Scecific
+scellLog
+scellMax
+schar
+scharacter
+sched
+SCHED
+schedulable
+SCHEDULABLE
+scheduleDAX
+schedulel
+schedulev
+schemaLocation
+schild
+schnorr
+Schnorr
+scinbuf
+scm
+scname
+SCO
+scomm
+sconstant
+sCopied
+sCopying
+scount
+scounts
+scoutbuf
+sd
+SD
+sData
+sdcc
+SDCC
+sdisp
+sdispls
+sdisps
+SDK
+SDL
+sdouble
+sdsc
+sdterr
+sdtype
+seander
+searchsub
+SearchTreeForFile
+SearchTreeForFileW
+sec
+sedding
+seedf
+seedx
+seedz
+seg
+segcount
+SEGCOUNT
+segfault
+segfaults
+segindex
+segmenets
+segsize
+SEGSIZE
+SEGV
+seing
+sel
+SelectedSymbol
+selfgroup
+selfid
+sem
+SEM
+semanticaly
+sempahore
+sendBounded
+sendbuf
+sendcnts
+sendcount
+sendcounts
+senddispl
+senddispls
+senddisps
+sended
+sendext
+sendMsg
+sendpid
+sendptr
+Sendreceive
+sendrecv
+Sendrecv
+SendRecv
+SENDRECV
+sendrecvs
+SendResults
+sendsize
+sendtag
+sendtmpbuf
+sendtmpcount
+sendtmptype
+sendto
+sendtype
+sendtypes
+sentBytes
+Sentinal
+sep
+SEP
+seperates
+seq
+SEQ
+seqs
+seqtask
+serie
+SERVICABLE
+ses
+setA
+setaffinity
+setAntithetic
+SetAntithetic
+setAsyncMailbox
+setAutoRestart
+setB
+SetBooleanField
+setbuf
+SetChannelAttribute
+setComputationAmount
+setComputeDuration
+setcontext
+SETCONTEXT
+setCpuUsed
+SetData
+setDataSize
+setdefault
+SetDeviceAttribute
+SetDoubleField
+setenv
+SetEvent
+setfenv
+setfield
+setget
+SetIntField
+setItemcontent
+setjmp
+setjump
+setKillTime
+setlocale
+SetLongField
+setMemoryUsed
+setmetatable
+SetMode
+setName
+SetObjectArrayElement
+SetObjectField
+setPackageSeed
+SetPackageSeed
+setparams
+SetParams
+setPriority
+setProperty
+SetQueue
+setSeed
+SetSeed
+setset
+SETSET
+setspecific
+setstacksize
+setState
+SetState
+SetThreadContext
+settop
+setVariable
+SetVariable
+setvbuf
+sevAttn
+sevFatal
+sevInfo
+sevMax
+sevProblem
+sext
+sextent
+sfield
+sFinished
+sFirst
+sg
+SGI
+sglua
+SGU
+sha
+SHA
+SHARC
+SHell
+shiftA
+shiftB
+shiftC
+shiftD
+shiftE
+shiftedrank
+shiftS
+shiftW
+shl
+shm
+shmurtz
+shortint
+shoud
+shouldnt
+shriked
+SHRT
+SHx
+si
+sibuf
+sid
+sig
+SIG
+SIGABRT
+sigaction
+SIGALRM
+sigaltstack
+SIGBUS
+SIGCHLD
+SIGCONT
+sigemptyset
+SIGFPE
+sighandler
+SIGHUP
+SIGILL
+SIGINT
+SIGIO
+sigjmp
+SIGKILL
+siglongjmp
+sigmask
+signficant
+signum
+SIGPIPE
+SIGPROF
+SIGQUIT
+SIGSEGV
+sigset
+sigsetjmp
+sigstack
+SIGSTOP
+SIGSYS
+SIGTERM
+SIGTRAP
+SIGTSTP
+SIGTTIN
+SIGTTOU
+SIGURG
+SIGUSR
+SIGVTALRM
+sigwaiter
+SIGWINCH
+SIGXCPU
+SIGXFSZ
+sim
+SIM
+Simcal
+simcall
+SIMCALL
+simcalls
+Simcalls
+SIMCALLS
+simdag
+Simdag
+SimDag
+simdata
+simgrid
+Simgrid
+simgrid's
+Simgrid's
+SimGrid's
+simix
+Simix
+simplfy
+simplifyied
+simulacrum
+sinbuf
+sinix
+sint
+sinteger
+sizeof
+SIZEOF
+SizeOfCoffSymbols
+SizeOfContext
+SizeOfCvRecord
+SizeOfImage
+SizeOfInfo
+sizeofint
+SIZEOFKEY
+SizeOfMiscRecord
+SizeOfStruct
+sizeoftype
+SJLJ
+skaddr
+skbuf
+sKeeping
+skiped
+sksize
+skyblue
+slavename
+slavenames
+slb
+sleeptime
+slen
+slimit
+SLMFLAG
+slogical
+sM
+sMaestro
+SMALLAMOUNT
+sMetatable
+smethod
+smp
+SMP
+smpi
+smpicc
+smpif
+SMPIF
+smpiff
+SMPI's
+SMPs
+smsg
+smurf
+SMURF
+smx
+SMX
+smxhost
+smxprocess
+sn
+snapshooting
+snd
+SND
+sndbuf
+sndinc
+sNo
+sNothing
+snprintf
+SNPRINTF
+soe
+sofar
+solaris's
+somes
+somewhereelse
+sophia
+sould
+sourcearchive
+sourceContainer
+SourceContainer
+SourceContainerType
+SOURCEFILE
+SOURCEFILEW
+sourceforge
+SourceIndexed
+soutbuf
+sp
+SP
+sparameter
+sparc
+Sparc
+sparent
+sparsetype
+splitcomm
+splited
+Spliting
+splitted
+SplittedBinary
+SPMD
+sponding
+sprintf
+sr
+srand
+srandom
+Srandom
+srank
+src
+SRC
+srcArray
+SRCCODEINFO
+SRCCODEINFOW
+srcdst
+srcs
+SRCSPEW
+sreq
+srequest
+SRL
+ss
+sscanf
+ssend
+Ssend
+SSEND
+ssh
+ssig
+ssize
+SSJLJ
+ssr
+SSR
+SSRVACTION
+SSRVOPT
+sta
+sTable
+StackBase
+StackEnd
+STACKFRAME
+STACKGROWTH
+StackOffset
+stackoverflow
+stacksize
+StackWalk
+STag
+staic
+stanford
+STARMPI
+startall
+Startall
+STARTALL
+StartContainer
+StartContainerType
+StartIdlePeriod
+startLink
+StartLink
+StartOfMemoryRange
+startTime
+stat
+STAT
+stateActionA
+stateActionB
+stateActionC
+stateful
+statename
+statenames
+StateType
+StatusEmpty
+std
+Std
+STD
+stdarg
+STDARG
+stdbool
+STDC
+stdcall
+STDCALL
+stddef
+STDDEF
+stdDeviation
+stderr
+stdev
+stdin
+STDINIT
+stdint
+STDINT
+stdlib
+STDLIB
+stdout
+stime
+storageId
+storagelevel
+storagetype
+str
+STR
+strbuff
+STRBUFF
+strcasecmp
+strcat
+strchr
+strcmp
+strcpy
+strcspn
+strdup
+strdup'ed
+StreamDirectoryRva
+StreamType
+strerror
+strftime
+strided
+strideType
+STRIN
+stringify
+STRINGIFY
+strlen
+STRLEN
+strncmp
+strncpy
+strrchr
+strs
+strspn
+strstr
+strtod
+strtok
+strtol
+strtoul
+struct
+STRUCT
+structs
+structype
+strue
+studently
+stype
+subarray
+SUBARRAY
+subas
+subcat
+subcategories
+subcategory
+SUBCATEGORY
+subcmd
+subcommunicator
+subl
+submatrix
+SUBMINOR
+subpipe
+subq
+subrow
+subseq
+subsize
+subsizes
+subst
+substract
+Substract
+substruct
+subsubtype
+subtee
+subtypep
+subVariable
+SubVariable
+succ
+Succ
+succeded
+succefully
+sucess
+SuiteMask
+suitename
+sumcomm
+suming
+Summa
+sumval
+SunOS
+SUNPRO
+supassing
+sur
+surfxml
+SURFXML
+suseconds
+SuspendCount
+SUSv
+Suter
+SV
+sval
+svalue
+svn
+swapcontext
+sx
+sy
+sym
+SYM
+SymAddSymbol
+SymAddSymbolW
+symb
+SYMBOLW
+SymCleanup
+SymCoff
+SymCv
+SymDeferred
+SymDeleteSymbol
+SymDeleteSymbolW
+SymDia
+SymEnumerateModules
+SymEnumerateModulesW
+SymEnumerateSymbols
+SymEnumerateSymbolsW
+SymEnumLines
+SymEnumLinesW
+SymEnumSourceFiles
+SymEnumSourceFilesW
+SymEnumSourceLines
+SymEnumSourceLinesW
+SymEnumSymbols
+SymEnumSymbolsForAddr
+SymEnumSymbolsForAddrW
+SymEnumSymbolsW
+SymEnumTypes
+SymEnumTypesW
+SymExport
+SYMF
+SymFindDebugInfoFile
+SymFindDebugInfoFileW
+SymFindExecutableImage
+SymFindExecutableImageW
+SymFindFileInPath
+SymFindFileInPathW
+SYMFLAG
+SymFromAddr
+SymFromAddrW
+SymFromIndex
+SymFromIndexW
+SymFromName
+SymFromNameW
+SymFromToken
+SymFromTokenW
+SymFunctionTableAccess
+SymGetFileLineOffsets
+SymGetHomeDirectory
+SymGetHomeDirectoryW
+SymGetLineFromAddr
+SymGetLineFromAddrW
+SymGetLineFromName
+SymGetLineFromNameW
+SymGetLineNext
+SymGetLineNextW
+SymGetLinePrev
+SymGetLinePrevW
+SymGetModuleBase
+SymGetModuleInfo
+SymGetModuleInfoW
+SymGetOptions
+SymGetScope
+SymGetScopeW
+SymGetSearchPath
+SymGetSearchPathW
+SymGetSourceFile
+SymGetSourceFileFromToken
+SymGetSourceFileFromTokenW
+SymGetSourceFileToken
+SymGetSourceFileTokenW
+SymGetSourceFileW
+SymGetSourceVarFromToken
+SymGetSourceVarFromTokenW
+SymGetSymFromAddr
+SymGetSymFromName
+SymGetSymNext
+SymGetSymNextW
+SymGetSymPrev
+SymGetSymPrevW
+SymGetTypeFromName
+SymGetTypeFromNameW
+SymGetTypeInfo
+SymGetTypeInfoEx
+SYMINDEX
+SymInitialize
+SymInitializeW
+SymLoadModule
+SymLoadModuleEx
+SymLoadModuleExW
+SymMatchFileName
+SymMatchFileNameW
+SymMatchString
+SymMatchStringA
+SymMatchStringW
+symmertical
+SYMNAME
+SymNone
+SYMOPT
+SYMPATH
+SymPdb
+SymRegisterCallback
+SymRegisterCallbackW
+SymRegisterFunctionEntryCallback
+syms
+SYMS
+SYMSEARCH
+SymSearchW
+SymSetContext
+SymSetHomeDirectory
+SymSetHomeDirectoryW
+SymSetOptions
+SymSetParentWindow
+SymSetSearchPath
+SymSetSearchPathW
+SymSym
+SYMTAG
+SymType
+SymUnDName
+SymUnloadModule
+SymVirtual
+synchro
+Synchro
+SYNCHRO
+synchronisation
+Synchro's
+syntaxically
+syscall
+syscalls
+sysconf
+SYSCONF
+sysctl
+SYSCTL
+sysdep
+SYSDEP
+sysinfo
+syssgi
+SystemInfoStream
+SystemRangeStart
+sysv
+sz
+tableptr
+tagADDRESS
+TagFilter
+TAGL
+TagsFound
+tahoe
+taille
+tand
+TARNAME
+taskA
+taskB
+taskBind
+taskC
+TaskCancelledException
+taskD
+taskE
+taskFin
+taskFinal
+taskInit
+taskmax
+taskmin
+taskname
+tata
+tatu
+tavailability
+tAVG
+tbi
+TBOOLEAN
+TBps
+tBread
+tbw
+TCHAR
+tClose
+tConstraint
+tcontent
+tContent
+tcp
+TcpModel
+TcpProtocol
+tcpsend
+tcpserver
+TCPServer
+TCPTR
+tdispls
+TDOUBLE
+tdown
+Teb
+techreport
+tempbuf
+tempcol
+tempCol
+Tennesse
+teraflops
+Terascale
+terminaison
+terminason
+TerminateThread
+tError
+tesh
+TESH
+teshsuite
+TEst
+testall
+Testall
+testany
+Testany
+TESTANY
+testgraph
+TestIntercomm
+testname
+testnum
+TESTSIZE
+testsome
+Testsome
+testsuite
+Testsuite
+TESTSUITE
+testTask
+tex
+textent
+Tf
+tflag
+tFlag
+TFLOAT
+tFull
+TFUNCTION
+tGet
+tgmr
+tha
+Thakur
+tHave
+ThCallbackBStore
+ThCallbackStack
+thehost
+THISADJUST
+THISARCH
+thiskey
+thislen
+thislevel
+thissuite
+THISTYPE
+thisunit
+thr
+thre
+ThreadCallback
+ThreadContext
+threadCoroutine
+ThreadEx
+ThreadExCallback
+ThreadExListStream
+ThreadHandle
+ThreadId
+ThreadInfoListStream
+threadLevel
+THREADLEVEL
+ThreadListStream
+threadtimer
+ThreadWriteBackingStore
+ThreadWriteContext
+ThreadWriteFlags
+ThreadWriteInstructionWindow
+ThreadWriteStack
+ThreadWriteThread
+ThreadWriteThreadData
+ThreadWriteThreadInfo
+THREED
+threeslice
+thres
+thresho
+threshol
+thresholdN
+thresholdPriority
+throught
+throwable
+THROWF
+ThrowNew
+tialisation
+TiB
+TiBps
+tid
+TigerSHARC
+tigger
+tiletype
+tiletypes
+timeb
+timecounter
+timedacquire
+TimeDateStamp
+timedlock
+TIMEDLOCK
+timedwait
+TIMEDWAIT
+timeing
+timeouted
+TimeoutException
+timespec
+timeval
+timout
+TINYC
+TinyCC
+tl
+tlat
+TLIGHTUSERDATA
+tLink
+TLONG
+TLS
+TlsAlloc
+TlsFree
+TlsGetValue
+TLSREL
+TlsSetValue
+tm
+tmax
+tMAX
+tmgr
+TMGR
+tmin
+tmodel
+tMount
+tmp
+TMP
+tmpA
+tmpB
+tmpbuf
+tmpbufs
+tmpComm
+tmpl
+tmpnd
+tmprecv
+tmpS
+tmpsend
+tmpType
+tname
+TNIL
+tnlen
+tnode
+tNon
+tns
+tnstr
+TNUMBER
+toadd
+toboolean
+toc
+tocfunction
+tocopy
+todo
+Todo
+ToDo
+TODO
+TOFIX
+tointeger
+tok
+Tokenize
+tolower
+tonumber
+TOOBIG
+Toole
+tooshort
+TOpaqOverview
+tOpen
+topo
+Topo
+TOPO
+topointer
+ToPointer
+topollogy
+Topoloby
+topoloty
+Topoloty
+topush
+TOS
+tostr
+tostring
+totalBytes
+TotalBytes
+totalHosts
+totalLinks
+totComparators
+toterr
+toterrs
+toto
+totoXXXtatu
+totoXXXtutu
+totoXXXtutu'XXXtata
+totsize
+tounserialize
+toupper
+touserdata
+toutes
+TPDS
+tpower
+tproperties
+tProperty
+TPTR
+trac
+TraceContainer
+tracefile
+Tracefile
+tracefilename
+tran
+tranfert
+tRank
+trans
+transblock
+transblockpad
+transfered
+TransferFailureException
+transmition
+transtyping
+transxyfin
+transxyglo
+transxyloc
+transxzfin
+transxzglo
+transxzloc
+trashbin
+trbuf
+trecvcounts
+tRemaining
+Tremblay
+Treumann
+Triming
+tripleType
+triva
+Triva
+trivaEdgeTypes
+trivaNodeTypes
+trouting
+tru
+TRUC
+trylock
+TRYLOCK
+trywait
+tsbuf
+TSC
+tSee
+tsend
+tSend
+TSHORT
+tsize
+tSize
+TSIZE
+TSPEC
+tstart
+tstate
+tStorage
+tstr
+TSTRING
+tsum
+tt
+TTABLE
+tThere
+TTHREAD
+ttype
+tu
+TUCHAR
+TUINT
+TULONG
+tUnlink
+tup
+tUpdate
+tuser
+TUSERDATA
+TUSHORT
+tututu
+tutuXXXtata
+tv
+tValue
+tVector
+TVOID
+twincell
+TWOD
+twoint
+twoslice
+tWrite
+tx
+txt
+TxTime
+ty
+typebuf
+typebufsz
+typeclass
+TYPECLASS
+typeId
+TypeId
+TYPEID
+TypeIds
+typeidx
+TypeIndex
+TypeInfo
+typelng
+TYPELNG
+typemapstring
+typename
+typep
+typerror
+typesize
+tz
+uaddr
+ub
+UB
+uc
+uchar
+UCHAR
+ucinbuf
+ucomm
+uconst
+uconstant
+ucontext
+UCONTEXT
+ucontextes
+ucontexts
+Ucontexts
+ucoutbuf
+ucp
+ucsc
+uctx
+ud
+udata
+Udi
+UDT
+UDTKIND
+ue
+uelm
+ui
+UI
+uinbuf
+uint
+UINT
+uintptr
+uj
+ul
+UL
+ulinbuf
+ull
+ULL
+ulong
+ULONG
+uloutbuf
+ultraclean
+ultrix
+UMontreal
+un
+unavail
+unbench
+UNCACHED
+uncat
+UNCAT
+uncatched
+unchocked
+unchoke
+UNCHOKE
+unchoked
+UNCHOKED
+unchoking
+UnDecorateSymbolName
+UnDecorateSymbolNameW
+undef
+undefine
+Undefine
+UNDNAME
+unfreeze
+unhandled
+unimplememted
+uninited
+uninitialization
+Uninitializes
+UNINTERSTED
+uniq
+unistd
+UNISTD
+unitname
+unix
+UnknownProcessProp
+UnloadedModuleListStream
+unlocker
+unmap
+UnmapDebugInformation
+unmapping
+Unmapping
+UNPAREN
+unpropper
+unpublish
+Unpublish
+unput
+unref
+unschedule
+Unschedules
+unserialisation
+unserialization
+unserialize
+unshift
+Unshift
+Unsortable
+untimed
+unuse
+unusedAlignment
+UnusedStream
+unw
+unwatch
+uoi
+uop
+uoutbuf
+upate
+upatras
+upto
+uptodate
+upvalue
+upvalues
+URC
+url
+usageOutput
+USCORE
+usec
+useconds
+usecs
+usefull
+Usefull
+userdata
+username
+userop
+userparam
+UserStreamArray
+UserStreamCount
+userTime
+usgin
+USHORT
+usinbuf
+usize
+usleep
+usoutbuf
+usr
+UTC
+util
+utils
+UTILS
+UTK
+utm
+Uuuh
+ux
+UX
+va
+val
+valgrind
+Valgrind
+VALGRIND
+valin
+valist
+valout
+vals
+valuelen
+valueN
+VALUEPRESENT
+valuestr
+var
+vararg
+varargs
+VARGET
+vargs
+VariableType
+variadic
+VARINIT
+vars
+Vars
+varsize
+varsubst
+vasnprintf
+VASNPRINTF
+vasprintf
+VASPRINTF
+vaxc
+vb
+vcalc
+vcheck
+vec
+VEC
+vecin
+vecout
+vecs
+vect
+VectorInit
+vectorizable
+vectorized
+vectype
+vegas
+Velho
+VELHO
+Velho's
+veloce
+VendorId
+ver
+VER
+verif
+verifcation
+VersionInfo
+VersionInformation
+verson
+veryPicky
+vextent
+vfprintf
+virt
+virtu
+VIRTU
+VIRTUALBASECLASS
+VIRTUALBASEPOINTEROFFSET
+VIRTUALTABLESHAPEID
+VisualAge
+VISUALC
+VisualDSP
+VISUALDSPVERSION
+vitual
+vivaldi
+vizualization
+vkid
+vm
+VM
+vmName
+vms
+VMs
+vmVariableDeclare
+vmVariableSet
+vname
+voidp
+VOIDP
+vous
+Vous
+vp
+vprintf
+vrank
+vranlc
+Vranlc
+VRP
+VRR
+VRRP
+vsnprintf
+VSNPRINTF
+vsprintf
+VSS
+vtype
+vval
+vvalue
+VVRR
+VVRRPP
+VVRRPPPP
+VVRRPPPPP
+VVRRTPPPP
+VVVRRRPPP
+waitall
+Waitall
+WAITALL
+waitany
+Waitany
+WAITANY
+waitCompletion
+waitFor
+WaitForMultipleObjects
+WaitForSingleObject
+waitpid
+waitsome
+Waitsome
+WaitTimeout
+walltimer
+Warshall
+wasCalled
+watchpoint
+Watcom
+WATCOMC
+waxman
+Waxman
+WCE
+wchar
+WCHAR
+wcomm
+wd
+wdir
+webloria
+webpages
+weibull
+WEXITSTATUS
+wfd
+wgroup
+wGroup
+WH
+whdc
+wheather
+whereto
+whitespaces
+Wi
+wich
+widly
+WIFEXITED
+WIFSIGNALED
+wihtout
+wikipedia
+Willenson
+WINAPI
+WinDef
+WindowFilter
+WindowSize
+winName
+WINNT
+winsock
+wint
+Wipeout
+WKS
+wLog
+Wlog
+Wo
+wocomm
+WorkflowGenerator
+workqueue
+workstationA
+WorkstationAttribute
+workstationB
+workusecs
+worldrank
+wouldBlock
+wr
+wrank
+wRank
+writeback
+WriteState
+WriteStateFull
+wrt
+ws
+WSAEINPROGRESS
+WSAETIMEDOUT
+WSAEWOULDBLOCK
+wscale
+wsize
+wSize
+wsl
+wsL
+WTERMSIG
+WTF
+WTH
+wtick
+Wtick
+WTICK
+wtime
+Wtime
+WTIME
+www
+xargc
+xargv
+xbt
+XBT
+xbtdata
+xce
+xdiv
+xdoukas
+xend
+Xin
+xkcd
+XL
+xlC
+xml
+XMLfiles
+xmlns
+XMLSchema
+xmove
+xN
+XOPEN
+xor
+XPG
+xpose
+xRy
+xsd
+XSH
+xsi
+xstart
+xsubi
+xtype
+xxcon
+xxrss
+xxx
+XXX
+xxxx
+XXXX
+XXXXX
+xyz
+XYZ
+yay
+ydiv
+yend
+Yf
+yieldTo
+yottaflops
+ystart
+yxz
+yy
+YY
+yyalloc
+yybytes
+yycon
+yyconst
+yyfree
+yyin
+yyinput
+yyl
+yyleng
+yyless
+yylex
+yylineno
+yylval
+yymore
+yyout
+yyparse
+yyrealloc
+yyrestart
+YYSTATE
+yystr
+YYSTYPE
+YYTABLES
+yyterminate
+yytext
+yyunput
+yywrap
+YYY
+YYYY
+YYYYMMDD
+zd
+zegura
+Zegura
+zend
+zeroblock
+zerocounts
+zero'd
+zero'ing
+zerotype
+zettaflops
+Zf
+zOS
+zstart
+zu
+zxy
+zyx
+zzcon
diff --git a/tools/spell/spell.sh b/tools/spell/spell.sh
new file mode 100644 (file)
index 0000000..406d634
--- /dev/null
@@ -0,0 +1 @@
+(find ./ -name '*.[ch]' | xargs perl tools/spell/lspell2.pl tools/spell/sg_stopwords.txt ; find ./ -name '*.[ch]' | xargs perl tools/spell/lspell.pl tools/spell/sg_stopwords.txt ) | grep -v ':' | sort -f | uniq 
\ No newline at end of file
index a3e2b78..3ed1758 100644 (file)
@@ -1,11 +1,19 @@
 cmake_minimum_required(VERSION 2.6)
 
 if(WIN32)
-  add_custom_target(tesh ALL
-    DEPENDS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl
-    COMMENT "Install ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl"
-    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh
-    )
+#  add_custom_target(tesh ALL
+#    DEPENDS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl
+#    COMMENT "Install ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl"
+#    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh
+#    )
+    configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/tesh.pl"
+  "${CMAKE_BINARY_DIR}/bin/tesh" @ONLY IMMEDIATE)
+
+    file(COPY        ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Scripts/Diff.pm 
+         DESTINATION ${CMAKE_BINARY_DIR}/bin
+         FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+                          GROUP_EXECUTE GROUP_READ)
+
 else()
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
 
index 7c9de93..359d2a5 100644 (file)
@@ -9,13 +9,20 @@ $ cd temp_testdir_background
 < #include <sys/types.h>
 < #include <sys/stat.h>
 < #include <fcntl.h>
+< #ifdef WIN32 
+<   #include "windows.h"
+< #endif
 <                   
 < int main() {
 <   char buff[2048];
 <   int got;
 <   int in;
 < 
+< #ifndef WIN32 
 <   sleep(1);
+< #else
+<   Sleep(1000);
+< #endif
 <   in = open("tmp_fich",O_RDONLY|O_CREAT);
 <   if (in == -1) {
 <     perror("Cannot open tmp_fich: ");
index c611336..8bfa7c7 100644 (file)
@@ -1,6 +1,6 @@
 /* run_context -- stuff in which TESH runs a command                        */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -85,7 +85,7 @@ void rctx_init(void)
   sigwaiter_mutex = xbt_os_mutex_init();
   sigwaiter_cond = xbt_os_cond_init();
   xbt_os_mutex_acquire(sigwaiter_mutex);
-  sigwaiter_thread = xbt_os_thread_create("Armaggedon request waiter",
+  sigwaiter_thread = xbt_os_thread_create("Armageddon request waiter",
                                           armageddon_sigwaiter, NULL, NULL);
   /* Wait for thread to start... */
   xbt_os_cond_wait(sigwaiter_cond, sigwaiter_mutex);
index 0d20b02..5a12029 100644 (file)
@@ -1,6 +1,6 @@
 /* run_context -- stuff in which TESH runs a command                        */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 9905ad7..adb9ee1 100644 (file)
@@ -1,6 +1,6 @@
 /* signal -- what TESH needs to know about signals                          */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index 0c8b21b..7f75229 100644 (file)
@@ -1,6 +1,6 @@
 /* TESH (Test Shell) -- mini shell specialized in running test units        */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -141,7 +141,6 @@ static void handle_suite(const char *filename, FILE * IN)
       } else {
         to_be_continued = 1;
         line[linelen - 2] = '\0';
-        linelen -= 2;
         if (!buff->used)
           buffbegin = line_num;
       }
index 4029614..e7f5627 100644 (file)
@@ -1,6 +1,6 @@
 /* TESH (Test Shell) -- mini shell specialized in running test units        */
 
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2011. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it