Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #228 from Takishipp/actor-execute
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 15 Oct 2017 14:37:30 +0000 (16:37 +0200)
committerGitHub <noreply@github.com>
Sun, 15 Oct 2017 14:37:30 +0000 (16:37 +0200)
Convert actor-execute to s4u API

444 files changed:
CMakeLists.txt
ChangeLog
NEWS
doc/doxygen/inside_extending.doc
doc/doxygen/inside_release.doc
doc/doxygen/inside_tests.doc
doc/doxygen/module-smpi.doc
doc/doxygen/uhood_switch.doc
examples/java/app/pingpong/Main.java
examples/java/cloud/masterworker/Main.java
examples/java/cloud/migration/Daemon.java
examples/java/cloud/migration/XVM.java
examples/java/dht/kademlia/Node.java
examples/java/process/kill/Main.java
examples/java/process/suspend/Main.java
examples/java/trace/pingpong/Main.java
examples/java/trace/pingpong/Receiver.java
examples/java/trace/pingpong/Sender.java
examples/msg/app-pingpong/app-pingpong.tesh
examples/msg/energy-ptask/energy-ptask.c
examples/msg/trace-link-user-variables/trace-link-user-variables.tesh
examples/msg/trace-platform/trace-platform.tesh
examples/msg/trace-process-migration/trace-process-migration.tesh
examples/msg/trace-route-user-variables/trace-route-user-variables.tesh
examples/platforms/small_platform_constant.xml [new file with mode: 0644]
examples/s4u/actions-comm/s4u-actions-comm.cpp
examples/s4u/actor-create/s4u-actor-create.cpp
examples/s4u/app-bittorrent/s4u-bittorrent.hpp
examples/s4u/app-bittorrent/s4u-peer.cpp
examples/s4u/app-masterworker/s4u-app-masterworker.cpp
examples/s4u/app-pingpong/s4u-app-pingpong.tesh
examples/s4u/app-token-ring/s4u-app-token-ring.cpp
examples/s4u/async-wait/s4u-async-wait.cpp
examples/s4u/async-waitall/s4u-async-waitall.cpp
examples/s4u/async-waitany/s4u-async-waitany.cpp
examples/s4u/dht-chord/node.cpp
examples/s4u/dht-chord/s4u-dht-chord.hpp
examples/s4u/io/s4u-io.cpp
examples/smpi/mc/bugged1_liveness.c
include/simgrid/chrono.hpp
include/simgrid/forward.h
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/kernel/future.hpp
include/simgrid/msg.h
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/simdag.h
include/simgrid/simix.h
include/xbt/backtrace.h
include/xbt/base.h
include/xbt/future.hpp
include/xbt/string.hpp
src/bindings/java/JavaContext.cpp
src/bindings/java/JavaContext.hpp
src/bindings/java/jmsg.cpp
src/bindings/java/jmsg.hpp [moved from src/bindings/java/jmsg.h with 55% similarity]
src/bindings/java/jmsg_as.cpp
src/bindings/java/jmsg_as.hpp [moved from src/bindings/java/jmsg_as.h with 89% similarity]
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_file.cpp
src/bindings/java/jmsg_host.cpp
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_rngstream.cpp
src/bindings/java/jmsg_storage.cpp
src/bindings/java/jmsg_synchro.cpp
src/bindings/java/jmsg_task.cpp
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jtrace.cpp
src/bindings/java/jxbt_utilities.cpp
src/bindings/java/jxbt_utilities.hpp [moved from src/bindings/java/jxbt_utilities.h with 53% similarity]
src/bindings/lua/lua_debug.cpp
src/bindings/lua/lua_host.cpp
src/bindings/lua/lua_platf.cpp
src/bindings/lua/lua_private.h [deleted file]
src/bindings/lua/lua_private.hpp [new file with mode: 0644]
src/bindings/lua/lua_utils.hpp [moved from src/bindings/lua/lua_utils.h with 84% similarity]
src/bindings/lua/simgrid_lua.cpp
src/bindings/lua/simgrid_lua.hpp [moved from src/bindings/lua/simgrid_lua.h with 86% similarity]
src/include/smpi/smpi_utils.hpp
src/include/surf/datatypes.h
src/include/surf/maxmin.hpp [moved from src/include/surf/maxmin.h with 89% similarity]
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_header.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.h [deleted file]
src/instr/instr_private.hpp [new file with mode: 0644]
src/instr/instr_resource_utilization.cpp
src/instr/instr_smpi.hpp [moved from src/instr/instr_smpi.h with 84% similarity]
src/kernel/activity/CommImpl.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SleepImpl.cpp
src/kernel/activity/SynchroIo.cpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.cpp
src/kernel/context/ContextRaw.cpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextUnix.cpp
src/kernel/future.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DijkstraZone.hpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetPoint.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/RoutedZone.hpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/mc/DwarfExpression.cpp
src/mc/DwarfExpression.hpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/ObjectInformation.hpp
src/mc/PageStore.cpp
src/mc/PageStore.hpp
src/mc/RegionSnapshot.cpp
src/mc/RegionSnapshot.hpp
src/mc/Session.cpp
src/mc/Session.hpp
src/mc/VisitedState.cpp
src/mc/VisitedState.hpp
src/mc/checker/Checker.hpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/LivenessChecker.hpp
src/mc/checker/SafetyChecker.cpp
src/mc/checker/SafetyChecker.hpp
src/mc/checker/simgrid_mc.cpp
src/mc/compare.cpp
src/mc/mc_base.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_client_api.cpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_comm_pattern.hpp
src/mc/mc_config.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_exit.hpp [moved from src/mc/mc_exit.h with 71% similarity]
src/mc/mc_global.cpp
src/mc/mc_hash.cpp
src/mc/mc_member.cpp
src/mc/mc_memory.cpp
src/mc/mc_mmu.hpp [moved from src/mc/mc_mmu.h with 83% similarity]
src/mc/mc_page_snapshot.cpp
src/mc/mc_private.hpp [moved from src/mc/mc_private.h with 75% similarity]
src/mc/mc_record.cpp
src/mc/mc_record.hpp [moved from src/mc/mc_record.h with 93% similarity]
src/mc/mc_request.cpp
src/mc/mc_request.hpp [moved from src/mc/mc_request.h with 87% similarity]
src/mc/mc_safety.hpp [moved from src/mc/mc_safety.h with 87% similarity]
src/mc/mc_smx.cpp
src/mc/mc_smx.hpp [moved from src/mc/mc_smx.h with 95% similarity]
src/mc/mc_snapshot.cpp
src/mc/mc_snapshot.hpp [moved from src/mc/mc_snapshot.h with 61% similarity]
src/mc/mc_state.cpp
src/mc/mc_state.hpp [moved from src/mc/mc_state.h with 79% similarity]
src/mc/mc_unw.cpp
src/mc/mc_unw.hpp [moved from src/mc/mc_unw.h with 63% similarity]
src/mc/mc_unw_vmread.cpp
src/mc/remote/Client.cpp
src/mc/remote/RemoteClient.cpp
src/mc/remote/RemoteClient.hpp
src/msg/instr_msg_process.cpp
src/msg/instr_msg_task.cpp
src/msg/msg_actions.cpp
src/msg/msg_deployment.cpp
src/msg/msg_environment.cpp
src/msg/msg_global.cpp
src/msg/msg_gos.cpp
src/msg/msg_host.cpp
src/msg/msg_io.cpp
src/msg/msg_mailbox.cpp
src/msg/msg_private.hpp [moved from src/msg/msg_private.h with 65% similarity]
src/msg/msg_process.cpp
src/msg/msg_synchro.cpp
src/msg/msg_task.cpp
src/msg/msg_vm.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/VirtualMachineImpl.hpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/s4u/s4u_engine.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_link.cpp
src/s4u/s4u_mailbox.cpp
src/s4u/s4u_mutex.cpp
src/s4u/s4u_netzone.cpp
src/s4u/s4u_storage.cpp
src/simdag/sd_task.cpp
src/simdag/simdag_private.hpp
src/simgrid/host.cpp
src/simgrid/sg_config.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/simix/libsmx.cpp
src/simix/popping.cpp
src/simix/popping_accessors.hpp [moved from src/simix/popping_accessors.h with 91% similarity]
src/simix/popping_bodies.cpp
src/simix/popping_generated.cpp
src/simix/popping_private.hpp [moved from src/simix/popping_private.h with 71% similarity]
src/simix/simcalls.py
src/simix/smx_context.cpp
src/simix/smx_deployment.cpp
src/simix/smx_environment.cpp
src/simix/smx_global.cpp
src/simix/smx_host.cpp
src/simix/smx_host_private.hpp [moved from src/simix/smx_host_private.h with 74% similarity]
src/simix/smx_io.cpp
src/simix/smx_io_private.hpp [moved from src/simix/smx_io_private.h with 86% similarity]
src/simix/smx_network.cpp
src/simix/smx_network_private.hpp [moved from src/simix/smx_network_private.h with 93% similarity]
src/simix/smx_private.hpp [moved from src/simix/smx_private.h with 66% similarity]
src/simix/smx_synchro.cpp
src/simix/smx_synchro_private.hpp
src/smpi/bindings/smpi_f77.cpp
src/smpi/bindings/smpi_f77_coll.cpp
src/smpi/bindings/smpi_f77_comm.cpp
src/smpi/bindings/smpi_f77_request.cpp
src/smpi/bindings/smpi_f77_type.cpp
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/smpi/bindings/smpi_pmpi_coll.cpp
src/smpi/bindings/smpi_pmpi_comm.cpp
src/smpi/bindings/smpi_pmpi_group.cpp
src/smpi/bindings/smpi_pmpi_info.cpp
src/smpi/bindings/smpi_pmpi_op.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_topo.cpp
src/smpi/bindings/smpi_pmpi_type.cpp
src/smpi/bindings/smpi_pmpi_win.cpp
src/smpi/colls/allgather/allgather-2dmesh.cpp
src/smpi/colls/allgather/allgather-3dmesh.cpp
src/smpi/colls/allgather/allgather-GB.cpp
src/smpi/colls/allgather/allgather-NTSLR-NB.cpp
src/smpi/colls/allgather/allgather-NTSLR.cpp
src/smpi/colls/allgather/allgather-SMP-NTS.cpp
src/smpi/colls/allgather/allgather-bruck.cpp
src/smpi/colls/allgather/allgather-loosely-lr.cpp
src/smpi/colls/allgather/allgather-mvapich-smp.cpp
src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp
src/smpi/colls/allgather/allgather-pair.cpp
src/smpi/colls/allgather/allgather-rdb.cpp
src/smpi/colls/allgather/allgather-rhv.cpp
src/smpi/colls/allgather/allgather-ring.cpp
src/smpi/colls/allgather/allgather-smp-simple.cpp
src/smpi/colls/allgather/allgather-spreading-simple.cpp
src/smpi/colls/allgatherv/allgatherv-GB.cpp
src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp
src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp
src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp
src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp
src/smpi/colls/allgatherv/allgatherv-pair.cpp
src/smpi/colls/allgatherv/allgatherv-ring.cpp
src/smpi/colls/allreduce/allreduce-lr.cpp
src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp
src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp
src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp
src/smpi/colls/allreduce/allreduce-rab-rdb.cpp
src/smpi/colls/allreduce/allreduce-rab1.cpp
src/smpi/colls/allreduce/allreduce-rab2.cpp
src/smpi/colls/allreduce/allreduce-rdb.cpp
src/smpi/colls/allreduce/allreduce-redbcast.cpp
src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp
src/smpi/colls/allreduce/allreduce-smp-binomial.cpp
src/smpi/colls/allreduce/allreduce-smp-rdb.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp
src/smpi/colls/allreduce/allreduce-smp-rsag.cpp
src/smpi/colls/alltoall/alltoall-2dmesh.cpp
src/smpi/colls/alltoall/alltoall-3dmesh.cpp
src/smpi/colls/alltoall/alltoall-basic-linear.cpp
src/smpi/colls/alltoall/alltoall-bruck.cpp
src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp
src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp
src/smpi/colls/alltoall/alltoall-pair.cpp
src/smpi/colls/alltoall/alltoall-rdb.cpp
src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp
src/smpi/colls/alltoall/alltoall-ring.cpp
src/smpi/colls/alltoallv/alltoallv-bruck.cpp
src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp
src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-pair.cpp
src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp
src/smpi/colls/alltoallv/alltoallv-ring.cpp
src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
src/smpi/colls/barrier/barrier-ompi.cpp
src/smpi/colls/bcast/bcast-NTSB.cpp
src/smpi/colls/bcast/bcast-NTSL-Isend.cpp
src/smpi/colls/bcast/bcast-NTSL.cpp
src/smpi/colls/bcast/bcast-SMP-binary.cpp
src/smpi/colls/bcast/bcast-SMP-binomial.cpp
src/smpi/colls/bcast/bcast-SMP-linear.cpp
src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp
src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp
src/smpi/colls/bcast/bcast-arrival-scatter.cpp
src/smpi/colls/bcast/bcast-binomial-tree.cpp
src/smpi/colls/bcast/bcast-flattree-pipeline.cpp
src/smpi/colls/bcast/bcast-flattree.cpp
src/smpi/colls/bcast/bcast-mvapich-smp.cpp
src/smpi/colls/bcast/bcast-ompi-pipeline.cpp
src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp
src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp
src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp
src/smpi/colls/coll_tuned_topo.cpp
src/smpi/colls/coll_tuned_topo.h [deleted file]
src/smpi/colls/coll_tuned_topo.hpp [new file with mode: 0644]
src/smpi/colls/colls_private.hpp [moved from src/smpi/colls/colls_private.h with 81% similarity]
src/smpi/colls/gather/gather-mvapich.cpp
src/smpi/colls/gather/gather-ompi.cpp
src/smpi/colls/reduce/reduce-NTSL.cpp
src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp
src/smpi/colls/reduce/reduce-binomial.cpp
src/smpi/colls/reduce/reduce-flat-tree.cpp
src/smpi/colls/reduce/reduce-mvapich-knomial.cpp
src/smpi/colls/reduce/reduce-mvapich-two-level.cpp
src/smpi/colls/reduce/reduce-ompi.cpp
src/smpi/colls/reduce/reduce-rab.cpp
src/smpi/colls/reduce/reduce-scatter-gather.cpp
src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp
src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp
src/smpi/colls/scatter/scatter-mvapich-two-level.cpp
src/smpi/colls/scatter/scatter-ompi.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/colls/smpi_coll.cpp
src/smpi/colls/smpi_default_selector.cpp
src/smpi/colls/smpi_intel_mpi_selector.cpp
src/smpi/colls/smpi_mpich_selector.cpp
src/smpi/colls/smpi_mvapich2_selector.cpp
src/smpi/colls/smpi_mvapich2_selector_stampede.h [deleted file]
src/smpi/colls/smpi_mvapich2_selector_stampede.hpp [new file with mode: 0644]
src/smpi/colls/smpi_openmpi_selector.cpp
src/smpi/include/private.h [deleted file]
src/smpi/include/private.hpp
src/smpi/include/smpi_coll.hpp
src/smpi/include/smpi_datatype.hpp
src/smpi/include/smpi_group.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/include/smpi_process.hpp
src/smpi/include/smpi_win.hpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_deployment.cpp
src/smpi/internals/smpi_dvfs.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_static_variables.cpp
src/smpi/mpi/smpi_comm.cpp
src/smpi/mpi/smpi_datatype.cpp
src/smpi/mpi/smpi_datatype_derived.cpp
src/smpi/mpi/smpi_f2c.cpp
src/smpi/mpi/smpi_group.cpp
src/smpi/mpi/smpi_keyvals.cpp
src/smpi/mpi/smpi_op.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/mpi/smpi_status.cpp
src/smpi/mpi/smpi_topo.cpp
src/smpi/mpi/smpi_win.cpp
src/surf/FileImpl.cpp
src/surf/FileImpl.hpp
src/surf/HostImpl.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_ti.cpp
src/surf/instr_routing.cpp
src/surf/instr_surf.cpp
src/surf/lagrange.cpp
src/surf/maxmin.cpp
src/surf/maxmin_private.hpp
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_interface.cpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/ns3/ns3_interface.hpp [moved from src/surf/ns3/ns3_interface.h with 86% similarity]
src/surf/ns3/ns3_simulator.cpp [moved from src/surf/ns3/ns3_simulator.cc with 95% similarity]
src/surf/ns3/ns3_simulator.hpp [moved from src/surf/ns3/ns3_simulator.h with 93% similarity]
src/surf/plugins/host_energy.cpp
src/surf/plugins/host_load.cpp
src/surf/ptask_L07.cpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.h [deleted file]
src/surf/surf_private.hpp [new file with mode: 0644]
src/surf/trace_mgr.cpp
src/surf/trace_mgr.hpp
src/surf/xml/platf.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/backtrace_linux.cpp
src/xbt/config.cpp
src/xbt/cunit.cpp
src/xbt/xbt_log_appender_file.c
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/s4u/actor/actor.cpp
teshsuite/s4u/pid/pid.cpp
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp
teshsuite/xbt/CMakeLists.txt
teshsuite/xbt/log_usage/log_usage.c
teshsuite/xbt/log_usage/log_usage.tesh
tools/cmake/DefinePackages.cmake
tools/cmake/MaintainerMode.cmake
tools/cmake/MakeLib.cmake

index e2bb276..7b93105 100644 (file)
@@ -105,7 +105,7 @@ endif()
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "17")
+set(SIMGRID_VERSION_MINOR "18")
 set(SIMGRID_VERSION_PATCH "0")
 set(SIMGRID_VERSION_EXTRA "-DEVEL") # Extra words to add to version string (e.g. -rc1)
 
@@ -242,6 +242,7 @@ endif()
 if(WIN32)
   set(Boost_USE_STATIC_LIBS 1)
 endif()
+
 set(HAVE_PAPI 0)
 if(enable_smpi_papi)
   include(FindPAPI)
index 454827e..5dc0488 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,20 @@
-SimGrid (3.17) UNRELEASED (release target: September 22 2017)
+SimGrid (3.18) NOT RELEASED YET (target: December 24 2017)
+
+ S4U
+ - Link::name() is deprecated and will be removed in v3.21, use instead
+   Link::getCname().
+ - Mailbox::getName() changed to return a std::string, use instead
+   Mailbox::getCname() to get a char*.
+ - Storage::getName() changed to return a std::string, use intead
+   Storage::getCname() to get a char*.
+
+SimGrid (3.17) Released October 8 2017
 
  The Drained Leaks release: (almost) no known leaks despite the tests.
 
  Even very long simulations will preserve your memory: our testsuite
- stresses SimGrid for over 45mn on fast machines, and there is only
- one single known leak, of about 4kb.
+ stresses SimGrid for over 45mn on fast machines for a coverage of
+ over 80%, and there is only one single known leak, of about 4kb.
 
 
  S4U
@@ -51,6 +61,8 @@ SimGrid (3.17) UNRELEASED (release target: September 22 2017)
    - #222: Actor::kill() doesn't really kill and segfaults
    - #225: Actor::kill() doesn't really kill when victims are doing a join()
 
+----------------------------------------------------------------------------
+
 SimGrid (3.16) Released June 22. 2017.
 
  The Blooming Spring Release: developments are budding.
diff --git a/NEWS b/NEWS
index 3125d9b..acbd344 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,23 @@
+                    _               _____  _  ___
+__   _____ _ __ ___(_) ___  _ __   |___ / / |( _ )
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ | |/ _ \
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) || | (_) |
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_|\___/
+               (not released yet)
+
                     _               _____  _ _____
 __   _____ _ __ ___(_) ___  _ __   |___ / / |___  |
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ | |  / /
  \ V /  __/ |  \__ \ | (_) | | | |  ___) || | / /
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_|/_/
-               (unreleased yet)
+               October 8 2017
+
+The Drained Leaks release: (almost) no known leaks despite the tests.
 
+ * Many many internal cleanups (almost 700 commits since 3.16).
+ * The coverage of our tests is above 80%.
+ * All memleaks but one plugged; A dozen of bugs fixed.
+ * XBT: Further replace XBT with std::* constructs.
                     _               _____  _  __
 __   _____ _ __ ___(_) ___  _ __   |___ / / |/ /_
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \ | | '_ \
index a0a8a97..9593489 100644 (file)
@@ -160,13 +160,13 @@ the simcall definitions from src/simix/simcalls.in, checks that both
 `simcall_<name>()` and `simcall_HANDLER()` are defined somewhere, and
 generates the following files:
 
-- smx_popping_accessors.h:
+- popping_accessors.hpp:
   Helper functions to get and set simcall arguments and results
-- smx_popping_bodies.cpp:
+- popping_bodies.cpp:
   The BODY function of each simcall
-- smx_popping_enum.c:
+- popping_enum.h:
   Definition of type `enum e_smx_simcall_t` (one value per existing simcall)
-- smx_popping_generated.cpp:
+- popping_generated.cpp:
   Definitions of `simcall_names[]` (debug name of each simcall), and
   SIMIX_simcall_enter() that deals with the simcall from within the kernel
 
index 57075d1..f3be6de 100644 (file)
@@ -8,6 +8,8 @@
 Please apply the following checklist before releasing.
 
 - Sources
+  - The external patches (Debian, etc) are integrated.
+    The COPYING file is aligned with Debian's copyright file.
   - The version number is correctly marked in CMakeLists.txt, in macros
     SIMGRID_VERSION_MAJOR and friends. 
   - The "make distcheck" target works (testing that every files needed
@@ -33,7 +35,7 @@ This should be done from a clean git repository because some files are
 included through globbing. The best is to use a clean checkout:
 \verbatim
 cd /tmp
-git clone ~/Code/simgrid
+git clone --depth=1 ~/Code/simgrid
 cd simgrid
 cmake . && make dist
 \endverbatim
@@ -90,7 +92,7 @@ the settings icon of the release you want to change.
   - emacs org/site/download.org and C-c C-c the first source block to refresh the download.
   - emacs org/site/documentation.org and edit the version links.
   - make -C org all sync
-  - git commit && git push
+  - git commit -a && git push
 - Announce the release
  - Mail the simgrid-user mailing list
     - the NEWS chunk in the mail;
index a31e13f..38732f6 100644 (file)
@@ -261,8 +261,10 @@ We have 2 interesting projects on Jenkins:
     is the main project, running the tests that we spoke about.\n It is
     configured (on Jenkins) to run the script <tt>tools/jenkins/build.sh</tt>
 \li <a href="https://ci.inria.fr/simgrid/job/SimGrid-DynamicAnalysis/">SimGrid-DynamicAnalysis</a>
-    runs the tests both under valgrind to find the memory errors and
-    under gcovr to report the achieved test coverage.\n It is configured
+    should be called "nightly" because it does not only run dynamic
+    tests, but a whole bunch of long lasting tests: valgrind (memory
+    errors), gcovr (coverage), Sanitizers (bad pointer usage, threading
+    errors, use of unspecified C constructs) and the clang static analyzer.\n It is configured
     (on Jenkins) to run the script <tt>tools/jenkins/DynamicAnalysis.sh</tt>
 
 In each case, SimGrid gets built in
@@ -282,6 +284,31 @@ order to disable the "ModelChecker" build on host
 (label=="small-netbsd-64-clang").implies(build_mode!="ModelChecker")
 \endverbatim
 
+Just for the record, the slaves were created from the available
+template with the following commands:
+\verbatim
+#debian/ubuntu
+apt-get install gcc g++ gfortran automake cmake libboost-dev openjdk-8-jdk openjdk-8-jre libxslt-dev libxml2-dev libevent-dev libunwind-dev libdw-dev htop git python3 xsltproc libboost-context-dev
+#for dynamicanalysis: 
+apt-get install jacoco libjacoco-java libns3-dev pcregrep gcovr ant lua5.3-dev sloccount
+
+#fedora
+dnf install libboost-devel openjdk-8-jdk openjdk-8-jre libxslt-devel libxml2-devel xsltproc git python3 libdw-devel libevent-devel libunwind-devel htop lua5.3-devel
+
+#netbsd
+pkg_add cmake gcc7 boost boost-headers automake openjdk8 libxslt libxml2 libunwind git htop python36
+
+#opensuse
+zypper install cmake automake clang boost-devel java-1_8_0-openjdk-devel libxslt-devel libxml2-devel xsltproc git python3 libdw-devel libevent-devel libunwind-devel htop binutils ggc7-fortran
+
+#freebsd
+pkg install boost-libs cmake openjdk8 automake libxslt libxml2 libunwind git htop python3  automake gcc6 flang elfutils libevent
+#+ clang-devel from ports
+
+#osx
+brew install cmake boost libunwind-headers libxslt git python3 
+\endverbatim
+
 \subsection inside_tests_travis Travis
 
 Travis is a free (as in free beer) Continuous Integration system that
index ae3d115..238ba47 100644 (file)
@@ -412,7 +412,7 @@ changed to use smpi version of the calls instead (MPI_Send will become smpi_mpi_
 
 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.
+ - Implement it in a file called alltoall-pair.c in the src/smpi/colls folder. This file should include colls_private.hpp.
 
  - The name of the new algorithm function should be smpi_coll_tuned_alltoall_pair, with the same signature as MPI_Alltoall.
 
index 3515d8c..684eacb 100644 (file)
@@ -371,7 +371,7 @@ this generates a bunch of C++ files:
   responsible for wrapping the parameters in the `struct s_smx_simcall`;
   and wrapping out the result;
 
-* [accessors](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_accessors.h)
+* [accessors](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_accessors.hpp)
    to get/set values of of `struct s_smx_simcall`;
 
 * a simulation-kernel-side [big switch](https://github.com/simgrid/simgrid/blob/4ae2fd01d8cc55bf83654e29f294335e3cb1f022/src/simix/popping_generated.cpp#L106)
@@ -629,7 +629,7 @@ which can be exposed using the same API as `std::condition_variable`:
 @code{cpp}
 class ConditionVariable {
 private:
-  friend s_smx_cond;
+  friend s_smx_cond_t;
   smx_cond_t cond_;
   ConditionVariable(smx_cond_t cond) : cond_(cond) {}
 public:
index 8e56aed..2030da9 100644 (file)
@@ -25,8 +25,8 @@ class Main {
     
     File f = new File(platfFile); 
     if (!f.exists()) {
-       System.err.println("File "+platfFile+" does not exist in "+System.getProperty("user.dir"));
-       System.err.println("Usage  : Main ../platforms/platform.xml");
+      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
+      Msg.error("Usage  : Main ../platforms/platform.xml");
     }
     
     Msg.createEnvironment(platfFile);
index a99dc21..5623ffa 100644 (file)
@@ -29,8 +29,8 @@ class Main {
     
     File f = new File(platfFile); 
     if (!f.exists()) {
-       System.err.println("File "+platfFile+" does not exist in "+System.getProperty("user.dir"));
-       System.err.println("Usage  : Main ../platforms/platform.xml");
+      Msg.error("File " + platfFile + " does not exist in " + System.getProperty("user.dir"));
+      Msg.error("Usage  : Main ../platforms/platform.xml");
     }
     
     Msg.createEnvironment(platfFile);
index d3c2af2..6e1bae9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ public class Daemon extends Process {
     } catch (HostFailureException e) {
       e.printStackTrace();
     } catch (TaskCancelledException e) {
-      System.out.println("task cancelled");
+      Msg.info("task cancelled");
       suspend(); // Suspend the process
     }
     currentTask = new Task(this.getHost().getName()+"-daemon-"+(i++), this.getHost().getSpeed()*100, 0);
index 414c980..10407a6 100644 (file)
@@ -47,7 +47,7 @@ public class XVM extends VM {
   }
 
   public int getLoad(){
-    System.out.println("Remaining comp:" + this.daemon.getRemaining());
+    Msg.info("Remaining comp:" + this.daemon.getRemaining());
     return this.currentLoad;
   }
 
index 841e9d1..a690a01 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -77,6 +77,7 @@ public class Node extends Process {
         }
       }
       catch (Exception e) {
+        Msg.debug("Caught exception: " + e);
       }
     }
     Msg.info(findNodeSuccedded + "/"  + (findNodeSuccedded + findNodeFailed) + " FIND_NODE have succedded.");
@@ -256,6 +257,7 @@ public class Node extends Process {
         waitFor(1);
       }
       catch (Exception ex) {
+        Msg.debug("Caught exception: " + ex);
       }
     } while (Msg.getClock() < timeout && !destinationFound);
   }
index 71d281b..96cf864 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014. The SimGrid Team.
+/* Copyright (c) 2006-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ public class Main {
       Killer killer = new Killer("Jacquelin","killer");
       killer.start();
     } catch (MsgException e){
-      System.out.println("Create processes failed!");
+      Msg.error("Create processes failed!");
     }
 
     /*  execute the simulation. */
index 04510e8..3eb4064 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2006-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -25,9 +25,9 @@ public class Main {
     try {
         DreamMaster process1 = new DreamMaster("Jacquelin","DreamMaster");
         process1.start();
-      } catch (MsgException e){
-        System.out.println("Create processes failed!");
-      }
+    } catch (MsgException e){
+      Msg.error("Create processes failed!");
+    }
 
     /*  execute the simulation. */
     Msg.run();
index 782f68f..37f866f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2007, 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,6 +10,8 @@ import org.simgrid.msg.MsgException;
 import org.simgrid.trace.Trace;
 
 public class Main  {
+  public static final String PM_STATE = "PM_STATE";
+
   private Main() {
     throw new IllegalAccessError("Utility class");
   }
@@ -29,11 +31,11 @@ public class Main  {
     new Receiver ("Tremblay", "Receiver", null).start();
 
     /* Initialize some state for the hosts */
-    Trace.hostStateDeclare ("PM_STATE"); 
-    Trace.hostStateDeclareValue ("PM_STATE", "waitingPing", "0 0 1");
-    Trace.hostStateDeclareValue ("PM_STATE", "sendingPong", "0 1 0");
-    Trace.hostStateDeclareValue ("PM_STATE", "sendingPing", "0 1 1");
-    Trace.hostStateDeclareValue ("PM_STATE", "waitingPong", "1 0 0");
+    Trace.hostStateDeclare (PM_STATE);
+    Trace.hostStateDeclareValue (PM_STATE, "waitingPing", "0 0 1");
+    Trace.hostStateDeclareValue (PM_STATE, "sendingPong", "0 1 0");
+    Trace.hostStateDeclareValue (PM_STATE, "sendingPing", "0 1 1");
+    Trace.hostStateDeclareValue (PM_STATE, "waitingPong", "1 0 0");
 
     /*  execute the simulation. */
     Msg.run();
index 4a1f26e..58e82b9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2007, 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2006-2007, 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,7 @@ import org.simgrid.trace.Trace;
 public class Receiver extends Process {
   private static final double COMM_SIZE_LAT = 1;
   private static final double COMM_SIZE_BW = 100000000;
+  private static final String PM_STATE = Main.PM_STATE;
 
   public Receiver(String hostname, String name, String[]args) throws HostNotFoundException {
     super(hostname,name,args);
@@ -22,7 +23,7 @@ public class Receiver extends Process {
 
   public void main(String[] args) throws MsgException {
     Msg.info("hello!");
-    Trace.hostPushState (getHost().getName(), "PM_STATE", "waitingPing");
+    Trace.hostPushState (getHost().getName(), PM_STATE, "waitingPing");
 
     /* Wait for the ping */ 
     Msg.info("try to get a task");
@@ -41,15 +42,15 @@ public class Receiver extends Process {
     Msg.info(" --- bw "+ COMM_SIZE_BW/communicationTime + " ----");
 
     /* Send the pong */
-    Trace.hostPushState (getHost().getName(), "PM_STATE", "sendingPong");
+    Trace.hostPushState (getHost().getName(), PM_STATE, "sendingPong");
     double computeDuration = 0;
     PingPongTask pong = new PingPongTask("no name",computeDuration,COMM_SIZE_LAT);
     pong.setTime(time);
     pong.send(ping.getSource().getName());
 
     /* Pop the two states */
-    Trace.hostPopState (getHost().getName(), "PM_STATE");
-    Trace.hostPopState (getHost().getName(), "PM_STATE");
+    Trace.hostPopState (getHost().getName(), PM_STATE);
+    Trace.hostPopState (getHost().getName(), PM_STATE);
 
     Msg.info("goodbye!");
   }
index 6af47fa..c97be48 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2006-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -16,7 +16,7 @@ import org.simgrid.trace.Trace;
 public class Sender extends Process {
   private static final double COMM_SIZE_LAT = 1;
   private static final double COMM_SIZE_BW = 100000000;
-  private static final String PM_STATE = "PM_STATE";
+  private static final String PM_STATE = Main.PM_STATE;
 
   public Sender(String hostname, String name, String[] args) throws HostNotFoundException {
     super(hostname,name,args);
index cc58794..2792765 100644 (file)
@@ -12,6 +12,19 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xm
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
 
+p Testing with default compound and Full network optimization
+
+$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-pingpong/app-pingpong_d.xml "--cfg=network/optim:Full" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/optim' to 'Full'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [  0.019014] (2:ponger@Jupiter)  Ping time (latency bound) 0.019014
+> [  0.019014] (2:ponger@Jupiter) task_bw->data = 0.019
+> [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
+> [150.178356] (0:maestro@) Total simulation time: 150.178
+
 p Testing the deprecated CM02 network model
 
 $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-pingpong/app-pingpong_d.xml --cfg=cpu/model:Cas01 --cfg=network/model:CM02 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
@@ -41,6 +54,21 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xm
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
 
+p Testing the surf network Reno2 fairness model using lagrangian approach
+
+$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-pingpong/app-pingpong_d.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Reno2" --log=surf_lagrange.thres=critical "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+> [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Reno2'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [  0.019014] (2:ponger@Jupiter)  Ping time (latency bound) 0.019014
+> [  0.019014] (2:ponger@Jupiter) task_bw->data = 0.019
+> [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
+> [150.178356] (0:maestro@) Total simulation time: 150.178
+
 p Testing the surf network Vegas fairness model using lagrangian approach
 
 $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml ${srcdir:=.}/../msg/app-pingpong/app-pingpong_d.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Vegas" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
@@ -55,3 +83,18 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xm
 > [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
+
+p Testing the surf network constant model
+
+$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${srcdir:=.}/small_platform_constant.xml ${srcdir:=.}/../msg/app-pingpong/app-pingpong_d.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+> [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [ 13.010000] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [ 13.010000] (2:ponger@Jupiter)  Ping time (latency bound) 13.010000
+> [ 13.010000] (2:ponger@Jupiter) task_bw->data = 13.010
+> [ 26.020000] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [ 26.020000] (1:pinger@Tremblay) Pong time (bandwidth bound): 13.010
+> [ 26.020000] (0:maestro@) Total simulation time: 26.020
index 2764151..d368bb1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -38,7 +38,8 @@ static int runner(int argc, char *argv[])
     MSG_parallel_task_create("parallel task", hosts_count, hosts, computation_amounts, communication_amounts, NULL);
   MSG_parallel_task_execute(ptask);
   MSG_task_destroy(ptask);
-  /* The arrays communication_amounts and computation_amounts are not to be freed manually */
+  xbt_free(communication_amounts);
+  xbt_free(computation_amounts);
 
   XBT_INFO("We can do the same with a timeout of one second enabled.");
   computation_amounts   = xbt_new0(double, hosts_count);
@@ -53,6 +54,8 @@ static int runner(int argc, char *argv[])
   msg_error_t errcode = MSG_parallel_task_execute_with_timeout(ptask, 1 /* timeout (in seconds)*/);
   xbt_assert(errcode == MSG_TIMEOUT, "Woops, this did not timeout as expected... Please report that bug.");
   MSG_task_destroy(ptask);
+  xbt_free(communication_amounts);
+  xbt_free(computation_amounts);
 
   XBT_INFO("Then, build a parallel task involving only computations and no communication (1 Gflop per node)");
   computation_amounts = xbt_new0(double, hosts_count);
@@ -61,6 +64,7 @@ static int runner(int argc, char *argv[])
   ptask = MSG_parallel_task_create("parallel exec", hosts_count, hosts, computation_amounts, NULL/* no comm */, NULL);
   MSG_parallel_task_execute(ptask);
   MSG_task_destroy(ptask);
+  xbt_free(computation_amounts);
 
   XBT_INFO("Then, build a parallel task with no computation nor communication (synchro only)");
   computation_amounts = xbt_new0(double, hosts_count);
@@ -68,8 +72,10 @@ static int runner(int argc, char *argv[])
   ptask = MSG_parallel_task_create("parallel sync", hosts_count, hosts, computation_amounts, communication_amounts, NULL);
   MSG_parallel_task_execute(ptask);
   MSG_task_destroy(ptask);
+  xbt_free(communication_amounts);
+  xbt_free(computation_amounts);
 
-   XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", MSG_host_get_name(hosts[1]));
+  XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", MSG_host_get_name(hosts[1]));
   computation_amounts = xbt_new0(double, 1);
   computation_amounts[0] = 1e9; // 1 Gflop
   msg_host_t *remote = xbt_new(msg_host_t,1);
@@ -77,10 +83,11 @@ static int runner(int argc, char *argv[])
   ptask = MSG_parallel_task_create("remote exec", 1, remote, computation_amounts, NULL/* no comm */, NULL);
   MSG_parallel_task_execute(ptask);
   MSG_task_destroy(ptask);
-  free(remote);
+  xbt_free(remote);
+  xbt_free(computation_amounts);
 
   XBT_INFO("Goodbye now!");
-  free(hosts);
+  xbt_free(hosts);
   return 0;
 }
 
index 130aff3..4c4b5f8 100644 (file)
@@ -566,36 +566,36 @@ $ tail -n +3 simgrid.trace
 > 10 0.412439 10 8 5.600000
 > 10 0.412439 10 9 3.400000
 > 10 0.412439 10 8 5.600000
-> 7 0.412439 1 6
-> 7 0.412439 1 3
-> 7 0.412439 3 28
-> 7 0.412439 3 29
-> 7 0.412439 3 23
-> 7 0.412439 3 30
-> 7 0.412439 3 24
-> 7 0.412439 3 18
-> 7 0.412439 1 1
+> 7 0.412439 3 16
+> 7 0.412439 3 14
 > 7 0.412439 3 19
 > 7 0.412439 3 20
+> 7 0.412439 3 18
 > 7 0.412439 3 21
 > 7 0.412439 3 22
-> 7 0.412439 3 25
-> 7 0.412439 3 26
-> 7 0.412439 3 31
-> 7 0.412439 3 27
-> 7 0.412439 3 16
-> 7 0.412439 3 14
 > 7 0.412439 3 12
 > 7 0.412439 3 9
 > 7 0.412439 3 15
+> 7 0.412439 3 23
+> 7 0.412439 3 24
 > 7 0.412439 3 17
+> 7 0.412439 3 25
+> 7 0.412439 3 26
+> 7 0.412439 3 27
 > 7 0.412439 3 8
 > 7 0.412439 3 10
+> 7 0.412439 3 28
+> 7 0.412439 3 29
 > 7 0.412439 3 13
+> 7 0.412439 3 30
 > 7 0.412439 3 11
-> 7 0.412439 1 5
-> 7 0.412439 1 2
 > 7 0.412439 1 7
+> 7 0.412439 1 5
+> 7 0.412439 1 3
 > 7 0.412439 1 4
+> 7 0.412439 1 6
+> 7 0.412439 1 2
+> 7 0.412439 1 1
+> 7 0.412439 3 31
 
 $ rm -f simgrid.trace
index 1be528a..6966242 100644 (file)
@@ -301,37 +301,37 @@ $ tail -n +3 trace_platform.trace
 > 16 0 6 0 topology 21 44
 > 15 0 6 0 topology 30 45
 > 16 0 6 0 topology 28 45
-> 7 0 1 6
-> 7 0 1 3
-> 7 0 3 28
-> 7 0 3 29
-> 7 0 3 23
-> 7 0 3 30
-> 7 0 3 24
-> 7 0 3 18
-> 7 0 1 1
+> 7 0 3 16
+> 7 0 3 14
 > 7 0 3 19
 > 7 0 3 20
+> 7 0 3 18
 > 7 0 3 21
 > 7 0 3 22
-> 7 0 3 25
-> 7 0 3 26
-> 7 0 3 31
-> 7 0 3 27
-> 7 0 3 16
-> 7 0 3 14
 > 7 0 3 12
 > 7 0 3 9
 > 7 0 3 15
+> 7 0 3 23
+> 7 0 3 24
 > 7 0 3 17
+> 7 0 3 25
+> 7 0 3 26
+> 7 0 3 27
 > 7 0 3 8
 > 7 0 3 10
+> 7 0 3 28
+> 7 0 3 29
 > 7 0 3 13
+> 7 0 3 30
 > 7 0 3 11
-> 7 0 1 5
-> 7 0 1 2
 > 7 0 1 7
+> 7 0 1 5
+> 7 0 1 3
 > 7 0 1 4
+> 7 0 1 6
+> 7 0 1 2
+> 7 0 1 1
+> 7 0 3 31
 
 $ rm -f trace_platform.trace
 
@@ -25722,4802 +25722,4802 @@ $ tail -n +3 trace_platform.trace
 > 16 0 35 0 topology 3414 6312
 > 15 0 35 0 topology 13 6313
 > 16 0 35 0 topology 2348 6313
-> 7 0 2 9
-> 7 0 3 18
-> 7 0 3 19
-> 7 0 3 17
-> 7 0 2 2
-> 7 0 3 13
-> 7 0 3 20
-> 7 0 2 10
-> 7 0 2 8
-> 7 0 3 16
-> 7 0 2 3
-> 7 0 3 15
-> 7 0 2 11
-> 7 0 3 14
-> 7 0 2 7
-> 7 0 2 6
-> 7 0 2 5
-> 7 0 3 12
-> 7 0 2 4
-> 7 0 1 1
-> 7 0 3 4794
-> 7 0 7 4648
-> 7 0 9 4778
-> 7 0 7 4660
-> 7 0 9 4640
-> 7 0 9 4665
-> 7 0 9 4652
-> 7 0 9 4725
-> 7 0 9 4701
-> 7 0 7 4663
-> 7 0 9 4677
-> 7 0 9 4785
-> 7 0 9 4761
-> 7 0 7 4723
-> 7 0 9 4737
-> 7 0 7 4699
-> 7 0 9 4713
-> 7 0 7 4675
-> 7 0 9 4689
-> 7 0 7 4783
-> 7 0 7 4759
-> 7 0 9 4773
-> 7 0 7 4735
-> 7 0 9 4749
-> 7 0 7 4711
-> 7 0 7 4687
-> 7 0 7 4771
-> 7 0 7 4747
-> 7 0 9 4673
-> 7 0 9 4703
-> 7 0 9 4733
-> 7 0 9 4647
-> 7 0 9 4763
-> 7 0 9 4685
-> 7 0 7 4639
-> 7 0 9 4715
-> 7 0 9 4745
-> 7 0 9 4659
-> 7 0 9 4775
-> 7 0 7 4651
-> 7 0 9 4637
-> 7 0 9 4649
-> 7 0 9 4668
-> 7 0 12 4792
-> 7 0 9 4728
-> 7 0 9 4704
-> 7 0 9 4661
-> 7 0 7 4666
-> 7 0 9 4680
-> 7 0 9 4788
-> 7 0 9 4764
-> 7 0 7 4726
-> 7 0 9 4740
-> 7 0 7 4702
-> 7 0 9 4716
-> 7 0 7 4678
-> 7 0 9 4692
-> 7 0 7 4786
-> 7 0 7 4762
-> 7 0 9 4776
-> 7 0 7 4738
-> 7 0 9 4752
-> 7 0 7 4714
-> 7 0 7 4690
-> 7 0 7 4774
-> 7 0 9 4670
-> 7 0 7 4750
-> 7 0 9 4638
-> 7 0 9 4700
-> 7 0 9 4730
-> 7 0 9 4760
-> 7 0 9 4682
-> 7 0 9 4790
-> 7 0 9 4650
-> 7 0 9 4712
-> 7 0 9 4742
-> 7 0 7 4642
-> 7 0 9 4772
-> 7 0 9 4662
-> 7 0 7 4654
-> 7 0 9 4646
-> 7 0 9 4695
-> 7 0 9 4671
-> 7 0 9 4755
-> 7 0 9 4658
-> 7 0 9 4731
-> 7 0 7 4693
-> 7 0 9 4707
-> 7 0 7 4669
-> 7 0 9 4683
-> 7 0 9 4791
-> 7 0 7 4753
-> 7 0 9 4767
-> 7 0 7 4729
-> 7 0 9 4743
-> 7 0 7 4705
-> 7 0 9 4719
-> 7 0 7 4681
-> 7 0 7 4789
-> 7 0 7 4765
-> 7 0 9 4779
-> 7 0 7 4741
-> 7 0 7 4717
-> 7 0 9 4667
-> 7 0 9 4697
-> 7 0 7 4777
-> 7 0 9 4727
-> 7 0 9 4793
-> 7 0 9 4641
-> 7 0 9 4757
-> 7 0 9 4679
-> 7 0 9 4787
-> 7 0 9 4709
-> 7 0 9 4739
-> 7 0 9 4653
-> 7 0 9 4769
-> 7 0 9 4691
-> 7 0 7 4645
-> 7 0 9 4721
-> 7 0 9 4751
-> 7 0 9 4781
-> 7 0 7 4657
-> 7 0 9 4643
-> 7 0 9 4698
-> 7 0 9 4655
-> 7 0 9 4674
-> 7 0 9 4758
-> 7 0 9 4734
-> 7 0 7 4696
-> 7 0 9 4710
-> 7 0 7 4672
-> 7 0 9 4686
-> 7 0 7 4756
-> 7 0 9 4770
-> 7 0 7 4732
-> 7 0 9 4746
-> 7 0 7 4708
-> 7 0 9 4722
-> 7 0 7 4684
-> 7 0 7 4768
-> 7 0 9 4782
-> 7 0 9 4664
-> 7 0 7 4744
-> 7 0 9 4694
-> 7 0 7 4720
-> 7 0 9 4724
-> 7 0 9 4754
-> 7 0 7 4780
-> 7 0 9 4676
-> 7 0 9 4784
-> 7 0 9 4644
-> 7 0 9 4706
-> 7 0 9 4736
-> 7 0 7 4636
-> 7 0 9 4766
-> 7 0 9 4688
-> 7 0 9 4656
-> 7 0 9 4718
-> 7 0 9 4748
-> 7 0 6 4635
-> 7 0 3 4797
-> 7 0 12 4796
-> 7 0 6 4795
-> 7 0 3 4634
-> 7 0 9 4405
-> 7 0 9 4427
-> 7 0 9 4511
-> 7 0 7 4422
-> 7 0 9 4463
-> 7 0 9 4547
-> 7 0 9 4631
-> 7 0 7 4458
-> 7 0 9 4499
-> 7 0 7 4542
-> 7 0 9 4583
-> 7 0 7 4494
-> 7 0 9 4535
-> 7 0 7 4578
-> 7 0 9 4619
-> 7 0 7 4446
-> 7 0 7 4530
-> 7 0 7 4614
-> 7 0 9 4633
-> 7 0 9 4459
-> 7 0 7 4566
-> 7 0 9 4400
-> 7 0 9 4519
-> 7 0 9 4441
-> 7 0 9 4579
-> 7 0 9 4501
-> 7 0 9 4561
-> 7 0 9 4621
-> 7 0 7 4413
-> 7 0 9 4454
-> 7 0 9 4414
-> 7 0 7 4449
-> 7 0 9 4490
-> 7 0 9 4574
-> 7 0 9 4442
-> 7 0 7 4485
-> 7 0 9 4526
-> 7 0 7 4569
-> 7 0 9 4610
-> 7 0 7 4437
-> 7 0 9 4478
-> 7 0 7 4521
-> 7 0 9 4562
-> 7 0 7 4605
-> 7 0 7 4473
-> 7 0 7 4557
-> 7 0 9 4598
-> 7 0 9 4426
-> 7 0 9 4486
-> 7 0 7 4593
-> 7 0 9 4546
-> 7 0 9 4468
-> 7 0 9 4606
-> 7 0 9 4528
-> 7 0 9 4415
-> 7 0 7 4404
-> 7 0 9 4588
-> 7 0 9 4399
-> 7 0 9 4481
-> 7 0 9 4433
-> 7 0 9 4517
-> 7 0 9 4601
-> 7 0 7 4428
-> 7 0 9 4469
-> 7 0 7 4512
-> 7 0 9 4553
-> 7 0 7 4464
-> 7 0 9 4505
-> 7 0 7 4548
-> 7 0 9 4589
-> 7 0 7 4500
-> 7 0 7 4584
-> 7 0 9 4625
-> 7 0 9 4453
-> 7 0 7 4536
-> 7 0 9 4513
-> 7 0 7 4620
-> 7 0 9 4435
-> 7 0 9 4573
-> 7 0 9 4406
-> 7 0 9 4495
-> 7 0 7 4395
-> 7 0 9 4555
-> 7 0 9 4477
-> 7 0 9 4615
-> 7 0 9 4537
-> 7 0 9 4597
-> 7 0 9 4424
-> 7 0 9 4408
-> 7 0 7 4419
-> 7 0 9 4460
-> 7 0 9 4544
-> 7 0 7 4455
-> 7 0 9 4496
-> 7 0 7 4539
-> 7 0 9 4580
-> 7 0 9 4448
-> 7 0 7 4491
-> 7 0 9 4532
-> 7 0 7 4575
-> 7 0 9 4616
-> 7 0 7 4443
-> 7 0 9 4420
-> 7 0 7 4527
-> 7 0 9 4568
-> 7 0 7 4611
-> 7 0 9 4480
-> 7 0 7 4563
-> 7 0 9 4397
-> 7 0 9 4540
-> 7 0 9 4462
-> 7 0 9 4600
-> 7 0 9 4522
-> 7 0 9 4444
-> 7 0 9 4582
-> 7 0 9 4504
-> 7 0 9 4564
-> 7 0 7 4410
-> 7 0 9 4624
-> 7 0 9 4393
-> 7 0 9 4451
-> 7 0 9 4487
-> 7 0 9 4417
-> 7 0 9 4571
-> 7 0 9 4439
-> 7 0 9 4523
-> 7 0 7 4482
-> 7 0 9 4607
-> 7 0 9 4475
-> 7 0 7 4434
-> 7 0 9 4559
-> 7 0 7 4518
-> 7 0 7 4602
-> 7 0 7 4470
-> 7 0 7 4554
-> 7 0 9 4595
-> 7 0 7 4506
-> 7 0 9 4429
-> 7 0 7 4590
-> 7 0 9 4489
-> 7 0 7 4626
-> 7 0 9 4549
-> 7 0 9 4471
-> 7 0 9 4412
-> 7 0 9 4609
-> 7 0 9 4531
-> 7 0 7 4401
-> 7 0 9 4591
-> 7 0 12 4632
-> 7 0 9 4402
-> 7 0 9 4430
-> 7 0 9 4514
-> 7 0 9 4466
-> 7 0 7 4425
-> 7 0 9 4550
-> 7 0 7 4509
-> 7 0 9 4502
-> 7 0 7 4461
-> 7 0 7 4545
-> 7 0 9 4586
-> 7 0 7 4629
-> 7 0 9 4538
-> 7 0 7 4497
-> 7 0 7 4581
-> 7 0 9 4622
-> 7 0 7 4533
-> 7 0 9 4456
-> 7 0 7 4617
-> 7 0 9 4516
-> 7 0 9 4438
-> 7 0 9 4403
-> 7 0 7 4392
-> 7 0 9 4576
-> 7 0 9 4498
-> 7 0 9 4558
-> 7 0 9 4618
-> 7 0 7 4416
-> 7 0 9 4421
-> 7 0 9 4457
-> 7 0 9 4411
-> 7 0 9 4541
-> 7 0 9 4493
-> 7 0 7 4452
-> 7 0 9 4577
-> 7 0 9 4445
-> 7 0 9 4529
-> 7 0 7 4488
-> 7 0 7 4572
-> 7 0 9 4613
-> 7 0 7 4440
-> 7 0 7 4524
-> 7 0 9 4565
-> 7 0 7 4608
-> 7 0 7 4476
-> 7 0 9 4423
-> 7 0 7 4560
-> 7 0 9 4483
-> 7 0 9 4394
-> 7 0 9 4543
-> 7 0 7 4596
-> 7 0 9 4465
-> 7 0 9 4603
-> 7 0 9 4525
-> 7 0 9 4447
-> 7 0 9 4585
-> 7 0 9 4507
-> 7 0 9 4418
-> 7 0 7 4407
-> 7 0 9 4567
-> 7 0 9 4627
-> 7 0 9 4396
-> 7 0 9 4484
-> 7 0 9 4436
-> 7 0 9 4520
-> 7 0 7 4479
-> 7 0 9 4604
-> 7 0 9 4472
-> 7 0 7 4431
-> 7 0 9 4556
-> 7 0 7 4515
-> 7 0 7 4599
-> 7 0 9 4508
-> 7 0 7 4467
-> 7 0 7 4551
-> 7 0 9 4592
-> 7 0 7 4503
-> 7 0 9 4450
-> 7 0 7 4587
-> 7 0 9 4628
-> 7 0 9 4510
-> 7 0 9 4432
-> 7 0 9 4570
-> 7 0 7 4623
-> 7 0 9 4492
-> 7 0 9 4630
-> 7 0 9 4552
-> 7 0 9 4409
-> 7 0 9 4474
-> 7 0 7 4398
-> 7 0 9 4612
-> 7 0 9 4534
-> 7 0 9 4594
-> 7 0 6 4391
-> 7 0 1 4390
-> 7 0 12 3919
-> 7 0 6 3918
-> 7 0 7 3801
-> 7 0 9 3827
-> 7 0 9 3887
-> 7 0 9 3817
-> 7 0 9 3863
-> 7 0 12 3915
-> 7 0 7 3813
-> 7 0 9 3839
-> 7 0 9 3899
-> 7 0 9 3875
-> 7 0 9 3851
-> 7 0 9 3911
-> 7 0 9 3823
-> 7 0 9 3853
-> 7 0 9 3883
-> 7 0 7 3825
-> 7 0 9 3913
-> 7 0 9 3835
-> 7 0 7 3855
-> 7 0 9 3865
-> 7 0 7 3885
-> 7 0 9 3806
-> 7 0 9 3895
-> 7 0 7 3837
-> 7 0 9 3847
-> 7 0 7 3867
-> 7 0 9 3877
-> 7 0 7 3897
-> 7 0 9 3818
-> 7 0 9 3907
-> 7 0 7 3849
-> 7 0 7 3879
-> 7 0 7 3909
-> 7 0 9 3802
-> 7 0 7 3798
-> 7 0 9 3854
-> 7 0 9 3830
-> 7 0 9 3814
-> 7 0 9 3914
-> 7 0 7 3810
-> 7 0 9 3890
-> 7 0 9 3866
-> 7 0 9 3842
-> 7 0 9 3902
-> 7 0 9 3878
-> 7 0 7 3822
-> 7 0 9 3797
-> 7 0 9 3832
-> 7 0 7 3852
-> 7 0 9 3916
-> 7 0 9 3862
-> 7 0 7 3882
-> 7 0 9 3892
-> 7 0 7 3912
-> 7 0 7 3834
-> 7 0 9 3809
-> 7 0 9 3844
-> 7 0 7 3864
-> 7 0 9 3874
-> 7 0 7 3894
-> 7 0 9 3904
-> 7 0 7 3846
-> 7 0 9 3821
-> 7 0 7 3876
-> 7 0 7 3906
-> 7 0 9 3799
-> 7 0 7 3795
-> 7 0 9 3811
-> 7 0 9 3857
-> 7 0 7 3807
-> 7 0 9 3833
-> 7 0 9 3893
-> 7 0 9 3869
-> 7 0 7 3819
-> 7 0 9 3845
-> 7 0 9 3905
-> 7 0 9 3881
-> 7 0 9 3829
-> 7 0 9 3859
-> 7 0 9 3800
-> 7 0 9 3889
-> 7 0 7 3831
-> 7 0 9 3841
-> 7 0 7 3861
-> 7 0 9 3871
-> 7 0 7 3891
-> 7 0 9 3812
-> 7 0 9 3901
-> 7 0 7 3843
-> 7 0 7 3873
-> 7 0 7 3903
-> 7 0 9 3796
-> 7 0 9 3824
-> 7 0 9 3808
-> 7 0 7 3804
-> 7 0 9 3884
-> 7 0 9 3860
-> 7 0 9 3836
-> 7 0 9 3820
-> 7 0 7 3816
-> 7 0 9 3896
-> 7 0 9 3872
-> 7 0 9 3848
-> 7 0 9 3908
-> 7 0 9 3826
-> 7 0 9 3856
-> 7 0 9 3886
-> 7 0 7 3828
-> 7 0 9 3803
-> 7 0 9 3838
-> 7 0 7 3858
-> 7 0 9 3868
-> 7 0 7 3888
-> 7 0 9 3898
-> 7 0 7 3840
-> 7 0 9 3815
-> 7 0 9 3850
-> 7 0 7 3870
-> 7 0 9 3880
-> 7 0 7 3900
-> 7 0 9 3910
-> 7 0 9 3805
-> 7 0 6 3794
-> 7 0 3 3714
-> 7 0 3 3611
-> 7 0 9 3434
-> 7 0 7 3462
-> 7 0 9 3523
-> 7 0 7 3570
-> 7 0 7 3492
-> 7 0 9 3553
-> 7 0 7 3600
-> 7 0 7 3522
-> 7 0 9 3583
-> 7 0 7 3552
-> 7 0 7 3582
-> 7 0 9 3418
-> 7 0 9 3446
-> 7 0 7 3423
-> 7 0 9 3430
-> 7 0 9 3506
-> 7 0 9 3482
-> 7 0 9 3458
-> 7 0 9 3566
-> 7 0 7 3435
-> 7 0 9 3442
-> 7 0 9 3542
-> 7 0 9 3518
-> 7 0 9 3494
-> 7 0 9 3602
-> 7 0 9 3470
-> 7 0 9 3578
-> 7 0 9 3554
-> 7 0 9 3530
-> 7 0 9 3590
-> 7 0 9 3448
-> 7 0 9 3478
-> 7 0 7 3447
-> 7 0 9 3508
-> 7 0 7 3477
-> 7 0 9 3538
-> 7 0 9 3425
-> 7 0 9 3460
-> 7 0 7 3507
-> 7 0 9 3568
-> 7 0 9 3490
-> 7 0 7 3537
-> 7 0 9 3598
-> 7 0 7 3459
-> 7 0 9 3520
-> 7 0 7 3567
-> 7 0 7 3489
-> 7 0 9 3550
-> 7 0 7 3597
-> 7 0 9 3437
-> 7 0 9 3472
-> 7 0 7 3519
-> 7 0 9 3580
-> 7 0 9 3502
-> 7 0 7 3549
-> 7 0 7 3471
-> 7 0 9 3532
-> 7 0 7 3579
-> 7 0 7 3501
-> 7 0 9 3562
-> 7 0 7 3531
-> 7 0 9 3592
-> 7 0 7 3561
-> 7 0 7 3591
-> 7 0 7 3420
-> 7 0 9 3427
-> 7 0 9 3449
-> 7 0 9 3509
-> 7 0 7 3432
-> 7 0 9 3439
-> 7 0 9 3485
-> 7 0 9 3461
-> 7 0 9 3569
-> 7 0 9 3545
-> 7 0 9 3521
-> 7 0 9 3497
-> 7 0 9 3605
-> 7 0 9 3473
-> 7 0 9 3581
-> 7 0 9 3557
-> 7 0 9 3533
-> 7 0 9 3445
-> 7 0 9 3593
-> 7 0 9 3475
-> 7 0 7 3444
-> 7 0 9 3505
-> 7 0 7 3474
-> 7 0 9 3535
-> 7 0 12 3609
-> 7 0 9 3457
-> 7 0 7 3504
-> 7 0 9 3565
-> 7 0 9 3487
-> 7 0 7 3534
-> 7 0 9 3595
-> 7 0 9 3428
-> 7 0 7 3456
-> 7 0 9 3517
-> 7 0 7 3564
-> 7 0 7 3486
-> 7 0 9 3547
-> 7 0 7 3594
-> 7 0 9 3469
-> 7 0 7 3516
-> 7 0 9 3577
-> 7 0 9 3499
-> 7 0 7 3546
-> 7 0 9 3607
-> 7 0 9 3440
-> 7 0 7 3468
-> 7 0 9 3529
-> 7 0 7 3576
-> 7 0 7 3498
-> 7 0 9 3559
-> 7 0 7 3606
-> 7 0 7 3528
-> 7 0 9 3589
-> 7 0 7 3558
-> 7 0 7 3588
-> 7 0 7 3417
-> 7 0 9 3424
-> 7 0 9 3476
-> 7 0 9 3452
-> 7 0 7 3429
-> 7 0 9 3436
-> 7 0 9 3536
-> 7 0 9 3512
-> 7 0 9 3488
-> 7 0 9 3596
-> 7 0 9 3464
-> 7 0 9 3572
-> 7 0 7 3441
-> 7 0 9 3548
-> 7 0 9 3524
-> 7 0 9 3500
-> 7 0 9 3608
-> 7 0 9 3584
-> 7 0 9 3560
-> 7 0 9 3419
-> 7 0 9 3454
-> 7 0 9 3610
-> 7 0 9 3484
-> 7 0 7 3453
-> 7 0 9 3514
-> 7 0 7 3483
-> 7 0 9 3544
-> 7 0 9 3431
-> 7 0 9 3466
-> 7 0 7 3513
-> 7 0 9 3574
-> 7 0 9 3496
-> 7 0 7 3543
-> 7 0 9 3604
-> 7 0 7 3465
-> 7 0 9 3526
-> 7 0 7 3573
-> 7 0 7 3495
-> 7 0 9 3556
-> 7 0 7 3603
-> 7 0 9 3443
-> 7 0 7 3525
-> 7 0 9 3586
-> 7 0 7 3555
-> 7 0 7 3585
-> 7 0 9 3421
-> 7 0 7 3426
-> 7 0 9 3433
-> 7 0 9 3479
-> 7 0 9 3455
-> 7 0 9 3539
-> 7 0 9 3515
-> 7 0 7 3438
-> 7 0 9 3491
-> 7 0 9 3599
-> 7 0 9 3467
-> 7 0 9 3575
-> 7 0 9 3551
-> 7 0 9 3527
-> 7 0 9 3503
-> 7 0 9 3587
-> 7 0 9 3563
-> 7 0 9 3451
-> 7 0 9 3481
-> 7 0 9 3422
-> 7 0 7 3450
-> 7 0 9 3511
-> 7 0 7 3480
-> 7 0 9 3541
-> 7 0 9 3463
-> 7 0 7 3510
-> 7 0 9 3571
-> 7 0 9 3493
-> 7 0 7 3540
-> 7 0 9 3601
-> 7 0 6 3416
-> 7 0 3 3917
-> 7 0 7 3640
-> 7 0 9 3615
-> 7 0 9 3650
-> 7 0 7 3670
-> 7 0 9 3713
-> 7 0 9 3680
-> 7 0 7 3700
-> 7 0 9 3710
-> 7 0 7 3652
-> 7 0 9 3627
-> 7 0 9 3662
-> 7 0 7 3682
-> 7 0 9 3692
-> 7 0 7 3664
-> 7 0 9 3639
-> 7 0 7 3694
-> 7 0 9 3617
-> 7 0 7 3613
-> 7 0 9 3629
-> 7 0 9 3675
-> 7 0 7 3625
-> 7 0 9 3651
-> 7 0 9 3711
-> 7 0 9 3687
-> 7 0 7 3637
-> 7 0 9 3663
-> 7 0 9 3699
-> 7 0 9 3647
-> 7 0 9 3677
-> 7 0 9 3618
-> 7 0 9 3707
-> 7 0 7 3649
-> 7 0 9 3659
-> 7 0 7 3679
-> 7 0 9 3689
-> 7 0 7 3709
-> 7 0 9 3630
-> 7 0 7 3661
-> 7 0 7 3691
-> 7 0 12 3712
-> 7 0 9 3614
-> 7 0 9 3642
-> 7 0 9 3626
-> 7 0 7 3622
-> 7 0 9 3702
-> 7 0 9 3678
-> 7 0 9 3654
-> 7 0 9 3638
-> 7 0 7 3634
-> 7 0 9 3690
-> 7 0 9 3666
-> 7 0 9 3644
-> 7 0 9 3674
-> 7 0 9 3704
-> 7 0 7 3646
-> 7 0 9 3621
-> 7 0 9 3656
-> 7 0 7 3676
-> 7 0 9 3686
-> 7 0 7 3706
-> 7 0 7 3658
-> 7 0 9 3633
-> 7 0 9 3668
-> 7 0 7 3688
-> 7 0 9 3698
-> 7 0 9 3623
-> 7 0 7 3619
-> 7 0 9 3645
-> 7 0 9 3705
-> 7 0 9 3635
-> 7 0 9 3681
-> 7 0 7 3631
-> 7 0 9 3657
-> 7 0 9 3693
-> 7 0 9 3669
-> 7 0 9 3641
-> 7 0 9 3671
-> 7 0 9 3701
-> 7 0 7 3643
-> 7 0 9 3653
-> 7 0 7 3673
-> 7 0 9 3683
-> 7 0 7 3703
-> 7 0 9 3624
-> 7 0 7 3655
-> 7 0 9 3665
-> 7 0 7 3685
-> 7 0 9 3695
-> 7 0 9 3636
-> 7 0 7 3667
-> 7 0 7 3697
-> 7 0 9 3620
-> 7 0 7 3616
-> 7 0 9 3672
-> 7 0 9 3648
-> 7 0 9 3632
-> 7 0 7 3628
-> 7 0 9 3708
-> 7 0 9 3684
-> 7 0 9 3660
-> 7 0 9 3696
-> 7 0 6 3612
-> 7 0 3 3793
-> 7 0 3 3920
-> 7 0 9 3729
-> 7 0 7 3725
-> 7 0 9 3778
-> 7 0 9 3754
-> 7 0 9 3741
-> 7 0 7 3737
-> 7 0 9 3790
-> 7 0 9 3766
-> 7 0 9 3744
-> 7 0 9 3774
-> 7 0 9 3718
-> 7 0 7 3746
-> 7 0 9 3756
-> 7 0 7 3776
-> 7 0 9 3786
-> 7 0 9 3730
-> 7 0 7 3758
-> 7 0 9 3768
-> 7 0 7 3788
-> 7 0 9 3742
-> 7 0 7 3770
-> 7 0 9 3726
-> 7 0 9 3745
-> 7 0 7 3722
-> 7 0 9 3781
-> 7 0 9 3738
-> 7 0 9 3757
-> 7 0 7 3734
-> 7 0 12 3791
-> 7 0 9 3769
-> 7 0 7 3743
-> 7 0 9 3753
-> 7 0 7 3773
-> 7 0 9 3721
-> 7 0 9 3783
-> 7 0 7 3755
-> 7 0 9 3765
-> 7 0 7 3785
-> 7 0 9 3733
-> 7 0 7 3767
-> 7 0 9 3723
-> 7 0 7 3719
-> 7 0 9 3748
-> 7 0 9 3735
-> 7 0 7 3731
-> 7 0 9 3784
-> 7 0 9 3760
-> 7 0 9 3772
-> 7 0 9 3750
-> 7 0 9 3780
-> 7 0 9 3724
-> 7 0 7 3752
-> 7 0 9 3762
-> 7 0 7 3782
-> 7 0 9 3736
-> 7 0 7 3764
-> 7 0 9 3720
-> 7 0 7 3716
-> 7 0 9 3775
-> 7 0 9 3732
-> 7 0 9 3751
-> 7 0 7 3728
-> 7 0 9 3787
-> 7 0 9 3763
-> 7 0 7 3740
-> 7 0 9 3747
-> 7 0 9 3777
-> 7 0 9 3792
-> 7 0 7 3749
-> 7 0 9 3759
-> 7 0 7 3779
-> 7 0 9 3727
-> 7 0 9 3789
-> 7 0 7 3761
-> 7 0 9 3771
-> 7 0 9 3739
-> 7 0 9 3717
-> 7 0 6 3715
-> 7 0 1 3415
-> 7 0 3 759
-> 7 0 9 684
-> 7 0 9 602
-> 7 0 9 662
-> 7 0 9 584
-> 7 0 9 722
-> 7 0 7 628
-> 7 0 9 644
-> 7 0 7 580
-> 7 0 9 704
-> 7 0 9 564
-> 7 0 9 626
-> 7 0 7 664
-> 7 0 7 748
-> 7 0 7 616
-> 7 0 9 686
-> 7 0 7 700
-> 7 0 9 746
-> 7 0 7 652
-> 7 0 9 542
-> 7 0 7 736
-> 7 0 9 603
-> 7 0 9 566
-> 7 0 9 639
-> 7 0 9 723
-> 7 0 9 591
-> 7 0 9 675
-> 7 0 7 562
-> 7 0 9 627
-> 7 0 9 711
-> 7 0 9 569
-> 7 0 9 747
-> 7 0 9 629
-> 7 0 9 689
-> 7 0 9 611
-> 7 0 7 571
-> 7 0 9 749
-> 7 0 9 555
-> 7 0 9 671
-> 7 0 9 593
-> 7 0 7 607
-> 7 0 9 731
-> 7 0 9 653
-> 7 0 7 691
-> 7 0 7 643
-> 7 0 9 713
-> 7 0 7 727
-> 7 0 7 595
-> 7 0 7 679
-> 7 0 7 715
-> 7 0 9 551
-> 7 0 9 630
-> 7 0 9 582
-> 7 0 9 666
-> 7 0 7 553
-> 7 0 9 750
-> 7 0 9 618
-> 7 0 9 702
-> 7 0 9 654
-> 7 0 9 738
-> 7 0 9 578
-> 7 0 9 546
-> 7 0 9 638
-> 7 0 7 598
-> 7 0 9 698
-> 7 0 9 620
-> 7 0 7 634
-> 7 0 9 680
-> 7 0 7 718
-> 7 0 7 586
-> 7 0 7 670
-> 7 0 9 740
-> 7 0 7 754
-> 7 0 7 622
-> 7 0 7 706
-> 7 0 7 742
-> 7 0 9 573
-> 7 0 7 544
-> 7 0 9 560
-> 7 0 9 609
-> 7 0 9 693
-> 7 0 9 645
-> 7 0 9 729
-> 7 0 9 597
-> 7 0 9 681
-> 7 0 9 717
-> 7 0 9 605
-> 7 0 9 665
-> 7 0 9 587
-> 7 0 9 725
-> 7 0 7 577
-> 7 0 9 647
-> 7 0 9 561
-> 7 0 7 661
-> 7 0 9 707
-> 7 0 7 613
-> 7 0 7 697
-> 7 0 7 649
-> 7 0 7 733
-> 7 0 9 545
-> 7 0 7 685
-> 7 0 9 600
-> 7 0 9 636
-> 7 0 9 720
-> 7 0 9 588
-> 7 0 9 672
-> 7 0 7 559
-> 7 0 9 756
-> 7 0 9 624
-> 7 0 9 708
-> 7 0 9 744
-> 7 0 9 572
-> 7 0 9 632
-> 7 0 9 758
-> 7 0 9 692
-> 7 0 7 568
-> 7 0 9 614
-> 7 0 9 552
-> 7 0 9 752
-> 7 0 9 674
-> 7 0 7 604
-> 7 0 7 688
-> 7 0 9 596
-> 7 0 9 734
-> 7 0 9 656
-> 7 0 7 640
-> 7 0 7 724
-> 7 0 7 592
-> 7 0 9 716
-> 7 0 7 676
-> 7 0 7 712
-> 7 0 12 757
-> 7 0 9 554
-> 7 0 9 579
-> 7 0 9 663
-> 7 0 7 550
-> 7 0 9 615
-> 7 0 9 699
-> 7 0 9 651
-> 7 0 9 735
-> 7 0 9 687
-> 7 0 9 599
-> 7 0 9 659
-> 7 0 9 543
-> 7 0 9 581
-> 7 0 9 719
-> 7 0 9 641
-> 7 0 9 701
-> 7 0 7 631
-> 7 0 9 623
-> 7 0 7 583
-> 7 0 9 683
-> 7 0 7 667
-> 7 0 9 567
-> 7 0 7 751
-> 7 0 7 619
-> 7 0 9 743
-> 7 0 7 703
-> 7 0 7 655
-> 7 0 7 739
-> 7 0 9 570
-> 7 0 7 541
-> 7 0 9 606
-> 7 0 9 690
-> 7 0 9 563
-> 7 0 9 642
-> 7 0 9 726
-> 7 0 9 594
-> 7 0 9 678
-> 7 0 7 565
-> 7 0 9 714
-> 7 0 9 608
-> 7 0 9 668
-> 7 0 9 590
-> 7 0 7 574
-> 7 0 7 658
-> 7 0 9 558
-> 7 0 9 728
-> 7 0 9 650
-> 7 0 7 610
-> 7 0 7 694
-> 7 0 9 710
-> 7 0 7 646
-> 7 0 7 730
-> 7 0 7 682
-> 7 0 9 548
-> 7 0 9 633
-> 7 0 9 585
-> 7 0 9 669
-> 7 0 7 556
-> 7 0 9 753
-> 7 0 9 621
-> 7 0 9 705
-> 7 0 9 657
-> 7 0 9 741
-> 7 0 9 575
-> 7 0 9 635
-> 7 0 9 549
-> 7 0 9 695
-> 7 0 9 617
-> 7 0 7 601
-> 7 0 9 755
-> 7 0 9 677
-> 7 0 7 637
-> 7 0 7 721
-> 7 0 9 737
-> 7 0 7 589
-> 7 0 7 673
-> 7 0 7 625
-> 7 0 7 709
-> 7 0 7 745
-> 7 0 9 576
-> 7 0 9 557
-> 7 0 9 660
-> 7 0 7 547
-> 7 0 9 612
-> 7 0 9 696
-> 7 0 9 648
-> 7 0 9 732
-> 7 0 6 540
-> 7 0 3 868
-> 7 0 12 867
-> 7 0 6 866
-> 7 0 3 865
-> 7 0 3 539
-> 7 0 9 792
-> 7 0 9 822
-> 7 0 9 852
-> 7 0 9 864
-> 7 0 9 766
-> 7 0 7 788
-> 7 0 9 804
-> 7 0 9 834
-> 7 0 7 848
-> 7 0 9 778
-> 7 0 7 824
-> 7 0 7 800
-> 7 0 9 816
-> 7 0 9 846
-> 7 0 7 860
-> 7 0 7 836
-> 7 0 7 812
-> 7 0 12 863
-> 7 0 9 768
-> 7 0 9 823
-> 7 0 7 764
-> 7 0 9 780
-> 7 0 9 799
-> 7 0 9 859
-> 7 0 9 835
-> 7 0 7 776
-> 7 0 9 811
-> 7 0 9 847
-> 7 0 9 789
-> 7 0 9 819
-> 7 0 9 849
-> 7 0 9 801
-> 7 0 9 769
-> 7 0 9 831
-> 7 0 7 791
-> 7 0 9 861
-> 7 0 9 813
-> 7 0 7 851
-> 7 0 9 781
-> 7 0 7 827
-> 7 0 9 843
-> 7 0 7 803
-> 7 0 7 839
-> 7 0 7 815
-> 7 0 9 765
-> 7 0 9 790
-> 7 0 9 777
-> 7 0 9 850
-> 7 0 9 826
-> 7 0 7 767
-> 7 0 9 802
-> 7 0 9 862
-> 7 0 9 838
-> 7 0 7 779
-> 7 0 9 814
-> 7 0 9 798
-> 7 0 9 828
-> 7 0 9 858
-> 7 0 9 772
-> 7 0 7 818
-> 7 0 7 794
-> 7 0 9 810
-> 7 0 9 840
-> 7 0 7 854
-> 7 0 9 784
-> 7 0 7 830
-> 7 0 7 806
-> 7 0 7 842
-> 7 0 9 762
-> 7 0 9 774
-> 7 0 9 793
-> 7 0 9 853
-> 7 0 9 829
-> 7 0 7 770
-> 7 0 9 786
-> 7 0 9 805
-> 7 0 9 841
-> 7 0 7 782
-> 7 0 9 817
-> 7 0 9 795
-> 7 0 9 763
-> 7 0 9 825
-> 7 0 9 855
-> 7 0 9 807
-> 7 0 9 775
-> 7 0 7 821
-> 7 0 9 837
-> 7 0 7 797
-> 7 0 7 857
-> 7 0 9 787
-> 7 0 7 833
-> 7 0 7 809
-> 7 0 7 845
-> 7 0 9 771
-> 7 0 9 820
-> 7 0 7 761
-> 7 0 9 796
-> 7 0 9 783
-> 7 0 9 856
-> 7 0 9 832
-> 7 0 7 773
-> 7 0 9 808
-> 7 0 9 844
-> 7 0 7 785
-> 7 0 6 760
-> 7 0 7 519
-> 7 0 9 506
-> 7 0 7 528
-> 7 0 9 518
-> 7 0 9 508
-> 7 0 9 533
-> 7 0 12 537
-> 7 0 9 520
-> 7 0 7 510
-> 7 0 7 522
-> 7 0 9 535
-> 7 0 9 509
-> 7 0 7 531
-> 7 0 9 521
-> 7 0 9 505
-> 7 0 7 501
-> 7 0 9 517
-> 7 0 9 536
-> 7 0 7 513
-> 7 0 7 525
-> 7 0 9 532
-> 7 0 9 538
-> 7 0 9 512
-> 7 0 7 534
-> 7 0 9 524
-> 7 0 9 502
-> 7 0 9 514
-> 7 0 7 504
-> 7 0 9 526
-> 7 0 7 516
-> 7 0 9 529
-> 7 0 9 503
-> 7 0 9 515
-> 7 0 9 527
-> 7 0 9 511
-> 7 0 9 530
-> 7 0 7 507
-> 7 0 9 523
-> 7 0 6 500
-> 7 0 1 499
-> 7 0 7 3373
-> 7 0 9 3320
-> 7 0 9 3332
-> 7 0 9 3381
-> 7 0 9 3357
-> 7 0 9 3344
-> 7 0 9 3393
-> 7 0 9 3369
-> 7 0 9 3405
-> 7 0 9 3347
-> 7 0 9 3377
-> 7 0 9 3407
-> 7 0 9 3321
-> 7 0 9 3359
-> 7 0 9 3389
-> 7 0 7 3376
-> 7 0 9 3333
-> 7 0 9 3371
-> 7 0 7 3382
-> 7 0 9 3401
-> 7 0 7 3388
-> 7 0 9 3345
-> 7 0 7 3394
-> 7 0 7 3400
-> 7 0 9 3329
-> 7 0 9 3348
-> 7 0 9 3408
-> 7 0 7 3322
-> 7 0 9 3384
-> 7 0 9 3341
-> 7 0 9 3360
-> 7 0 7 3328
-> 7 0 7 3334
-> 7 0 9 3396
-> 7 0 9 3372
-> 7 0 7 3340
-> 7 0 9 3356
-> 7 0 9 3324
-> 7 0 9 3386
-> 7 0 7 3346
-> 7 0 7 3352
-> 7 0 9 3368
-> 7 0 9 3336
-> 7 0 9 3398
-> 7 0 7 3358
-> 7 0 7 3364
-> 7 0 7 3370
-> 7 0 9 3326
-> 7 0 9 3351
-> 7 0 9 3338
-> 7 0 9 3387
-> 7 0 9 3363
-> 7 0 9 3399
-> 7 0 9 3375
-> 7 0 9 3353
-> 7 0 9 3383
-> 7 0 9 3327
-> 7 0 9 3365
-> 7 0 7 3379
-> 7 0 9 3395
-> 7 0 9 3339
-> 7 0 7 3385
-> 7 0 7 3391
-> 7 0 7 3397
-> 7 0 7 3403
-> 7 0 9 3323
-> 7 0 9 3378
-> 7 0 7 3319
-> 7 0 9 3335
-> 7 0 9 3354
-> 7 0 7 3325
-> 7 0 9 3390
-> 7 0 7 3331
-> 7 0 9 3366
-> 7 0 7 3337
-> 7 0 9 3402
-> 7 0 7 3343
-> 7 0 9 3350
-> 7 0 12 3409
-> 7 0 9 3380
-> 7 0 9 3410
-> 7 0 9 3362
-> 7 0 9 3330
-> 7 0 7 3349
-> 7 0 9 3392
-> 7 0 7 3406
-> 7 0 7 3355
-> 7 0 9 3374
-> 7 0 9 3342
-> 7 0 7 3361
-> 7 0 9 3404
-> 7 0 7 3367
-> 7 0 6 3318
-> 7 0 12 3413
-> 7 0 6 3412
-> 7 0 3 3317
-> 7 0 3 3414
-> 7 0 16 3155
-> 7 0 16 3131
-> 7 0 16 3107
-> 7 0 16 3191
-> 7 0 16 3167
-> 7 0 16 3143
-> 7 0 14 3144
-> 7 0 14 3093
-> 7 0 16 3121
-> 7 0 14 3150
-> 7 0 14 3099
-> 7 0 16 3151
-> 7 0 14 3156
-> 7 0 16 3181
-> 7 0 16 3103
-> 7 0 14 3105
-> 7 0 16 3133
-> 7 0 14 3162
-> 7 0 14 3111
-> 7 0 16 3163
-> 7 0 14 3168
-> 7 0 16 3193
-> 7 0 16 3146
-> 7 0 16 3122
-> 7 0 16 3098
-> 7 0 16 3182
-> 7 0 16 3158
-> 7 0 16 3134
-> 7 0 16 3110
-> 7 0 16 3194
-> 7 0 16 3170
-> 7 0 14 3114
-> 7 0 16 3118
-> 7 0 14 3120
-> 7 0 16 3148
-> 7 0 14 3177
-> 7 0 14 3126
-> 7 0 16 3178
-> 7 0 16 3100
-> 7 0 14 3183
-> 7 0 16 3130
-> 7 0 14 3132
-> 7 0 16 3160
-> 7 0 14 3189
-> 7 0 14 3138
-> 7 0 16 3190
-> 7 0 16 3112
-> 7 0 14 3195
-> 7 0 16 3142
-> 7 0 16 3172
-> 7 0 16 3149
-> 7 0 16 3125
-> 7 0 16 3101
-> 7 0 16 3185
-> 7 0 16 3161
-> 7 0 16 3137
-> 7 0 16 3113
-> 7 0 16 3197
-> 7 0 16 3173
-> 7 0 16 3115
-> 7 0 16 3145
-> 7 0 14 3147
-> 7 0 14 3096
-> 7 0 16 3175
-> 7 0 16 3097
-> 7 0 14 3153
-> 7 0 19 3201
-> 7 0 14 3102
-> 7 0 16 3127
-> 7 0 16 3157
-> 7 0 14 3159
-> 7 0 14 3108
-> 7 0 16 3187
-> 7 0 16 3109
-> 7 0 14 3165
-> 7 0 16 3139
-> 7 0 16 3169
-> 7 0 14 3171
-> 7 0 16 3199
-> 7 0 16 3202
-> 7 0 16 3116
-> 7 0 16 3176
-> 7 0 16 3152
-> 7 0 16 3128
-> 7 0 16 3104
-> 7 0 16 3188
-> 7 0 16 3164
-> 7 0 16 3140
-> 7 0 16 3200
-> 7 0 14 3117
-> 7 0 14 3174
-> 7 0 16 3094
-> 7 0 14 3123
-> 7 0 16 3124
-> 7 0 14 3180
-> 7 0 14 3129
-> 7 0 16 3154
-> 7 0 16 3184
-> 7 0 14 3186
-> 7 0 16 3106
-> 7 0 14 3135
-> 7 0 16 3136
-> 7 0 14 3192
-> 7 0 14 3141
-> 7 0 16 3166
-> 7 0 16 3196
-> 7 0 14 3198
-> 7 0 16 3119
-> 7 0 16 3095
-> 7 0 16 3179
-> 7 0 13 3092
-> 7 0 9 3316
-> 7 0 16 3278
-> 7 0 16 3290
-> 7 0 16 3274
-> 7 0 16 3286
-> 7 0 16 3281
-> 7 0 14 3273
-> 7 0 14 3279
-> 7 0 14 3285
-> 7 0 16 3283
-> 7 0 16 3284
-> 7 0 16 3280
-> 7 0 16 3275
-> 7 0 14 3276
-> 7 0 16 3287
-> 7 0 14 3282
-> 7 0 14 3288
-> 7 0 16 3277
-> 7 0 19 3291
-> 7 0 16 3289
-> 7 0 16 3292
-> 7 0 13 3272
-> 7 0 14 2352
-> 7 0 16 2371
-> 7 0 16 2444
-> 7 0 16 2420
-> 7 0 14 2358
-> 7 0 16 2396
-> 7 0 14 2364
-> 7 0 16 2456
-> 7 0 16 2432
-> 7 0 14 2370
-> 7 0 16 2408
-> 7 0 14 2376
-> 7 0 16 2386
-> 7 0 16 2416
-> 7 0 16 2446
-> 7 0 16 2360
-> 7 0 16 2398
-> 7 0 16 2428
-> 7 0 14 2412
-> 7 0 16 2458
-> 7 0 16 2372
-> 7 0 14 2418
-> 7 0 14 2424
-> 7 0 14 2430
-> 7 0 14 2436
-> 7 0 16 2356
-> 7 0 16 2411
-> 7 0 16 2368
-> 7 0 16 2387
-> 7 0 16 2447
-> 7 0 16 2423
-> 7 0 16 2399
-> 7 0 19 2460
-> 7 0 16 2459
-> 7 0 16 2435
-> 7 0 16 2383
-> 7 0 16 2413
-> 7 0 16 2443
-> 7 0 16 2461
-> 7 0 16 2395
-> 7 0 16 2363
-> 7 0 16 2425
-> 7 0 14 2382
-> 7 0 16 2455
-> 7 0 14 2439
-> 7 0 14 2388
-> 7 0 16 2407
-> 7 0 16 2375
-> 7 0 16 2437
-> 7 0 14 2445
-> 7 0 14 2394
-> 7 0 14 2451
-> 7 0 14 2400
-> 7 0 14 2457
-> 7 0 14 2406
-> 7 0 16 2353
-> 7 0 16 2365
-> 7 0 16 2414
-> 7 0 16 2390
-> 7 0 14 2355
-> 7 0 16 2377
-> 7 0 16 2450
-> 7 0 14 2361
-> 7 0 16 2426
-> 7 0 16 2402
-> 7 0 14 2367
-> 7 0 14 2373
-> 7 0 16 2438
-> 7 0 16 2380
-> 7 0 16 2410
-> 7 0 16 2440
-> 7 0 16 2354
-> 7 0 16 2392
-> 7 0 16 2422
-> 7 0 16 2452
-> 7 0 16 2366
-> 7 0 14 2409
-> 7 0 16 2404
-> 7 0 14 2415
-> 7 0 16 2434
-> 7 0 16 2378
-> 7 0 14 2421
-> 7 0 14 2427
-> 7 0 14 2433
-> 7 0 16 2362
-> 7 0 16 2381
-> 7 0 16 2441
-> 7 0 16 2417
-> 7 0 16 2374
-> 7 0 16 2393
-> 7 0 16 2453
-> 7 0 16 2429
-> 7 0 16 2405
-> 7 0 16 2389
-> 7 0 16 2357
-> 7 0 16 2419
-> 7 0 16 2449
-> 7 0 14 2379
-> 7 0 16 2401
-> 7 0 16 2369
-> 7 0 14 2385
-> 7 0 16 2431
-> 7 0 14 2442
-> 7 0 14 2391
-> 7 0 14 2448
-> 7 0 14 2397
-> 7 0 14 2454
-> 7 0 14 2403
-> 7 0 16 2359
-> 7 0 16 2384
-> 7 0 13 2351
-> 7 0 14 2592
-> 7 0 16 2665
-> 7 0 14 2649
-> 7 0 16 2677
-> 7 0 16 2600
-> 7 0 16 2576
-> 7 0 16 2636
-> 7 0 16 2612
-> 7 0 16 2588
-> 7 0 16 2648
-> 7 0 16 2624
-> 7 0 16 2660
-> 7 0 16 2596
-> 7 0 16 2626
-> 7 0 16 2672
-> 7 0 16 2578
-> 7 0 14 2595
-> 7 0 16 2608
-> 7 0 16 2638
-> 7 0 14 2601
-> 7 0 16 2590
-> 7 0 14 2607
-> 7 0 16 2620
-> 7 0 16 2650
-> 7 0 14 2613
-> 7 0 16 2662
-> 7 0 14 2619
-> 7 0 14 2658
-> 7 0 16 2674
-> 7 0 14 2664
-> 7 0 14 2670
-> 7 0 16 2627
-> 7 0 14 2676
-> 7 0 16 2603
-> 7 0 16 2579
-> 7 0 16 2639
-> 7 0 16 2615
-> 7 0 16 2591
-> 7 0 16 2651
-> 7 0 16 2663
-> 7 0 16 2575
-> 7 0 16 2675
-> 7 0 16 2605
-> 7 0 16 2635
-> 7 0 16 2587
-> 7 0 14 2628
-> 7 0 14 2577
-> 7 0 16 2617
-> 7 0 14 2634
-> 7 0 16 2647
-> 7 0 14 2583
-> 7 0 14 2640
-> 7 0 16 2659
-> 7 0 14 2589
-> 7 0 14 2646
-> 7 0 14 2652
-> 7 0 16 2671
-> 7 0 16 2630
-> 7 0 16 2606
-> 7 0 16 2582
-> 7 0 16 2642
-> 7 0 16 2618
-> 7 0 16 2594
-> 7 0 16 2654
-> 7 0 16 2666
-> 7 0 16 2602
-> 7 0 16 2632
-> 7 0 16 2678
-> 7 0 16 2584
-> 7 0 14 2598
-> 7 0 16 2614
-> 7 0 14 2604
-> 7 0 16 2644
-> 7 0 14 2610
-> 7 0 16 2656
-> 7 0 14 2616
-> 7 0 14 2622
-> 7 0 14 2655
-> 7 0 16 2668
-> 7 0 14 2661
-> 7 0 14 2667
-> 7 0 16 2680
-> 7 0 16 2597
-> 7 0 14 2673
-> 7 0 19 2682
-> 7 0 14 2679
-> 7 0 16 2633
-> 7 0 16 2609
-> 7 0 16 2585
-> 7 0 16 2645
-> 7 0 16 2621
-> 7 0 16 2657
-> 7 0 16 2683
-> 7 0 16 2669
-> 7 0 16 2599
-> 7 0 16 2629
-> 7 0 16 2581
-> 7 0 16 2681
-> 7 0 16 2611
-> 7 0 14 2625
-> 7 0 14 2574
-> 7 0 16 2641
-> 7 0 14 2631
-> 7 0 14 2580
-> 7 0 16 2593
-> 7 0 16 2623
-> 7 0 14 2637
-> 7 0 14 2586
-> 7 0 16 2653
-> 7 0 14 2643
-> 7 0 13 2573
-> 7 0 16 2867
-> 7 0 14 2814
-> 7 0 16 2821
-> 7 0 16 2851
-> 7 0 14 2871
-> 7 0 14 2820
-> 7 0 16 2881
-> 7 0 16 2803
-> 7 0 14 2877
-> 7 0 14 2826
-> 7 0 16 2833
-> 7 0 16 2863
-> 7 0 14 2883
-> 7 0 14 2832
-> 7 0 16 2893
-> 7 0 14 2889
-> 7 0 14 2838
-> 7 0 14 2895
-> 7 0 16 2846
-> 7 0 16 2822
-> 7 0 16 2798
-> 7 0 16 2882
-> 7 0 16 2858
-> 7 0 16 2834
-> 7 0 16 2810
-> 7 0 16 2894
-> 7 0 16 2870
-> 7 0 16 2818
-> 7 0 14 2841
-> 7 0 16 2848
-> 7 0 16 2878
-> 7 0 16 2800
-> 7 0 14 2847
-> 7 0 19 2904
-> 7 0 14 2796
-> 7 0 16 2830
-> 7 0 14 2853
-> 7 0 16 2860
-> 7 0 14 2802
-> 7 0 16 2890
-> 7 0 14 2859
-> 7 0 14 2808
-> 7 0 14 2865
-> 7 0 16 2905
-> 7 0 16 2813
-> 7 0 16 2873
-> 7 0 16 2849
-> 7 0 16 2825
-> 7 0 16 2801
-> 7 0 16 2885
-> 7 0 16 2861
-> 7 0 16 2837
-> 7 0 16 2897
-> 7 0 16 2815
-> 7 0 14 2811
-> 7 0 16 2845
-> 7 0 16 2875
-> 7 0 16 2797
-> 7 0 14 2817
-> 7 0 16 2827
-> 7 0 14 2874
-> 7 0 14 2823
-> 7 0 16 2857
-> 7 0 14 2880
-> 7 0 16 2887
-> 7 0 16 2809
-> 7 0 14 2829
-> 7 0 16 2839
-> 7 0 14 2886
-> 7 0 14 2835
-> 7 0 16 2869
-> 7 0 14 2892
-> 7 0 16 2899
-> 7 0 14 2898
-> 7 0 16 2816
-> 7 0 16 2876
-> 7 0 16 2852
-> 7 0 16 2828
-> 7 0 16 2804
-> 7 0 16 2888
-> 7 0 16 2864
-> 7 0 16 2840
-> 7 0 16 2900
-> 7 0 16 2812
-> 7 0 16 2842
-> 7 0 16 2872
-> 7 0 16 2902
-> 7 0 16 2824
-> 7 0 14 2844
-> 7 0 16 2854
-> 7 0 14 2901
-> 7 0 14 2850
-> 7 0 16 2884
-> 7 0 14 2799
-> 7 0 16 2806
-> 7 0 16 2836
-> 7 0 14 2856
-> 7 0 14 2805
-> 7 0 16 2866
-> 7 0 14 2862
-> 7 0 16 2896
-> 7 0 14 2868
-> 7 0 16 2843
-> 7 0 16 2819
-> 7 0 16 2903
-> 7 0 16 2879
-> 7 0 16 2855
-> 7 0 16 2831
-> 7 0 16 2807
-> 7 0 16 2891
-> 7 0 13 2795
-> 7 0 16 3020
-> 7 0 16 3080
-> 7 0 16 2992
-> 7 0 14 3021
-> 7 0 16 3022
-> 7 0 16 3052
-> 7 0 14 3027
-> 7 0 16 3082
-> 7 0 16 3004
-> 7 0 14 3084
-> 7 0 14 3033
-> 7 0 16 3034
-> 7 0 14 2982
-> 7 0 16 3064
-> 7 0 16 2986
-> 7 0 14 3039
-> 7 0 14 2988
-> 7 0 16 3016
-> 7 0 14 3045
-> 7 0 16 3046
-> 7 0 16 3076
-> 7 0 16 3023
-> 7 0 16 2999
-> 7 0 16 3083
-> 7 0 16 3059
-> 7 0 16 3035
-> 7 0 16 3011
-> 7 0 16 2987
-> 7 0 16 3071
-> 7 0 16 3047
-> 7 0 14 2991
-> 7 0 14 2997
-> 7 0 16 3001
-> 7 0 14 3054
-> 7 0 14 3003
-> 7 0 16 3031
-> 7 0 14 3060
-> 7 0 16 3061
-> 7 0 16 2983
-> 7 0 14 3009
-> 7 0 16 3013
-> 7 0 14 3066
-> 7 0 14 3015
-> 7 0 16 3043
-> 7 0 14 3072
-> 7 0 16 3073
-> 7 0 14 3078
-> 7 0 16 3026
-> 7 0 16 3002
-> 7 0 16 3086
-> 7 0 16 3062
-> 7 0 16 3038
-> 7 0 16 3014
-> 7 0 16 2990
-> 7 0 16 3074
-> 7 0 16 3050
-> 7 0 16 2998
-> 7 0 14 3024
-> 7 0 16 3028
-> 7 0 14 3081
-> 7 0 14 3030
-> 7 0 16 3058
-> 7 0 14 3087
-> 7 0 16 3088
-> 7 0 16 3010
-> 7 0 14 3036
-> 7 0 14 2985
-> 7 0 16 3040
-> 7 0 14 3042
-> 7 0 16 3070
-> 7 0 14 3048
-> 7 0 16 2993
-> 7 0 16 3053
-> 7 0 16 3029
-> 7 0 16 3005
-> 7 0 16 3089
-> 7 0 16 3065
-> 7 0 16 3041
-> 7 0 16 3017
-> 7 0 16 3077
-> 7 0 14 2994
-> 7 0 16 2995
-> 7 0 16 3025
-> 7 0 14 3051
-> 7 0 14 3000
-> 7 0 16 3055
-> 7 0 14 3057
-> 7 0 16 3085
-> 7 0 14 3006
-> 7 0 16 3007
-> 7 0 16 3037
-> 7 0 14 3063
-> 7 0 14 3012
-> 7 0 16 3067
-> 7 0 19 3090
-> 7 0 16 2989
-> 7 0 14 3069
-> 7 0 14 3018
-> 7 0 16 3019
-> 7 0 16 3049
-> 7 0 14 3075
-> 7 0 16 3079
-> 7 0 16 3091
-> 7 0 16 2996
-> 7 0 16 3056
-> 7 0 16 3032
-> 7 0 16 3008
-> 7 0 16 2984
-> 7 0 16 3068
-> 7 0 16 3044
-> 7 0 13 2981
-> 7 0 16 3305
-> 7 0 14 3306
-> 7 0 16 3295
-> 7 0 16 3308
-> 7 0 16 3296
-> 7 0 14 3294
-> 7 0 14 3300
-> 7 0 16 3310
-> 7 0 14 3303
-> 7 0 16 3311
-> 7 0 14 3309
-> 7 0 16 3299
-> 7 0 16 3307
-> 7 0 19 3312
-> 7 0 16 3301
-> 7 0 16 3313
-> 7 0 16 3302
-> 7 0 14 3297
-> 7 0 16 3304
-> 7 0 16 3298
-> 7 0 13 3293
-> 7 0 16 3227
-> 7 0 16 3244
-> 7 0 16 3256
-> 7 0 16 3211
-> 7 0 14 3210
-> 7 0 14 3216
-> 7 0 16 3223
-> 7 0 14 3222
-> 7 0 16 3205
-> 7 0 14 3228
-> 7 0 16 3235
-> 7 0 14 3234
-> 7 0 16 3269
-> 7 0 16 3245
-> 7 0 16 3257
-> 7 0 16 3218
-> 7 0 16 3241
-> 7 0 16 3230
-> 7 0 16 3206
-> 7 0 14 3240
-> 7 0 14 3246
-> 7 0 16 3253
-> 7 0 14 3252
-> 7 0 16 3208
-> 7 0 14 3258
-> 7 0 16 3265
-> 7 0 14 3264
-> 7 0 16 3220
-> 7 0 16 3232
-> 7 0 14 3204
-> 7 0 16 3248
-> 7 0 16 3260
-> 7 0 16 3209
-> 7 0 16 3221
-> 7 0 16 3238
-> 7 0 16 3268
-> 7 0 16 3233
-> 7 0 14 3267
-> 7 0 16 3250
-> 7 0 16 3262
-> 7 0 19 3270
-> 7 0 14 3207
-> 7 0 16 3217
-> 7 0 14 3213
-> 7 0 14 3219
-> 7 0 16 3229
-> 7 0 14 3225
-> 7 0 16 3271
-> 7 0 14 3231
-> 7 0 16 3239
-> 7 0 16 3251
-> 7 0 16 3263
-> 7 0 16 3212
-> 7 0 16 3224
-> 7 0 14 3237
-> 7 0 16 3247
-> 7 0 16 3236
-> 7 0 14 3243
-> 7 0 14 3249
-> 7 0 16 3259
-> 7 0 14 3255
-> 7 0 16 3214
-> 7 0 14 3261
-> 7 0 16 3226
-> 7 0 16 3242
-> 7 0 16 3254
-> 7 0 16 3266
-> 7 0 16 3215
-> 7 0 13 3203
-> 7 0 19 3315
-> 7 0 13 3314
-> 7 0 16 2474
-> 7 0 16 2534
-> 7 0 16 2510
-> 7 0 16 2486
-> 7 0 19 2571
-> 7 0 16 2570
-> 7 0 16 2546
-> 7 0 16 2522
-> 7 0 16 2498
-> 7 0 16 2558
-> 7 0 16 2572
-> 7 0 16 2482
-> 7 0 16 2512
-> 7 0 14 2472
-> 7 0 16 2542
-> 7 0 16 2464
-> 7 0 14 2478
-> 7 0 16 2494
-> 7 0 16 2524
-> 7 0 14 2535
-> 7 0 14 2484
-> 7 0 16 2554
-> 7 0 14 2541
-> 7 0 14 2490
-> 7 0 14 2547
-> 7 0 14 2496
-> 7 0 14 2553
-> 7 0 14 2559
-> 7 0 16 2477
-> 7 0 16 2537
-> 7 0 16 2513
-> 7 0 16 2489
-> 7 0 16 2465
-> 7 0 16 2549
-> 7 0 16 2525
-> 7 0 16 2501
-> 7 0 16 2561
-> 7 0 16 2479
-> 7 0 16 2509
-> 7 0 16 2539
-> 7 0 16 2569
-> 7 0 16 2491
-> 7 0 14 2505
-> 7 0 16 2521
-> 7 0 16 2551
-> 7 0 14 2562
-> 7 0 14 2511
-> 7 0 14 2568
-> 7 0 14 2517
-> 7 0 14 2466
-> 7 0 14 2523
-> 7 0 14 2529
-> 7 0 16 2504
-> 7 0 16 2480
-> 7 0 16 2564
-> 7 0 16 2540
-> 7 0 16 2516
-> 7 0 16 2492
-> 7 0 16 2468
-> 7 0 16 2552
-> 7 0 16 2528
-> 7 0 16 2476
-> 7 0 16 2506
-> 7 0 16 2536
-> 7 0 16 2566
-> 7 0 16 2488
-> 7 0 14 2475
-> 7 0 16 2518
-> 7 0 14 2532
-> 7 0 16 2548
-> 7 0 16 2470
-> 7 0 14 2481
-> 7 0 16 2500
-> 7 0 14 2538
-> 7 0 14 2487
-> 7 0 16 2530
-> 7 0 14 2544
-> 7 0 16 2560
-> 7 0 14 2493
-> 7 0 14 2550
-> 7 0 14 2499
-> 7 0 14 2556
-> 7 0 16 2507
-> 7 0 16 2483
-> 7 0 16 2567
-> 7 0 16 2543
-> 7 0 16 2519
-> 7 0 16 2495
-> 7 0 16 2471
-> 7 0 16 2555
-> 7 0 16 2531
-> 7 0 16 2473
-> 7 0 16 2503
-> 7 0 16 2533
-> 7 0 16 2563
-> 7 0 16 2485
-> 7 0 16 2515
-> 7 0 14 2502
-> 7 0 16 2545
-> 7 0 16 2467
-> 7 0 16 2497
-> 7 0 14 2508
-> 7 0 16 2527
-> 7 0 14 2565
-> 7 0 14 2514
-> 7 0 16 2557
-> 7 0 14 2463
-> 7 0 14 2520
-> 7 0 14 2469
-> 7 0 14 2526
-> 7 0 13 2462
-> 7 0 16 2692
-> 7 0 16 2722
-> 7 0 16 2752
-> 7 0 14 2691
-> 7 0 16 2782
-> 7 0 16 2704
-> 7 0 14 2748
-> 7 0 14 2697
-> 7 0 16 2734
-> 7 0 14 2754
-> 7 0 16 2764
-> 7 0 16 2686
-> 7 0 14 2703
-> 7 0 16 2716
-> 7 0 14 2760
-> 7 0 14 2709
-> 7 0 16 2746
-> 7 0 14 2766
-> 7 0 16 2776
-> 7 0 14 2715
-> 7 0 14 2772
-> 7 0 16 2723
-> 7 0 16 2699
-> 7 0 16 2783
-> 7 0 16 2759
-> 7 0 16 2735
-> 7 0 16 2711
-> 7 0 16 2687
-> 7 0 16 2771
-> 7 0 16 2747
-> 7 0 16 2689
-> 7 0 16 2719
-> 7 0 16 2749
-> 7 0 16 2779
-> 7 0 16 2701
-> 7 0 14 2718
-> 7 0 16 2731
-> 7 0 14 2724
-> 7 0 16 2761
-> 7 0 14 2781
-> 7 0 16 2791
-> 7 0 16 2713
-> 7 0 14 2730
-> 7 0 16 2743
-> 7 0 14 2787
-> 7 0 14 2736
-> 7 0 16 2773
-> 7 0 14 2685
-> 7 0 14 2742
-> 7 0 16 2690
-> 7 0 16 2750
-> 7 0 16 2726
-> 7 0 16 2702
-> 7 0 16 2786
-> 7 0 16 2762
-> 7 0 16 2738
-> 7 0 16 2714
-> 7 0 16 2774
-> 7 0 14 2688
-> 7 0 16 2698
-> 7 0 16 2728
-> 7 0 14 2694
-> 7 0 16 2758
-> 7 0 14 2751
-> 7 0 16 2788
-> 7 0 14 2700
-> 7 0 16 2710
-> 7 0 16 2740
-> 7 0 14 2757
-> 7 0 14 2706
-> 7 0 16 2770
-> 7 0 19 2793
-> 7 0 14 2763
-> 7 0 14 2712
-> 7 0 14 2769
-> 7 0 14 2775
-> 7 0 16 2794
-> 7 0 16 2693
-> 7 0 16 2753
-> 7 0 16 2729
-> 7 0 16 2705
-> 7 0 16 2789
-> 7 0 16 2765
-> 7 0 16 2741
-> 7 0 16 2717
-> 7 0 16 2777
-> 7 0 16 2695
-> 7 0 16 2725
-> 7 0 16 2755
-> 7 0 14 2721
-> 7 0 16 2785
-> 7 0 16 2707
-> 7 0 14 2778
-> 7 0 14 2727
-> 7 0 16 2737
-> 7 0 16 2767
-> 7 0 14 2784
-> 7 0 14 2733
-> 7 0 14 2790
-> 7 0 14 2739
-> 7 0 14 2745
-> 7 0 16 2720
-> 7 0 16 2696
-> 7 0 16 2780
-> 7 0 16 2756
-> 7 0 16 2732
-> 7 0 16 2708
-> 7 0 16 2792
-> 7 0 16 2768
-> 7 0 16 2744
-> 7 0 13 2684
-> 7 0 16 2918
-> 7 0 16 2935
-> 7 0 14 2961
-> 7 0 16 2965
-> 7 0 14 2967
-> 7 0 16 2947
-> 7 0 14 2973
-> 7 0 16 2977
-> 7 0 19 2979
-> 7 0 14 2907
-> 7 0 16 2914
-> 7 0 14 2913
-> 7 0 14 2919
-> 7 0 16 2926
-> 7 0 14 2925
-> 7 0 16 2980
-> 7 0 16 2960
-> 7 0 16 2936
-> 7 0 16 2972
-> 7 0 16 2948
-> 7 0 16 2909
-> 7 0 16 2932
-> 7 0 16 2921
-> 7 0 14 2931
-> 7 0 16 2962
-> 7 0 14 2937
-> 7 0 16 2944
-> 7 0 14 2943
-> 7 0 16 2974
-> 7 0 14 2949
-> 7 0 16 2956
-> 7 0 14 2955
-> 7 0 16 2911
-> 7 0 16 2923
-> 7 0 16 2963
-> 7 0 16 2939
-> 7 0 16 2975
-> 7 0 16 2951
-> 7 0 16 2912
-> 7 0 16 2929
-> 7 0 16 2959
-> 7 0 14 2958
-> 7 0 16 2924
-> 7 0 16 2941
-> 7 0 14 2964
-> 7 0 16 2971
-> 7 0 14 2970
-> 7 0 16 2953
-> 7 0 14 2976
-> 7 0 16 2908
-> 7 0 14 2910
-> 7 0 14 2916
-> 7 0 16 2920
-> 7 0 14 2922
-> 7 0 16 2930
-> 7 0 16 2966
-> 7 0 16 2942
-> 7 0 16 2978
-> 7 0 16 2954
-> 7 0 16 2915
-> 7 0 14 2928
-> 7 0 14 2934
-> 7 0 16 2938
-> 7 0 16 2927
-> 7 0 16 2968
-> 7 0 14 2940
-> 7 0 14 2946
-> 7 0 16 2950
-> 7 0 14 2952
-> 7 0 16 2917
-> 7 0 16 2933
-> 7 0 16 2969
-> 7 0 16 2945
-> 7 0 16 2957
-> 7 0 13 2906
-> 7 0 6 2350
-> 7 0 3 3411
-> 7 0 1 2349
-> 7 0 9 2054
-> 7 0 19 2053
-> 7 0 13 2052
-> 7 0 16 1718
-> 7 0 14 1636
-> 7 0 19 1726
-> 7 0 14 1642
-> 7 0 14 1699
-> 7 0 14 1648
-> 7 0 14 1705
-> 7 0 16 1616
-> 7 0 14 1654
-> 7 0 14 1711
-> 7 0 16 1641
-> 7 0 14 1660
-> 7 0 14 1717
-> 7 0 16 1628
-> 7 0 16 1701
-> 7 0 16 1677
-> 7 0 14 1723
-> 7 0 16 1653
-> 7 0 16 1713
-> 7 0 16 1689
-> 7 0 16 1665
-> 7 0 16 1725
-> 7 0 16 1643
-> 7 0 16 1673
-> 7 0 16 1703
-> 7 0 16 1617
-> 7 0 16 1655
-> 7 0 16 1685
-> 7 0 16 1715
-> 7 0 16 1629
-> 7 0 14 1669
-> 7 0 14 1675
-> 7 0 16 1613
-> 7 0 14 1681
-> 7 0 16 1668
-> 7 0 14 1687
-> 7 0 16 1625
-> 7 0 16 1644
-> 7 0 14 1693
-> 7 0 16 1704
-> 7 0 16 1680
-> 7 0 16 1656
-> 7 0 16 1716
-> 7 0 14 1609
-> 7 0 16 1692
-> 7 0 14 1615
-> 7 0 14 1621
-> 7 0 16 1640
-> 7 0 14 1627
-> 7 0 16 1670
-> 7 0 16 1700
-> 7 0 16 1727
-> 7 0 14 1633
-> 7 0 16 1652
-> 7 0 16 1620
-> 7 0 16 1682
-> 7 0 16 1712
-> 7 0 16 1664
-> 7 0 16 1632
-> 7 0 16 1694
-> 7 0 16 1724
-> 7 0 14 1639
-> 7 0 14 1696
-> 7 0 14 1645
-> 7 0 16 1610
-> 7 0 14 1702
-> 7 0 14 1651
-> 7 0 14 1708
-> 7 0 14 1657
-> 7 0 16 1622
-> 7 0 14 1714
-> 7 0 14 1663
-> 7 0 16 1671
-> 7 0 16 1647
-> 7 0 14 1720
-> 7 0 16 1634
-> 7 0 16 1707
-> 7 0 16 1683
-> 7 0 16 1659
-> 7 0 16 1719
-> 7 0 16 1695
-> 7 0 16 1637
-> 7 0 16 1667
-> 7 0 16 1697
-> 7 0 16 1611
-> 7 0 16 1649
-> 7 0 16 1679
-> 7 0 16 1709
-> 7 0 16 1623
-> 7 0 16 1661
-> 7 0 16 1691
-> 7 0 16 1721
-> 7 0 16 1635
-> 7 0 14 1666
-> 7 0 14 1672
-> 7 0 14 1678
-> 7 0 16 1619
-> 7 0 16 1638
-> 7 0 14 1684
-> 7 0 14 1690
-> 7 0 16 1698
-> 7 0 16 1674
-> 7 0 16 1631
-> 7 0 16 1650
-> 7 0 16 1710
-> 7 0 16 1686
-> 7 0 16 1662
-> 7 0 14 1612
-> 7 0 16 1722
-> 7 0 14 1618
-> 7 0 14 1624
-> 7 0 14 1630
-> 7 0 16 1646
-> 7 0 16 1614
-> 7 0 16 1676
-> 7 0 16 1706
-> 7 0 16 1658
-> 7 0 16 1626
-> 7 0 16 1688
-> 7 0 13 1608
-> 7 0 16 1826
-> 7 0 16 1748
-> 7 0 16 1778
-> 7 0 16 1808
-> 7 0 14 1759
-> 7 0 14 1765
-> 7 0 14 1822
-> 7 0 14 1771
-> 7 0 14 1828
-> 7 0 14 1777
-> 7 0 16 1761
-> 7 0 14 1783
-> 7 0 16 1737
-> 7 0 16 1821
-> 7 0 16 1797
-> 7 0 16 1773
-> 7 0 16 1749
-> 7 0 16 1833
-> 7 0 16 1809
-> 7 0 16 1785
-> 7 0 16 1733
-> 7 0 16 1763
-> 7 0 16 1793
-> 7 0 16 1823
-> 7 0 16 1745
-> 7 0 16 1775
-> 7 0 16 1805
-> 7 0 16 1757
-> 7 0 19 1834
-> 7 0 16 1787
-> 7 0 14 1729
-> 7 0 16 1817
-> 7 0 14 1735
-> 7 0 14 1792
-> 7 0 14 1741
-> 7 0 14 1798
-> 7 0 14 1747
-> 7 0 14 1804
-> 7 0 14 1753
-> 7 0 14 1810
-> 7 0 16 1764
-> 7 0 16 1740
-> 7 0 14 1816
-> 7 0 16 1824
-> 7 0 16 1800
-> 7 0 16 1776
-> 7 0 16 1752
-> 7 0 16 1812
-> 7 0 16 1788
-> 7 0 16 1730
-> 7 0 16 1760
-> 7 0 16 1790
-> 7 0 16 1820
-> 7 0 16 1742
-> 7 0 16 1772
-> 7 0 16 1802
-> 7 0 16 1832
-> 7 0 16 1754
-> 7 0 16 1784
-> 7 0 16 1814
-> 7 0 14 1762
-> 7 0 14 1819
-> 7 0 14 1768
-> 7 0 14 1825
-> 7 0 14 1774
-> 7 0 14 1831
-> 7 0 16 1731
-> 7 0 14 1780
-> 7 0 14 1786
-> 7 0 16 1791
-> 7 0 16 1767
-> 7 0 16 1743
-> 7 0 16 1827
-> 7 0 16 1803
-> 7 0 16 1779
-> 7 0 16 1755
-> 7 0 16 1815
-> 7 0 16 1835
-> 7 0 16 1739
-> 7 0 16 1769
-> 7 0 16 1799
-> 7 0 16 1829
-> 7 0 16 1751
-> 7 0 16 1781
-> 7 0 16 1811
-> 7 0 14 1732
-> 7 0 14 1789
-> 7 0 14 1738
-> 7 0 14 1795
-> 7 0 14 1744
-> 7 0 14 1801
-> 7 0 14 1750
-> 7 0 14 1807
-> 7 0 16 1734
-> 7 0 14 1756
-> 7 0 14 1813
-> 7 0 16 1794
-> 7 0 16 1770
-> 7 0 16 1746
-> 7 0 16 1830
-> 7 0 16 1806
-> 7 0 16 1782
-> 7 0 16 1758
-> 7 0 16 1818
-> 7 0 16 1736
-> 7 0 16 1766
-> 7 0 16 1796
-> 7 0 13 1728
-> 7 0 16 1926
-> 7 0 16 1856
-> 7 0 16 1886
-> 7 0 16 1838
-> 7 0 16 1868
-> 7 0 16 1898
-> 7 0 16 1850
-> 7 0 16 1880
-> 7 0 16 1910
-> 7 0 14 1882
-> 7 0 16 1922
-> 7 0 14 1888
-> 7 0 14 1837
-> 7 0 14 1894
-> 7 0 14 1843
-> 7 0 14 1900
-> 7 0 14 1849
-> 7 0 14 1906
-> 7 0 16 1857
-> 7 0 14 1915
-> 7 0 14 1921
-> 7 0 16 1893
-> 7 0 16 1869
-> 7 0 16 1845
-> 7 0 16 1905
-> 7 0 16 1881
-> 7 0 16 1917
-> 7 0 16 1853
-> 7 0 16 1883
-> 7 0 16 1865
-> 7 0 16 1895
-> 7 0 16 1847
-> 7 0 16 1877
-> 7 0 16 1907
-> 7 0 14 1852
-> 7 0 16 1919
-> 7 0 14 1858
-> 7 0 14 1864
-> 7 0 14 1870
-> 7 0 14 1876
-> 7 0 16 1884
-> 7 0 16 1860
-> 7 0 16 1896
-> 7 0 16 1872
-> 7 0 16 1848
-> 7 0 16 1908
-> 7 0 16 1920
-> 7 0 16 1862
-> 7 0 16 1892
-> 7 0 19 1927
-> 7 0 16 1844
-> 7 0 16 1874
-> 7 0 16 1904
-> 7 0 16 1916
-> 7 0 14 1885
-> 7 0 14 1891
-> 7 0 14 1840
-> 7 0 14 1897
-> 7 0 14 1846
-> 7 0 14 1903
-> 7 0 14 1912
-> 7 0 14 1909
-> 7 0 16 1887
-> 7 0 14 1918
-> 7 0 16 1863
-> 7 0 16 1839
-> 7 0 14 1924
-> 7 0 16 1899
-> 7 0 16 1875
-> 7 0 16 1851
-> 7 0 16 1911
-> 7 0 16 1923
-> 7 0 16 1859
-> 7 0 16 1889
-> 7 0 16 1841
-> 7 0 16 1871
-> 7 0 16 1901
-> 7 0 16 1913
-> 7 0 14 1855
-> 7 0 14 1861
-> 7 0 16 1925
-> 7 0 14 1867
-> 7 0 14 1873
-> 7 0 16 1854
-> 7 0 14 1879
-> 7 0 16 1890
-> 7 0 16 1866
-> 7 0 16 1842
-> 7 0 16 1902
-> 7 0 16 1878
-> 7 0 16 1914
-> 7 0 16 1928
-> 7 0 13 1836
-> 7 0 16 2007
-> 7 0 16 1959
-> 7 0 16 2043
-> 7 0 16 1995
-> 7 0 16 2031
-> 7 0 16 1955
-> 7 0 16 2015
-> 7 0 16 1937
-> 7 0 16 1997
-> 7 0 14 1975
-> 7 0 14 2038
-> 7 0 14 1987
-> 7 0 14 1936
-> 7 0 14 1999
-> 7 0 16 2051
-> 7 0 16 1950
-> 7 0 16 1986
-> 7 0 16 1938
-> 7 0 16 2022
-> 7 0 16 1974
-> 7 0 16 1982
-> 7 0 16 2042
-> 7 0 16 1964
-> 7 0 16 2024
-> 7 0 14 1951
-> 7 0 14 2014
-> 7 0 14 1963
-> 7 0 14 2026
-> 7 0 16 1977
-> 7 0 16 2013
-> 7 0 16 1965
-> 7 0 16 2049
-> 7 0 16 2001
-> 7 0 16 1949
-> 7 0 16 2009
-> 7 0 16 1931
-> 7 0 16 1991
-> 7 0 16 1973
-> 7 0 14 1978
-> 7 0 16 2033
-> 7 0 14 2041
-> 7 0 14 1990
-> 7 0 14 1939
-> 7 0 14 2002
-> 7 0 16 1956
-> 7 0 16 2040
-> 7 0 16 1992
-> 7 0 16 1944
-> 7 0 16 2028
-> 7 0 16 1976
-> 7 0 16 2036
-> 7 0 16 1958
-> 7 0 16 2018
-> 7 0 16 1940
-> 7 0 16 2000
-> 7 0 14 2005
-> 7 0 14 1954
-> 7 0 14 2017
-> 7 0 14 1966
-> 7 0 16 1947
-> 7 0 14 2029
-> 7 0 16 1983
-> 7 0 16 1935
-> 7 0 16 2019
-> 7 0 16 1971
-> 7 0 16 1985
-> 7 0 16 2045
-> 7 0 16 1967
-> 7 0 16 2027
-> 7 0 14 1981
-> 7 0 14 1930
-> 7 0 14 2044
-> 7 0 14 1993
-> 7 0 14 1942
-> 7 0 16 2010
-> 7 0 16 1962
-> 7 0 16 2046
-> 7 0 16 1998
-> 7 0 16 2034
-> 7 0 16 1952
-> 7 0 16 2012
-> 7 0 16 1934
-> 7 0 16 1994
-> 7 0 14 1945
-> 7 0 14 2008
-> 7 0 14 1957
-> 7 0 14 2020
-> 7 0 14 1969
-> 7 0 14 2032
-> 7 0 16 1953
-> 7 0 16 2037
-> 7 0 16 1989
-> 7 0 16 1941
-> 7 0 16 2025
-> 7 0 16 1979
-> 7 0 16 2039
-> 7 0 16 1961
-> 7 0 16 2021
-> 7 0 16 1943
-> 7 0 16 2003
-> 7 0 14 2035
-> 7 0 14 1984
-> 7 0 14 1933
-> 7 0 14 2047
-> 7 0 14 1996
-> 7 0 16 1980
-> 7 0 16 1932
-> 7 0 16 2016
-> 7 0 16 1968
-> 7 0 19 2050
-> 7 0 16 2004
-> 7 0 16 1946
-> 7 0 16 2006
-> 7 0 16 1988
-> 7 0 16 2048
-> 7 0 16 1970
-> 7 0 16 2030
-> 7 0 14 1948
-> 7 0 14 2011
-> 7 0 14 1960
-> 7 0 14 2023
-> 7 0 14 1972
-> 7 0 13 1929
-> 7 0 6 1607
-> 7 0 19 2343
-> 7 0 13 2342
-> 7 0 16 2110
-> 7 0 16 2140
-> 7 0 16 2081
-> 7 0 14 2085
-> 7 0 16 2146
-> 7 0 14 2091
-> 7 0 14 2097
-> 7 0 16 2065
-> 7 0 14 2103
-> 7 0 14 2109
-> 7 0 16 2117
-> 7 0 16 2093
-> 7 0 16 2077
-> 7 0 16 2129
-> 7 0 14 2145
-> 7 0 16 2153
-> 7 0 16 2105
-> 7 0 14 2058
-> 7 0 16 2141
-> 7 0 14 2064
-> 7 0 14 2070
-> 7 0 14 2076
-> 7 0 16 2060
-> 7 0 16 2095
-> 7 0 16 2155
-> 7 0 14 2082
-> 7 0 16 2125
-> 7 0 16 2072
-> 7 0 16 2107
-> 7 0 16 2137
-> 7 0 16 2084
-> 7 0 19 2154
-> 7 0 14 2118
-> 7 0 14 2124
-> 7 0 16 2062
-> 7 0 14 2130
-> 7 0 14 2136
-> 7 0 16 2074
-> 7 0 16 2120
-> 7 0 16 2096
-> 7 0 14 2142
-> 7 0 16 2132
-> 7 0 16 2108
-> 7 0 16 2144
-> 7 0 16 2092
-> 7 0 16 2122
-> 7 0 16 2063
-> 7 0 16 2104
-> 7 0 16 2134
-> 7 0 16 2075
-> 7 0 14 2088
-> 7 0 14 2094
-> 7 0 16 2059
-> 7 0 14 2100
-> 7 0 16 2087
-> 7 0 14 2106
-> 7 0 16 2071
-> 7 0 14 2112
-> 7 0 16 2123
-> 7 0 16 2099
-> 7 0 16 2083
-> 7 0 14 2148
-> 7 0 16 2135
-> 7 0 16 2111
-> 7 0 14 2061
-> 7 0 14 2067
-> 7 0 16 2147
-> 7 0 14 2073
-> 7 0 16 2089
-> 7 0 16 2119
-> 7 0 14 2079
-> 7 0 16 2066
-> 7 0 16 2101
-> 7 0 16 2131
-> 7 0 16 2078
-> 7 0 16 2113
-> 7 0 16 2143
-> 7 0 14 2115
-> 7 0 16 2149
-> 7 0 14 2121
-> 7 0 14 2127
-> 7 0 14 2151
-> 7 0 16 2068
-> 7 0 14 2133
-> 7 0 16 2090
-> 7 0 14 2139
-> 7 0 16 2080
-> 7 0 16 2126
-> 7 0 16 2102
-> 7 0 16 2138
-> 7 0 16 2114
-> 7 0 16 2086
-> 7 0 16 2150
-> 7 0 16 2116
-> 7 0 16 2098
-> 7 0 16 2128
-> 7 0 16 2152
-> 7 0 16 2069
-> 7 0 13 2057
-> 7 0 16 2227
-> 7 0 16 2179
-> 7 0 16 2209
-> 7 0 16 2239
-> 7 0 14 2160
-> 7 0 14 2217
-> 7 0 14 2166
-> 7 0 14 2223
-> 7 0 14 2172
-> 7 0 14 2229
-> 7 0 14 2178
-> 7 0 14 2235
-> 7 0 16 2162
-> 7 0 14 2184
-> 7 0 16 2222
-> 7 0 16 2198
-> 7 0 16 2174
-> 7 0 16 2234
-> 7 0 16 2210
-> 7 0 16 2186
-> 7 0 16 2164
-> 7 0 16 2194
-> 7 0 16 2224
-> 7 0 16 2176
-> 7 0 16 2206
-> 7 0 16 2236
-> 7 0 14 2187
-> 7 0 14 2193
-> 7 0 14 2199
-> 7 0 14 2205
-> 7 0 16 2189
-> 7 0 14 2211
-> 7 0 16 2165
-> 7 0 16 2225
-> 7 0 16 2201
-> 7 0 16 2177
-> 7 0 16 2237
-> 7 0 16 2213
-> 7 0 16 2161
-> 7 0 16 2242
-> 7 0 16 2191
-> 7 0 16 2221
-> 7 0 16 2173
-> 7 0 16 2203
-> 7 0 16 2233
-> 7 0 16 2185
-> 7 0 16 2215
-> 7 0 14 2157
-> 7 0 19 2241
-> 7 0 14 2163
-> 7 0 14 2220
-> 7 0 14 2169
-> 7 0 14 2226
-> 7 0 14 2175
-> 7 0 14 2232
-> 7 0 14 2181
-> 7 0 14 2238
-> 7 0 16 2192
-> 7 0 16 2168
-> 7 0 16 2228
-> 7 0 16 2204
-> 7 0 16 2180
-> 7 0 16 2240
-> 7 0 16 2216
-> 7 0 16 2158
-> 7 0 16 2188
-> 7 0 16 2218
-> 7 0 16 2170
-> 7 0 16 2200
-> 7 0 16 2230
-> 7 0 16 2182
-> 7 0 16 2212
-> 7 0 14 2190
-> 7 0 14 2196
-> 7 0 14 2202
-> 7 0 16 2159
-> 7 0 14 2208
-> 7 0 14 2214
-> 7 0 16 2219
-> 7 0 16 2195
-> 7 0 16 2171
-> 7 0 16 2231
-> 7 0 16 2207
-> 7 0 16 2183
-> 7 0 16 2167
-> 7 0 16 2197
-> 7 0 13 2156
-> 7 0 16 2248
-> 7 0 16 2278
-> 7 0 16 2308
-> 7 0 16 2338
-> 7 0 16 2260
-> 7 0 16 2290
-> 7 0 16 2320
-> 7 0 14 2274
-> 7 0 14 2331
-> 7 0 14 2280
-> 7 0 14 2337
-> 7 0 14 2286
-> 7 0 14 2292
-> 7 0 16 2273
-> 7 0 14 2298
-> 7 0 16 2249
-> 7 0 16 2333
-> 7 0 16 2309
-> 7 0 16 2285
-> 7 0 16 2261
-> 7 0 16 2321
-> 7 0 16 2297
-> 7 0 16 2245
-> 7 0 16 2275
-> 7 0 16 2305
-> 7 0 16 2335
-> 7 0 16 2257
-> 7 0 16 2287
-> 7 0 16 2317
-> 7 0 16 2269
-> 7 0 16 2299
-> 7 0 14 2244
-> 7 0 16 2329
-> 7 0 14 2301
-> 7 0 14 2250
-> 7 0 14 2307
-> 7 0 14 2256
-> 7 0 14 2313
-> 7 0 14 2262
-> 7 0 14 2319
-> 7 0 14 2268
-> 7 0 14 2325
-> 7 0 16 2276
-> 7 0 16 2252
-> 7 0 16 2336
-> 7 0 16 2312
-> 7 0 16 2288
-> 7 0 16 2264
-> 7 0 16 2324
-> 7 0 16 2300
-> 7 0 16 2272
-> 7 0 16 2302
-> 7 0 16 2332
-> 7 0 16 2254
-> 7 0 16 2284
-> 7 0 16 2314
-> 7 0 16 2266
-> 7 0 16 2296
-> 7 0 16 2326
-> 7 0 14 2271
-> 7 0 14 2277
-> 7 0 14 2334
-> 7 0 14 2283
-> 7 0 14 2289
-> 7 0 14 2295
-> 7 0 16 2303
-> 7 0 16 2279
-> 7 0 16 2255
-> 7 0 16 2339
-> 7 0 16 2315
-> 7 0 16 2291
-> 7 0 16 2267
-> 7 0 16 2327
-> 7 0 16 2341
-> 7 0 16 2251
-> 7 0 16 2281
-> 7 0 16 2311
-> 7 0 16 2263
-> 7 0 16 2293
-> 7 0 19 2340
-> 7 0 16 2323
-> 7 0 14 2247
-> 7 0 14 2304
-> 7 0 14 2253
-> 7 0 14 2310
-> 7 0 14 2259
-> 7 0 14 2316
-> 7 0 14 2265
-> 7 0 14 2322
-> 7 0 16 2246
-> 7 0 14 2328
-> 7 0 16 2306
-> 7 0 16 2282
-> 7 0 16 2258
-> 7 0 16 2318
-> 7 0 16 2294
-> 7 0 16 2270
-> 7 0 16 2330
-> 7 0 13 2243
-> 7 0 9 2344
-> 7 0 6 2056
-> 7 0 12 2347
-> 7 0 6 2346
-> 7 0 3 2345
-> 7 0 3 2348
-> 7 0 3 2055
-> 7 0 1 1606
-> 7 0 3 461
-> 7 0 3 495
-> 7 0 9 470
-> 7 0 9 482
-> 7 0 7 469
-> 7 0 9 471
-> 7 0 7 481
-> 7 0 9 483
-> 7 0 12 493
-> 7 0 9 467
-> 7 0 7 490
-> 7 0 9 479
-> 7 0 9 494
-> 7 0 7 472
-> 7 0 9 474
-> 7 0 7 484
-> 7 0 9 486
-> 7 0 9 464
-> 7 0 9 476
-> 7 0 9 488
-> 7 0 9 491
-> 7 0 7 463
-> 7 0 9 465
-> 7 0 7 475
-> 7 0 9 477
-> 7 0 7 487
-> 7 0 9 489
-> 7 0 9 473
-> 7 0 9 492
-> 7 0 9 485
-> 7 0 7 466
-> 7 0 9 468
-> 7 0 7 478
-> 7 0 9 480
-> 7 0 6 462
-> 7 0 3 178
-> 7 0 9 111
-> 7 0 9 141
-> 7 0 9 28
-> 7 0 9 63
-> 7 0 9 171
-> 7 0 7 35
-> 7 0 9 93
-> 7 0 9 123
-> 7 0 9 153
-> 7 0 9 40
-> 7 0 9 75
-> 7 0 7 47
-> 7 0 9 105
-> 7 0 9 135
-> 7 0 9 165
-> 7 0 9 24
-> 7 0 7 83
-> 7 0 9 36
-> 7 0 7 59
-> 7 0 9 82
-> 7 0 9 58
-> 7 0 7 143
-> 7 0 7 119
-> 7 0 9 142
-> 7 0 7 95
-> 7 0 9 118
-> 7 0 9 48
-> 7 0 7 71
-> 7 0 9 94
-> 7 0 9 70
-> 7 0 7 155
-> 7 0 7 131
-> 7 0 9 154
-> 7 0 7 107
-> 7 0 9 130
-> 7 0 9 106
-> 7 0 7 167
-> 7 0 9 166
-> 7 0 7 26
-> 7 0 9 60
-> 7 0 9 177
-> 7 0 9 90
-> 7 0 9 31
-> 7 0 9 120
-> 7 0 7 38
-> 7 0 9 150
-> 7 0 9 72
-> 7 0 9 102
-> 7 0 9 43
-> 7 0 9 132
-> 7 0 9 162
-> 7 0 7 50
-> 7 0 9 33
-> 7 0 7 110
-> 7 0 7 86
-> 7 0 7 62
-> 7 0 9 85
-> 7 0 7 170
-> 7 0 9 61
-> 7 0 7 146
-> 7 0 9 45
-> 7 0 7 122
-> 7 0 9 145
-> 7 0 7 98
-> 7 0 9 121
-> 7 0 7 74
-> 7 0 9 97
-> 7 0 9 73
-> 7 0 7 158
-> 7 0 7 134
-> 7 0 9 157
-> 7 0 9 133
-> 7 0 9 109
-> 7 0 9 169
-> 7 0 9 57
-> 7 0 7 29
-> 7 0 9 87
-> 7 0 9 117
-> 7 0 9 147
-> 7 0 9 34
-> 7 0 9 69
-> 7 0 7 41
-> 7 0 9 99
-> 7 0 9 129
-> 7 0 9 159
-> 7 0 9 46
-> 7 0 9 30
-> 7 0 7 53
-> 7 0 9 52
-> 7 0 7 113
-> 7 0 7 89
-> 7 0 9 112
-> 7 0 9 42
-> 7 0 7 65
-> 7 0 9 88
-> 7 0 7 173
-> 7 0 9 64
-> 7 0 7 149
-> 7 0 9 172
-> 7 0 7 125
-> 7 0 9 148
-> 7 0 7 101
-> 7 0 9 124
-> 7 0 7 77
-> 7 0 9 100
-> 7 0 9 76
-> 7 0 7 161
-> 7 0 7 137
-> 7 0 9 160
-> 7 0 9 136
-> 7 0 9 54
-> 7 0 9 84
-> 7 0 9 25
-> 7 0 9 114
-> 7 0 7 32
-> 7 0 9 144
-> 7 0 9 66
-> 7 0 9 174
-> 7 0 9 96
-> 7 0 9 37
-> 7 0 9 126
-> 7 0 7 44
-> 7 0 9 156
-> 7 0 9 78
-> 7 0 9 108
-> 7 0 9 49
-> 7 0 9 138
-> 7 0 9 168
-> 7 0 9 27
-> 7 0 7 80
-> 7 0 7 56
-> 7 0 9 55
-> 7 0 7 140
-> 7 0 9 39
-> 7 0 7 116
-> 7 0 7 92
-> 7 0 9 115
-> 7 0 7 68
-> 7 0 9 91
-> 7 0 9 67
-> 7 0 7 152
-> 7 0 9 175
-> 7 0 12 176
-> 7 0 7 128
-> 7 0 9 151
-> 7 0 7 104
-> 7 0 9 127
-> 7 0 9 103
-> 7 0 9 79
-> 7 0 7 164
-> 7 0 9 163
-> 7 0 9 139
-> 7 0 9 51
-> 7 0 7 23
-> 7 0 9 81
-> 7 0 6 22
-> 7 0 3 498
-> 7 0 12 497
-> 7 0 6 496
-> 7 0 9 377
-> 7 0 7 441
-> 7 0 7 180
-> 7 0 9 413
-> 7 0 9 241
-> 7 0 9 301
-> 7 0 9 223
-> 7 0 9 361
-> 7 0 9 194
-> 7 0 9 283
-> 7 0 9 421
-> 7 0 7 204
-> 7 0 9 343
-> 7 0 9 265
-> 7 0 9 403
-> 7 0 9 325
-> 7 0 9 385
-> 7 0 9 445
-> 7 0 7 240
-> 7 0 9 212
-> 7 0 9 196
-> 7 0 7 276
-> 7 0 9 248
-> 7 0 7 360
-> 7 0 7 228
-> 7 0 9 332
-> 7 0 7 312
-> 7 0 9 284
-> 7 0 7 396
-> 7 0 7 264
-> 7 0 9 368
-> 7 0 9 236
-> 7 0 7 348
-> 7 0 9 452
-> 7 0 9 320
-> 7 0 7 432
-> 7 0 9 404
-> 7 0 7 384
-> 7 0 9 208
-> 7 0 9 356
-> 7 0 9 440
-> 7 0 9 268
-> 7 0 9 185
-> 7 0 9 328
-> 7 0 9 250
-> 7 0 7 195
-> 7 0 9 388
-> 7 0 9 310
-> 7 0 9 232
-> 7 0 9 448
-> 7 0 9 370
-> 7 0 9 292
-> 7 0 9 430
-> 7 0 9 352
-> 7 0 9 412
-> 7 0 9 181
-> 7 0 7 267
-> 7 0 9 239
-> 7 0 7 219
-> 7 0 7 303
-> 7 0 9 275
-> 7 0 7 387
-> 7 0 9 205
-> 7 0 7 255
-> 7 0 9 359
-> 7 0 9 227
-> 7 0 7 339
-> 7 0 9 311
-> 7 0 7 423
-> 7 0 7 291
-> 7 0 9 395
-> 7 0 9 263
-> 7 0 7 375
-> 7 0 9 347
-> 7 0 9 431
-> 7 0 7 411
-> 7 0 9 383
-> 7 0 7 186
-> 7 0 9 217
-> 7 0 9 277
-> 7 0 9 337
-> 7 0 9 259
-> 7 0 9 200
-> 7 0 9 397
-> 7 0 9 319
-> 7 0 9 457
-> 7 0 9 379
-> 7 0 9 439
-> 7 0 7 210
-> 7 0 9 190
-> 7 0 7 246
-> 7 0 9 218
-> 7 0 7 330
-> 7 0 9 302
-> 7 0 7 282
-> 7 0 9 254
-> 7 0 7 366
-> 7 0 7 234
-> 7 0 9 338
-> 7 0 7 450
-> 7 0 7 318
-> 7 0 9 422
-> 7 0 9 290
-> 7 0 7 402
-> 7 0 9 374
-> 7 0 7 354
-> 7 0 9 458
-> 7 0 9 326
-> 7 0 7 438
-> 7 0 9 410
-> 7 0 9 244
-> 7 0 9 446
-> 7 0 9 304
-> 7 0 9 191
-> 7 0 9 226
-> 7 0 9 364
-> 7 0 7 201
-> 7 0 9 286
-> 7 0 9 424
-> 7 0 9 346
-> 7 0 9 406
-> 7 0 7 237
-> 7 0 9 209
-> 7 0 7 273
-> 7 0 9 199
-> 7 0 9 245
-> 7 0 7 357
-> 7 0 7 225
-> 7 0 9 329
-> 7 0 7 309
-> 7 0 9 281
-> 7 0 7 393
-> 7 0 7 261
-> 7 0 9 365
-> 7 0 9 233
-> 7 0 7 345
-> 7 0 9 449
-> 7 0 9 317
-> 7 0 7 429
-> 7 0 9 401
-> 7 0 7 381
-> 7 0 9 353
-> 7 0 9 437
-> 7 0 9 211
-> 7 0 9 271
-> 7 0 9 182
-> 7 0 9 331
-> 7 0 7 192
-> 7 0 9 253
-> 7 0 9 391
-> 7 0 9 313
-> 7 0 9 235
-> 7 0 9 451
-> 7 0 9 373
-> 7 0 9 295
-> 7 0 9 206
-> 7 0 9 433
-> 7 0 9 355
-> 7 0 9 415
-> 7 0 9 184
-> 7 0 7 216
-> 7 0 7 300
-> 7 0 9 272
-> 7 0 7 252
-> 7 0 7 336
-> 7 0 9 224
-> 7 0 9 308
-> 7 0 7 420
-> 7 0 7 288
-> 7 0 9 392
-> 7 0 7 372
-> 7 0 9 260
-> 7 0 9 344
-> 7 0 7 456
-> 7 0 7 324
-> 7 0 9 428
-> 7 0 9 296
-> 7 0 7 408
-> 7 0 9 380
-> 7 0 9 238
-> 7 0 7 444
-> 7 0 7 183
-> 7 0 9 416
-> 7 0 9 298
-> 7 0 9 220
-> 7 0 9 358
-> 7 0 9 280
-> 7 0 9 418
-> 7 0 9 340
-> 7 0 9 197
-> 7 0 9 262
-> 7 0 9 400
-> 7 0 9 322
-> 7 0 9 382
-> 7 0 9 442
-> 7 0 7 207
-> 7 0 7 243
-> 7 0 9 193
-> 7 0 7 327
-> 7 0 9 215
-> 7 0 9 299
-> 7 0 7 279
-> 7 0 7 363
-> 7 0 9 251
-> 7 0 9 335
-> 7 0 7 231
-> 7 0 7 447
-> 7 0 7 315
-> 7 0 9 419
-> 7 0 9 287
-> 7 0 7 399
-> 7 0 9 371
-> 7 0 7 351
-> 7 0 9 455
-> 7 0 9 323
-> 7 0 7 435
-> 7 0 9 407
-> 7 0 9 443
-> 7 0 9 460
-> 7 0 9 247
-> 7 0 9 188
-> 7 0 9 307
-> 7 0 9 229
-> 7 0 7 198
-> 7 0 9 367
-> 7 0 9 289
-> 7 0 9 427
-> 7 0 9 349
-> 7 0 9 409
-> 7 0 7 270
-> 7 0 9 242
-> 7 0 7 222
-> 7 0 7 306
-> 7 0 9 202
-> 7 0 9 278
-> 7 0 7 390
-> 7 0 9 362
-> 7 0 7 258
-> 7 0 7 342
-> 7 0 9 230
-> 7 0 9 314
-> 7 0 7 426
-> 7 0 7 294
-> 7 0 9 398
-> 7 0 12 459
-> 7 0 7 378
-> 7 0 9 266
-> 7 0 9 350
-> 7 0 9 434
-> 7 0 7 414
-> 7 0 9 386
-> 7 0 9 214
-> 7 0 9 274
-> 7 0 7 189
-> 7 0 9 334
-> 7 0 9 256
-> 7 0 9 394
-> 7 0 9 316
-> 7 0 9 203
-> 7 0 9 454
-> 7 0 9 376
-> 7 0 9 436
-> 7 0 9 187
-> 7 0 7 213
-> 7 0 7 297
-> 7 0 9 269
-> 7 0 7 249
-> 7 0 7 333
-> 7 0 9 221
-> 7 0 9 305
-> 7 0 7 417
-> 7 0 7 285
-> 7 0 9 389
-> 7 0 7 369
-> 7 0 9 257
-> 7 0 9 341
-> 7 0 7 453
-> 7 0 7 321
-> 7 0 9 425
-> 7 0 9 293
-> 7 0 7 405
-> 7 0 6 179
-> 7 0 1 21
-> 7 0 3 1602
-> 7 0 9 1475
-> 7 0 9 1535
-> 7 0 7 1375
-> 7 0 9 1595
-> 7 0 9 1376
-> 7 0 9 1422
-> 7 0 9 1458
-> 7 0 9 1542
-> 7 0 9 1410
-> 7 0 9 1494
-> 7 0 7 1423
-> 7 0 9 1578
-> 7 0 7 1399
-> 7 0 9 1446
-> 7 0 9 1530
-> 7 0 7 1543
-> 7 0 7 1519
-> 7 0 9 1566
-> 7 0 7 1495
-> 7 0 7 1471
-> 7 0 9 1400
-> 7 0 7 1447
-> 7 0 9 1371
-> 7 0 9 1460
-> 7 0 7 1591
-> 7 0 9 1520
-> 7 0 7 1567
-> 7 0 9 1442
-> 7 0 9 1580
-> 7 0 9 1502
-> 7 0 9 1562
-> 7 0 7 1378
-> 7 0 9 1401
-> 7 0 9 1385
-> 7 0 9 1485
-> 7 0 9 1437
-> 7 0 9 1521
-> 7 0 7 1450
-> 7 0 7 1426
-> 7 0 9 1473
-> 7 0 7 1402
-> 7 0 9 1557
-> 7 0 9 1509
-> 7 0 7 1570
-> 7 0 7 1546
-> 7 0 9 1593
-> 7 0 7 1522
-> 7 0 7 1498
-> 7 0 9 1427
-> 7 0 7 1474
-> 7 0 9 1487
-> 7 0 9 1409
-> 7 0 9 1547
-> 7 0 7 1594
-> 7 0 9 1469
-> 7 0 9 1386
-> 7 0 9 1529
-> 7 0 9 1589
-> 7 0 7 1381
-> 7 0 9 1370
-> 7 0 9 1392
-> 7 0 9 1428
-> 7 0 9 1512
-> 7 0 9 1464
-> 7 0 9 1548
-> 7 0 9 1416
-> 7 0 7 1453
-> 7 0 9 1500
-> 7 0 7 1429
-> 7 0 9 1584
-> 7 0 7 1405
-> 7 0 9 1536
-> 7 0 7 1573
-> 7 0 9 1394
-> 7 0 7 1549
-> 7 0 7 1525
-> 7 0 9 1454
-> 7 0 7 1501
-> 7 0 7 1477
-> 7 0 9 1514
-> 7 0 9 1436
-> 7 0 9 1377
-> 7 0 9 1574
-> 7 0 9 1496
-> 7 0 7 1597
-> 7 0 9 1418
-> 7 0 9 1556
-> 7 0 9 1478
-> 7 0 9 1538
-> 7 0 9 1598
-> 7 0 7 1384
-> 7 0 9 1379
-> 7 0 9 1455
-> 7 0 9 1407
-> 7 0 12 1600
-> 7 0 9 1491
-> 7 0 9 1575
-> 7 0 9 1443
-> 7 0 7 1480
-> 7 0 9 1527
-> 7 0 7 1456
-> 7 0 7 1432
-> 7 0 9 1479
-> 7 0 7 1408
-> 7 0 9 1563
-> 7 0 9 1421
-> 7 0 7 1576
-> 7 0 7 1552
-> 7 0 9 1599
-> 7 0 9 1481
-> 7 0 7 1528
-> 7 0 9 1368
-> 7 0 9 1403
-> 7 0 7 1504
-> 7 0 9 1541
-> 7 0 9 1463
-> 7 0 9 1523
-> 7 0 7 1363
-> 7 0 9 1445
-> 7 0 9 1583
-> 7 0 9 1505
-> 7 0 9 1565
-> 7 0 9 1364
-> 7 0 7 1387
-> 7 0 9 1398
-> 7 0 9 1482
-> 7 0 9 1434
-> 7 0 9 1388
-> 7 0 9 1518
-> 7 0 9 1470
-> 7 0 9 1554
-> 7 0 7 1483
-> 7 0 7 1459
-> 7 0 9 1506
-> 7 0 7 1435
-> 7 0 9 1590
-> 7 0 7 1411
-> 7 0 7 1579
-> 7 0 7 1555
-> 7 0 9 1601
-> 7 0 9 1430
-> 7 0 7 1531
-> 7 0 7 1507
-> 7 0 9 1490
-> 7 0 9 1412
-> 7 0 9 1550
-> 7 0 9 1472
-> 7 0 9 1383
-> 7 0 7 1366
-> 7 0 9 1532
-> 7 0 9 1592
-> 7 0 9 1373
-> 7 0 9 1425
-> 7 0 9 1461
-> 7 0 7 1390
-> 7 0 9 1545
-> 7 0 9 1413
-> 7 0 9 1497
-> 7 0 9 1581
-> 7 0 9 1449
-> 7 0 7 1510
-> 7 0 7 1486
-> 7 0 9 1533
-> 7 0 7 1462
-> 7 0 7 1438
-> 7 0 7 1414
-> 7 0 9 1569
-> 7 0 9 1397
-> 7 0 7 1582
-> 7 0 9 1457
-> 7 0 7 1558
-> 7 0 7 1534
-> 7 0 9 1374
-> 7 0 9 1517
-> 7 0 9 1439
-> 7 0 9 1577
-> 7 0 9 1499
-> 7 0 7 1369
-> 7 0 9 1559
-> 7 0 9 1452
-> 7 0 9 1382
-> 7 0 9 1404
-> 7 0 9 1488
-> 7 0 9 1572
-> 7 0 9 1440
-> 7 0 7 1393
-> 7 0 9 1524
-> 7 0 9 1476
-> 7 0 7 1513
-> 7 0 9 1560
-> 7 0 7 1489
-> 7 0 7 1465
-> 7 0 7 1441
-> 7 0 9 1596
-> 7 0 9 1424
-> 7 0 7 1417
-> 7 0 9 1365
-> 7 0 9 1484
-> 7 0 7 1585
-> 7 0 9 1406
-> 7 0 7 1561
-> 7 0 7 1537
-> 7 0 9 1544
-> 7 0 9 1466
-> 7 0 9 1526
-> 7 0 9 1448
-> 7 0 9 1389
-> 7 0 9 1586
-> 7 0 7 1372
-> 7 0 9 1508
-> 7 0 9 1568
-> 7 0 9 1367
-> 7 0 9 1395
-> 7 0 9 1431
-> 7 0 9 1515
-> 7 0 9 1467
-> 7 0 7 1420
-> 7 0 7 1396
-> 7 0 9 1551
-> 7 0 9 1419
-> 7 0 9 1503
-> 7 0 7 1540
-> 7 0 9 1587
-> 7 0 7 1516
-> 7 0 7 1492
-> 7 0 9 1391
-> 7 0 9 1539
-> 7 0 7 1468
-> 7 0 9 1451
-> 7 0 7 1444
-> 7 0 9 1511
-> 7 0 9 1433
-> 7 0 7 1588
-> 7 0 7 1564
-> 7 0 9 1571
-> 7 0 9 1493
-> 7 0 9 1415
-> 7 0 9 1380
-> 7 0 9 1553
-> 7 0 6 1362
-> 7 0 3 1605
-> 7 0 12 1604
-> 7 0 6 1603
-> 7 0 3 1361
-> 7 0 9 1204
-> 7 0 9 1253
-> 7 0 9 1229
-> 7 0 9 1313
-> 7 0 9 1216
-> 7 0 9 1289
-> 7 0 9 1265
-> 7 0 7 1221
-> 7 0 9 1241
-> 7 0 9 1349
-> 7 0 9 1325
-> 7 0 7 1281
-> 7 0 9 1301
-> 7 0 7 1257
-> 7 0 9 1277
-> 7 0 7 1233
-> 7 0 7 1341
-> 7 0 7 1317
-> 7 0 9 1337
-> 7 0 9 1219
-> 7 0 7 1293
-> 7 0 9 1249
-> 7 0 7 1269
-> 7 0 7 1245
-> 7 0 9 1279
-> 7 0 7 1353
-> 7 0 9 1193
-> 7 0 9 1309
-> 7 0 7 1329
-> 7 0 9 1231
-> 7 0 7 1305
-> 7 0 9 1339
-> 7 0 9 1261
-> 7 0 9 1291
-> 7 0 9 1205
-> 7 0 9 1321
-> 7 0 9 1243
-> 7 0 9 1351
-> 7 0 7 1191
-> 7 0 9 1273
-> 7 0 9 1303
-> 7 0 9 1217
-> 7 0 9 1333
-> 7 0 7 1203
-> 7 0 7 1215
-> 7 0 12 1359
-> 7 0 9 1201
-> 7 0 9 1220
-> 7 0 9 1280
-> 7 0 9 1256
-> 7 0 9 1213
-> 7 0 9 1232
-> 7 0 9 1340
-> 7 0 9 1316
-> 7 0 9 1292
-> 7 0 7 1248
-> 7 0 9 1268
-> 7 0 7 1224
-> 7 0 9 1244
-> 7 0 9 1352
-> 7 0 7 1308
-> 7 0 9 1328
-> 7 0 7 1284
-> 7 0 9 1304
-> 7 0 7 1260
-> 7 0 7 1236
-> 7 0 7 1344
-> 7 0 7 1320
-> 7 0 7 1296
-> 7 0 7 1272
-> 7 0 9 1228
-> 7 0 7 1356
-> 7 0 9 1196
-> 7 0 9 1258
-> 7 0 7 1332
-> 7 0 9 1288
-> 7 0 9 1318
-> 7 0 9 1240
-> 7 0 9 1348
-> 7 0 9 1208
-> 7 0 9 1270
-> 7 0 9 1300
-> 7 0 7 1194
-> 7 0 9 1330
-> 7 0 7 1206
-> 7 0 9 1198
-> 7 0 9 1223
-> 7 0 9 1210
-> 7 0 9 1283
-> 7 0 9 1259
-> 7 0 9 1235
-> 7 0 9 1343
-> 7 0 9 1319
-> 7 0 9 1295
-> 7 0 7 1251
-> 7 0 9 1271
-> 7 0 7 1227
-> 7 0 9 1247
-> 7 0 9 1355
-> 7 0 7 1311
-> 7 0 9 1331
-> 7 0 7 1287
-> 7 0 9 1307
-> 7 0 7 1263
-> 7 0 7 1239
-> 7 0 7 1347
-> 7 0 7 1323
-> 7 0 9 1225
-> 7 0 7 1299
-> 7 0 9 1255
-> 7 0 7 1275
-> 7 0 9 1285
-> 7 0 9 1199
-> 7 0 9 1315
-> 7 0 7 1335
-> 7 0 9 1237
-> 7 0 9 1345
-> 7 0 9 1267
-> 7 0 9 1297
-> 7 0 9 1211
-> 7 0 9 1327
-> 7 0 9 1357
-> 7 0 7 1197
-> 7 0 7 1209
-> 7 0 9 1195
-> 7 0 9 1250
-> 7 0 9 1207
-> 7 0 9 1226
-> 7 0 9 1310
-> 7 0 9 1286
-> 7 0 9 1262
-> 7 0 7 1218
-> 7 0 9 1238
-> 7 0 9 1346
-> 7 0 9 1322
-> 7 0 7 1278
-> 7 0 9 1298
-> 7 0 7 1254
-> 7 0 9 1274
-> 7 0 7 1230
-> 7 0 7 1338
-> 7 0 9 1358
-> 7 0 7 1314
-> 7 0 9 1334
-> 7 0 7 1290
-> 7 0 7 1266
-> 7 0 9 1222
-> 7 0 7 1242
-> 7 0 7 1350
-> 7 0 9 1252
-> 7 0 7 1326
-> 7 0 9 1282
-> 7 0 7 1302
-> 7 0 9 1360
-> 7 0 9 1312
-> 7 0 9 1234
-> 7 0 9 1342
-> 7 0 9 1202
-> 7 0 9 1264
-> 7 0 9 1294
-> 7 0 9 1324
-> 7 0 9 1246
-> 7 0 9 1354
-> 7 0 9 1214
-> 7 0 9 1276
-> 7 0 9 1306
-> 7 0 7 1200
-> 7 0 9 1336
-> 7 0 9 1192
-> 7 0 7 1212
-> 7 0 6 1190
-> 7 0 1 1189
-> 7 0 7 1059
-> 7 0 7 1122
-> 7 0 7 1071
+> 7 0 9 177
+> 7 0 9 52
+> 7 0 9 51
+> 7 0 9 55
+> 7 0 9 54
+> 7 0 9 58
+> 7 0 9 57
+> 7 0 9 61
+> 7 0 9 60
+> 7 0 9 64
+> 7 0 9 63
+> 7 0 9 67
+> 7 0 9 66
+> 7 0 9 70
+> 7 0 9 69
+> 7 0 9 73
+> 7 0 9 72
+> 7 0 9 76
+> 7 0 9 75
+> 7 0 9 79
+> 7 0 9 78
+> 7 0 9 25
+> 7 0 9 24
+> 7 0 9 82
+> 7 0 9 81
+> 7 0 9 85
+> 7 0 9 84
+> 7 0 9 88
+> 7 0 9 87
+> 7 0 9 91
+> 7 0 9 90
+> 7 0 9 94
+> 7 0 9 93
+> 7 0 9 97
+> 7 0 9 96
+> 7 0 9 100
+> 7 0 9 99
+> 7 0 9 103
+> 7 0 9 102
+> 7 0 9 106
+> 7 0 9 105
+> 7 0 9 109
+> 7 0 9 108
+> 7 0 9 28
+> 7 0 9 27
+> 7 0 9 112
+> 7 0 9 111
+> 7 0 9 115
+> 7 0 9 114
+> 7 0 9 118
+> 7 0 9 117
+> 7 0 9 121
+> 7 0 9 120
+> 7 0 9 124
+> 7 0 9 123
+> 7 0 9 127
+> 7 0 9 126
+> 7 0 9 130
+> 7 0 9 129
+> 7 0 9 133
+> 7 0 9 132
+> 7 0 9 136
+> 7 0 9 135
+> 7 0 9 139
+> 7 0 9 138
+> 7 0 9 31
+> 7 0 9 30
+> 7 0 9 142
+> 7 0 9 141
+> 7 0 9 145
+> 7 0 9 144
+> 7 0 9 148
+> 7 0 9 147
+> 7 0 9 151
+> 7 0 9 150
+> 7 0 9 154
+> 7 0 9 153
+> 7 0 9 157
+> 7 0 9 156
+> 7 0 9 160
+> 7 0 9 159
+> 7 0 9 163
+> 7 0 9 162
+> 7 0 9 166
+> 7 0 9 165
+> 7 0 9 169
+> 7 0 9 168
+> 7 0 9 34
+> 7 0 9 33
+> 7 0 9 172
+> 7 0 9 171
+> 7 0 9 175
+> 7 0 9 174
+> 7 0 9 37
+> 7 0 9 36
+> 7 0 9 40
+> 7 0 9 39
+> 7 0 9 43
+> 7 0 9 42
+> 7 0 9 46
+> 7 0 9 45
+> 7 0 9 49
+> 7 0 9 48
+> 7 0 7 23
+> 7 0 7 50
+> 7 0 7 53
+> 7 0 7 56
+> 7 0 7 59
+> 7 0 7 62
+> 7 0 7 65
+> 7 0 7 68
+> 7 0 7 71
+> 7 0 7 74
+> 7 0 7 77
+> 7 0 7 26
+> 7 0 7 80
+> 7 0 7 83
+> 7 0 7 86
+> 7 0 7 89
+> 7 0 7 92
+> 7 0 7 95
+> 7 0 7 98
+> 7 0 7 101
+> 7 0 7 104
+> 7 0 7 107
+> 7 0 7 29
+> 7 0 7 110
+> 7 0 7 113
+> 7 0 7 116
+> 7 0 7 119
+> 7 0 7 122
+> 7 0 7 125
+> 7 0 7 128
+> 7 0 7 131
+> 7 0 7 134
+> 7 0 7 137
+> 7 0 7 32
+> 7 0 7 140
+> 7 0 7 143
+> 7 0 7 146
+> 7 0 7 149
+> 7 0 7 152
+> 7 0 7 155
+> 7 0 7 158
+> 7 0 7 161
+> 7 0 7 164
+> 7 0 7 167
+> 7 0 7 35
+> 7 0 7 170
+> 7 0 7 173
+> 7 0 7 38
+> 7 0 7 41
+> 7 0 7 44
+> 7 0 7 47
+> 7 0 12 176
+> 7 0 6 22
+> 7 0 9 460
+> 7 0 9 209
+> 7 0 9 208
+> 7 0 9 212
+> 7 0 9 211
+> 7 0 9 215
+> 7 0 9 214
+> 7 0 9 218
+> 7 0 9 217
+> 7 0 9 221
+> 7 0 9 220
+> 7 0 9 224
+> 7 0 9 223
+> 7 0 9 227
+> 7 0 9 226
+> 7 0 9 230
+> 7 0 9 229
+> 7 0 9 233
+> 7 0 9 232
+> 7 0 9 236
+> 7 0 9 235
+> 7 0 9 182
+> 7 0 9 181
+> 7 0 9 239
+> 7 0 9 238
+> 7 0 9 242
+> 7 0 9 241
+> 7 0 9 245
+> 7 0 9 244
+> 7 0 9 248
+> 7 0 9 247
+> 7 0 9 251
+> 7 0 9 250
+> 7 0 9 254
+> 7 0 9 253
+> 7 0 9 257
+> 7 0 9 256
+> 7 0 9 260
+> 7 0 9 259
+> 7 0 9 263
+> 7 0 9 262
+> 7 0 9 266
+> 7 0 9 265
+> 7 0 9 185
+> 7 0 9 184
+> 7 0 9 269
+> 7 0 9 268
+> 7 0 9 272
+> 7 0 9 271
+> 7 0 9 275
+> 7 0 9 274
+> 7 0 9 278
+> 7 0 9 277
+> 7 0 9 281
+> 7 0 9 280
+> 7 0 9 284
+> 7 0 9 283
+> 7 0 9 287
+> 7 0 9 286
+> 7 0 9 290
+> 7 0 9 289
+> 7 0 9 293
+> 7 0 9 292
+> 7 0 9 296
+> 7 0 9 295
+> 7 0 9 188
+> 7 0 9 187
+> 7 0 9 299
+> 7 0 9 298
+> 7 0 9 302
+> 7 0 9 301
+> 7 0 9 305
+> 7 0 9 304
+> 7 0 9 308
+> 7 0 9 307
+> 7 0 9 311
+> 7 0 9 310
+> 7 0 9 314
+> 7 0 9 313
+> 7 0 9 317
+> 7 0 9 316
+> 7 0 9 320
+> 7 0 9 319
+> 7 0 9 323
+> 7 0 9 322
+> 7 0 9 326
+> 7 0 9 325
+> 7 0 9 191
+> 7 0 9 190
+> 7 0 9 329
+> 7 0 9 328
+> 7 0 9 332
+> 7 0 9 331
+> 7 0 9 335
+> 7 0 9 334
+> 7 0 9 338
+> 7 0 9 337
+> 7 0 9 341
+> 7 0 9 340
+> 7 0 9 344
+> 7 0 9 343
+> 7 0 9 347
+> 7 0 9 346
+> 7 0 9 350
+> 7 0 9 349
+> 7 0 9 353
+> 7 0 9 352
+> 7 0 9 356
+> 7 0 9 355
+> 7 0 9 194
+> 7 0 9 193
+> 7 0 9 359
+> 7 0 9 358
+> 7 0 9 362
+> 7 0 9 361
+> 7 0 9 365
+> 7 0 9 364
+> 7 0 9 368
+> 7 0 9 367
+> 7 0 9 371
+> 7 0 9 370
+> 7 0 9 374
+> 7 0 9 373
+> 7 0 9 377
+> 7 0 9 376
+> 7 0 9 380
+> 7 0 9 379
+> 7 0 9 383
+> 7 0 9 382
+> 7 0 9 386
+> 7 0 9 385
+> 7 0 9 197
+> 7 0 9 196
+> 7 0 9 389
+> 7 0 9 388
+> 7 0 9 392
+> 7 0 9 391
+> 7 0 9 395
+> 7 0 9 394
+> 7 0 9 398
+> 7 0 9 397
+> 7 0 9 401
+> 7 0 9 400
+> 7 0 9 404
+> 7 0 9 403
+> 7 0 9 407
+> 7 0 9 406
+> 7 0 9 410
+> 7 0 9 409
+> 7 0 9 413
+> 7 0 9 412
+> 7 0 9 416
+> 7 0 9 415
+> 7 0 9 200
+> 7 0 9 199
+> 7 0 9 419
+> 7 0 9 418
+> 7 0 9 422
+> 7 0 9 421
+> 7 0 9 425
+> 7 0 9 424
+> 7 0 9 428
+> 7 0 9 427
+> 7 0 9 431
+> 7 0 9 430
+> 7 0 9 434
+> 7 0 9 433
+> 7 0 9 437
+> 7 0 9 436
+> 7 0 9 440
+> 7 0 9 439
+> 7 0 9 443
+> 7 0 9 442
+> 7 0 9 446
+> 7 0 9 445
+> 7 0 9 203
+> 7 0 9 202
+> 7 0 9 449
+> 7 0 9 448
+> 7 0 9 452
+> 7 0 9 451
+> 7 0 9 455
+> 7 0 9 454
+> 7 0 9 458
+> 7 0 9 457
+> 7 0 9 206
+> 7 0 9 205
+> 7 0 7 180
+> 7 0 7 207
+> 7 0 7 210
+> 7 0 7 213
+> 7 0 7 216
+> 7 0 7 219
+> 7 0 7 222
+> 7 0 7 225
+> 7 0 7 228
+> 7 0 7 231
+> 7 0 7 234
+> 7 0 7 183
+> 7 0 7 237
+> 7 0 7 240
+> 7 0 7 243
+> 7 0 7 246
+> 7 0 7 249
+> 7 0 7 252
+> 7 0 7 255
+> 7 0 7 258
+> 7 0 7 261
+> 7 0 7 264
+> 7 0 7 186
+> 7 0 7 267
+> 7 0 7 270
+> 7 0 7 273
+> 7 0 7 276
+> 7 0 7 279
+> 7 0 7 282
+> 7 0 7 285
+> 7 0 7 288
+> 7 0 7 291
+> 7 0 7 294
+> 7 0 7 189
+> 7 0 7 297
+> 7 0 7 300
+> 7 0 7 303
+> 7 0 7 306
+> 7 0 7 309
+> 7 0 7 312
+> 7 0 7 315
+> 7 0 7 318
+> 7 0 7 321
+> 7 0 7 324
+> 7 0 7 192
+> 7 0 7 327
+> 7 0 7 330
+> 7 0 7 333
+> 7 0 7 336
+> 7 0 7 339
+> 7 0 7 342
+> 7 0 7 345
+> 7 0 7 348
+> 7 0 7 351
+> 7 0 7 354
+> 7 0 7 195
+> 7 0 7 357
+> 7 0 7 360
+> 7 0 7 363
+> 7 0 7 366
+> 7 0 7 369
+> 7 0 7 372
+> 7 0 7 375
+> 7 0 7 378
+> 7 0 7 381
+> 7 0 7 384
+> 7 0 7 198
+> 7 0 7 387
+> 7 0 7 390
+> 7 0 7 393
+> 7 0 7 396
+> 7 0 7 399
+> 7 0 7 402
+> 7 0 7 405
+> 7 0 7 408
+> 7 0 7 411
+> 7 0 7 414
+> 7 0 7 201
+> 7 0 7 417
+> 7 0 7 420
+> 7 0 7 423
+> 7 0 7 426
+> 7 0 7 429
+> 7 0 7 432
+> 7 0 7 435
+> 7 0 7 438
+> 7 0 7 441
+> 7 0 7 444
+> 7 0 7 204
+> 7 0 7 447
+> 7 0 7 450
+> 7 0 7 453
+> 7 0 7 456
+> 7 0 12 459
+> 7 0 6 179
+> 7 0 9 494
+> 7 0 9 492
+> 7 0 9 491
+> 7 0 9 465
+> 7 0 9 464
+> 7 0 9 468
+> 7 0 9 467
+> 7 0 9 471
+> 7 0 9 470
+> 7 0 9 474
+> 7 0 9 473
+> 7 0 9 477
+> 7 0 9 476
+> 7 0 9 480
+> 7 0 9 479
+> 7 0 9 483
+> 7 0 9 482
+> 7 0 9 486
+> 7 0 9 485
+> 7 0 9 489
+> 7 0 9 488
+> 7 0 7 463
+> 7 0 7 490
+> 7 0 7 466
+> 7 0 7 469
+> 7 0 7 472
+> 7 0 7 475
+> 7 0 7 478
+> 7 0 7 481
+> 7 0 7 484
+> 7 0 7 487
+> 7 0 12 493
+> 7 0 6 462
+> 7 0 12 497
+> 7 0 6 496
+> 7 0 3 178
+> 7 0 3 461
+> 7 0 3 495
+> 7 0 3 498
+> 7 0 1 21
+> 7 0 9 538
+> 7 0 9 530
+> 7 0 9 529
+> 7 0 9 533
+> 7 0 9 532
+> 7 0 9 536
+> 7 0 9 535
+> 7 0 9 503
+> 7 0 9 502
+> 7 0 9 506
+> 7 0 9 505
+> 7 0 9 509
+> 7 0 9 508
+> 7 0 9 512
+> 7 0 9 511
+> 7 0 9 515
+> 7 0 9 514
+> 7 0 9 518
+> 7 0 9 517
+> 7 0 9 521
+> 7 0 9 520
+> 7 0 9 524
+> 7 0 9 523
+> 7 0 9 527
+> 7 0 9 526
+> 7 0 7 501
+> 7 0 7 528
+> 7 0 7 531
+> 7 0 7 534
+> 7 0 7 504
+> 7 0 7 507
+> 7 0 7 510
+> 7 0 7 513
+> 7 0 7 516
+> 7 0 7 519
+> 7 0 7 522
+> 7 0 7 525
+> 7 0 12 537
+> 7 0 6 500
+> 7 0 9 758
+> 7 0 9 570
+> 7 0 9 569
+> 7 0 9 573
+> 7 0 9 572
+> 7 0 9 576
+> 7 0 9 575
+> 7 0 9 579
+> 7 0 9 578
+> 7 0 9 582
+> 7 0 9 581
+> 7 0 9 585
+> 7 0 9 584
+> 7 0 9 588
+> 7 0 9 587
+> 7 0 9 591
+> 7 0 9 590
+> 7 0 9 594
+> 7 0 9 593
+> 7 0 9 597
+> 7 0 9 596
+> 7 0 9 543
+> 7 0 9 542
+> 7 0 9 600
+> 7 0 9 599
+> 7 0 9 603
+> 7 0 9 602
+> 7 0 9 606
+> 7 0 9 605
+> 7 0 9 609
+> 7 0 9 608
+> 7 0 9 612
+> 7 0 9 611
+> 7 0 9 615
+> 7 0 9 614
+> 7 0 9 618
+> 7 0 9 617
+> 7 0 9 621
+> 7 0 9 620
+> 7 0 9 624
+> 7 0 9 623
+> 7 0 9 627
+> 7 0 9 626
+> 7 0 9 546
+> 7 0 9 545
+> 7 0 9 630
+> 7 0 9 629
+> 7 0 9 633
+> 7 0 9 632
+> 7 0 9 636
+> 7 0 9 635
+> 7 0 9 639
+> 7 0 9 638
+> 7 0 9 642
+> 7 0 9 641
+> 7 0 9 645
+> 7 0 9 644
+> 7 0 9 648
+> 7 0 9 647
+> 7 0 9 651
+> 7 0 9 650
+> 7 0 9 654
+> 7 0 9 653
+> 7 0 9 657
+> 7 0 9 656
+> 7 0 9 549
+> 7 0 9 548
+> 7 0 9 660
+> 7 0 9 659
+> 7 0 9 663
+> 7 0 9 662
+> 7 0 9 666
+> 7 0 9 665
+> 7 0 9 669
+> 7 0 9 668
+> 7 0 9 672
+> 7 0 9 671
+> 7 0 9 675
+> 7 0 9 674
+> 7 0 9 678
+> 7 0 9 677
+> 7 0 9 681
+> 7 0 9 680
+> 7 0 9 684
+> 7 0 9 683
+> 7 0 9 687
+> 7 0 9 686
+> 7 0 9 552
+> 7 0 9 551
+> 7 0 9 690
+> 7 0 9 689
+> 7 0 9 693
+> 7 0 9 692
+> 7 0 9 696
+> 7 0 9 695
+> 7 0 9 699
+> 7 0 9 698
+> 7 0 9 702
+> 7 0 9 701
+> 7 0 9 705
+> 7 0 9 704
+> 7 0 9 708
+> 7 0 9 707
+> 7 0 9 711
+> 7 0 9 710
+> 7 0 9 714
+> 7 0 9 713
+> 7 0 9 717
+> 7 0 9 716
+> 7 0 9 555
+> 7 0 9 554
+> 7 0 9 720
+> 7 0 9 719
+> 7 0 9 723
+> 7 0 9 722
+> 7 0 9 726
+> 7 0 9 725
+> 7 0 9 729
+> 7 0 9 728
+> 7 0 9 732
+> 7 0 9 731
+> 7 0 9 735
+> 7 0 9 734
+> 7 0 9 738
+> 7 0 9 737
+> 7 0 9 741
+> 7 0 9 740
+> 7 0 9 744
+> 7 0 9 743
+> 7 0 9 747
+> 7 0 9 746
+> 7 0 9 558
+> 7 0 9 557
+> 7 0 9 750
+> 7 0 9 749
+> 7 0 9 753
+> 7 0 9 752
+> 7 0 9 756
+> 7 0 9 755
+> 7 0 9 561
+> 7 0 9 560
+> 7 0 9 564
+> 7 0 9 563
+> 7 0 9 567
+> 7 0 9 566
+> 7 0 7 541
+> 7 0 7 568
+> 7 0 7 571
+> 7 0 7 574
+> 7 0 7 577
+> 7 0 7 580
+> 7 0 7 583
+> 7 0 7 586
+> 7 0 7 589
+> 7 0 7 592
+> 7 0 7 595
+> 7 0 7 544
+> 7 0 7 598
+> 7 0 7 601
+> 7 0 7 604
+> 7 0 7 607
+> 7 0 7 610
+> 7 0 7 613
+> 7 0 7 616
+> 7 0 7 619
+> 7 0 7 622
+> 7 0 7 625
+> 7 0 7 547
+> 7 0 7 628
+> 7 0 7 631
+> 7 0 7 634
+> 7 0 7 637
+> 7 0 7 640
+> 7 0 7 643
+> 7 0 7 646
+> 7 0 7 649
+> 7 0 7 652
+> 7 0 7 655
+> 7 0 7 550
+> 7 0 7 658
+> 7 0 7 661
+> 7 0 7 664
+> 7 0 7 667
+> 7 0 7 670
+> 7 0 7 673
+> 7 0 7 676
+> 7 0 7 679
+> 7 0 7 682
+> 7 0 7 685
+> 7 0 7 553
+> 7 0 7 688
+> 7 0 7 691
+> 7 0 7 694
+> 7 0 7 697
+> 7 0 7 700
+> 7 0 7 703
+> 7 0 7 706
+> 7 0 7 709
+> 7 0 7 712
+> 7 0 7 715
+> 7 0 7 556
+> 7 0 7 718
+> 7 0 7 721
+> 7 0 7 724
+> 7 0 7 727
+> 7 0 7 730
+> 7 0 7 733
+> 7 0 7 736
+> 7 0 7 739
+> 7 0 7 742
+> 7 0 7 745
+> 7 0 7 559
+> 7 0 7 748
+> 7 0 7 751
+> 7 0 7 754
+> 7 0 7 562
+> 7 0 7 565
+> 7 0 12 757
+> 7 0 6 540
+> 7 0 9 864
+> 7 0 9 790
+> 7 0 9 789
+> 7 0 9 793
+> 7 0 9 792
+> 7 0 9 796
+> 7 0 9 795
+> 7 0 9 799
+> 7 0 9 798
+> 7 0 9 802
+> 7 0 9 801
+> 7 0 9 805
+> 7 0 9 804
+> 7 0 9 808
+> 7 0 9 807
+> 7 0 9 811
+> 7 0 9 810
+> 7 0 9 814
+> 7 0 9 813
+> 7 0 9 817
+> 7 0 9 816
+> 7 0 9 763
+> 7 0 9 762
+> 7 0 9 820
+> 7 0 9 819
+> 7 0 9 823
+> 7 0 9 822
+> 7 0 9 826
+> 7 0 9 825
+> 7 0 9 829
+> 7 0 9 828
+> 7 0 9 832
+> 7 0 9 831
+> 7 0 9 835
+> 7 0 9 834
+> 7 0 9 838
+> 7 0 9 837
+> 7 0 9 841
+> 7 0 9 840
+> 7 0 9 844
+> 7 0 9 843
+> 7 0 9 847
+> 7 0 9 846
+> 7 0 9 766
+> 7 0 9 765
+> 7 0 9 850
+> 7 0 9 849
+> 7 0 9 853
+> 7 0 9 852
+> 7 0 9 856
+> 7 0 9 855
+> 7 0 9 859
+> 7 0 9 858
+> 7 0 9 862
+> 7 0 9 861
+> 7 0 9 769
+> 7 0 9 768
+> 7 0 9 772
+> 7 0 9 771
+> 7 0 9 775
+> 7 0 9 774
+> 7 0 9 778
+> 7 0 9 777
+> 7 0 9 781
+> 7 0 9 780
+> 7 0 9 784
+> 7 0 9 783
+> 7 0 9 787
+> 7 0 9 786
+> 7 0 7 761
+> 7 0 7 788
+> 7 0 7 791
+> 7 0 7 794
+> 7 0 7 797
+> 7 0 7 800
+> 7 0 7 803
+> 7 0 7 806
+> 7 0 7 809
+> 7 0 7 812
+> 7 0 7 815
+> 7 0 7 764
+> 7 0 7 818
+> 7 0 7 821
+> 7 0 7 824
+> 7 0 7 827
+> 7 0 7 830
+> 7 0 7 833
+> 7 0 7 836
+> 7 0 7 839
+> 7 0 7 842
+> 7 0 7 845
+> 7 0 7 767
+> 7 0 7 848
+> 7 0 7 851
+> 7 0 7 854
+> 7 0 7 857
+> 7 0 7 860
+> 7 0 7 770
+> 7 0 7 773
+> 7 0 7 776
+> 7 0 7 779
+> 7 0 7 782
+> 7 0 7 785
+> 7 0 12 863
+> 7 0 6 760
+> 7 0 12 867
+> 7 0 6 866
+> 7 0 3 539
+> 7 0 3 759
+> 7 0 3 865
+> 7 0 3 868
+> 7 0 1 499
+> 7 0 3 16
+> 7 0 3 12
+> 7 0 3 17
+> 7 0 3 18
+> 7 0 3 19
+> 7 0 3 20
+> 7 0 3 15
+> 7 0 3 13
+> 7 0 3 14
+> 7 0 2 7
+> 7 0 2 8
+> 7 0 2 2
+> 7 0 2 6
+> 7 0 2 9
+> 7 0 2 4
+> 7 0 2 3
+> 7 0 2 5
+> 7 0 2 11
+> 7 0 2 10
+> 7 0 1 1
+> 7 0 9 950
+> 7 0 9 900
+> 7 0 9 899
+> 7 0 9 903
+> 7 0 9 902
+> 7 0 9 906
+> 7 0 9 905
+> 7 0 9 909
+> 7 0 9 908
+> 7 0 9 912
+> 7 0 9 911
+> 7 0 9 915
+> 7 0 9 914
+> 7 0 9 918
+> 7 0 9 917
+> 7 0 9 921
+> 7 0 9 920
+> 7 0 9 924
+> 7 0 9 923
+> 7 0 9 927
+> 7 0 9 926
+> 7 0 9 873
+> 7 0 9 872
+> 7 0 9 930
+> 7 0 9 929
+> 7 0 9 933
+> 7 0 9 932
+> 7 0 9 936
+> 7 0 9 935
+> 7 0 9 939
+> 7 0 9 938
+> 7 0 9 942
+> 7 0 9 941
+> 7 0 9 945
+> 7 0 9 944
+> 7 0 9 948
+> 7 0 9 947
+> 7 0 9 876
+> 7 0 9 875
+> 7 0 9 879
+> 7 0 9 878
+> 7 0 9 882
+> 7 0 9 881
+> 7 0 9 885
+> 7 0 9 884
+> 7 0 9 888
+> 7 0 9 887
+> 7 0 9 891
+> 7 0 9 890
+> 7 0 9 894
+> 7 0 9 893
+> 7 0 9 897
+> 7 0 9 896
+> 7 0 7 871
+> 7 0 7 898
+> 7 0 7 901
+> 7 0 7 904
+> 7 0 7 907
+> 7 0 7 910
+> 7 0 7 913
+> 7 0 7 916
+> 7 0 7 919
+> 7 0 7 922
+> 7 0 7 925
+> 7 0 7 874
+> 7 0 7 928
+> 7 0 7 931
+> 7 0 7 934
+> 7 0 7 937
+> 7 0 7 940
+> 7 0 7 943
+> 7 0 7 946
+> 7 0 7 877
+> 7 0 7 880
+> 7 0 7 883
+> 7 0 7 886
+> 7 0 7 889
+> 7 0 7 892
+> 7 0 7 895
+> 7 0 12 949
+> 7 0 6 870
+> 7 0 9 1014
+> 7 0 9 982
+> 7 0 9 981
+> 7 0 9 985
+> 7 0 9 984
+> 7 0 9 988
+> 7 0 9 987
+> 7 0 9 991
+> 7 0 9 990
+> 7 0 9 994
+> 7 0 9 993
+> 7 0 9 997
+> 7 0 9 996
+> 7 0 9 1000
+> 7 0 9 999
+> 7 0 9 1003
+> 7 0 9 1002
+> 7 0 9 1006
+> 7 0 9 1005
+> 7 0 9 1009
+> 7 0 9 1008
+> 7 0 9 955
+> 7 0 9 954
+> 7 0 9 1012
+> 7 0 9 1011
+> 7 0 9 958
+> 7 0 9 957
+> 7 0 9 961
+> 7 0 9 960
+> 7 0 9 964
+> 7 0 9 963
+> 7 0 9 967
+> 7 0 9 966
+> 7 0 9 970
+> 7 0 9 969
+> 7 0 9 973
+> 7 0 9 972
+> 7 0 9 976
+> 7 0 9 975
+> 7 0 9 979
+> 7 0 9 978
+> 7 0 7 953
+> 7 0 7 980
+> 7 0 7 983
+> 7 0 7 986
+> 7 0 7 989
+> 7 0 7 992
+> 7 0 7 995
+> 7 0 7 998
+> 7 0 7 1001
+> 7 0 7 1004
+> 7 0 7 1007
+> 7 0 7 956
+> 7 0 7 1010
+> 7 0 7 959
+> 7 0 7 962
+> 7 0 7 965
+> 7 0 7 968
+> 7 0 7 971
+> 7 0 7 974
+> 7 0 7 977
+> 7 0 12 1013
+> 7 0 6 952
+> 7 0 9 1156
 > 7 0 9 1046
-> 7 0 9 1036
-> 7 0 9 1082
-> 7 0 7 1017
-> 7 0 9 1118
-> 7 0 9 1070
-> 7 0 9 1154
-> 7 0 7 1029
-> 7 0 7 1041
+> 7 0 9 1045
+> 7 0 9 1049
 > 7 0 9 1048
+> 7 0 9 1052
+> 7 0 9 1051
+> 7 0 9 1055
+> 7 0 9 1054
+> 7 0 9 1058
+> 7 0 9 1057
+> 7 0 9 1061
+> 7 0 9 1060
+> 7 0 9 1064
+> 7 0 9 1063
+> 7 0 9 1067
+> 7 0 9 1066
+> 7 0 9 1070
+> 7 0 9 1069
+> 7 0 9 1073
+> 7 0 9 1072
 > 7 0 9 1019
-> 7 0 9 1108
-> 7 0 12 1155
+> 7 0 9 1018
+> 7 0 9 1076
+> 7 0 9 1075
+> 7 0 9 1079
+> 7 0 9 1078
+> 7 0 9 1082
+> 7 0 9 1081
+> 7 0 9 1085
+> 7 0 9 1084
+> 7 0 9 1088
+> 7 0 9 1087
+> 7 0 9 1091
 > 7 0 9 1090
-> 7 0 9 1150
-> 7 0 9 1072
-> 7 0 7 1074
-> 7 0 9 1043
-> 7 0 9 1132
-> 7 0 7 1137
-> 7 0 7 1086
+> 7 0 9 1094
+> 7 0 9 1093
+> 7 0 9 1097
+> 7 0 9 1096
+> 7 0 9 1100
+> 7 0 9 1099
+> 7 0 9 1103
+> 7 0 9 1102
+> 7 0 9 1022
 > 7 0 9 1021
-> 7 0 7 1149
-> 7 0 7 1098
+> 7 0 9 1106
+> 7 0 9 1105
 > 7 0 9 1109
-> 7 0 9 1061
-> 7 0 9 1145
-> 7 0 9 1097
-> 7 0 9 1133
-> 7 0 9 1075
-> 7 0 9 1135
-> 7 0 9 1057
+> 7 0 9 1108
+> 7 0 9 1112
+> 7 0 9 1111
+> 7 0 9 1115
+> 7 0 9 1114
+> 7 0 9 1118
 > 7 0 9 1117
-> 7 0 9 1034
-> 7 0 9 1099
-> 7 0 7 1050
-> 7 0 7 1113
-> 7 0 7 1062
-> 7 0 7 1125
-> 7 0 9 1030
-> 7 0 9 1052
-> 7 0 9 1136
-> 7 0 9 1088
-> 7 0 7 1020
+> 7 0 9 1121
+> 7 0 9 1120
 > 7 0 9 1124
-> 7 0 7 1032
-> 7 0 9 1156
-> 7 0 9 1084
+> 7 0 9 1123
+> 7 0 9 1127
+> 7 0 9 1126
+> 7 0 9 1130
+> 7 0 9 1129
+> 7 0 9 1133
+> 7 0 9 1132
 > 7 0 9 1025
+> 7 0 9 1024
+> 7 0 9 1136
+> 7 0 9 1135
+> 7 0 9 1139
+> 7 0 9 1138
+> 7 0 9 1142
+> 7 0 9 1141
+> 7 0 9 1145
 > 7 0 9 1144
-> 7 0 9 1066
-> 7 0 9 1126
-> 7 0 7 1077
-> 7 0 7 1140
-> 7 0 7 1089
-> 7 0 7 1152
-> 7 0 7 1101
-> 7 0 9 1079
-> 7 0 9 1039
-> 7 0 9 1115
-> 7 0 9 1067
+> 7 0 9 1148
+> 7 0 9 1147
 > 7 0 9 1151
-> 7 0 9 1103
-> 7 0 9 1051
-> 7 0 9 1111
-> 7 0 9 1093
+> 7 0 9 1150
+> 7 0 9 1154
 > 7 0 9 1153
+> 7 0 9 1028
+> 7 0 9 1027
+> 7 0 9 1031
+> 7 0 9 1030
+> 7 0 9 1034
+> 7 0 9 1033
+> 7 0 9 1037
+> 7 0 9 1036
 > 7 0 9 1040
-> 7 0 7 1104
+> 7 0 9 1039
+> 7 0 9 1043
+> 7 0 9 1042
+> 7 0 7 1017
+> 7 0 7 1044
+> 7 0 7 1047
+> 7 0 7 1050
 > 7 0 7 1053
-> 7 0 7 1116
+> 7 0 7 1056
+> 7 0 7 1059
+> 7 0 7 1062
 > 7 0 7 1065
-> 7 0 9 1024
-> 7 0 7 1128
-> 7 0 9 1106
-> 7 0 9 1058
-> 7 0 9 1142
-> 7 0 9 1094
-> 7 0 7 1023
-> 7 0 9 1130
-> 7 0 7 1035
-> 7 0 9 1078
-> 7 0 9 1138
-> 7 0 9 1060
-> 7 0 9 1120
-> 7 0 9 1031
-> 7 0 9 1102
+> 7 0 7 1068
+> 7 0 7 1071
+> 7 0 7 1020
+> 7 0 7 1074
+> 7 0 7 1077
 > 7 0 7 1080
-> 7 0 7 1143
+> 7 0 7 1083
+> 7 0 7 1086
+> 7 0 7 1089
 > 7 0 7 1092
-> 7 0 9 1049
-> 7 0 9 1033
-> 7 0 9 1085
-> 7 0 9 1121
-> 7 0 9 1073
-> 7 0 9 1045
-> 7 0 9 1105
-> 7 0 9 1022
-> 7 0 9 1087
-> 7 0 9 1147
-> 7 0 9 1069
-> 7 0 7 1044
-> 7 0 9 1129
+> 7 0 7 1095
+> 7 0 7 1098
+> 7 0 7 1101
+> 7 0 7 1023
+> 7 0 7 1104
 > 7 0 7 1107
-> 7 0 7 1056
+> 7 0 7 1110
+> 7 0 7 1113
+> 7 0 7 1116
 > 7 0 7 1119
-> 7 0 9 1018
-> 7 0 7 1068
+> 7 0 7 1122
+> 7 0 7 1125
+> 7 0 7 1128
 > 7 0 7 1131
-> 7 0 9 1076
-> 7 0 9 1112
-> 7 0 9 1042
-> 7 0 9 1064
-> 7 0 9 1148
-> 7 0 9 1100
 > 7 0 7 1026
-> 7 0 7 1038
-> 7 0 9 1054
-> 7 0 9 1114
-> 7 0 9 1096
-> 7 0 9 1037
 > 7 0 7 1134
-> 7 0 7 1083
+> 7 0 7 1137
+> 7 0 7 1140
+> 7 0 7 1143
 > 7 0 7 1146
-> 7 0 7 1095
-> 7 0 9 1027
-> 7 0 9 1055
-> 7 0 9 1139
-> 7 0 9 1091
-> 7 0 9 1127
-> 7 0 9 1081
-> 7 0 9 1141
-> 7 0 9 1063
-> 7 0 9 1028
-> 7 0 9 1123
-> 7 0 7 1047
-> 7 0 7 1110
+> 7 0 7 1149
+> 7 0 7 1152
+> 7 0 7 1029
+> 7 0 7 1032
+> 7 0 7 1035
+> 7 0 7 1038
+> 7 0 7 1041
+> 7 0 12 1155
 > 7 0 6 1016
-> 7 0 7 989
-> 7 0 7 995
-> 7 0 9 954
-> 7 0 7 1001
-> 7 0 7 1007
-> 7 0 9 966
-> 7 0 9 985
-> 7 0 9 978
-> 7 0 9 997
-> 7 0 9 1009
-> 7 0 9 987
-> 7 0 9 955
-> 7 0 9 999
-> 7 0 9 967
-> 7 0 7 1010
-> 7 0 9 979
-> 7 0 9 963
-> 7 0 9 1012
-> 7 0 9 988
-> 7 0 9 975
-> 7 0 7 953
-> 7 0 9 1000
-> 7 0 7 959
-> 7 0 7 965
-> 7 0 7 971
-> 7 0 7 977
-> 7 0 9 984
-> 7 0 9 1014
-> 7 0 9 958
-> 7 0 9 996
-> 7 0 9 970
-> 7 0 7 980
-> 7 0 9 1008
-> 7 0 7 986
-> 7 0 7 992
-> 7 0 7 998
-> 7 0 7 1004
-> 7 0 9 960
-> 7 0 9 972
-> 7 0 9 991
-> 7 0 9 1003
-> 7 0 9 981
-> 7 0 9 1011
-> 7 0 9 993
-> 7 0 9 961
-> 7 0 12 1013
-> 7 0 9 1005
-> 7 0 9 973
-> 7 0 9 957
-> 7 0 9 982
-> 7 0 9 969
-> 7 0 9 994
-> 7 0 7 956
-> 7 0 9 1006
-> 7 0 7 962
-> 7 0 7 968
-> 7 0 7 974
-> 7 0 9 990
-> 7 0 9 964
-> 7 0 9 1002
-> 7 0 9 976
-> 7 0 7 983
-> 7 0 6 952
-> 7 0 9 1179
-> 7 0 9 1169
-> 7 0 9 1181
-> 7 0 7 1159
-> 7 0 7 1165
-> 7 0 7 1171
-> 7 0 7 1177
-> 7 0 9 1170
-> 7 0 9 1182
-> 7 0 9 1166
-> 7 0 9 1178
-> 7 0 9 1161
 > 7 0 9 1184
+> 7 0 9 1161
+> 7 0 9 1160
+> 7 0 9 1164
+> 7 0 9 1163
+> 7 0 9 1167
+> 7 0 9 1166
+> 7 0 9 1170
+> 7 0 9 1169
 > 7 0 9 1173
-> 7 0 12 1183
-> 7 0 9 1163
+> 7 0 9 1172
+> 7 0 9 1176
 > 7 0 9 1175
+> 7 0 9 1179
+> 7 0 9 1178
+> 7 0 9 1182
+> 7 0 9 1181
+> 7 0 7 1159
 > 7 0 7 1162
+> 7 0 7 1165
 > 7 0 7 1168
+> 7 0 7 1171
 > 7 0 7 1174
+> 7 0 7 1177
 > 7 0 7 1180
-> 7 0 9 1164
-> 7 0 9 1176
-> 7 0 9 1160
-> 7 0 9 1172
-> 7 0 9 1167
+> 7 0 12 1183
 > 7 0 6 1158
 > 7 0 12 1187
 > 7 0 6 1186
-> 7 0 3 1015
 > 7 0 3 951
-> 7 0 9 950
-> 7 0 9 876
-> 7 0 9 914
-> 7 0 9 944
-> 7 0 9 888
-> 7 0 9 926
-> 7 0 7 931
-> 7 0 7 937
-> 7 0 7 943
-> 7 0 9 878
-> 7 0 9 933
-> 7 0 9 890
-> 7 0 9 909
-> 7 0 9 945
-> 7 0 7 874
-> 7 0 9 921
-> 7 0 7 880
-> 7 0 7 886
-> 7 0 7 892
-> 7 0 9 899
-> 7 0 9 929
-> 7 0 9 911
-> 7 0 9 879
-> 7 0 9 941
-> 7 0 9 923
-> 7 0 9 891
-> 7 0 7 901
-> 7 0 7 907
-> 7 0 7 913
-> 7 0 12 949
-> 7 0 7 919
-> 7 0 9 875
-> 7 0 7 925
-> 7 0 9 900
-> 7 0 9 887
-> 7 0 9 936
-> 7 0 9 912
-> 7 0 9 948
-> 7 0 9 924
-> 7 0 9 908
-> 7 0 9 938
-> 7 0 9 882
-> 7 0 9 920
-> 7 0 9 894
-> 7 0 7 928
-> 7 0 7 934
-> 7 0 7 940
-> 7 0 9 872
-> 7 0 7 946
-> 7 0 9 884
-> 7 0 9 903
-> 7 0 9 939
-> 7 0 9 896
-> 7 0 9 915
-> 7 0 7 871
-> 7 0 7 877
-> 7 0 9 927
-> 7 0 7 883
-> 7 0 7 889
-> 7 0 7 895
-> 7 0 9 905
-> 7 0 9 873
-> 7 0 9 935
-> 7 0 9 917
-> 7 0 9 885
-> 7 0 9 947
-> 7 0 7 898
-> 7 0 9 897
-> 7 0 7 904
-> 7 0 7 910
-> 7 0 7 916
-> 7 0 7 922
-> 7 0 9 881
-> 7 0 9 930
-> 7 0 9 906
-> 7 0 9 893
-> 7 0 9 942
-> 7 0 9 918
-> 7 0 9 902
-> 7 0 9 932
-> 7 0 6 870
+> 7 0 3 1015
+> 7 0 3 1157
 > 7 0 3 1185
 > 7 0 3 1188
-> 7 0 3 1157
 > 7 0 1 869
-> 7 0 3 4093
-> 7 0 9 3939
-> 7 0 9 4012
+> 7 0 9 1360
+> 7 0 9 1220
+> 7 0 9 1219
+> 7 0 9 1223
+> 7 0 9 1222
+> 7 0 9 1226
+> 7 0 9 1225
+> 7 0 9 1229
+> 7 0 9 1228
+> 7 0 9 1232
+> 7 0 9 1231
+> 7 0 9 1235
+> 7 0 9 1234
+> 7 0 9 1238
+> 7 0 9 1237
+> 7 0 9 1241
+> 7 0 9 1240
+> 7 0 9 1244
+> 7 0 9 1243
+> 7 0 9 1247
+> 7 0 9 1246
+> 7 0 9 1193
+> 7 0 9 1192
+> 7 0 9 1250
+> 7 0 9 1249
+> 7 0 9 1253
+> 7 0 9 1252
+> 7 0 9 1256
+> 7 0 9 1255
+> 7 0 9 1259
+> 7 0 9 1258
+> 7 0 9 1262
+> 7 0 9 1261
+> 7 0 9 1265
+> 7 0 9 1264
+> 7 0 9 1268
+> 7 0 9 1267
+> 7 0 9 1271
+> 7 0 9 1270
+> 7 0 9 1274
+> 7 0 9 1273
+> 7 0 9 1277
+> 7 0 9 1276
+> 7 0 9 1196
+> 7 0 9 1195
+> 7 0 9 1280
+> 7 0 9 1279
+> 7 0 9 1283
+> 7 0 9 1282
+> 7 0 9 1286
+> 7 0 9 1285
+> 7 0 9 1289
+> 7 0 9 1288
+> 7 0 9 1292
+> 7 0 9 1291
+> 7 0 9 1295
+> 7 0 9 1294
+> 7 0 9 1298
+> 7 0 9 1297
+> 7 0 9 1301
+> 7 0 9 1300
+> 7 0 9 1304
+> 7 0 9 1303
+> 7 0 9 1307
+> 7 0 9 1306
+> 7 0 9 1199
+> 7 0 9 1198
+> 7 0 9 1310
+> 7 0 9 1309
+> 7 0 9 1313
+> 7 0 9 1312
+> 7 0 9 1316
+> 7 0 9 1315
+> 7 0 9 1319
+> 7 0 9 1318
+> 7 0 9 1322
+> 7 0 9 1321
+> 7 0 9 1325
+> 7 0 9 1324
+> 7 0 9 1328
+> 7 0 9 1327
+> 7 0 9 1331
+> 7 0 9 1330
+> 7 0 9 1334
+> 7 0 9 1333
+> 7 0 9 1337
+> 7 0 9 1336
+> 7 0 9 1202
+> 7 0 9 1201
+> 7 0 9 1340
+> 7 0 9 1339
+> 7 0 9 1343
+> 7 0 9 1342
+> 7 0 9 1346
+> 7 0 9 1345
+> 7 0 9 1349
+> 7 0 9 1348
+> 7 0 9 1352
+> 7 0 9 1351
+> 7 0 9 1355
+> 7 0 9 1354
+> 7 0 9 1358
+> 7 0 9 1357
+> 7 0 9 1205
+> 7 0 9 1204
+> 7 0 9 1208
+> 7 0 9 1207
+> 7 0 9 1211
+> 7 0 9 1210
+> 7 0 9 1214
+> 7 0 9 1213
+> 7 0 9 1217
+> 7 0 9 1216
+> 7 0 7 1191
+> 7 0 7 1218
+> 7 0 7 1221
+> 7 0 7 1224
+> 7 0 7 1227
+> 7 0 7 1230
+> 7 0 7 1233
+> 7 0 7 1236
+> 7 0 7 1239
+> 7 0 7 1242
+> 7 0 7 1245
+> 7 0 7 1194
+> 7 0 7 1248
+> 7 0 7 1251
+> 7 0 7 1254
+> 7 0 7 1257
+> 7 0 7 1260
+> 7 0 7 1263
+> 7 0 7 1266
+> 7 0 7 1269
+> 7 0 7 1272
+> 7 0 7 1275
+> 7 0 7 1197
+> 7 0 7 1278
+> 7 0 7 1281
+> 7 0 7 1284
+> 7 0 7 1287
+> 7 0 7 1290
+> 7 0 7 1293
+> 7 0 7 1296
+> 7 0 7 1299
+> 7 0 7 1302
+> 7 0 7 1305
+> 7 0 7 1200
+> 7 0 7 1308
+> 7 0 7 1311
+> 7 0 7 1314
+> 7 0 7 1317
+> 7 0 7 1320
+> 7 0 7 1323
+> 7 0 7 1326
+> 7 0 7 1329
+> 7 0 7 1332
+> 7 0 7 1335
+> 7 0 7 1203
+> 7 0 7 1338
+> 7 0 7 1341
+> 7 0 7 1344
+> 7 0 7 1347
+> 7 0 7 1350
+> 7 0 7 1353
+> 7 0 7 1356
+> 7 0 7 1206
+> 7 0 7 1209
+> 7 0 7 1212
+> 7 0 7 1215
+> 7 0 12 1359
+> 7 0 6 1190
+> 7 0 9 1601
+> 7 0 9 1392
+> 7 0 9 1391
+> 7 0 9 1395
+> 7 0 9 1394
+> 7 0 9 1398
+> 7 0 9 1397
+> 7 0 9 1401
+> 7 0 9 1400
+> 7 0 9 1404
+> 7 0 9 1403
+> 7 0 9 1407
+> 7 0 9 1406
+> 7 0 9 1410
+> 7 0 9 1409
+> 7 0 9 1413
+> 7 0 9 1412
+> 7 0 9 1416
+> 7 0 9 1415
+> 7 0 9 1419
+> 7 0 9 1418
+> 7 0 9 1365
+> 7 0 9 1364
+> 7 0 9 1422
+> 7 0 9 1421
+> 7 0 9 1425
+> 7 0 9 1424
+> 7 0 9 1428
+> 7 0 9 1427
+> 7 0 9 1431
+> 7 0 9 1430
+> 7 0 9 1434
+> 7 0 9 1433
+> 7 0 9 1437
+> 7 0 9 1436
+> 7 0 9 1440
+> 7 0 9 1439
+> 7 0 9 1443
+> 7 0 9 1442
+> 7 0 9 1446
+> 7 0 9 1445
+> 7 0 9 1449
+> 7 0 9 1448
+> 7 0 9 1368
+> 7 0 9 1367
+> 7 0 9 1452
+> 7 0 9 1451
+> 7 0 9 1455
+> 7 0 9 1454
+> 7 0 9 1458
+> 7 0 9 1457
+> 7 0 9 1461
+> 7 0 9 1460
+> 7 0 9 1464
+> 7 0 9 1463
+> 7 0 9 1467
+> 7 0 9 1466
+> 7 0 9 1470
+> 7 0 9 1469
+> 7 0 9 1473
+> 7 0 9 1472
+> 7 0 9 1476
+> 7 0 9 1475
+> 7 0 9 1479
+> 7 0 9 1478
+> 7 0 9 1371
+> 7 0 9 1370
+> 7 0 9 1482
+> 7 0 9 1481
+> 7 0 9 1485
+> 7 0 9 1484
+> 7 0 9 1488
+> 7 0 9 1487
+> 7 0 9 1491
+> 7 0 9 1490
+> 7 0 9 1494
+> 7 0 9 1493
+> 7 0 9 1497
+> 7 0 9 1496
+> 7 0 9 1500
+> 7 0 9 1499
+> 7 0 9 1503
+> 7 0 9 1502
+> 7 0 9 1506
+> 7 0 9 1505
+> 7 0 9 1509
+> 7 0 9 1508
+> 7 0 9 1374
+> 7 0 9 1373
+> 7 0 9 1512
+> 7 0 9 1511
+> 7 0 9 1515
+> 7 0 9 1514
+> 7 0 9 1518
+> 7 0 9 1517
+> 7 0 9 1521
+> 7 0 9 1520
+> 7 0 9 1524
+> 7 0 9 1523
+> 7 0 9 1527
+> 7 0 9 1526
+> 7 0 9 1530
+> 7 0 9 1529
+> 7 0 9 1533
+> 7 0 9 1532
+> 7 0 9 1536
+> 7 0 9 1535
+> 7 0 9 1539
+> 7 0 9 1538
+> 7 0 9 1377
+> 7 0 9 1376
+> 7 0 9 1542
+> 7 0 9 1541
+> 7 0 9 1545
+> 7 0 9 1544
+> 7 0 9 1548
+> 7 0 9 1547
+> 7 0 9 1551
+> 7 0 9 1550
+> 7 0 9 1554
+> 7 0 9 1553
+> 7 0 9 1557
+> 7 0 9 1556
+> 7 0 9 1560
+> 7 0 9 1559
+> 7 0 9 1563
+> 7 0 9 1562
+> 7 0 9 1566
+> 7 0 9 1565
+> 7 0 9 1569
+> 7 0 9 1568
+> 7 0 9 1380
+> 7 0 9 1379
+> 7 0 9 1572
+> 7 0 9 1571
+> 7 0 9 1575
+> 7 0 9 1574
+> 7 0 9 1578
+> 7 0 9 1577
+> 7 0 9 1581
+> 7 0 9 1580
+> 7 0 9 1584
+> 7 0 9 1583
+> 7 0 9 1587
+> 7 0 9 1586
+> 7 0 9 1590
+> 7 0 9 1589
+> 7 0 9 1593
+> 7 0 9 1592
+> 7 0 9 1596
+> 7 0 9 1595
+> 7 0 9 1599
+> 7 0 9 1598
+> 7 0 9 1383
+> 7 0 9 1382
+> 7 0 9 1386
+> 7 0 9 1385
+> 7 0 9 1389
+> 7 0 9 1388
+> 7 0 7 1363
+> 7 0 7 1390
+> 7 0 7 1393
+> 7 0 7 1396
+> 7 0 7 1399
+> 7 0 7 1402
+> 7 0 7 1405
+> 7 0 7 1408
+> 7 0 7 1411
+> 7 0 7 1414
+> 7 0 7 1417
+> 7 0 7 1366
+> 7 0 7 1420
+> 7 0 7 1423
+> 7 0 7 1426
+> 7 0 7 1429
+> 7 0 7 1432
+> 7 0 7 1435
+> 7 0 7 1438
+> 7 0 7 1441
+> 7 0 7 1444
+> 7 0 7 1447
+> 7 0 7 1369
+> 7 0 7 1450
+> 7 0 7 1453
+> 7 0 7 1456
+> 7 0 7 1459
+> 7 0 7 1462
+> 7 0 7 1465
+> 7 0 7 1468
+> 7 0 7 1471
+> 7 0 7 1474
+> 7 0 7 1477
+> 7 0 7 1372
+> 7 0 7 1480
+> 7 0 7 1483
+> 7 0 7 1486
+> 7 0 7 1489
+> 7 0 7 1492
+> 7 0 7 1495
+> 7 0 7 1498
+> 7 0 7 1501
+> 7 0 7 1504
+> 7 0 7 1507
+> 7 0 7 1375
+> 7 0 7 1510
+> 7 0 7 1513
+> 7 0 7 1516
+> 7 0 7 1519
+> 7 0 7 1522
+> 7 0 7 1525
+> 7 0 7 1528
+> 7 0 7 1531
+> 7 0 7 1534
+> 7 0 7 1537
+> 7 0 7 1378
+> 7 0 7 1540
+> 7 0 7 1543
+> 7 0 7 1546
+> 7 0 7 1549
+> 7 0 7 1552
+> 7 0 7 1555
+> 7 0 7 1558
+> 7 0 7 1561
+> 7 0 7 1564
+> 7 0 7 1567
+> 7 0 7 1381
+> 7 0 7 1570
+> 7 0 7 1573
+> 7 0 7 1576
+> 7 0 7 1579
+> 7 0 7 1582
+> 7 0 7 1585
+> 7 0 7 1588
+> 7 0 7 1591
+> 7 0 7 1594
+> 7 0 7 1597
+> 7 0 7 1384
+> 7 0 7 1387
+> 7 0 12 1600
+> 7 0 6 1362
+> 7 0 12 1604
+> 7 0 6 1603
+> 7 0 3 1361
+> 7 0 3 1605
+> 7 0 3 1602
+> 7 0 1 1189
+> 7 0 16 1727
+> 7 0 16 1638
+> 7 0 16 1637
+> 7 0 16 1641
+> 7 0 16 1640
+> 7 0 16 1644
+> 7 0 16 1643
+> 7 0 16 1647
+> 7 0 16 1646
+> 7 0 16 1650
+> 7 0 16 1649
+> 7 0 16 1653
+> 7 0 16 1652
+> 7 0 16 1656
+> 7 0 16 1655
+> 7 0 16 1659
+> 7 0 16 1658
+> 7 0 16 1662
+> 7 0 16 1661
+> 7 0 16 1665
+> 7 0 16 1664
+> 7 0 16 1611
+> 7 0 16 1610
+> 7 0 16 1668
+> 7 0 16 1667
+> 7 0 16 1671
+> 7 0 16 1670
+> 7 0 16 1674
+> 7 0 16 1673
+> 7 0 16 1677
+> 7 0 16 1676
+> 7 0 16 1680
+> 7 0 16 1679
+> 7 0 16 1683
+> 7 0 16 1682
+> 7 0 16 1686
+> 7 0 16 1685
+> 7 0 16 1689
+> 7 0 16 1688
+> 7 0 16 1692
+> 7 0 16 1691
+> 7 0 16 1695
+> 7 0 16 1694
+> 7 0 16 1614
+> 7 0 16 1613
+> 7 0 16 1698
+> 7 0 16 1697
+> 7 0 16 1701
+> 7 0 16 1700
+> 7 0 16 1704
+> 7 0 16 1703
+> 7 0 16 1707
+> 7 0 16 1706
+> 7 0 16 1710
+> 7 0 16 1709
+> 7 0 16 1713
+> 7 0 16 1712
+> 7 0 16 1716
+> 7 0 16 1715
+> 7 0 16 1719
+> 7 0 16 1718
+> 7 0 16 1722
+> 7 0 16 1721
+> 7 0 16 1725
+> 7 0 16 1724
+> 7 0 16 1617
+> 7 0 16 1616
+> 7 0 16 1620
+> 7 0 16 1619
+> 7 0 16 1623
+> 7 0 16 1622
+> 7 0 16 1626
+> 7 0 16 1625
+> 7 0 16 1629
+> 7 0 16 1628
+> 7 0 16 1632
+> 7 0 16 1631
+> 7 0 16 1635
+> 7 0 16 1634
+> 7 0 14 1609
+> 7 0 14 1636
+> 7 0 14 1639
+> 7 0 14 1642
+> 7 0 14 1645
+> 7 0 14 1648
+> 7 0 14 1651
+> 7 0 14 1654
+> 7 0 14 1657
+> 7 0 14 1660
+> 7 0 14 1663
+> 7 0 14 1612
+> 7 0 14 1666
+> 7 0 14 1669
+> 7 0 14 1672
+> 7 0 14 1675
+> 7 0 14 1678
+> 7 0 14 1681
+> 7 0 14 1684
+> 7 0 14 1687
+> 7 0 14 1690
+> 7 0 14 1693
+> 7 0 14 1615
+> 7 0 14 1696
+> 7 0 14 1699
+> 7 0 14 1702
+> 7 0 14 1705
+> 7 0 14 1708
+> 7 0 14 1711
+> 7 0 14 1714
+> 7 0 14 1717
+> 7 0 14 1720
+> 7 0 14 1723
+> 7 0 14 1618
+> 7 0 14 1621
+> 7 0 14 1624
+> 7 0 14 1627
+> 7 0 14 1630
+> 7 0 14 1633
+> 7 0 19 1726
+> 7 0 13 1608
+> 7 0 16 1835
+> 7 0 16 1731
+> 7 0 16 1730
+> 7 0 16 1734
+> 7 0 16 1733
+> 7 0 16 1737
+> 7 0 16 1736
+> 7 0 16 1740
+> 7 0 16 1739
+> 7 0 16 1743
+> 7 0 16 1742
+> 7 0 16 1746
+> 7 0 16 1745
+> 7 0 16 1749
+> 7 0 16 1748
+> 7 0 16 1752
+> 7 0 16 1751
+> 7 0 16 1755
+> 7 0 16 1754
+> 7 0 16 1758
+> 7 0 16 1757
+> 7 0 16 1761
+> 7 0 16 1760
+> 7 0 16 1764
+> 7 0 16 1763
+> 7 0 16 1767
+> 7 0 16 1766
+> 7 0 16 1770
+> 7 0 16 1769
+> 7 0 16 1773
+> 7 0 16 1772
+> 7 0 16 1776
+> 7 0 16 1775
+> 7 0 16 1779
+> 7 0 16 1778
+> 7 0 16 1782
+> 7 0 16 1781
+> 7 0 16 1785
+> 7 0 16 1784
+> 7 0 16 1788
+> 7 0 16 1787
+> 7 0 16 1791
+> 7 0 16 1790
+> 7 0 16 1794
+> 7 0 16 1793
+> 7 0 16 1797
+> 7 0 16 1796
+> 7 0 16 1800
+> 7 0 16 1799
+> 7 0 16 1803
+> 7 0 16 1802
+> 7 0 16 1806
+> 7 0 16 1805
+> 7 0 16 1809
+> 7 0 16 1808
+> 7 0 16 1812
+> 7 0 16 1811
+> 7 0 16 1815
+> 7 0 16 1814
+> 7 0 16 1818
+> 7 0 16 1817
+> 7 0 16 1821
+> 7 0 16 1820
+> 7 0 16 1824
+> 7 0 16 1823
+> 7 0 16 1827
+> 7 0 16 1826
+> 7 0 16 1830
+> 7 0 16 1829
+> 7 0 16 1833
+> 7 0 16 1832
+> 7 0 14 1729
+> 7 0 14 1732
+> 7 0 14 1735
+> 7 0 14 1738
+> 7 0 14 1741
+> 7 0 14 1744
+> 7 0 14 1747
+> 7 0 14 1750
+> 7 0 14 1753
+> 7 0 14 1756
+> 7 0 14 1759
+> 7 0 14 1762
+> 7 0 14 1765
+> 7 0 14 1768
+> 7 0 14 1771
+> 7 0 14 1774
+> 7 0 14 1777
+> 7 0 14 1780
+> 7 0 14 1783
+> 7 0 14 1786
+> 7 0 14 1789
+> 7 0 14 1792
+> 7 0 14 1795
+> 7 0 14 1798
+> 7 0 14 1801
+> 7 0 14 1804
+> 7 0 14 1807
+> 7 0 14 1810
+> 7 0 14 1813
+> 7 0 14 1816
+> 7 0 14 1819
+> 7 0 14 1822
+> 7 0 14 1825
+> 7 0 14 1828
+> 7 0 14 1831
+> 7 0 19 1834
+> 7 0 13 1728
+> 7 0 16 1928
+> 7 0 16 1914
+> 7 0 16 1913
+> 7 0 16 1917
+> 7 0 16 1916
+> 7 0 16 1920
+> 7 0 16 1919
+> 7 0 16 1923
+> 7 0 16 1922
+> 7 0 16 1926
+> 7 0 16 1925
+> 7 0 16 1839
+> 7 0 16 1838
+> 7 0 16 1842
+> 7 0 16 1841
+> 7 0 16 1845
+> 7 0 16 1844
+> 7 0 16 1848
+> 7 0 16 1847
+> 7 0 16 1851
+> 7 0 16 1850
+> 7 0 16 1854
+> 7 0 16 1853
+> 7 0 16 1857
+> 7 0 16 1856
+> 7 0 16 1860
+> 7 0 16 1859
+> 7 0 16 1863
+> 7 0 16 1862
+> 7 0 16 1866
+> 7 0 16 1865
+> 7 0 16 1869
+> 7 0 16 1868
+> 7 0 16 1872
+> 7 0 16 1871
+> 7 0 16 1875
+> 7 0 16 1874
+> 7 0 16 1878
+> 7 0 16 1877
+> 7 0 16 1881
+> 7 0 16 1880
+> 7 0 16 1884
+> 7 0 16 1883
+> 7 0 16 1887
+> 7 0 16 1886
+> 7 0 16 1890
+> 7 0 16 1889
+> 7 0 16 1893
+> 7 0 16 1892
+> 7 0 16 1896
+> 7 0 16 1895
+> 7 0 16 1899
+> 7 0 16 1898
+> 7 0 16 1902
+> 7 0 16 1901
+> 7 0 16 1905
+> 7 0 16 1904
+> 7 0 16 1908
+> 7 0 16 1907
+> 7 0 16 1911
+> 7 0 16 1910
+> 7 0 14 1912
+> 7 0 14 1915
+> 7 0 14 1918
+> 7 0 14 1921
+> 7 0 14 1924
+> 7 0 14 1837
+> 7 0 14 1840
+> 7 0 14 1843
+> 7 0 14 1846
+> 7 0 14 1849
+> 7 0 14 1852
+> 7 0 14 1855
+> 7 0 14 1858
+> 7 0 14 1861
+> 7 0 14 1864
+> 7 0 14 1867
+> 7 0 14 1870
+> 7 0 14 1873
+> 7 0 14 1876
+> 7 0 14 1879
+> 7 0 14 1882
+> 7 0 14 1885
+> 7 0 14 1888
+> 7 0 14 1891
+> 7 0 14 1894
+> 7 0 14 1897
+> 7 0 14 1900
+> 7 0 14 1903
+> 7 0 14 1906
+> 7 0 14 1909
+> 7 0 19 1927
+> 7 0 13 1836
+> 7 0 16 2051
+> 7 0 16 1932
+> 7 0 16 1931
+> 7 0 16 1935
+> 7 0 16 1934
+> 7 0 16 1938
+> 7 0 16 1937
+> 7 0 16 1941
+> 7 0 16 1940
+> 7 0 16 1944
+> 7 0 16 1943
+> 7 0 16 1947
+> 7 0 16 1946
+> 7 0 16 1950
+> 7 0 16 1949
+> 7 0 16 1953
+> 7 0 16 1952
+> 7 0 16 1956
+> 7 0 16 1955
+> 7 0 16 1959
+> 7 0 16 1958
+> 7 0 16 1962
+> 7 0 16 1961
+> 7 0 16 1965
+> 7 0 16 1964
+> 7 0 16 1968
+> 7 0 16 1967
+> 7 0 16 1971
+> 7 0 16 1970
+> 7 0 16 1974
+> 7 0 16 1973
+> 7 0 16 1977
+> 7 0 16 1976
+> 7 0 16 1980
+> 7 0 16 1979
+> 7 0 16 1983
+> 7 0 16 1982
+> 7 0 16 1986
+> 7 0 16 1985
+> 7 0 16 1989
+> 7 0 16 1988
+> 7 0 16 1992
+> 7 0 16 1991
+> 7 0 16 1995
+> 7 0 16 1994
+> 7 0 16 1998
+> 7 0 16 1997
+> 7 0 16 2001
+> 7 0 16 2000
+> 7 0 16 2004
+> 7 0 16 2003
+> 7 0 16 2007
+> 7 0 16 2006
+> 7 0 16 2010
+> 7 0 16 2009
+> 7 0 16 2013
+> 7 0 16 2012
+> 7 0 16 2016
+> 7 0 16 2015
+> 7 0 16 2019
+> 7 0 16 2018
+> 7 0 16 2022
+> 7 0 16 2021
+> 7 0 16 2025
+> 7 0 16 2024
+> 7 0 16 2028
+> 7 0 16 2027
+> 7 0 16 2031
+> 7 0 16 2030
+> 7 0 16 2034
+> 7 0 16 2033
+> 7 0 16 2037
+> 7 0 16 2036
+> 7 0 16 2040
+> 7 0 16 2039
+> 7 0 16 2043
+> 7 0 16 2042
+> 7 0 16 2046
+> 7 0 16 2045
+> 7 0 16 2049
+> 7 0 16 2048
+> 7 0 14 1930
+> 7 0 14 1933
+> 7 0 14 1936
+> 7 0 14 1939
+> 7 0 14 1942
+> 7 0 14 1945
+> 7 0 14 1948
+> 7 0 14 1951
+> 7 0 14 1954
+> 7 0 14 1957
+> 7 0 14 1960
+> 7 0 14 1963
+> 7 0 14 1966
+> 7 0 14 1969
+> 7 0 14 1972
+> 7 0 14 1975
+> 7 0 14 1978
+> 7 0 14 1981
+> 7 0 14 1984
+> 7 0 14 1987
+> 7 0 14 1990
+> 7 0 14 1993
+> 7 0 14 1996
+> 7 0 14 1999
+> 7 0 14 2002
+> 7 0 14 2005
+> 7 0 14 2008
+> 7 0 14 2011
+> 7 0 14 2014
+> 7 0 14 2017
+> 7 0 14 2020
+> 7 0 14 2023
+> 7 0 14 2026
+> 7 0 14 2029
+> 7 0 14 2032
+> 7 0 14 2035
+> 7 0 14 2038
+> 7 0 14 2041
+> 7 0 14 2044
+> 7 0 14 2047
+> 7 0 19 2050
+> 7 0 13 1929
+> 7 0 19 2053
+> 7 0 13 2052
+> 7 0 9 2054
+> 7 0 6 1607
+> 7 0 16 2155
+> 7 0 16 2087
+> 7 0 16 2086
+> 7 0 16 2090
+> 7 0 16 2089
+> 7 0 16 2093
+> 7 0 16 2092
+> 7 0 16 2096
+> 7 0 16 2095
+> 7 0 16 2099
+> 7 0 16 2098
+> 7 0 16 2102
+> 7 0 16 2101
+> 7 0 16 2105
+> 7 0 16 2104
+> 7 0 16 2108
+> 7 0 16 2107
+> 7 0 16 2111
+> 7 0 16 2110
+> 7 0 16 2114
+> 7 0 16 2113
+> 7 0 16 2060
+> 7 0 16 2059
+> 7 0 16 2117
+> 7 0 16 2116
+> 7 0 16 2120
+> 7 0 16 2119
+> 7 0 16 2123
+> 7 0 16 2122
+> 7 0 16 2126
+> 7 0 16 2125
+> 7 0 16 2129
+> 7 0 16 2128
+> 7 0 16 2132
+> 7 0 16 2131
+> 7 0 16 2135
+> 7 0 16 2134
+> 7 0 16 2138
+> 7 0 16 2137
+> 7 0 16 2141
+> 7 0 16 2140
+> 7 0 16 2144
+> 7 0 16 2143
+> 7 0 16 2063
+> 7 0 16 2062
+> 7 0 16 2066
+> 7 0 16 2065
+> 7 0 16 2069
+> 7 0 16 2068
+> 7 0 16 2147
+> 7 0 16 2146
+> 7 0 16 2150
+> 7 0 16 2149
+> 7 0 16 2072
+> 7 0 16 2071
+> 7 0 16 2153
+> 7 0 16 2152
+> 7 0 16 2075
+> 7 0 16 2074
+> 7 0 16 2078
+> 7 0 16 2077
+> 7 0 16 2081
+> 7 0 16 2080
+> 7 0 16 2084
+> 7 0 16 2083
+> 7 0 14 2058
+> 7 0 14 2085
+> 7 0 14 2088
+> 7 0 14 2091
+> 7 0 14 2094
+> 7 0 14 2097
+> 7 0 14 2100
+> 7 0 14 2103
+> 7 0 14 2106
+> 7 0 14 2109
+> 7 0 14 2112
+> 7 0 14 2061
+> 7 0 14 2115
+> 7 0 14 2118
+> 7 0 14 2121
+> 7 0 14 2124
+> 7 0 14 2127
+> 7 0 14 2130
+> 7 0 14 2133
+> 7 0 14 2136
+> 7 0 14 2139
+> 7 0 14 2142
+> 7 0 14 2064
+> 7 0 14 2067
+> 7 0 14 2070
+> 7 0 14 2145
+> 7 0 14 2148
+> 7 0 14 2073
+> 7 0 14 2151
+> 7 0 14 2076
+> 7 0 14 2079
+> 7 0 14 2082
+> 7 0 19 2154
+> 7 0 13 2057
+> 7 0 16 2242
+> 7 0 16 2159
+> 7 0 16 2158
+> 7 0 16 2162
+> 7 0 16 2161
+> 7 0 16 2165
+> 7 0 16 2164
+> 7 0 16 2168
+> 7 0 16 2167
+> 7 0 16 2171
+> 7 0 16 2170
+> 7 0 16 2174
+> 7 0 16 2173
+> 7 0 16 2177
+> 7 0 16 2176
+> 7 0 16 2180
+> 7 0 16 2179
+> 7 0 16 2183
+> 7 0 16 2182
+> 7 0 16 2186
+> 7 0 16 2185
+> 7 0 16 2189
+> 7 0 16 2188
+> 7 0 16 2192
+> 7 0 16 2191
+> 7 0 16 2195
+> 7 0 16 2194
+> 7 0 16 2198
+> 7 0 16 2197
+> 7 0 16 2201
+> 7 0 16 2200
+> 7 0 16 2204
+> 7 0 16 2203
+> 7 0 16 2207
+> 7 0 16 2206
+> 7 0 16 2210
+> 7 0 16 2209
+> 7 0 16 2213
+> 7 0 16 2212
+> 7 0 16 2216
+> 7 0 16 2215
+> 7 0 16 2219
+> 7 0 16 2218
+> 7 0 16 2222
+> 7 0 16 2221
+> 7 0 16 2225
+> 7 0 16 2224
+> 7 0 16 2228
+> 7 0 16 2227
+> 7 0 16 2231
+> 7 0 16 2230
+> 7 0 16 2234
+> 7 0 16 2233
+> 7 0 16 2237
+> 7 0 16 2236
+> 7 0 16 2240
+> 7 0 16 2239
+> 7 0 14 2157
+> 7 0 14 2160
+> 7 0 14 2163
+> 7 0 14 2166
+> 7 0 14 2169
+> 7 0 14 2172
+> 7 0 14 2175
+> 7 0 14 2178
+> 7 0 14 2181
+> 7 0 14 2184
+> 7 0 14 2187
+> 7 0 14 2190
+> 7 0 14 2193
+> 7 0 14 2196
+> 7 0 14 2199
+> 7 0 14 2202
+> 7 0 14 2205
+> 7 0 14 2208
+> 7 0 14 2211
+> 7 0 14 2214
+> 7 0 14 2217
+> 7 0 14 2220
+> 7 0 14 2223
+> 7 0 14 2226
+> 7 0 14 2229
+> 7 0 14 2232
+> 7 0 14 2235
+> 7 0 14 2238
+> 7 0 19 2241
+> 7 0 13 2156
+> 7 0 16 2341
+> 7 0 16 2246
+> 7 0 16 2245
+> 7 0 16 2249
+> 7 0 16 2248
+> 7 0 16 2252
+> 7 0 16 2251
+> 7 0 16 2255
+> 7 0 16 2254
+> 7 0 16 2258
+> 7 0 16 2257
+> 7 0 16 2261
+> 7 0 16 2260
+> 7 0 16 2264
+> 7 0 16 2263
+> 7 0 16 2267
+> 7 0 16 2266
+> 7 0 16 2270
+> 7 0 16 2269
+> 7 0 16 2273
+> 7 0 16 2272
+> 7 0 16 2276
+> 7 0 16 2275
+> 7 0 16 2279
+> 7 0 16 2278
+> 7 0 16 2282
+> 7 0 16 2281
+> 7 0 16 2285
+> 7 0 16 2284
+> 7 0 16 2288
+> 7 0 16 2287
+> 7 0 16 2291
+> 7 0 16 2290
+> 7 0 16 2294
+> 7 0 16 2293
+> 7 0 16 2297
+> 7 0 16 2296
+> 7 0 16 2300
+> 7 0 16 2299
+> 7 0 16 2303
+> 7 0 16 2302
+> 7 0 16 2306
+> 7 0 16 2305
+> 7 0 16 2309
+> 7 0 16 2308
+> 7 0 16 2312
+> 7 0 16 2311
+> 7 0 16 2315
+> 7 0 16 2314
+> 7 0 16 2318
+> 7 0 16 2317
+> 7 0 16 2321
+> 7 0 16 2320
+> 7 0 16 2324
+> 7 0 16 2323
+> 7 0 16 2327
+> 7 0 16 2326
+> 7 0 16 2330
+> 7 0 16 2329
+> 7 0 16 2333
+> 7 0 16 2332
+> 7 0 16 2336
+> 7 0 16 2335
+> 7 0 16 2339
+> 7 0 16 2338
+> 7 0 14 2244
+> 7 0 14 2247
+> 7 0 14 2250
+> 7 0 14 2253
+> 7 0 14 2256
+> 7 0 14 2259
+> 7 0 14 2262
+> 7 0 14 2265
+> 7 0 14 2268
+> 7 0 14 2271
+> 7 0 14 2274
+> 7 0 14 2277
+> 7 0 14 2280
+> 7 0 14 2283
+> 7 0 14 2286
+> 7 0 14 2289
+> 7 0 14 2292
+> 7 0 14 2295
+> 7 0 14 2298
+> 7 0 14 2301
+> 7 0 14 2304
+> 7 0 14 2307
+> 7 0 14 2310
+> 7 0 14 2313
+> 7 0 14 2316
+> 7 0 14 2319
+> 7 0 14 2322
+> 7 0 14 2325
+> 7 0 14 2328
+> 7 0 14 2331
+> 7 0 14 2334
+> 7 0 14 2337
+> 7 0 19 2340
+> 7 0 13 2243
+> 7 0 19 2343
+> 7 0 13 2342
+> 7 0 9 2344
+> 7 0 6 2056
+> 7 0 12 2347
+> 7 0 6 2346
+> 7 0 3 2055
+> 7 0 3 2345
+> 7 0 3 2348
+> 7 0 1 1606
+> 7 0 16 2461
+> 7 0 16 2381
+> 7 0 16 2380
+> 7 0 16 2384
+> 7 0 16 2383
+> 7 0 16 2387
+> 7 0 16 2386
+> 7 0 16 2390
+> 7 0 16 2389
+> 7 0 16 2393
+> 7 0 16 2392
+> 7 0 16 2396
+> 7 0 16 2395
+> 7 0 16 2399
+> 7 0 16 2398
+> 7 0 16 2402
+> 7 0 16 2401
+> 7 0 16 2405
+> 7 0 16 2404
+> 7 0 16 2408
+> 7 0 16 2407
+> 7 0 16 2354
+> 7 0 16 2353
+> 7 0 16 2411
+> 7 0 16 2410
+> 7 0 16 2414
+> 7 0 16 2413
+> 7 0 16 2417
+> 7 0 16 2416
+> 7 0 16 2420
+> 7 0 16 2419
+> 7 0 16 2423
+> 7 0 16 2422
+> 7 0 16 2426
+> 7 0 16 2425
+> 7 0 16 2429
+> 7 0 16 2428
+> 7 0 16 2432
+> 7 0 16 2431
+> 7 0 16 2435
+> 7 0 16 2434
+> 7 0 16 2438
+> 7 0 16 2437
+> 7 0 16 2357
+> 7 0 16 2356
+> 7 0 16 2441
+> 7 0 16 2440
+> 7 0 16 2444
+> 7 0 16 2443
+> 7 0 16 2447
+> 7 0 16 2446
+> 7 0 16 2450
+> 7 0 16 2449
+> 7 0 16 2453
+> 7 0 16 2452
+> 7 0 16 2456
+> 7 0 16 2455
+> 7 0 16 2459
+> 7 0 16 2458
+> 7 0 16 2360
+> 7 0 16 2359
+> 7 0 16 2363
+> 7 0 16 2362
+> 7 0 16 2366
+> 7 0 16 2365
+> 7 0 16 2369
+> 7 0 16 2368
+> 7 0 16 2372
+> 7 0 16 2371
+> 7 0 16 2375
+> 7 0 16 2374
+> 7 0 16 2378
+> 7 0 16 2377
+> 7 0 14 2352
+> 7 0 14 2379
+> 7 0 14 2382
+> 7 0 14 2385
+> 7 0 14 2388
+> 7 0 14 2391
+> 7 0 14 2394
+> 7 0 14 2397
+> 7 0 14 2400
+> 7 0 14 2403
+> 7 0 14 2406
+> 7 0 14 2355
+> 7 0 14 2409
+> 7 0 14 2412
+> 7 0 14 2415
+> 7 0 14 2418
+> 7 0 14 2421
+> 7 0 14 2424
+> 7 0 14 2427
+> 7 0 14 2430
+> 7 0 14 2433
+> 7 0 14 2436
+> 7 0 14 2358
+> 7 0 14 2439
+> 7 0 14 2442
+> 7 0 14 2445
+> 7 0 14 2448
+> 7 0 14 2451
+> 7 0 14 2454
+> 7 0 14 2457
+> 7 0 14 2361
+> 7 0 14 2364
+> 7 0 14 2367
+> 7 0 14 2370
+> 7 0 14 2373
+> 7 0 14 2376
+> 7 0 19 2460
+> 7 0 13 2351
+> 7 0 16 2572
+> 7 0 16 2465
+> 7 0 16 2464
+> 7 0 16 2468
+> 7 0 16 2467
+> 7 0 16 2471
+> 7 0 16 2470
+> 7 0 16 2474
+> 7 0 16 2473
+> 7 0 16 2477
+> 7 0 16 2476
+> 7 0 16 2480
+> 7 0 16 2479
+> 7 0 16 2483
+> 7 0 16 2482
+> 7 0 16 2486
+> 7 0 16 2485
+> 7 0 16 2489
+> 7 0 16 2488
+> 7 0 16 2492
+> 7 0 16 2491
+> 7 0 16 2495
+> 7 0 16 2494
+> 7 0 16 2498
+> 7 0 16 2497
+> 7 0 16 2501
+> 7 0 16 2500
+> 7 0 16 2504
+> 7 0 16 2503
+> 7 0 16 2507
+> 7 0 16 2506
+> 7 0 16 2510
+> 7 0 16 2509
+> 7 0 16 2513
+> 7 0 16 2512
+> 7 0 16 2516
+> 7 0 16 2515
+> 7 0 16 2519
+> 7 0 16 2518
+> 7 0 16 2522
+> 7 0 16 2521
+> 7 0 16 2525
+> 7 0 16 2524
+> 7 0 16 2528
+> 7 0 16 2527
+> 7 0 16 2531
+> 7 0 16 2530
+> 7 0 16 2534
+> 7 0 16 2533
+> 7 0 16 2537
+> 7 0 16 2536
+> 7 0 16 2540
+> 7 0 16 2539
+> 7 0 16 2543
+> 7 0 16 2542
+> 7 0 16 2546
+> 7 0 16 2545
+> 7 0 16 2549
+> 7 0 16 2548
+> 7 0 16 2552
+> 7 0 16 2551
+> 7 0 16 2555
+> 7 0 16 2554
+> 7 0 16 2558
+> 7 0 16 2557
+> 7 0 16 2561
+> 7 0 16 2560
+> 7 0 16 2564
+> 7 0 16 2563
+> 7 0 16 2567
+> 7 0 16 2566
+> 7 0 16 2570
+> 7 0 16 2569
+> 7 0 14 2463
+> 7 0 14 2466
+> 7 0 14 2469
+> 7 0 14 2472
+> 7 0 14 2475
+> 7 0 14 2478
+> 7 0 14 2481
+> 7 0 14 2484
+> 7 0 14 2487
+> 7 0 14 2490
+> 7 0 14 2493
+> 7 0 14 2496
+> 7 0 14 2499
+> 7 0 14 2502
+> 7 0 14 2505
+> 7 0 14 2508
+> 7 0 14 2511
+> 7 0 14 2514
+> 7 0 14 2517
+> 7 0 14 2520
+> 7 0 14 2523
+> 7 0 14 2526
+> 7 0 14 2529
+> 7 0 14 2532
+> 7 0 14 2535
+> 7 0 14 2538
+> 7 0 14 2541
+> 7 0 14 2544
+> 7 0 14 2547
+> 7 0 14 2550
+> 7 0 14 2553
+> 7 0 14 2556
+> 7 0 14 2559
+> 7 0 14 2562
+> 7 0 14 2565
+> 7 0 14 2568
+> 7 0 19 2571
+> 7 0 13 2462
+> 7 0 16 2683
+> 7 0 16 2657
+> 7 0 16 2656
+> 7 0 16 2660
+> 7 0 16 2659
+> 7 0 16 2663
+> 7 0 16 2662
+> 7 0 16 2666
+> 7 0 16 2665
+> 7 0 16 2669
+> 7 0 16 2668
+> 7 0 16 2672
+> 7 0 16 2671
+> 7 0 16 2675
+> 7 0 16 2674
+> 7 0 16 2678
+> 7 0 16 2677
+> 7 0 16 2681
+> 7 0 16 2680
+> 7 0 16 2576
+> 7 0 16 2575
+> 7 0 16 2579
+> 7 0 16 2578
+> 7 0 16 2582
+> 7 0 16 2581
+> 7 0 16 2585
+> 7 0 16 2584
+> 7 0 16 2588
+> 7 0 16 2587
+> 7 0 16 2591
+> 7 0 16 2590
+> 7 0 16 2594
+> 7 0 16 2593
+> 7 0 16 2597
+> 7 0 16 2596
+> 7 0 16 2600
+> 7 0 16 2599
+> 7 0 16 2603
+> 7 0 16 2602
+> 7 0 16 2606
+> 7 0 16 2605
+> 7 0 16 2609
+> 7 0 16 2608
+> 7 0 16 2612
+> 7 0 16 2611
+> 7 0 16 2615
+> 7 0 16 2614
+> 7 0 16 2618
+> 7 0 16 2617
+> 7 0 16 2621
+> 7 0 16 2620
+> 7 0 16 2624
+> 7 0 16 2623
+> 7 0 16 2627
+> 7 0 16 2626
+> 7 0 16 2630
+> 7 0 16 2629
+> 7 0 16 2633
+> 7 0 16 2632
+> 7 0 16 2636
+> 7 0 16 2635
+> 7 0 16 2639
+> 7 0 16 2638
+> 7 0 16 2642
+> 7 0 16 2641
+> 7 0 16 2645
+> 7 0 16 2644
+> 7 0 16 2648
+> 7 0 16 2647
+> 7 0 16 2651
+> 7 0 16 2650
+> 7 0 16 2654
+> 7 0 16 2653
+> 7 0 14 2655
+> 7 0 14 2658
+> 7 0 14 2661
+> 7 0 14 2664
+> 7 0 14 2667
+> 7 0 14 2670
+> 7 0 14 2673
+> 7 0 14 2676
+> 7 0 14 2679
+> 7 0 14 2574
+> 7 0 14 2577
+> 7 0 14 2580
+> 7 0 14 2583
+> 7 0 14 2586
+> 7 0 14 2589
+> 7 0 14 2592
+> 7 0 14 2595
+> 7 0 14 2598
+> 7 0 14 2601
+> 7 0 14 2604
+> 7 0 14 2607
+> 7 0 14 2610
+> 7 0 14 2613
+> 7 0 14 2616
+> 7 0 14 2619
+> 7 0 14 2622
+> 7 0 14 2625
+> 7 0 14 2628
+> 7 0 14 2631
+> 7 0 14 2634
+> 7 0 14 2637
+> 7 0 14 2640
+> 7 0 14 2643
+> 7 0 14 2646
+> 7 0 14 2649
+> 7 0 14 2652
+> 7 0 19 2682
+> 7 0 13 2573
+> 7 0 16 2794
+> 7 0 16 2687
+> 7 0 16 2686
+> 7 0 16 2690
+> 7 0 16 2689
+> 7 0 16 2693
+> 7 0 16 2692
+> 7 0 16 2696
+> 7 0 16 2695
+> 7 0 16 2699
+> 7 0 16 2698
+> 7 0 16 2702
+> 7 0 16 2701
+> 7 0 16 2705
+> 7 0 16 2704
+> 7 0 16 2708
+> 7 0 16 2707
+> 7 0 16 2711
+> 7 0 16 2710
+> 7 0 16 2714
+> 7 0 16 2713
+> 7 0 16 2717
+> 7 0 16 2716
+> 7 0 16 2720
+> 7 0 16 2719
+> 7 0 16 2723
+> 7 0 16 2722
+> 7 0 16 2726
+> 7 0 16 2725
+> 7 0 16 2729
+> 7 0 16 2728
+> 7 0 16 2732
+> 7 0 16 2731
+> 7 0 16 2735
+> 7 0 16 2734
+> 7 0 16 2738
+> 7 0 16 2737
+> 7 0 16 2741
+> 7 0 16 2740
+> 7 0 16 2744
+> 7 0 16 2743
+> 7 0 16 2747
+> 7 0 16 2746
+> 7 0 16 2750
+> 7 0 16 2749
+> 7 0 16 2753
+> 7 0 16 2752
+> 7 0 16 2756
+> 7 0 16 2755
+> 7 0 16 2759
+> 7 0 16 2758
+> 7 0 16 2762
+> 7 0 16 2761
+> 7 0 16 2765
+> 7 0 16 2764
+> 7 0 16 2768
+> 7 0 16 2767
+> 7 0 16 2771
+> 7 0 16 2770
+> 7 0 16 2774
+> 7 0 16 2773
+> 7 0 16 2777
+> 7 0 16 2776
+> 7 0 16 2780
+> 7 0 16 2779
+> 7 0 16 2783
+> 7 0 16 2782
+> 7 0 16 2786
+> 7 0 16 2785
+> 7 0 16 2789
+> 7 0 16 2788
+> 7 0 16 2792
+> 7 0 16 2791
+> 7 0 14 2685
+> 7 0 14 2688
+> 7 0 14 2691
+> 7 0 14 2694
+> 7 0 14 2697
+> 7 0 14 2700
+> 7 0 14 2703
+> 7 0 14 2706
+> 7 0 14 2709
+> 7 0 14 2712
+> 7 0 14 2715
+> 7 0 14 2718
+> 7 0 14 2721
+> 7 0 14 2724
+> 7 0 14 2727
+> 7 0 14 2730
+> 7 0 14 2733
+> 7 0 14 2736
+> 7 0 14 2739
+> 7 0 14 2742
+> 7 0 14 2745
+> 7 0 14 2748
+> 7 0 14 2751
+> 7 0 14 2754
+> 7 0 14 2757
+> 7 0 14 2760
+> 7 0 14 2763
+> 7 0 14 2766
+> 7 0 14 2769
+> 7 0 14 2772
+> 7 0 14 2775
+> 7 0 14 2778
+> 7 0 14 2781
+> 7 0 14 2784
+> 7 0 14 2787
+> 7 0 14 2790
+> 7 0 19 2793
+> 7 0 13 2684
+> 7 0 16 2905
+> 7 0 16 2798
+> 7 0 16 2797
+> 7 0 16 2801
+> 7 0 16 2800
+> 7 0 16 2804
+> 7 0 16 2803
+> 7 0 16 2807
+> 7 0 16 2806
+> 7 0 16 2810
+> 7 0 16 2809
+> 7 0 16 2813
+> 7 0 16 2812
+> 7 0 16 2816
+> 7 0 16 2815
+> 7 0 16 2819
+> 7 0 16 2818
+> 7 0 16 2822
+> 7 0 16 2821
+> 7 0 16 2825
+> 7 0 16 2824
+> 7 0 16 2828
+> 7 0 16 2827
+> 7 0 16 2831
+> 7 0 16 2830
+> 7 0 16 2834
+> 7 0 16 2833
+> 7 0 16 2837
+> 7 0 16 2836
+> 7 0 16 2840
+> 7 0 16 2839
+> 7 0 16 2843
+> 7 0 16 2842
+> 7 0 16 2846
+> 7 0 16 2845
+> 7 0 16 2849
+> 7 0 16 2848
+> 7 0 16 2852
+> 7 0 16 2851
+> 7 0 16 2855
+> 7 0 16 2854
+> 7 0 16 2858
+> 7 0 16 2857
+> 7 0 16 2861
+> 7 0 16 2860
+> 7 0 16 2864
+> 7 0 16 2863
+> 7 0 16 2867
+> 7 0 16 2866
+> 7 0 16 2870
+> 7 0 16 2869
+> 7 0 16 2873
+> 7 0 16 2872
+> 7 0 16 2876
+> 7 0 16 2875
+> 7 0 16 2879
+> 7 0 16 2878
+> 7 0 16 2882
+> 7 0 16 2881
+> 7 0 16 2885
+> 7 0 16 2884
+> 7 0 16 2888
+> 7 0 16 2887
+> 7 0 16 2891
+> 7 0 16 2890
+> 7 0 16 2894
+> 7 0 16 2893
+> 7 0 16 2897
+> 7 0 16 2896
+> 7 0 16 2900
+> 7 0 16 2899
+> 7 0 16 2903
+> 7 0 16 2902
+> 7 0 14 2796
+> 7 0 14 2799
+> 7 0 14 2802
+> 7 0 14 2805
+> 7 0 14 2808
+> 7 0 14 2811
+> 7 0 14 2814
+> 7 0 14 2817
+> 7 0 14 2820
+> 7 0 14 2823
+> 7 0 14 2826
+> 7 0 14 2829
+> 7 0 14 2832
+> 7 0 14 2835
+> 7 0 14 2838
+> 7 0 14 2841
+> 7 0 14 2844
+> 7 0 14 2847
+> 7 0 14 2850
+> 7 0 14 2853
+> 7 0 14 2856
+> 7 0 14 2859
+> 7 0 14 2862
+> 7 0 14 2865
+> 7 0 14 2868
+> 7 0 14 2871
+> 7 0 14 2874
+> 7 0 14 2877
+> 7 0 14 2880
+> 7 0 14 2883
+> 7 0 14 2886
+> 7 0 14 2889
+> 7 0 14 2892
+> 7 0 14 2895
+> 7 0 14 2898
+> 7 0 14 2901
+> 7 0 19 2904
+> 7 0 13 2795
+> 7 0 16 2980
+> 7 0 16 2909
+> 7 0 16 2908
+> 7 0 16 2912
+> 7 0 16 2911
+> 7 0 16 2915
+> 7 0 16 2914
+> 7 0 16 2918
+> 7 0 16 2917
+> 7 0 16 2921
+> 7 0 16 2920
+> 7 0 16 2924
+> 7 0 16 2923
+> 7 0 16 2927
+> 7 0 16 2926
+> 7 0 16 2930
+> 7 0 16 2929
+> 7 0 16 2933
+> 7 0 16 2932
+> 7 0 16 2936
+> 7 0 16 2935
+> 7 0 16 2939
+> 7 0 16 2938
+> 7 0 16 2942
+> 7 0 16 2941
+> 7 0 16 2945
+> 7 0 16 2944
+> 7 0 16 2948
+> 7 0 16 2947
+> 7 0 16 2951
+> 7 0 16 2950
+> 7 0 16 2954
+> 7 0 16 2953
+> 7 0 16 2957
+> 7 0 16 2956
+> 7 0 16 2960
+> 7 0 16 2959
+> 7 0 16 2963
+> 7 0 16 2962
+> 7 0 16 2966
+> 7 0 16 2965
+> 7 0 16 2969
+> 7 0 16 2968
+> 7 0 16 2972
+> 7 0 16 2971
+> 7 0 16 2975
+> 7 0 16 2974
+> 7 0 16 2978
+> 7 0 16 2977
+> 7 0 14 2907
+> 7 0 14 2910
+> 7 0 14 2913
+> 7 0 14 2916
+> 7 0 14 2919
+> 7 0 14 2922
+> 7 0 14 2925
+> 7 0 14 2928
+> 7 0 14 2931
+> 7 0 14 2934
+> 7 0 14 2937
+> 7 0 14 2940
+> 7 0 14 2943
+> 7 0 14 2946
+> 7 0 14 2949
+> 7 0 14 2952
+> 7 0 14 2955
+> 7 0 14 2958
+> 7 0 14 2961
+> 7 0 14 2964
+> 7 0 14 2967
+> 7 0 14 2970
+> 7 0 14 2973
+> 7 0 14 2976
+> 7 0 19 2979
+> 7 0 13 2906
+> 7 0 16 3091
+> 7 0 16 2984
+> 7 0 16 2983
+> 7 0 16 2987
+> 7 0 16 2986
+> 7 0 16 2990
+> 7 0 16 2989
+> 7 0 16 2993
+> 7 0 16 2992
+> 7 0 16 2996
+> 7 0 16 2995
+> 7 0 16 2999
+> 7 0 16 2998
+> 7 0 16 3002
+> 7 0 16 3001
+> 7 0 16 3005
+> 7 0 16 3004
+> 7 0 16 3008
+> 7 0 16 3007
+> 7 0 16 3011
+> 7 0 16 3010
+> 7 0 16 3014
+> 7 0 16 3013
+> 7 0 16 3017
+> 7 0 16 3016
+> 7 0 16 3020
+> 7 0 16 3019
+> 7 0 16 3023
+> 7 0 16 3022
+> 7 0 16 3026
+> 7 0 16 3025
+> 7 0 16 3029
+> 7 0 16 3028
+> 7 0 16 3032
+> 7 0 16 3031
+> 7 0 16 3035
+> 7 0 16 3034
+> 7 0 16 3038
+> 7 0 16 3037
+> 7 0 16 3041
+> 7 0 16 3040
+> 7 0 16 3044
+> 7 0 16 3043
+> 7 0 16 3047
+> 7 0 16 3046
+> 7 0 16 3050
+> 7 0 16 3049
+> 7 0 16 3053
+> 7 0 16 3052
+> 7 0 16 3056
+> 7 0 16 3055
+> 7 0 16 3059
+> 7 0 16 3058
+> 7 0 16 3062
+> 7 0 16 3061
+> 7 0 16 3065
+> 7 0 16 3064
+> 7 0 16 3068
+> 7 0 16 3067
+> 7 0 16 3071
+> 7 0 16 3070
+> 7 0 16 3074
+> 7 0 16 3073
+> 7 0 16 3077
+> 7 0 16 3076
+> 7 0 16 3080
+> 7 0 16 3079
+> 7 0 16 3083
+> 7 0 16 3082
+> 7 0 16 3086
+> 7 0 16 3085
+> 7 0 16 3089
+> 7 0 16 3088
+> 7 0 14 2982
+> 7 0 14 2985
+> 7 0 14 2988
+> 7 0 14 2991
+> 7 0 14 2994
+> 7 0 14 2997
+> 7 0 14 3000
+> 7 0 14 3003
+> 7 0 14 3006
+> 7 0 14 3009
+> 7 0 14 3012
+> 7 0 14 3015
+> 7 0 14 3018
+> 7 0 14 3021
+> 7 0 14 3024
+> 7 0 14 3027
+> 7 0 14 3030
+> 7 0 14 3033
+> 7 0 14 3036
+> 7 0 14 3039
+> 7 0 14 3042
+> 7 0 14 3045
+> 7 0 14 3048
+> 7 0 14 3051
+> 7 0 14 3054
+> 7 0 14 3057
+> 7 0 14 3060
+> 7 0 14 3063
+> 7 0 14 3066
+> 7 0 14 3069
+> 7 0 14 3072
+> 7 0 14 3075
+> 7 0 14 3078
+> 7 0 14 3081
+> 7 0 14 3084
+> 7 0 14 3087
+> 7 0 19 3090
+> 7 0 13 2981
+> 7 0 16 3202
+> 7 0 16 3095
+> 7 0 16 3094
+> 7 0 16 3098
+> 7 0 16 3097
+> 7 0 16 3101
+> 7 0 16 3100
+> 7 0 16 3104
+> 7 0 16 3103
+> 7 0 16 3107
+> 7 0 16 3106
+> 7 0 16 3110
+> 7 0 16 3109
+> 7 0 16 3113
+> 7 0 16 3112
+> 7 0 16 3116
+> 7 0 16 3115
+> 7 0 16 3119
+> 7 0 16 3118
+> 7 0 16 3122
+> 7 0 16 3121
+> 7 0 16 3125
+> 7 0 16 3124
+> 7 0 16 3128
+> 7 0 16 3127
+> 7 0 16 3131
+> 7 0 16 3130
+> 7 0 16 3134
+> 7 0 16 3133
+> 7 0 16 3137
+> 7 0 16 3136
+> 7 0 16 3140
+> 7 0 16 3139
+> 7 0 16 3143
+> 7 0 16 3142
+> 7 0 16 3146
+> 7 0 16 3145
+> 7 0 16 3149
+> 7 0 16 3148
+> 7 0 16 3152
+> 7 0 16 3151
+> 7 0 16 3155
+> 7 0 16 3154
+> 7 0 16 3158
+> 7 0 16 3157
+> 7 0 16 3161
+> 7 0 16 3160
+> 7 0 16 3164
+> 7 0 16 3163
+> 7 0 16 3167
+> 7 0 16 3166
+> 7 0 16 3170
+> 7 0 16 3169
+> 7 0 16 3173
+> 7 0 16 3172
+> 7 0 16 3176
+> 7 0 16 3175
+> 7 0 16 3179
+> 7 0 16 3178
+> 7 0 16 3182
+> 7 0 16 3181
+> 7 0 16 3185
+> 7 0 16 3184
+> 7 0 16 3188
+> 7 0 16 3187
+> 7 0 16 3191
+> 7 0 16 3190
+> 7 0 16 3194
+> 7 0 16 3193
+> 7 0 16 3197
+> 7 0 16 3196
+> 7 0 16 3200
+> 7 0 16 3199
+> 7 0 14 3093
+> 7 0 14 3096
+> 7 0 14 3099
+> 7 0 14 3102
+> 7 0 14 3105
+> 7 0 14 3108
+> 7 0 14 3111
+> 7 0 14 3114
+> 7 0 14 3117
+> 7 0 14 3120
+> 7 0 14 3123
+> 7 0 14 3126
+> 7 0 14 3129
+> 7 0 14 3132
+> 7 0 14 3135
+> 7 0 14 3138
+> 7 0 14 3141
+> 7 0 14 3144
+> 7 0 14 3147
+> 7 0 14 3150
+> 7 0 14 3153
+> 7 0 14 3156
+> 7 0 14 3159
+> 7 0 14 3162
+> 7 0 14 3165
+> 7 0 14 3168
+> 7 0 14 3171
+> 7 0 14 3174
+> 7 0 14 3177
+> 7 0 14 3180
+> 7 0 14 3183
+> 7 0 14 3186
+> 7 0 14 3189
+> 7 0 14 3192
+> 7 0 14 3195
+> 7 0 14 3198
+> 7 0 19 3201
+> 7 0 13 3092
+> 7 0 16 3271
+> 7 0 16 3206
+> 7 0 16 3205
+> 7 0 16 3209
+> 7 0 16 3208
+> 7 0 16 3212
+> 7 0 16 3211
+> 7 0 16 3215
+> 7 0 16 3214
+> 7 0 16 3218
+> 7 0 16 3217
+> 7 0 16 3221
+> 7 0 16 3220
+> 7 0 16 3224
+> 7 0 16 3223
+> 7 0 16 3227
+> 7 0 16 3226
+> 7 0 16 3230
+> 7 0 16 3229
+> 7 0 16 3233
+> 7 0 16 3232
+> 7 0 16 3236
+> 7 0 16 3235
+> 7 0 16 3239
+> 7 0 16 3238
+> 7 0 16 3242
+> 7 0 16 3241
+> 7 0 16 3245
+> 7 0 16 3244
+> 7 0 16 3248
+> 7 0 16 3247
+> 7 0 16 3251
+> 7 0 16 3250
+> 7 0 16 3254
+> 7 0 16 3253
+> 7 0 16 3257
+> 7 0 16 3256
+> 7 0 16 3260
+> 7 0 16 3259
+> 7 0 16 3263
+> 7 0 16 3262
+> 7 0 16 3266
+> 7 0 16 3265
+> 7 0 16 3269
+> 7 0 16 3268
+> 7 0 14 3204
+> 7 0 14 3207
+> 7 0 14 3210
+> 7 0 14 3213
+> 7 0 14 3216
+> 7 0 14 3219
+> 7 0 14 3222
+> 7 0 14 3225
+> 7 0 14 3228
+> 7 0 14 3231
+> 7 0 14 3234
+> 7 0 14 3237
+> 7 0 14 3240
+> 7 0 14 3243
+> 7 0 14 3246
+> 7 0 14 3249
+> 7 0 14 3252
+> 7 0 14 3255
+> 7 0 14 3258
+> 7 0 14 3261
+> 7 0 14 3264
+> 7 0 14 3267
+> 7 0 19 3270
+> 7 0 13 3203
+> 7 0 16 3292
+> 7 0 16 3275
+> 7 0 16 3274
+> 7 0 16 3278
+> 7 0 16 3277
+> 7 0 16 3281
+> 7 0 16 3280
+> 7 0 16 3284
+> 7 0 16 3283
+> 7 0 16 3287
+> 7 0 16 3286
+> 7 0 16 3290
+> 7 0 16 3289
+> 7 0 14 3273
+> 7 0 14 3276
+> 7 0 14 3279
+> 7 0 14 3282
+> 7 0 14 3285
+> 7 0 14 3288
+> 7 0 19 3291
+> 7 0 13 3272
+> 7 0 16 3313
+> 7 0 16 3296
+> 7 0 16 3295
+> 7 0 16 3299
+> 7 0 16 3298
+> 7 0 16 3302
+> 7 0 16 3301
+> 7 0 16 3305
+> 7 0 16 3304
+> 7 0 16 3308
+> 7 0 16 3307
+> 7 0 16 3311
+> 7 0 16 3310
+> 7 0 14 3294
+> 7 0 14 3297
+> 7 0 14 3300
+> 7 0 14 3303
+> 7 0 14 3306
+> 7 0 14 3309
+> 7 0 19 3312
+> 7 0 13 3293
+> 7 0 19 3315
+> 7 0 13 3314
+> 7 0 9 3316
+> 7 0 6 2350
+> 7 0 9 3410
+> 7 0 9 3348
+> 7 0 9 3347
+> 7 0 9 3351
+> 7 0 9 3350
+> 7 0 9 3354
+> 7 0 9 3353
+> 7 0 9 3357
+> 7 0 9 3356
+> 7 0 9 3360
+> 7 0 9 3359
+> 7 0 9 3363
+> 7 0 9 3362
+> 7 0 9 3366
+> 7 0 9 3365
+> 7 0 9 3369
+> 7 0 9 3368
+> 7 0 9 3372
+> 7 0 9 3371
+> 7 0 9 3375
+> 7 0 9 3374
+> 7 0 9 3321
+> 7 0 9 3320
+> 7 0 9 3378
+> 7 0 9 3377
+> 7 0 9 3381
+> 7 0 9 3380
+> 7 0 9 3384
+> 7 0 9 3383
+> 7 0 9 3387
+> 7 0 9 3386
+> 7 0 9 3390
+> 7 0 9 3389
+> 7 0 9 3393
+> 7 0 9 3392
+> 7 0 9 3396
+> 7 0 9 3395
+> 7 0 9 3399
+> 7 0 9 3398
+> 7 0 9 3402
+> 7 0 9 3401
+> 7 0 9 3405
+> 7 0 9 3404
+> 7 0 9 3324
+> 7 0 9 3323
+> 7 0 9 3408
+> 7 0 9 3407
+> 7 0 9 3327
+> 7 0 9 3326
+> 7 0 9 3330
+> 7 0 9 3329
+> 7 0 9 3333
+> 7 0 9 3332
+> 7 0 9 3336
+> 7 0 9 3335
+> 7 0 9 3339
+> 7 0 9 3338
+> 7 0 9 3342
+> 7 0 9 3341
+> 7 0 9 3345
+> 7 0 9 3344
+> 7 0 7 3319
+> 7 0 7 3346
+> 7 0 7 3349
+> 7 0 7 3352
+> 7 0 7 3355
+> 7 0 7 3358
+> 7 0 7 3361
+> 7 0 7 3364
+> 7 0 7 3367
+> 7 0 7 3370
+> 7 0 7 3373
+> 7 0 7 3322
+> 7 0 7 3376
+> 7 0 7 3379
+> 7 0 7 3382
+> 7 0 7 3385
+> 7 0 7 3388
+> 7 0 7 3391
+> 7 0 7 3394
+> 7 0 7 3397
+> 7 0 7 3400
+> 7 0 7 3403
+> 7 0 7 3325
+> 7 0 7 3406
+> 7 0 7 3328
+> 7 0 7 3331
+> 7 0 7 3334
+> 7 0 7 3337
+> 7 0 7 3340
+> 7 0 7 3343
+> 7 0 12 3409
+> 7 0 6 3318
+> 7 0 12 3413
+> 7 0 6 3412
+> 7 0 3 3317
+> 7 0 3 3414
+> 7 0 3 3411
+> 7 0 1 2349
+> 7 0 9 3610
+> 7 0 9 3446
+> 7 0 9 3445
+> 7 0 9 3449
+> 7 0 9 3448
+> 7 0 9 3452
+> 7 0 9 3451
+> 7 0 9 3455
+> 7 0 9 3454
+> 7 0 9 3458
+> 7 0 9 3457
+> 7 0 9 3461
+> 7 0 9 3460
+> 7 0 9 3464
+> 7 0 9 3463
+> 7 0 9 3467
+> 7 0 9 3466
+> 7 0 9 3470
+> 7 0 9 3469
+> 7 0 9 3473
+> 7 0 9 3472
+> 7 0 9 3419
+> 7 0 9 3418
+> 7 0 9 3476
+> 7 0 9 3475
+> 7 0 9 3479
+> 7 0 9 3478
+> 7 0 9 3482
+> 7 0 9 3481
+> 7 0 9 3485
+> 7 0 9 3484
+> 7 0 9 3488
+> 7 0 9 3487
+> 7 0 9 3491
+> 7 0 9 3490
+> 7 0 9 3494
+> 7 0 9 3493
+> 7 0 9 3497
+> 7 0 9 3496
+> 7 0 9 3500
+> 7 0 9 3499
+> 7 0 9 3503
+> 7 0 9 3502
+> 7 0 9 3422
+> 7 0 9 3421
+> 7 0 9 3506
+> 7 0 9 3505
+> 7 0 9 3509
+> 7 0 9 3508
+> 7 0 9 3512
+> 7 0 9 3511
+> 7 0 9 3515
+> 7 0 9 3514
+> 7 0 9 3518
+> 7 0 9 3517
+> 7 0 9 3521
+> 7 0 9 3520
+> 7 0 9 3524
+> 7 0 9 3523
+> 7 0 9 3527
+> 7 0 9 3526
+> 7 0 9 3530
+> 7 0 9 3529
+> 7 0 9 3533
+> 7 0 9 3532
+> 7 0 9 3425
+> 7 0 9 3424
+> 7 0 9 3536
+> 7 0 9 3535
+> 7 0 9 3539
+> 7 0 9 3538
+> 7 0 9 3542
+> 7 0 9 3541
+> 7 0 9 3545
+> 7 0 9 3544
+> 7 0 9 3548
+> 7 0 9 3547
+> 7 0 9 3551
+> 7 0 9 3550
+> 7 0 9 3554
+> 7 0 9 3553
+> 7 0 9 3557
+> 7 0 9 3556
+> 7 0 9 3560
+> 7 0 9 3559
+> 7 0 9 3563
+> 7 0 9 3562
+> 7 0 9 3428
+> 7 0 9 3427
+> 7 0 9 3566
+> 7 0 9 3565
+> 7 0 9 3569
+> 7 0 9 3568
+> 7 0 9 3572
+> 7 0 9 3571
+> 7 0 9 3575
+> 7 0 9 3574
+> 7 0 9 3578
+> 7 0 9 3577
+> 7 0 9 3581
+> 7 0 9 3580
+> 7 0 9 3584
+> 7 0 9 3583
+> 7 0 9 3587
+> 7 0 9 3586
+> 7 0 9 3590
+> 7 0 9 3589
+> 7 0 9 3593
+> 7 0 9 3592
+> 7 0 9 3431
+> 7 0 9 3430
+> 7 0 9 3596
+> 7 0 9 3595
+> 7 0 9 3599
+> 7 0 9 3598
+> 7 0 9 3602
+> 7 0 9 3601
+> 7 0 9 3605
+> 7 0 9 3604
+> 7 0 9 3608
+> 7 0 9 3607
+> 7 0 9 3434
+> 7 0 9 3433
+> 7 0 9 3437
+> 7 0 9 3436
+> 7 0 9 3440
+> 7 0 9 3439
+> 7 0 9 3443
+> 7 0 9 3442
+> 7 0 7 3417
+> 7 0 7 3444
+> 7 0 7 3447
+> 7 0 7 3450
+> 7 0 7 3453
+> 7 0 7 3456
+> 7 0 7 3459
+> 7 0 7 3462
+> 7 0 7 3465
+> 7 0 7 3468
+> 7 0 7 3471
+> 7 0 7 3420
+> 7 0 7 3474
+> 7 0 7 3477
+> 7 0 7 3480
+> 7 0 7 3483
+> 7 0 7 3486
+> 7 0 7 3489
+> 7 0 7 3492
+> 7 0 7 3495
+> 7 0 7 3498
+> 7 0 7 3501
+> 7 0 7 3423
+> 7 0 7 3504
+> 7 0 7 3507
+> 7 0 7 3510
+> 7 0 7 3513
+> 7 0 7 3516
+> 7 0 7 3519
+> 7 0 7 3522
+> 7 0 7 3525
+> 7 0 7 3528
+> 7 0 7 3531
+> 7 0 7 3426
+> 7 0 7 3534
+> 7 0 7 3537
+> 7 0 7 3540
+> 7 0 7 3543
+> 7 0 7 3546
+> 7 0 7 3549
+> 7 0 7 3552
+> 7 0 7 3555
+> 7 0 7 3558
+> 7 0 7 3561
+> 7 0 7 3429
+> 7 0 7 3564
+> 7 0 7 3567
+> 7 0 7 3570
+> 7 0 7 3573
+> 7 0 7 3576
+> 7 0 7 3579
+> 7 0 7 3582
+> 7 0 7 3585
+> 7 0 7 3588
+> 7 0 7 3591
+> 7 0 7 3432
+> 7 0 7 3594
+> 7 0 7 3597
+> 7 0 7 3600
+> 7 0 7 3603
+> 7 0 7 3606
+> 7 0 7 3435
+> 7 0 7 3438
+> 7 0 7 3441
+> 7 0 12 3609
+> 7 0 6 3416
+> 7 0 9 3713
+> 7 0 9 3642
+> 7 0 9 3641
+> 7 0 9 3645
+> 7 0 9 3644
+> 7 0 9 3648
+> 7 0 9 3647
+> 7 0 9 3651
+> 7 0 9 3650
+> 7 0 9 3654
+> 7 0 9 3653
+> 7 0 9 3657
+> 7 0 9 3656
+> 7 0 9 3660
+> 7 0 9 3659
+> 7 0 9 3663
+> 7 0 9 3662
+> 7 0 9 3666
+> 7 0 9 3665
+> 7 0 9 3669
+> 7 0 9 3668
+> 7 0 9 3615
+> 7 0 9 3614
+> 7 0 9 3672
+> 7 0 9 3671
+> 7 0 9 3675
+> 7 0 9 3674
+> 7 0 9 3678
+> 7 0 9 3677
+> 7 0 9 3681
+> 7 0 9 3680
+> 7 0 9 3684
+> 7 0 9 3683
+> 7 0 9 3687
+> 7 0 9 3686
+> 7 0 9 3690
+> 7 0 9 3689
+> 7 0 9 3693
+> 7 0 9 3692
+> 7 0 9 3696
+> 7 0 9 3695
+> 7 0 9 3699
+> 7 0 9 3698
+> 7 0 9 3618
+> 7 0 9 3617
+> 7 0 9 3702
+> 7 0 9 3701
+> 7 0 9 3705
+> 7 0 9 3704
+> 7 0 9 3708
+> 7 0 9 3707
+> 7 0 9 3711
+> 7 0 9 3710
+> 7 0 9 3621
+> 7 0 9 3620
+> 7 0 9 3624
+> 7 0 9 3623
+> 7 0 9 3627
+> 7 0 9 3626
+> 7 0 9 3630
+> 7 0 9 3629
+> 7 0 9 3633
+> 7 0 9 3632
+> 7 0 9 3636
+> 7 0 9 3635
+> 7 0 9 3639
+> 7 0 9 3638
+> 7 0 7 3613
+> 7 0 7 3640
+> 7 0 7 3643
+> 7 0 7 3646
+> 7 0 7 3649
+> 7 0 7 3652
+> 7 0 7 3655
+> 7 0 7 3658
+> 7 0 7 3661
+> 7 0 7 3664
+> 7 0 7 3667
+> 7 0 7 3616
+> 7 0 7 3670
+> 7 0 7 3673
+> 7 0 7 3676
+> 7 0 7 3679
+> 7 0 7 3682
+> 7 0 7 3685
+> 7 0 7 3688
+> 7 0 7 3691
+> 7 0 7 3694
+> 7 0 7 3697
+> 7 0 7 3619
+> 7 0 7 3700
+> 7 0 7 3703
+> 7 0 7 3706
+> 7 0 7 3709
+> 7 0 7 3622
+> 7 0 7 3625
+> 7 0 7 3628
+> 7 0 7 3631
+> 7 0 7 3634
+> 7 0 7 3637
+> 7 0 12 3712
+> 7 0 6 3612
+> 7 0 9 3792
+> 7 0 9 3745
+> 7 0 9 3744
+> 7 0 9 3748
+> 7 0 9 3747
+> 7 0 9 3751
+> 7 0 9 3750
+> 7 0 9 3754
+> 7 0 9 3753
+> 7 0 9 3757
+> 7 0 9 3756
+> 7 0 9 3760
+> 7 0 9 3759
+> 7 0 9 3763
+> 7 0 9 3762
+> 7 0 9 3766
+> 7 0 9 3765
+> 7 0 9 3769
+> 7 0 9 3768
+> 7 0 9 3772
+> 7 0 9 3771
+> 7 0 9 3718
+> 7 0 9 3717
+> 7 0 9 3775
+> 7 0 9 3774
+> 7 0 9 3778
+> 7 0 9 3777
+> 7 0 9 3781
+> 7 0 9 3780
+> 7 0 9 3784
+> 7 0 9 3783
+> 7 0 9 3787
+> 7 0 9 3786
+> 7 0 9 3790
+> 7 0 9 3789
+> 7 0 9 3721
+> 7 0 9 3720
+> 7 0 9 3724
+> 7 0 9 3723
+> 7 0 9 3727
+> 7 0 9 3726
+> 7 0 9 3730
+> 7 0 9 3729
+> 7 0 9 3733
+> 7 0 9 3732
+> 7 0 9 3736
+> 7 0 9 3735
+> 7 0 9 3739
+> 7 0 9 3738
+> 7 0 9 3742
+> 7 0 9 3741
+> 7 0 7 3716
+> 7 0 7 3743
+> 7 0 7 3746
+> 7 0 7 3749
+> 7 0 7 3752
+> 7 0 7 3755
+> 7 0 7 3758
+> 7 0 7 3761
+> 7 0 7 3764
+> 7 0 7 3767
+> 7 0 7 3770
+> 7 0 7 3719
+> 7 0 7 3773
+> 7 0 7 3776
+> 7 0 7 3779
+> 7 0 7 3782
+> 7 0 7 3785
+> 7 0 7 3788
+> 7 0 7 3722
+> 7 0 7 3725
+> 7 0 7 3728
+> 7 0 7 3731
+> 7 0 7 3734
+> 7 0 7 3737
+> 7 0 7 3740
+> 7 0 12 3791
+> 7 0 6 3715
+> 7 0 9 3916
+> 7 0 9 3824
+> 7 0 9 3823
+> 7 0 9 3827
+> 7 0 9 3826
+> 7 0 9 3830
+> 7 0 9 3829
+> 7 0 9 3833
+> 7 0 9 3832
+> 7 0 9 3836
+> 7 0 9 3835
+> 7 0 9 3839
+> 7 0 9 3838
+> 7 0 9 3842
+> 7 0 9 3841
+> 7 0 9 3845
+> 7 0 9 3844
+> 7 0 9 3848
+> 7 0 9 3847
+> 7 0 9 3851
+> 7 0 9 3850
+> 7 0 9 3797
+> 7 0 9 3796
+> 7 0 9 3854
+> 7 0 9 3853
+> 7 0 9 3857
+> 7 0 9 3856
+> 7 0 9 3860
+> 7 0 9 3859
+> 7 0 9 3863
+> 7 0 9 3862
+> 7 0 9 3866
+> 7 0 9 3865
+> 7 0 9 3869
+> 7 0 9 3868
+> 7 0 9 3872
+> 7 0 9 3871
+> 7 0 9 3875
+> 7 0 9 3874
+> 7 0 9 3878
+> 7 0 9 3877
+> 7 0 9 3881
+> 7 0 9 3880
+> 7 0 9 3800
+> 7 0 9 3799
+> 7 0 9 3884
+> 7 0 9 3883
+> 7 0 9 3887
+> 7 0 9 3886
+> 7 0 9 3890
+> 7 0 9 3889
+> 7 0 9 3893
+> 7 0 9 3892
+> 7 0 9 3896
+> 7 0 9 3895
+> 7 0 9 3899
+> 7 0 9 3898
+> 7 0 9 3902
+> 7 0 9 3901
+> 7 0 9 3905
+> 7 0 9 3904
+> 7 0 9 3908
+> 7 0 9 3907
+> 7 0 9 3911
+> 7 0 9 3910
+> 7 0 9 3803
+> 7 0 9 3802
+> 7 0 9 3914
+> 7 0 9 3913
+> 7 0 9 3806
+> 7 0 9 3805
+> 7 0 9 3809
+> 7 0 9 3808
+> 7 0 9 3812
+> 7 0 9 3811
+> 7 0 9 3815
+> 7 0 9 3814
+> 7 0 9 3818
+> 7 0 9 3817
+> 7 0 9 3821
+> 7 0 9 3820
+> 7 0 7 3795
+> 7 0 7 3822
+> 7 0 7 3825
+> 7 0 7 3828
+> 7 0 7 3831
+> 7 0 7 3834
+> 7 0 7 3837
+> 7 0 7 3840
+> 7 0 7 3843
+> 7 0 7 3846
+> 7 0 7 3849
+> 7 0 7 3798
+> 7 0 7 3852
+> 7 0 7 3855
+> 7 0 7 3858
+> 7 0 7 3861
+> 7 0 7 3864
+> 7 0 7 3867
+> 7 0 7 3870
+> 7 0 7 3873
+> 7 0 7 3876
+> 7 0 7 3879
+> 7 0 7 3801
+> 7 0 7 3882
+> 7 0 7 3885
+> 7 0 7 3888
+> 7 0 7 3891
+> 7 0 7 3894
+> 7 0 7 3897
+> 7 0 7 3900
+> 7 0 7 3903
+> 7 0 7 3906
+> 7 0 7 3909
+> 7 0 7 3804
+> 7 0 7 3912
+> 7 0 7 3807
+> 7 0 7 3810
+> 7 0 7 3813
+> 7 0 7 3816
+> 7 0 7 3819
+> 7 0 12 3915
+> 7 0 6 3794
+> 7 0 12 3919
+> 7 0 6 3918
+> 7 0 3 3920
+> 7 0 3 3611
+> 7 0 3 3714
+> 7 0 3 3793
+> 7 0 3 3917
+> 7 0 1 3415
+> 7 0 9 4092
+> 7 0 9 3952
+> 7 0 9 3951
+> 7 0 9 3955
+> 7 0 9 3954
+> 7 0 9 3958
+> 7 0 9 3957
+> 7 0 9 3961
+> 7 0 9 3960
 > 7 0 9 3964
-> 7 0 9 4048
-> 7 0 9 4000
-> 7 0 9 4084
-> 7 0 9 4036
-> 7 0 7 3989
-> 7 0 7 4049
-> 7 0 7 3971
-> 7 0 9 3990
-> 7 0 7 4031
-> 7 0 9 3934
-> 7 0 9 4050
+> 7 0 9 3963
+> 7 0 9 3967
+> 7 0 9 3966
+> 7 0 9 3970
+> 7 0 9 3969
+> 7 0 9 3973
 > 7 0 9 3972
-> 7 0 9 4032
-> 7 0 7 3929
-> 7 0 9 3924
-> 7 0 9 3955
-> 7 0 9 3991
-> 7 0 9 3948
-> 7 0 9 4075
-> 7 0 9 4027
+> 7 0 9 3976
+> 7 0 9 3975
 > 7 0 9 3979
-> 7 0 7 3956
-> 7 0 9 4063
-> 7 0 7 4016
-> 7 0 7 4076
-> 7 0 9 3957
-> 7 0 7 3998
+> 7 0 9 3978
 > 7 0 9 3925
-> 7 0 9 4017
-> 7 0 7 4058
-> 7 0 9 4077
-> 7 0 9 3999
-> 7 0 9 4059
-> 7 0 9 3949
-> 7 0 7 3938
-> 7 0 9 3933
+> 7 0 9 3924
 > 7 0 9 3982
-> 7 0 9 4018
-> 7 0 9 3970
-> 7 0 9 4054
-> 7 0 9 4006
-> 7 0 7 3983
-> 7 0 9 4090
-> 7 0 7 4043
-> 7 0 7 3965
+> 7 0 9 3981
+> 7 0 9 3985
 > 7 0 9 3984
-> 7 0 7 4025
-> 7 0 9 4092
-> 7 0 9 4044
-> 7 0 7 4085
-> 7 0 9 3966
-> 7 0 7 4007
-> 7 0 9 4026
-> 7 0 7 4067
-> 7 0 9 3940
-> 7 0 9 4086
-> 7 0 9 4008
-> 7 0 7 3923
-> 7 0 9 4068
-> 7 0 7 3947
-> 7 0 9 3942
-> 7 0 9 3961
-> 7 0 9 4045
+> 7 0 9 3988
+> 7 0 9 3987
+> 7 0 9 3991
+> 7 0 9 3990
+> 7 0 9 3994
+> 7 0 9 3993
 > 7 0 9 3997
-> 7 0 9 4081
-> 7 0 7 3950
-> 7 0 9 4033
-> 7 0 7 4010
-> 7 0 9 4069
-> 7 0 7 4070
-> 7 0 9 3951
-> 7 0 7 3992
+> 7 0 9 3996
+> 7 0 9 4000
+> 7 0 9 3999
+> 7 0 9 4003
+> 7 0 9 4002
+> 7 0 9 4006
+> 7 0 9 4005
+> 7 0 9 4009
+> 7 0 9 4008
+> 7 0 9 3928
+> 7 0 9 3927
+> 7 0 9 4012
 > 7 0 9 4011
-> 7 0 7 4052
-> 7 0 7 3974
-> 7 0 9 4071
+> 7 0 9 4015
+> 7 0 9 4014
+> 7 0 9 4018
+> 7 0 9 4017
+> 7 0 9 4021
+> 7 0 9 4020
+> 7 0 9 4024
+> 7 0 9 4023
+> 7 0 9 4027
+> 7 0 9 4026
+> 7 0 9 4030
+> 7 0 9 4029
+> 7 0 9 4033
+> 7 0 9 4032
+> 7 0 9 4036
+> 7 0 9 4035
+> 7 0 9 4039
+> 7 0 9 4038
 > 7 0 9 3931
-> 7 0 9 3993
-> 7 0 7 4034
+> 7 0 9 3930
+> 7 0 9 4042
+> 7 0 9 4041
+> 7 0 9 4045
+> 7 0 9 4044
+> 7 0 9 4048
+> 7 0 9 4047
+> 7 0 9 4051
+> 7 0 9 4050
+> 7 0 9 4054
 > 7 0 9 4053
-> 7 0 9 3975
-> 7 0 9 4035
-> 7 0 7 3932
-> 7 0 9 3927
-> 7 0 9 3952
-> 7 0 9 3988
-> 7 0 9 4072
-> 7 0 9 4024
-> 7 0 9 3976
+> 7 0 9 4057
+> 7 0 9 4056
 > 7 0 9 4060
-> 7 0 7 3959
-> 7 0 7 4019
-> 7 0 7 4079
-> 7 0 7 4001
-> 7 0 9 3960
-> 7 0 7 4061
-> 7 0 9 4020
-> 7 0 9 4080
-> 7 0 9 4002
+> 7 0 9 4059
+> 7 0 9 4063
 > 7 0 9 4062
-> 7 0 9 3946
-> 7 0 7 3941
-> 7 0 9 3936
-> 7 0 9 4015
-> 7 0 9 3967
-> 7 0 9 4051
-> 7 0 9 4003
+> 7 0 9 4066
+> 7 0 9 4065
+> 7 0 9 4069
+> 7 0 9 4068
+> 7 0 9 3934
+> 7 0 9 3933
+> 7 0 9 4072
+> 7 0 9 4071
+> 7 0 9 4075
+> 7 0 9 4074
+> 7 0 9 4078
+> 7 0 9 4077
+> 7 0 9 4081
+> 7 0 9 4080
+> 7 0 9 4084
+> 7 0 9 4083
 > 7 0 9 4087
-> 7 0 9 4039
-> 7 0 7 3986
-> 7 0 7 4046
-> 7 0 7 3968
-> 7 0 7 4028
-> 7 0 9 3987
-> 7 0 9 4047
-> 7 0 7 4088
-> 7 0 9 3969
-> 7 0 9 3937
-> 7 0 9 4029
+> 7 0 9 4086
+> 7 0 9 4090
 > 7 0 9 4089
-> 7 0 7 3926
-> 7 0 12 4091
-> 7 0 9 3958
-> 7 0 9 4042
+> 7 0 9 3937
+> 7 0 9 3936
+> 7 0 9 3940
+> 7 0 9 3939
+> 7 0 9 3943
+> 7 0 9 3942
+> 7 0 9 3946
 > 7 0 9 3945
-> 7 0 9 3994
-> 7 0 9 4078
-> 7 0 9 4030
+> 7 0 9 3949
+> 7 0 9 3948
+> 7 0 7 3923
+> 7 0 7 3950
 > 7 0 7 3953
+> 7 0 7 3956
+> 7 0 7 3959
+> 7 0 7 3962
+> 7 0 7 3965
+> 7 0 7 3968
+> 7 0 7 3971
+> 7 0 7 3974
+> 7 0 7 3977
+> 7 0 7 3926
+> 7 0 7 3980
+> 7 0 7 3983
+> 7 0 7 3986
+> 7 0 7 3989
+> 7 0 7 3992
+> 7 0 7 3995
+> 7 0 7 3998
+> 7 0 7 4001
+> 7 0 7 4004
+> 7 0 7 4007
+> 7 0 7 3929
+> 7 0 7 4010
 > 7 0 7 4013
-> 7 0 9 4066
-> 7 0 7 4073
-> 7 0 7 3995
-> 7 0 9 3954
-> 7 0 7 4055
-> 7 0 9 4014
-> 7 0 7 3977
-> 7 0 9 3928
-> 7 0 9 4074
+> 7 0 7 4016
+> 7 0 7 4019
+> 7 0 7 4022
+> 7 0 7 4025
+> 7 0 7 4028
+> 7 0 7 4031
+> 7 0 7 4034
 > 7 0 7 4037
-> 7 0 9 3996
-> 7 0 9 4056
-> 7 0 9 3978
-> 7 0 9 4038
-> 7 0 7 3935
-> 7 0 9 3930
-> 7 0 9 3985
-> 7 0 9 4021
-> 7 0 9 3973
-> 7 0 9 4057
-> 7 0 7 3980
-> 7 0 9 4009
+> 7 0 7 3932
 > 7 0 7 4040
-> 7 0 7 3962
-> 7 0 7 4022
-> 7 0 9 3981
-> 7 0 9 4041
-> 7 0 7 4082
-> 7 0 7 4004
-> 7 0 9 3963
+> 7 0 7 4043
+> 7 0 7 4046
+> 7 0 7 4049
+> 7 0 7 4052
+> 7 0 7 4055
+> 7 0 7 4058
+> 7 0 7 4061
 > 7 0 7 4064
-> 7 0 9 4023
-> 7 0 9 4083
-> 7 0 9 4005
-> 7 0 9 3943
-> 7 0 9 4065
+> 7 0 7 4067
+> 7 0 7 3935
+> 7 0 7 4070
+> 7 0 7 4073
+> 7 0 7 4076
+> 7 0 7 4079
+> 7 0 7 4082
+> 7 0 7 4085
+> 7 0 7 4088
+> 7 0 7 3938
+> 7 0 7 3941
 > 7 0 7 3944
+> 7 0 7 3947
+> 7 0 12 4091
 > 7 0 6 3922
-> 7 0 3 4247
-> 7 0 3 4389
-> 7 0 3 4386
-> 7 0 12 4388
-> 7 0 6 4387
-> 7 0 7 4273
-> 7 0 9 4281
-> 7 0 9 4265
-> 7 0 9 4341
-> 7 0 9 4317
-> 7 0 9 4293
-> 7 0 9 4377
-> 7 0 9 4353
-> 7 0 9 4329
-> 7 0 7 4279
-> 7 0 9 4305
-> 7 0 7 4309
-> 7 0 7 4339
-> 7 0 9 4365
-> 7 0 7 4369
-> 7 0 9 4277
-> 7 0 7 4291
-> 7 0 9 4307
-> 7 0 7 4321
-> 7 0 9 4337
-> 7 0 7 4351
-> 7 0 9 4367
-> 7 0 7 4381
-> 7 0 9 4254
-> 7 0 9 4289
-> 7 0 7 4303
-> 7 0 9 4319
-> 7 0 7 4333
-> 7 0 9 4349
-> 7 0 7 4363
-> 7 0 9 4379
-> 7 0 9 4266
-> 7 0 9 4301
-> 7 0 9 4331
-> 7 0 9 4361
-> 7 0 7 4258
-> 7 0 9 4250
-> 7 0 7 4270
-> 7 0 9 4262
-> 7 0 9 4308
-> 7 0 9 4284
-> 7 0 9 4368
-> 7 0 9 4344
-> 7 0 9 4274
-> 7 0 9 4320
-> 7 0 9 4296
-> 7 0 9 4380
-> 7 0 7 4276
-> 7 0 9 4356
-> 7 0 7 4306
-> 7 0 9 4332
-> 7 0 7 4336
-> 7 0 7 4366
-> 7 0 7 4288
-> 7 0 7 4318
-> 7 0 7 4348
-> 7 0 7 4378
-> 7 0 9 4286
-> 7 0 7 4300
-> 7 0 9 4385
-> 7 0 9 4316
-> 7 0 7 4330
-> 7 0 9 4257
-> 7 0 9 4346
-> 7 0 7 4360
-> 7 0 9 4376
-> 7 0 9 4298
-> 7 0 9 4328
-> 7 0 9 4269
-> 7 0 9 4358
-> 7 0 7 4255
-> 7 0 7 4267
-> 7 0 12 4384
-> 7 0 9 4259
-> 7 0 9 4311
-> 7 0 9 4287
-> 7 0 9 4271
-> 7 0 9 4371
-> 7 0 9 4347
-> 7 0 9 4323
-> 7 0 9 4299
-> 7 0 9 4383
-> 7 0 9 4359
-> 7 0 9 4335
-> 7 0 7 4285
-> 7 0 7 4315
-> 7 0 7 4345
-> 7 0 7 4375
-> 7 0 9 4283
-> 7 0 7 4297
-> 7 0 9 4313
-> 7 0 7 4327
-> 7 0 9 4343
-> 7 0 7 4357
-> 7 0 9 4373
-> 7 0 9 4260
-> 7 0 9 4295
-> 7 0 9 4325
-> 7 0 9 4355
-> 7 0 9 4272
-> 7 0 7 4252
-> 7 0 7 4264
-> 7 0 9 4256
-> 7 0 9 4278
-> 7 0 9 4338
-> 7 0 9 4268
-> 7 0 9 4314
-> 7 0 9 4290
-> 7 0 9 4374
-> 7 0 9 4350
-> 7 0 9 4326
-> 7 0 9 4302
-> 7 0 7 4282
-> 7 0 9 4362
-> 7 0 7 4312
-> 7 0 7 4342
-> 7 0 7 4372
-> 7 0 9 4280
-> 7 0 7 4294
-> 7 0 9 4310
-> 7 0 7 4324
-> 7 0 9 4251
-> 7 0 9 4340
-> 7 0 7 4354
-> 7 0 9 4370
-> 7 0 9 4292
-> 7 0 9 4322
-> 7 0 9 4263
-> 7 0 9 4352
-> 7 0 9 4382
-> 7 0 9 4304
-> 7 0 9 4334
-> 7 0 7 4249
-> 7 0 9 4275
-> 7 0 9 4364
-> 7 0 7 4261
-> 7 0 9 4253
-> 7 0 6 4248
-> 7 0 9 4177
-> 7 0 9 4207
-> 7 0 7 4095
-> 7 0 9 4121
-> 7 0 9 4237
-> 7 0 7 4107
-> 7 0 9 4105
-> 7 0 7 4119
+> 7 0 9 4246
 > 7 0 9 4124
-> 7 0 9 4184
-> 7 0 9 4160
-> 7 0 9 4117
-> 7 0 9 4136
-> 7 0 9 4244
-> 7 0 9 4220
-> 7 0 9 4196
-> 7 0 9 4172
-> 7 0 9 4148
-> 7 0 9 4232
-> 7 0 7 4128
-> 7 0 9 4208
-> 7 0 7 4158
-> 7 0 7 4188
-> 7 0 7 4218
-> 7 0 7 4140
-> 7 0 7 4170
-> 7 0 9 4132
-> 7 0 7 4200
-> 7 0 9 4100
-> 7 0 9 4162
-> 7 0 7 4230
-> 7 0 9 4192
-> 7 0 9 4222
-> 7 0 9 4144
-> 7 0 9 4112
-> 7 0 9 4174
-> 7 0 9 4204
-> 7 0 9 4234
-> 7 0 7 4104
-> 7 0 9 4102
-> 7 0 7 4116
+> 7 0 9 4123
 > 7 0 9 4127
-> 7 0 9 4114
-> 7 0 9 4187
-> 7 0 9 4163
+> 7 0 9 4126
+> 7 0 9 4130
+> 7 0 9 4129
+> 7 0 9 4133
+> 7 0 9 4132
+> 7 0 9 4136
+> 7 0 9 4135
 > 7 0 9 4139
-> 7 0 9 4223
-> 7 0 9 4199
-> 7 0 9 4175
-> 7 0 7 4125
+> 7 0 9 4138
+> 7 0 9 4142
+> 7 0 9 4141
+> 7 0 9 4145
+> 7 0 9 4144
+> 7 0 9 4148
+> 7 0 9 4147
 > 7 0 9 4151
-> 7 0 7 4155
-> 7 0 9 4235
-> 7 0 7 4185
-> 7 0 9 4211
-> 7 0 7 4215
-> 7 0 7 4137
-> 7 0 7 4167
-> 7 0 9 4129
-> 7 0 7 4197
+> 7 0 9 4150
+> 7 0 9 4097
+> 7 0 9 4096
+> 7 0 9 4154
+> 7 0 9 4153
+> 7 0 9 4157
+> 7 0 9 4156
+> 7 0 9 4160
 > 7 0 9 4159
-> 7 0 7 4227
-> 7 0 7 4149
-> 7 0 9 4189
-> 7 0 9 4103
-> 7 0 7 4179
-> 7 0 9 4219
-> 7 0 9 4141
-> 7 0 7 4209
+> 7 0 9 4163
+> 7 0 9 4162
+> 7 0 9 4166
+> 7 0 9 4165
+> 7 0 9 4169
+> 7 0 9 4168
+> 7 0 9 4172
 > 7 0 9 4171
-> 7 0 7 4239
-> 7 0 9 4201
-> 7 0 9 4115
-> 7 0 9 4231
-> 7 0 7 4101
+> 7 0 9 4175
+> 7 0 9 4174
+> 7 0 9 4178
+> 7 0 9 4177
+> 7 0 9 4181
+> 7 0 9 4180
+> 7 0 9 4100
 > 7 0 9 4099
-> 7 0 7 4113
-> 7 0 9 4154
-> 7 0 9 4111
-> 7 0 9 4130
-> 7 0 9 4214
+> 7 0 9 4184
+> 7 0 9 4183
+> 7 0 9 4187
+> 7 0 9 4186
 > 7 0 9 4190
-> 7 0 9 4166
-> 7 0 9 4142
-> 7 0 9 4226
-> 7 0 7 4122
+> 7 0 9 4189
+> 7 0 9 4193
+> 7 0 9 4192
+> 7 0 9 4196
+> 7 0 9 4195
+> 7 0 9 4199
+> 7 0 9 4198
 > 7 0 9 4202
-> 7 0 12 4245
-> 7 0 7 4152
-> 7 0 9 4178
-> 7 0 7 4182
-> 7 0 7 4212
-> 7 0 9 4238
-> 7 0 7 4134
-> 7 0 7 4242
-> 7 0 7 4164
-> 7 0 9 4126
-> 7 0 7 4194
-> 7 0 9 4156
-> 7 0 7 4224
-> 7 0 7 4146
-> 7 0 9 4186
-> 7 0 9 4246
-> 7 0 7 4176
+> 7 0 9 4201
+> 7 0 9 4205
+> 7 0 9 4204
+> 7 0 9 4208
+> 7 0 9 4207
+> 7 0 9 4211
+> 7 0 9 4210
+> 7 0 9 4103
+> 7 0 9 4102
+> 7 0 9 4214
+> 7 0 9 4213
+> 7 0 9 4217
 > 7 0 9 4216
-> 7 0 9 4138
-> 7 0 7 4206
-> 7 0 9 4106
-> 7 0 9 4168
-> 7 0 7 4236
-> 7 0 9 4198
+> 7 0 9 4220
+> 7 0 9 4219
+> 7 0 9 4223
+> 7 0 9 4222
+> 7 0 9 4226
+> 7 0 9 4225
+> 7 0 9 4229
 > 7 0 9 4228
-> 7 0 9 4150
-> 7 0 9 4118
-> 7 0 9 4180
-> 7 0 9 4210
-> 7 0 7 4098
+> 7 0 9 4232
+> 7 0 9 4231
+> 7 0 9 4235
+> 7 0 9 4234
+> 7 0 9 4238
+> 7 0 9 4237
+> 7 0 9 4241
 > 7 0 9 4240
-> 7 0 9 4096
-> 7 0 7 4110
+> 7 0 9 4106
+> 7 0 9 4105
+> 7 0 9 4244
+> 7 0 9 4243
+> 7 0 9 4109
 > 7 0 9 4108
-> 7 0 9 4157
-> 7 0 9 4133
-> 7 0 9 4217
+> 7 0 9 4112
+> 7 0 9 4111
+> 7 0 9 4115
+> 7 0 9 4114
+> 7 0 9 4118
+> 7 0 9 4117
+> 7 0 9 4121
 > 7 0 9 4120
-> 7 0 9 4193
-> 7 0 9 4169
-> 7 0 9 4145
-> 7 0 9 4229
-> 7 0 9 4205
-> 7 0 9 4181
+> 7 0 7 4095
+> 7 0 7 4122
+> 7 0 7 4125
+> 7 0 7 4128
 > 7 0 7 4131
-> 7 0 7 4161
-> 7 0 9 4241
-> 7 0 9 4123
-> 7 0 7 4191
-> 7 0 9 4153
-> 7 0 7 4221
+> 7 0 7 4134
+> 7 0 7 4137
+> 7 0 7 4140
 > 7 0 7 4143
-> 7 0 9 4183
-> 7 0 9 4097
+> 7 0 7 4146
+> 7 0 7 4149
+> 7 0 7 4098
+> 7 0 7 4152
+> 7 0 7 4155
+> 7 0 7 4158
+> 7 0 7 4161
+> 7 0 7 4164
+> 7 0 7 4167
+> 7 0 7 4170
 > 7 0 7 4173
-> 7 0 9 4213
-> 7 0 9 4135
+> 7 0 7 4176
+> 7 0 7 4179
+> 7 0 7 4101
+> 7 0 7 4182
+> 7 0 7 4185
+> 7 0 7 4188
+> 7 0 7 4191
+> 7 0 7 4194
+> 7 0 7 4197
+> 7 0 7 4200
 > 7 0 7 4203
-> 7 0 9 4243
-> 7 0 9 4165
+> 7 0 7 4206
+> 7 0 7 4209
+> 7 0 7 4104
+> 7 0 7 4212
+> 7 0 7 4215
+> 7 0 7 4218
+> 7 0 7 4221
+> 7 0 7 4224
+> 7 0 7 4227
+> 7 0 7 4230
 > 7 0 7 4233
-> 7 0 9 4195
-> 7 0 9 4109
-> 7 0 9 4225
-> 7 0 9 4147
+> 7 0 7 4236
+> 7 0 7 4239
+> 7 0 7 4107
+> 7 0 7 4242
+> 7 0 7 4110
+> 7 0 7 4113
+> 7 0 7 4116
+> 7 0 7 4119
+> 7 0 12 4245
 > 7 0 6 4094
+> 7 0 9 4385
+> 7 0 9 4278
+> 7 0 9 4277
+> 7 0 9 4281
+> 7 0 9 4280
+> 7 0 9 4284
+> 7 0 9 4283
+> 7 0 9 4287
+> 7 0 9 4286
+> 7 0 9 4290
+> 7 0 9 4289
+> 7 0 9 4293
+> 7 0 9 4292
+> 7 0 9 4296
+> 7 0 9 4295
+> 7 0 9 4299
+> 7 0 9 4298
+> 7 0 9 4302
+> 7 0 9 4301
+> 7 0 9 4305
+> 7 0 9 4304
+> 7 0 9 4251
+> 7 0 9 4250
+> 7 0 9 4308
+> 7 0 9 4307
+> 7 0 9 4311
+> 7 0 9 4310
+> 7 0 9 4314
+> 7 0 9 4313
+> 7 0 9 4317
+> 7 0 9 4316
+> 7 0 9 4320
+> 7 0 9 4319
+> 7 0 9 4323
+> 7 0 9 4322
+> 7 0 9 4326
+> 7 0 9 4325
+> 7 0 9 4329
+> 7 0 9 4328
+> 7 0 9 4332
+> 7 0 9 4331
+> 7 0 9 4335
+> 7 0 9 4334
+> 7 0 9 4254
+> 7 0 9 4253
+> 7 0 9 4338
+> 7 0 9 4337
+> 7 0 9 4341
+> 7 0 9 4340
+> 7 0 9 4344
+> 7 0 9 4343
+> 7 0 9 4347
+> 7 0 9 4346
+> 7 0 9 4350
+> 7 0 9 4349
+> 7 0 9 4353
+> 7 0 9 4352
+> 7 0 9 4356
+> 7 0 9 4355
+> 7 0 9 4359
+> 7 0 9 4358
+> 7 0 9 4362
+> 7 0 9 4361
+> 7 0 9 4365
+> 7 0 9 4364
+> 7 0 9 4257
+> 7 0 9 4256
+> 7 0 9 4368
+> 7 0 9 4367
+> 7 0 9 4371
+> 7 0 9 4370
+> 7 0 9 4374
+> 7 0 9 4373
+> 7 0 9 4377
+> 7 0 9 4376
+> 7 0 9 4380
+> 7 0 9 4379
+> 7 0 9 4383
+> 7 0 9 4382
+> 7 0 9 4260
+> 7 0 9 4259
+> 7 0 9 4263
+> 7 0 9 4262
+> 7 0 9 4266
+> 7 0 9 4265
+> 7 0 9 4269
+> 7 0 9 4268
+> 7 0 9 4272
+> 7 0 9 4271
+> 7 0 9 4275
+> 7 0 9 4274
+> 7 0 7 4249
+> 7 0 7 4276
+> 7 0 7 4279
+> 7 0 7 4282
+> 7 0 7 4285
+> 7 0 7 4288
+> 7 0 7 4291
+> 7 0 7 4294
+> 7 0 7 4297
+> 7 0 7 4300
+> 7 0 7 4303
+> 7 0 7 4252
+> 7 0 7 4306
+> 7 0 7 4309
+> 7 0 7 4312
+> 7 0 7 4315
+> 7 0 7 4318
+> 7 0 7 4321
+> 7 0 7 4324
+> 7 0 7 4327
+> 7 0 7 4330
+> 7 0 7 4333
+> 7 0 7 4255
+> 7 0 7 4336
+> 7 0 7 4339
+> 7 0 7 4342
+> 7 0 7 4345
+> 7 0 7 4348
+> 7 0 7 4351
+> 7 0 7 4354
+> 7 0 7 4357
+> 7 0 7 4360
+> 7 0 7 4363
+> 7 0 7 4258
+> 7 0 7 4366
+> 7 0 7 4369
+> 7 0 7 4372
+> 7 0 7 4375
+> 7 0 7 4378
+> 7 0 7 4381
+> 7 0 7 4261
+> 7 0 7 4264
+> 7 0 7 4267
+> 7 0 7 4270
+> 7 0 7 4273
+> 7 0 12 4384
+> 7 0 6 4248
+> 7 0 12 4388
+> 7 0 6 4387
+> 7 0 3 4389
+> 7 0 3 4093
+> 7 0 3 4247
+> 7 0 3 4386
 > 7 0 1 3921
+> 7 0 9 4633
+> 7 0 9 4421
+> 7 0 9 4420
+> 7 0 9 4424
+> 7 0 9 4423
+> 7 0 9 4427
+> 7 0 9 4426
+> 7 0 9 4430
+> 7 0 9 4429
+> 7 0 9 4433
+> 7 0 9 4432
+> 7 0 9 4436
+> 7 0 9 4435
+> 7 0 9 4439
+> 7 0 9 4438
+> 7 0 9 4442
+> 7 0 9 4441
+> 7 0 9 4445
+> 7 0 9 4444
+> 7 0 9 4448
+> 7 0 9 4447
+> 7 0 9 4394
+> 7 0 9 4393
+> 7 0 9 4451
+> 7 0 9 4450
+> 7 0 9 4454
+> 7 0 9 4453
+> 7 0 9 4457
+> 7 0 9 4456
+> 7 0 9 4460
+> 7 0 9 4459
+> 7 0 9 4463
+> 7 0 9 4462
+> 7 0 9 4466
+> 7 0 9 4465
+> 7 0 9 4469
+> 7 0 9 4468
+> 7 0 9 4472
+> 7 0 9 4471
+> 7 0 9 4475
+> 7 0 9 4474
+> 7 0 9 4478
+> 7 0 9 4477
+> 7 0 9 4397
+> 7 0 9 4396
+> 7 0 9 4481
+> 7 0 9 4480
+> 7 0 9 4484
+> 7 0 9 4483
+> 7 0 9 4487
+> 7 0 9 4486
+> 7 0 9 4490
+> 7 0 9 4489
+> 7 0 9 4493
+> 7 0 9 4492
+> 7 0 9 4496
+> 7 0 9 4495
+> 7 0 9 4499
+> 7 0 9 4498
+> 7 0 9 4502
+> 7 0 9 4501
+> 7 0 9 4505
+> 7 0 9 4504
+> 7 0 9 4508
+> 7 0 9 4507
+> 7 0 9 4400
+> 7 0 9 4399
+> 7 0 9 4511
+> 7 0 9 4510
+> 7 0 9 4514
+> 7 0 9 4513
+> 7 0 9 4517
+> 7 0 9 4516
+> 7 0 9 4520
+> 7 0 9 4519
+> 7 0 9 4523
+> 7 0 9 4522
+> 7 0 9 4526
+> 7 0 9 4525
+> 7 0 9 4529
+> 7 0 9 4528
+> 7 0 9 4532
+> 7 0 9 4531
+> 7 0 9 4535
+> 7 0 9 4534
+> 7 0 9 4538
+> 7 0 9 4537
+> 7 0 9 4403
+> 7 0 9 4402
+> 7 0 9 4541
+> 7 0 9 4540
+> 7 0 9 4544
+> 7 0 9 4543
+> 7 0 9 4547
+> 7 0 9 4546
+> 7 0 9 4550
+> 7 0 9 4549
+> 7 0 9 4553
+> 7 0 9 4552
+> 7 0 9 4556
+> 7 0 9 4555
+> 7 0 9 4559
+> 7 0 9 4558
+> 7 0 9 4562
+> 7 0 9 4561
+> 7 0 9 4565
+> 7 0 9 4564
+> 7 0 9 4568
+> 7 0 9 4567
+> 7 0 9 4406
+> 7 0 9 4405
+> 7 0 9 4571
+> 7 0 9 4570
+> 7 0 9 4574
+> 7 0 9 4573
+> 7 0 9 4577
+> 7 0 9 4576
+> 7 0 9 4580
+> 7 0 9 4579
+> 7 0 9 4583
+> 7 0 9 4582
+> 7 0 9 4586
+> 7 0 9 4585
+> 7 0 9 4589
+> 7 0 9 4588
+> 7 0 9 4592
+> 7 0 9 4591
+> 7 0 9 4595
+> 7 0 9 4594
+> 7 0 9 4598
+> 7 0 9 4597
+> 7 0 9 4409
+> 7 0 9 4408
+> 7 0 9 4601
+> 7 0 9 4600
+> 7 0 9 4604
+> 7 0 9 4603
+> 7 0 9 4607
+> 7 0 9 4606
+> 7 0 9 4610
+> 7 0 9 4609
+> 7 0 9 4613
+> 7 0 9 4612
+> 7 0 9 4616
+> 7 0 9 4615
+> 7 0 9 4619
+> 7 0 9 4618
+> 7 0 9 4622
+> 7 0 9 4621
+> 7 0 9 4625
+> 7 0 9 4624
+> 7 0 9 4628
+> 7 0 9 4627
+> 7 0 9 4412
+> 7 0 9 4411
+> 7 0 9 4631
+> 7 0 9 4630
+> 7 0 9 4415
+> 7 0 9 4414
+> 7 0 9 4418
+> 7 0 9 4417
+> 7 0 7 4392
+> 7 0 7 4419
+> 7 0 7 4422
+> 7 0 7 4425
+> 7 0 7 4428
+> 7 0 7 4431
+> 7 0 7 4434
+> 7 0 7 4437
+> 7 0 7 4440
+> 7 0 7 4443
+> 7 0 7 4446
+> 7 0 7 4395
+> 7 0 7 4449
+> 7 0 7 4452
+> 7 0 7 4455
+> 7 0 7 4458
+> 7 0 7 4461
+> 7 0 7 4464
+> 7 0 7 4467
+> 7 0 7 4470
+> 7 0 7 4473
+> 7 0 7 4476
+> 7 0 7 4398
+> 7 0 7 4479
+> 7 0 7 4482
+> 7 0 7 4485
+> 7 0 7 4488
+> 7 0 7 4491
+> 7 0 7 4494
+> 7 0 7 4497
+> 7 0 7 4500
+> 7 0 7 4503
+> 7 0 7 4506
+> 7 0 7 4401
+> 7 0 7 4509
+> 7 0 7 4512
+> 7 0 7 4515
+> 7 0 7 4518
+> 7 0 7 4521
+> 7 0 7 4524
+> 7 0 7 4527
+> 7 0 7 4530
+> 7 0 7 4533
+> 7 0 7 4536
+> 7 0 7 4404
+> 7 0 7 4539
+> 7 0 7 4542
+> 7 0 7 4545
+> 7 0 7 4548
+> 7 0 7 4551
+> 7 0 7 4554
+> 7 0 7 4557
+> 7 0 7 4560
+> 7 0 7 4563
+> 7 0 7 4566
+> 7 0 7 4407
+> 7 0 7 4569
+> 7 0 7 4572
+> 7 0 7 4575
+> 7 0 7 4578
+> 7 0 7 4581
+> 7 0 7 4584
+> 7 0 7 4587
+> 7 0 7 4590
+> 7 0 7 4593
+> 7 0 7 4596
+> 7 0 7 4410
+> 7 0 7 4599
+> 7 0 7 4602
+> 7 0 7 4605
+> 7 0 7 4608
+> 7 0 7 4611
+> 7 0 7 4614
+> 7 0 7 4617
+> 7 0 7 4620
+> 7 0 7 4623
+> 7 0 7 4626
+> 7 0 7 4413
+> 7 0 7 4629
+> 7 0 7 4416
+> 7 0 12 4632
+> 7 0 6 4391
+> 7 0 9 4793
+> 7 0 9 4665
+> 7 0 9 4664
+> 7 0 9 4668
+> 7 0 9 4667
+> 7 0 9 4671
+> 7 0 9 4670
+> 7 0 9 4674
+> 7 0 9 4673
+> 7 0 9 4677
+> 7 0 9 4676
+> 7 0 9 4680
+> 7 0 9 4679
+> 7 0 9 4683
+> 7 0 9 4682
+> 7 0 9 4686
+> 7 0 9 4685
+> 7 0 9 4689
+> 7 0 9 4688
+> 7 0 9 4692
+> 7 0 9 4691
+> 7 0 9 4638
+> 7 0 9 4637
+> 7 0 9 4695
+> 7 0 9 4694
+> 7 0 9 4698
+> 7 0 9 4697
+> 7 0 9 4701
+> 7 0 9 4700
+> 7 0 9 4704
+> 7 0 9 4703
+> 7 0 9 4707
+> 7 0 9 4706
+> 7 0 9 4710
+> 7 0 9 4709
+> 7 0 9 4713
+> 7 0 9 4712
+> 7 0 9 4716
+> 7 0 9 4715
+> 7 0 9 4719
+> 7 0 9 4718
+> 7 0 9 4722
+> 7 0 9 4721
+> 7 0 9 4641
+> 7 0 9 4640
+> 7 0 9 4725
+> 7 0 9 4724
+> 7 0 9 4728
+> 7 0 9 4727
+> 7 0 9 4731
+> 7 0 9 4730
+> 7 0 9 4734
+> 7 0 9 4733
+> 7 0 9 4737
+> 7 0 9 4736
+> 7 0 9 4740
+> 7 0 9 4739
+> 7 0 9 4743
+> 7 0 9 4742
+> 7 0 9 4746
+> 7 0 9 4745
+> 7 0 9 4749
+> 7 0 9 4748
+> 7 0 9 4752
+> 7 0 9 4751
+> 7 0 9 4644
+> 7 0 9 4643
+> 7 0 9 4755
+> 7 0 9 4754
+> 7 0 9 4758
+> 7 0 9 4757
+> 7 0 9 4761
+> 7 0 9 4760
+> 7 0 9 4764
+> 7 0 9 4763
+> 7 0 9 4767
+> 7 0 9 4766
+> 7 0 9 4770
+> 7 0 9 4769
+> 7 0 9 4773
+> 7 0 9 4772
+> 7 0 9 4776
+> 7 0 9 4775
+> 7 0 9 4779
+> 7 0 9 4778
+> 7 0 9 4782
+> 7 0 9 4781
+> 7 0 9 4647
+> 7 0 9 4646
+> 7 0 9 4785
+> 7 0 9 4784
+> 7 0 9 4788
+> 7 0 9 4787
+> 7 0 9 4791
+> 7 0 9 4790
+> 7 0 9 4650
+> 7 0 9 4649
+> 7 0 9 4653
+> 7 0 9 4652
+> 7 0 9 4656
+> 7 0 9 4655
+> 7 0 9 4659
+> 7 0 9 4658
+> 7 0 9 4662
+> 7 0 9 4661
+> 7 0 7 4636
+> 7 0 7 4663
+> 7 0 7 4666
+> 7 0 7 4669
+> 7 0 7 4672
+> 7 0 7 4675
+> 7 0 7 4678
+> 7 0 7 4681
+> 7 0 7 4684
+> 7 0 7 4687
+> 7 0 7 4690
+> 7 0 7 4639
+> 7 0 7 4693
+> 7 0 7 4696
+> 7 0 7 4699
+> 7 0 7 4702
+> 7 0 7 4705
+> 7 0 7 4708
+> 7 0 7 4711
+> 7 0 7 4714
+> 7 0 7 4717
+> 7 0 7 4720
+> 7 0 7 4642
+> 7 0 7 4723
+> 7 0 7 4726
+> 7 0 7 4729
+> 7 0 7 4732
+> 7 0 7 4735
+> 7 0 7 4738
+> 7 0 7 4741
+> 7 0 7 4744
+> 7 0 7 4747
+> 7 0 7 4750
+> 7 0 7 4645
+> 7 0 7 4753
+> 7 0 7 4756
+> 7 0 7 4759
+> 7 0 7 4762
+> 7 0 7 4765
+> 7 0 7 4768
+> 7 0 7 4771
+> 7 0 7 4774
+> 7 0 7 4777
+> 7 0 7 4780
+> 7 0 7 4648
+> 7 0 7 4783
+> 7 0 7 4786
+> 7 0 7 4789
+> 7 0 7 4651
+> 7 0 7 4654
+> 7 0 7 4657
+> 7 0 7 4660
+> 7 0 12 4792
+> 7 0 6 4635
+> 7 0 12 4796
+> 7 0 6 4795
+> 7 0 3 4797
+> 7 0 3 4634
+> 7 0 3 4794
+> 7 0 1 4390
 
 $ rm -f trace_platform.trace
index fb4b0ed..41a7064 100644 (file)
@@ -361,37 +361,37 @@ $ tail -n +3 procmig.trace
 > 13 18.155073 3 41
 > 16 18.155073 10 0 SR 41 p8
 > 7 18.155073 2 41
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 11 28
-> 7 18.155073 11 29
-> 7 18.155073 11 23
-> 7 18.155073 11 30
-> 7 18.155073 11 24
-> 7 18.155073 11 18
-> 7 18.155073 1 1
+> 7 18.155073 11 16
+> 7 18.155073 11 14
 > 7 18.155073 11 19
 > 7 18.155073 11 20
+> 7 18.155073 11 18
 > 7 18.155073 11 21
 > 7 18.155073 11 22
-> 7 18.155073 11 25
-> 7 18.155073 11 26
-> 7 18.155073 11 31
-> 7 18.155073 11 27
-> 7 18.155073 11 16
-> 7 18.155073 11 14
 > 7 18.155073 11 12
 > 7 18.155073 11 9
 > 7 18.155073 11 15
+> 7 18.155073 11 23
+> 7 18.155073 11 24
 > 7 18.155073 11 17
+> 7 18.155073 11 25
+> 7 18.155073 11 26
+> 7 18.155073 11 27
 > 7 18.155073 11 8
 > 7 18.155073 11 10
+> 7 18.155073 11 28
+> 7 18.155073 11 29
 > 7 18.155073 11 13
+> 7 18.155073 11 30
 > 7 18.155073 11 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 11 31
 
 $ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=tracing/buffer:yes --cfg=tracing/filename:procmig.trace --cfg=tracing/msg/process:yes ${srcdir:=.}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
@@ -707,8 +707,8 @@ $ tail -n +3 procmig.trace
 > 16 0 17 0 topology 21 44
 > 15 0 17 0 topology 30 45
 > 16 0 17 0 topology 28 45
-> 1 20 13 bmigration_order "0.800026 0.545312 0.857926"
-> 1 21 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 20 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 21 13 bmigration_order "0.800026 0.545312 0.857926"
 > 6 0 32 4 3 "emigrant-1"
 > 6 0 33 4 1 "policeman-2"
 > 12 0 5 32 7
@@ -964,37 +964,37 @@ $ tail -n +3 procmig.trace
 > 13 18.155073 5 41
 > 16 18.155073 12 0 SR 41 p8
 > 7 18.155073 4 41
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 13 28
-> 7 18.155073 13 29
-> 7 18.155073 13 23
-> 7 18.155073 13 30
-> 7 18.155073 13 24
-> 7 18.155073 13 18
-> 7 18.155073 1 1
+> 7 18.155073 13 16
+> 7 18.155073 13 14
 > 7 18.155073 13 19
 > 7 18.155073 13 20
+> 7 18.155073 13 18
 > 7 18.155073 13 21
 > 7 18.155073 13 22
-> 7 18.155073 13 25
-> 7 18.155073 13 26
-> 7 18.155073 13 31
-> 7 18.155073 13 27
-> 7 18.155073 13 16
-> 7 18.155073 13 14
 > 7 18.155073 13 12
 > 7 18.155073 13 9
 > 7 18.155073 13 15
+> 7 18.155073 13 23
+> 7 18.155073 13 24
 > 7 18.155073 13 17
+> 7 18.155073 13 25
+> 7 18.155073 13 26
+> 7 18.155073 13 27
 > 7 18.155073 13 8
 > 7 18.155073 13 10
+> 7 18.155073 13 28
+> 7 18.155073 13 29
 > 7 18.155073 13 13
+> 7 18.155073 13 30
 > 7 18.155073 13 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 13 31
 
 $ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes --cfg=tracing/buffer:no --cfg=tracing/filename:procmig.trace --cfg=tracing/msg/process:yes ${srcdir:=.}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
@@ -1309,8 +1309,8 @@ $ tail -n +3 procmig.trace
 > 16 0 17 0 topology 21 44
 > 15 0 17 0 topology 30 45
 > 16 0 17 0 topology 28 45
-> 1 20 13 bmigration_order "0.800026 0.545312 0.857926"
-> 1 21 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 20 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 21 13 bmigration_order "0.800026 0.545312 0.857926"
 > 6 0 32 4 3 "emigrant-1"
 > 6 0 33 4 1 "policeman-2"
 > 12 0 5 32 7
@@ -1566,37 +1566,37 @@ $ tail -n +3 procmig.trace
 > 13 18.155073 5 41
 > 16 18.155073 12 0 SR 41 p8
 > 7 18.155073 4 41
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 13 28
-> 7 18.155073 13 29
-> 7 18.155073 13 23
-> 7 18.155073 13 30
-> 7 18.155073 13 24
-> 7 18.155073 13 18
-> 7 18.155073 1 1
+> 7 18.155073 13 16
+> 7 18.155073 13 14
 > 7 18.155073 13 19
 > 7 18.155073 13 20
+> 7 18.155073 13 18
 > 7 18.155073 13 21
 > 7 18.155073 13 22
-> 7 18.155073 13 25
-> 7 18.155073 13 26
-> 7 18.155073 13 31
-> 7 18.155073 13 27
-> 7 18.155073 13 16
-> 7 18.155073 13 14
 > 7 18.155073 13 12
 > 7 18.155073 13 9
 > 7 18.155073 13 15
+> 7 18.155073 13 23
+> 7 18.155073 13 24
 > 7 18.155073 13 17
+> 7 18.155073 13 25
+> 7 18.155073 13 26
+> 7 18.155073 13 27
 > 7 18.155073 13 8
 > 7 18.155073 13 10
+> 7 18.155073 13 28
+> 7 18.155073 13 29
 > 7 18.155073 13 13
+> 7 18.155073 13 30
 > 7 18.155073 13 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 13 31
 
 $ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing:no ${srcdir:=.}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'no'
@@ -1900,39 +1900,39 @@ $ tail -n +3 simgrid.trace
 > 16 0 6 0 topology 21 44
 > 15 0 6 0 topology 30 45
 > 16 0 6 0 topology 28 45
-> 1 9 3 bmigration_order "0.800026 0.545312 0.857926"
-> 1 10 1 pmigration_order "0.800026 0.545312 0.857926"
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 3 28
-> 7 18.155073 3 29
-> 7 18.155073 3 23
-> 7 18.155073 3 30
-> 7 18.155073 3 24
-> 7 18.155073 3 18
-> 7 18.155073 1 1
+> 1 9 1 pmigration_order "0.800026 0.545312 0.857926"
+> 1 10 3 bmigration_order "0.800026 0.545312 0.857926"
+> 7 18.155073 3 16
+> 7 18.155073 3 14
 > 7 18.155073 3 19
 > 7 18.155073 3 20
+> 7 18.155073 3 18
 > 7 18.155073 3 21
 > 7 18.155073 3 22
-> 7 18.155073 3 25
-> 7 18.155073 3 26
-> 7 18.155073 3 31
-> 7 18.155073 3 27
-> 7 18.155073 3 16
-> 7 18.155073 3 14
 > 7 18.155073 3 12
 > 7 18.155073 3 9
 > 7 18.155073 3 15
+> 7 18.155073 3 23
+> 7 18.155073 3 24
 > 7 18.155073 3 17
+> 7 18.155073 3 25
+> 7 18.155073 3 26
+> 7 18.155073 3 27
 > 7 18.155073 3 8
 > 7 18.155073 3 10
+> 7 18.155073 3 28
+> 7 18.155073 3 29
 > 7 18.155073 3 13
+> 7 18.155073 3 30
 > 7 18.155073 3 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 3 31
 
 $ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing:yes --cfg=tracing/uncategorized:yes ${srcdir:=.}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
@@ -2382,37 +2382,37 @@ $ tail -n +3 simgrid.trace
 > 10 18.155073 7 9 466506.488095
 > 9 18.155073 7 15 466506.488095
 > 10 18.155073 7 15 466506.488095
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 4 28
-> 7 18.155073 4 29
-> 7 18.155073 4 23
-> 7 18.155073 4 30
-> 7 18.155073 4 24
-> 7 18.155073 4 18
-> 7 18.155073 1 1
+> 7 18.155073 4 16
+> 7 18.155073 4 14
 > 7 18.155073 4 19
 > 7 18.155073 4 20
+> 7 18.155073 4 18
 > 7 18.155073 4 21
 > 7 18.155073 4 22
-> 7 18.155073 4 25
-> 7 18.155073 4 26
-> 7 18.155073 4 31
-> 7 18.155073 4 27
-> 7 18.155073 4 16
-> 7 18.155073 4 14
 > 7 18.155073 4 12
 > 7 18.155073 4 9
 > 7 18.155073 4 15
+> 7 18.155073 4 23
+> 7 18.155073 4 24
 > 7 18.155073 4 17
+> 7 18.155073 4 25
+> 7 18.155073 4 26
+> 7 18.155073 4 27
 > 7 18.155073 4 8
 > 7 18.155073 4 10
+> 7 18.155073 4 28
+> 7 18.155073 4 29
 > 7 18.155073 4 13
+> 7 18.155073 4 30
 > 7 18.155073 4 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 4 31
 
 $ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing:yes --cfg=tracing/msg/process:yes ${srcdir:=.}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
@@ -2772,36 +2772,36 @@ $ tail -n +3 simgrid.trace
 > 13 18.155073 3 41
 > 16 18.155073 10 0 SR 41 p8
 > 7 18.155073 2 41
-> 7 18.155073 1 6
-> 7 18.155073 1 3
-> 7 18.155073 11 28
-> 7 18.155073 11 29
-> 7 18.155073 11 23
-> 7 18.155073 11 30
-> 7 18.155073 11 24
-> 7 18.155073 11 18
-> 7 18.155073 1 1
+> 7 18.155073 11 16
+> 7 18.155073 11 14
 > 7 18.155073 11 19
 > 7 18.155073 11 20
+> 7 18.155073 11 18
 > 7 18.155073 11 21
 > 7 18.155073 11 22
-> 7 18.155073 11 25
-> 7 18.155073 11 26
-> 7 18.155073 11 31
-> 7 18.155073 11 27
-> 7 18.155073 11 16
-> 7 18.155073 11 14
 > 7 18.155073 11 12
 > 7 18.155073 11 9
 > 7 18.155073 11 15
+> 7 18.155073 11 23
+> 7 18.155073 11 24
 > 7 18.155073 11 17
+> 7 18.155073 11 25
+> 7 18.155073 11 26
+> 7 18.155073 11 27
 > 7 18.155073 11 8
 > 7 18.155073 11 10
+> 7 18.155073 11 28
+> 7 18.155073 11 29
 > 7 18.155073 11 13
+> 7 18.155073 11 30
 > 7 18.155073 11 11
-> 7 18.155073 1 5
-> 7 18.155073 1 2
 > 7 18.155073 1 7
+> 7 18.155073 1 5
+> 7 18.155073 1 3
 > 7 18.155073 1 4
+> 7 18.155073 1 6
+> 7 18.155073 1 2
+> 7 18.155073 1 1
+> 7 18.155073 11 31
 
 $ rm -rf procmig.trace simgrid.trace
index dda9db3..22a6756 100644 (file)
@@ -1886,35 +1886,35 @@ $ tail -n +3 simgrid.trace
 > 10 0.412439 10 16 5.600000
 > 10 0.412439 10 12 5.600000
 > 10 0.412439 10 17 5.600000
-> 7 0.412439 1 6
-> 7 0.412439 1 3
-> 7 0.412439 3 28
-> 7 0.412439 3 29
-> 7 0.412439 3 23
-> 7 0.412439 3 30
-> 7 0.412439 3 24
-> 7 0.412439 3 18
-> 7 0.412439 1 1
+> 7 0.412439 3 16
+> 7 0.412439 3 14
 > 7 0.412439 3 19
 > 7 0.412439 3 20
+> 7 0.412439 3 18
 > 7 0.412439 3 21
 > 7 0.412439 3 22
-> 7 0.412439 3 25
-> 7 0.412439 3 26
-> 7 0.412439 3 31
-> 7 0.412439 3 27
-> 7 0.412439 3 16
-> 7 0.412439 3 14
 > 7 0.412439 3 12
 > 7 0.412439 3 9
 > 7 0.412439 3 15
+> 7 0.412439 3 23
+> 7 0.412439 3 24
 > 7 0.412439 3 17
+> 7 0.412439 3 25
+> 7 0.412439 3 26
+> 7 0.412439 3 27
 > 7 0.412439 3 8
 > 7 0.412439 3 10
+> 7 0.412439 3 28
+> 7 0.412439 3 29
 > 7 0.412439 3 13
+> 7 0.412439 3 30
 > 7 0.412439 3 11
-> 7 0.412439 1 5
-> 7 0.412439 1 2
 > 7 0.412439 1 7
+> 7 0.412439 1 5
+> 7 0.412439 1 3
 > 7 0.412439 1 4
+> 7 0.412439 1 6
+> 7 0.412439 1 2
+> 7 0.412439 1 1
+> 7 0.412439 3 31
 $ rm -f simgrid.trace
diff --git a/examples/platforms/small_platform_constant.xml b/examples/platforms/small_platform_constant.xml
new file mode 100644 (file)
index 0000000..8a9c350
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <zone id="zone0" routing="None">
+    <host id="Tremblay" speed="98.095Mf"/>
+    <host id="Jupiter" speed="76.296Mf"/>
+    <host id="Fafard" speed="76.296Mf"/>
+    <host id="Ginette" speed="48.492Mf"/>
+    <host id="Bourassa" speed="48.492Mf"/>
+    <host id="Jacquelin" speed="137.333Mf"/>
+    <host id="Boivin" speed="98.095Mf"/>
+  </zone>
+</platform>
index f620071..5a1faac 100644 (file)
@@ -6,6 +6,7 @@
 #include "simgrid/s4u.hpp"
 #include "xbt/replay.hpp"
 #include "xbt/str.h"
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(actions, "Messages specific for this msg example");
 
@@ -59,13 +60,13 @@ public:
   static void send(const char* const* action)
   {
     double size                 = std::stod(action[3]);
-    char* payload               = xbt_strdup(action[3]);
+    std::string* payload        = new std::string(action[3]);
     double clock                = simgrid::s4u::Engine::getClock();
     simgrid::s4u::MailboxPtr to = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getName() + "_" + action[2]);
     ACT_DEBUG("Entering Send: %s (size: %g) -- Actor %s on mailbox %s", NAME, size,
-              simgrid::s4u::this_actor::getName().c_str(), to->getName());
+              simgrid::s4u::this_actor::getCname(), to->getCname());
     to->put(payload, size);
-    xbt_free(payload);
+    delete payload;
 
     log_action(action, simgrid::s4u::Engine::getClock() - clock);
   }
@@ -76,8 +77,7 @@ public:
     simgrid::s4u::MailboxPtr from =
         simgrid::s4u::Mailbox::byName(std::string(action[2]) + "_" + simgrid::s4u::this_actor::getName());
 
-    ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME, simgrid::s4u::this_actor::getName().c_str(),
-              from->getName());
+    ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME, simgrid::s4u::this_actor::getCname(), from->getCname());
     from->get();
     log_action(action, simgrid::s4u::Engine::getClock() - clock);
   }
index 33ed245..8753058 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <simgrid/s4u.hpp>
+#include <string>
 
 // This declares a logging channel so that XBT_INFO can be used later
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_create, "The logging channel used in this example");
@@ -42,7 +43,7 @@ public:
     XBT_INFO("Hello s4u, I have something to send");
     simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName("mb42");
 
-    mailbox->put(xbt_strdup(msg.c_str()), msg.size());
+    mailbox->put(new std::string(msg), msg.size());
     XBT_INFO("I'm done. See you.");
   }
 };
@@ -72,13 +73,13 @@ public:
   }
   void operator()()
   {
-    XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->getName());
+    XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->getCname());
 
-    char* msg1 = static_cast<char*>(mailbox->get());
-    char* msg2 = static_cast<char*>(mailbox->get());
-    XBT_INFO("I received '%s' and '%s'", msg1, msg2);
-    xbt_free(msg1);
-    xbt_free(msg2);
+    std::string* msg1 = static_cast<std::string*>(mailbox->get());
+    std::string* msg2 = static_cast<std::string*>(mailbox->get());
+    XBT_INFO("I received '%s' and '%s'", msg1->c_str(), msg2->c_str());
+    delete msg1;
+    delete msg2;
     XBT_INFO("I'm done. See you.");
   }
 };
index a3b296a..61e64bd 100644 (file)
@@ -44,7 +44,7 @@
 #define MESSAGE_CANCEL_SIZE 17
 
 /** Types of messages exchanged between two peers. */
-typedef enum {
+enum e_message_type {
   MESSAGE_HANDSHAKE,
   MESSAGE_CHOKE,
   MESSAGE_UNCHOKE,
@@ -55,7 +55,7 @@ typedef enum {
   MESSAGE_REQUEST,
   MESSAGE_PIECE,
   MESSAGE_CANCEL
-} e_message_type;
+};
 
 class Message {
 public:
index 8f57ee9..3225496 100644 (file)
@@ -128,13 +128,13 @@ void Peer::sendHandshakeToAllPeers()
 void Peer::sendMessage(simgrid::s4u::MailboxPtr mailbox, e_message_type type, uint64_t size)
 {
   const char* type_names[6] = {"HANDSHAKE", "CHOKE", "UNCHOKE", "INTERESTED", "NOTINTERESTED", "CANCEL"};
-  XBT_DEBUG("Sending %s to %s", type_names[type], mailbox->getName());
+  XBT_DEBUG("Sending %s to %s", type_names[type], mailbox->getCname());
   mailbox->put_init(new Message(type, id, bitfield_, mailbox_), size)->detach();
 }
 
 void Peer::sendBitfield(simgrid::s4u::MailboxPtr mailbox)
 {
-  XBT_DEBUG("Sending a BITFIELD to %s", mailbox->getName());
+  XBT_DEBUG("Sending a BITFIELD to %s", mailbox->getCname());
   mailbox
       ->put_init(new Message(MESSAGE_BITFIELD, id, bitfield_, mailbox_),
                  MESSAGE_BITFIELD_SIZE + BITS_TO_BYTES(FILE_PIECES))
@@ -144,7 +144,7 @@ void Peer::sendBitfield(simgrid::s4u::MailboxPtr mailbox)
 void Peer::sendPiece(simgrid::s4u::MailboxPtr mailbox, unsigned int piece, int block_index, int block_length)
 {
   xbt_assert(not hasNotPiece(piece), "Tried to send a unavailable piece.");
-  XBT_DEBUG("Sending the PIECE %u (%d,%d) to %s", piece, block_index, block_length, mailbox->getName());
+  XBT_DEBUG("Sending the PIECE %u (%d,%d) to %s", piece, block_index, block_length, mailbox->getCname());
   mailbox->put_init(new Message(MESSAGE_PIECE, id, mailbox_, piece, block_index, block_length), BLOCK_SIZE)->detach();
 }
 
@@ -164,7 +164,7 @@ void Peer::sendRequestTo(Connection* remote_peer, unsigned int piece)
   int block_index = getFirstMissingBlockFrom(piece);
   if (block_index != -1) {
     int block_length = MIN(BLOCKS_REQUESTED, PIECES_BLOCKS - block_index);
-    XBT_DEBUG("Sending a REQUEST to %s for piece %u (%d,%d)", remote_peer->mailbox_->getName(), piece, block_index,
+    XBT_DEBUG("Sending a REQUEST to %s for piece %u (%d,%d)", remote_peer->mailbox_->getCname(), piece, block_index,
               block_length);
     remote_peer->mailbox_
         ->put_init(new Message(MESSAGE_REQUEST, id, mailbox_, piece, block_index, block_length), MESSAGE_REQUEST_SIZE)
@@ -233,7 +233,7 @@ void Peer::leech()
 
   /* Send a "handshake" message to all the peers it got (since it couldn't have gotten more than 50 peers) */
   sendHandshakeToAllPeers();
-  XBT_DEBUG("Starting main leech loop listening on mailbox: %s", mailbox_->getName());
+  XBT_DEBUG("Starting main leech loop listening on mailbox: %s", mailbox_->getCname());
 
   void* data = nullptr;
   while (simgrid::s4u::Engine::getClock() < deadline && countPieces(bitfield_) < FILE_PIECES) {
@@ -299,7 +299,7 @@ void Peer::handleMessage()
   const char* type_names[10] = {"HANDSHAKE", "CHOKE",    "UNCHOKE", "INTERESTED", "NOTINTERESTED",
                                 "HAVE",      "BITFIELD", "REQUEST", "PIECE",      "CANCEL"};
 
-  XBT_DEBUG("Received a %s message from %s", type_names[message->type], message->return_mailbox->getName());
+  XBT_DEBUG("Received a %s message from %s", type_names[message->type], message->return_mailbox->getCname());
 
   auto known_peer         = connected_peers.find(message->peer_id);
   Connection* remote_peer = (known_peer == connected_peers.end()) ? nullptr : known_peer->second;
index e21badf..199299a 100644 (file)
@@ -37,7 +37,7 @@ public:
 
       if (number_of_tasks < 10000 || i % 10000 == 0)
         XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", (std::string("Task_") + std::to_string(i)).c_str(),
-                 number_of_tasks, mailbox->getName());
+                 number_of_tasks, mailbox->getCname());
 
       /* - Send the computation amount to the @ref worker */
       mailbox->put(new double(comp_size), comm_size);
index dd1102d..3db5c8a 100644 (file)
@@ -12,6 +12,19 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platfor
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
 
+p Testing with default compound Full network optimization
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--cfg=network/optim:Full" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/optim' to 'Full'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [  0.019014] (2:ponger@Jupiter)  Ping time (latency bound) 0.019014
+> [  0.019014] (2:ponger@Jupiter) task_bw->data = 0.019
+> [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
+> [150.178356] (0:maestro@) Total simulation time: 150.178
+
 p Testing the deprecated CM02 network model
 
 $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml --cfg=cpu/model:Cas01 --cfg=network/model:CM02 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
@@ -41,6 +54,21 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platfor
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
 
+p Testing the surf network Reno2 fairness model using lagrangian approach
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Reno2" --log=surf_lagrange.thres=critical "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+> [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Reno2'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [  0.019014] (2:ponger@Jupiter)  Ping time (latency bound) 0.019014
+> [  0.019014] (2:ponger@Jupiter) task_bw->data = 0.019
+> [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
+> [150.178356] (0:maestro@) Total simulation time: 150.178
+
 p Testing the surf network Vegas fairness model using lagrangian approach
 
 $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Vegas" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
@@ -55,3 +83,18 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platfor
 > [150.178356] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
 > [150.178356] (1:pinger@Tremblay) Pong time (bandwidth bound): 150.159
 > [150.178356] (0:maestro@) Total simulation time: 150.178
+
+p Testing the surf network constant model
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${srcdir:=.}/small_platform_constant.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+> [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
+> [  0.000000] (1:pinger@Tremblay) Ping -> Jupiter
+> [  0.000000] (2:ponger@Jupiter) Pong -> Tremblay
+> [ 13.010000] (2:ponger@Jupiter) Task received : small communication (latency bound)
+> [ 13.010000] (2:ponger@Jupiter)  Ping time (latency bound) 13.010000
+> [ 13.010000] (2:ponger@Jupiter) task_bw->data = 13.010
+> [ 26.020000] (1:pinger@Tremblay) Task received : large communication (bandwidth bound)
+> [ 26.020000] (1:pinger@Tremblay) Pong time (bandwidth bound): 13.010
+> [ 26.020000] (0:maestro@) Total simulation time: 26.020
index 7f242e4..388e19f 100644 (file)
@@ -38,15 +38,15 @@ public:
 
     if (rank == 0) {
       /* The root process (rank 0) first sends the token then waits to receive it back */
-      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getName());
-      neighbor_mailbox->put(xbt_strdup("Token"), task_comm_size);
-      char* res = static_cast<char*>(my_mailbox->get());
-      XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
-      xbt_free(res);
+      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
+      std::string msg = "Token";
+      neighbor_mailbox->put(&msg, task_comm_size);
+      std::string* res = static_cast<std::string*>(my_mailbox->get());
+      XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
     } else {
-      char* res = static_cast<char*>(my_mailbox->get());
-      XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
-      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getName());
+      std::string* res = static_cast<std::string*>(my_mailbox->get());
+      XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
+      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
       neighbor_mailbox->put(res, task_comm_size);
     }
   }
index 7742cca..d712f92 100644 (file)
@@ -14,6 +14,7 @@
 #include "simgrid/s4u.hpp"
 #include <cstdlib>
 #include <iostream>
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_wait, "Messages specific for this s4u example");
 
@@ -40,11 +41,11 @@ public:
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
       std::string msgName = std::string("Message ") + std::to_string(i);
-      char* payload = xbt_strdup(msgName.c_str()); // copy the data we send: 'msgName' is not a stable storage location
-
+      std::string* payload          = new std::string(msgName); // copy the data we send:
+                                                                // 'msgName' is not a stable storage location
       XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
       /* Create a communication representing the ongoing communication */
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, msg_size);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, msg_size);
       /* Add this comm to the vector of all known comms */
       pending_comms.push_back(comm);
     }
@@ -53,9 +54,9 @@ public:
     for (int i = 0; i < receivers_count; i++) {
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
-      char* payload                 = xbt_strdup("finalize"); // Make a copy of the data we will send
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
 
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, 0);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
       pending_comms.push_back(comm);
       XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
     }
@@ -87,15 +88,12 @@ public:
   void operator()()
   {
     XBT_INFO("Wait for my first message");
-    while (1) {
-      char* received = static_cast<char*>(mbox->get());
-      XBT_INFO("I got a '%s'.", received);
-      if (std::strcmp(received, "finalize") == 0) { /* If it's a finalize message, we're done */
-        xbt_free(received);
-        break;
-      }
-      /* Otherwise receiving the message was all we were supposed to do */
-      xbt_free(received);
+    for (bool done = false; not done;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      done = (*received == "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
     }
   }
 };
index 270894f..98ca116 100644 (file)
@@ -15,6 +15,7 @@
 #include "simgrid/s4u.hpp"
 #include <cstdlib>
 #include <iostream>
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this s4u example");
 
@@ -41,11 +42,11 @@ public:
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
       std::string msgName           = std::string("Message ") + std::to_string(i);
-      char* payload = xbt_strdup(msgName.c_str()); // copy the data we send: 'msgName' is not a stable storage location
-
+      std::string* payload          = new std::string(msgName); // copy the data we send:
+                                                                // 'msgName' is not a stable storage location
       XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
       /* Create a communication representing the ongoing communication */
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, msg_size);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, msg_size);
       /* Add this comm to the vector of all known comms */
       pending_comms.push_back(comm);
     }
@@ -54,9 +55,9 @@ public:
     for (int i = 0; i < receivers_count; i++) {
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
-      char* payload                 = xbt_strdup("finalize"); // Make a copy of the data we will send
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
 
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, 0);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
       pending_comms.push_back(comm);
       XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
     }
@@ -83,15 +84,12 @@ public:
   void operator()()
   {
     XBT_INFO("Wait for my first message");
-    while (1) {
-      char* received = static_cast<char*>(mbox->get());
-      XBT_INFO("I got a '%s'.", received);
-      if (std::strcmp(received, "finalize") == 0) { /* If it's a finalize message, we're done */
-        xbt_free(received);
-        break;
-      }
-      /* Otherwise receiving the message was all we were supposed to do */
-      xbt_free(received);
+    for (bool done = false; not done;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      done = (*received == "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
     }
   }
 };
index d94b036..0f3bec8 100644 (file)
@@ -20,6 +20,7 @@
 #include "simgrid/s4u.hpp"
 #include <cstdlib>
 #include <iostream>
+#include <string>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this msg example");
 
@@ -46,11 +47,11 @@ public:
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
       std::string msgName           = std::string("Message ") + std::to_string(i);
-      char* payload = xbt_strdup(msgName.c_str()); // copy the data we send: 'msgName' is not a stable storage location
-
+      std::string* payload          = new std::string(msgName); // copy the data we send:
+                                                                // 'msgName' is not a stable storage location
       XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
       /* Create a communication representing the ongoing communication */
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, msg_size);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, msg_size);
       /* Add this comm to the vector of all known comms */
       pending_comms.push_back(comm);
     }
@@ -59,9 +60,9 @@ public:
     for (int i = 0; i < receivers_count; i++) {
       std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
       simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(mboxName);
-      char* payload                 = xbt_strdup("finalize"); // Make a copy of the data we will send
+      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
 
-      simgrid::s4u::CommPtr comm = mbox->put_async((void*)payload, 0);
+      simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
       pending_comms.push_back(comm);
       XBT_INFO("Send 'finalize' to 'receiver-%ld'", i % receivers_count);
     }
@@ -99,15 +100,12 @@ public:
   void operator()()
   {
     XBT_INFO("Wait for my first message");
-    while (1) {
-      char* received = static_cast<char*>(mbox->get());
-      XBT_INFO("I got a '%s'.", received);
-      if (std::strcmp(received, "finalize") == 0) { /* If it's a finalize message, we're done */
-        xbt_free(received);
-        break;
-      }
-      /* Otherwise receiving the message was all we were supposed to do */
-      xbt_free(received);
+    for (bool done = false; not done;) {
+      std::string* received = static_cast<std::string*>(mbox->get());
+      XBT_INFO("I got a '%s'.", received->c_str());
+      done = (*received == "finalize"); // If it's a finalize message, we're done
+      // Receiving the message was all we were supposed to do
+      delete received;
     }
   }
 };
index a31877f..4a73c0f 100644 (file)
@@ -235,7 +235,7 @@ void Node::checkPredecessor()
   }
   // receive the answer
   XBT_DEBUG("Sent 'Predecessor Alive' request to %d, waiting for the answer on my mailbox '%s'", pred_id_,
-            message->answer_to->getName());
+            message->answer_to->getCname());
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
@@ -280,7 +280,7 @@ int Node::remoteGetPredecessor(int ask_to)
 
   // receive the answer
   XBT_DEBUG("Sent 'Get Predecessor' request to %d, waiting for the answer on my mailbox '%s'", ask_to,
-            message->answer_to->getName());
+            message->answer_to->getCname());
   simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
 
   try {
@@ -432,7 +432,7 @@ void Node::handleMessage(ChordMessage* message)
       message->type = FIND_SUCCESSOR_ANSWER;
       message->answer_id = fingers_[0];
       XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
-                message->issuer_host_name.c_str(), message->answer_to->getName(), message->request_id,
+                message->issuer_host_name.c_str(), message->answer_to->getCname(), message->request_id,
                 message->answer_id);
       message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     } else {
@@ -450,7 +450,7 @@ void Node::handleMessage(ChordMessage* message)
     message->type = GET_PREDECESSOR_ANSWER;
     message->answer_id = pred_id_;
     XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
-              message->issuer_host_name.c_str(), message->answer_to->getName(), message->answer_id);
+              message->issuer_host_name.c_str(), message->answer_to->getCname(), message->answer_id);
     message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     break;
 
@@ -488,7 +488,7 @@ void Node::handleMessage(ChordMessage* message)
     XBT_DEBUG("Receiving a 'Predecessor Alive' request from %s", message->issuer_host_name.c_str());
     message->type = PREDECESSOR_ALIVE_ANSWER;
     XBT_DEBUG("Sending back a 'Predecessor Alive Answer' to %s (mailbox %s)", message->issuer_host_name.c_str(),
-              message->answer_to->getName());
+              message->answer_to->getCname());
     message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
     break;
 
index 4c44d8f..ff05252 100644 (file)
@@ -42,7 +42,7 @@ public:
 };
 
 /* Types of tasks exchanged between nodes. */
-typedef enum {
+enum e_message_type_t {
   FIND_SUCCESSOR,
   FIND_SUCCESSOR_ANSWER,
   GET_PREDECESSOR,
@@ -52,7 +52,7 @@ typedef enum {
   PREDECESSOR_LEAVING,
   PREDECESSOR_ALIVE,
   PREDECESSOR_ALIVE_ANSWER
-} e_message_type_t;
+};
 
 class ChordMessage {
 public:
index fb4bc28..46a5013 100644 (file)
@@ -3,6 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <string>
 #include <unordered_map>
 
 #include "simgrid/s4u.hpp"
@@ -24,7 +25,7 @@ public:
       sg_size_t used_size = storage->getSizeUsed();
       sg_size_t size      = storage->getSize();
 
-      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->getName(), mountpoint.c_str(), used_size,
+      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->getCname(), mountpoint.c_str(), used_size,
                free_size, size);
     }
   }
@@ -63,21 +64,22 @@ public:
     file->move(newpath);
 
     // Test attaching some user data to the file
-    file->setUserdata(xbt_strdup("777"));
-    XBT_INFO("User data attached to the file: %s", static_cast<char*>(file->getUserdata()));
-    xbt_free(file->getUserdata());
+    file->setUserdata(new std::string("777"));
+    std::string* file_data = static_cast<std::string*>(file->getUserdata());
+    XBT_INFO("User data attached to the file: %s", file_data->c_str());
+    delete file_data;
 
     // Close the file
     delete file;
 
     // Now attach some user data to disk1
-    XBT_INFO("Get/set data for storage element: %s", storage->getName());
+    XBT_INFO("Get/set data for storage element: %s", storage->getCname());
     XBT_INFO("    Uninitialized storage data: '%s'", static_cast<char*>(storage->getUserdata()));
 
-    storage->setUserdata(xbt_strdup("Some user data"));
-    XBT_INFO("    Set and get data: '%s'", static_cast<char*>(storage->getUserdata()));
-
-    xbt_free(storage->getUserdata());
+    storage->setUserdata(new std::string("Some user data"));
+    std::string* storage_data = static_cast<std::string*>(storage->getUserdata());
+    XBT_INFO("    Set and get data: '%s'", storage_data->c_str());
+    delete storage_data;
   }
 };
 
index 2bf4f87..0a527ab 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -26,7 +26,8 @@
 #define REQUEST_TAG 1
 #define RELEASE_TAG 2
 
-int r, cs;
+int r;
+int cs;
 
 int main(int argc, char **argv){
   int size;
index d3759ca..8f5b480 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2016-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -37,7 +37,8 @@ namespace simgrid {
  * @endcode
  *
  */
-struct SimulationClock {
+class SimulationClock {
+public:
   using rep        = double;
   using period     = std::ratio<1>;
   using duration   = std::chrono::duration<rep, period>;
index 45a0af2..e2cdeab 100644 (file)
@@ -98,6 +98,9 @@ typedef struct Trace tmgr_Trace;
 
 typedef struct s_smx_context* smx_context_t;
 typedef struct s_smx_actor* smx_actor_t;
+typedef struct s_smx_mutex* smx_mutex_t;
+typedef struct s_smx_mailbox* smx_mailbox_t;
+typedef struct s_surf_file* surf_file_t;
 
 #endif
 
index ebb956e..0ea9ab8 100644 (file)
@@ -36,11 +36,9 @@ public:
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Jedule *jedule_t;
-
-SG_END_DECL()
+}
 #endif
 
 #endif /* JEDULE_HPP_ */
index aa16099..704d4f6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -40,11 +40,9 @@ XBT_PUBLIC_CLASS Event{
 }
 }
 
-SG_BEGIN_DECL()
-
+extern "C" {
 typedef simgrid::jedule::Event * jed_event_t;
-
-SG_END_DECL()
+}
 
 #endif
 
index caaf672..9510ad0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -50,12 +50,11 @@ public:
 
 }
 }
-SG_BEGIN_DECL()
+extern "C" {
 typedef simgrid::jedule::Container * jed_container_t;
 typedef simgrid::jedule::Subset * jed_subset_t;
 void get_resource_selection_by_hosts(std::vector<jed_subset_t>* subset_list, std::vector<sg_host_t> *host_list);
-
-SG_END_DECL()
+}
 
 #endif
 
index 766d425..a4db6ec 100644 (file)
@@ -207,7 +207,7 @@ public:
 template<class T>
 void bindPromise(Promise<T> promise, Future<T> future)
 {
-  struct PromiseBinder {
+  class PromiseBinder {
   public:
     PromiseBinder(Promise<T> promise) : promise_(std::move(promise)) {}
     void operator()(Future<T> future)
index c621759..8ee47ab 100644 (file)
@@ -51,7 +51,7 @@ typedef sg_host_t msg_host_t;
 XBT_PUBLIC_DATA(int) sg_storage_max_file_descriptors;
 /* ******************************** Task ************************************ */
 
-typedef struct simdata_task *simdata_task_t;
+typedef struct s_simdata_task_t* simdata_task_t;
 
 typedef struct msg_task {
   char *name;                   /**< @brief task name if any */
@@ -449,7 +449,8 @@ XBT_PUBLIC(void) MSG_action_exit();
  *  @ingroup msg_synchro
  *  @hideinitializer
  */
-typedef struct s_smx_sem *msg_sem_t; // Yeah that's a rename of the smx_sem_t which doesnt require smx_sem_t to be declared here
+typedef struct s_smx_sem_t* msg_sem_t; // Yeah that's a rename of the smx_sem_t which doesnt require smx_sem_t to be
+                                       // declared here
 XBT_PUBLIC(msg_sem_t) MSG_sem_init(int initial_value);
 XBT_PUBLIC(void) MSG_sem_acquire(msg_sem_t sem);
 XBT_PUBLIC(msg_error_t) MSG_sem_acquire_timeout(msg_sem_t sem, double timeout);
@@ -464,7 +465,7 @@ XBT_PUBLIC(int) MSG_sem_would_block(msg_sem_t sem);
  */
 
 #define MSG_BARRIER_SERIAL_PROCESS -1
-typedef struct s_msg_bar* msg_bar_t;
+typedef struct s_msg_bar_t* msg_bar_t;
 XBT_PUBLIC(msg_bar_t) MSG_barrier_init( unsigned int count);
 XBT_PUBLIC(void) MSG_barrier_destroy(msg_bar_t bar);
 XBT_PUBLIC(int) MSG_barrier_wait(msg_bar_t bar);
index d0c8b54..4568e52 100644 (file)
@@ -9,7 +9,7 @@
 #include <simgrid/s4u/forward.hpp>
 #include <simgrid/forward.h>
 
-typedef enum { inited = 0, started, canceled, errored, finished } e_s4u_activity_state_t;
+enum e_s4u_activity_state_t { inited = 0, started, canceled, errored, finished };
 
 namespace simgrid {
 namespace s4u {
index eef1611..210baad 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -197,10 +197,10 @@ public:
   /** This actor will be automatically terminated when the last non-daemon process finishes **/
   void daemonize();
 
-  /** Retrieves the name of that actor as a C string */
-  const char* getCname();
   /** Retrieves the name of that actor as a C++ string */
-  simgrid::xbt::string getName();
+  const simgrid::xbt::string& getName() const;
+  /** Retrieves the name of that actor as a C string */
+  const char* getCname() const;
   /** Retrieves the host on which that actor is running */
   s4u::Host* getHost();
   /** Retrieves the PID of that actor
@@ -286,80 +286,83 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
 {
   auto seconds = std::chrono::duration_cast<SimulationClockDuration>(duration);
   this_actor::sleep_for(seconds.count());
-  }
-  template<class Duration>
-  inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
-  {
-    auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
-    this_actor::sleep_until(timeout_native.time_since_epoch().count());
-  }
+}
 
-  XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep(
-      double duration)
-  {
-    return sleep_for(duration);
-  }
+template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
+{
+  auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
+  this_actor::sleep_until(timeout_native.time_since_epoch().count());
+}
+
+XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep(
+    double duration)
+{
+  return sleep_for(duration);
+}
 
-  /** Block the actor, computing the given amount of flops */
-  XBT_PUBLIC(void) execute(double flop);
+/** Block the actor, computing the given amount of flops */
+XBT_PUBLIC(void) execute(double flop);
 
-  /** Block the actor until it gets a message from the given mailbox.
  *
  * See \ref Comm for the full communication API (including non blocking communications).
  */
-  XBT_PUBLIC(void*)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") recv(MailboxPtr chan);
-  XBT_PUBLIC(void*)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.")
-      recv(MailboxPtr chan, double timeout);
-  XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.")
-      irecv(MailboxPtr chan, void** data);
-
-  /** Block the actor until it delivers a message of the given simulated size to the given mailbox
  *
  * See \ref Comm for the full communication API (including non blocking communications).
-  */
-  XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
-      send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
-  XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
-      send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
+/** Block the actor until it gets a message from the given mailbox.
+ *
+ * See \ref Comm for the full communication API (including non blocking communications).
+ */
+XBT_PUBLIC(void*)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.") recv(MailboxPtr chan);
+XBT_PUBLIC(void*)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will turn this warning into an error.")
+    recv(MailboxPtr chan, double timeout);
+XBT_PUBLIC(CommPtr)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will turn this warning into an error.")
+    irecv(MailboxPtr chan, void** data);
+
+/** Block the actor until it delivers a message of the given simulated size to the given mailbox
+ *
+ * See \ref Comm for the full communication API (including non blocking communications).
+*/
+XBT_PUBLIC(void)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
+    send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
+XBT_PUBLIC(void)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will turn this warning into an error.")
+    send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
 
-  XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
-      isend(MailboxPtr chan, void* payload, double simulatedSize);
+XBT_PUBLIC(CommPtr)
+XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will turn this warning into an error.")
+    isend(MailboxPtr chan, void* payload, double simulatedSize);
 
-  /** @brief Returns the actor ID of the current actor (same as pid). */
-  XBT_PUBLIC(aid_t) getPid();
+/** @brief Returns the actor ID of the current actor (same as pid). */
+XBT_PUBLIC(aid_t) getPid();
 
-  /** @brief Returns the ancestor's actor ID of the current actor (same as ppid). */
-  XBT_PUBLIC(aid_t) getPpid();
+/** @brief Returns the ancestor's actor ID of the current actor (same as ppid). */
+XBT_PUBLIC(aid_t) getPpid();
 
-  /** @brief Returns the name of the current actor. */
-  XBT_PUBLIC(std::string) getName();
+/** @brief Returns the name of the current actor. */
+XBT_PUBLIC(std::string) getName();
 
-  /** @brief Returns the name of the host on which the process is running. */
-  XBT_PUBLIC(Host*) getHost();
+/** @brief Returns the name of the current actor as a C string. */
+XBT_PUBLIC(const char*) getCname();
 
-  /** @brief Suspend the actor. */
-  XBT_PUBLIC(void) suspend();
+/** @brief Returns the name of the host on which the process is running. */
+XBT_PUBLIC(Host*) getHost();
 
-  /** @brief Resume the actor. */
-  XBT_PUBLIC(void) resume();
+/** @brief Suspend the actor. */
+XBT_PUBLIC(void) suspend();
 
-  XBT_PUBLIC(bool) isSuspended();
+/** @brief Resume the actor. */
+XBT_PUBLIC(void) resume();
 
-  /** @brief kill the actor. */
-  XBT_PUBLIC(void) kill();
+XBT_PUBLIC(bool) isSuspended();
 
-  /** @brief Add a function to the list of "on_exit" functions. */
-  XBT_PUBLIC(void) onExit(int_f_pvoid_pvoid_t fun, void* data);
+/** @brief kill the actor. */
+XBT_PUBLIC(void) kill();
 
-  /** @brief Migrate the actor to a new host. */
-  XBT_PUBLIC(void) migrate(Host* new_host);
-};
+/** @brief Add a function to the list of "on_exit" functions. */
+XBT_PUBLIC(void) onExit(int_f_pvoid_pvoid_t fun, void* data);
+
+/** @brief Migrate the actor to a new host. */
+XBT_PUBLIC(void) migrate(Host* new_host);
+}
 
 /** @} */
 
index 5af3446..25d1dcf 100644 (file)
@@ -33,7 +33,7 @@ namespace s4u {
 XBT_PUBLIC_CLASS ConditionVariable
 {
 private:
-  friend s_smx_cond;
+  friend s_smx_cond_t;
   smx_cond_t cond_;
   explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {}
 public:
index 09c55ec..6495cf5 100644 (file)
@@ -66,7 +66,9 @@ public:
   /** Retrieves the host on which the current actor is running */
   static s4u::Host* current();
 
+  /** Retrieves the name of that host as a C++ string */
   simgrid::xbt::string const& getName() const { return name_; }
+  /** Retrieves the name of that host as a C string */
   const char* getCname() const { return name_.c_str(); }
 
   void actorList(std::vector<ActorPtr> * whereto);
index de05738..8637924 100644 (file)
@@ -10,6 +10,7 @@
 #include <xbt/base.h>
 #include <xbt/signal.hpp>
 
+#include <string>
 #include <unordered_map>
 
 /***********
@@ -36,8 +37,10 @@ public:
   /** @brief Retrieve a link from its name */
   static Link* byName(const char* name);
 
-  /** @brief Get da name */
-  const char* name();
+  /** @brief Retrieves the name of that link as a C++ string */
+  const std::string& getName() const;
+  /** @brief Retrieves the name of that link as a C string */
+  const char* getCname() const;
 
   /** @brief Get the bandwidth in bytes per second of current Link */
   double bandwidth();
@@ -80,6 +83,8 @@ public:
 
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
   static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
+
+  const char* XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") name();
 };
 }
 }
index f7d280d..3ca3459 100644 (file)
@@ -9,6 +9,7 @@
 #include <string>
 
 #include <xbt/base.h>
+#include <xbt/string.hpp>
 
 #include <simgrid/s4u/forward.hpp>
 #include <simgrid/s4u/Actor.hpp>
@@ -120,8 +121,10 @@ public:
   /** private function, do not use. FIXME: make me protected */
   kernel::activity::MailboxImpl* getImpl() { return pimpl_; }
 
-  /** Gets the name of that mailbox */
-  const char* getName();
+  /** @brief Retrieves the name of that mailbox as a C++ string */
+  const simgrid::xbt::string& getName() const;
+  /** @brief Retrieves the name of that mailbox as a C string */
+  const char* getCname() const;
 
   /** Retrieve the mailbox associated to the given C string */
   static MailboxPtr byName(const char *name);
index 0f50b37..fc8c8fa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2016-2017. The SimGrid Team. All rights reserved.               */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -44,7 +44,10 @@ protected:
 public:
   /** @brief Seal your netzone once you're done adding content, and before routing stuff through it */
   virtual void seal();
-  const char* getCname();
+  /** @brief Retrieves the name of that netzone as a C++ string */
+  const std::string& getName() const { return name_; }
+  /** @brief Retrieves the name of that netzone as a C string */
+  const char* getCname() const;
   NetZone* getFather();
 
   std::vector<NetZone*>* getChildren();             // Sub netzones
index efad7b8..f28f936 100644 (file)
@@ -29,7 +29,10 @@ public:
   virtual ~Storage() = default;
   /** Retrieve a Storage by its name. It must exist in the platform file */
   static Storage* byName(std::string name);
-  const char* getName();
+  /** @brief Retrieves the name of that storage as a C++ string */
+  std::string const& getName() const;
+  /** @brief Retrieves the name of that storage as a C string */
+  const char* getCname() const;
   const char* getType();
   Host* getHost();
   sg_size_t getSize(); /** Retrieve the total amount of space of this storage element */
index 4453039..0d6023d 100644 (file)
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/forward.hpp"
 
-typedef enum {
+enum e_surf_vm_state_t {
   SURF_VM_STATE_CREATED, /**< created, but not yet started */
   SURF_VM_STATE_RUNNING,
   SURF_VM_STATE_SUSPENDED, /**< Suspend/resume does not involve disk I/O, so we assume there is no transition states. */
   SURF_VM_STATE_DESTROYED
-} e_surf_vm_state_t;
+};
 
 namespace simgrid {
 namespace vm {
index 55f8ba0..8f64ea3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2010, 2012-2016. The SimGrid Team.
+/* Copyright (c) 2006-2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ typedef sg_link_t SD_link_t;
     Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether the task is scheduled, running, done, ...
 
     */
-typedef struct SD_task *SD_task_t;
+typedef struct s_SD_task_t* SD_task_t;
 
 /** @brief Task states
     @ingroup SD_task_api */
index 4d55193..8d27291 100644 (file)
 #include "simgrid/host.h"
 #include "xbt/ex.h"
 #include "xbt/parmap.h"
+#ifdef __cplusplus
 #include <map>
+#endif
+
 /* ******************************** Host ************************************ */
 /** @brief Host datatype
     @ingroup simix_host_management
@@ -46,11 +49,11 @@ typedef enum {
 /**
  * \ingroup simix_synchro_management
  */
-typedef struct s_smx_cond *smx_cond_t;
+typedef struct s_smx_cond_t* smx_cond_t;
 /**
  * \ingroup simix_synchro_management
  */
-typedef struct s_smx_sem *smx_sem_t;
+typedef struct s_smx_sem_t* smx_sem_t;
 
 /* ****************************** Process *********************************** */
 
@@ -103,7 +106,7 @@ XBT_PUBLIC(void) SIMIX_run();
 XBT_PUBLIC(double) SIMIX_get_clock();
 
 /* Timer functions FIXME: should these be public? */
-typedef struct s_smx_timer* smx_timer_t;
+typedef struct s_smx_timer_t* smx_timer_t;
 
 XBT_PUBLIC(smx_timer_t) SIMIX_timer_set(double date, void (*function)(void*), void *arg);
 XBT_PUBLIC(void) SIMIX_timer_remove(smx_timer_t timer);
@@ -138,9 +141,11 @@ XBT_PUBLIC(void) SIMIX_process_set_function(const char* process_host,
  */
 
 XBT_PUBLIC(void) SIMIX_maestro_create(void (*code)(void*), void* data);
+#ifdef __cplusplus
 XBT_PUBLIC(smx_actor_t)
 SIMIX_process_attach(const char* name, void* data, const char* hostname, std::map<std::string, std::string>* properties,
                      smx_actor_t parent_process);
+#endif
 XBT_PUBLIC(void) SIMIX_process_detach();
 
 /*********************************** Host *************************************/
@@ -195,9 +200,11 @@ XBT_PUBLIC(e_smx_state_t) simcall_execution_wait(smx_activity_t execution);
 /**************************** Process simcalls ********************************/
 SG_BEGIN_DECL()
 /* Constructor and Destructor */
+#ifdef __cplusplus
 XBT_PUBLIC(smx_actor_t)
 simcall_process_create(const char* name, xbt_main_func_t code, void* data, sg_host_t host, int argc, char** argv,
                        std::map<std::string, std::string>* properties);
+#endif
 
 XBT_PUBLIC(void) simcall_process_killall(int reset_pid);
 XBT_PUBLIC(void) SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char *msg);
@@ -219,6 +226,7 @@ SG_END_DECL()
 
 /************************** Comunication simcalls *****************************/
 
+#ifdef __cplusplus
 XBT_PUBLIC(void)
 simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
                   size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
@@ -243,6 +251,7 @@ simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, siz
 XBT_PUBLIC(smx_activity_t)
 simcall_comm_iprobe(smx_mailbox_t mbox, int type, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                     void* data);
+#endif
 XBT_PUBLIC(void) simcall_comm_cancel(smx_activity_t comm);
 
 /* FIXME: waitany is going to be a vararg function, and should take a timeout */
index 90df0a3..dd4fb3d 100644 (file)
@@ -1,9 +1,11 @@
-/* Copyright (c) 2005-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2005-2017. The SimGrid Team. All rights reserved.          */
 
 #ifndef XBT_BACKTRACE_H
 #define XBT_BACKTRACE_H
 
+#ifdef __cplusplus
 #include <cstddef>
+#endif
 
 #include <xbt/base.h>
 
index e2d740c..f49a50d 100644 (file)
@@ -49,6 +49,7 @@
 #define XBT_ATTRIB_UNUSED  __attribute__((unused))
 #define XBT_ATTRIB_DEPRECATED_v319(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.19 */
 #define XBT_ATTRIB_DEPRECATED_v320(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.20 */
+#define XBT_ATTRIB_DEPRECATED_v321(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.21 */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
index a374bec..95b3557 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -123,9 +123,6 @@ public:
   T get()
   {
     switch (status_) {
-      case ResultStatus::invalid:
-      default:
-        throw std::logic_error("Invalid result");
       case ResultStatus::value: {
         T value = std::move(value_);
         value_.~T();
@@ -139,6 +136,8 @@ public:
         std::rethrow_exception(std::move(exception));
         break;
       }
+      default:
+        throw std::logic_error("Invalid result");
     }
   }
 private:
index 912fe8d..c0126b4 100644 (file)
 
 #if SIMGRID_HAVE_MC
 
-#include <stdexcept>
+#include <algorithm>
 #include <cstddef>
 #include <cstring>
 #include <iterator>
+#include <stdexcept>
 
 #include <xbt/sysdep.h>
 
@@ -56,7 +57,6 @@ struct string_data {
 XBT_PUBLIC_CLASS string : private string_data {
   static const char NUL;
 public:
-
   // Types
   typedef std::size_t size_type;
   typedef std::ptrdiff_t difference_type;
@@ -71,7 +71,7 @@ public:
   ~string()
   {
     if (string_data::data != &NUL)
-      std::free(string_data::data);
+      delete[] string_data::data;
   }
 
   // Ctors
@@ -82,8 +82,8 @@ public:
       string_data::data = const_cast<char*>(&NUL);
     } else {
       string_data::len = size;
-      string_data::data = static_cast<char*>(std::malloc(string_data::len + 1));
-      memcpy(string_data::data, s, string_data::len);
+      string_data::data = new char[string_data::len + 1];
+      std::copy_n(s, string_data::len, string_data::data);
       string_data::data[string_data::len] = '\0';
     }
   }
@@ -103,14 +103,14 @@ public:
   void assign(const char* s, size_t size)
   {
     if (string_data::data != &NUL) {
-      std::free(string_data::data);
+      delete[] string_data::data;
       string_data::data = nullptr;
       string_data::len = 0;
     }
     if (size != 0) {
       string_data::len = size;
-      string_data::data = (char*) std::malloc(string_data::len + 1);
-      std::memcpy(string_data::data, s, string_data::len);
+      string_data::data = new char[string_data::len + 1];
+      std::copy_n(s, string_data::len, string_data::data);
       string_data::data[string_data::len] = '\0';
     }
   }
@@ -164,6 +164,7 @@ public:
     return data()[i];
   }
   // Conversion
+  static string_data& to_string_data(string& s) { return s; }
   operator std::string() const { return std::string(this->c_str(), this->size()); }
 
   // Iterators
index 7865d16..695023d 100644 (file)
@@ -6,8 +6,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "JavaContext.hpp"
-#include "jxbt_utilities.h"
-#include "src/simix/smx_private.h"
+#include "jxbt_utilities.hpp"
+#include "src/simix/smx_private.hpp"
 #include "xbt/ex.hpp"
 
 #include <functional>
@@ -130,7 +130,7 @@ void JavaContext::stop()
     // (as the ones created for the VM migration). The Java exception will not be catched anywhere.
     // Bad things happen currently if these actors get killed, unfortunately.
     jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError",
-                       std::string("Process ") + this->process()->cname() + " killed from file JavaContext.cpp");
+                       std::string("Process ") + this->process()->getCname() + " killed from file JavaContext.cpp");
 
     // (remember that throwing a java exception from C does not break the C execution path.
     //  Instead, it marks the exception to be raised when returning to the Java world and
index 6ebaad4..7af0b5e 100644 (file)
 #include <jni.h>
 
 #include "simgrid/simix.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "xbt/xbt_os_thread.h"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 
 namespace simgrid {
 namespace kernel {
index 1bb1487..6119a64 100644 (file)
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
-#include "jmsg_process.h"
-#include "jmsg_as.h"
+#include "jmsg.hpp"
+#include "jmsg_as.hpp"
 #include "jmsg_host.h"
+#include "jmsg_process.h"
 #include "jmsg_storage.h"
 #include "jmsg_task.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jxbt_utilities.hpp"
 
 #include "JavaContext.hpp"
 
@@ -38,7 +38,7 @@
 #endif
 /* end of eclipse-mandated pimple */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int JAVA_HOST_LEVEL = -1;
 
@@ -243,8 +243,7 @@ Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jde
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit() {
   sg_host_energy_plugin_init();
 }
-
-SG_END_DECL()
+} // extern "C"
 
 /** Run a Java org.simgrid.msg.Process
  *
similarity index 55%
rename from src/bindings/java/jmsg.h
rename to src/bindings/java/jmsg.hpp
index c0e7e2d..295a938 100644 (file)
@@ -5,13 +5,13 @@
 /* This program 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 MSG4JAVA_H
-#define MSG4JAVA_H
+#ifndef JMSG_HPP
+#define JMSG_HPP
 #include <jni.h>
 #include <simgrid/msg.h>
 #include <unordered_map>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -25,29 +25,28 @@ SG_BEGIN_DECL()
 extern int JAVA_HOST_LEVEL;
 static std::unordered_map<msg_storage_t, jobject> java_storage_map;
 
-JavaVM *get_java_VM();
-JNIEnv *get_current_thread_env();
+JavaVMget_java_VM();
+JNIEnvget_current_thread_env();
 /**
  * This function throws the correct exception according to the status provided.
  */
-void jmsg_throw_status(JNIEnv *env, msg_error_t status);
+void jmsg_throw_status(JNIEnvenv, msg_error_t status);
 
-JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv * env, jclass cls);
-JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass cls);
+JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv* env, jclass cls);
+JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_energyInit();
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv * env, jclass cls, jstring jargs);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv * env, jclass cls, jstring jargs);
-
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls, jstring jplatformFile);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls, jstring jdeploymentFile);
-
-SG_END_DECL()
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_debug(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_verb(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_info(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_warn(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_error(JNIEnv* env, jclass cls, jstring jargs);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_critical(JNIEnv* env, jclass cls, jstring jargs);
+
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls, jstring jplatformFile);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv* env, jclass cls);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Msg_deployApplication(JNIEnv* env, jclass cls, jstring jdeploymentFile);
+}
 #endif
index 41ed0b3..d06d1d4 100644 (file)
@@ -9,14 +9,14 @@
 #include "simgrid/s4u/NetZone.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
-#include "jmsg_as.h"
+#include "jmsg.hpp"
+#include "jmsg_as.hpp"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jas_method_As_constructor;
 static jfieldID jas_field_As_bind;
@@ -155,5 +155,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv * env, jo
   }
   return jtable;
 }
-
-SG_END_DECL()
+}
similarity index 89%
rename from src/bindings/java/jmsg_as.h
rename to src/bindings/java/jmsg_as.hpp
index 89ac082..2ce24f7 100644 (file)
@@ -5,12 +5,12 @@
 /* This program 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 MSG_JAS_H
-#define MSG_JAS_H
-#include <jni.h>
+#ifndef JMSG_AS_HPP
+#define JMSG_AS_HPP
 #include "simgrid/msg.h"
+#include <jni.h>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */
 #ifndef JNIEXPORT
@@ -27,11 +27,10 @@ void jnetzone_unref(JNIEnv* env, jobject jnetzone);
 void jnetzone_bind(jobject jas, msg_netzone_t as, JNIEnv* env);
 simgrid::s4u::NetZone* jnetzone_get_native(JNIEnv* env, jobject jnetzone);
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnv *env, jclass cls);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject jas);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_As_nativeInit(JNIEnvenv, jclass cls);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv* env, jobject jas);
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv* env, jobject jnetzone);
-JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobject jhost, jobject jname);
+JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnvenv, jobject jhost, jobject jname);
 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getHosts(JNIEnv* env, jobject jnetzone);
-
-SG_END_DECL()
+}
 #endif
index 47f14d6..da8c34d 100644 (file)
@@ -6,15 +6,15 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "jmsg_comm.h"
-#include "jxbt_utilities.h"
-#include "jmsg.h"
+#include "jmsg.hpp"
+#include "jxbt_utilities.hpp"
 
 #include <simgrid/msg.h>
 #include <string>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jcomm_field_Comm_bind;
 static jfieldID jcomm_field_Comm_finished;
@@ -65,7 +65,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_nativeFinalize(JNIEnv *env, job
   msg_task_t *task_received;
 
   task_received = (msg_task_t*)  (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_taskBind);
-  xbt_free(task_received);
+  delete task_received;
 
   comm = (msg_comm_t) (uintptr_t) env->GetLongField(jcomm, jcomm_field_Comm_bind);
   MSG_comm_destroy(comm);
@@ -123,7 +123,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, job
 static msg_comm_t* jarray_to_commArray(JNIEnv *env, jobjectArray jcomms, /* OUT */ int *count)
 {
   *count = env->GetArrayLength(jcomms);
-  msg_comm_t* comms = xbt_new(msg_comm_t, *count);
+  msg_comm_t* comms = new msg_comm_t[*count];
 
   for (int i=0; i < *count; i++) {
      jobject jcomm = env->GetObjectArrayElement(jcomms, i);
@@ -148,7 +148,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitAll(JNIEnv *env, jclass cls
     return;
 
   MSG_comm_waitall(comms, count, static_cast<double>(timeout));
-  xbt_free(comms);
+  delete[] comms;
 }
 JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms)
 {
@@ -162,9 +162,8 @@ JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls,
   }
 
   int rank = MSG_comm_waitany(dyn);
-  xbt_free(comms);
+  delete[] comms;
   xbt_dynar_free(&dyn);
   return rank;
 }
-
-SG_END_DECL()
+}
index 8243f6a..ff8dcba 100644 (file)
@@ -1,14 +1,14 @@
 /* Java bindings of the file API.                                           */
 
-/* Copyright (c) 2012-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "jmsg_file.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd) {
   env->SetLongField(jfile, jfile_field_bind, reinterpret_cast<std::intptr_t>(fd));
@@ -53,5 +53,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_File_close(JNIEnv *env, jobject jfil
   MSG_file_close(file);
   jfile_bind(env, jfile, nullptr);
 }
-
-SG_END_DECL()
+}
index a255e2e..22c54da 100644 (file)
@@ -9,14 +9,14 @@
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
 #include "jmsg_storage.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jhost_method_Host_constructor;
 static jfieldID jhost_field_Host_bind;
@@ -250,7 +250,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEn
   }
 
   for (auto const& elm : mounted_storages) {
-    jname    = env->NewStringUTF(elm.second->getName());
+    jname    = env->NewStringUTF(elm.second->getCname());
     jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
     env->SetObjectArrayElement(jtable, index, jstorage);
     index++;
@@ -374,5 +374,4 @@ JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env,
   msg_host_t host = jhost_get_native(env, jhost);
   return MSG_host_get_power_peak_at(host, pstate);
 }
-
-SG_END_DECL()
+}
index ec8c032..ad3f399 100644 (file)
@@ -9,14 +9,14 @@
 
 #include "jmsg_process.h"
 
-#include "jmsg.h"
-#include "jmsg_host.h"
-#include "jxbt_utilities.h"
 #include "JavaContext.hpp"
+#include "jmsg.hpp"
+#include "jmsg_host.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jprocess_field_Process_bind;
 jfieldID jprocess_field_Process_host;
@@ -289,5 +289,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , j
 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls) {
   return (jint) MSG_process_get_number();
 }
-
-SG_END_DECL()
+}
index 0bb54a2..cf069b3 100644 (file)
@@ -8,9 +8,9 @@
 #include "xbt/sysdep.h"
 
 #include "jmsg_rngstream.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jfieldID jrngstream_bind;
 
@@ -145,5 +145,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_RngStream_randInt(JNIEnv *env, jobje
 
   return (jint)RngStream_RandInt(rngstream, (int)i, (int)j);
 }
-
-SG_END_DECL()
+}
index 7b5003f..e92d050 100644 (file)
@@ -7,13 +7,13 @@
 
 #include "simgrid/msg.h"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_storage.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jstorage_method_Storage_constructor;
 static jfieldID jstorage_field_Storage_bind;
@@ -227,5 +227,4 @@ JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv * env, jc
   xbt_dynar_free(&table);
   return jtable;
 }
-
-SG_END_DECL()
+}
index 9749bf3..a831b3f 100644 (file)
@@ -7,14 +7,14 @@
 
 #include <xbt/ex.hpp>
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_synchro.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 #include "xbt/synchro.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jfieldID jsynchro_field_Mutex_bind;
 
@@ -94,5 +94,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * en
   sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
   MSG_sem_destroy(sem);
 }
-
-SG_END_DECL()
+}
index eb5ca2d..f07d543 100644 (file)
@@ -7,15 +7,15 @@
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "jmsg.h"
+#include "jmsg.hpp"
 #include "jmsg_host.h"
-#include "jmsg_task.h"
 #include "jmsg_process.h"
-#include "jxbt_utilities.h"
+#include "jmsg_task.h"
+#include "jxbt_utilities.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 static jmethodID jtask_method_Comm_constructor;
 
@@ -76,8 +76,8 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jo
   int host_count = static_cast<int>(env->GetArrayLength(jhosts));
 
   jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, 0);
-  msg_host_t* hosts          = xbt_new0(msg_host_t, host_count);
-  double* computeDurations   = xbt_new0(double, host_count);
+  msg_host_t* hosts          = new msg_host_t[host_count];
+  double* computeDurations   = new double[host_count];
   for (int index = 0; index < host_count; index++) {
     jobject jhost           = env->GetObjectArrayElement(jhosts, index);
     hosts[index] = jhost_get_native(env, jhost);
@@ -86,7 +86,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jo
   env->ReleaseDoubleArrayElements(jcomputeDurations_arg, jcomputeDurations, 0);
 
   jdouble* jmessageSizes = env->GetDoubleArrayElements(jmessageSizes_arg, 0);
-  double* messageSizes   = xbt_new0(double, host_count* host_count);
+  double* messageSizes   = new double[host_count * host_count];
   for (int index = 0; index < host_count * host_count; index++) {
     messageSizes[index] = jmessageSizes[index];
   }
@@ -99,6 +99,10 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jo
 
   /* associate the java task object and the native task */
   jtask_bind(jtask, task, env);
+
+  delete[] hosts;
+  delete[] computeDurations;
+  delete[] messageSizes;
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel(JNIEnv * env, jobject jtask)
@@ -303,8 +307,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass c
     return nullptr;
 
   //pointer to store the task object pointer.
-  msg_task_t *task = xbt_new(msg_task_t,1);
-  *task = nullptr;
+  msg_task_t* task = new msg_task_t(nullptr);
   /* There should be a cache here */
 
   jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
@@ -358,7 +361,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, j
     return nullptr;
 
   // pointer to store the task object pointer.
-  msg_task_t* task = xbt_new0(msg_task_t, 1);
+  msg_task_t* task = new msg_task_t(nullptr);
 
   jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
   if (not jcomm) {
@@ -525,5 +528,4 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass
 
   return (jint) rv;
 }
-
-SG_END_DECL()
+}
index 76b0dce..70dc62c 100644 (file)
@@ -7,13 +7,13 @@
 
 #include "jmsg_vm.h"
 #include "jmsg_host.h"
-#include "jxbt_utilities.h"
+#include "jxbt_utilities.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "xbt/ex.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
-SG_BEGIN_DECL()
+extern "C" {
 
 extern int JAVA_HOST_LEVEL;
 static jfieldID jvm_field_bind;
@@ -186,4 +186,4 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   return static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
 }
-SG_END_DECL()
+}
index 667c7b4..02f22f1 100644 (file)
@@ -20,7 +20,7 @@
 // Define a new category
 XBT_LOG_NEW_DEFAULT_CATEGORY (jtrace, "TRACE for Java(TM)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostStateDeclare(JNIEnv * env, jclass cls, jstring js)
 {
@@ -198,5 +198,4 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSet
    JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime(JNIEnv *env, jclass cls, jdouble,
                                                                                      jstring, jstring, jstring, jdouble)
 */
-
-SG_END_DECL()
+}
index a5e6ed1..1853d1b 100644 (file)
@@ -5,12 +5,12 @@
 /* This program 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 "jxbt_utilities.hpp"
 #include "xbt/sysdep.h"
-#include "jxbt_utilities.h"
 
 #include <cstdlib> /* abort */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 jclass jxbt_get_class(JNIEnv * env, const char *name)
 {
@@ -211,5 +211,4 @@ void jxbt_throw_task_cancelled(JNIEnv* env, std::string details)
 {
   jxbt_throw_by_name(env, "org/simgrid/msg/TaskCancelledException", details);
 }
-
-SG_END_DECL()
+}
similarity index 53%
rename from src/bindings/java/jxbt_utilities.h
rename to src/bindings/java/jxbt_utilities.hpp
index 067a654..e496893 100644 (file)
@@ -5,48 +5,50 @@
 /* This program 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 JXBT_UTILITY_H
-#define JXBT_UTILITY_H
+#ifndef JXBT_UTILITIES_HPP
+#define JXBT_UTILITIES_HPP
 
+#include <cstdint>
 #include <jni.h>
-#include <stdint.h>
 #include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Search a class and throw an exception if not found */
-jclass jxbt_get_class(JNIEnv * env, const char *name);
+jclass jxbt_get_class(JNIEnv* env, const char* name);
 
 /* Search a method in a class and throw an exception if not found(it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jmethodID jxbt_get_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Like the jxbt_get_class() but get a static method */
-jmethodID jxbt_get_static_jmethod(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jmethodID jxbt_get_static_jmethod(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_jfield(JNIEnv * env, jclass cls, const char *name, const char *signature);
+jfieldID jxbt_get_jfield(JNIEnv* env, jclass cls, const char* name, const char* signature);
 
 /* Search a method in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jmethodID jxbt_get_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature);
+jmethodID jxbt_get_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
 
 /* Like the jxbt_get_smethod() but get a static method */
-jmethodID jxbt_get_static_smethod(JNIEnv * env, const char *classname, const char *name, const char *signature);
+jmethodID jxbt_get_static_smethod(JNIEnv* env, const char* classname, const char* name, const char* signature);
 
 /* Search a field in a class and throw an exception if not found (it's ok to to pass a NULL class: it's a noop) */
-jfieldID jxbt_get_sfield(JNIEnv * env, const char *classname, const char *name, const char *signature);
-
-#define jxbt_check_res(fun, res, allowed_exceptions, detail) do {\
-    if (res != MSG_OK && (res | allowed_exceptions)) { \
-      xbt_die("%s failed with error code %d, which is not an allowed exception. Please fix me.",fun,res); \
-    } else if (res == MSG_HOST_FAILURE) { \
-      jxbt_throw_host_failure(env, detail); \
-    } else if (res == MSG_TRANSFER_FAILURE) { \
-      jxbt_throw_transfer_failure(env,detail); \
-    } else if (res == MSG_TIMEOUT) { \
-      jxbt_throw_time_out_failure(env,detail); \
-    } else if (res == MSG_TASK_CANCELED){ \
-      jxbt_throw_task_cancelled(env,detail); \
-   } } while (0)
+jfieldID jxbt_get_sfield(JNIEnv* env, const char* classname, const char* name, const char* signature);
+
+#define jxbt_check_res(fun, res, allowed_exceptions, detail)                                                           \
+  do {                                                                                                                 \
+    if (res != MSG_OK && (res | allowed_exceptions)) {                                                                 \
+      xbt_die("%s failed with error code %d, which is not an allowed exception. Please fix me.", fun, res);            \
+    } else if (res == MSG_HOST_FAILURE) {                                                                              \
+      jxbt_throw_host_failure(env, detail);                                                                            \
+    } else if (res == MSG_TRANSFER_FAILURE) {                                                                          \
+      jxbt_throw_transfer_failure(env, detail);                                                                        \
+    } else if (res == MSG_TIMEOUT) {                                                                                   \
+      jxbt_throw_time_out_failure(env, detail);                                                                        \
+    } else if (res == MSG_TASK_CANCELED) {                                                                             \
+      jxbt_throw_task_cancelled(env, detail);                                                                          \
+    }                                                                                                                  \
+  } while (0)
 
 /* Throws an exception according to its name */
 void jxbt_throw_by_name(JNIEnv* env, const char* name, std::string msg);
@@ -73,6 +75,5 @@ void jxbt_throw_time_out_failure(JNIEnv* env, std::string details);
 void jxbt_throw_task_cancelled(JNIEnv* env, std::string details);
 /** Thrown when looking for a storage from name does not lead to anything */
 void jxbt_throw_storage_not_found(JNIEnv* env, std::string invalid_name);
-
-SG_END_DECL()
+}
 #endif
index c02d921..ddf1fb4 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2010-2016. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.
  *
  * This program 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 file contains functions that aid users to debug their lua scripts; for instance,
  * tables can be easily output and values are represented in a human-readable way. (For instance,
@@ -15,7 +14,7 @@
 extern "C" {
 #include <lauxlib.h>
 }
-#include "lua_utils.h"
+#include "lua_utils.hpp"
 #include "xbt.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua_debug, "Lua bindings (helper functions)");
index 9220e67..f511ec3 100644 (file)
@@ -5,7 +5,7 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
+#include "lua_private.hpp"
 #include "simgrid/s4u/Host.hpp"
 extern "C" {
 #include <lauxlib.h>
index cddfe8a..90c72c6 100644 (file)
@@ -5,7 +5,7 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
+#include "lua_private.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
@@ -16,7 +16,7 @@ extern "C" {
 #include <lauxlib.h>
 }
 
-#include "src/surf/surf_private.h"
+#include "src/surf/surf_private.hpp"
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <simgrid/s4u/Host.hpp>
diff --git a/src/bindings/lua/lua_private.h b/src/bindings/lua/lua_private.h
deleted file mode 100644 (file)
index 0010302..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* SimGrid Lua bindings                                                     */
-
-#ifndef LUA_PRIVATE_H
-#define LUA_PRIVATE_H
-
-#include "simgrid/msg.h"
-#include "simgrid_lua.h"
-
-extern "C" {
-
-void sglua_register_host_functions(lua_State* L);
-msg_host_t sglua_check_host(lua_State* L, int index);
-
-void sglua_register_platf_functions(lua_State* L);
-
-const char* sglua_get_msg_error(msg_error_t err);
-
-}
-
-#define lua_ensure(...) \
-  _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
-#define _lua_ensure_ARG1(cond) \
-  _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
-#define _lua_ensure_ARGN(cond, ...) \
-  do { if (!(cond)) { luaL_error(L, __VA_ARGS__); return -1;} } while (0)
-
-#endif
diff --git a/src/bindings/lua/lua_private.hpp b/src/bindings/lua/lua_private.hpp
new file mode 100644 (file)
index 0000000..abcfd70
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* SimGrid Lua bindings                                                     */
+
+#ifndef LUA_PRIVATE_HPP
+#define LUA_PRIVATE_HPP
+
+#include "simgrid/msg.h"
+#include "simgrid_lua.hpp"
+
+extern "C" {
+
+void sglua_register_host_functions(lua_State* L);
+msg_host_t sglua_check_host(lua_State* L, int index);
+
+void sglua_register_platf_functions(lua_State* L);
+
+const char* sglua_get_msg_error(msg_error_t err);
+}
+
+#define lua_ensure(...) _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
+#define _lua_ensure_ARG1(cond) _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
+#define _lua_ensure_ARGN(cond, ...)                                                                                    \
+  do {                                                                                                                 \
+    if (!(cond)) {                                                                                                     \
+      luaL_error(L, __VA_ARGS__);                                                                                      \
+      return -1;                                                                                                       \
+    }                                                                                                                  \
+  } while (0)
+
+#endif
similarity index 84%
rename from src/bindings/lua/lua_utils.h
rename to src/bindings/lua/lua_utils.hpp
index 203c0e4..acc134b 100644 (file)
@@ -5,8 +5,8 @@
 
 /* SimGrid Lua helper functions                                             */
 
-#ifndef LUA_UTILS_H
-#define LUA_UTILS_H
+#ifndef LUA_UTILS_HPP
+#define LUA_UTILS_HPP
 
 extern "C" {
 
@@ -17,20 +17,20 @@ extern "C" {
  *
  * This structure is used as the userdata parameter of lua_Writer.
  */
-typedef struct s_sglua_buffer {
+struct s_sglua_buffer_t {
   char* data;
   size_t size;
   size_t capacity;
-} s_sglua_buffer_t, *sglua_buffer_t;
+};
+typedef s_sglua_buffer_t* sglua_buffer_t;
 
 const char* sglua_tostring(lua_State* L, int index);
 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
-void sglua_stack_dump(lua_State* L, const char *msg);
+void sglua_stack_dump(lua_State* L, const charmsg);
 static int sglua_dump_table(lua_State* L);
 void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
 const char* sglua_get_spaces(int length);
 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
-
 }
 
 #endif
index 846d2b0..1bca949 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,8 +6,8 @@
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
-#include "lua_utils.h"
+#include "lua_private.hpp"
+#include "lua_utils.hpp"
 #include "src/surf/xml/platf.hpp"
 
 
similarity index 86%
rename from src/bindings/lua/simgrid_lua.h
rename to src/bindings/lua/simgrid_lua.hpp
index f95d620..33e8a47 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_LUA_H
-#define SIMGRID_LUA_H
+#ifndef SIMGRID_LUA_HPP
+#define SIMGRID_LUA_HPP
 
 extern "C" {
 #include <lua.h>
@@ -13,8 +13,8 @@ extern "C" {
 /*                           Plaftorm functions                                      */
 /* ********************************************************************************* */
 
-int console_open(lua_State *L);
-int console_close(lua_State *L);
+int console_open(lua_StateL);
+int console_close(lua_StateL);
 
 int console_add_backbone(lua_State*);
 int console_add_host___link(lua_State*);
@@ -24,7 +24,7 @@ int console_add_router(lua_State* L);
 int console_add_route(lua_State*);
 int console_add_ASroute(lua_State*);
 int console_AS_open(lua_State*);
-int console_AS_seal(lua_State *L);
+int console_AS_seal(lua_StateL);
 int console_set_function(lua_State*);
 int console_host_set_property(lua_State*);
 }
index 0f98f38..9b991fd 100644 (file)
@@ -9,16 +9,15 @@
 #include <cstddef>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // Methods used to parse and store the values for timing injections in smpi
-typedef struct s_smpi_factor *smpi_os_factor_t;
-typedef struct s_smpi_factor{
+struct s_smpi_factor_t {
   size_t factor=0;
   std::vector<double> values;
-} s_smpi_factor_t;
-
-SG_END_DECL()
+};
+typedef s_smpi_factor_t* smpi_os_factor_t;
+}
 
 XBT_PUBLIC(std::vector<s_smpi_factor_t>) parse_factor(const char *smpi_coef_string);
 
index 1ce9da6..445ddc1 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef MAXMIN_DATATYPES_H
 #define MAXMIN_DATATYPES_H
 
-typedef struct lmm_element *lmm_element_t;
-typedef struct lmm_variable *lmm_variable_t;
-typedef struct lmm_constraint *lmm_constraint_t;
-typedef struct lmm_constraint_light *lmm_constraint_light_t;
-typedef struct lmm_system *lmm_system_t;
+typedef struct s_lmm_element_t* lmm_element_t;
+typedef struct s_lmm_variable_t* lmm_variable_t;
+typedef struct s_lmm_constraint_t* lmm_constraint_t;
+typedef struct s_lmm_constraint_light_t* lmm_constraint_light_t;
+typedef struct s_lmm_system_t* lmm_system_t;
 
 #endif
similarity index 89%
rename from src/include/surf/maxmin.h
rename to src/include/surf/maxmin.hpp
index df7571f..1df5043 100644 (file)
@@ -3,14 +3,14 @@
 /* This program 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_MAXMIN_H
-#define SURF_MAXMIN_H
+#ifndef SURF_MAXMIN_HPP
+#define SURF_MAXMIN_HPP
 
 #include "src/internal_config.h"
-#include "xbt/misc.h"
-#include "xbt/asserts.h"
 #include "surf/datatypes.h"
-#include <math.h>
+#include "xbt/asserts.h"
+#include "xbt/misc.h"
+#include <cmath>
 
 namespace simgrid {
 namespace surf {
@@ -131,13 +131,13 @@ XBT_PUBLIC_DATA(double) sg_maxmin_precision;
 XBT_PUBLIC_DATA(double) sg_surf_precision;
 XBT_PUBLIC_DATA(int) sg_concurrency_limit;
 
-static inline void double_update(double *variable, double value, double precision)
+static inline void double_update(doublevariable, double value, double precision)
 {
-  //printf("Updating %g -= %g +- %g\n",*variable,value,precision);
-  //xbt_assert(value==0  || value>precision);
-  //Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may happen,
-  //and the precision mechanism is not active...
-  //xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
+  // printf("Updating %g -= %g +- %g\n",*variable,value,precision);
+  // xbt_assert(value==0  || value>precision);
+  // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may
+  // happen, and the precision mechanism is not active...
+  // xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
   *variable -= value;
   if (*variable < precision)
     *variable = 0.0;
@@ -153,7 +153,7 @@ static inline int double_equals(double value1, double value2, double precision)
   return (fabs(value1 - value2) < precision);
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @{ @ingroup SURF_lmm */
 /**
@@ -174,7 +174,7 @@ XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
  * @param id Data associated to the constraint (e.g.: a network link)
  * @param bound_value The bound value of the constraint
  */
-XBT_PUBLIC(lmm_constraint_t) lmm_constraint_new(lmm_system_t sys, void *id,double bound_value);
+XBT_PUBLIC(lmm_constraint_t) lmm_constraint_new(lmm_system_t sys, void* id, double bound_value);
 
 /**
  * @brief Share a constraint
@@ -332,7 +332,7 @@ XBT_PUBLIC(int) lmm_get_number_of_cnst_from_var(lmm_system_t sys, lmm_variable_t
  * @param elem A element of constraint of the constraint or NULL
  * @return A variable associated to a constraint
  */
-XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t * elem);
+XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t* elem);
 
 /**
  * @brief Get a var associated to a constraint
@@ -344,8 +344,9 @@ XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst(lmm_system_t sys, lmm_constrain
  *
  * @return A variable associated to a constraint
  */
-XBT_PUBLIC(lmm_variable_t) lmm_get_var_from_cnst_safe(lmm_system_t sys, lmm_constraint_t cnst,
-                                     lmm_element_t * elem, lmm_element_t * nextelem, int * numelem);
+XBT_PUBLIC(lmm_variable_t)
+lmm_get_var_from_cnst_safe(lmm_system_t sys, lmm_constraint_t cnst, lmm_element_t* elem, lmm_element_t* nextelem,
+                           int* numelem);
 
 /**
  * @brief Get the first active constraint of a system
@@ -368,14 +369,14 @@ XBT_PUBLIC(lmm_constraint_t) lmm_get_next_active_constraint(lmm_system_t sys, lm
  * @param cnst A constraint
  * @return The data associated to the constraint
  */
-XBT_PUBLIC(void *) lmm_constraint_id(lmm_constraint_t cnst);
+XBT_PUBLIC(void*) lmm_constraint_id(lmm_constraint_t cnst);
 
 /**
  * @brief Get the data associated to a variable
  * @param var A variable
  * @return The data associated to the variable
  */
-XBT_PUBLIC(void *) lmm_variable_id(lmm_variable_t var);
+XBT_PUBLIC(void*) lmm_variable_id(lmm_variable_t var);
 
 /**
  * @brief Update the value of element linking the constraint and the variable
@@ -442,23 +443,24 @@ XBT_PUBLIC(void) bottleneck_solve(lmm_system_t sys);
 
 /** Default functions associated to the chosen protocol. When using the lagrangian approach. */
 
-XBT_PUBLIC(void) lmm_set_default_protocol_function(double (*func_f)(lmm_variable_t var,double x),
-                                                   double (*func_fp)(lmm_variable_t var,double x),
-                                                   double (*func_fpi)(lmm_variable_t var,double x));
+XBT_PUBLIC(void)
+lmm_set_default_protocol_function(double (*func_f)(lmm_variable_t var, double x),
+                                  double (*func_fp)(lmm_variable_t var, double x),
+                                  double (*func_fpi)(lmm_variable_t var, double x));
 
-XBT_PUBLIC(double func_reno_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno_fpi(lmm_variable_t var, double x);
 
-XBT_PUBLIC(double func_reno2_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno2_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_reno2_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_reno2_fpi(lmm_variable_t var, double x);
 
-XBT_PUBLIC(double func_vegas_f) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
-XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_f(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_fp(lmm_variable_t var, double x);
+XBT_PUBLIC(double) func_vegas_fpi(lmm_variable_t var, double x);
 
 /** @} */
-SG_END_DECL()
+}
 
 #endif
index cf20d44..eb86e1d 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "surf/surf.h"
 #include <string>
 #include <vector>
@@ -117,10 +117,10 @@ int TRACE_start()
     }
 
     /* activate trace */
-    if (trace_active == 1) {
+    if (trace_active) {
       THROWF(tracing_error, 0, "Tracing is already active");
     }
-    trace_active = 1;
+    trace_active = true;
     XBT_DEBUG("Tracing is on");
   }
   return 0;
@@ -139,11 +139,11 @@ int TRACE_end()
 
     /* dump trace buffer */
     TRACE_last_timestamp_to_dump = surf_get_clock();
-    TRACE_paje_dump_buffer(1);
+    TRACE_paje_dump_buffer(true);
 
     /* destroy all data structures of tracing (and free) */
-    PJ_container_free_all();
-    delete PJ_type_get_root();
+    delete PJ_container_get_root();
+    delete simgrid::instr::Type::getRootType();
     rootType = nullptr;
 
     /* close the trace files */
@@ -158,7 +158,7 @@ int TRACE_end()
     }
 
     /* de-activate trace */
-    trace_active = 0;
+    trace_active = false;
     XBT_DEBUG("Tracing is off");
     XBT_DEBUG("Tracing system is shutdown");
   }
@@ -303,11 +303,11 @@ char *TRACE_get_viva_cat_conf ()
 
 void TRACE_global_init()
 {
-  static int is_initialised = 0;
+  static bool is_initialised = false;
   if (is_initialised)
     return;
 
-  is_initialised = 1;
+  is_initialised = true;
   /* name of the tracefile */
   xbt_cfg_register_string (OPT_TRACING_FILENAME, "simgrid.trace", nullptr, "Trace file created by the instrumented SimGrid.");
   xbt_cfg_register_boolean(OPT_TRACING, "no", nullptr, "Enable Tracing.");
@@ -351,7 +351,7 @@ void TRACE_global_init()
   xbt_cfg_register_alias(OPT_TRACING_ONELINK_ONLY, "tracing/onelink_only");
 
   /* instrumentation can be considered configured now */
-  trace_configured = 1;
+  trace_configured = true;
 }
 
 static void print_line (const char *option, const char *desc, const char *longdesc, int detailed)
@@ -597,7 +597,7 @@ void instr_pause_tracing ()
   }else{
     XBT_DEBUG ("Tracing is being paused.");
   }
-  trace_enabled = 0;
+  trace_enabled = false;
   XBT_DEBUG ("Tracing is paused.");
 }
 
@@ -612,7 +612,7 @@ void instr_resume_tracing ()
   if (previous_trace_state != -1){
     trace_enabled = previous_trace_state;
   }else{
-    trace_enabled = 1;
+    trace_enabled = true;
   }
   XBT_DEBUG ("Tracing is resumed.");
   previous_trace_state = -1;
index 121b6f9..a0899f6 100644 (file)
@@ -1,23 +1,18 @@
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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_config.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
-#include "src/surf/surf_private.h"
+#include "src/surf/surf_private.hpp"
 #include "surf/surf.h"
 #include <algorithm>
 
-typedef enum {
-  INSTR_US_DECLARE,
-  INSTR_US_SET,
-  INSTR_US_ADD,
-  INSTR_US_SUB
-} InstrUserVariable;
+enum InstrUserVariable { INSTR_US_DECLARE, INSTR_US_SET, INSTR_US_ADD, INSTR_US_SUB };
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
 
@@ -153,7 +148,7 @@ void TRACE_declare_mark(const char *mark_type)
   }
 
   XBT_DEBUG("MARK,declare %s", mark_type);
-  simgrid::instr::Type::eventNew(mark_type, PJ_type_get_root());
+  simgrid::instr::Type::getRootType()->getOrCreateEventType(mark_type);
   declared_marks.insert(mark_type);
 }
 
@@ -183,17 +178,16 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar
   if (not mark_value)
     THROWF (tracing_error, 1, "mark_value is nullptr");
 
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild(mark_type);
+  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName(mark_type);
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
 
-  char white[INSTR_DEFAULT_STR_SIZE] = "1.0 1.0 1.0";
   if (not mark_color)
-    mark_color = white;
+    mark_color = "1.0 1.0 1.0" /*white*/;
 
   XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
-  new simgrid::instr::Value(mark_value, mark_color, type);
+  simgrid::instr::Value::byNameOrCreate(mark_value, mark_color, type);
 }
 
 /** \ingroup TRACE_mark
@@ -239,14 +233,14 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
     THROWF (tracing_error, 1, "mark_value is nullptr");
 
   //check if mark_type is already declared
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild(mark_type);
+  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName(mark_type);
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
 
   XBT_DEBUG("MARK %s %s", mark_type, mark_value);
   new simgrid::instr::NewEvent(MSG_get_clock(), PJ_container_get_root(), type,
-                               simgrid::instr::Value::get(mark_value, type));
+                               simgrid::instr::Value::byName(mark_value, type));
 }
 
 /** \ingroup TRACE_mark
@@ -282,8 +276,8 @@ static void instr_user_variable(double time, const char* resource, const char* v
     if (created != filter->end()) { // declared, let's work
       char valuestr[100];
       snprintf(valuestr, 100, "%g", value);
-      container_t container = PJ_container_get(resource);
-      simgrid::instr::Type* type = container->type_->getChild(variable);
+      container_t container      = simgrid::instr::Container::byName(resource);
+      simgrid::instr::Type* type = container->type_->byName(variable);
       switch (what){
       case INSTR_US_SET:
         new simgrid::instr::SetVariableEvent(time, container, type, value);
@@ -316,7 +310,7 @@ static void instr_user_srcdst_variable(double time, const char *src, const char
   std::vector<simgrid::surf::LinkImpl*> route;
   simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
   for (auto const& link : route)
-    instr_user_variable(time, link->cname(), variable, father_type, value, what, nullptr, &user_link_variables);
+    instr_user_variable(time, link->getCname(), variable, father_type, value, what, nullptr, &user_link_variables);
 }
 
 /** \ingroup TRACE_API
@@ -945,10 +939,10 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const
  */
 void TRACE_host_set_state(const char* host, const char* state, const char* value_str)
 {
-  container_t container = PJ_container_get(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(
-      value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+  container_t container      = simgrid::instr::Container::byName(host);
+  simgrid::instr::Type* type = container->type_->byName(state);
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
+      value_str, "", type); /* if user didn't declare a value with a color, use no color */
   new simgrid::instr::SetStateEvent(MSG_get_clock(), container, type, val);
 }
 
@@ -965,10 +959,10 @@ void TRACE_host_set_state(const char* host, const char* state, const char* value
  */
 void TRACE_host_push_state(const char* host, const char* state, const char* value_str)
 {
-  container_t container = PJ_container_get(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(
-      value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+  container_t container      = simgrid::instr::Container::byName(host);
+  simgrid::instr::Type* type = container->type_->byName(state);
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
+      value_str, "", type); /* if user didn't declare a value with a color, use no color */
   new simgrid::instr::PushStateEvent(MSG_get_clock(), container, type, val);
 }
 
@@ -984,8 +978,8 @@ void TRACE_host_push_state(const char* host, const char* state, const char* valu
  */
 void TRACE_host_pop_state (const char *host, const char *state)
 {
-  container_t container = PJ_container_get(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
+  container_t container      = simgrid::instr::Container::byName(host);
+  simgrid::instr::Type* type = container->type_->byName(state);
   new simgrid::instr::PopStateEvent(MSG_get_clock(), container, type);
 }
 
index 7541e6b..3316dbd 100644 (file)
@@ -5,18 +5,18 @@
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
-
+#include "src/instr/instr_private.hpp"
 #include "surf/surf.h"
-
-#include "src/instr/instr_private.h"
-
 #include <unordered_map>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)");
 
+extern FILE* tracing_file;
+extern std::map<container_t, FILE*> tracing_files; // TI specific
+double prefix = 0.0;                               // TI specific
+
 static container_t rootContainer = nullptr;    /* the root container */
-static std::unordered_map<std::string, simgrid::instr::Container*>
-    allContainers;                              /* all created containers indexed by name */
+static std::unordered_map<std::string, container_t> allContainers; /* all created containers indexed by name */
 std::set<std::string> trivaNodeTypes;           /* all host types defined */
 std::set<std::string> trivaEdgeTypes;           /* all link types defined */
 
@@ -26,197 +26,217 @@ long long int instr_new_paje_id ()
   return type_id++;
 }
 
+container_t PJ_container_get_root()
+{
+  return rootContainer;
+}
+
 void PJ_container_set_root (container_t root)
 {
   rootContainer = root;
 }
 
-simgrid::instr::Container::Container(const char* name, simgrid::instr::e_container_types kind, Container* father)
-    : name_(xbt_strdup(name)), father_(father)
-{
-  xbt_assert(name != nullptr, "Container name cannot be nullptr");
+namespace simgrid {
+namespace instr {
 
+Container::Container(std::string name, e_container_types kind, Container* father)
+    : kind_(kind), name_(name), father_(father)
+{
   static long long int container_id = 0;
-  id_                               = bprintf("%lld", container_id); // id (or alias) of the container
+  id_                               = std::to_string(container_id); // id (or alias) of the container
   container_id++;
 
-  //Search for network_element_t
-  switch (kind){
-    case simgrid::instr::INSTR_HOST:
-      this->netpoint_ = sg_host_by_name(name)->pimpl_netpoint;
-      xbt_assert(this->netpoint_, "Element '%s' not found", name);
+  if (father_) {
+    level_ = father_->level_ + 1;
+    XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
+  }
+
+  // Search for network_element_t for AS, ROUTER and HOST
+  // Name the kind of container. For AS otherwise, the name depends on its level
+  std::string typeNameBuff;
+  switch (kind_) {
+    case INSTR_AS:
+      netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
+      xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+      typeNameBuff = std::string("L") + std::to_string(level_);
       break;
-    case simgrid::instr::INSTR_ROUTER:
-      this->netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
-      xbt_assert(this->netpoint_, "Element '%s' not found", name);
+    case INSTR_ROUTER:
+      netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
+      xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+      typeNameBuff = std::string("ROUTER");
       break;
-    case simgrid::instr::INSTR_AS:
-      this->netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
-      xbt_assert(this->netpoint_, "Element '%s' not found", name);
+    case INSTR_HOST:
+      netpoint_ = sg_host_by_name(name.c_str())->pimpl_netpoint;
+      xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
+      typeNameBuff = std::string("HOST");
+      break;
+    case INSTR_LINK:
+      typeNameBuff = std::string("LINK");
+      break;
+    case INSTR_SMPI:
+      typeNameBuff = std::string("MPI");
+      break;
+    case INSTR_MSG_PROCESS:
+      typeNameBuff = std::string("MSG_PROCESS");
+      break;
+    case INSTR_MSG_VM:
+      typeNameBuff = std::string("MSG_VM");
+      break;
+    case INSTR_MSG_TASK:
+      typeNameBuff = std::string("MSG_TASK");
       break;
     default:
-      this->netpoint_ = nullptr;
+      THROWF(tracing_error, 0, "new container kind is unknown.");
       break;
   }
 
   if (father_) {
-    this->level_ = father_->level_ + 1;
-    XBT_DEBUG("new container %s, child of %s", name, father->name_);
-  }
-
-  // type definition (method depends on kind of this new container)
-  this->kind_ = kind;
-  if (this->kind_ == simgrid::instr::INSTR_AS) {
-    //if this container is of an AS, its type name depends on its level
-    char as_typename[INSTR_DEFAULT_STR_SIZE];
-    snprintf(as_typename, INSTR_DEFAULT_STR_SIZE, "L%d", this->level_);
-    if (this->father_) {
-      this->type_ = this->father_->type_->getChildOrNull(as_typename);
-      if (this->type_ == nullptr) {
-        this->type_ = simgrid::instr::Type::containerNew(as_typename, this->father_->type_);
-      }
-    }else{
-      this->type_ = simgrid::instr::Type::containerNew("0", nullptr);
-    }
-  }else{
-    //otherwise, the name is its kind
-    char typeNameBuff[INSTR_DEFAULT_STR_SIZE];
-    switch (this->kind_) {
-      case simgrid::instr::INSTR_HOST:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "HOST");
-        break;
-      case simgrid::instr::INSTR_LINK:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "LINK");
-        break;
-      case simgrid::instr::INSTR_ROUTER:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "ROUTER");
-        break;
-      case simgrid::instr::INSTR_SMPI:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MPI");
-        break;
-      case simgrid::instr::INSTR_MSG_PROCESS:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_PROCESS");
-        break;
-      case simgrid::instr::INSTR_MSG_VM:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_VM");
-        break;
-      case simgrid::instr::INSTR_MSG_TASK:
-        snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_TASK");
-        break;
-      default:
-        THROWF (tracing_error, 0, "new container kind is unknown.");
-        break;
-    }
-    simgrid::instr::Type* type = this->father_->type_->getChildOrNull(typeNameBuff);
-    if (type == nullptr){
-      this->type_ = simgrid::instr::Type::containerNew(typeNameBuff, this->father_->type_);
-    }else{
-      this->type_ = type;
-    }
-  }
-  this->children_ = xbt_dict_new_homogeneous(nullptr);
-  if (this->father_) {
-    xbt_dict_set(this->father_->children_, this->name_, this, nullptr);
-    LogContainerCreation(this);
+    type_ = father_->type_->getOrCreateContainerType(typeNameBuff);
+    father_->children_.insert({name_, this});
+    logCreation();
+  } else if (kind_ == INSTR_AS) {
+    type_ = Type::createRootType();
   }
 
   //register all kinds by name
-  if (not allContainers.emplace(this->name_, this).second) {
-    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", this->name_);
+  if (not allContainers.emplace(name_, this).second) {
+    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", name_.c_str());
   }
 
-  XBT_DEBUG("Add container name '%s'", this->name_);
+  XBT_DEBUG("Add container name '%s'", name_.c_str());
 
   //register NODE types for triva configuration
-  if (this->kind_ == simgrid::instr::INSTR_HOST || this->kind_ == simgrid::instr::INSTR_LINK ||
-      this->kind_ == simgrid::instr::INSTR_ROUTER) {
-    trivaNodeTypes.insert(this->type_->name_);
-  }
+  if (kind_ == INSTR_HOST || kind_ == INSTR_LINK || kind_ == INSTR_ROUTER)
+    trivaNodeTypes.insert(type_->getName());
 }
-simgrid::instr::Container::~Container()
+
+Container::~Container()
 {
-  XBT_DEBUG("destroy container %s", name_);
+  XBT_DEBUG("destroy container %s", name_.c_str());
+  // Begin with destroying my own children
+  for (auto child : children_) {
+    delete child.second;
+  }
 
-  // obligation to dump previous events because they might
-  // reference the container that is about to be destroyed
+  // obligation to dump previous events because they might reference the container that is about to be destroyed
   TRACE_last_timestamp_to_dump = surf_get_clock();
-  TRACE_paje_dump_buffer(1);
+  TRACE_paje_dump_buffer(true);
 
   // trace my destruction
   if (not TRACE_disable_destroy() && this != PJ_container_get_root()) {
-    // do not trace the container destruction if user requests
-    // or if the container is root
-    LogContainerDestruction(this);
+    // do not trace the container destruction if user requests or if the container is root
+    logDestruction();
   }
 
-  // remove it from allContainers data structure
+  // remove me from the allContainers data structure
   allContainers.erase(name_);
-
-  // free
-  xbt_free(name_);
-  xbt_free(id_);
-  xbt_dict_free(&children_);
-}
-
-simgrid::instr::Container* PJ_container_get(const char* name)
-{
-  container_t ret = PJ_container_get_or_null (name);
-  if (ret == nullptr){
-    THROWF(tracing_error, 1, "container with name %s not found", name);
-  }
-  return ret;
 }
 
-simgrid::instr::Container* PJ_container_get_or_null(const char* name)
+Container* Container::byNameOrNull(std::string name)
 {
   auto cont = allContainers.find(name);
   return cont == allContainers.end() ? nullptr : cont->second;
 }
 
-simgrid::instr::Container* PJ_container_get_root()
+Container* Container::byName(std::string name)
 {
-  return rootContainer;
+  Container* ret = Container::byNameOrNull(name);
+  if (ret == nullptr)
+    THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
+
+  return ret;
 }
 
-void PJ_container_remove_from_parent (container_t child)
+void Container::removeFromParent()
 {
-  if (child == nullptr){
-    THROWF (tracing_error, 0, "can't remove from parent with a nullptr child");
-  }
-
-  container_t parent = child->father_;
-  if (parent){
-    XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", child->name_, parent->name_);
-    xbt_dict_remove(parent->children_, child->name_);
+  if (father_) {
+    XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", name_.c_str(), father_->name_.c_str());
+    father_->children_.erase(name_);
   }
 }
 
-static void recursiveDestroyContainer (container_t container)
+void Container::logCreation()
 {
-  if (container == nullptr){
-    THROWF (tracing_error, 0, "trying to recursively destroy a nullptr container");
-  }
-  XBT_DEBUG("recursiveDestroyContainer %s", container->name_);
-  xbt_dict_cursor_t cursor = nullptr;
-  container_t child;
-  char *child_name;
-  xbt_dict_foreach (container->children_, cursor, child_name, child) {
-    recursiveDestroyContainer (child);
+  double timestamp = SIMIX_get_clock();
+  std::stringstream stream;
+
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_CreateContainer, timestamp);
+
+  if (instr_fmt_type == instr_fmt_paje) {
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << simgrid::instr::PAJE_CreateContainer;
+    stream << " ";
+    /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
+    if (timestamp < 1e-12)
+      stream << 0;
+    else
+      stream << timestamp;
+    stream << " " << id_ << " " << type_->getId() << " " << father_->id_ << " \"" << name_ << "\"" << std::endl;
+    fprintf(tracing_file, "%s", stream.str().c_str());
+    XBT_DEBUG("Dump %s", stream.str().c_str());
+    stream.str("");
+    stream.clear();
+  } else if (instr_fmt_type == instr_fmt_TI) {
+    // if we are in the mode with only one file
+    static FILE* ti_unique_file = nullptr;
+
+    if (tracing_files.empty()) {
+      // generate unique run id with time
+      prefix = xbt_os_time();
+    }
+
+    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
+      char* folder_name = bprintf("%s_files", TRACE_get_filename());
+      char* filename    = bprintf("%s/%f_%s.txt", folder_name, prefix, name_.c_str());
+#ifdef WIN32
+      _mkdir(folder_name);
+#else
+      mkdir(folder_name, S_IRWXU | S_IRWXG | S_IRWXO);
+#endif
+      ti_unique_file = fopen(filename, "w");
+      xbt_assert(ti_unique_file, "Tracefile %s could not be opened for writing: %s", filename, strerror(errno));
+      fprintf(tracing_file, "%s\n", filename);
+
+      xbt_free(folder_name);
+      xbt_free(filename);
+    }
+
+    tracing_files.insert({this, ti_unique_file});
+  } else {
+    THROW_IMPOSSIBLE;
   }
-  delete container;
 }
 
-void PJ_container_free_all ()
+void Container::logDestruction()
 {
-  container_t root = PJ_container_get_root();
-  if (root == nullptr){
-    THROWF (tracing_error, 0, "trying to free all containers, but root is nullptr");
-  }
-  recursiveDestroyContainer (root);
-  rootContainer = nullptr;
-
-  //checks
-  if (not allContainers.empty()) {
-    THROWF(tracing_error, 0, "some containers still present even after destroying all of them");
+  std::stringstream stream;
+  double timestamp = SIMIX_get_clock();
+
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_DestroyContainer, timestamp);
+
+  if (instr_fmt_type == instr_fmt_paje) {
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << simgrid::instr::PAJE_DestroyContainer;
+    stream << " ";
+    /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
+    if (timestamp < 1e-12)
+      stream << 0;
+    else
+      stream << timestamp;
+    stream << " " << type_->getId() << " " << id_ << std::endl;
+    fprintf(tracing_file, "%s", stream.str().c_str());
+    XBT_DEBUG("Dump %s", stream.str().c_str());
+    stream.str("");
+    stream.clear();
+  } else if (instr_fmt_type == instr_fmt_TI) {
+    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || tracing_files.size() == 1) {
+      FILE* f = tracing_files.at(this);
+      fclose(f);
+    }
+    tracing_files.erase(this);
+  } else {
+    THROW_IMPOSSIBLE;
   }
 }
+}
+}
index 4f49363..76d7967 100644 (file)
@@ -1,17 +1,17 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 "src/instr/instr_private.h"
 #include "simgrid/sg_config.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_header, instr, "Paje tracing event system (header)");
 
 extern FILE *tracing_file;
 
-static void TRACE_header_PajeDefineContainerType (int basic, int size)
+static void TRACE_header_PajeDefineContainerType(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineContainerType %d\n", simgrid::instr::PAJE_DefineContainerType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -24,7 +24,7 @@ static void TRACE_header_PajeDefineContainerType (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineVariableType (int basic, int size)
+static void TRACE_header_PajeDefineVariableType(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineVariableType %d\n", simgrid::instr::PAJE_DefineVariableType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -38,7 +38,7 @@ static void TRACE_header_PajeDefineVariableType (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineStateType (int basic, int size)
+static void TRACE_header_PajeDefineStateType(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineStateType %d\n", simgrid::instr::PAJE_DefineStateType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -51,7 +51,7 @@ static void TRACE_header_PajeDefineStateType (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineEventType (int basic, int size)
+static void TRACE_header_PajeDefineEventType(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineEventType %d\n", simgrid::instr::PAJE_DefineEventType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -64,7 +64,7 @@ static void TRACE_header_PajeDefineEventType (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineLinkType (int basic, int size)
+static void TRACE_header_PajeDefineLinkType(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineLinkType %d\n", simgrid::instr::PAJE_DefineLinkType);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -81,7 +81,7 @@ static void TRACE_header_PajeDefineLinkType (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDefineEntityValue (int basic, int size)
+static void TRACE_header_PajeDefineEntityValue(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeDefineEntityValue %d\n", simgrid::instr::PAJE_DefineEntityValue);
   fprintf(tracing_file, "%%       Alias string\n");
@@ -95,7 +95,7 @@ static void TRACE_header_PajeDefineEntityValue (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeCreateContainer (int basic, int size)
+static void TRACE_header_PajeCreateContainer()
 {
   fprintf(tracing_file, "%%EventDef PajeCreateContainer %d\n", simgrid::instr::PAJE_CreateContainer);
   fprintf(tracing_file, "%%       Time date\n");
@@ -106,7 +106,7 @@ static void TRACE_header_PajeCreateContainer (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeDestroyContainer (int basic, int size)
+static void TRACE_header_PajeDestroyContainer()
 {
   fprintf(tracing_file, "%%EventDef PajeDestroyContainer %d\n", simgrid::instr::PAJE_DestroyContainer);
   fprintf(tracing_file, "%%       Time date\n");
@@ -115,7 +115,7 @@ static void TRACE_header_PajeDestroyContainer (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeSetVariable (int basic, int size)
+static void TRACE_header_PajeSetVariable()
 {
   fprintf(tracing_file, "%%EventDef PajeSetVariable %d\n", simgrid::instr::PAJE_SetVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -125,7 +125,7 @@ static void TRACE_header_PajeSetVariable (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeAddVariable (int basic, int size)
+static void TRACE_header_PajeAddVariable()
 {
   fprintf(tracing_file, "%%EventDef PajeAddVariable %d\n", simgrid::instr::PAJE_AddVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -135,7 +135,7 @@ static void TRACE_header_PajeAddVariable (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeSubVariable (int basic, int size)
+static void TRACE_header_PajeSubVariable()
 {
   fprintf(tracing_file, "%%EventDef PajeSubVariable %d\n", simgrid::instr::PAJE_SubVariable);
   fprintf(tracing_file, "%%       Time date\n");
@@ -145,8 +145,7 @@ static void TRACE_header_PajeSubVariable (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-
-static void TRACE_header_PajeSetState (int basic, int size)
+static void TRACE_header_PajeSetState()
 {
   fprintf(tracing_file, "%%EventDef PajeSetState %d\n", simgrid::instr::PAJE_SetState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -156,7 +155,7 @@ static void TRACE_header_PajeSetState (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajePushState (int basic, int size)
+static void TRACE_header_PajePushState(int size)
 {
   fprintf(tracing_file, "%%EventDef PajePushState %d\n", simgrid::instr::PAJE_PushState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -177,7 +176,7 @@ static void TRACE_header_PajePushState (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajePopState (int basic, int size)
+static void TRACE_header_PajePopState()
 {
   fprintf(tracing_file, "%%EventDef PajePopState %d\n", simgrid::instr::PAJE_PopState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -186,9 +185,10 @@ static void TRACE_header_PajePopState (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeResetState (int basic, int size)
+static void TRACE_header_PajeResetState(bool basic)
 {
-  if (basic) return;
+  if (basic)
+    return;
 
   fprintf(tracing_file, "%%EventDef PajeResetState %d\n", simgrid::instr::PAJE_ResetState);
   fprintf(tracing_file, "%%       Time date\n");
@@ -197,7 +197,7 @@ static void TRACE_header_PajeResetState (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeStartLink (int basic, int size)
+static void TRACE_header_PajeStartLink(bool basic, int size)
 {
   fprintf(tracing_file, "%%EventDef PajeStartLink %d\n", simgrid::instr::PAJE_StartLink);
   fprintf(tracing_file, "%%       Time date\n");
@@ -214,7 +214,7 @@ static void TRACE_header_PajeStartLink (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeEndLink (int basic, int size)
+static void TRACE_header_PajeEndLink(bool basic)
 {
   fprintf(tracing_file, "%%EventDef PajeEndLink %d\n", simgrid::instr::PAJE_EndLink);
   fprintf(tracing_file, "%%       Time date\n");
@@ -230,7 +230,7 @@ static void TRACE_header_PajeEndLink (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-static void TRACE_header_PajeNewEvent (int basic, int size)
+static void TRACE_header_PajeNewEvent()
 {
   fprintf(tracing_file, "%%EventDef PajeNewEvent %d\n", simgrid::instr::PAJE_NewEvent);
   fprintf(tracing_file, "%%       Time date\n");
@@ -240,25 +240,25 @@ static void TRACE_header_PajeNewEvent (int basic, int size)
   fprintf(tracing_file, "%%EndEventDef\n");
 }
 
-void TRACE_header(int basic, int size)
+void TRACE_header(bool basic, int size)
 {
   XBT_DEBUG ("Define paje header");
-  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_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();
+  TRACE_header_PajeDestroyContainer();
+  TRACE_header_PajeSetVariable();
+  TRACE_header_PajeAddVariable();
+  TRACE_header_PajeSubVariable();
+  TRACE_header_PajeSetState();
+  TRACE_header_PajePushState(size);
+  TRACE_header_PajePopState();
+  TRACE_header_PajeResetState(basic);
   TRACE_header_PajeStartLink (basic, size);
-  TRACE_header_PajeEndLink (basic, size);
-  TRACE_header_PajeNewEvent (basic, size);
+  TRACE_header_PajeEndLink(basic);
+  TRACE_header_PajeNewEvent();
 }
index 3e7c282..bcc695e 100644 (file)
@@ -1,31 +1,22 @@
-/* Copyright (c) 2010-2016. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 "src/instr/instr_private.h"
-#include "src/instr/instr_smpi.h"
+#include "simgrid/sg_config.h"
+#include "src/instr/instr_private.hpp"
+#include "src/instr/instr_smpi.hpp"
 #include "src/smpi/include/private.hpp"
 #include "typeinfo"
 #include "xbt/virtu.h" /* sg_cmdline */
-#include "simgrid/sg_config.h"
-
-#include <sstream>
-#include <vector>
-#include <iomanip> /** std::setprecision **/
-#include <sys/stat.h>
-#ifdef WIN32
-#include <direct.h> // _mkdir
-#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_trace, instr, "tracing event system");
 
 static std::stringstream stream;
 FILE *tracing_file = nullptr;
 
-static xbt_dict_t tracing_files = nullptr; // TI specific
-static double prefix=0.0; // TI specific
+std::map<container_t, FILE*> tracing_files; // TI specific
 
 std::vector<simgrid::instr::PajeEvent*> buffer;
 void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf);
@@ -62,7 +53,7 @@ void dump_comment_file (const char *filename)
 
 double TRACE_last_timestamp_to_dump = 0;
 //dumps the trace file until the timestamp TRACE_last_timestamp_to_dump
-void TRACE_paje_dump_buffer (int force)
+void TRACE_paje_dump_buffer(bool force)
 {
   if (not TRACE_is_enabled())
     return;
@@ -121,22 +112,22 @@ static void print_timestamp(simgrid::instr::PajeEvent* event)
 }
 
 /* internal do the instrumentation module */
-static void insert_into_buffer(simgrid::instr::PajeEvent* tbi)
+void simgrid::instr::PajeEvent::insertIntoBuffer()
 {
-  if (TRACE_buffer() == 0){
-    tbi->print ();
-    delete tbi;
+  if (not TRACE_buffer()) {
+    print();
+    delete this;
     return;
   }
   buffer_debug(&buffer);
 
-  XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%zu)", __FUNCTION__, (int)tbi->eventType_,
-            tbi->timestamp_, buffer.size());
+  XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%zu)", __FUNCTION__, static_cast<int>(eventType_),
+            timestamp_, buffer.size());
   std::vector<simgrid::instr::PajeEvent*>::reverse_iterator i;
   for (i = buffer.rbegin(); i != buffer.rend(); ++i) {
     simgrid::instr::PajeEvent* e1 = *i;
-    XBT_DEBUG("compare to %p is of type %d; timestamp:%f", e1, (int)e1->eventType_, e1->timestamp_);
-    if (e1->timestamp_ <= tbi->timestamp_)
+    XBT_DEBUG("compare to %p is of type %d; timestamp:%f", e1, static_cast<int>(e1->eventType_), e1->timestamp_);
+    if (e1->timestamp_ <= timestamp_)
       break;
   }
   if (i == buffer.rend())
@@ -144,9 +135,8 @@ static void insert_into_buffer(simgrid::instr::PajeEvent* tbi)
   else if (i == buffer.rbegin())
     XBT_DEBUG("%s: inserted at end", __FUNCTION__);
   else
-    XBT_DEBUG("%s: inserted at pos= %zd from its end", __FUNCTION__,
-        std::distance(buffer.rbegin(),i));
-  buffer.insert(i.base(), tbi);
+    XBT_DEBUG("%s: inserted at pos= %zd from its end", __FUNCTION__, std::distance(buffer.rbegin(), i));
+  buffer.insert(i.base(), this);
 
   buffer_debug(&buffer);
 }
@@ -192,7 +182,7 @@ void TRACE_paje_end() {
   XBT_DEBUG("Filename %s is closed", filename);
 }
 
-void LogContainerTypeDefinition(simgrid::instr::Type* type)
+void simgrid::instr::Type::logContainerTypeDefinition()
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineContainerType);
   //print it
@@ -201,31 +191,29 @@ void LogContainerTypeDefinition(simgrid::instr::Type* type)
               TRACE_precision(), 0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << simgrid::instr::PAJE_DefineContainerType;
-    stream << " " << type->id_ << " " << type->father_->id_ << " " << type->name_;
+    stream << " " << id_ << " " << father_->getId() << " " << name_;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
   } else {
     THROW_IMPOSSIBLE;
   }
-  //--
 }
 
-void LogVariableTypeDefinition(simgrid::instr::Type* type)
+void simgrid::instr::Type::logVariableTypeDefinition()
 {
-
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineVariableType);
 
   //print it
-if (instr_fmt_type == instr_fmt_paje) {
-  XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineVariableType,
-            TRACE_precision(), 0.);
-  stream << std::fixed << std::setprecision(TRACE_precision());
-  stream << simgrid::instr::PAJE_DefineVariableType;
-  stream << " " << type->id_ << " " << type->father_->id_ << " " << type->name_;
-  if (type->color_)
-    stream << " \"" << type->color_ << "\"";
-  print_row();
+  if (instr_fmt_type == instr_fmt_paje) {
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineVariableType,
+              TRACE_precision(), 0.);
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << simgrid::instr::PAJE_DefineVariableType;
+    stream << " " << id_ << " " << father_->getId() << " " << name_;
+    if (isColored())
+      stream << " \"" << color_ << "\"";
+    print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
   } else {
@@ -233,16 +221,16 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
-void LogStateTypeDefinition(simgrid::instr::Type* type)
+void simgrid::instr::Type::logStateTypeDefinition()
 {
   //print it
-if (instr_fmt_type == instr_fmt_paje) {
-  XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineStateType, TRACE_precision(),
-            0.);
-  stream << std::fixed << std::setprecision(TRACE_precision());
-  stream << simgrid::instr::PAJE_DefineStateType;
-  stream << " " << type->id_ << " " << type->father_->id_ << " " << type->name_;
-  print_row();
+  if (instr_fmt_type == instr_fmt_paje) {
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineStateType,
+              TRACE_precision(), 0.);
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << simgrid::instr::PAJE_DefineStateType;
+    stream << " " << id_ << " " << father_->getId() << " " << name_;
+    print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
   } else {
@@ -250,7 +238,7 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
-void LogDefineEventType(simgrid::instr::Type* type)
+void simgrid::instr::Type::logDefineEventType()
 {
   //print it
   if (instr_fmt_type == instr_fmt_paje) {
@@ -258,7 +246,7 @@ void LogDefineEventType(simgrid::instr::Type* type)
               TRACE_precision(), 0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << simgrid::instr::PAJE_DefineEventType;
-    stream << " " << type->id_ << " " << type->father_->id_ << " " << type->name_;
+    stream << " " << id_ << " " << father_->getId() << " " << name_;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -267,18 +255,17 @@ void LogDefineEventType(simgrid::instr::Type* type)
   }
 }
 
-void LogLinkTypeDefinition(simgrid::instr::Type* type, simgrid::instr::Type* source, simgrid::instr::Type* dest)
+void simgrid::instr::Type::logLinkTypeDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest)
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineLinkType);
   //print it
-if (instr_fmt_type == instr_fmt_paje) {
-  XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineLinkType, TRACE_precision(),
-            0.);
-  stream << std::fixed << std::setprecision(TRACE_precision());
-  stream << simgrid::instr::PAJE_DefineLinkType;
-  stream << " " << type->id_ << " " << type->father_->id_ << " " << source->id_ << " " << dest->id_ << " "
-         << type->name_;
-  print_row();
+  if (instr_fmt_type == instr_fmt_paje) {
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, simgrid::instr::PAJE_DefineLinkType, TRACE_precision(),
+              0.);
+    stream << std::fixed << std::setprecision(TRACE_precision());
+    stream << simgrid::instr::PAJE_DefineLinkType;
+    stream << " " << id_ << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << name_;
+    print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
   } else {
@@ -286,16 +273,16 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
-void LogEntityValue(simgrid::instr::Value* val)
+void simgrid::instr::Value::print()
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, simgrid::instr::PAJE_DefineEntityValue);
   //print it
-if (instr_fmt_type == instr_fmt_paje) {
+  if (instr_fmt_type == instr_fmt_paje) {
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << simgrid::instr::PAJE_DefineEntityValue;
-    stream << " " << val->id_ << " " << val->father_->id_ << " " << val->name_;
-    if (val->color_)
-      stream << " \"" << val->color_ << "\"";
+    stream << " " << id_ << " " << father_->getId() << " " << name_;
+    if (isColored())
+      stream << " \"" << color_ << "\"";
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -305,96 +292,11 @@ if (instr_fmt_type == instr_fmt_paje) {
 }
 
 
-void LogContainerCreation (container_t container)
-{
-  double timestamp = SIMIX_get_clock();
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_CreateContainer, timestamp);
-
-  if (instr_fmt_type == instr_fmt_paje) {
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << simgrid::instr::PAJE_CreateContainer;
-    stream << " ";
-  /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
-    if (timestamp < 1e-12)
-      stream << 0;
-    else
-      stream << timestamp;
-    stream << " " << container->id_ << " " << container->type_->id_ << " " << container->father_->id_ << " \""
-           << container->name_ << "\"";
-
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    // if we are in the mode with only one file
-    static FILE* ti_unique_file = nullptr;
-
-    if (tracing_files == nullptr) {
-      tracing_files = xbt_dict_new_homogeneous(nullptr);
-      // generate unique run id with time
-      prefix = xbt_os_time();
-    }
-
-    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
-      char* folder_name = bprintf("%s_files", TRACE_get_filename());
-      char* filename    = bprintf("%s/%f_%s.txt", folder_name, prefix, container->name_);
-#ifdef WIN32
-      _mkdir(folder_name);
-#else
-      mkdir(folder_name, S_IRWXU | S_IRWXG | S_IRWXO);
-#endif
-      ti_unique_file = fopen(filename, "w");
-      xbt_assert(ti_unique_file, "Tracefile %s could not be opened for writing: %s", filename, strerror(errno));
-      fprintf(tracing_file, "%s\n", filename);
-
-      xbt_free(folder_name);
-      xbt_free(filename);
-    }
-
-    xbt_dict_set(tracing_files, container->name_, (void*)ti_unique_file, nullptr);
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-void LogContainerDestruction(container_t container)
-{
-  double timestamp                               = SIMIX_get_clock();
-
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, simgrid::instr::PAJE_DestroyContainer, timestamp);
-
-  if (instr_fmt_type == instr_fmt_paje) {
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << simgrid::instr::PAJE_DestroyContainer;
-    stream << " ";
-  /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
-    if (timestamp < 1e-12)
-        stream << 0;
-    else
-      stream << timestamp;
-    stream << " " << container->type_->id_ << " " << container->id_;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    if (not xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || xbt_dict_length(tracing_files) == 1) {
-      FILE* f = (FILE*)xbt_dict_get_or_null(tracing_files, container->name_);
-      fclose(f);
-    }
-    xbt_dict_remove(tracing_files, container->name_);
-        } else {
-          THROW_IMPOSSIBLE;
-        }
-}
-
 simgrid::instr::SetVariableEvent::SetVariableEvent(double timestamp, container_t container, Type* type, double value)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_SetVariable), value(value)
 {
-  this->eventType_ = PAJE_SetVariable;
-  this->timestamp_ = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::SetVariableEvent::print()
@@ -404,7 +306,7 @@ void simgrid::instr::SetVariableEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_ << " " << value;
+    stream << " " << type->getId() << " " << container->id_ << " " << value;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -415,16 +317,10 @@ void simgrid::instr::SetVariableEvent::print()
 
 simgrid::instr::AddVariableEvent::AddVariableEvent(double timestamp, container_t container, simgrid::instr::Type* type,
                                                    double value)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_AddVariable), value(value)
 {
-  this->eventType_ = PAJE_AddVariable;
-  this->timestamp_ = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::AddVariableEvent::print()
@@ -434,7 +330,7 @@ void simgrid::instr::AddVariableEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_ << " " << value;
+    stream << " " << type->getId() << " " << container->id_ << " " << value;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -444,16 +340,10 @@ void simgrid::instr::AddVariableEvent::print()
 }
 
 simgrid::instr::SubVariableEvent::SubVariableEvent(double timestamp, container_t container, Type* type, double value)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_SubVariable), value(value)
 {
-  this->eventType_ = PAJE_SubVariable;
-  this->timestamp_ = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->value     = value;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::SubVariableEvent::print()
@@ -463,7 +353,7 @@ void simgrid::instr::SubVariableEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_ << " " << value;
+    stream << " " << type->getId() << " " << container->id_ << " " << value;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -472,14 +362,9 @@ void simgrid::instr::SubVariableEvent::print()
   }
 }
 
-simgrid::instr::SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, Value* val)
+simgrid::instr::SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, Value* value)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_SetState), value(value)
 {
-  this->eventType_                      = PAJE_SetState;
-  this->timestamp_                      = timestamp;
-  this->type      = type;
-  this->container = container;
-  this->val                             = val;
-
 #if HAVE_SMPI
   if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
     smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
@@ -489,8 +374,7 @@ simgrid::instr::SetStateEvent::SetStateEvent(double timestamp, container_t conta
 #endif
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::SetStateEvent::print()
@@ -500,8 +384,8 @@ void simgrid::instr::SetStateEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_;
-    stream << " " << val->id_;
+    stream << " " << type->getId() << " " << container->id_;
+    stream << " " << value->getId();
 #if HAVE_SMPI
     if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
       stream << " \"" << filename << "\" " << linenumber;
@@ -515,16 +399,10 @@ void simgrid::instr::SetStateEvent::print()
   }
 }
 
-simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val,
+simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* value,
                                                void* extra)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_PushState), value(value), extra_(extra)
 {
-  this->eventType_                  = PAJE_PushState;
-  this->timestamp_                  = timestamp;
-  this->type = type;
-  this->container = container;
-  this->val                         = val;
-  this->extra_     = extra;
-
 #if HAVE_SMPI
   if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
     smpi_trace_call_location_t* loc = smpi_trace_get_call_location();
@@ -535,7 +413,7 @@ simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t con
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
 
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val)
@@ -548,8 +426,8 @@ void simgrid::instr::PushStateEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_;
-    stream << " " << val->id_;
+    stream << " " << type->getId() << " " << container->id_;
+    stream << " " << value->getId();
 
     if (TRACE_display_sizes()) {
       stream << " ";
@@ -580,12 +458,12 @@ void simgrid::instr::PushStateEvent::print()
 
     char* process_id = nullptr;
     // FIXME: dirty extract "rank-" from the name, as we want the bare process id here
-    if (strstr(container->name_, "rank-") == nullptr)
-      process_id = xbt_strdup(container->name_);
+    if (strstr(container->name_.c_str(), "rank-") == nullptr)
+      process_id = xbt_strdup(container->name_.c_str());
     else
-      process_id = xbt_strdup(container->name_ + 5);
+      process_id = xbt_strdup(container->name_.c_str() + 5);
 
-    FILE* trace_file = (FILE*)xbt_dict_get(tracing_files, container->name_);
+    FILE* trace_file = tracing_files.at(container);
 
     switch (extra->type) {
       case TRACING_INIT:
@@ -676,7 +554,8 @@ void simgrid::instr::PushStateEvent::print()
         fprintf(trace_file, "%d %s %s\n", extra->root, extra->datatype1, extra->datatype2);
         break;
       case TRACING_ALLGATHER: // rank allgather sendcount recvcounts (sendtype) (recvtype)
-        fprintf(trace_file, "%s allGather %d %d %s %s", process_id, extra->send_size, extra->recv_size, extra->datatype1, extra->datatype2);
+        fprintf(trace_file, "%s allGather %d %d %s %s", process_id, extra->send_size, extra->recv_size,
+                extra->datatype1, extra->datatype2);
         break;
       case TRACING_WAITANY:
       case TRACING_SENDRECV:
@@ -690,7 +569,7 @@ void simgrid::instr::PushStateEvent::print()
       case TRACING_SSEND:
       case TRACING_ISSEND:
       default:
-        XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", val->name_);
+        XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", value->getCname());
         break;
     }
 
@@ -707,15 +586,10 @@ void simgrid::instr::PushStateEvent::print()
 }
 
 simgrid::instr::PopStateEvent::PopStateEvent(double timestamp, container_t container, Type* type)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_PopState)
 {
-  this->eventType_ = PAJE_PopState;
-  this->timestamp_ = timestamp;
-  this->type      = type;
-  this->container = container;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::PopStateEvent::print()
@@ -725,7 +599,7 @@ void simgrid::instr::PopStateEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_;
+    stream << " " << type->getId() << " " << container->id_;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -735,15 +609,10 @@ void simgrid::instr::PopStateEvent::print()
 }
 
 simgrid::instr::ResetStateEvent::ResetStateEvent(double timestamp, container_t container, Type* type)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_ResetState)
 {
-  this->eventType_ = PAJE_ResetState;
-  this->timestamp_ = timestamp;
-  this->type      = type;
-  this->container = container;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
   delete[] this;
 }
 
@@ -754,7 +623,7 @@ void simgrid::instr::ResetStateEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_;
+    stream << " " << type->getId() << " " << container->id_;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -764,26 +633,21 @@ void simgrid::instr::ResetStateEvent::print()
 }
 
 simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
-                                               container_t sourceContainer, const char* value, const char* key)
+                                               container_t sourceContainer, std::string value, std::string key)
     : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
 {}
 
 simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
-                                               container_t sourceContainer, const char* value, const char* key,
+                                               container_t sourceContainer, std::string value, std::string key,
                                                int size)
-    : container_(container)
-    , type_(type)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_StartLink)
     , sourceContainer_(sourceContainer)
     , value_(value)
     , key_(key)
     , size_(size)
 {
-  eventType_            = PAJE_StartLink;
-  this->timestamp_      = timestamp;
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f, value:%s", __FUNCTION__, (int)eventType_, this->timestamp_, this->value_.c_str());
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::StartLinkEvent::print()
@@ -793,7 +657,7 @@ void simgrid::instr::StartLinkEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type_->id_ << " " << container_->id_ << " " << value_;
+    stream << " " << type->getId() << " " << container->id_ << " " << value_;
     stream << " " << sourceContainer_->id_ << " " << key_;
 
     if (TRACE_display_sizes()) {
@@ -808,26 +672,16 @@ void simgrid::instr::StartLinkEvent::print()
 }
 
 simgrid::instr::EndLinkEvent::EndLinkEvent(double timestamp, container_t container, Type* type,
-                                           container_t destContainer, const char* value, const char* key)
+                                           container_t destContainer, std::string value, std::string key)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_EndLink)
+    , destContainer(destContainer)
+    , value(value)
+    , key(key)
 {
-  this->eventType_    = PAJE_EndLink;
-  this->timestamp_    = timestamp;
-  this->type          = type;
-  this->container     = container;
-  this->destContainer = destContainer;
-  this->value         = xbt_strdup(value);
-  this->key           = xbt_strdup(key);
-
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
-
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
-simgrid::instr::EndLinkEvent::~EndLinkEvent()
-{
-  free(value);
-  free(key);
-}
 void simgrid::instr::EndLinkEvent::print()
 {
   if (instr_fmt_type == instr_fmt_paje) {
@@ -835,7 +689,7 @@ void simgrid::instr::EndLinkEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_ << " " << value;
+    stream << " " << type->getId() << " " << container->id_ << " " << value;
     stream << " " << destContainer->id_ << " " << key;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
@@ -846,16 +700,13 @@ void simgrid::instr::EndLinkEvent::print()
 }
 
 simgrid::instr::NewEvent::NewEvent(double timestamp, container_t container, Type* type, Value* val)
+    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent)
 {
-  this->eventType_                      = PAJE_NewEvent;
-  this->timestamp_                      = timestamp;
-  this->type      = type;
-  this->container = container;
   this->val                             = val;
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)eventType_, this->timestamp_);
 
-  insert_into_buffer (this);
+  insertIntoBuffer();
 }
 
 void simgrid::instr::NewEvent::print()
@@ -865,7 +716,7 @@ void simgrid::instr::NewEvent::print()
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->eventType_;
     print_timestamp(this);
-    stream << " " << type->id_ << " " << container->id_ << " " << val->id_;
+    stream << " " << type->getId() << " " << container->id_ << " " << val->getId();
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -874,7 +725,6 @@ void simgrid::instr::NewEvent::print()
   }
 }
 
-
 void TRACE_TI_start()
 {
   char *filename = TRACE_get_filename();
@@ -893,9 +743,7 @@ void TRACE_TI_start()
 
 void TRACE_TI_end()
 {
-  xbt_dict_free(&tracing_files);
   fclose(tracing_file);
   char *filename = TRACE_get_filename();
   XBT_DEBUG("Filename %s is closed", filename);
 }
-
index e8b59fa..87c7f20 100644 (file)
 /* This program 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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
 
 static simgrid::instr::Type* rootType = nullptr; /* the root type */
 
-simgrid::instr::Type* PJ_type_get_root()
-{
-  return rootType;
-}
+namespace simgrid {
+namespace instr {
 
-simgrid::instr::Type::Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind,
-                           Type* father)
-    : kind_(kind), father_(father)
+Type::Type(std::string name, std::string alias, std::string color, e_entity_types kind, Type* father)
+    : name_(name), color_(color), kind_(kind), father_(father)
 {
-  if (typeNameBuff == nullptr || key == nullptr){
-    THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
+  if (name.empty() || alias.empty()) {
+    THROWF(tracing_error, 0, "can't create a new type with no name or alias");
   }
 
-  this->name_     = xbt_strdup(typeNameBuff);
-  this->children_ = xbt_dict_new_homogeneous(nullptr);
-  this->values_   = xbt_dict_new_homogeneous(nullptr);
-  this->color_    = xbt_strdup(color);
-
-  this->id_ = bprintf("%lld", instr_new_paje_id());
+  id_ = std::to_string(instr_new_paje_id());
 
   if (father != nullptr){
-    xbt_dict_set(father->children_, key, this, nullptr);
-    XBT_DEBUG("new type %s, child of %s", typeNameBuff, father->name_);
+    father->children_.insert({alias, this});
+    XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->getCname());
   }
 }
 
-simgrid::instr::Type::~Type()
+Type::~Type()
 {
-  simgrid::instr::Value* val;
-  char *value_name;
-  xbt_dict_cursor_t cursor = nullptr;
-  xbt_dict_foreach (values_, cursor, value_name, val) {
-    XBT_DEBUG("free value %s, child of %s", val->name_, val->father_->name_);
-    delete val;
-  }
-  xbt_dict_free(&values_);
-  simgrid::instr::Type* child;
-  char *child_name;
-  xbt_dict_foreach (children_, cursor, child_name, child) {
-    delete child;
-  }
-  xbt_dict_free(&children_);
-  xbt_free(name_);
-  xbt_free(id_);
-  xbt_free(color_);
+  for (auto elm : values_)
+    delete elm.second;
+  for (auto elm : children_)
+    delete elm.second;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::getChild(const char* name)
+Type* Type::byName(std::string name)
 {
-  simgrid::instr::Type* ret = this->getChildOrNull(name);
-  if (ret == nullptr)
-    THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name, this->name_);
-  return ret;
-}
-
-simgrid::instr::Type* simgrid::instr::Type::getChildOrNull(const char* name)
-{
-  xbt_assert(name != nullptr, "can't get type with a nullptr name");
-
-  simgrid::instr::Type* ret = nullptr;
-  simgrid::instr::Type* child;
-  char *child_name;
-  xbt_dict_cursor_t cursor = nullptr;
-  xbt_dict_foreach (children_, cursor, child_name, child) {
-    if (strcmp(child->name_, name) == 0) {
+  Type* ret = nullptr;
+  for (auto elm : children_) {
+    if (elm.second->name_ == name) {
       if (ret != nullptr) {
         THROWF (tracing_error, 0, "there are two children types with the same name?");
       } else {
-        ret = child;
+        ret = elm.second;
       }
     }
   }
+  if (ret == nullptr)
+    THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), getCname());
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::containerNew(const char* name, simgrid::instr::Type* father)
+Type* Type::createRootType()
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
-  }
-
-  simgrid::instr::Type* ret = new simgrid::instr::Type(name, name, nullptr, TYPE_CONTAINER, father);
-  if (father == nullptr) {
-    rootType = ret;
-  } else {
-    XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->name_, ret->id_, father->name_, father->id_);
-    LogContainerTypeDefinition(ret);
-  }
+  simgrid::instr::Type* ret = new simgrid::instr::Type("0", "0", "", TYPE_CONTAINER, nullptr);
+  rootType                  = ret;
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::eventNew(const char* name, simgrid::instr::Type* father)
+Type* Type::getRootType()
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create an event type with a nullptr name");
-  }
-
-  Type* ret = new Type (name, name, nullptr, TYPE_EVENT, father);
-  XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->name_, ret->id_, father->name_, father->id_);
-  LogDefineEventType(ret);
-  return ret;
+  return rootType;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::variableNew(const char* name, const char* color,
-                                                        simgrid::instr::Type* father)
+Type* Type::getOrCreateContainerType(std::string name)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a variable type with a nullptr name");
-  }
-
-  Type* ret = nullptr;
+  auto it = children_.find(name);
+  if (it == children_.end()) {
+    Type* ret = new simgrid::instr::Type(name, name, "", TYPE_CONTAINER, this);
+    XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
+    ret->logContainerTypeDefinition();
+    return ret;
+  } else
+    return it->second;
+}
 
-  if (not color) {
-    char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
-    ret = new Type (name, name, white, TYPE_VARIABLE, father);
-  }else{
-    ret = new Type (name, name, color, TYPE_VARIABLE, father);
+Type* Type::getOrCreateEventType(std::string name)
+{
+  auto it = children_.find(name);
+  if (it == children_.end()) {
+    Type* ret = new Type(name, name, "", TYPE_EVENT, this);
+    XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
+    ret->logDefineEventType();
+    return ret;
+  } else {
+    return it->second;
   }
-  XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->name_, ret->id_, father->name_, father->id_);
-  LogVariableTypeDefinition (ret);
-  return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::linkNew(const char* name, Type* father, Type* source, Type* dest)
+Type* Type::getOrCreateVariableType(std::string name, std::string color)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a link type with a nullptr name");
-  }
+  auto it = children_.find(name);
+  if (it == children_.end()) {
+    Type* ret = new Type(name, name, color.empty() ? "1 1 1" : color, TYPE_VARIABLE, this);
 
-  char key[INSTR_DEFAULT_STR_SIZE];
-  snprintf(key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", name, source->id_, dest->id_);
-  Type* ret = new Type(name, key, nullptr, TYPE_LINK, father);
-  XBT_DEBUG("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->name_, ret->id_, father->name_, father->id_,
-            source->name_, source->id_, dest->name_, dest->id_);
-  LogLinkTypeDefinition(ret, source, dest);
-  return ret;
+    XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
+    ret->logVariableTypeDefinition();
+
+    return ret;
+  } else
+    return it->second;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::stateNew(const char* name, Type* father)
+Type* Type::getOrCreateLinkType(std::string name, Type* source, Type* dest)
 {
-  if (name == nullptr){
-    THROWF (tracing_error, 0, "can't create a state type with a nullptr name");
-  }
+  std::string alias = name + "-" + source->id_ + "-" + dest->id_;
+  auto it           = children_.find(alias);
+  if (it == children_.end()) {
+    Type* ret = new Type(name, alias, "", TYPE_LINK, this);
+    XBT_DEBUG("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->getCname(), ret->getId(), getCname(), getId(),
+              source->getCname(), source->getId(), dest->getCname(), dest->getId());
+    ret->logLinkTypeDefinition(source, dest);
+    return ret;
+  } else
+    return it->second;
+}
 
-  Type* ret = new Type(name, name, nullptr, TYPE_STATE, father);
-  XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name_, ret->id_, father->name_, father->id_);
-  LogStateTypeDefinition(ret);
-  return ret;
+Type* Type::getOrCreateStateType(std::string name)
+{
+  auto it = children_.find(name);
+  if (it == children_.end()) {
+    Type* ret = new Type(name, name, "", TYPE_STATE, this);
+    XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->getCname(), ret->getId(), getCname(), getId());
+    ret->logStateTypeDefinition();
+    return ret;
+  } else
+    return it->second;
+}
+}
 }
index a0b4a1a..380f1c6 100644 (file)
@@ -1,62 +1,58 @@
-/* Copyright (c) 2012-2015. The SimGrid Team.
+/* Copyright (c) 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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.hpp>
-
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
 
-simgrid::instr::Value::Value(const char* name, const char* color, simgrid::instr::Type* father)
+namespace simgrid {
+namespace instr {
+
+Value::Value(std::string name, std::string color, Type* father) : name_(name), color_(color), father_(father)
 {
-  if (name == nullptr || father == nullptr){
-    THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
+  if (name.empty() || father == nullptr) {
+    THROWF(tracing_error, 0, "can't create a value with no name (or a nullptr father)");
   }
-  this->name_   = xbt_strdup(name);
-  this->father_ = father;
-  this->color_  = xbt_strdup(color);
+  this->id_    = std::to_string(instr_new_paje_id());
 
-  this->id_ = bprintf("%lld", instr_new_paje_id());
-
-  xbt_dict_set(father->values_, name, this, nullptr);
-  XBT_DEBUG("new value %s, child of %s", name_, father_->name_);
-  LogEntityValue(this);
+  father->values_.insert({name, this});
+  XBT_DEBUG("new value %s, child of %s", name_.c_str(), father_->getCname());
+  print();
 };
 
-simgrid::instr::Value::~Value()
+Value::~Value()
 {
-  xbt_free(name_);
-  xbt_free(color_);
-  xbt_free(id_);
+  XBT_DEBUG("free value %s, child of %s", getCname(), father_->getCname());
 }
 
-simgrid::instr::Value* simgrid::instr::Value::get_or_new(const char* name, const char* color,
-                                                         simgrid::instr::Type* father)
+Value* Value::byNameOrCreate(std::string name, std::string color, Type* father)
 {
-  Value* ret = 0;
+  Value* ret = nullptr;
   try {
-    ret = Value::get(name, father);
-  }
-  catch(xbt_ex& e) {
+    ret = Value::byName(name, father);
+  } catch (xbt_ex& e) {
     ret = new Value(name, color, father);
   }
   return ret;
 }
 
-simgrid::instr::Value* simgrid::instr::Value::get(const char* name, Type* father)
+Value* Value::byName(std::string name, Type* father)
 {
-  if (name == nullptr || father == nullptr){
-    THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
+  if (name.empty() || father == nullptr) {
+    THROWF(tracing_error, 0, "can't get a value with no name (or a nullptr father)");
   }
 
-  if (father->kind_ == TYPE_VARIABLE)
-    THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name_);
-  Value* ret = (Value*)xbt_dict_get_or_null(father->values_, name);
-  if (ret == nullptr) {
-    THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name_);
+  if (father->getKind() == TYPE_VARIABLE)
+    THROWF(tracing_error, 0, "variables can't have different values (%s)", father->getCname());
+  auto ret = father->values_.find(name);
+  if (ret == father->values_.end()) {
+    THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name.c_str(), father->getCname());
   }
-  return ret;
+  return ret->second;
+}
+}
 }
diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h
deleted file mode 100644 (file)
index f611d22..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
-
-/* This program 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 INSTR_PRIVATE_H_
-#define INSTR_PRIVATE_H_
-
-#include <xbt/base.h>
-
-#include "instr/instr_interface.h"
-#include "simgrid/instr.h"
-#include "simgrid_config.h"
-#include "src/internal_config.h"
-#include <set>
-#include <string>
-
-/* Need to define function drand48 for Windows */
-/* FIXME: use _drand48() defined in src/surf/random_mgr.c instead */
-#ifdef _WIN32
-#  define drand48() (rand()/(RAND_MAX + 1.0))
-#endif
-
-#define INSTR_DEFAULT_STR_SIZE 500
-
-#include "xbt/graph.h"
-#include "xbt/dict.h"
-
-namespace simgrid {
-namespace instr {
-typedef enum {
-  PAJE_DefineContainerType,
-  PAJE_DefineVariableType,
-  PAJE_DefineStateType,
-  PAJE_DefineEventType,
-  PAJE_DefineLinkType,
-  PAJE_DefineEntityValue,
-  PAJE_CreateContainer,
-  PAJE_DestroyContainer,
-  PAJE_SetVariable,
-  PAJE_AddVariable,
-  PAJE_SubVariable,
-  PAJE_SetState,
-  PAJE_PushState,
-  PAJE_PopState,
-  PAJE_ResetState,
-  PAJE_StartLink,
-  PAJE_EndLink,
-  PAJE_NewEvent
-} e_event_type;
-
-typedef enum {
-  TYPE_VARIABLE,
-  TYPE_LINK,
-  TYPE_CONTAINER,
-  TYPE_STATE,
-  TYPE_EVENT
-} e_entity_types;
-
-//--------------------------------------------------
-
-class Type {
-public:
-  char* id_;
-  char* name_;
-  char* color_;
-
-  e_entity_types kind_;
-  Type* father_;
-  xbt_dict_t children_;
-  xbt_dict_t values_; // valid for all types except variable and container
-  Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind, Type* father);
-  ~Type();
-  Type* getChild(const char* name);
-  Type* getChildOrNull(const char* name);
-
-  static Type* containerNew(const char* name, Type* father);
-  static Type* eventNew(const char* name, Type* father);
-  static Type* variableNew(const char* name, const char* color, Type* father);
-  static Type* linkNew(const char* name, Type* father, Type* source, Type* dest);
-  static Type* stateNew(const char* name, Type* father);
-};
-
-//--------------------------------------------------
-class Value {
-public:
-  char* id_;
-  char* name_;
-  char* color_;
-
-  Type* father_;
-  Value(const char* name, const char* color, Type* father);
-  ~Value();
-  static Value* get_or_new(const char* name, const char* color, Type* father);
-  static Value* get(const char* name, Type* father);
-};
-
-
-//--------------------------------------------------
-typedef enum {
-  INSTR_HOST,
-  INSTR_LINK,
-  INSTR_ROUTER,
-  INSTR_AS,
-  INSTR_SMPI,
-  INSTR_MSG_VM,
-  INSTR_MSG_PROCESS,
-  INSTR_MSG_TASK
-} e_container_types;
-
-//--------------------------------------------------
-
-class Container {
-public:
-  Container(const char* name, simgrid::instr::e_container_types kind, Container* father);
-  virtual ~Container();
-
-  sg_netpoint_t netpoint_;
-  char* name_;             /* Unique name of this container */
-  char* id_;               /* Unique id of this container */
-  Type* type_;             /* Type of this container */
-  int level_ = 0;          /* Level in the hierarchy, root level is 0 */
-  e_container_types kind_; /* This container is of what kind */
-  Container* father_;
-  xbt_dict_t children_;
-};
-
-//--------------------------------------------------
-class PajeEvent {
-  public:
-    double timestamp_;
-    e_event_type eventType_;
-    virtual void print() = 0;
-    virtual ~PajeEvent();
-};
-
-//--------------------------------------------------
-class SetVariableEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    double value;
-
-  public:
-    SetVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
-};
-
-class AddVariableEvent:public PajeEvent {
-  private:
-    Container* container;
-    Type* type;
-    double value;
-
-  public:
-    AddVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
-};
-//--------------------------------------------------
-
-
-class SubVariableEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    double value;
-
-  public:
-    SubVariableEvent(double timestamp, Container* container, Type* type, double value);
-    void print() override;
-};
-//--------------------------------------------------
-
-class SetStateEvent : public PajeEvent  {
-  private:
-    Container* container;
-    Type* type;
-    Value* val;
-    const char* filename;
-    int linenumber;
-
-  public:
-    SetStateEvent(double timestamp, Container* container, Type* type, Value* val);
-    void print() override;
-};
-
-
-class PushStateEvent : public PajeEvent  {
-  public:
-    Container* container;
-    Type* type;
-    Value* val;
-    int size;
-    const char* filename;
-    int linenumber;
-    void* extra_;
-
-  public:
-    PushStateEvent(double timestamp, Container* container, Type* type, Value* val);
-    PushStateEvent(double timestamp, Container* container, Type* type, Value* val, void* extra);
-    void print() override;
-};
-
-class PopStateEvent : public PajeEvent  {
-  Container* container;
-  Type* type;
-
-public:
-  PopStateEvent(double timestamp, Container* container, Type* type);
-  void print() override;
-};
-
-class ResetStateEvent : public PajeEvent  {
-  Container* container;
-  Type* type;
-
-public:
-  ResetStateEvent(double timestamp, Container* container, Type* type);
-  void print() override;
-};
-
-class StartLinkEvent : public PajeEvent  {
-  Container* container_;
-  Type* type_;
-  Container* sourceContainer_;
-  std::string value_;
-  std::string key_;
-  int size_;
-
-public:
-  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, const char* value,
-                 const char* key);
-  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, const char* value,
-                 const char* key, int size);
-  void print() override;
-};
-
-class EndLinkEvent : public PajeEvent  {
-  Container* container;
-  Type* type;
-  Container* destContainer;
-  char *value;
-  char *key;
-  public:
-    EndLinkEvent(double timestamp, Container* container, Type* type, Container* destContainer, const char* value,
-                 const char* key);
-    ~EndLinkEvent();
-    void print() override;
-};
-
-
-class NewEvent : public PajeEvent  {
-  public:
-    Container* container;
-    Type* type;
-    Value* val;
-
-  public:
-    NewEvent(double timestamp, Container* container, Type* type, Value* val);
-    void print() override;
-};
-}
-} // namespace simgrid::instr
-typedef simgrid::instr::Container* container_t;
-
-SG_BEGIN_DECL()
-
-extern XBT_PRIVATE std::set<std::string> created_categories;
-extern XBT_PRIVATE std::set<std::string> declared_marks;
-extern XBT_PRIVATE std::set<std::string> user_host_variables;
-extern XBT_PRIVATE std::set<std::string> user_vm_variables;
-extern XBT_PRIVATE std::set<std::string> user_link_variables;
-extern XBT_PRIVATE double TRACE_last_timestamp_to_dump;
-
-/* instr_paje_header.c */
-XBT_PRIVATE void TRACE_header(int basic, int size);
-
-/* from paje.c */
-XBT_PRIVATE void TRACE_paje_start();
-XBT_PRIVATE void TRACE_paje_end();
-XBT_PRIVATE void TRACE_paje_dump_buffer (int force);
-
-
-/* from instr_config.c */
-XBT_PRIVATE bool TRACE_needs_platform ();
-XBT_PRIVATE bool TRACE_is_enabled();
-XBT_PRIVATE bool TRACE_platform();
-XBT_PRIVATE bool TRACE_platform_topology();
-XBT_PRIVATE bool TRACE_is_configured();
-XBT_PRIVATE bool TRACE_categorized ();
-XBT_PRIVATE bool TRACE_uncategorized ();
-XBT_PRIVATE bool TRACE_msg_process_is_enabled();
-XBT_PRIVATE bool TRACE_msg_vm_is_enabled();
-XBT_PRIVATE bool TRACE_buffer ();
-XBT_PRIVATE bool TRACE_disable_link();
-XBT_PRIVATE bool TRACE_disable_speed();
-XBT_PRIVATE bool TRACE_onelink_only ();
-XBT_PRIVATE bool TRACE_disable_destroy ();
-XBT_PRIVATE bool TRACE_basic ();
-XBT_PRIVATE bool TRACE_display_sizes ();
-XBT_PRIVATE char *TRACE_get_comment ();
-XBT_PRIVATE char *TRACE_get_comment_file ();
-XBT_PRIVATE int TRACE_precision ();
-XBT_PRIVATE char *TRACE_get_filename();
-XBT_PRIVATE char *TRACE_get_viva_uncat_conf ();
-XBT_PRIVATE char *TRACE_get_viva_cat_conf ();
-XBT_PRIVATE void TRACE_generate_viva_uncat_conf ();
-XBT_PRIVATE void TRACE_generate_viva_cat_conf ();
-XBT_PRIVATE void instr_pause_tracing ();
-XBT_PRIVATE void instr_resume_tracing ();
-
-/* Public functions used in SMPI */
-XBT_PUBLIC(bool) TRACE_smpi_is_enabled();
-XBT_PUBLIC(bool) TRACE_smpi_is_grouped();
-XBT_PUBLIC(bool) TRACE_smpi_is_computing();
-XBT_PUBLIC(bool) TRACE_smpi_is_sleeping();
-XBT_PUBLIC(bool) TRACE_smpi_view_internals();
-
-/* from resource_utilization.c */
-XBT_PRIVATE void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now,
-                                     double delta);
-XBT_PRIVATE void TRACE_surf_link_set_utilization(const char *resource,const char *category, double value, double now,
-                                     double delta);
-XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc();
-
-/* instr_paje.c */
-extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
-extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
-XBT_PRIVATE long long int instr_new_paje_id ();
-XBT_PUBLIC(container_t) PJ_container_get (const char *name);
-XBT_PUBLIC(simgrid::instr::Container*) PJ_container_get_or_null(const char* name);
-XBT_PUBLIC(container_t) PJ_container_get_root ();
-XBT_PUBLIC(void) PJ_container_set_root (container_t root);
-XBT_PUBLIC(void) PJ_container_free_all (void);
-XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container);
-
-/* instr_paje_types.c */
-XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get_root();
-
-/* instr_config.c */
-XBT_PRIVATE void TRACE_TI_start();
-XBT_PRIVATE void TRACE_TI_end();
-
-XBT_PRIVATE void TRACE_paje_dump_buffer (int force);
-XBT_PRIVATE void dump_comment_file (const char *filename);
-XBT_PRIVATE void dump_comment (const char *comment);
-
-struct s_instr_extra_data;
-typedef struct s_instr_extra_data *instr_extra_data;
-
-typedef enum{
-  TRACING_INIT,
-  TRACING_FINALIZE,
-  TRACING_COMM_SIZE,
-  TRACING_COMM_SPLIT,
-  TRACING_COMM_DUP,
-  TRACING_SEND,
-  TRACING_ISEND,
-  TRACING_SSEND,
-  TRACING_ISSEND,
-  TRACING_RECV,
-  TRACING_IRECV,
-  TRACING_SENDRECV,
-  TRACING_TEST,
-  TRACING_WAIT,
-  TRACING_WAITALL,
-  TRACING_WAITANY,
-  TRACING_BARRIER,
-  TRACING_BCAST,
-  TRACING_REDUCE,
-  TRACING_ALLREDUCE,
-  TRACING_ALLTOALL,
-  TRACING_ALLTOALLV,
-  TRACING_GATHER,
-  TRACING_GATHERV,
-  TRACING_SCATTER,
-  TRACING_SCATTERV,
-  TRACING_ALLGATHER,
-  TRACING_ALLGATHERV,
-  TRACING_REDUCE_SCATTER,
-  TRACING_COMPUTING,
-  TRACING_SLEEPING,
-  TRACING_SCAN,
-  TRACING_EXSCAN
-} e_caller_type ;
-
-typedef struct s_instr_extra_data {
-  e_caller_type type;
-  int send_size;
-  int recv_size;
-  double comp_size;
-  double sleep_duration;
-  int src;
-  int dst;
-  int root;
-  const char* datatype1;
-  const char* datatype2;
-  int * sendcounts;
-  int * recvcounts;
-  int num_processes;
-} s_instr_extra_data_t;
-
-/* Format of TRACING output.
- *   - paje is the regular format, that we all know
- *   - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such trace can easily be replayed with smpi_replay afterward.
- *     This trick should be removed and replaced by some code using the signal that we will create to cleanup the TRACING
- */
-typedef enum { instr_fmt_paje, instr_fmt_TI } instr_fmt_type_t;
-extern instr_fmt_type_t instr_fmt_type;
-
-SG_END_DECL()
-
-void LogContainerTypeDefinition(simgrid::instr::Type* type);
-void LogVariableTypeDefinition(simgrid::instr::Type* type);
-void LogStateTypeDefinition(simgrid::instr::Type* type);
-void LogLinkTypeDefinition(simgrid::instr::Type* type, simgrid::instr::Type* source, simgrid::instr::Type* dest);
-void LogEntityValue(simgrid::instr::Value* val);
-void LogContainerCreation (container_t container);
-void LogContainerDestruction (container_t container);
-void LogDefineEventType(simgrid::instr::Type* type);
-
-#endif
diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp
new file mode 100644 (file)
index 0000000..fc85fe6
--- /dev/null
@@ -0,0 +1,400 @@
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 INSTR_PRIVATE_HPP
+#define INSTR_PRIVATE_HPP
+
+#include <xbt/base.h>
+
+#include "instr/instr_interface.h"
+#include "simgrid/instr.h"
+#include "simgrid_config.h"
+#include "src/internal_config.h"
+#include "xbt/graph.h"
+#include <iomanip> /** std::setprecision **/
+#include <map>
+#include <set>
+#include <sstream>
+#include <string>
+#include <sys/stat.h>
+#ifdef WIN32
+#include <direct.h> // _mkdir
+/* Need to define function drand48 for Windows */
+/* FIXME: use _drand48() defined in src/surf/random_mgr.c instead */
+#define drand48() (rand() / (RAND_MAX + 1.0))
+#endif
+
+#define INSTR_DEFAULT_STR_SIZE 500
+
+namespace simgrid {
+namespace instr {
+
+class Value;
+
+enum e_event_type {
+  PAJE_DefineContainerType,
+  PAJE_DefineVariableType,
+  PAJE_DefineStateType,
+  PAJE_DefineEventType,
+  PAJE_DefineLinkType,
+  PAJE_DefineEntityValue,
+  PAJE_CreateContainer,
+  PAJE_DestroyContainer,
+  PAJE_SetVariable,
+  PAJE_AddVariable,
+  PAJE_SubVariable,
+  PAJE_SetState,
+  PAJE_PushState,
+  PAJE_PopState,
+  PAJE_ResetState,
+  PAJE_StartLink,
+  PAJE_EndLink,
+  PAJE_NewEvent
+};
+
+//--------------------------------------------------
+enum e_entity_types { TYPE_VARIABLE, TYPE_LINK, TYPE_CONTAINER, TYPE_STATE, TYPE_EVENT };
+
+class Type {
+  std::string id_;
+  std::string name_;
+  std::string color_;
+  e_entity_types kind_;
+  Type* father_;
+
+public:
+  std::map<std::string, Type*> children_;
+  std::map<std::string, Value*> values_; // valid for all types except variable and container
+
+  Type(std::string name, std::string alias, std::string color, e_entity_types kind, Type* father);
+  ~Type();
+
+  std::string getName() { return name_; }
+  const char* getCname() { return name_.c_str(); }
+  const char* getId() { return id_.c_str(); }
+  e_entity_types getKind() { return kind_; }
+  bool isColored() { return not color_.empty(); }
+
+  Type* byName(std::string name);
+
+  Type* getOrCreateContainerType(std::string name);
+  Type* getOrCreateEventType(std::string name);
+  Type* getOrCreateLinkType(std::string name, Type* source, Type* dest);
+  Type* getOrCreateStateType(std::string name);
+  Type* getOrCreateVariableType(std::string name, std::string color);
+
+  void logContainerTypeDefinition();
+  void logVariableTypeDefinition();
+  void logStateTypeDefinition();
+  void logLinkTypeDefinition(simgrid::instr::Type* source, simgrid::instr::Type* dest);
+  void logDefineEventType();
+
+  static Type* createRootType();
+  static Type* getRootType();
+};
+
+//--------------------------------------------------
+class Value {
+  std::string name_;
+  std::string id_;
+  std::string color_;
+  Type* father_;
+
+  explicit Value(std::string name, std::string color, Type* father);
+
+public:
+  ~Value();
+  static Value* byNameOrCreate(std::string name, std::string color, Type* father);
+  static Value* byName(std::string name, Type* father);
+  const char* getCname() { return name_.c_str(); }
+  const char* getId() { return id_.c_str(); }
+  bool isColored() { return not color_.empty(); }
+  void print();
+};
+
+//--------------------------------------------------
+enum e_container_types {
+  INSTR_HOST,
+  INSTR_LINK,
+  INSTR_ROUTER,
+  INSTR_AS,
+  INSTR_SMPI,
+  INSTR_MSG_VM,
+  INSTR_MSG_PROCESS,
+  INSTR_MSG_TASK
+};
+
+class Container {
+  e_container_types kind_; /* This container is of what kind */
+  int level_ = 0;          /* Level in the hierarchy, root level is 0 */
+  sg_netpoint_t netpoint_ = nullptr;
+
+public:
+  Container(std::string name, simgrid::instr::e_container_types kind, Container* father);
+  virtual ~Container();
+
+  std::string name_;       /* Unique name of this container */
+  std::string id_;         /* Unique id of this container */
+  Type* type_;             /* Type of this container */
+  Container* father_;
+  std::map<std::string, Container*> children_;
+  static Container* byNameOrNull(std::string name);
+  static Container* byName(std::string name);
+  void removeFromParent();
+  void logCreation();
+  void logDestruction();
+};
+
+//--------------------------------------------------
+class PajeEvent {
+protected:
+  Container* container;
+  Type* type;
+
+public:
+  double timestamp_;
+  e_event_type eventType_;
+  PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType)
+      : container(container), type(type), timestamp_(timestamp), eventType_(eventType){};
+  virtual void print() = 0;
+  virtual ~PajeEvent();
+  void insertIntoBuffer();
+};
+
+//--------------------------------------------------
+class SetVariableEvent : public PajeEvent {
+  double value;
+
+public:
+  SetVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
+};
+
+class AddVariableEvent : public PajeEvent {
+  double value;
+
+public:
+  AddVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
+};
+//--------------------------------------------------
+
+class SubVariableEvent : public PajeEvent {
+  double value;
+
+public:
+  SubVariableEvent(double timestamp, Container* container, Type* type, double value);
+  void print() override;
+};
+//--------------------------------------------------
+
+class SetStateEvent : public PajeEvent {
+  Value* value;
+  const char* filename;
+  int linenumber;
+
+public:
+  SetStateEvent(double timestamp, Container* container, Type* type, Value* val);
+  void print() override;
+};
+
+class PushStateEvent : public PajeEvent {
+  Value* value;
+  const char* filename;
+  int linenumber;
+  void* extra_;
+
+public:
+  PushStateEvent(double timestamp, Container* container, Type* type, Value* val);
+  PushStateEvent(double timestamp, Container* container, Type* type, Value* val, void* extra);
+  void print() override;
+};
+
+class PopStateEvent : public PajeEvent {
+public:
+  PopStateEvent(double timestamp, Container* container, Type* type);
+  void print() override;
+};
+
+class ResetStateEvent : public PajeEvent {
+public:
+  ResetStateEvent(double timestamp, Container* container, Type* type);
+  void print() override;
+};
+
+class StartLinkEvent : public PajeEvent {
+  Container* sourceContainer_;
+  std::string value_;
+  std::string key_;
+  int size_;
+
+public:
+  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, std::string value,
+                 std::string key);
+  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, std::string value,
+                 std::string key, int size);
+  void print() override;
+};
+
+class EndLinkEvent : public PajeEvent {
+  Container* destContainer;
+  std::string value;
+  std::string key;
+
+public:
+  EndLinkEvent(double timestamp, Container* container, Type* type, Container* destContainer, std::string value,
+               std::string key);
+  ~EndLinkEvent() = default;
+  void print() override;
+};
+
+class NewEvent : public PajeEvent {
+  Value* val;
+
+public:
+  NewEvent(double timestamp, Container* container, Type* type, Value* val);
+  void print() override;
+};
+}
+} // namespace simgrid::instr
+typedef simgrid::instr::Container* container_t;
+
+extern "C" {
+
+extern XBT_PRIVATE std::set<std::string> created_categories;
+extern XBT_PRIVATE std::set<std::string> declared_marks;
+extern XBT_PRIVATE std::set<std::string> user_host_variables;
+extern XBT_PRIVATE std::set<std::string> user_vm_variables;
+extern XBT_PRIVATE std::set<std::string> user_link_variables;
+extern XBT_PRIVATE double TRACE_last_timestamp_to_dump;
+
+/* instr_paje_header.c */
+XBT_PRIVATE void TRACE_header(bool basic, int size);
+
+/* from paje.c */
+XBT_PRIVATE void TRACE_paje_start();
+XBT_PRIVATE void TRACE_paje_end();
+
+/* from instr_config.c */
+XBT_PRIVATE bool TRACE_needs_platform();
+XBT_PRIVATE bool TRACE_is_enabled();
+XBT_PRIVATE bool TRACE_platform();
+XBT_PRIVATE bool TRACE_platform_topology();
+XBT_PRIVATE bool TRACE_is_configured();
+XBT_PRIVATE bool TRACE_categorized();
+XBT_PRIVATE bool TRACE_uncategorized();
+XBT_PRIVATE bool TRACE_msg_process_is_enabled();
+XBT_PRIVATE bool TRACE_msg_vm_is_enabled();
+XBT_PRIVATE bool TRACE_buffer();
+XBT_PRIVATE bool TRACE_disable_link();
+XBT_PRIVATE bool TRACE_disable_speed();
+XBT_PRIVATE bool TRACE_onelink_only();
+XBT_PRIVATE bool TRACE_disable_destroy();
+XBT_PRIVATE bool TRACE_basic();
+XBT_PRIVATE bool TRACE_display_sizes();
+XBT_PRIVATE char* TRACE_get_comment();
+XBT_PRIVATE char* TRACE_get_comment_file();
+XBT_PRIVATE int TRACE_precision();
+XBT_PRIVATE char* TRACE_get_filename();
+XBT_PRIVATE char* TRACE_get_viva_uncat_conf();
+XBT_PRIVATE char* TRACE_get_viva_cat_conf();
+XBT_PRIVATE void TRACE_generate_viva_uncat_conf();
+XBT_PRIVATE void TRACE_generate_viva_cat_conf();
+XBT_PRIVATE void instr_pause_tracing();
+XBT_PRIVATE void instr_resume_tracing();
+
+/* Public functions used in SMPI */
+XBT_PUBLIC(bool) TRACE_smpi_is_enabled();
+XBT_PUBLIC(bool) TRACE_smpi_is_grouped();
+XBT_PUBLIC(bool) TRACE_smpi_is_computing();
+XBT_PUBLIC(bool) TRACE_smpi_is_sleeping();
+XBT_PUBLIC(bool) TRACE_smpi_view_internals();
+
+/* from resource_utilization.c */
+XBT_PRIVATE void TRACE_surf_host_set_utilization(const char* resource, const char* category, double value, double now,
+                                                 double delta);
+XBT_PRIVATE void TRACE_surf_link_set_utilization(const char* resource, const char* category, double value, double now,
+                                                 double delta);
+XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc();
+
+/* instr_paje.c */
+extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
+extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
+XBT_PRIVATE long long int instr_new_paje_id();
+XBT_PUBLIC(container_t) PJ_container_get_root ();
+XBT_PUBLIC(void) PJ_container_set_root (container_t root);
+
+/* instr_config.c */
+XBT_PRIVATE void TRACE_TI_start();
+XBT_PRIVATE void TRACE_TI_end();
+
+XBT_PRIVATE void TRACE_paje_dump_buffer(bool force);
+XBT_PRIVATE void dump_comment_file(const char* filename);
+XBT_PRIVATE void dump_comment(const char* comment);
+
+enum e_caller_type {
+  TRACING_INIT,
+  TRACING_FINALIZE,
+  TRACING_COMM_SIZE,
+  TRACING_COMM_SPLIT,
+  TRACING_COMM_DUP,
+  TRACING_SEND,
+  TRACING_ISEND,
+  TRACING_SSEND,
+  TRACING_ISSEND,
+  TRACING_RECV,
+  TRACING_IRECV,
+  TRACING_SENDRECV,
+  TRACING_TEST,
+  TRACING_WAIT,
+  TRACING_WAITALL,
+  TRACING_WAITANY,
+  TRACING_BARRIER,
+  TRACING_BCAST,
+  TRACING_REDUCE,
+  TRACING_ALLREDUCE,
+  TRACING_ALLTOALL,
+  TRACING_ALLTOALLV,
+  TRACING_GATHER,
+  TRACING_GATHERV,
+  TRACING_SCATTER,
+  TRACING_SCATTERV,
+  TRACING_ALLGATHER,
+  TRACING_ALLGATHERV,
+  TRACING_REDUCE_SCATTER,
+  TRACING_COMPUTING,
+  TRACING_SLEEPING,
+  TRACING_SCAN,
+  TRACING_EXSCAN
+};
+
+struct s_instr_extra_data_t {
+  e_caller_type type;
+  int send_size;
+  int recv_size;
+  double comp_size;
+  double sleep_duration;
+  int src;
+  int dst;
+  int root;
+  const char* datatype1;
+  const char* datatype2;
+  int* sendcounts;
+  int* recvcounts;
+  int num_processes;
+};
+typedef s_instr_extra_data_t* instr_extra_data;
+
+/* Format of TRACING output.
+ *   - paje is the regular format, that we all know
+ *   - TI is a trick to reuse the tracing functions to generate a time independent trace during the execution. Such
+ *     trace can easily be replayed with smpi_replay afterward. This trick should be removed and replaced by some code
+ *     using the signal that we will create to cleanup the TRACING
+ */
+enum instr_fmt_type_t { instr_fmt_paje, instr_fmt_TI };
+extern instr_fmt_type_t instr_fmt_type;
+}
+
+#endif
index 6b7bfec..86d76d8 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. */
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include <string>
 #include <unordered_map>
 
@@ -14,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorize
 static std::unordered_map<std::string, std::string> platform_variables;
 
 //used by all methods
-static void __TRACE_surf_check_variable_set_to_zero(double now, const char *variable, const char *resource)
+static void __TRACE_surf_check_variable_set_to_zero(double now, const char* variable, std::string resource)
 {
   /* To trace resource utilization, we use pajeAddVariable and pajeSubVariable only.
    * The Paje simulator needs a pajeSetVariable in the first place so it knows the initial value of all variables for
@@ -23,12 +23,12 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, const char *vari
    */
 
   // create a key considering the resource and variable
-  std::string key = std::string(resource) + variable;
+  std::string key = resource + variable;
 
   // check if key exists: if it doesn't, set the variable to zero and mark this in the dict
   if (platform_variables.find(key) == platform_variables.end()) {
-    container_t container = PJ_container_get (resource);
-    simgrid::instr::Type* type = container->type_->getChild(variable);
+    container_t container      = simgrid::instr::Container::byName(resource);
+    simgrid::instr::Type* type = container->type_->byName(variable);
     new simgrid::instr::SetVariableEvent(now, container, type, 0);
     platform_variables[key] = std::string("");
   }
@@ -36,7 +36,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, const char *vari
 
 static void instr_event(double now, double delta, simgrid::instr::Type* variable, container_t resource, double value)
 {
-  __TRACE_surf_check_variable_set_to_zero(now, variable->name_, resource->name_);
+  __TRACE_surf_check_variable_set_to_zero(now, variable->getCname(), resource->name_);
   new simgrid::instr::AddVariableEvent(now, resource, variable, value);
   new simgrid::instr::SubVariableEvent(now + delta, resource, variable, value);
 }
@@ -45,7 +45,7 @@ static void instr_event(double now, double delta, simgrid::instr::Type* variable
 void TRACE_surf_link_set_utilization(const char *resource, const char *category, double value, double now, double delta)
 {
   //only trace link utilization if link is known by tracing mechanism
-  if (not PJ_container_get_or_null(resource))
+  if (not simgrid::instr::Container::byNameOrNull(resource))
     return;
   if (not value)
     return;
@@ -53,8 +53,8 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
   //trace uncategorized link utilization
   if (TRACE_uncategorized()){
     XBT_DEBUG("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value);
-    container_t container = PJ_container_get (resource);
-    simgrid::instr::Type* type = container->type_->getChild("bandwidth_used");
+    container_t container      = simgrid::instr::Container::byName(resource);
+    simgrid::instr::Type* type = container->type_->byName("bandwidth_used");
     instr_event (now, delta, type, container, value);
   }
 
@@ -66,8 +66,8 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
     char category_type[INSTR_DEFAULT_STR_SIZE];
     snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", category);
     XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
-    container_t container = PJ_container_get (resource);
-    simgrid::instr::Type* type = container->type_->getChild(category_type);
+    container_t container      = simgrid::instr::Container::byName(resource);
+    simgrid::instr::Type* type = container->type_->byName(category_type);
     instr_event (now, delta, type, container, value);
   }
 }
@@ -76,14 +76,14 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
 void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now, double delta)
 {
   //only trace host utilization if host is known by tracing mechanism
-  container_t container = PJ_container_get_or_null(resource);
+  container_t container = simgrid::instr::Container::byNameOrNull(resource);
   if (not container || not value)
     return;
 
   //trace uncategorized host utilization
   if (TRACE_uncategorized()){
     XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
-    simgrid::instr::Type* type = container->type_->getChild("power_used");
+    simgrid::instr::Type* type = container->type_->byName("power_used");
     instr_event (now, delta, type, container, value);
   }
 
@@ -95,7 +95,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category,
     char category_type[INSTR_DEFAULT_STR_SIZE];
     snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", category);
     XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
-    simgrid::instr::Type* type = container->type_->getChild(category_type);
+    simgrid::instr::Type* type = container->type_->byName(category_type);
     instr_event (now, delta, type, container, value);
   }
 }
similarity index 84%
rename from src/instr/instr_smpi.h
rename to src/instr/instr_smpi.hpp
index cd6faa5..8b08e92 100644 (file)
@@ -3,17 +3,14 @@
 /* This program 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 INSTR_SMPI_H_
-#define INSTR_SMPI_H_
-
-#ifdef __cplusplus
-#include <string>
-#endif
+#ifndef INSTR_SMPI_HPP
+#define INSTR_SMPI_HPP
 
 #include "smpi/smpi.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
+#include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
 XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
@@ -39,21 +36,20 @@ XBT_PRIVATE char* smpi_container(int rank, char* container, int n);
 
 XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype, int* known);
 
-typedef struct smpi_trace_call_location {
+class smpi_trace_call_location_t {
+public:
   const char* filename;
   int linenumber;
 
   const char* previous_filename;
   int previous_linenumber;
 
-#ifdef __cplusplus
-  std::string get_composed_key() {
-    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' + std::to_string(linenumber);
+  std::string get_composed_key()
+  {
+    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' +
+           std::to_string(linenumber);
   }
-#endif
-
-} smpi_trace_call_location_t;
-
-SG_END_DECL()
+};
+}
 
 #endif
index 33d31e7..c7517bf 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "simgrid/modelchecker.h"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/smx_network_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
index fb60e05..2eecc69 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "surf/surf.h"
 
-typedef enum { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE } e_smx_comm_type_t;
+enum e_smx_comm_type_t { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE };
 
 namespace simgrid {
 namespace kernel {
index aee76bc..95a4e38 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/s4u/Host.hpp"
 
 #include "src/kernel/activity/ExecImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
index 13e9870..bed10c2 100644 (file)
@@ -73,14 +73,14 @@ void MailboxImpl::remove(smx_activity_t activity)
       boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(activity);
 
   xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
-             (comm->mbox ? comm->mbox->name_ : "(null)"), this->name_);
+             (comm->mbox ? comm->mbox->getCname() : "(null)"), this->getCname());
   comm->mbox = nullptr;
   for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++)
     if (*it == comm) {
       this->comm_queue.erase(it);
       return;
     }
-  xbt_die("Comm %p not found in mailbox %s", comm.get(), this->name_);
+  xbt_die("Comm %p not found in mailbox %s", comm.get(), this->getCname());
 }
 }
 }
index 8c4541d..3ebc417 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMIX_MAILBOXIMPL_H
 
 #include <boost/circular_buffer.hpp>
+#include <xbt/string.hpp>
 
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
@@ -21,20 +22,20 @@ namespace activity {
 
 class MailboxImpl {
   explicit MailboxImpl(const char* name)
-      : piface_(this), name_(xbt_strdup(name)), comm_queue(MAX_MAILBOX_SIZE), done_comm_queue(MAX_MAILBOX_SIZE)
+      : piface_(this), name_(name), comm_queue(MAX_MAILBOX_SIZE), done_comm_queue(MAX_MAILBOX_SIZE)
   {
   }
 
 public:
-  ~MailboxImpl() { xbt_free(name_); }
-
+  const simgrid::xbt::string& getName() const { return name_; }
+  const char* getCname() const { return name_.c_str(); }
   static MailboxImpl* byNameOrNull(const char* name);
   static MailboxImpl* byNameOrCreate(const char* name);
   void setReceiver(s4u::ActorPtr actor);
   void push(activity::CommImplPtr comm);
   void remove(smx_activity_t activity);
   simgrid::s4u::Mailbox piface_; // Our interface
-  char* name_;
+  simgrid::xbt::string name_;
 
   simgrid::simix::ActorImplPtr permanent_receiver; // process which the mailbox is attached to
   boost::circular_buffer_space_optimized<smx_activity_t> comm_queue;
index 88cd15b..7b8f3d5 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/context/Context.hpp"
 
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
index 7e8ea86..65ac052 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "src/kernel/activity/SynchroIo.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 void simgrid::kernel::activity::IoImpl::suspend()
index bf07805..1a9dae5 100644 (file)
@@ -6,7 +6,7 @@
 #include "mc/mc.h"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 /**
  * @brief creates a new context for a user level process
index c184df4..c467f05 100644 (file)
 #include <xbt/functional.hpp>
 
 #include "simgrid/simix.h"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/internal_config.h"
-#include "src/simix/popping_private.h"
-#include "src/simix/smx_host_private.h"
-#include "src/simix/smx_io_private.h"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/popping_private.hpp"
+#include "src/simix/smx_host_private.hpp"
+#include "src/simix/smx_io_private.hpp"
+#include "src/simix/smx_network_private.hpp"
 #include "src/simix/smx_synchro_private.hpp"
 #include "surf/surf.h"
 #include "xbt/base.h"
@@ -148,8 +148,7 @@ XBT_PRIVATE ContextFactory* boost_factory();
 
 typedef simgrid::kernel::context::ContextFactory *smx_context_factory_t;
 
-SG_BEGIN_DECL()
-
+extern "C" {
 
 XBT_PRIVATE void SIMIX_context_mod_init();
 XBT_PRIVATE void SIMIX_context_mod_exit();
@@ -185,8 +184,7 @@ XBT_PRIVATE smx_context_t SIMIX_context_get_current();
 XBT_PUBLIC(int) SIMIX_process_get_maxpid();
 
 XBT_PRIVATE void SIMIX_post_create_environment();
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const char *name);
 
index 8e1eabd..3e18362 100644 (file)
@@ -14,9 +14,9 @@
 #include <xbt/log.h>
 #include <xbt/xbt_os_thread.h>
 
-#include "src/simix/smx_private.h"
 #include "src/internal_config.h"
 #include "src/kernel/context/ContextBoost.hpp"
+#include "src/simix/smx_private.hpp"
 
 #if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
 #include <sanitizer/asan_interface.h>
index 8e83fa5..1cd6340 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "xbt/parmap.hpp"
 
-#include "src/simix/smx_private.h"
 #include "mc/mc.h"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
@@ -267,7 +267,7 @@ RawContextFactory::RawContextFactory()
     xbt_os_thread_key_create(&raw_worker_id_key);
     // TODO, lazily init
     raw_parmap = nullptr;
-    raw_workers_context = xbt_new(RawContext*, nthreads);
+    raw_workers_context = new RawContext*[nthreads];
     raw_maestro_context = nullptr;
 #endif
     // TODO: choose dynamically when SIMIX_context_get_parallel_threshold() > 1
@@ -278,7 +278,7 @@ RawContextFactory::~RawContextFactory()
 {
 #if HAVE_THREAD_CONTEXTS
   delete raw_parmap;
-  xbt_free(raw_workers_context);
+  delete[] raw_workers_context;
 #endif
 }
 
@@ -408,7 +408,7 @@ void RawContext::suspend_parallel()
     XBT_DEBUG("No more processes to run");
     uintptr_t worker_id = (uintptr_t)
       xbt_os_thread_get_specific(raw_worker_id_key);
-    next_context = static_cast<RawContext*>(raw_workers_context[worker_id]);
+    next_context = raw_workers_context[worker_id];
     XBT_DEBUG("Restoring worker stack %zu (working threads = %zu)",
         worker_id, raw_threads_working);
   }
index 8e9ee72..ebcdfbe 100644 (file)
@@ -6,12 +6,12 @@
 #include <utility>
 #include <functional>
 
+#include "src/internal_config.h" /* loads context system definitions */
+#include "src/simix/smx_private.hpp"
+#include "src/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */
 #include "xbt/function_types.h"
-#include "src/simix/smx_private.h"
-#include "src/internal_config.h"           /* loads context system definitions */
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
-#include "src/xbt_modinter.h"       /* prototype of os thread module's init/exit in XBT */
 
 #include "src/kernel/context/ContextThread.hpp"
 
index 0ee4c14..26d629d 100644 (file)
@@ -10,7 +10,7 @@
 #include "mc/mc.h"
 #include "src/mc/mc_ignore.h"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "xbt/parmap.hpp"
 
 /** Many integers are needed to store a pointer
@@ -130,7 +130,7 @@ UContextFactory::UContextFactory() : ContextFactory("UContextFactory")
 #if HAVE_THREAD_CONTEXTS  /* To use parallel ucontexts a thread pool is needed */
     int nthreads = SIMIX_context_get_nthreads();
     sysv_parmap = nullptr;
-    sysv_workers_context = xbt_new(ParallelUContext*, nthreads);
+    sysv_workers_context = new ParallelUContext*[nthreads];
     sysv_maestro_context = nullptr;
     xbt_os_thread_key_create(&sysv_worker_id_key);
 #else
@@ -145,7 +145,7 @@ UContextFactory::~UContextFactory()
 {
 #if HAVE_THREAD_CONTEXTS
   delete sysv_parmap;
-  xbt_free(sysv_workers_context);
+  delete[] sysv_workers_context;
 #endif
 }
 
index 4252161..4eb9900 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,7 +8,7 @@
 
 #include <simgrid/kernel/future.hpp>
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid {
 namespace kernel {
index 2bd66e5..78e3d89 100644 (file)
@@ -22,7 +22,7 @@ ClusterZone::ClusterZone(NetZone* father, std::string name) : NetZoneImpl(father
 
 void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
   xbt_assert(not privateLinks_.empty(),
              "Cluster routing: no links attached to the source node - did you use host_link tag?");
 
@@ -77,22 +77,22 @@ void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges
              "Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
 
   /* create the router */
-  xbt_node_t routerNode = new_xbt_graph_node(graph, router_->cname(), nodes);
+  xbt_node_t routerNode = new_xbt_graph_node(graph, router_->getCname(), nodes);
 
   xbt_node_t backboneNode = nullptr;
   if (backbone_) {
-    backboneNode = new_xbt_graph_node(graph, backbone_->cname(), nodes);
+    backboneNode = new_xbt_graph_node(graph, backbone_->getCname(), nodes);
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
   }
 
   for (auto const& src : getVertices()) {
     if (not src->isRouter()) {
-      xbt_node_t previous = new_xbt_graph_node(graph, src->cname(), nodes);
+      xbt_node_t previous = new_xbt_graph_node(graph, src->getCname(), nodes);
 
       std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(src->id());
 
       if (info.first) { // link up
-        xbt_node_t current = new_xbt_graph_node(graph, info.first->cname(), nodes);
+        xbt_node_t current = new_xbt_graph_node(graph, info.first->getCname(), nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         if (backbone_) {
@@ -103,7 +103,7 @@ void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges
       }
 
       if (info.second) { // link down
-        xbt_node_t current = new_xbt_graph_node(graph, info.second->cname(), nodes);
+        xbt_node_t current = new_xbt_graph_node(graph, info.second->getCname(), nodes);
         new_xbt_graph_edge(graph, previous, current, edges);
 
         if (backbone_) {
index 2d978c9..0c5123d 100644 (file)
@@ -13,27 +13,18 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf
 
 /* Free functions */
 
-static void route_cache_elem_free(void* e)
+static void graph_node_data_free(void* n)
 {
-  route_cache_element_t elm = (route_cache_element_t)e;
-  if (elm) {
-    xbt_free(elm->pred_arr);
-    xbt_free(elm);
-  }
-}
-
-static void graph_node_map_elem_free(void* e)
-{
-  graph_node_map_element_t elm = (graph_node_map_element_t)e;
-  xbt_free(elm);
+  graph_node_data_t data = static_cast<graph_node_data_t>(n);
+  delete data;
 }
 
 static void graph_edge_data_free(void* e) // FIXME: useless code duplication
 {
-  sg_platf_route_cbarg_t e_route = (sg_platf_route_cbarg_t)e;
+  sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(e);
   if (e_route) {
     delete e_route->link_list;
-    xbt_free(e_route);
+    delete e_route;
   }
 }
 
@@ -50,8 +41,6 @@ void DijkstraZone::seal()
   /* Create the topology graph */
   if (not routeGraph_)
     routeGraph_ = xbt_graph_new_graph(1, nullptr);
-  if (not graphNodeMap_)
-    graphNodeMap_ = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
 
   /* Add the loopback if needed */
   if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
@@ -68,7 +57,7 @@ void DijkstraZone::seal()
       }
 
       if (not found) {
-        sg_platf_route_cbarg_t e_route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
+        sg_platf_route_cbarg_t e_route = new s_sg_platf_route_cbarg_t;
         e_route->link_list             = new std::vector<surf::LinkImpl*>();
         e_route->link_list->push_back(surf_network_model->loopback_);
         xbt_graph_new_edge(routeGraph_, node, node, e_route);
@@ -80,28 +69,27 @@ void DijkstraZone::seal()
   xbt_dynar_t nodes = xbt_graph_get_nodes(routeGraph_);
 
   xbt_dynar_foreach (nodes, cursor, node) {
-    graph_node_data_t data = (graph_node_data_t)xbt_graph_node_get_data(node);
+    graph_node_data_t data = static_cast<graph_node_data_t>(xbt_graph_node_get_data(node));
     data->graph_id         = cursor;
   }
 }
 
 xbt_node_t DijkstraZone::routeGraphNewNode(int id, int graph_id)
 {
-  graph_node_data_t data         = xbt_new0(struct graph_node_data, 1);
+  graph_node_data_t data = new s_graph_node_data_t;
   data->id       = id;
   data->graph_id = graph_id;
 
   xbt_node_t node                = xbt_graph_new_node(routeGraph_, data);
-  graph_node_map_element_t elm   = xbt_new0(struct graph_node_map_element, 1);
-  elm->node = node;
-  xbt_dict_set_ext(graphNodeMap_, (char*)(&id), sizeof(int), (xbt_dictelm_t)elm, nullptr);
+  graphNodeMap_.emplace(id, node);
 
   return node;
 }
 
-graph_node_map_element_t DijkstraZone::nodeMapSearch(int id)
+xbt_node_t DijkstraZone::nodeMapSearch(int id)
 {
-  return (graph_node_map_element_t)xbt_dict_get_or_null_ext(graphNodeMap_, (char*)(&id), sizeof(int));
+  auto ret = graphNodeMap_.find(id);
+  return ret == graphNodeMap_.end() ? nullptr : ret->second;
 }
 
 /* Parsing */
@@ -112,14 +100,14 @@ void DijkstraZone::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_rou
   xbt_node_t src = nullptr;
   xbt_node_t dst = nullptr;
 
-  graph_node_map_element_t src_elm = nodeMapSearch(src_id);
-  graph_node_map_element_t dst_elm = nodeMapSearch(dst_id);
+  xbt_node_t src_elm = nodeMapSearch(src_id);
+  xbt_node_t dst_elm = nodeMapSearch(dst_id);
 
   if (src_elm)
-    src = src_elm->node;
+    src = src_elm;
 
   if (dst_elm)
-    dst = dst_elm->node;
+    dst = dst_elm;
 
   /* add nodes if they don't exist in the graph */
   if (src_id == dst_id && src == nullptr && dst == nullptr) {
@@ -144,16 +132,14 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
   int src_id = src->id();
   int dst_id = dst->id();
 
-  int* pred_arr     = nullptr;
-  int size          = 0;
   xbt_dynar_t nodes = xbt_graph_get_nodes(routeGraph_);
 
   /* Use the graph_node id mapping set to quickly find the nodes */
-  graph_node_map_element_t src_elm = nodeMapSearch(src_id);
-  graph_node_map_element_t dst_elm = nodeMapSearch(dst_id);
+  xbt_node_t src_elm = nodeMapSearch(src_id);
+  xbt_node_t dst_elm = nodeMapSearch(dst_id);
 
-  int src_node_id = ((graph_node_data_t)xbt_graph_node_get_data(src_elm->node))->graph_id;
-  int dst_node_id = ((graph_node_data_t)xbt_graph_node_get_data(dst_elm->node))->graph_id;
+  int src_node_id = static_cast<graph_node_data_t>(xbt_graph_node_get_data(src_elm))->graph_id;
+  int dst_node_id = static_cast<graph_node_data_t>(xbt_graph_node_get_data(dst_elm))->graph_id;
 
   /* if the src and dst are the same */
   if (src_node_id == dst_node_id) {
@@ -163,9 +149,9 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     xbt_edge_t edge     = xbt_graph_get_edge(routeGraph_, node_s_v, node_e_v);
 
     if (edge == nullptr)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name().c_str(), dst->name().c_str());
+      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
 
-    sg_platf_route_cbarg_t e_route = (sg_platf_route_cbarg_t)xbt_graph_edge_get_data(edge);
+    sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
 
     for (auto const& link : *e_route->link_list) {
       route->link_list->insert(route->link_list->begin(), link);
@@ -174,19 +160,14 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     }
   }
 
-  route_cache_element_t elm = nullptr;
-  if (routeCache_) { /* cache mode  */
-    elm = (route_cache_element_t)xbt_dict_get_or_null_ext(routeCache_, (char*)(&src_id), sizeof(int));
-  }
-
-  if (elm) { /* cached mode and cache hit */
-    pred_arr = elm->pred_arr;
-  } else { /* not cached mode, or cache miss */
+  auto elm                   = routeCache_.emplace(src_id, std::vector<int>());
+  std::vector<int>& pred_arr = elm.first->second;
 
+  if (elm.second) { /* new element was inserted (not cached mode, or cache miss) */
     int nr_nodes      = xbt_dynar_length(nodes);
-    double* cost_arr  = xbt_new0(double, nr_nodes); /* link cost from src to other hosts */
-    pred_arr          = xbt_new0(int, nr_nodes);    /* predecessors in path from src */
-    xbt_heap_t pqueue = xbt_heap_new(nr_nodes, xbt_free_f);
+    std::vector<double> cost_arr(nr_nodes); /* link cost from src to other hosts */
+    pred_arr.resize(nr_nodes);              /* predecessors in path from src */
+    xbt_heap_t pqueue = xbt_heap_new(nr_nodes, nullptr);
 
     /* initialize */
     cost_arr[src_node_id] = 0.0;
@@ -199,8 +180,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
       pred_arr[i] = 0;
 
       /* initialize priority queue */
-      int* nodeid = xbt_new0(int, 1);
-      *nodeid     = i;
+      int* nodeid = new int(i);
       xbt_heap_push(pqueue, nodeid, cost_arr[i]);
     }
 
@@ -213,25 +193,22 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
 
       xbt_dynar_foreach (xbt_graph_node_get_outedges(v_node), cursor, edge) {
         xbt_node_t u_node                  = xbt_graph_edge_get_target(edge);
-        graph_node_data_t data             = (graph_node_data_t)xbt_graph_node_get_data(u_node);
+        graph_node_data_t data             = static_cast<graph_node_data_t>(xbt_graph_node_get_data(u_node));
         int u_id                           = data->graph_id;
-        sg_platf_route_cbarg_t tmp_e_route = (sg_platf_route_cbarg_t)xbt_graph_edge_get_data(edge);
+        sg_platf_route_cbarg_t tmp_e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
         int cost_v_u                       = tmp_e_route->link_list->size(); /* count of links, old model assume 1 */
 
         if (cost_v_u + cost_arr[*v_id] < cost_arr[u_id]) {
           pred_arr[u_id] = *v_id;
           cost_arr[u_id] = cost_v_u + cost_arr[*v_id];
-          int* nodeid    = xbt_new0(int, 1);
-          *nodeid        = u_id;
+          int* nodeid    = new int(u_id);
           xbt_heap_push(pqueue, nodeid, cost_arr[u_id]);
         }
       }
 
       /* free item popped from pqueue */
-      xbt_free(v_id);
+      delete v_id;
     }
-
-    xbt_free(cost_arr);
     xbt_heap_free(pqueue);
   }
 
@@ -246,9 +223,9 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     xbt_edge_t edge        = xbt_graph_get_edge(routeGraph_, node_pred_v, node_v);
 
     if (edge == nullptr)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name().c_str(), dst->name().c_str());
+      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
 
-    sg_platf_route_cbarg_t e_route = (sg_platf_route_cbarg_t)xbt_graph_edge_get_data(edge);
+    sg_platf_route_cbarg_t e_route = static_cast<sg_platf_route_cbarg_t>(xbt_graph_edge_get_data(edge));
 
     NetPoint* prev_gw_src          = gw_src;
     gw_src                         = e_route->gw_src;
@@ -257,8 +234,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     if (v == dst_node_id)
       first_gw = gw_dst;
 
-    if (hierarchy_ == RoutingMode::recursive && v != dst_node_id &&
-        strcmp(gw_dst->name().c_str(), prev_gw_src->name().c_str())) {
+    if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->getName() != prev_gw_src->getName()) {
       std::vector<surf::LinkImpl*> e_route_as_to_as;
 
       NetPoint* gw_dst_net_elm      = nullptr;
@@ -278,7 +254,6 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
       if (lat)
         *lat += static_cast<surf::LinkImpl*>(link)->latency();
     }
-    size++;
   }
 
   if (hierarchy_ == RoutingMode::recursive) {
@@ -286,47 +261,33 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cb
     route->gw_dst = first_gw;
   }
 
-  if (routeCache_ && elm == nullptr) {
-    /* add to predecessor list of the current src-host to cache */
-    elm           = xbt_new0(struct route_cache_element, 1);
-    elm->pred_arr = pred_arr;
-    elm->size     = size;
-    xbt_dict_set_ext(routeCache_, (char*)(&src_id), sizeof(int), (xbt_dictelm_t)elm, nullptr);
-  }
-
-  if (not routeCache_)
-    xbt_free(pred_arr);
+  if (not cached_)
+    routeCache_.clear();
 }
 
 DijkstraZone::~DijkstraZone()
 {
-  xbt_graph_free_graph(routeGraph_, &xbt_free_f, &graph_edge_data_free, &xbt_free_f);
-  xbt_dict_free(&graphNodeMap_);
-  xbt_dict_free(&routeCache_);
+  xbt_graph_free_graph(routeGraph_, &graph_node_data_free, &graph_edge_data_free, nullptr);
 }
 
 /* Creation routing model functions */
 
-DijkstraZone::DijkstraZone(NetZone* father, std::string name, bool cached) : RoutedZone(father, name)
+DijkstraZone::DijkstraZone(NetZone* father, std::string name, bool cached) : RoutedZone(father, name), cached_(cached)
 {
-  if (cached)
-    routeCache_ = xbt_dict_new_homogeneous(&route_cache_elem_free);
 }
 
 void DijkstraZone::addRoute(sg_platf_route_cbarg_t route)
 {
   NetPoint* src       = route->src;
   NetPoint* dst       = route->dst;
-  const char* srcName = src->name().c_str();
-  const char* dstName = dst->name().c_str();
+  const char* srcName = src->getCname();
+  const char* dstName = dst->getCname();
 
   addRouteCheckParams(route);
 
   /* Create the topology graph */
   if (not routeGraph_)
     routeGraph_ = xbt_graph_new_graph(1, nullptr);
-  if (not graphNodeMap_)
-    graphNodeMap_ = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
 
   /* we don't check whether the route already exist, because the algorithm may find another path through some other
    * nodes */
@@ -348,11 +309,11 @@ void DijkstraZone::addRoute(sg_platf_route_cbarg_t route)
       if (edge)
         THROWF(arg_error, 0, "Route from %s to %s already exists", dstName, srcName);
     } else {
-      XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, route->gw_dst->name().c_str(), srcName,
-                route->gw_src->name().c_str());
+      XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, route->gw_dst->getCname(), srcName,
+                route->gw_src->getCname());
       if (edge)
-        THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, route->gw_dst->name().c_str(), srcName,
-             route->gw_src->name().c_str());
+        THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, route->gw_dst->getCname(), srcName,
+               route->gw_src->getCname());
     }
 
     if (route->gw_dst && route->gw_src) {
index 29e8b90..f7fc503 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,23 +8,12 @@
 
 #include "src/kernel/routing/RoutedZone.hpp"
 
-typedef struct graph_node_data {
+struct s_graph_node_data_t {
   int id;
   int graph_id; /* used for caching internal graph id's */
-} s_graph_node_data_t;
+};
 typedef s_graph_node_data_t* graph_node_data_t;
 
-typedef struct graph_node_map_element {
-  xbt_node_t node;
-} s_graph_node_map_element_t;
-typedef s_graph_node_map_element_t* graph_node_map_element_t;
-
-typedef struct route_cache_element {
-  int* pred_arr;
-  int size;
-} s_route_cache_element_t;
-typedef s_route_cache_element_t* route_cache_element_t;
-
 namespace simgrid {
 namespace kernel {
 namespace routing {
@@ -48,7 +37,7 @@ public:
 
   ~DijkstraZone() override;
   xbt_node_t routeGraphNewNode(int id, int graph_id);
-  graph_node_map_element_t nodeMapSearch(int id);
+  xbt_node_t nodeMapSearch(int id);
   void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
   /* For each vertex (node) already in the graph,
    * make sure it also has a loopback link; this loopback
@@ -65,8 +54,9 @@ public:
   void addRoute(sg_platf_route_cbarg_t route) override;
 
   xbt_graph_t routeGraph_  = nullptr; /* xbt_graph */
-  xbt_dict_t graphNodeMap_ = nullptr; /* map */
-  xbt_dict_t routeCache_   = nullptr; /* use in cache mode */
+  std::map<int, xbt_node_t> graphNodeMap_;     /* map */
+  bool cached_;                                /* cache mode */
+  std::map<int, std::vector<int>> routeCache_; /* use in cache mode */
 };
 }
 }
index 790b3d1..fd60b9d 100644 (file)
@@ -25,8 +25,8 @@ DragonflyZone::~DragonflyZone()
 {
   if (this->routers_ != nullptr) {
     for (unsigned int i = 0; i < this->numGroups_ * this->numChassisPerGroup_ * this->numBladesPerChassis_; i++)
-      delete (routers_[i]);
-    xbt_free(routers_);
+      delete routers_[i];
+    delete[] routers_;
   }
 }
 
@@ -47,8 +47,7 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   std::vector<std::string> tmp;
   boost::split(parameters, cluster->topo_parameters, boost::is_any_of(";"));
 
-  // TODO : we have to check for zeros and negative numbers, or it might crash
-  if (parameters.size() != 4) {
+  if (parameters.size() != 4 || parameters.empty()) {
     surf_parse_error(
         "Dragonfly are defined by the number of groups, chassis per groups, blades per chassis, nodes per blade");
   }
@@ -135,20 +134,15 @@ DragonflyRouter::DragonflyRouter(int group, int chassis, int blade) : group_(gro
 
 DragonflyRouter::~DragonflyRouter()
 {
-  if (this->myNodes_ != nullptr)
-    xbt_free(myNodes_);
-  if (this->greenLinks_ != nullptr)
-    xbt_free(greenLinks_);
-  if (this->blackLinks_ != nullptr)
-    xbt_free(blackLinks_);
-  if (this->blueLinks_ != nullptr)
-    xbt_free(blueLinks_);
+  delete[] myNodes_;
+  delete[] greenLinks_;
+  delete[] blackLinks_;
+  delete blueLinks_;
 }
 
 void DragonflyZone::generateRouters()
 {
-  this->routers_ = static_cast<DragonflyRouter**>(xbt_malloc0(this->numGroups_ * this->numChassisPerGroup_ *
-                                                              this->numBladesPerChassis_ * sizeof(DragonflyRouter*)));
+  this->routers_ = new DragonflyRouter*[this->numGroups_ * this->numChassisPerGroup_ * this->numBladesPerChassis_];
 
   for (unsigned int i = 0; i < this->numGroups_; i++) {
     for (unsigned int j = 0; j < this->numChassisPerGroup_; j++) {
@@ -202,12 +196,9 @@ void DragonflyZone::generateLinks()
   // Links from routers to their local nodes.
   for (unsigned int i = 0; i < numRouters; i++) {
     // allocate structures
-    this->routers_[i]->myNodes_ = static_cast<surf::LinkImpl**>(
-        xbt_malloc0(numLinksperLink_ * this->numNodesPerBlade_ * sizeof(surf::LinkImpl*)));
-    this->routers_[i]->greenLinks_ =
-        static_cast<surf::LinkImpl**>(xbt_malloc0(this->numBladesPerChassis_ * sizeof(surf::LinkImpl*)));
-    this->routers_[i]->blackLinks_ =
-        static_cast<surf::LinkImpl**>(xbt_malloc0(this->numChassisPerGroup_ * sizeof(surf::LinkImpl*)));
+    this->routers_[i]->myNodes_    = new surf::LinkImpl*[numLinksperLink_ * this->numNodesPerBlade_];
+    this->routers_[i]->greenLinks_ = new surf::LinkImpl*[this->numBladesPerChassis_];
+    this->routers_[i]->blackLinks_ = new surf::LinkImpl*[this->numChassisPerGroup_];
 
     for (unsigned int j = 0; j < numLinksperLink_ * this->numNodesPerBlade_; j += numLinksperLink_) {
       std::string id = "local_link_from_router_"+ std::to_string(i) + "_to_node_" +
@@ -265,8 +256,8 @@ void DragonflyZone::generateLinks()
     for (unsigned int j = i + 1; j < this->numGroups_; j++) {
       unsigned int routernumi                = i * numBladesPerChassis_ * numChassisPerGroup_ + j;
       unsigned int routernumj                = j * numBladesPerChassis_ * numChassisPerGroup_ + i;
-      this->routers_[routernumi]->blueLinks_ = static_cast<surf::LinkImpl**>(xbt_malloc0(sizeof(surf::LinkImpl*)));
-      this->routers_[routernumj]->blueLinks_ = static_cast<surf::LinkImpl**>(xbt_malloc0(sizeof(surf::LinkImpl*)));
+      this->routers_[routernumi]->blueLinks_ = new surf::LinkImpl*;
+      this->routers_[routernumj]->blueLinks_ = new surf::LinkImpl*;
       std::string id = "blue_link_between_group_"+ std::to_string(i) +"_and_" + std::to_string(j) +"_routers_" +
           std::to_string(routernumi) + "_and_" + std::to_string(routernumj) + "_" + std::to_string(uniqueId);
       this->createLink(id, this->numLinksBlue_, &linkup, &linkdown);
@@ -286,8 +277,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
   if (dst->isRouter() || src->isRouter())
     return;
 
-  XBT_VERB("dragonfly getLocalRout from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
-           dst->id());
+  XBT_VERB("dragonfly getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
   if ((src->id() == dst->id()) && hasLoopback_) {
     std::pair<surf::LinkImpl*, surf::LinkImpl*> info = privateLinks_.at(nodePosition(src->id()));
index c6485c8..4eb5f29 100644 (file)
@@ -65,16 +65,16 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
   /* Let's find the source and the destination in our internal structure */
   auto searchedNode = this->computeNodes_.find(src->id());
   xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%u] in the fat tree",
-             src->name().c_str(), src->id());
+             src->getCname(), src->id());
   FatTreeNode* source = searchedNode->second;
 
   searchedNode = this->computeNodes_.find(dst->id());
   xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%u] in the fat tree",
-             dst->name().c_str(), dst->id());
+             dst->getCname(), dst->id());
   FatTreeNode* destination = searchedNode->second;
 
-  XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->name().c_str(), src->id(),
-           dst->name().c_str(), dst->id());
+  XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->getCname(), src->id(),
+           dst->getCname(), dst->id());
 
   /* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
   if (source->id == destination->id && this->hasLoopback_) {
index e680281..b434384 100644 (file)
@@ -37,10 +37,10 @@ FloydZone::~FloydZone()
   for (unsigned int i = 0; i < table_size; i++)
     for (unsigned int j = 0; j < table_size; j++)
       routing_route_free(TO_FLOYD_LINK(i, j));
-  xbt_free(linkTable_);
+  delete[] linkTable_;
 
-  xbt_free(predecessorTable_);
-  xbt_free(costTable_);
+  delete[] predecessorTable_;
+  delete[] costTable_;
 }
 
 void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
@@ -55,7 +55,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
   do {
     int pred = TO_FLOYD_PRED(src->id(), cur);
     if (pred == -1)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->name().c_str(), dst->name().c_str());
+      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
     route_stack.push_back(TO_FLOYD_LINK(pred, cur));
     cur = pred;
   } while (cur != src->id());
@@ -70,7 +70,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
     sg_platf_route_cbarg_t e_route = route_stack.back();
     route_stack.pop_back();
     if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
-        strcmp(prev_dst_gw->name().c_str(), e_route->gw_src->name().c_str())) {
+        prev_dst_gw->getCname() != e_route->gw_src->getCname()) {
       getGlobalRoute(prev_dst_gw, e_route->gw_src, route->link_list, lat);
     }
 
@@ -93,9 +93,9 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
 
   if (not linkTable_) {
     /* Create Cost, Predecessor and Link tables */
-    costTable_        = xbt_new0(double, table_size* table_size);                  /* link cost from host to host */
-    predecessorTable_ = xbt_new0(int, table_size* table_size);                     /* predecessor host numbers */
-    linkTable_        = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size); /* actual link between src and dst */
+    costTable_        = new double[table_size * table_size];                 /* link cost from host to host */
+    predecessorTable_ = new int[table_size * table_size];                    /* predecessor host numbers */
+    linkTable_        = new sg_platf_route_cbarg_t[table_size * table_size]; /* actual link between src and dst */
 
     /* Initialize costs and predecessors */
     for (unsigned int i = 0; i < table_size; i++)
@@ -110,12 +110,11 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
   if (route->gw_dst) // netzone route (to adapt the error message, if any)
     xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
                "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
-               route->src->name().c_str(), route->gw_src->name().c_str(), route->dst->name().c_str(),
-               route->gw_dst->name().c_str());
+               route->src->getCname(), route->gw_src->getCname(), route->dst->getCname(), route->gw_dst->getCname());
   else
     xbt_assert(nullptr == TO_FLOYD_LINK(route->src->id(), route->dst->id()),
                "The route between %s and %s already exists (Rq: routes are symmetrical by default).",
-               route->src->name().c_str(), route->dst->name().c_str());
+               route->src->getCname(), route->dst->getCname());
 
   TO_FLOYD_LINK(route->src->id(), route->dst->id()) = newExtendedRoute(hierarchy_, route, 1);
   TO_FLOYD_PRED(route->src->id(), route->dst->id()) = route->src->id();
@@ -127,12 +126,11 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
       xbt_assert(
           nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
           "The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
-          route->dst->name().c_str(), route->gw_dst->name().c_str(), route->src->name().c_str(),
-          route->gw_src->name().c_str());
+          route->dst->getCname(), route->gw_dst->getCname(), route->src->getCname(), route->gw_src->getCname());
     else
       xbt_assert(nullptr == TO_FLOYD_LINK(route->dst->id(), route->src->id()),
                  "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
-                 route->dst->name().c_str(), route->src->name().c_str());
+                 route->dst->getCname(), route->src->getCname());
 
     if (route->gw_dst && route->gw_src) {
       NetPoint* gw_tmp = route->gw_src;
@@ -141,10 +139,10 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route)
     }
 
     if (not route->gw_src || not route->gw_dst)
-      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name().c_str(), route->src->name().c_str());
+      XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->getCname(), route->src->getCname());
     else
-      XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name().c_str(), route->gw_src->name().c_str(),
-                route->src->name().c_str(), route->gw_dst->name().c_str());
+      XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", route->dst->getCname(), route->gw_src->getCname(),
+                route->src->getCname(), route->gw_dst->getCname());
 
     TO_FLOYD_LINK(route->dst->id(), route->src->id()) = newExtendedRoute(hierarchy_, route, 0);
     TO_FLOYD_PRED(route->dst->id(), route->src->id()) = route->dst->id();
@@ -160,9 +158,9 @@ void FloydZone::seal()
 
   if (not linkTable_) {
     /* Create Cost, Predecessor and Link tables */
-    costTable_        = xbt_new0(double, table_size* table_size);                  /* link cost from host to host */
-    predecessorTable_ = xbt_new0(int, table_size* table_size);                     /* predecessor host numbers */
-    linkTable_        = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size); /* actual link between src and dst */
+    costTable_        = new double[table_size * table_size];                 /* link cost from host to host */
+    predecessorTable_ = new int[table_size * table_size];                    /* predecessor host numbers */
+    linkTable_        = new sg_platf_route_cbarg_t[table_size * table_size]; /* actual link between src and dst */
 
     /* Initialize costs and predecessors */
     for (unsigned int i = 0; i < table_size; i++)
@@ -178,7 +176,7 @@ void FloydZone::seal()
     for (unsigned int i = 0; i < table_size; i++) {
       sg_platf_route_cbarg_t e_route = TO_FLOYD_LINK(i, i);
       if (not e_route) {
-        e_route            = xbt_new0(s_sg_platf_route_cbarg_t, 1);
+        e_route            = new s_sg_platf_route_cbarg_t;
         e_route->gw_src    = nullptr;
         e_route->gw_dst    = nullptr;
         e_route->link_list = new std::vector<surf::LinkImpl*>();
index 429f079..d6e4660 100644 (file)
@@ -24,14 +24,14 @@ void FullZone::seal()
 
   /* Create table if needed */
   if (not routingTable_)
-    routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);
+    routingTable_ = new sg_platf_route_cbarg_t[table_size * table_size]();
 
   /* Add the loopback if needed */
   if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
     for (unsigned int i = 0; i < table_size; i++) {
       sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(i, i);
       if (not e_route) {
-        e_route            = xbt_new0(s_sg_platf_route_cbarg_t, 1);
+        e_route            = new s_sg_platf_route_cbarg_t;
         e_route->gw_src    = nullptr;
         e_route->gw_dst    = nullptr;
         e_route->link_list = new std::vector<surf::LinkImpl*>();
@@ -51,16 +51,16 @@ FullZone::~FullZone()
       for (unsigned int j = 0; j < table_size; j++) {
         if (TO_ROUTE_FULL(i, j)) {
           delete TO_ROUTE_FULL(i, j)->link_list;
-          xbt_free(TO_ROUTE_FULL(i, j));
+          delete TO_ROUTE_FULL(i, j);
         }
       }
-    xbt_free(routingTable_);
+    delete[] routingTable_;
   }
 }
 
 void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
 {
-  XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
   unsigned int table_size        = getTableSize();
   sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
@@ -85,17 +85,17 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
   unsigned int table_size = getTableSize();
 
   if (not routingTable_)
-    routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);
+    routingTable_ = new sg_platf_route_cbarg_t[table_size * table_size]();
 
   /* Check that the route does not already exist */
   if (route->gw_dst) // inter-zone route (to adapt the error message, if any)
     xbt_assert(nullptr == TO_ROUTE_FULL(src->id(), dst->id()),
                "The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
-               src->cname(), route->gw_src->cname(), dst->cname(), route->gw_dst->cname());
+               src->getCname(), route->gw_src->getCname(), dst->getCname(), route->gw_dst->getCname());
   else
     xbt_assert(nullptr == TO_ROUTE_FULL(src->id(), dst->id()),
-               "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->cname(),
-               dst->cname());
+               "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->getCname(),
+               dst->getCname());
 
   /* Add the route to the base */
   TO_ROUTE_FULL(src->id(), dst->id()) = newExtendedRoute(hierarchy_, route, true);
@@ -110,11 +110,11 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route)
       xbt_assert(
           nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
           "The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
-          dst->cname(), route->gw_dst->cname(), src->cname(), route->gw_src->cname());
+          dst->getCname(), route->gw_dst->getCname(), src->getCname(), route->gw_src->getCname());
     else
       xbt_assert(nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
                  "The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
-                 dst->cname(), src->cname());
+                 dst->getCname(), src->getCname());
 
     TO_ROUTE_FULL(dst->id(), src->id()) = newExtendedRoute(hierarchy_, route, false);
   }
index fd54a2f..0a48274 100644 (file)
@@ -31,8 +31,8 @@ public:
 
   // Our rank in the vertices_ array of the netzone that contains us.
   unsigned int id() { return id_; }
-  std::string name() { return name_; }
-  const char* cname() { return name_.c_str(); }
+  const std::string& getName() const { return name_; }
+  const char* getCname() const { return name_.c_str(); }
   /** @brief the NetZone in which this NetPoint is included */
   NetZoneImpl* netzone() { return netzone_; }
 
index 994c6e1..a9e952e 100644 (file)
@@ -68,19 +68,21 @@ void NetZoneImpl::addBypassRoute(sg_platf_route_cbarg_t e_route)
 {
   /* Argument validity checks */
   if (e_route->gw_dst) {
-    XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", e_route->src->cname(), e_route->gw_src->cname(),
-              e_route->dst->cname(), e_route->gw_dst->cname());
+    XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", e_route->src->getCname(), e_route->gw_src->getCname(),
+              e_route->dst->getCname(), e_route->gw_dst->getCname());
     xbt_assert(not e_route->link_list->empty(), "Bypass route between %s@%s and %s@%s cannot be empty.",
-               e_route->src->cname(), e_route->gw_src->cname(), e_route->dst->cname(), e_route->gw_dst->cname());
+               e_route->src->getCname(), e_route->gw_src->getCname(), e_route->dst->getCname(),
+               e_route->gw_dst->getCname());
     xbt_assert(bypassRoutes_.find({e_route->src, e_route->dst}) == bypassRoutes_.end(),
-               "The bypass route between %s@%s and %s@%s already exists.", e_route->src->cname(),
-               e_route->gw_src->cname(), e_route->dst->cname(), e_route->gw_dst->cname());
+               "The bypass route between %s@%s and %s@%s already exists.", e_route->src->getCname(),
+               e_route->gw_src->getCname(), e_route->dst->getCname(), e_route->gw_dst->getCname());
   } else {
-    XBT_DEBUG("Load bypassRoute from %s to %s", e_route->src->cname(), e_route->dst->cname());
+    XBT_DEBUG("Load bypassRoute from %s to %s", e_route->src->getCname(), e_route->dst->getCname());
     xbt_assert(not e_route->link_list->empty(), "Bypass route between %s and %s cannot be empty.",
-               e_route->src->cname(), e_route->dst->cname());
+               e_route->src->getCname(), e_route->dst->getCname());
     xbt_assert(bypassRoutes_.find({e_route->src, e_route->dst}) == bypassRoutes_.end(),
-               "The bypass route between %s and %s already exists.", e_route->src->cname(), e_route->dst->cname());
+               "The bypass route between %s and %s already exists.", e_route->src->getCname(),
+               e_route->dst->getCname());
   }
 
   /* Build a copy that will be stored in the dict */
@@ -160,8 +162,8 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst,
   NetZoneImpl* src_as = src->netzone();
   NetZoneImpl* dst_as = dst->netzone();
 
-  xbt_assert(src_as, "Host %s must be in a netzone", src->cname());
-  xbt_assert(dst_as, "Host %s must be in a netzone", dst->cname());
+  xbt_assert(src_as, "Host %s must be in a netzone", src->getCname());
+  xbt_assert(dst_as, "Host %s must be in a netzone", dst->getCname());
 
   /* (2) find the path to the root routing component */
   std::vector<NetZoneImpl*> path_src;
@@ -218,7 +220,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
         if (latency)
           *latency += link->latency();
       }
-      XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->cname(), dst->cname(),
+      XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->getCname(), dst->getCname(),
                 bypassedRoute->links.size());
       return true;
     }
@@ -294,7 +296,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
   if (bypassedRoute) {
     XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links. We may have to complete it with recursive "
               "calls to getRoute",
-              src->cname(), dst->cname(), bypassedRoute->links.size());
+              src->getCname(), dst->getCname(), bypassedRoute->links.size());
     if (src != key.first)
       getGlobalRoute(src, bypassedRoute->gw_src, links, latency);
     for (surf::LinkImpl* const& link : bypassedRoute->links) {
@@ -306,7 +308,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
       getGlobalRoute(bypassedRoute->gw_dst, dst, links, latency);
     return true;
   }
-  XBT_DEBUG("No bypass route from '%s' to '%s'.", src->cname(), dst->cname());
+  XBT_DEBUG("No bypass route from '%s' to '%s'.", src->getCname(), dst->getCname());
   return false;
 }
 
@@ -316,7 +318,7 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
   s_sg_platf_route_cbarg_t route;
   memset(&route, 0, sizeof(route));
 
-  XBT_DEBUG("Resolve route from '%s' to '%s'", src->cname(), dst->cname());
+  XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname());
 
   /* Find how src and dst are interconnected */
   NetZoneImpl *common_ancestor;
@@ -343,7 +345,7 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
 
   common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
   xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "bad gateways for route from \"%s\" to \"%s\"",
-             src->cname(), dst->cname());
+             src->getCname(), dst->getCname());
 
   /* If source gateway is not our source, we have to recursively find our way up to this point */
   if (src != route.gw_src)
index 5c23716..4368705 100644 (file)
@@ -18,7 +18,7 @@ void routing_route_free(sg_platf_route_cbarg_t route)
 {
   if (route) {
     delete route->link_list;
-    xbt_free(route);
+    delete route;
   }
 }
 
@@ -78,12 +78,12 @@ void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       if (my_src == my_dst)
         continue;
 
-      sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
+      sg_platf_route_cbarg_t route = new s_sg_platf_route_cbarg_t;
       route->link_list             = new std::vector<surf::LinkImpl*>();
 
       getLocalRoute(my_src, my_dst, route, nullptr);
 
-      XBT_DEBUG("get_route_and_latency %s -> %s", my_src->cname(), my_dst->cname());
+      XBT_DEBUG("get_route_and_latency %s -> %s", my_src->getCname(), my_dst->getCname());
 
       xbt_node_t current;
       xbt_node_t previous;
@@ -91,15 +91,15 @@ void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       const char *current_name;
 
       if (route->gw_src) {
-        previous      = new_xbt_graph_node(graph, route->gw_src->cname(), nodes);
-        previous_name = route->gw_src->cname();
+        previous      = new_xbt_graph_node(graph, route->gw_src->getCname(), nodes);
+        previous_name = route->gw_src->getCname();
       } else {
-        previous      = new_xbt_graph_node(graph, my_src->cname(), nodes);
-        previous_name = my_src->cname();
+        previous      = new_xbt_graph_node(graph, my_src->getCname(), nodes);
+        previous_name = my_src->getCname();
       }
 
       for (auto const& link : *route->link_list) {
-        const char* link_name = link->cname();
+        const char* link_name = link->getCname();
         current               = new_xbt_graph_node(graph, link_name, nodes);
         current_name          = link_name;
         new_xbt_graph_edge(graph, previous, current, edges);
@@ -109,17 +109,17 @@ void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
       }
 
       if (route->gw_dst) {
-        current      = new_xbt_graph_node(graph, route->gw_dst->cname(), nodes);
-        current_name = route->gw_dst->cname();
+        current      = new_xbt_graph_node(graph, route->gw_dst->getCname(), nodes);
+        current_name = route->gw_dst->getCname();
       } else {
-        current      = new_xbt_graph_node(graph, my_dst->cname(), nodes);
-        current_name = my_dst->cname();
+        current      = new_xbt_graph_node(graph, my_dst->getCname(), nodes);
+        current_name = my_dst->getCname();
       }
       new_xbt_graph_edge(graph, previous, current, edges);
       XBT_DEBUG("  %s -> %s", previous_name, current_name);
 
       delete route->link_list;
-      xbt_free(route);
+      delete route;
     }
   }
 }
@@ -132,7 +132,7 @@ sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, sg_pl
 {
   sg_platf_route_cbarg_t result;
 
-  result            = xbt_new0(s_sg_platf_route_cbarg_t, 1);
+  result            = new s_sg_platf_route_cbarg_t;
   result->link_list = new std::vector<surf::LinkImpl*>();
 
   xbt_assert(hierarchy == RoutingMode::base || hierarchy == RoutingMode::recursive,
@@ -158,26 +158,26 @@ sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, sg_pl
 
 void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst)
 {
-  xbt_assert(src, "Cannot find a route from nullptr to %s", dst->cname());
-  xbt_assert(dst, "Cannot find a route from %s to nullptr", src->cname());
+  xbt_assert(src, "Cannot find a route from nullptr to %s", dst->getCname());
+  xbt_assert(dst, "Cannot find a route from %s to nullptr", src->getCname());
 
   NetZone* src_as = src->netzone();
   NetZone* dst_as = dst->netzone();
 
   xbt_assert(src_as == dst_as,
              "Internal error: %s@%s and %s@%s are not in the same netzone as expected. Please report that bug.",
-             src->cname(), src_as->getCname(), dst->cname(), dst_as->getCname());
+             src->getCname(), src_as->getCname(), dst->getCname(), dst_as->getCname());
 
   xbt_assert(this == dst_as, "Internal error: route destination %s@%s is not in netzone %s as expected (route source: "
                              "%s@%s). Please report that bug.",
-             src->cname(), dst->cname(), src_as->getCname(), dst_as->getCname(), getCname());
+             src->getCname(), dst->getCname(), src_as->getCname(), dst_as->getCname(), getCname());
 }
 void RoutedZone::addRouteCheckParams(sg_platf_route_cbarg_t route)
 {
   NetPoint* src       = route->src;
   NetPoint* dst       = route->dst;
-  const char* srcName = src->cname();
-  const char* dstName = dst->cname();
+  const char* srcName = src->getCname();
+  const char* dstName = dst->getCname();
 
   if (not route->gw_dst || not route->gw_src) {
     XBT_DEBUG("Load Route from \"%s\" to \"%s\"", srcName, dstName);
@@ -191,7 +191,8 @@ void RoutedZone::addRouteCheckParams(sg_platf_route_cbarg_t route)
                "When defining a route, dst cannot be a netzone such as '%s'. Did you meant to have an NetzoneRoute?",
                dstName);
   } else {
-    XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, route->gw_src->cname(), dstName, route->gw_dst->cname());
+    XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, route->gw_src->getCname(), dstName,
+              route->gw_dst->getCname());
     xbt_assert(src->isNetZone(), "When defining a NetzoneRoute, src must be a netzone but '%s' is not", srcName);
     xbt_assert(dst->isNetZone(), "When defining a NetzoneRoute, dst must be a netzone but '%s' is not", dstName);
 
@@ -200,14 +201,15 @@ void RoutedZone::addRouteCheckParams(sg_platf_route_cbarg_t route)
     xbt_assert(route->gw_dst->isHost() || route->gw_dst->isRouter(),
                "When defining a NetzoneRoute, gw_dst must be an host or a router but '%s' is not.", dstName);
 
-    xbt_assert(route->gw_src != route->gw_dst, "Cannot define an NetzoneRoute from '%s' to itself", route->gw_src->cname());
+    xbt_assert(route->gw_src != route->gw_dst, "Cannot define an NetzoneRoute from '%s' to itself",
+               route->gw_src->getCname());
 
-    xbt_assert(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, route->gw_src->cname(),
-               dstName, route->gw_dst->cname(), srcName);
-    xbt_assert(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, route->gw_src->cname(),
-               dstName, route->gw_dst->cname(), dstName);
+    xbt_assert(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, route->gw_src->getCname(),
+               dstName, route->gw_dst->getCname(), srcName);
+    xbt_assert(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, route->gw_src->getCname(),
+               dstName, route->gw_dst->getCname(), dstName);
     xbt_assert(not route->link_list->empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName,
-               route->gw_src->cname(), dstName, route->gw_dst->cname());
+               route->gw_src->getCname(), dstName, route->gw_dst->getCname());
   }
 
   onRouteCreation(route->symmetrical, route->src, route->dst, route->gw_src, route->gw_dst, route->link_list);
index 3904232..74e655b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -64,9 +64,9 @@ protected:
 }
 } // namespace
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE xbt_node_t new_xbt_graph_node(xbt_graph_t graph, const char* name, xbt_dict_t nodes);
 XBT_PRIVATE xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
-SG_END_DECL()
+}
 
 #endif /* SIMGRID_ROUTING_GENERIC_HPP_ */
index 074d473..4992637 100644 (file)
@@ -94,8 +94,7 @@ void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
 
-  XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
-           dst->id());
+  XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
   if (dst->isRouter() || src->isRouter())
     return;
index d1ea847..a6b4fc3 100644 (file)
@@ -27,7 +27,7 @@ Coords::Coords(NetPoint* netpoint, std::string coordStr)
 
   std::vector<std::string> string_values;
   boost::split(string_values, coordStr, boost::is_any_of(" "));
-  xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netpoint->cname());
+  xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netpoint->getCname());
 
   for (auto const& str : string_values)
     try {
@@ -38,7 +38,7 @@ Coords::Coords(NetPoint* netpoint, std::string coordStr)
   coords.shrink_to_fit();
 
   netpoint->extension_set<Coords>(this);
-  XBT_DEBUG("Coords of %s %p: %s", netpoint->cname(), netpoint, coordStr.c_str());
+  XBT_DEBUG("Coords of %s %p: %s", netpoint->getCname(), netpoint, coordStr.c_str());
 }
 }; // namespace vivaldi
 
@@ -54,7 +54,7 @@ static std::vector<double>* getCoordsFromNetpoint(NetPoint* np)
 {
   simgrid::kernel::routing::vivaldi::Coords* coords = np->extension<simgrid::kernel::routing::vivaldi::Coords>();
   xbt_assert(coords, "Please specify the Vivaldi coordinates of %s %s (%p)",
-             (np->isNetZone() ? "Netzone" : (np->isHost() ? "Host" : "Router")), np->cname(), np);
+             (np->isNetZone() ? "Netzone" : (np->isHost() ? "Host" : "Router")), np->getCname(), np);
   return &coords->coords;
 }
 
@@ -68,8 +68,8 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s
 
   new simgrid::kernel::routing::vivaldi::Coords(netpoint, coord);
 
-  std::string link_up   = "link_" + netpoint->name() + "_UP";
-  std::string link_down = "link_" + netpoint->name() + "_DOWN";
+  std::string link_up      = "link_" + netpoint->getName() + "_UP";
+  std::string link_down    = "link_" + netpoint->getName() + "_DOWN";
   surf::LinkImpl* linkUp   = surf_network_model->createLink(link_up, bw_out, 0, SURF_LINK_SHARED);
   surf::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, SURF_LINK_SHARED);
   privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
@@ -77,11 +77,11 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s
 
 void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
 
   if (src->isNetZone()) {
-    std::string srcName = "router_" + src->name();
-    std::string dstName = "router_" + dst->name();
+    std::string srcName = "router_" + src->getName();
+    std::string dstName = "router_" + dst->getName();
     route->gw_src       = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(srcName.c_str());
     route->gw_dst       = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(dstName.c_str());
   }
index fe55a37..bfa4f16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,14 +9,15 @@
 
 #include <dwarf.h>
 #include <elfutils/libdw.h>
+#include <libunwind.h>
 
-#include "src/mc/mc_private.h"
-#include "src/mc/LocationList.hpp"
 #include "src/mc/AddressSpace.hpp"
+#include "src/mc/DwarfExpression.hpp"
 #include "src/mc/Frame.hpp"
+#include "src/mc/LocationList.hpp"
 #include "src/mc/ObjectInformation.hpp"
-#include "src/mc/DwarfExpression.hpp"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 using simgrid::mc::remote;
 
index 1bf89d8..09160c8 100644 (file)
@@ -41,7 +41,8 @@ typedef std::vector<Dwarf_Op> DwarfExpression;
  *  the process memory, etc. All those informations are gathered in
  *  the evaluation context.
  */
-struct ExpressionContext {
+class ExpressionContext {
+public:
   ExpressionContext() :
     cursor(nullptr), frame_base(nullptr), address_space(nullptr),
     object_info(nullptr), process_index(simgrid::mc::ProcessIndexMissing) {}
index 8de1553..4c47db5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -26,9 +26,9 @@
 #include "src/mc/PageStore.hpp"
 #include "src/mc/Transition.hpp"
 #include "src/mc/checker/Checker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
index bb733e3..e7b7e90 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -43,7 +43,6 @@ class ModelChecker {
 public:
   std::shared_ptr<simgrid::mc::Snapshot> parent_snapshot_;
 
-public:
   ModelChecker(ModelChecker const&) = delete;
   ModelChecker& operator=(ModelChecker const&) = delete;
   explicit ModelChecker(std::unique_ptr<RemoteClient> process);
index 019e75b..a7e9bf5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@
 #include "src/mc/Type.hpp"
 #include "src/mc/Frame.hpp"
 
-#include "src/smpi/include/private.h"
+#include "src/smpi/include/private.hpp"
 
 namespace simgrid {
 namespace mc {
index b258b16..5f2d921 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "src/mc/PageStore.hpp"
 
-#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_mmu.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
index 80332ea..3d1d15e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,8 +15,8 @@
 
 #include "xbt/base.h"
 
-#include "src/mc/mc_mmu.h"
 #include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_mmu.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -75,14 +75,16 @@ namespace mc {
 class PageStore {
 public: // Types
   typedef std::uint64_t hash_type;
-private: // Types
+
+private:
+  // Types
   // We are using a cheap hash to index a page.
   // We should expect collision and we need to associate multiple page indices
   // to the same hash.
   typedef std::unordered_set<std::size_t> page_set_type;
   typedef std::unordered_map<hash_type, page_set_type> pages_map_type;
 
-private: // Fields:
+  // Fields:
   /** First page */
   void* memory_;
   /** Number of available pages in virtual memory */
@@ -96,18 +98,19 @@ private: // Fields:
   /** Index from page hash to page index */
   pages_map_type hash_index_;
 
-private: // Methods
+  // Methods
   void resize(std::size_t size);
   std::size_t alloc_page();
   void remove_page(std::size_t pageno);
 
-public: // Constructors
+public:
+  // Constructors
   PageStore(PageStore const&) = delete;
   PageStore& operator=(PageStore const&) = delete;
   explicit PageStore(std::size_t size);
   ~PageStore();
 
-public: // Methods
+  // Methods
 
   /** @brief Decrement the reference count for a given page
    *
@@ -141,7 +144,7 @@ public: // Methods
    */
   const void* get_page(std::size_t pageno) const;
 
-public: // Debug/test methods
+  // Debug/test methods
 
   /** @brief Get the number of references for a page */
   std::size_t get_ref(std::size_t pageno);
index c120607..445daed 100644 (file)
@@ -12,7 +12,7 @@
 #endif
 
 #include "mc/mc.h"
-#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_snapshot.hpp"
 
 #include "src/mc/ChunkedData.hpp"
 #include "src/mc/RegionSnapshot.hpp"
index 52deff2..07baf1d 100644 (file)
@@ -44,7 +44,7 @@ private:
   void* data_ = nullptr;
   std::size_t size_;
   Type type_ = Type::Malloc;
-private:
+
   Buffer(std::size_t size, Type type = Type::Malloc);
   Buffer(void* data, std::size_t size, Type type = Type::Malloc) :
     data_(data), size_(size), type_(type) {}
@@ -276,6 +276,6 @@ simgrid::mc::RegionSnapshot region(
 }
 }
 
-typedef class simgrid::mc::RegionSnapshot s_mc_mem_region_t;
+typedef simgrid::mc::RegionSnapshot s_mc_mem_region_t;
 typedef s_mc_mem_region_t* mc_mem_region_t;
 #endif
index ce79e7c..b88f98d 100644 (file)
@@ -16,9 +16,9 @@
 #include <simgrid/sg_config.h>
 
 #include "src/mc/Session.hpp"
-#include "src/mc/mc_state.h"
-#include "src/mc/mc_private.h"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_state.hpp"
 
 #include "src/smpi/include/private.hpp"
 
index 8bc9f04..9eab46b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@ private:
   std::unique_ptr<ModelChecker> modelChecker_;
   std::shared_ptr<simgrid::mc::Snapshot> initialSnapshot_;
 
-private:
   Session(pid_t pid, int socket);
 
   // No copy:
@@ -50,14 +49,13 @@ public:
   ~Session();
   void close();
 
-public:
   void initialize();
   void execute(Transition const& transition);
   void logState();
 
   void restoreInitialState();
 
-public: // static constructors
+  // static constructors
 
   /** Create a new session by forking
    *
index a85f282..cb22a57 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_VisitedState, mc, "Logging specific to state equality detection mechanisms");
index 7028f4d..ebc6dcb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include <memory>
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_state.hpp"
 
 namespace simgrid {
 namespace mc {
 
-struct XBT_PRIVATE VisitedState {
+class XBT_PRIVATE VisitedState {
+public:
   std::shared_ptr<simgrid::mc::Snapshot> system_state = nullptr;
   std::size_t heap_bytes_used = 0;
   int actors_count            = 0;
index ce27ab2..4de42ae 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,9 +11,9 @@
 #include <memory>
 #include <string>
 
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_record.h"
 #include "src/mc/Session.hpp"
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_record.hpp"
 
 namespace simgrid {
 namespace mc {
index c4dd392..7fb06e5 100644 (file)
 #include "src/mc/Transition.hpp"
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #include "src/mc/remote/Client.hpp"
 
 #include "smpi_request.hpp"
@@ -236,7 +236,9 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim
     simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
 
     char* remote_name;
-    mc_model_checker->process().read(&remote_name, remote(comm->mbox ? &comm->mbox->name_ : &comm->mbox_cpy->name_));
+    mc_model_checker->process().read(
+        &remote_name, remote(comm->mbox ? &simgrid::xbt::string::to_string_data(comm->mbox->name_).data
+                                        : &simgrid::xbt::string::to_string_data(comm->mbox_cpy->name_).data));
     pattern->rdv = mc_model_checker->process().read_string(remote_name);
     pattern->dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_proc))->pid;
     pattern->dst_host = MC_smx_actor_get_host_name(issuer);
index 42ce4dc..6eef330 100644 (file)
 #include "src/mc/Session.hpp"
 #include "src/mc/Transition.hpp"
 #include "src/mc/checker/LivenessChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/remote/Client.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms for liveness properties verification");
index 16bfff7..1f9be7f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include <memory>
 #include <vector>
 
+#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_state.hpp"
 #include <simgrid_config.h>
-#include <xbt/base.h>
 #include <xbt/automaton.h>
-#include "src/mc/mc_state.h"
-#include "src/mc/checker/Checker.hpp"
-
-SG_BEGIN_DECL()
-
-SG_END_DECL()
+#include <xbt/base.h>
 
 namespace simgrid {
 namespace mc {
 
-struct XBT_PRIVATE Pair {
+class XBT_PRIVATE Pair {
+public:
   int num = 0;
   bool search_cycle = false;
   std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
@@ -44,7 +41,8 @@ struct XBT_PRIVATE Pair {
   Pair& operator=(Pair const&) = delete;
 };
 
-struct XBT_PRIVATE VisitedPair {
+class XBT_PRIVATE VisitedPair {
+public:
   int num;
   int other_num = 0; /* Dot output for */
   std::shared_ptr<simgrid::mc::State> graph_state = nullptr; /* System state included */
@@ -79,7 +77,7 @@ private:
   void purgeVisitedPairs();
   void backtrack();
   std::shared_ptr<Pair> newPair(Pair* pair, xbt_automaton_state_t state, std::shared_ptr<const std::vector<int>> propositions);
-private:
+
   // A stack of (application_state, automaton_state) pairs for DFS exploration:
   std::list<std::shared_ptr<Pair>> explorationStack_;
   std::list<std::shared_ptr<VisitedPair>> acceptancePairs_;
index e360a1e..0003a8f 100644 (file)
 #include "src/mc/Transition.hpp"
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/SafetyChecker.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
index ffc27f1..0a45e48 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2016. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,7 +15,7 @@
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_safety.h"
+#include "src/mc/mc_safety.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -33,7 +33,7 @@ private:
   void checkNonTermination(simgrid::mc::State* current_state);
   void backtrack();
   void restoreState();
-private:
+
   /** Stack representing the position in the exploration graph */
   std::list<std::unique_ptr<simgrid::mc::State>> stack_;
   simgrid::mc::VisitedStates visitedStates_;
index 1b57a3f..45f1201 100644 (file)
@@ -23,9 +23,9 @@
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_base.h"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_exit.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_safety.h"
+#include "src/mc/mc_exit.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_safety.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc");
index 03f96ae..1093b18 100644 (file)
 #include "src/xbt/mmalloc/mmprivate.h"
 
 #if HAVE_SMPI
-#include "src/smpi/include/private.h"
 #include "src/smpi/include/private.hpp"
 #endif
 
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_dwarf.hpp"
 #include "src/mc/Frame.hpp"
 #include "src/mc/ObjectInformation.hpp"
+#include "src/mc/Type.hpp"
 #include "src/mc/Variable.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
 #include "src/mc/mc_dwarf.hpp"
-#include "src/mc/Type.hpp"
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, xbt, "Logging specific to mc_compare in mc");
 
@@ -131,8 +128,8 @@ template <class X, class Y> class hash<std::pair<X, Y>> {
 public:
   std::size_t operator()(std::pair<X,Y>const& x) const
   {
-    struct hash<X> h1;
-    struct hash<X> h2;
+    hash<X> h1;
+    hash<X> h2;
     return h1(x.first) ^ h2(x.second);
   }
 };
@@ -982,7 +979,8 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
   const malloc_info* heapinfos1 = snapshot1->read(remote((const malloc_info**)heapinfo_address), process_index);
   const malloc_info* heapinfos2 = snapshot2->read(remote((const malloc_info**)heapinfo_address), process_index);
 
-  malloc_info heapinfo_temp1, heapinfo_temp2;
+  malloc_info heapinfo_temp1;
+  malloc_info heapinfo_temp2;
 
   simgrid::mc::HeapLocationPairs current;
   if (previous == nullptr) {
@@ -1472,7 +1470,8 @@ static int compare_local_variables(simgrid::mc::StateComparator& state,
   }
 
     unsigned int cursor = 0;
-    local_variable_t current_var1, current_var2;
+    local_variable_t current_var1;
+    local_variable_t current_var2;
     while (cursor < stack1->local_variables.size()) {
       current_var1 = &stack1->local_variables[cursor];
       current_var2 = &stack1->local_variables[cursor];
index f2b9548..dbafa01 100644 (file)
@@ -8,7 +8,7 @@
 #include "mc/mc.h"
 #include "src/mc/mc_base.h"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
index 44d5091..abd51e2 100644 (file)
 #endif
 
 #include "src/internal_config.h"
-#include "src/mc/mc_private.h"
-#include "src/smpi/include/private.h"
+#include "src/mc/mc_private.hpp"
+#include "src/smpi/include/private.hpp"
 #include "xbt/mmalloc.h"
 #include "xbt/module.h"
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #include <libunwind.h>
 #include <libelf.h>
 
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include <mc/mc.h>
 
 #include "src/mc/mc_hash.hpp"
-#include "src/mc/mc_mmu.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 #include "src/mc/RegionSnapshot.hpp"
@@ -60,11 +60,6 @@ namespace mc {
 static void restore(mc_mem_region_t region)
 {
   switch(region->storage_type()) {
-  case simgrid::mc::StorageType::NoData:
-  default:
-    xbt_die("Storage type not supported");
-    break;
-
   case simgrid::mc::StorageType::Flat:
     mc_model_checker->process().write_bytes(region->flat_data().get(),
       region->size(), region->permanent_address());
@@ -78,6 +73,10 @@ static void restore(mc_mem_region_t region)
     for (auto& p : region->privatized_data())
       restore(&p);
     break;
+
+  default: // includes StorageType::NoData
+    xbt_die("Storage type not supported");
+    break;
   }
 }
 
@@ -278,10 +277,8 @@ static bool valid_variable(simgrid::mc::Variable* var,
     return true;
 }
 
-static void fill_local_variables_values(mc_stack_frame_t stack_frame,
-                                           simgrid::mc::Frame* scope,
-                                           int process_index,
-                                           std::vector<s_local_variable>& result)
+static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::mc::Frame* scope, int process_index,
+                                        std::vector<s_local_variable_t>& result)
 {
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
 
@@ -335,10 +332,10 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame,
       stack_frame, &nested_scope, process_index, result);
 }
 
-static std::vector<s_local_variable> get_local_variables_values(
-  std::vector<s_mc_stack_frame_t>& stack_frames, int process_index)
+static std::vector<s_local_variable_t> get_local_variables_values(std::vector<s_mc_stack_frame_t>& stack_frames,
+                                                                  int process_index)
 {
-  std::vector<s_local_variable> variables;
+  std::vector<s_local_variable_t> variables;
   for (s_mc_stack_frame_t& stack_frame : stack_frames)
     fill_local_variables_values(&stack_frame, stack_frame.frame, process_index, variables);
   return variables;
index fee19b6..aab4ac6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,8 +10,8 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/mc_ignore.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
index cb7029c..48608a8 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/mc_xbt.hpp"
 
 using simgrid::mc::remote;
index 0d99b67..cc189d7 100644 (file)
@@ -11,7 +11,7 @@
 #include "smpi/smpi.h"
 #include "xbt/dynar.h"
 
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_state.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -23,7 +23,7 @@ struct PatternCommunicationList {
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /**
  *  Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
@@ -35,15 +35,15 @@ extern XBT_PRIVATE xbt_dynar_t initial_communications_pattern;
  */
 extern XBT_PRIVATE xbt_dynar_t incomplete_communications_pattern;
 
-typedef enum {
+enum e_mc_call_type_t {
   MC_CALL_TYPE_NONE,
   MC_CALL_TYPE_SEND,
   MC_CALL_TYPE_RECV,
   MC_CALL_TYPE_WAIT,
   MC_CALL_TYPE_WAITANY,
-} e_mc_call_type_t;
+};
 
-typedef enum {
+enum e_mc_comm_pattern_difference_t {
   NONE_DIFF,
   TYPE_DIFF,
   RDV_DIFF,
@@ -52,7 +52,7 @@ typedef enum {
   DST_PROC_DIFF,
   DATA_SIZE_DIFF,
   DATA_DIFF,
-} e_mc_comm_pattern_difference_t;
+};
 
 static inline e_mc_call_type_t MC_get_call_type(smx_simcall_t req)
 {
@@ -77,7 +77,6 @@ XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);
 
 XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
 XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);
-
-SG_END_DECL()
+}
 
 #endif
index e61201c..566544c 100644 (file)
 #include <simgrid/sg_config.h>
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_safety.h"
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_safety.hpp"
 #endif
 
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc, "Configuration of the Model Checker");
 
index c7a785b..84df334 100644 (file)
@@ -25,8 +25,8 @@
 #include "xbt/sysdep.h"
 #include <simgrid_config.h>
 
-#include "src/mc/mc_private.h"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Variable.hpp"
@@ -532,13 +532,10 @@ static void MC_dwarf_fill_member_location(
                 (uint64_t) type->id, type->name.c_str());
       break;
     }
-  case simgrid::dwarf::FormClass::LocListPtr:
-    // Reference to a location list:
-    // TODO
-  case simgrid::dwarf::FormClass::Reference:
-    // It's supposed to be possible in DWARF2 but I couldn't find its semantic
-    // in the spec.
+
   default:
+    // includes FormClass::LocListPtr (reference to a location list: TODO) and FormClass::Reference (it's supposed to be
+    // possible in DWARF2 but I couldn't find its semantic in the spec)
     xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
   }
 
@@ -800,18 +797,16 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     int form = dwarf_whatform(&attr);
     simgrid::dwarf::FormClass form_class = simgrid::dwarf::classify_form(form);
     switch (form_class) {
-    case simgrid::dwarf::FormClass::Constant:
-      {
+      case simgrid::dwarf::FormClass::Constant: {
         Dwarf_Word value;
         variable->start_scope =
             dwarf_formudata(&attr, &value) == 0 ? (size_t) value : 0;
         break;
       }
 
-    case simgrid::dwarf::FormClass::RangeListPtr:     // TODO
-    default:
-      xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form,
-              (unsigned)form_class, name == nullptr ? "?" : name);
+      default: // includes FormClass::RangeListPtr (TODO)
+        xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form,
+                (unsigned)form_class, name == nullptr ? "?" : name);
     }
   }
 
similarity index 71%
rename from src/mc/mc_exit.h
rename to src/mc/mc_exit.hpp
index 83fe9dc..cede412 100644 (file)
@@ -7,21 +7,21 @@
 #define SIMGRID_MC_EXIT_HPP
 #include "xbt/base.h"
 
-#define SIMGRID_MC_EXIT_SUCCESS  0
-#define SIMGRID_MC_EXIT_SAFETY   1
+#define SIMGRID_MC_EXIT_SUCCESS 0
+#define SIMGRID_MC_EXIT_SAFETY 1
 #define SIMGRID_MC_EXIT_LIVENESS 2
 #define SIMGRID_MC_EXIT_DEADLOCK 3
 #define SIMGRID_MC_EXIT_NON_TERMINATION 4
 #define SIMGRID_MC_EXIT_NON_DETERMINISM 5
 #define SIMGRID_MC_EXIT_PROGRAM_CRASH 6
 
-#define SIMGRID_MC_EXIT_ERROR         63
+#define SIMGRID_MC_EXIT_ERROR 63
 
 namespace simgrid {
 namespace mc {
-XBT_PUBLIC_CLASS DeadlockError {};
-XBT_PUBLIC_CLASS TerminationError {};
-XBT_PUBLIC_CLASS LivenessError {};
+XBT_PUBLIC_CLASS DeadlockError{};
+XBT_PUBLIC_CLASS TerminationError{};
+XBT_PUBLIC_CLASS LivenessError{};
 }
 }
 
index 0204bbd..0e86c47 100644 (file)
 #if SIMGRID_HAVE_MC
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_safety.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_safety.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 #include <libunwind.h>
 #endif
 
 #include "src/mc/Transition.hpp"
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
index d537cfe..9a77423 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include "xbt/log.h"
 
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
 #include "mc/datatypes.h"
 #include "src/mc/mc_hash.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 #include <mc/mc.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash");
index ff4c77f..c2c67e7 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 "src/mc/mc_private.h"
 #include "src/mc/Type.hpp"
 #include "src/mc/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
 
 namespace simgrid {
 namespace dwarf {
index d0bb0a6..28ff84b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,7 +10,7 @@
 #include "xbt/log.h"
 
 #include "mc/mc.h"
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include "src/xbt/mmalloc/mmprivate.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory, mc,
similarity index 83%
rename from src/mc/mc_mmu.h
rename to src/mc/mc_mmu.hpp
index c7d5b97..b220822 100644 (file)
@@ -3,10 +3,12 @@
 /* This program 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 SIMGRID_MC_MMU_H
-#define SIMGRID_MC_MMU_H
+#ifndef SIMGRID_MC_MMU_HPP
+#define SIMGRID_MC_MMU_HPP
 
 #include "xbt/misc.h" // xbt_pagesize...
+#include <cstdint>
+#include <utility>
 
 namespace simgrid {
 namespace mc {
@@ -26,24 +28,21 @@ static int chunkSize()
 static XBT_ALWAYS_INLINE std::size_t chunkCount(std::size_t size)
 {
   size_t page_count = size >> xbt_pagebits;
-  if (size & (xbt_pagesize-1))
-    page_count ++;
+  if (size & (xbt_pagesize - 1))
+    page_count++;
   return page_count;
 }
 
 /** @brief Split into chunk number and remaining offset */
 static XBT_ALWAYS_INLINE std::pair<std::size_t, std::uintptr_t> split(std::uintptr_t offset)
 {
-  return {
-    offset >> xbt_pagebits,
-    offset & (xbt_pagesize-1)
-  };
+  return {offset >> xbt_pagebits, offset & (xbt_pagesize - 1)};
 }
 
 /** Merge chunk number and remaining offset info a global offset */
 static XBT_ALWAYS_INLINE std::uintptr_t join(std::size_t page, std::uintptr_t offset)
 {
-  return ((std::uintptr_t) page << xbt_pagebits) + offset;
+  return ((std::uintptr_t)page << xbt_pagebits) + offset;
 }
 
 static XBT_ALWAYS_INLINE std::uintptr_t join(std::pair<std::size_t, std::uintptr_t> value)
@@ -55,7 +54,6 @@ static XBT_ALWAYS_INLINE bool sameChunk(std::uintptr_t a, std::uintptr_t b)
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
-
 }
 }
 }
index 5c6f2bf..dacbbb6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,9 +10,9 @@
 #include <unistd.h> // pread, pwrite
 
 #include "src/mc/PageStore.hpp"
-#include "src/mc/mc_mmu.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 #include <xbt/mmalloc.h>
 #include "src/mc/ChunkedData.hpp"
similarity index 75%
rename from src/mc/mc_private.h
rename to src/mc/mc_private.hpp
index 0bdeb53..f51b0e9 100644 (file)
@@ -3,40 +3,34 @@
 /* This program 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 SIMGRID_MC_PRIVATE_H
-#define SIMGRID_MC_PRIVATE_H
+#ifndef SIMGRID_MC_PRIVATE_HPP
+#define SIMGRID_MC_PRIVATE_HPP
 
 #include "mc/mc.h"
 #include "xbt/automaton.h"
 
-#ifdef __cplusplus
 #include "src/mc/mc_forward.hpp"
 #include "src/xbt/memory_map.hpp"
-#endif
 
-#ifdef __cplusplus
 namespace simgrid {
 namespace mc {
 
 struct DerefAndCompareByActorsCountAndUsedHeap {
-  template<class X, class Y>
-  bool operator()(X const& a, Y const& b)
+  template <class X, class Y> bool operator()(X const& a, Y const& b)
   {
     return std::make_pair(a->actors_count, a->heap_bytes_used) < std::make_pair(b->actors_count, b->heap_bytes_used);
   }
 };
-
 }
 }
-#endif
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MC Global **********************************/
 
 XBT_PRIVATE void MC_init_dot_output();
 
-XBT_PRIVATE extern FILE *dot_output;
+XBT_PRIVATE extern FILEdot_output;
 
 XBT_PRIVATE void MC_show_deadlock(void);
 
@@ -46,26 +40,20 @@ XBT_PRIVATE void MC_show_deadlock(void);
 #define MC_VERBOSE 1
 
 /********************************** Miscellaneous **********************************/
-
-SG_END_DECL()
-
-#ifdef __cplusplus
+}
 
 namespace simgrid {
 namespace mc {
 
-XBT_PRIVATE void find_object_address(
-  std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
+XBT_PRIVATE void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps,
+                                     simgrid::mc::ObjectInformation* result);
 
 XBT_PRIVATE
 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
 
 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
 extern XBT_PRIVATE xbt_automaton_t property_automaton;
-
 }
 }
 
 #endif
-
-#endif
index a8dfdb1..5939b84 100644 (file)
 #include "simgrid/simix.h"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/mc/mc_record.h"
+#include "src/simix/ActorImpl.hpp"
+#include "src/simix/smx_private.hpp"
 
 #include "src/mc/mc_base.h"
 #include "src/mc/Transition.hpp"
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_state.h"
-#include "src/mc/mc_smx.h"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc,
similarity index 93%
rename from src/mc/mc_record.h
rename to src/mc/mc_record.hpp
index 56a3410..af99482 100644 (file)
@@ -3,7 +3,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. */
 
-/** \file mc_record.h
+/** \file mc_record.hpp
  *
  *  This file contains the MC replay/record functionnality.
  *  A MC path may be recorded by using ``-cfg=model-check/record:1`'`.
@@ -14,8 +14,8 @@
  *  passed to the application (without the MC specific arguments).
  */
 
-#ifndef SIMGRID_MC_RECORD_H
-#define SIMGRID_MC_RECORD_H
+#ifndef SIMGRID_MC_RECORD_HPP
+#define SIMGRID_MC_RECORD_HPP
 
 #include "src/mc/Transition.hpp"
 #include "xbt/base.h"
@@ -35,12 +35,9 @@ XBT_PRIVATE void dumpRecordPath();
 
 XBT_PRIVATE void replay(RecordTrace const& trace);
 XBT_PRIVATE void replay(const char* trace);
-
 }
 }
 
-SG_BEGIN_DECL()
-
 /** Whether the MC record mode is enabled
  *
  *  The behaviour is not changed. The only real difference is that
@@ -50,6 +47,4 @@ SG_BEGIN_DECL()
 
 // **** Data conversion
 
-SG_END_DECL()
-
 #endif
index 59ccaa9..e4fbdf6 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "src/include/mc/mc.h"
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
 #include "src/mc/mc_xbt.hpp"
 
 using simgrid::mc::remote;
similarity index 87%
rename from src/mc/mc_request.h
rename to src/mc/mc_request.hpp
index f7085c6..6036769 100644 (file)
@@ -3,10 +3,10 @@
 /* This program 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 SIMGRID_MC_REQUEST_H
-#define SIMGRID_MC_REQUEST_H
+#ifndef SIMGRID_MC_REQUEST_HPP
+#define SIMGRID_MC_REQUEST_HPP
 
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -24,7 +24,6 @@ XBT_PRIVATE std::string request_to_string(smx_simcall_t req, int value, simgrid:
 XBT_PRIVATE bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx);
 
 XBT_PRIVATE std::string request_get_dot_output(smx_simcall_t req, int value);
-
 }
 }
 
similarity index 87%
rename from src/mc/mc_safety.h
rename to src/mc/mc_safety.hpp
index 2c31b5d..bf1853d 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_SAFETY_H
-#define SIMGRID_MC_SAFETY_H
+#ifndef SIMGRID_MC_SAFETY_HPP
+#define SIMGRID_MC_SAFETY_HPP
 
 #include "xbt/base.h"
 
@@ -18,7 +18,6 @@ enum class ReductionMode {
 };
 
 extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
-
 }
 }
 
index c37252a..9f07568 100644 (file)
@@ -5,8 +5,8 @@
 
 #include "simgrid/s4u/Host.hpp"
 
-#include "src/mc/mc_smx.h"
 #include "src/mc/ModelChecker.hpp"
+#include "src/mc/mc_smx.hpp"
 
 using simgrid::mc::remote;
 
@@ -66,7 +66,7 @@ static void MC_process_refresh_simix_actor_dynar(simgrid::mc::RemoteClient* proc
   s_xbt_dynar_t dynar;
   process->read_bytes(&dynar, sizeof(dynar), remote_dynar);
 
-  smx_actor_t* data = (smx_actor_t*)malloc(dynar.elmsize * dynar.used);
+  smx_actor_t* data = static_cast<smx_actor_t*>(::operator new(dynar.elmsize * dynar.used));
   process->read_bytes(data, dynar.elmsize * dynar.used, dynar.data);
 
   // Load each element of the vector from the MCed process:
@@ -78,7 +78,7 @@ static void MC_process_refresh_simix_actor_dynar(simgrid::mc::RemoteClient* proc
     process->read_bytes(&info.copy, sizeof(info.copy), remote(data[i]));
     target.push_back(std::move(info));
   }
-  free(data);
+  ::operator delete(data);
 }
 namespace simgrid {
 namespace mc {
@@ -184,7 +184,7 @@ const char* MC_smx_actor_get_name(smx_actor_t actor)
 
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
   if (info->name.empty()) {
-    simgrid::xbt::string_data string_data = (simgrid::xbt::string_data&)actor->name;
+    simgrid::xbt::string_data string_data = simgrid::xbt::string::to_string_data(actor->name);
     info->name = process->read_string(remote(string_data.data), string_data.len);
   }
   return info->name.c_str();
similarity index 95%
rename from src/mc/mc_smx.h
rename to src/mc/mc_smx.hpp
index be72eaa..cebb749 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_SMX_H
-#define SIMGRID_MC_SMX_H
+#ifndef SIMGRID_MC_SMX_HPP
+#define SIMGRID_MC_SMX_HPP
 
 #include "src/mc/remote/RemoteClient.hpp"
 
@@ -28,7 +28,7 @@
  * MCed code.
  */
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** Get the issuer of  a simcall (`req->issuer`)
  *
@@ -47,7 +47,6 @@ XBT_PRIVATE const char* MC_smx_actor_get_host_name(smx_actor_t p);
 XBT_PRIVATE int MC_smpi_process_count(void);
 
 XBT_PRIVATE unsigned long MC_smx_get_maxpid(void);
-
-SG_END_DECL()
+}
 
 #endif
index 11dba26..13586a6 100644 (file)
 #include "xbt/sysdep.h"
 
 #include "src/internal_config.h"
-#include "src/smpi/include/private.h"
+#include "src/smpi/include/private.hpp"
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_mmu.h"
 #include "src/mc/PageStore.hpp"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 extern "C" {
 
@@ -123,8 +123,8 @@ int MC_snapshot_region_memcmp(
   bool stack_alloc = size < 64;
   const bool region1_need_buffer = region1==nullptr || region1->storage_type()==simgrid::mc::StorageType::Flat;
   const bool region2_need_buffer = region2==nullptr || region2->storage_type()==simgrid::mc::StorageType::Flat;
-  void* buffer1a = region1_need_buffer ? nullptr : stack_alloc ? alloca(size) : malloc(size);
-  void* buffer2a = region2_need_buffer ? nullptr : stack_alloc ? alloca(size) : malloc(size);
+  void* buffer1a                 = region1_need_buffer ? nullptr : stack_alloc ? alloca(size) : ::operator new(size);
+  void* buffer2a                 = region2_need_buffer ? nullptr : stack_alloc ? alloca(size) : ::operator new(size);
   const void* buffer1 = MC_region_read(region1, buffer1a, addr1, size);
   const void* buffer2 = MC_region_read(region2, buffer2a, addr2, size);
   int res;
@@ -133,8 +133,8 @@ int MC_snapshot_region_memcmp(
   else
     res = memcmp(buffer1, buffer2, size);
   if (not stack_alloc) {
-    free(buffer1a);
-    free(buffer2a);
+    ::operator delete(buffer1a);
+    ::operator delete(buffer2a);
   }
   return res;
 }
@@ -201,9 +201,9 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size,
 
 #include <sys/mman.h>
 
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_mmu.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 XBT_TEST_SUITE("mc_snapshot", "Snapshots");
 
similarity index 61%
rename from src/mc/mc_snapshot.h
rename to src/mc/mc_snapshot.hpp
index 1b1c7c1..6eab444 100644 (file)
@@ -3,20 +3,20 @@
 /* This program 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 SIMGRID_MC_SNAPSHOT_H
-#define SIMGRID_MC_SNAPSHOT_H
+#ifndef SIMGRID_MC_SNAPSHOT_HPP
+#define SIMGRID_MC_SNAPSHOT_HPP
 
-#include <vector>
+#include <memory>
 #include <set>
 #include <string>
-#include <memory>
+#include <vector>
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/RegionSnapshot.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 // ***** Snapshot region
 
@@ -24,32 +24,29 @@ XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc
 
 static XBT_ALWAYS_INLINE void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region)
 {
-  auto split = simgrid::mc::mmu::split(addr - region->start().address());
-  auto pageno = split.first;
-  auto offset = split.second;
+  auto split                = simgrid::mc::mmu::split(addr - region->start().address());
+  auto pageno               = split.first;
+  auto offset               = split.second;
   const void* snapshot_page = region->page_data().page(pageno);
-  return (char*) snapshot_page + offset;
+  return (char*)snapshot_page + offset;
 }
 
 static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
 {
   switch (region->storage_type()) {
-  case simgrid::mc::StorageType::Flat:
-    {
-      uintptr_t offset = (uintptr_t) addr - (uintptr_t) region->start().address();
-      return (void *) ((uintptr_t) region->flat_data().get() + offset);
+    case simgrid::mc::StorageType::Flat: {
+      uintptr_t offset = (uintptr_t)addr - (uintptr_t)region->start().address();
+      return (void*)((uintptr_t)region->flat_data().get() + offset);
     }
-  case simgrid::mc::StorageType::Chunked:
-    return mc_translate_address_region_chunked(addr, region);
-  case simgrid::mc::StorageType::Privatized:
-    {
-    xbt_assert(process_index >= 0, "Missing process index for privatized region");
-    xbt_assert((size_t)process_index < region->privatized_data().size(), "Out of range process index");
-    simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
-    return mc_translate_address_region(addr, &subregion, process_index);
+    case simgrid::mc::StorageType::Chunked:
+      return mc_translate_address_region_chunked(addr, region);
+    case simgrid::mc::StorageType::Privatized: {
+      xbt_assert(process_index >= 0, "Missing process index for privatized region");
+      xbt_assert((size_t)process_index < region->privatized_data().size(), "Out of range process index");
+      simgrid::mc::RegionSnapshot& subregion = region->privatized_data()[process_index];
+      return mc_translate_address_region(addr, &subregion, process_index);
     }
-    case simgrid::mc::StorageType::NoData:
-    default:
+    default: // includes StorageType::NoData
       xbt_die("Storage type not supported");
   }
 }
@@ -65,20 +62,20 @@ XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgr
  *  Some parts of the snapshot are ignored by zeroing them out: the real
  *  values is stored here.
  * */
-typedef struct s_mc_snapshot_ignored_data {
+struct s_mc_snapshot_ignored_data_t {
   void* start;
   std::vector<char> data;
-} s_mc_snapshot_ignored_data_t;
+};
 
-typedef struct s_fd_infos{
+struct s_fd_infos_t {
   std::string filename;
   int number;
   off_t current_position;
   int flags;
-} s_fd_infos_t;
+};
 
 /** Information about a given stack frame */
-typedef struct s_mc_stack_frame {
+struct s_mc_stack_frame_t {
   /** Instruction pointer */
   unw_word_t ip;
   /** Stack pointer */
@@ -87,25 +84,26 @@ typedef struct s_mc_stack_frame {
   simgrid::mc::Frame* frame;
   std::string frame_name;
   unw_cursor_t unw_cursor;
-} s_mc_stack_frame_t;
+};
 typedef s_mc_stack_frame_t* mc_stack_frame_t;
 
-typedef struct s_local_variable{
+struct s_local_variable_t {
   simgrid::mc::Frame* subprogram;
   unsigned long ip;
   std::string name;
   simgrid::mc::Type* type;
-  void *address;
+  voidaddress;
   int region;
-} s_local_variable_t;
+};
 typedef s_local_variable_t* local_variable_t;
 
-typedef struct XBT_PRIVATE s_mc_snapshot_stack {
-  std::vector<s_local_variable> local_variables;
+struct XBT_PRIVATE s_mc_snapshot_stack_t {
+  std::vector<s_local_variable_t> local_variables;
   simgrid::mc::UnwindContext context;
   std::vector<s_mc_stack_frame_t> stack_frames;
   int process_index;
-} s_mc_snapshot_stack_t, *mc_snapshot_stack_t;
+};
+typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
 
 namespace simgrid {
 namespace mc {
@@ -114,9 +112,8 @@ class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   Snapshot(RemoteClient* process, int num_state);
   ~Snapshot() = default;
-  const void* read_bytes(void* buffer, std::size_t size,
-    RemotePtr<void> address, int process_index = ProcessIndexAny,
-    ReadOptions options = ReadOptions::none()) const override;
+  const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index = ProcessIndexAny,
+                         ReadOptions options = ReadOptions::none()) const override;
 
   // To be private
   int num_state;
@@ -128,10 +125,9 @@ public:
   std::vector<s_mc_snapshot_stack_t> stacks;
   std::vector<simgrid::mc::IgnoredHeapRegion> to_ignore;
   std::uint64_t hash;
-  std::vector<s_mc_snapshot_ignored_data> ignored_data;
+  std::vector<s_mc_snapshot_ignored_data_t> ignored_data;
   std::vector<s_fd_infos_t> current_fds;
 };
-
 }
 }
 
@@ -147,41 +143,32 @@ static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgri
 }
 
 static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-
 }
 
-#ifdef __cplusplus
-
 namespace simgrid {
 namespace mc {
 
 XBT_PRIVATE std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state);
 XBT_PRIVATE void restore_snapshot(std::shared_ptr<simgrid::mc::Snapshot> snapshot);
-
 }
 }
 
-#endif
-
 extern "C" {
 
 XBT_PRIVATE void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
                                                  simgrid::mc::ChunkedData const& pagenos);
 
-const void* MC_region_read_fragmented(
-  mc_mem_region_t region, void* target, const void* addr, std::size_t size);
+const void* MC_region_read_fragmented(mc_mem_region_t region, void* target, const void* addr, std::size_t size);
 
-int MC_snapshot_region_memcmp(
-  const void* addr1, mc_mem_region_t region1,
-  const void* addr2, mc_mem_region_t region2, std::size_t size);
-XBT_PRIVATE int MC_snapshot_memcmp(
-  const void* addr1, simgrid::mc::Snapshot* snapshot1,
-  const void* addr2, simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
+int MC_snapshot_region_memcmp(const void* addr1, mc_mem_region_t region1, const void* addr2, mc_mem_region_t region2,
+                              std::size_t size);
+XBT_PRIVATE int MC_snapshot_memcmp(const void* addr1, simgrid::mc::Snapshot* snapshot1, const void* addr2,
+                                   simgrid::mc::Snapshot* snapshot2, int process_index, std::size_t size);
 
 static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
 {
-  if(snapshot==nullptr)
-      xbt_die("snapshot is nullptr");
+  if (snapshot == nullptr)
+    xbt_die("snapshot is nullptr");
   return mc_model_checker->process().get_heap()->breakval;
 }
 
@@ -203,39 +190,33 @@ static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void
   xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
 
   switch (region->storage_type()) {
-  case simgrid::mc::StorageType::NoData:
-  default:
-    xbt_die("Storage type not supported");
+    case simgrid::mc::StorageType::Flat:
+      return (char*)region->flat_data().get() + offset;
 
-  case simgrid::mc::StorageType::Flat:
-    return (char*) region->flat_data().get() + offset;
-
-  case simgrid::mc::StorageType::Chunked:
-    {
+    case simgrid::mc::StorageType::Chunked: {
       // Last byte of the region:
-      void* end = (char*) addr + size - 1;
-      if (simgrid::mc::mmu::sameChunk((std::uintptr_t) addr, (std::uintptr_t) end) ) {
+      void* end = (char*)addr + size - 1;
+      if (simgrid::mc::mmu::sameChunk((std::uintptr_t)addr, (std::uintptr_t)end)) {
         // The memory is contained in a single page:
-        return mc_translate_address_region_chunked((uintptr_t) addr, region);
+        return mc_translate_address_region_chunked((uintptr_t)addr, region);
       } else {
         // The memory spans several pages:
         return MC_region_read_fragmented(region, target, addr, size);
       }
     }
 
-  // We currently do not pass the process_index to this function so we assume
-  // that the privatized region has been resolved in the callers:
-  case simgrid::mc::StorageType::Privatized:
-    xbt_die("Storage type not supported");
+    default:
+      // includes StorageType::NoData and StorageType::Privatized (we currently do not pass the process_index to this
+      // function so we assume that the privatized region has been resolved in the callers)
+      xbt_die("Storage type not supported");
   }
 }
 
 static XBT_ALWAYS_INLINE void* MC_region_read_pointer(mc_mem_region_t region, const void* addr)
 {
   void* res;
-  return *(void**) MC_region_read(region, &res, addr, sizeof(void*));
+  return *(void**)MC_region_read(region, &res, addr, sizeof(void*));
+}
 }
-
-SG_END_DECL()
 
 #endif
index 0bce019..3fce2df 100644 (file)
 
 #include "src/mc/Transition.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_private.h"
-#include "src/mc/mc_request.h"
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_state.h"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/mc_request.hpp"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_state.hpp"
 #include "src/mc/mc_xbt.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 using simgrid::mc::remote;
 
similarity index 79%
rename from src/mc/mc_state.h
rename to src/mc/mc_state.hpp
index d6ee814..edef946 100644 (file)
@@ -3,60 +3,57 @@
 /* This program 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 SIMGRID_MC_STATE_H
-#define SIMGRID_MC_STATE_H
+#ifndef SIMGRID_MC_STATE_HPP
+#define SIMGRID_MC_STATE_HPP
 
 #include <list>
 #include <memory>
 
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_record.h"
 #include "src/mc/Transition.hpp"
+#include "src/mc/mc_record.hpp"
+#include "src/mc/mc_snapshot.hpp"
 
 namespace simgrid {
 namespace mc {
 
 enum class PatternCommunicationType {
-  none = 0,
-  send = 1,
+  none    = 0,
+  send    = 1,
   receive = 2,
 };
 
-struct PatternCommunication {
+class PatternCommunication {
+public:
   int num = 0;
   simgrid::kernel::activity::CommImpl* comm_addr;
   PatternCommunicationType type = PatternCommunicationType::send;
-  unsigned long src_proc = 0;
-  unsigned long dst_proc = 0;
-  const char *src_host = nullptr;
-  const char *dst_host = nullptr;
+  unsigned long src_proc        = 0;
+  unsigned long dst_proc        = 0;
+  const char* src_host          = nullptr;
+  const char* dst_host          = nullptr;
   std::string rdv;
   std::vector<char> data;
-  int tag = 0;
+  int tag   = 0;
   int index = 0;
 
-  PatternCommunication()
-  {
-    std::memset(&comm_addr, 0, sizeof(comm_addr));
-  }
+  PatternCommunication() { std::memset(&comm_addr, 0, sizeof(comm_addr)); }
 
   PatternCommunication dup() const
   {
     simgrid::mc::PatternCommunication res;
     // num?
     res.comm_addr = this->comm_addr;
-    res.type = this->type;
+    res.type      = this->type;
     // src_proc?
     // dst_proc?
     res.dst_proc = this->dst_proc;
     res.dst_host = this->dst_host;
-    res.rdv = this->rdv;
-    res.data = this->data;
+    res.rdv      = this->rdv;
+    res.data     = this->data;
     // tag?
     res.index = this->index;
     return res;
   }
-
 };
 
 /* On every state, each process has an entry of the following type.
@@ -78,34 +75,28 @@ class ProcessState {
 
   /** Exploration control information */
   InterleavingType state = InterleavingType::disabled;
+
 public:
   /** Number of times that the process was considered to be executed */
   // TODO, make this private
   unsigned int times_considered = 0;
 
-  bool isDisabled() const {
-    return this->state == InterleavingType::disabled;
-  }
-  bool isDone() const {
-    return this->state == InterleavingType::done;
-  }
-  bool isTodo() const {
-    return this->state == InterleavingType::todo;
-  }
+  bool isDisabled() const { return this->state == InterleavingType::disabled; }
+  bool isDone() const { return this->state == InterleavingType::done; }
+  bool isTodo() const { return this->state == InterleavingType::todo; }
   /** Mark that we should try executing this process at some point in the future of the checker algorithm */
-  void consider() {
+  void consider()
+  {
     this->state            = InterleavingType::todo;
     this->times_considered = 0;
   }
-  void setDone() {
-    this->state = InterleavingType::done;
-  }
+  void setDone() { this->state = InterleavingType::done; }
 };
 
 /* A node in the exploration graph (kind-of)
  */
-struct XBT_PRIVATE State {
-
+class XBT_PRIVATE State {
+public:
   /** Sequential state number (used for debugging) */
   int num = 0;
 
@@ -140,7 +131,6 @@ struct XBT_PRIVATE State {
   void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->pid].consider(); }
   Transition getTransition() const;
 };
-
 }
 }
 
index 85b6129..b85172e 100644 (file)
@@ -23,7 +23,7 @@ typedef register_t greg_t;
 #include <libunwind.h>
 
 #include "src/mc/Frame.hpp"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 using simgrid::mc::remote;
similarity index 63%
rename from src/mc/mc_unw.h
rename to src/mc/mc_unw.hpp
index 6a6b861..7eeec0a 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMGRID_MC_UNW_H
-#define SIMGRID_MC_UNW_H
+#ifndef SIMGRID_MC_UNW_HPP
+#define SIMGRID_MC_UNW_HPP
 
 /** @file
  *  Libunwind implementation for the model-checker
@@ -28,8 +28,8 @@
 #include "src/mc/mc_forward.hpp"
 #include "xbt/base.h"
 
+#include <cstdio>
 #include <libunwind.h>
-#include <stdio.h>
 #include <sys/types.h>
 
 namespace simgrid {
@@ -37,7 +37,6 @@ namespace unw {
 
 XBT_PRIVATE unw_addr_space_t create_addr_space();
 XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid);
-
 }
 }
 
@@ -57,30 +56,19 @@ public:
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
-  static int find_proc_info(unw_addr_space_t as,
-                unw_word_t ip, unw_proc_info_t *pip,
-                int need_unwind_info, void* arg) noexcept;
-  static void put_unwind_info(unw_addr_space_t as,
-                unw_proc_info_t *pip, void* arg) noexcept;
-  static int get_dyn_info_list_addr(unw_addr_space_t as,
-                unw_word_t *dilap, void* arg) noexcept;
-  static int access_mem(unw_addr_space_t as,
-                unw_word_t addr, unw_word_t *valp,
-                int write, void* arg) noexcept;
+  static int find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t* pip, int need_unwind_info,
+                            void* arg) noexcept;
+  static void put_unwind_info(unw_addr_space_t as, unw_proc_info_t* pip, void* arg) noexcept;
+  static int get_dyn_info_list_addr(unw_addr_space_t as, unw_word_t* dilap, void* arg) noexcept;
+  static int access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t* valp, int write, void* arg) noexcept;
   static void* get_reg(unw_context_t* context, unw_regnum_t regnum) noexcept;
-  static int access_reg(unw_addr_space_t as,
-                unw_regnum_t regnum, unw_word_t *valp,
-                int write, void* arg) noexcept;
-  static int access_fpreg(unw_addr_space_t as,
-                unw_regnum_t regnum, unw_fpreg_t *fpvalp,
-                int write, void* arg) noexcept;
-  static int resume(unw_addr_space_t as,
-                unw_cursor_t *cp, void* arg) noexcept;
-  static int get_proc_name(unw_addr_space_t as,
-                unw_word_t addr, char *bufp,
-                size_t buf_len, unw_word_t *offp,
-                void* arg) noexcept;
+  static int access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t* valp, int write, void* arg) noexcept;
+  static int access_fpreg(unw_addr_space_t as, unw_regnum_t regnum, unw_fpreg_t* fpvalp, int write, void* arg) noexcept;
+  static int resume(unw_addr_space_t as, unw_cursor_t* cp, void* arg) noexcept;
+  static int get_proc_name(unw_addr_space_t as, unw_word_t addr, char* bufp, size_t buf_len, unw_word_t* offp,
+                           void* arg) noexcept;
   static unw_accessors_t accessors;
+
 public:
   // Create a libunwind address space:
   static unw_addr_space_t createUnwindAddressSpace();
@@ -89,7 +77,6 @@ public:
 void MC_dump_stack_unw(FILE* file, unw_cursor_t cursor);
 void dumpStack(FILE* file, unw_cursor_t cursor);
 void dumpStack(FILE* file, pid_t pid);
-
 }
 }
 
index 97b5646..3614cc3 100644 (file)
@@ -11,7 +11,7 @@
 #include <libunwind.h>
 #include <libunwind-ptrace.h>
 
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_unw.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
 /** \file
@@ -36,7 +36,7 @@ struct _UPT_info {
 static inline
 pid_t _UPT_getpid(void* arg)
 {
-  struct _UPT_info* info = static_cast<_UPT_info*>(arg);
+  _UPT_info* info = static_cast<_UPT_info*>(arg);
   return info->pid;
 }
 
index 93f0bc0..362a3cd 100644 (file)
 
 #include "src/internal_config.h"
 
-#include "src/mc/mc_request.h"
+#include "src/mc/mc_request.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 
 #include "src/smpi/include/private.hpp"
 
 // We won't need those once the separation MCer/MCed is complete:
-#include "src/mc/mc_smx.h"
+#include "src/mc/mc_smx.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client, mc, "MC client logic");
 
index 74ffde1..37abc50 100644 (file)
@@ -31,9 +31,9 @@
 #include "xbt/log.h"
 #include <xbt/mmalloc.h>
 
-#include "src/mc/mc_smx.h"
-#include "src/mc/mc_snapshot.h"
-#include "src/mc/mc_unw.h"
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_snapshot.hpp"
+#include "src/mc/mc_unw.hpp"
 
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/ObjectInformation.hpp"
@@ -116,7 +116,7 @@ struct s_mc_memory_map_re {
   regex_t version_re;
 };
 
-static char* get_lib_name(const char* pathname, struct s_mc_memory_map_re* res)
+static char* get_lib_name(const char* pathname, s_mc_memory_map_re* res)
 {
   char* map_basename = xbt_basename(pathname);
 
@@ -227,7 +227,7 @@ void RemoteClient::init()
     xbt_die("No heap information in the target process");
   if (not std_heap_var->address)
     xbt_die("No constant address for this variable");
-  this->read_bytes(&this->heap_address, sizeof(struct mdesc*), remote(std_heap_var->address),
+  this->read_bytes(&this->heap_address, sizeof(mdesc*), remote(std_heap_var->address),
                    simgrid::mc::ProcessIndexDisabled);
 
   this->smx_actors_infos.clear();
@@ -262,8 +262,7 @@ void RemoteClient::refresh_heap()
   // Read/dereference/refresh the std_heap pointer:
   if (not this->heap)
     this->heap = std::unique_ptr<s_xbt_mheap_t>(new s_xbt_mheap_t());
-  this->read_bytes(this->heap.get(), sizeof(struct mdesc), remote(this->heap_address),
-                   simgrid::mc::ProcessIndexDisabled);
+  this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address), simgrid::mc::ProcessIndexDisabled);
   this->cache_flags_ |= RemoteClient::cache_heap;
 }
 
@@ -295,7 +294,7 @@ void RemoteClient::init_memory_map_info()
   this->binary_info     = nullptr;
   this->libsimgrid_info = nullptr;
 
-  struct s_mc_memory_map_re res;
+  s_mc_memory_map_re res;
 
   if (regcomp(&res.so_re, SO_RE, 0) || regcomp(&res.version_re, VERSION_RE, 0))
     xbt_die(".so regexp did not compile");
index 2fc8586..3f99f0e 100644 (file)
@@ -26,8 +26,8 @@
 #include "src/mc/remote/Channel.hpp"
 #include "src/mc/remote/RemotePtr.hpp"
 
-#include "src/simix/popping_private.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/popping_private.hpp"
+#include "src/simix/smx_private.hpp"
 #include <simgrid/simix.h>
 
 #include "src/xbt/memory_map.hpp"
@@ -226,7 +226,6 @@ private:
   void refresh_malloc_info();
   void refresh_simix();
 
-private:
   pid_t pid_ = -1;
   Channel channel_;
   bool running_ = false;
@@ -239,17 +238,18 @@ private:
   std::vector<s_stack_region_t> stack_areas_;
   std::vector<IgnoredHeapRegion> ignored_heap_;
 
-public: // object info
+public:
+  // object info
   // TODO, make private (first, objectify simgrid::mc::ObjectInformation*)
   std::vector<std::shared_ptr<simgrid::mc::ObjectInformation>> object_infos;
   std::shared_ptr<simgrid::mc::ObjectInformation> libsimgrid_info;
   std::shared_ptr<simgrid::mc::ObjectInformation> binary_info;
 
-public: // Copies of MCed SMX data structures
-        /** Copy of `simix_global->process_list`
-         *
-         *  See mc_smx.c.
-         */
+  // Copies of MCed SMX data structures
+  /** Copy of `simix_global->process_list`
+   *
+   *  See mc_smx.c.
+   */
   std::vector<ActorInformation> smx_actors_infos;
 
   /** Copy of `simix_global->process_to_destroy`
@@ -282,13 +282,13 @@ public:
    */
   std::vector<malloc_info> heap_info;
 
-public: // Libunwind-data
-        /** Full-featured MC-aware libunwind address space for the process
-         *
-         *  This address space is using a simgrid::mc::UnwindContext*
-         *  (with simgrid::mc::Process* / simgrid::mc::AddressSpace*
-         *  and unw_context_t).
-         */
+  // Libunwind-data
+  /** Full-featured MC-aware libunwind address space for the process
+   *
+   *  This address space is using a simgrid::mc::UnwindContext*
+   *  (with simgrid::mc::Process* / simgrid::mc::AddressSpace*
+   *  and unw_context_t).
+   */
   unw_addr_space_t unw_addr_space;
 
   /** Underlying libunwind address-space
index a3a69f9..d82c9ca 100644 (file)
@@ -4,8 +4,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Host.hpp"
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
@@ -36,8 +36,8 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     //start link
-    container_t msg = PJ_container_get (instr_process_id(process, str, len));
-    simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK");
+    container_t msg            = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     //destroy existing container of this process
@@ -47,8 +47,8 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
     TRACE_msg_process_create (MSG_process_get_name (process), MSG_process_get_PID (process), new_host);
 
     //end link
-    msg = PJ_container_get(instr_process_id(process, str, len));
-    type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK");
+    msg  = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
 }
@@ -59,7 +59,7 @@ void TRACE_msg_process_create (const char *process_name, int process_pid, msg_ho
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t host_container = PJ_container_get(host->getCname());
+    container_t host_container = simgrid::instr::Container::byName(host->getName());
     new simgrid::instr::Container(instr_process_id_2(process_name, process_pid, str, len),
                                   simgrid::instr::INSTR_MSG_PROCESS, host_container);
   }
@@ -71,9 +71,10 @@ void TRACE_msg_process_destroy (const char *process_name, int process_pid)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process = PJ_container_get_or_null(instr_process_id_2(process_name, process_pid, str, len));
+    container_t process =
+        simgrid::instr::Container::byNameOrNull(instr_process_id_2(process_name, process_pid, str, len));
     if (process) {
-      PJ_container_remove_from_parent (process);
+      process->removeFromParent();
       delete process;
     }
   }
@@ -93,9 +94,9 @@ void TRACE_msg_process_suspend(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
-    simgrid::instr::Value* val    = simgrid::instr::Value::get("suspend", type);
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
+    simgrid::instr::Value* val    = simgrid::instr::Value::byName("suspend", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
@@ -106,8 +107,8 @@ void TRACE_msg_process_resume(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
@@ -118,9 +119,9 @@ void TRACE_msg_process_sleep_in(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
-    simgrid::instr::Value* val    = simgrid::instr::Value::get("sleep", type);
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
+    simgrid::instr::Value* val    = simgrid::instr::Value::byName("sleep", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
@@ -131,8 +132,8 @@ void TRACE_msg_process_sleep_out(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
index 49f94db..4eb14d3 100644 (file)
@@ -1,12 +1,12 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 "mc/mc.h"
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 
 #include <atomic>
 
@@ -52,9 +52,9 @@ void TRACE_msg_task_execute_start(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
-    simgrid::instr::Value* val    = simgrid::instr::Value::get("task_execute", type);
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
+    simgrid::instr::Value* val    = simgrid::instr::Value::byName("task_execute", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
@@ -67,8 +67,8 @@ void TRACE_msg_task_execute_end(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
@@ -92,9 +92,9 @@ void TRACE_msg_task_get_start()
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
-    simgrid::instr::Value* val    = simgrid::instr::Value::get("receive", type);
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
+    simgrid::instr::Value* val    = simgrid::instr::Value::byName("receive", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
@@ -107,13 +107,13 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
 
     char key[INSTR_DEFAULT_STR_SIZE];
     snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
-    type = PJ_type_get_root()->getChild("MSG_PROCESS_TASK_LINK");
+    type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
   }
 }
@@ -127,14 +127,14 @@ int TRACE_msg_task_put_start(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
-    simgrid::instr::Value* val    = simgrid::instr::Value::get("send", type);
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
+    simgrid::instr::Value* val    = simgrid::instr::Value::byName("send", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
 
     char key[INSTR_DEFAULT_STR_SIZE];
     snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
-    type = PJ_type_get_root()->getChild("MSG_PROCESS_TASK_LINK");
+    type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
   }
 
@@ -149,8 +149,8 @@ void TRACE_msg_task_put_end()
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    container_t process_container = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
index 917c868..82619ee 100644 (file)
@@ -3,14 +3,14 @@
 /* This program 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 "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "xbt/replay.hpp"
 
 #include <cerrno>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 void MSG_action_init()
 {
@@ -52,5 +52,4 @@ msg_error_t MSG_action_trace_run(char *path)
 
   return res;
 }
-
-SG_END_DECL()
+}
index a5089f6..ae3d87a 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2004-2014. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_simulation
  * \brief An application deployer.
@@ -59,5 +59,4 @@ void MSG_set_function(const char *host_id, const char *function_name, xbt_dynar_
 {
   SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);
 }
-
-SG_END_DECL()
+}
index 8399065..92d67e9 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 #if SIMGRID_HAVE_LUA
 #include <lua.h>
@@ -13,7 +13,7 @@
 #include <lualib.h>
 #endif
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* MSG **************************************/
 
@@ -76,5 +76,4 @@ void MSG_zone_get_hosts(msg_netzone_t netzone, xbt_dynar_t whereto)
   for (auto const& host : hosts)
     xbt_dynar_push(whereto, &host);
 }
-
-SG_END_DECL()
+}
index f2f926b..5651178 100644 (file)
@@ -8,12 +8,12 @@
 
 #include "instr/instr_interface.h"
 #include "mc/mc.h"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 MSG_Global_t msg_global = nullptr;
 static void MSG_exit();
@@ -130,5 +130,4 @@ unsigned long int MSG_get_sent_msg()
 {
   return msg_global->sent_msg;
 }
-
-SG_END_DECL()
+}
index feb9577..d6ef1f3 100644 (file)
@@ -6,12 +6,12 @@
 #include <xbt/ex.hpp>
 
 #include "src/kernel/activity/ExecImpl.hpp"
-#include "src/msg/msg_private.h"
-#include "src/simix/smx_private.h" /* MSG_task_listen looks inside the rdv directly. Not clean. */
+#include "src/msg/msg_private.hpp"
+#include "src/simix/smx_private.hpp" /* MSG_task_listen looks inside the rdv directly. Not clean. */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_task_usage
  * \brief Executes a task and waits for its termination.
@@ -270,7 +270,7 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
   /* Try to receive it by calling SIMIX network layer */
   try {
     simcall_comm_recv(MSG_process_self()->getImpl(), mailbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, timeout, rate);
-    XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->getName());
+    XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->getCname());
     (*task)->simdata->setNotUsed();
   }
   catch (xbt_ex& e) {
@@ -907,5 +907,4 @@ const char *MSG_task_get_category (msg_task_t task)
 {
   return task->category;
 }
-
-SG_END_DECL()
+}
index e40c790..7605967 100644 (file)
@@ -5,16 +5,15 @@
 
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_host_private.h"
-
+#include "src/simix/smx_host_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
 
 simgrid::xbt::Extension<simgrid::s4u::Host, simgrid::MsgHostExt> simgrid::MsgHostExt::EXTENSION_ID;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int sg_storage_max_file_descriptors = 1024;
 
@@ -267,5 +266,4 @@ xbt_dict_t MSG_host_get_storage_content(msg_host_t host)
 
   return contents;
 }
-
-SG_END_DECL()
+}
index 1566e85..11de4c7 100644 (file)
@@ -6,12 +6,12 @@
 #include "simgrid/s4u/File.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include <numeric>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_io, msg, "Logging specific to MSG (io)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup msg_file
  * (#msg_file_t) and the functions for managing it.
@@ -94,7 +94,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size)
   /* Find the host where the file is physically located and read it */
   msg_storage_t storage_src           = simgrid::s4u::Storage::byName(fd->storageId);
   msg_host_t attached_host            = storage_src->getHost();
-  read_size                           = fd->read(size); // TODO re-add attached_host
+  read_size                           = fd->read(size);
 
   if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
@@ -158,7 +158,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
     }
   }
   /* Write file on local or remote host */
-  sg_size_t write_size = fd->write(size); // TODO readd attached_host
+  sg_size_t write_size = fd->write(size);
 
   return write_size;
 }
@@ -175,6 +175,7 @@ msg_file_t MSG_file_open(const char* fullpath, void* data)
 {
   msg_file_t fd         = new simgrid::s4u::File(fullpath, MSG_host_self());
   fd->desc_id           = MSG_host_get_file_descriptor_id(MSG_host_self());
+  fd->setUserdata(data);
   return fd;
 }
 
@@ -357,7 +358,7 @@ msg_error_t MSG_file_rmove (msg_file_t file, msg_host_t host, const char* fullpa
 const char* MSG_storage_get_name(msg_storage_t storage)
 {
   xbt_assert((storage != nullptr), "Invalid parameters");
-  return storage->getName();
+  return storage->getCname();
 }
 
 /** \ingroup msg_storage_management
@@ -477,10 +478,11 @@ void *MSG_storage_get_data(msg_storage_t storage)
 xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
 {
   std::map<std::string, sg_size_t>* content = storage->getContent();
-  xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+  // Note: ::operator delete is ok here (no destructor called) since the dict elements are of POD type sg_size_t.
+  xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(::operator delete);
 
   for (auto const& entry : *content) {
-    sg_size_t* psize = static_cast<sg_size_t*>(malloc(sizeof(sg_size_t)));
+    sg_size_t* psize = new sg_size_t;
     *psize           = entry.second;
     xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr);
   }
@@ -509,5 +511,4 @@ const char* MSG_storage_get_host(msg_storage_t storage)
   xbt_assert((storage != nullptr), "Invalid parameters");
   return storage->getHost()->getCname();
 }
-
-SG_END_DECL()
+}
index d27f199..791e59d 100644 (file)
@@ -6,11 +6,11 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Mailbox.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup msg_mailbox_management
  * \brief Set the mailbox to receive in asynchronous mode
@@ -26,5 +26,4 @@ void MSG_mailbox_set_async(const char *alias){
   mailbox->setReceiver(simgrid::s4u::Actor::self());
   XBT_VERB("%s mailbox set to receive eagerly for myself\n",alias);
 }
-
-SG_END_DECL()
+}
similarity index 65%
rename from src/msg/msg_private.h
rename to src/msg/msg_private.hpp
index 656d67f..094dd62 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef METASIMGRID_PRIVATE_H
-#define METASIMGRID_PRIVATE_H
+#ifndef MSG_PRIVATE_HPP
+#define MSG_PRIVATE_HPP
 
 #include "simgrid/msg.h"
 
@@ -21,48 +21,44 @@ class MsgHostExt {
 public:
   static simgrid::xbt::Extension<s4u::Host, MsgHostExt> EXTENSION_ID;
 
-  ~MsgHostExt() {
-    delete file_descriptor_table;
-  }
+  ~MsgHostExt() { delete file_descriptor_table; }
   std::vector<int>* file_descriptor_table = nullptr; // Created lazily on need
 };
 }
 /********************************* Task **************************************/
 
-typedef struct simdata_task {
-  ~simdata_task()
+struct s_simdata_task_t {
+  ~s_simdata_task_t()
   {
     /* parallel tasks only */
-    xbt_free(this->host_list);
+    delete[] this->host_list;
+    /* flops_parallel_amount and bytes_parallel_amount are automatically deleted in ~L07Action */
   }
   void setUsed();
-  void setNotUsed()
-  {
-    this->isused = false;
-  }
+  void setNotUsed() { this->isused = false; }
 
   simgrid::kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
   simgrid::kernel::activity::CommImplPtr comm    = nullptr; /* SIMIX modeling of communication */
-  double bytes_amount = 0.0; /* Data size */
-  double flops_amount = 0.0; /* Computation size */
-  msg_process_t sender = nullptr;
-  msg_process_t receiver = nullptr;
-  msg_host_t source = nullptr;
+  double bytes_amount                            = 0.0;     /* Data size */
+  double flops_amount                            = 0.0;     /* Computation size */
+  msg_process_t sender                           = nullptr;
+  msg_process_t receiver                         = nullptr;
+  msg_host_t source                              = nullptr;
 
   double priority = 1.0;
   double bound    = 0.0; /* Capping for CPU resource, or 0 for no capping */
   double rate     = -1;  /* Capping for network resource, or -1 for no capping*/
 
-  bool isused = false;  /* Indicates whether the task is used in SIMIX currently */
-  int host_nb = 0;      /* ==0 if sequential task; parallel task if not */
+  bool isused = false; /* Indicates whether the task is used in SIMIX currently */
+  int host_nb = 0;     /* ==0 if sequential task; parallel task if not */
   /*******  Parallel Tasks Only !!!! *******/
-  sg_host_t *host_list = nullptr;
-  double *flops_parallel_amount = nullptr;
-  double *bytes_parallel_amount = nullptr;
+  sg_host_t* host_list          = nullptr;
+  doubleflops_parallel_amount = nullptr;
+  doublebytes_parallel_amount = nullptr;
 
 private:
   void reportMultipleUse() const;
-} s_simdata_task_t;
+};
 
 /******************************* Process *************************************/
 
@@ -72,15 +68,15 @@ class ActorExt {
 public:
   explicit ActorExt(void* d) : data(d) {}
   msg_error_t errno_ = MSG_OK;  /* the last value returned by a MSG_function */
-  void* data = nullptr; /* user data */
+  void* data         = nullptr; /* user data */
 };
 
 class Comm {
 public:
-  msg_task_t task_sent;           /* task sent (NULL for the receiver) */
-  msg_task_t *task_received;      /* where the task will be received (NULL for the sender) */
-  smx_activity_t s_comm;          /* SIMIX communication object encapsulated (the same for both processes) */
-  msg_error_t status = MSG_OK;    /* status of the communication once finished */
+  msg_task_t task_sent;        /* task sent (NULL for the receiver) */
+  msg_task_t* task_received;   /* where the task will be received (NULL for the sender) */
+  smx_activity_t s_comm;       /* SIMIX communication object encapsulated (the same for both processes) */
+  msg_error_t status = MSG_OK; /* status of the communication once finished */
   Comm(msg_task_t sent, msg_task_t* received, smx_activity_t comm)
       : task_sent(sent), task_received(received), s_comm(std::move(comm))
   {
@@ -90,15 +86,15 @@ public:
 }
 
 /************************** Global variables ********************************/
-typedef struct MSG_Global {
-  int debug_multiple_use;       /* whether we want an error message when reusing the same Task for 2 things */
+struct s_MSG_Global_t {
+  int debug_multiple_use;            /* whether we want an error message when reusing the same Task for 2 things */
   std::atomic_int_fast32_t sent_msg; /* Total amount of messages sent during the simulation */
-  void (*task_copy_callback) (msg_task_t task, msg_process_t src, msg_process_t dst);
+  void (*task_copy_callback)(msg_task_t task, msg_process_t src, msg_process_t dst);
   void_f_pvoid_t process_data_cleanup;
-} s_MSG_Global_t;
+};
 typedef s_MSG_Global_t* MSG_Global_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC_DATA(MSG_Global_t) msg_global;
 
@@ -114,31 +110,30 @@ XBT_PRIVATE void MSG_host_del_task(msg_host_t host, msg_task_t task);
 
 /********** Tracing **********/
 /* declaration of instrumentation functions from msg_task_instr.c */
-XBT_PRIVATE void TRACE_msg_set_task_category(msg_task_t task, const char *category);
+XBT_PRIVATE void TRACE_msg_set_task_category(msg_task_t task, const charcategory);
 XBT_PRIVATE void TRACE_msg_task_create(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_execute_start(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_execute_end(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_destroy(msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_get_end(double start_time, msg_task_t task);
 XBT_PRIVATE void TRACE_msg_task_get_start();
-XBT_PRIVATE int TRACE_msg_task_put_start(msg_task_t task);    //returns TRUE if the task_put_end must be called
+XBT_PRIVATE int TRACE_msg_task_put_start(msg_task_t task); // returns TRUE if the task_put_end must be called
 XBT_PRIVATE void TRACE_msg_task_put_end();
 
 /* declaration of instrumentation functions from msg_process_instr.c */
-XBT_PRIVATE char *instr_process_id (msg_process_t proc, char *str, int len);
-XBT_PRIVATE char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
+XBT_PRIVATE char* instr_process_id(msg_process_t proc, char* str, int len);
+XBT_PRIVATE char* instr_process_id_2(const char* process_name, int process_pid, char* str, int len);
 XBT_PRIVATE void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host);
-XBT_PRIVATE void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host);
-XBT_PRIVATE void TRACE_msg_process_destroy (const char *process_name, int process_pid);
+XBT_PRIVATE void TRACE_msg_process_create(const char* process_name, int process_pid, msg_host_t host);
+XBT_PRIVATE void TRACE_msg_process_destroy(const char* process_name, int process_pid);
 XBT_PRIVATE void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_suspend(msg_process_t process);
 XBT_PRIVATE void TRACE_msg_process_resume(msg_process_t process);
-XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process);   //called from msg/gos.c
+XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process); // called from msg/gos.c
 XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process);
+}
 
-SG_END_DECL()
-
-inline void simdata_task::setUsed()
+inline void s_simdata_task_t::setUsed()
 {
   if (this->isused)
     this->reportMultipleUse();
index 75a3997..465e4cf 100644 (file)
@@ -3,14 +3,14 @@
 /* This program 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 "msg_private.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_process, msg, "Logging specific to MSG (process)");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_process_management
  *
@@ -138,8 +138,7 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
   xbt_free(argv);
   return res;
 }
-
-SG_END_DECL()
+}
 
 msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<void()> code, void* data, msg_host_t host,
                                               std::map<std::string, std::string>* properties)
@@ -158,7 +157,7 @@ msg_process_t MSG_process_create_from_stdfunc(const char* name, std::function<vo
   return process->ciface();
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Become a process in the simulation
  *
@@ -524,5 +523,4 @@ XBT_PUBLIC(void) MSG_process_unref(msg_process_t process)
 {
   intrusive_ptr_release(process);
 }
-
-SG_END_DECL()
+}
index 5cf06a0..b475b9d 100644 (file)
@@ -6,8 +6,8 @@
 
 #include "xbt/ex.hpp"
 
-#include "msg_private.h"
-#include "src/simix/smx_private.h"
+#include "msg_private.hpp"
+#include "src/simix/smx_private.hpp"
 #include "xbt/synchro.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_synchro, msg, "Logging specific to MSG (synchro)");
@@ -63,16 +63,16 @@ int MSG_sem_would_block(msg_sem_t sem) {
 }
 
 /*-**** barrier related functions ****-*/
-typedef struct s_msg_bar {
+struct s_msg_bar_t {
   xbt_mutex_t mutex;
   xbt_cond_t cond;
   unsigned int arrived_processes;
   unsigned int expected_processes;
-} s_msg_bar_t;
+};
 
 /** @brief Initializes a barrier, with count elements */
 msg_bar_t MSG_barrier_init(unsigned int count) {
-  msg_bar_t bar           = xbt_new0(s_msg_bar, 1);
+  msg_bar_t bar           = xbt_new0(s_msg_bar_t, 1);
   bar->expected_processes = count;
   bar->arrived_processes  = 0;
   bar->mutex              = xbt_mutex_init();
index 42a69af..0f6c705 100644 (file)
@@ -1,12 +1,13 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "src/simix/smx_private.h"
+#include "msg_private.hpp"
+#include "src/simix/smx_private.hpp"
+#include <algorithm>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /** @addtogroup m_task_management
  *
@@ -18,7 +19,7 @@ SG_BEGIN_DECL()
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
 
-void simdata_task::reportMultipleUse() const
+void s_simdata_task_t::reportMultipleUse() const
 {
   if (msg_global->debug_multiple_use){
     XBT_ERROR("This task is already used in there:");
@@ -90,12 +91,16 @@ msg_task_t MSG_parallel_task_create(const char *name, int host_nb, const msg_hos
 
   /* Simulator Data specific to parallel tasks */
   simdata->host_nb = host_nb;
-  simdata->host_list = xbt_new0(sg_host_t, host_nb);
-  simdata->flops_parallel_amount = flops_amount;
-  simdata->bytes_parallel_amount = bytes_amount;
-
-  for (int i = 0; i < host_nb; i++)
-    simdata->host_list[i] = host_list[i];
+  simdata->host_list             = new sg_host_t[host_nb];
+  std::copy_n(host_list, host_nb, simdata->host_list);
+  if (flops_amount != nullptr) {
+    simdata->flops_parallel_amount = new double[host_nb];
+    std::copy_n(flops_amount, host_nb, simdata->flops_parallel_amount);
+  }
+  if (bytes_amount != nullptr) {
+    simdata->bytes_parallel_amount = new double[host_nb * host_nb];
+    std::copy_n(bytes_amount, host_nb * host_nb, simdata->bytes_parallel_amount);
+  }
 
   return task;
 }
@@ -304,5 +309,4 @@ void MSG_task_set_bound(msg_task_t task, double bound)
   if (task->simdata->compute)
     simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
 }
-
-SG_END_DECL()
+}
index 1829b63..126d3d8 100644 (file)
 
 #include <xbt/ex.hpp>
 
-#include "src/instr/instr_private.h"
-#include "src/msg/msg_private.h"
+#include "src/instr/instr_private.hpp"
+#include "src/msg/msg_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
 
 #include "simgrid/host.h"
 #include "simgrid/simix.hpp"
 
-SG_BEGIN_DECL()
+extern "C" {
 
-struct dirty_page {
+struct s_dirty_page {
   double prev_clock;
   double prev_remaining;
   msg_task_t task;
 };
-typedef struct dirty_page s_dirty_page;
-typedef struct dirty_page* dirty_page_t;
+typedef s_dirty_page* dirty_page_t;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg, "Cloud-oriented parts of the MSG API");
 
@@ -171,8 +170,8 @@ void MSG_vm_destroy(msg_vm_t vm)
   simgrid::simix::kernelImmediate([vm]() { vm->destroy(); });
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t container = PJ_container_get(vm->getCname());
-    PJ_container_remove_from_parent(container);
+    container_t container = simgrid::instr::Container::byName(vm->getName());
+    container->removeFromParent();
     delete container;
   }
 }
@@ -186,9 +185,9 @@ void MSG_vm_start(msg_vm_t vm)
 {
   vm->start();
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
-    simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("start", "0 0 1", type); // start is blue
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("start", "0 0 1", type); // start is blue
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
 }
@@ -242,7 +241,7 @@ static int migration_rx_fun(int argc, char *argv[])
   XBT_DEBUG("mig: rx_start");
 
   // The structure has been created in the do_migration function and should only be freed in the same place ;)
-  struct migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
+  migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
 
   bool received_finalize = false;
 
@@ -295,22 +294,22 @@ static int migration_rx_fun(int argc, char *argv[])
     counter++;
 
     // start link
-    container_t msg = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    container_t msg            = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     // destroy existing container of this vm
-    container_t existing_container = PJ_container_get(vm->getCname());
-    PJ_container_remove_from_parent(existing_container);
+    container_t existing_container = simgrid::instr::Container::byName(vm->getName());
+    existing_container->removeFromParent();
     delete existing_container;
 
     // create new container on the new_host location
     new simgrid::instr::Container(vm->getCname(), simgrid::instr::INSTR_MSG_VM,
-                                  PJ_container_get(ms->dst_pm->getCname()));
+                                  simgrid::instr::Container::byName(ms->dst_pm->getName()));
 
     // end link
-    msg  = PJ_container_get(vm->getCname());
-    type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    msg  = simgrid::instr::Container::byName(vm->getName());
+    type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
 
@@ -507,7 +506,7 @@ static int migration_tx_fun(int argc, char *argv[])
   XBT_DEBUG("mig: tx_start");
 
   // Note that the ms structure has been allocated in do_migration and hence should be freed in the same function ;)
-  migration_session *ms = static_cast<migration_session *>(MSG_process_get_data(MSG_process_self()));
+  migration_session* ms = static_cast<migration_session*>(MSG_process_get_data(MSG_process_self()));
 
   double host_speed = ms->vm->pimpl_vm_->getPm()->getSpeed();
   s_vm_params_t params;
@@ -706,7 +705,7 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
 
   vm->pimpl_vm_->isMigrating = true;
 
-  struct migration_session *ms = xbt_new(struct migration_session, 1);
+  migration_session* ms = xbt_new(migration_session, 1);
   ms->vm = vm;
   ms->src_pm = src_pm;
   ms->dst_pm = dst_pm;
@@ -769,9 +768,9 @@ void MSG_vm_suspend(msg_vm_t vm)
   XBT_DEBUG("vm_suspend done");
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
-    simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("suspend", "1 0 0", type); // suspend is red
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("suspend", "1 0 0", type); // suspend is red
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
 }
@@ -786,8 +785,8 @@ void MSG_vm_resume(msg_vm_t vm)
   vm->pimpl_vm_->resume();
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type);
   }
 }
@@ -830,5 +829,4 @@ void MSG_vm_set_bound(msg_vm_t vm, double bound)
 {
   simgrid::simix::kernelImmediate([vm, bound]() { vm->pimpl_vm_->setBound(bound); });
 }
-
-SG_END_DECL()
+}
index c300f94..f815594 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
@@ -174,7 +174,7 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
   if (getState() != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "Cannot suspend VM %s: it is not running.", piface_->getCname());
   if (issuer->host == piface_)
-    THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->cname(), piface_->getCname());
+    THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->getCname(), piface_->getCname());
 
   xbt_swag_t process_list = piface_->extension<simgrid::simix::Host>()->process_list;
   XBT_DEBUG("suspend VM(%s), where %d processes exist", piface_->getCname(), xbt_swag_size(process_list));
@@ -206,7 +206,7 @@ void VirtualMachineImpl::resume()
   smx_actor_t smx_process;
   smx_actor_t smx_process_safe;
   xbt_swag_foreach_safe(smx_process, smx_process_safe, process_list) {
-    XBT_DEBUG("resume %s", smx_process->cname());
+    XBT_DEBUG("resume %s", smx_process->getCname());
     smx_process->resume();
   }
 
@@ -247,8 +247,8 @@ void VirtualMachineImpl::shutdown(smx_actor_t issuer)
   smx_actor_t smx_process;
   smx_actor_t smx_process_safe;
   xbt_swag_foreach_safe(smx_process, smx_process_safe, process_list) {
-    XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process->cname(), smx_process->host->getCname(),
-              issuer->cname());
+    XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process->getCname(),
+              smx_process->host->getCname(), issuer->getCname());
     SIMIX_process_kill(smx_process, issuer);
   }
 
index 79c3aff..fbc0483 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -16,7 +16,7 @@
 #define GUESTOS_NOISE 100 // This value corresponds to the cost of the global action associated to the VM
                           // It corresponds to the cost of a VM running no tasks.
 
-typedef struct dirty_page* dirty_page_t;
+typedef struct s_dirty_page* dirty_page_t;
 
 namespace simgrid {
 namespace vm {
index 14c29fe..8e74223 100644 (file)
@@ -3,10 +3,10 @@
 /* This program 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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/cpu_cas01.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_vm, "S4U virtual machines");
@@ -32,7 +32,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm, int coreAmount)
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t host_container = PJ_container_get(pm->getCname());
+    container_t host_container = simgrid::instr::Container::byName(pm->getName());
     new simgrid::instr::Container(name, simgrid::instr::INSTR_MSG_VM, host_container);
   }
 }
index f3f5ab0..80f0c11 100644 (file)
@@ -11,7 +11,7 @@
 #include "simgrid/s4u/Mailbox.hpp"
 
 #include "src/kernel/context/Context.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #include <sstream>
 
@@ -85,14 +85,14 @@ void Actor::daemonize()
   simgrid::simix::kernelImmediate([this]() { pimpl_->daemonize(); });
 }
 
-const char* Actor::getCname()
+const simgrid::xbt::string& Actor::getName() const
 {
-  return this->pimpl_->name.c_str();
+  return this->pimpl_->getName();
 }
 
-simgrid::xbt::string Actor::getName()
+const char* Actor::getCname() const
 {
-  return this->pimpl_->name;
+  return this->pimpl_->getCname();
 }
 
 aid_t Actor::getPid()
@@ -269,7 +269,12 @@ aid_t getPpid()
 
 std::string getName()
 {
-  return SIMIX_process_self()->name;
+  return SIMIX_process_self()->getName();
+}
+
+const char* getCname()
+{
+  return SIMIX_process_self()->getCname();
 }
 
 Host* getHost()
index bfd0faa..f1f3135 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "src/msg/msg_private.hpp"
 #include "xbt/log.h"
-#include "src/msg/msg_private.h"
 
 #include "simgrid/s4u/Comm.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
index 07fa11b..39e5922 100644 (file)
@@ -32,11 +32,11 @@ Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see
 
 Engine::Engine(int *argc, char **argv) {
   xbt_assert(s4u::Engine::instance_ == nullptr, "It is currently forbidden to create more than one instance of s4u::Engine");
-  s4u::Engine::instance_ = this;
-  pimpl                  = new kernel::EngineImpl();
-
   TRACE_global_init();
   SIMIX_global_init(argc, argv);
+
+  pimpl                  = new kernel::EngineImpl();
+  s4u::Engine::instance_ = this;
 }
 
 Engine::~Engine()
@@ -48,12 +48,14 @@ Engine::~Engine()
 Engine* Engine::getInstance()
 {
   if (s4u::Engine::instance_ == nullptr)
-    new Engine(0,nullptr);
-  return s4u::Engine::instance_;
+    return new Engine(0, nullptr);
+  else
+    return s4u::Engine::instance_;
 }
 
 void Engine::shutdown() {
   delete s4u::Engine::instance_;
+  s4u::Engine::instance_ = nullptr;
 }
 
 double Engine::getClock()
@@ -141,15 +143,15 @@ void Engine::getNetpointList(std::vector<simgrid::kernel::routing::NetPoint*>* l
 /** @brief Register a new netpoint to the system */
 void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
 {
-//  simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
-  pimpl->netpoints_[point->name()] = point;
-//  });
+  // simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
+  pimpl->netpoints_[point->getName()] = point;
+  // });
 }
 /** @brief Unregister a given netpoint */
 void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
 {
   simgrid::simix::kernelImmediate([this, point] {
-    pimpl->netpoints_.erase(point->name());
+    pimpl->netpoints_.erase(point->getName());
     delete point;
   });
 }
index 763fe98..b4245ed 100644 (file)
@@ -14,9 +14,9 @@
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "xbt/log.h"
@@ -169,7 +169,7 @@ void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>* links, double* late
     XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", getCname(), dest->getCname(),
                (latency == nullptr ? -1 : *latency));
     for (auto const& link : *links)
-      XBT_CDEBUG(surf_route, "Link %s", link->cname());
+      XBT_CDEBUG(surf_route, "Link %s", link->getCname());
   }
 }
 
index 24561ff..c640077 100644 (file)
@@ -21,7 +21,7 @@ extern "C" {
 
 const char* sg_link_name(sg_link_t link)
 {
-  return link->name();
+  return link->getCname();
 }
 sg_link_t sg_link_by_name(const char* name)
 {
@@ -82,9 +82,17 @@ Link* Link::byName(const char* name)
     return nullptr;
   return &res->piface_;
 }
+const std::string& Link::getName() const
+{
+  return this->pimpl_->getName();
+}
+const char* Link::getCname() const
+{
+  return this->pimpl_->getCname();
+}
 const char* Link::name()
 {
-  return this->pimpl_->cname();
+  return getCname();
 }
 bool Link::isUsed()
 {
index 245bd53..32ab0bb 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "simgrid/s4u/Comm.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
-#include "src/simix/smx_network_private.h"
+#include "src/simix/smx_network_private.hpp"
 #include "xbt/log.h"
 
 XBT_LOG_EXTERNAL_CATEGORY(s4u);
@@ -16,9 +16,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_channel,s4u,"S4U Communication Mailboxes");
 namespace simgrid {
 namespace s4u {
 
-const char* Mailbox::getName()
+const simgrid::xbt::string& Mailbox::getName() const
 {
-  return pimpl_->name_;
+  return pimpl_->getName();
+}
+
+const char* Mailbox::getCname() const
+{
+  return pimpl_->getCname();
 }
 
 MailboxPtr Mailbox::byName(const char*name)
index 5e63f24..7e0e852 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/simix/smx_synchro_private.hpp"
 #include "xbt/log.h"
 
index 0dc3a43..2675596 100644 (file)
@@ -63,7 +63,7 @@ std::vector<NetZone*>* NetZone::getChildren()
 {
   return children_;
 }
-const char* NetZone::getCname()
+const char* NetZone::getCname() const
 {
   return name_.c_str();
 }
@@ -75,7 +75,7 @@ NetZone* NetZone::getFather()
 void NetZone::getHosts(std::vector<s4u::Host*>* whereto)
 {
   for (auto const& card : vertices_) {
-    s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name());
+    s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->getName());
     if (host != nullptr)
       whereto->push_back(host);
   }
index 092afea..c3066bd 100644 (file)
@@ -30,9 +30,14 @@ Storage* Storage::byName(std::string name)
   return &res->piface_;
 }
 
-const char* Storage::getName()
+const std::string& Storage::getName() const
 {
-  return pimpl_->cname();
+  return pimpl_->getName();
+}
+
+const char* Storage::getCname() const
+{
+  return pimpl_->getCname();
 }
 
 const char* Storage::getType()
index 978bb6b..84b9b74 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2016. The SimGrid Team.
+/* Copyright (c) 2006-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,6 +7,7 @@
 #include "simdag_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/surf_interface.hpp"
+#include <algorithm>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_task, sd, "Logging specific to SimDag (task)");
 
@@ -798,20 +799,16 @@ void SD_task_run(SD_task_t task)
 
   /* Copy the elements of the task into the action */
   int host_nb = task->allocation->size();
-  sg_host_t *hosts = xbt_new(sg_host_t, host_nb);
-  int i =0;
-  for (auto const& host : *task->allocation) {
-    hosts[i] = host;
-    i++;
-  }
+  sg_host_t* hosts = new sg_host_t[host_nb];
+  std::copy_n(task->allocation->begin(), host_nb, hosts);
 
-  double *flops_amount = xbt_new0(double, host_nb);
-  double *bytes_amount = xbt_new0(double, host_nb * host_nb);
+  double* flops_amount = new double[host_nb]();
+  double* bytes_amount = new double[host_nb * host_nb]();
 
   if(task->flops_amount)
-    memcpy(flops_amount, task->flops_amount, sizeof(double) * host_nb);
+    std::copy_n(task->flops_amount, host_nb, flops_amount);
   if(task->bytes_amount)
-    memcpy(bytes_amount, task->bytes_amount, sizeof(double) * host_nb * host_nb);
+    std::copy_n(task->bytes_amount, host_nb * host_nb, bytes_amount);
 
   task->surf_action = surf_host_model->executeParallelTask(host_nb, hosts, flops_amount, bytes_amount, task->rate);
 
@@ -973,12 +970,12 @@ void SD_task_schedulev(SD_task_t task, int count, const sg_host_t * list)
 void SD_task_schedulel(SD_task_t task, int count, ...)
 {
   va_list ap;
-  sg_host_t *list = xbt_new(sg_host_t, count);
+  sg_host_t* list = new sg_host_t[count];
   va_start(ap, count);
   for (int i=0; i<count; i++)
     list[i] = va_arg(ap, sg_host_t);
 
   va_end(ap);
   SD_task_schedulev(task, count, list);
-  xbt_free(list);
+  delete[] list;
 }
index b5e52f0..6b14965 100644 (file)
@@ -34,11 +34,11 @@ std::set<SD_task_t>* simulate (double how_long);
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
 
 /* Task */
-typedef struct SD_task {
+struct s_SD_task_t {
   e_SD_task_state_t state;
   void *data;                   /* user data */
   char *name;
@@ -63,7 +63,7 @@ typedef struct SD_task {
   double *flops_amount;
   double *bytes_amount;
   double rate;
-} s_SD_task_t;
+};
 
 /* SimDag private functions */
 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
@@ -71,5 +71,5 @@ XBT_PRIVATE void SD_task_run(SD_task_t task);
 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
-SG_END_DECL()
+}
 #endif
index 3d528ae..5b709b4 100644 (file)
@@ -12,7 +12,7 @@
 #include "xbt/dict.h"
 
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 
@@ -126,7 +126,7 @@ xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){
   for (auto const& elm : host->getMountedStorages()) {
     const char* mount_name = elm.first.c_str();
     sg_storage_t storage   = elm.second;
-    xbt_dict_set(res, mount_name, (void*)storage->getName(), nullptr);
+    xbt_dict_set(res, mount_name, (void*)storage->getCname(), nullptr);
   }
 
   return res;
index 0c10cd4..752cf85 100644 (file)
@@ -6,22 +6,22 @@
 
 /* sg_config: configuration infrastructure for the simulation world       */
 
-#include "xbt/misc.h"
-#include "xbt/config.h"
-#include "xbt/config.hpp"
-#include "xbt/log.h"
-#include "xbt/mallocator.h"
-#include "xbt/sysdep.h"
-#include "surf/surf.h"
-#include "surf/maxmin.h"
-#include "instr/instr_interface.h"
-#include "simgrid/simix.h"
 #include "simgrid/sg_config.h"
-#include "simgrid_config.h" /* what was compiled in? */
+#include "instr/instr_interface.h"
 #include "mc/mc.h"
 #include "simgrid/instr.h"
+#include "simgrid/simix.h"
+#include "simgrid_config.h" /* what was compiled in? */
 #include "src/mc/mc_replay.h"
 #include "src/surf/surf_interface.hpp"
+#include "surf/maxmin.hpp"
+#include "surf/surf.h"
+#include "xbt/config.h"
+#include "xbt/config.hpp"
+#include "xbt/log.h"
+#include "xbt/mallocator.h"
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of SimGrid");
 
index 49d14cb..40e0f17 100644 (file)
 
 #include "mc/mc.h"
 
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/SleepImpl.hpp"
 #include "src/kernel/activity/SynchroIo.hpp"
 #include "src/kernel/activity/SynchroRaw.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/mc/remote/Client.hpp"
-#include "src/msg/msg_private.h"
+#include "src/msg/msg_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 
@@ -169,7 +169,7 @@ void ActorImpl::daemonize()
 
 simgrid::s4u::Actor* ActorImpl::restart()
 {
-  XBT_DEBUG("Restarting process %s on %s", cname(), host->getCname());
+  XBT_DEBUG("Restarting process %s on %s", getCname(), host->getCname());
 
   // retrieve the arguments of the old process
   // FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
@@ -346,12 +346,12 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
 
   /* Now insert it in the global process list and in the process to run list */
   simix_global->process_list[process->pid] = process;
-  XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->getCname());
+  XBT_DEBUG("Inserting %s(%s) in the to_run list", process->getCname(), host->getCname());
   simix_global->process_to_run.push_back(process);
   intrusive_ptr_add_ref(process);
 
   /* Tracing the process creation */
-  TRACE_msg_process_create(process->cname(), process->pid, process->host);
+  TRACE_msg_process_create(process->getCname(), process->pid, process->host);
 
   return process;
 }
@@ -410,11 +410,11 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
 
   /* Now insert it in the global process list and in the process to run list */
   simix_global->process_list[process->pid] = process;
-  XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->getCname());
+  XBT_DEBUG("Inserting %s(%s) in the to_run list", process->getCname(), host->getCname());
   simix_global->process_to_run.push_back(process);
 
   /* Tracing the process creation */
-  TRACE_msg_process_create(process->cname(), process->pid, process->host);
+  TRACE_msg_process_create(process->getCname(), process->pid, process->host);
 
   auto context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
   if (not context)
@@ -464,7 +464,7 @@ void SIMIX_process_runall()
  */
 void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
 
-  XBT_DEBUG("Killing process %s@%s", process->cname(), process->host->getCname());
+  XBT_DEBUG("Killing process %s@%s", process->getCname(), process->host->getCname());
 
   process->context->iwannadie = 1;
   process->blocked = 0;
@@ -718,7 +718,7 @@ void SIMIX_process_sleep_destroy(smx_activity_t synchro)
  */
 void SIMIX_process_yield(smx_actor_t self)
 {
-  XBT_DEBUG("Yield actor '%s'", self->cname());
+  XBT_DEBUG("Yield actor '%s'", self->getCname());
 
   /* Go into sleep and return control to maestro */
   self->context->suspend();
@@ -738,11 +738,11 @@ void SIMIX_process_yield(smx_actor_t self)
     SIMIX_process_on_exit_runall(self);
     /* Add the process to the list of process to restart, only if the host is down */
     if (self->auto_restart && self->host->isOff()) {
-      SIMIX_host_add_auto_restart_process(self->host, self->cname(), self->code, self->userdata,
+      SIMIX_host_add_auto_restart_process(self->host, self->getCname(), self->code, self->userdata,
                                           SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
                                           self->auto_restart);
     }
-    XBT_DEBUG("Process %s@%s is dead", self->cname(), self->host->getCname());
+    XBT_DEBUG("Process %s@%s is dead", self->getCname(), self->host->getCname());
     self->context->stop();
   }
 
index dcdea7a..cbe2eb9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,16 +7,16 @@
 #define SIMIX_ACTORIMPL_H
 
 #include "simgrid/s4u/Actor.hpp"
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "xbt/swag.h"
 #include <list>
 #include <map>
 
-typedef struct s_smx_process_exit_fun {
+struct s_smx_process_exit_fun_t {
   int_f_pvoid_pvoid_t fun;
   void *arg;
-} s_smx_process_exit_fun_t;
+};
 typedef s_smx_process_exit_fun_t* smx_process_exit_fun_t;
 
 namespace simgrid {
@@ -47,7 +47,8 @@ public:
   aid_t pid  = 0;
   aid_t ppid = -1;
   simgrid::xbt::string name;
-  const char* cname() { return name.c_str(); }
+  const simgrid::xbt::string& getName() const { return name; }
+  const char* getCname() const { return name.c_str(); }
   s4u::Host* host       = nullptr; /* the host on which the process is running */
   smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
 
@@ -122,7 +123,7 @@ typedef simgrid::simix::ProcessArg *smx_process_arg_t;
 
 typedef simgrid::simix::ActorImpl* smx_actor_t;
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
                                              std::map<std::string, std::string>* properties,
@@ -142,8 +143,7 @@ XBT_PRIVATE smx_actor_t SIMIX_process_get_by_name(const char* name);
 XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
 
 extern void (*SMPI_switch_data_segment)(int dest);
-
-SG_END_DECL()
+}
 
 XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
 XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, double timeout);
index b26dcb7..6ba3e71 100644 (file)
@@ -5,7 +5,7 @@
 /*                                                                            */
 /* This is somehow the "libc" of SimGrid                                      */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include "simgrid/s4u/VirtualMachine.hpp"
 #include "simgrid/simix.hpp"
 #include "simgrid/simix/blocking_simcall.hpp"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include "src/simix/smx_host_private.h"
+#include "src/simix/smx_host_private.hpp"
 #include "xbt/ex.h"
 #include "xbt/functional.hpp"
 
@@ -35,7 +35,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
 void simcall_call(smx_actor_t actor)
 {
   if (actor != simix_global->maestro_process) {
-    XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->cname(), SIMIX_simcall_name(actor->simcall.call),
+    XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->getCname(), SIMIX_simcall_name(actor->simcall.call),
               (int)actor->simcall.call);
     SIMIX_process_yield(actor);
   } else {
@@ -242,7 +242,7 @@ void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 
   if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
     return;
-  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->cname(), process->host->getCname());
+  XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->getCname(), process->host->getCname());
   process->kill_timer = SIMIX_timer_set(kill_time, [process] {
     simix_global->kill_process_function(process);
     process->kill_timer=nullptr;
index 6210e32..2672a4a 100644 (file)
@@ -3,10 +3,10 @@
 /* This program 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 "smx_private.hpp"
 #include "xbt/xbt_os_thread.h"
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #endif
 
 #include "src/kernel/activity/CommImpl.hpp"
similarity index 91%
rename from src/simix/popping_accessors.h
rename to src/simix/popping_accessors.hpp
index a101a80..3201a9e 100644 (file)
@@ -14,7 +14,7 @@
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
-#include "src/simix/popping_private.h"
+#include "src/simix/popping_private.hpp"
 static inline int simcall_process_killall__get__reset_pid(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<int>(simcall->args[0]);
@@ -86,8 +86,9 @@ static inline int simcall_process_join__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall)
@@ -110,8 +111,9 @@ static inline int simcall_process_sleep__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline const char* simcall_execution_start__get__name(smx_simcall_t simcall)
@@ -162,8 +164,7 @@ static inline void simcall_execution_start__set__bound(smx_simcall_t simcall, do
 {
   simgrid::simix::marshal<double>(simcall->args[3], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-simcall_execution_start__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_execution_start__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result);
 }
@@ -171,9 +172,7 @@ static inline simgrid::kernel::activity::ExecImpl* simcall_execution_start__getr
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->result);
 }
-static inline void
-simcall_execution_start__set__result(smx_simcall_t simcall,
-                                     boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
+static inline void simcall_execution_start__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, result);
 }
@@ -262,25 +261,20 @@ static inline void simcall_execution_parallel_start__set__timeout(smx_simcall_t
 {
   simgrid::simix::marshal<double>(simcall->args[6], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_execution_parallel_start__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result);
 }
-static inline simgrid::kernel::activity::ExecImpl*
-simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl* simcall_execution_parallel_start__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->result);
 }
-static inline void
-simcall_execution_parallel_start__set__result(smx_simcall_t simcall,
-                                              boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
+static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_wait__get__execution(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_execution_wait__get__execution(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
@@ -288,9 +282,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_execution_wait__g
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void
-simcall_execution_wait__set__execution(smx_simcall_t simcall,
-                                       boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
@@ -302,8 +294,9 @@ static inline int simcall_execution_wait__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall)
@@ -391,8 +384,7 @@ static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* a
 {
   simgrid::simix::marshal<void*>(simcall->args[3], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_iprobe__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_comm_iprobe__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
 }
@@ -400,9 +392,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_iprobe__getr
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void
-simcall_comm_iprobe__set__result(smx_simcall_t simcall,
-                                 boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
@@ -660,8 +650,7 @@ static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int
 {
   simgrid::simix::marshal<int>(simcall->args[10], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_isend__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_comm_isend__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
 }
@@ -669,8 +658,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getra
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_isend__set__result(smx_simcall_t simcall,
-                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
@@ -880,8 +868,7 @@ static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double a
 {
   simgrid::simix::marshal<double>(simcall->args[7], arg);
 }
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_irecv__get__result(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_comm_irecv__get__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
 }
@@ -889,8 +876,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getra
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
 }
-static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall,
-                                                   boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
+static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> result)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
 }
@@ -927,12 +913,12 @@ static inline int simcall_comm_waitany__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_comm_waitany__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_comm_waitany__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_wait__get__comm(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_comm_wait__get__comm(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
@@ -940,8 +926,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_wait__getraw
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall,
-                                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
@@ -958,8 +943,7 @@ static inline void simcall_comm_wait__set__timeout(smx_simcall_t simcall, double
   simgrid::simix::marshal<double>(simcall->args[1], arg);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_comm_test__get__comm(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_comm_test__get__comm(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
@@ -967,8 +951,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_test__getraw
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_comm_test__set__comm(smx_simcall_t simcall,
-                                                boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
@@ -980,12 +963,12 @@ static inline int simcall_comm_test__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_comm_test__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_comm_test__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*
-simcall_comm_testany__get__comms(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* simcall_comm_testany__get__comms(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]);
 }
@@ -993,8 +976,7 @@ static inline simgrid::kernel::activity::ActivityImpl** simcall_comm_testany__ge
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl**>(simcall->args[0]);
 }
-static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall,
-                                                    boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* arg)
+static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* arg)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0], arg);
 }
@@ -1018,8 +1000,9 @@ static inline int simcall_comm_testany__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_comm_testany__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
@@ -1055,8 +1038,9 @@ static inline int simcall_mutex_trylock__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_mutex_trylock__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
 static inline smx_mutex_t simcall_mutex_unlock__get__mutex(smx_simcall_t simcall)
@@ -1080,8 +1064,9 @@ static inline smx_cond_t simcall_cond_init__getraw__result(smx_simcall_t simcall
 {
   return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->result);
 }
-static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_cond_t result){
-    simgrid::simix::marshal<smx_cond_t>(simcall->result, result);
+static inline void simcall_cond_init__set__result(smx_simcall_t simcall, smx_cond_t result)
+{
+  simgrid::simix::marshal<smx_cond_t>(simcall->result, result);
 }
 
 static inline smx_cond_t simcall_cond_signal__get__cond(smx_simcall_t simcall)
@@ -1242,8 +1227,9 @@ static inline sg_size_t simcall_file_read__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
 }
-static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size_t result){
-    simgrid::simix::marshal<sg_size_t>(simcall->result, result);
+static inline void simcall_file_read__set__result(smx_simcall_t simcall, sg_size_t result)
+{
+  simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
 static inline surf_file_t simcall_file_write__get__fd(smx_simcall_t simcall)
@@ -1278,8 +1264,9 @@ static inline sg_size_t simcall_file_write__getraw__result(smx_simcall_t simcall
 {
   return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
 }
-static inline void simcall_file_write__set__result(smx_simcall_t simcall, sg_size_t result){
-    simgrid::simix::marshal<sg_size_t>(simcall->result, result);
+static inline void simcall_file_write__set__result(smx_simcall_t simcall, sg_size_t result)
+{
+  simgrid::simix::marshal<sg_size_t>(simcall->result, result);
 }
 
 static inline int simcall_mc_random__get__min(smx_simcall_t simcall)
@@ -1314,12 +1301,12 @@ static inline int simcall_mc_random__getraw__result(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal_raw<int>(simcall->result);
 }
-static inline void simcall_mc_random__set__result(smx_simcall_t simcall, int result){
-    simgrid::simix::marshal<int>(simcall->result, result);
+static inline void simcall_mc_random__set__result(smx_simcall_t simcall, int result)
+{
+  simgrid::simix::marshal<int>(simcall->result, result);
 }
 
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_set_category__get__synchro(smx_simcall_t simcall)
+static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_set_category__get__synchro(smx_simcall_t simcall)
 {
   return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
 }
@@ -1327,8 +1314,7 @@ static inline simgrid::kernel::activity::ActivityImpl* simcall_set_category__get
 {
   return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
 }
-static inline void simcall_set_category__set__synchro(smx_simcall_t simcall,
-                                                      boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
+static inline void simcall_set_category__set__synchro(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
 {
   simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
 }
@@ -1377,35 +1363,17 @@ XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall, int rese
 XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t process);
 XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout);
 XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
-XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority,
-                                double bound);
-XBT_PRIVATE void
-simcall_HANDLER_execution_wait(smx_simcall_t simcall,
-                               boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
-XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun,
-                            void* data);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound);
+XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
 XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
-XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate,
-                           void* src_buff, size_t src_buff_size, simix_match_func_t match_fun,
-                           simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data,
-                           int detached);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
 XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
-XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff,
-                           size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun,
-                           void* data, double rate);
+XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
 XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall,
-                                           boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
-                                           double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall,
-                                           boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm);
-XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall,
-                                              boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
-                                              size_t count);
+XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm, double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm);
+XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count);
 XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
 XBT_PRIVATE void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex);
index 4f3e9a7..f942251 100644 (file)
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
-#include <functional>
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "xbt/ex.h"
+#include <functional>
 #include <simgrid/simix.hpp>
 /** @cond */ // Please Doxygen, don't look at this
 
@@ -36,247 +36,240 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
   return simgrid::simix::unmarshal<R>(self->simcall.result);
 }
 
-inline static void simcall_BODY_process_killall(int reset_pid) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall, reset_pid);
-    return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
-  }
+inline static void simcall_BODY_process_killall(int reset_pid)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_killall(&SIMIX_process_self()->simcall, reset_pid);
+  return simcall<void, int>(SIMCALL_PROCESS_KILLALL, reset_pid);
+}
 
-inline static void simcall_BODY_process_cleanup(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_cleanup(process);
-    return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
-  }
+inline static void simcall_BODY_process_cleanup(smx_actor_t process)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_process_cleanup(process);
+  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_CLEANUP, process);
+}
 
-inline static void simcall_BODY_process_suspend(smx_actor_t process) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
-    return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
-  }
+inline static void simcall_BODY_process_suspend(smx_actor_t process)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
+  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
+}
 
-inline static int simcall_BODY_process_join(smx_actor_t process, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
-    return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
-  }
+inline static int simcall_BODY_process_join(smx_actor_t process, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_join(&SIMIX_process_self()->simcall, process, timeout);
+  return simcall<int, smx_actor_t, double>(SIMCALL_PROCESS_JOIN, process, timeout);
+}
 
-inline static int simcall_BODY_process_sleep(double duration) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_process_sleep(&SIMIX_process_self()->simcall, duration);
-    return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
-  }
+inline static int simcall_BODY_process_sleep(double duration)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_process_sleep(&SIMIX_process_self()->simcall, duration);
+  return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-  simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, double, double, double>(
-        SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, double, double, double>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
-  simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount,
-                                        double* bytes_amount, double rate, double timeout)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, int, sg_host_t*, double*,
-                   double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount,
-                                            bytes_amount, rate, timeout);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>, const char*, int, sg_host_t*, double*, double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
+}
 
-  inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
-    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_WAIT,
-                                                                                       execution);
-  }
+inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
+  return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_WAIT, execution);
+}
 
-inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_process_on_exit(process, fun, data);
-    return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
-  }
+inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_process_on_exit(process, fun, data);
+  return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-  simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, match_fun, data);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int,
-                   simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, match_fun, data);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, match_fun, data);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_mailbox_t, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, match_fun, data);
+}
 
-inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
-    return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
-  }
+inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_send(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
+  return simcall<void, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-  simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff,
-                          size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun,
-                          simix_copy_data_func_t copy_data_fun, void* data, int detached)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, double,
-                   double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(
-        SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun,
-        data, detached);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+}
 
-inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
-    return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
-  }
+inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_recv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
+  return simcall<void, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
+}
 
-  inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-  simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
-                          simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
-    return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, void*,
-                   size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(
-        SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
-  }
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+}
 
-inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout);
-    return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
-  }
+inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_waitany(&SIMIX_process_self()->simcall, comms, timeout);
+  return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
+}
 
-  inline static void simcall_BODY_comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm,
-                                            double timeout)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
-    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(SIMCALL_COMM_WAIT, comm,
-                                                                                                timeout);
-  }
+inline static void simcall_BODY_comm_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
+  return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(SIMCALL_COMM_WAIT, comm, timeout);
+}
 
-  inline static int simcall_BODY_comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
-    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
-  }
+inline static int simcall_BODY_comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
+  return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_COMM_TEST, comm);
+}
 
-  inline static int simcall_BODY_comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
-                                              size_t count)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
-    return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY,
-                                                                                                comms, count);
-  }
+inline static int simcall_BODY_comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
+  return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
+}
 
-inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_LOCK, mutex);
-  }
+inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_LOCK, mutex);
+}
 
-inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_trylock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<int, smx_mutex_t>(SIMCALL_MUTEX_TRYLOCK, mutex);
-  }
+inline static int simcall_BODY_mutex_trylock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_trylock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<int, smx_mutex_t>(SIMCALL_MUTEX_TRYLOCK, mutex);
+}
 
-inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mutex_unlock(&SIMIX_process_self()->simcall, mutex);
-    return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
-  }
+inline static void simcall_BODY_mutex_unlock(smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mutex_unlock(&SIMIX_process_self()->simcall, mutex);
+  return simcall<void, smx_mutex_t>(SIMCALL_MUTEX_UNLOCK, mutex);
+}
 
-inline static smx_cond_t simcall_BODY_cond_init() {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_init();
-    return simcall<smx_cond_t>(SIMCALL_COND_INIT);
-  }
+inline static smx_cond_t simcall_BODY_cond_init()
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_init();
+  return simcall<smx_cond_t>(SIMCALL_COND_INIT);
+}
 
-inline static void simcall_BODY_cond_signal(smx_cond_t cond) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_signal(cond);
-    return simcall<void, smx_cond_t>(SIMCALL_COND_SIGNAL, cond);
-  }
+inline static void simcall_BODY_cond_signal(smx_cond_t cond)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_signal(cond);
+  return simcall<void, smx_cond_t>(SIMCALL_COND_SIGNAL, cond);
+}
 
-inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall, cond, mutex);
-    return simcall<void, smx_cond_t, smx_mutex_t>(SIMCALL_COND_WAIT, cond, mutex);
-  }
+inline static void simcall_BODY_cond_wait(smx_cond_t cond, smx_mutex_t mutex)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_cond_wait(&SIMIX_process_self()->simcall, cond, mutex);
+  return simcall<void, smx_cond_t, smx_mutex_t>(SIMCALL_COND_WAIT, cond, mutex);
+}
 
-inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_cond_wait_timeout(&SIMIX_process_self()->simcall, cond, mutex, timeout);
-    return simcall<void, smx_cond_t, smx_mutex_t, double>(SIMCALL_COND_WAIT_TIMEOUT, cond, mutex, timeout);
-  }
+inline static void simcall_BODY_cond_wait_timeout(smx_cond_t cond, smx_mutex_t mutex, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_cond_wait_timeout(&SIMIX_process_self()->simcall, cond, mutex, timeout);
+  return simcall<void, smx_cond_t, smx_mutex_t, double>(SIMCALL_COND_WAIT_TIMEOUT, cond, mutex, timeout);
+}
 
-inline static void simcall_BODY_cond_broadcast(smx_cond_t cond) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_cond_broadcast(cond);
-    return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
-  }
+inline static void simcall_BODY_cond_broadcast(smx_cond_t cond)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_cond_broadcast(cond);
+  return simcall<void, smx_cond_t>(SIMCALL_COND_BROADCAST, cond);
+}
 
-inline static void simcall_BODY_sem_acquire(smx_sem_t sem) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_acquire(&SIMIX_process_self()->simcall, sem);
-    return simcall<void, smx_sem_t>(SIMCALL_SEM_ACQUIRE, sem);
-  }
+inline static void simcall_BODY_sem_acquire(smx_sem_t sem)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_sem_acquire(&SIMIX_process_self()->simcall, sem);
+  return simcall<void, smx_sem_t>(SIMCALL_SEM_ACQUIRE, sem);
+}
 
-inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_sem_acquire_timeout(&SIMIX_process_self()->simcall, sem, timeout);
-    return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
-  }
+inline static void simcall_BODY_sem_acquire_timeout(smx_sem_t sem, double timeout)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_sem_acquire_timeout(&SIMIX_process_self()->simcall, sem, timeout);
+  return simcall<void, smx_sem_t, double>(SIMCALL_SEM_ACQUIRE_TIMEOUT, sem, timeout);
+}
 
-  inline static sg_size_t simcall_BODY_file_read(surf_file_t fd, sg_size_t size)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size);
-    return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_READ, fd, size);
-  }
+inline static sg_size_t simcall_BODY_file_read(surf_file_t fd, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_file_read(&SIMIX_process_self()->simcall, fd, size);
+  return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_READ, fd, size);
+}
 
-  inline static sg_size_t simcall_BODY_file_write(surf_file_t fd, sg_size_t size)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0)
-      simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size);
-    return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_WRITE, fd, size);
-  }
+inline static sg_size_t simcall_BODY_file_write(surf_file_t fd, sg_size_t size)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_file_write(&SIMIX_process_self()->simcall, fd, size);
+  return simcall<sg_size_t, surf_file_t, sg_size_t>(SIMCALL_FILE_WRITE, fd, size);
+}
 
-inline static int simcall_BODY_mc_random(int min, int max) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) simcall_HANDLER_mc_random(&SIMIX_process_self()->simcall, min, max);
-    return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
-  }
+inline static int simcall_BODY_mc_random(int min, int max)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    simcall_HANDLER_mc_random(&SIMIX_process_self()->simcall, min, max);
+  return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
+}
 
-  inline static void simcall_BODY_set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro,
-                                               const char* category)
-  {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_set_category(synchro, category);
-    return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*>(
-        SIMCALL_SET_CATEGORY, synchro, category);
-  }
+inline static void simcall_BODY_set_category(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> synchro, const char* category)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_set_category(synchro, category);
+  return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
+}
 
-inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_run_kernel(code);
-    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
-  }
+inline static void simcall_BODY_run_kernel(std::function<void()> const* code)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_run_kernel(code);
+  return simcall<void, std::function<void()> const*>(SIMCALL_RUN_KERNEL, code);
+}
 
-inline static void simcall_BODY_run_blocking(std::function<void()> const* code) {
-    /* Go to that function to follow the code flow through the simcall barrier */
-    if (0) SIMIX_run_blocking(code);
-    return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);
-  }/** @endcond */
+inline static void simcall_BODY_run_blocking(std::function<void()> const* code)
+{
+  if (0) /* Go to that function to follow the code flow through the simcall barrier */
+    SIMIX_run_blocking(code);
+  return simcall<void, std::function<void()> const*>(SIMCALL_RUN_BLOCKING, code);
+} /** @endcond */
index 7f4fc93..dfed3e3 100644 (file)
@@ -14,8 +14,8 @@
  * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :)
  */
 
+#include "smx_private.hpp"
 #include <xbt/base.h>
-#include "smx_private.h"
 #if SIMGRID_HAVE_MC
 #include "src/mc/mc_forward.hpp"
 #endif
@@ -73,203 +73,156 @@ void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
     return;
   switch (simcall->call) {
 case SIMCALL_PROCESS_KILLALL:
-      simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simcall_HANDLER_process_killall(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_PROCESS_CLEANUP:
-      SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_process_cleanup(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_PROCESS_SUSPEND:
-      simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_process_suspend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_PROCESS_JOIN:
-      simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_process_join(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_PROCESS_SLEEP:
-      simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
-      break;
+  simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
+  break;
 
 case SIMCALL_EXECUTION_START:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
-      simcall->result,
-      simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]),
-                                      simgrid::simix::unmarshal<double>(simcall->args[1]),
-                                      simgrid::simix::unmarshal<double>(simcall->args[2]),
-                                      simgrid::simix::unmarshal<double>(simcall->args[3])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_EXECUTION_PARALLEL_START:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(
-      simcall->result,
-      SIMIX_execution_parallel_start(
-          simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]),
-          simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]),
-          simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]),
-          simgrid::simix::unmarshal<double>(simcall->args[6])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, SIMIX_execution_parallel_start(simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]), simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]), simgrid::simix::unmarshal<double>(simcall->args[6])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_EXECUTION_WAIT:
-  simcall_HANDLER_execution_wait(
-      simcall,
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
   break;
 
 case SIMCALL_PROCESS_ON_EXIT:
-      SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COMM_IPROBE:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
-      simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]),
-                                                   simgrid::simix::unmarshal<int>(simcall->args[1]),
-                                                   simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[2]),
-                                                   simgrid::simix::unmarshal<void*>(simcall->args[3])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[2]), simgrid::simix::unmarshal<void*>(simcall->args[3])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_COMM_SEND:
-      simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
-      break;
+  simcall_HANDLER_comm_send(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]), simgrid::simix::unmarshal<void*>(simcall->args[8]), simgrid::simix::unmarshal<double>(simcall->args[9]));
+  break;
 
 case SIMCALL_COMM_ISEND:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
-      simcall->result,
-      simcall_HANDLER_comm_isend(
-          simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
-          simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
-          simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]),
-          simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]),
-          simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]),
-          simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]),
-          simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]),
-          simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_COMM_RECV:
-      simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
-      break;
+  simcall_HANDLER_comm_recv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7]), simgrid::simix::unmarshal<double>(simcall->args[8]));
+  break;
 
 case SIMCALL_COMM_IRECV:
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(
-      simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]),
-                                                  simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]),
-                                                  simgrid::simix::unmarshal<void*>(simcall->args[2]),
-                                                  simgrid::simix::unmarshal<size_t*>(simcall->args[3]),
-                                                  simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]),
-                                                  simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]),
-                                                  simgrid::simix::unmarshal<void*>(simcall->args[6]),
-                                                  simgrid::simix::unmarshal<double>(simcall->args[7])));
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_COMM_WAITANY:
-      simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_comm_waitany(simcall, simgrid::simix::unmarshal<xbt_dynar_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_COMM_WAIT:
-  simcall_HANDLER_comm_wait(
-      simcall,
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
-      simgrid::simix::unmarshal<double>(simcall->args[1]));
+  simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
   break;
 
 case SIMCALL_COMM_TEST:
-  simcall_HANDLER_comm_test(
-      simcall,
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
+  simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
   break;
 
 case SIMCALL_COMM_TESTANY:
-  simcall_HANDLER_comm_testany(
-      simcall,
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]),
-      simgrid::simix::unmarshal<size_t>(simcall->args[1]));
+  simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>*>(simcall->args[0]), simgrid::simix::unmarshal<size_t>(simcall->args[1]));
   break;
 
 case SIMCALL_MUTEX_LOCK:
-      simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_MUTEX_TRYLOCK:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mutex_trylock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_MUTEX_UNLOCK:
-      simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_INIT:
-      simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<smx_cond_t>(simcall->result, SIMIX_cond_init());
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_SIGNAL:
-      SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_cond_signal(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_COND_WAIT:
-      simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
-      break;
+  simcall_HANDLER_cond_wait(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]));
+  break;
 
 case SIMCALL_COND_WAIT_TIMEOUT:
-      simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
-      break;
+  simcall_HANDLER_cond_wait_timeout(simcall, simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
+  break;
 
 case SIMCALL_COND_BROADCAST:
-      SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_cond_broadcast(simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_SEM_ACQUIRE:
-      simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
-      break;
+  simcall_HANDLER_sem_acquire(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]));
+  break;
 
 case SIMCALL_SEM_ACQUIRE_TIMEOUT:
-      simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
-      break;
+  simcall_HANDLER_sem_acquire_timeout(simcall, simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+  break;
 
 case SIMCALL_FILE_READ:
-  simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
-                            simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
+  simcall_HANDLER_file_read(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
   break;
 
 case SIMCALL_FILE_WRITE:
-  simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]),
-                             simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
+  simcall_HANDLER_file_write(simcall, simgrid::simix::unmarshal<surf_file_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_size_t>(simcall->args[1]));
   break;
 
 case SIMCALL_MC_RANDOM:
-      simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
-      SIMIX_simcall_answer(simcall);
-      break;
+  simgrid::simix::marshal<int>(simcall->result, simcall_HANDLER_mc_random(simcall, simgrid::simix::unmarshal<int>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1])));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_SET_CATEGORY:
-  SIMIX_set_category(
-      simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
-      simgrid::simix::unmarshal<const char*>(simcall->args[1]));
+  SIMIX_set_category(simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1]));
   SIMIX_simcall_answer(simcall);
   break;
 
 case SIMCALL_RUN_KERNEL:
-      SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
-      SIMIX_simcall_answer(simcall);
-      break;
+  SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
+  SIMIX_simcall_answer(simcall);
+  break;
 
 case SIMCALL_RUN_BLOCKING:
-      SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
-      break;
+  SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]));
+  break;
     case NUM_SIMCALLS:
       break;
     case SIMCALL_NONE:
similarity index 71%
rename from src/simix/popping_private.h
rename to src/simix/popping_private.hpp
index 160e55e..e0c200a 100644 (file)
@@ -3,11 +3,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. */
 
-#ifndef SG_POPPING_PRIVATE_H
-#define SG_POPPING_PRIVATE_H
+#ifndef SG_POPPING_PRIVATE_HPP
+#define SG_POPPING_PRIVATE_HPP
 
-#include <xbt/base.h>
 #include <simgrid/simix.h>
+#include <xbt/base.h>
 
 #include <src/kernel/activity/ActivityImpl.hpp>
 #include <src/kernel/activity/CommImpl.hpp>
@@ -15,7 +15,7 @@
 
 #include <boost/intrusive_ptr.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /********************************* Simcalls *********************************/
 XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
@@ -24,24 +24,24 @@ XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
 
 typedef int (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
 typedef void (*simix_copy_data_func_t)(smx_activity_t, void*, size_t);
-typedef void (*simix_clean_func_t)(void *);
+typedef void (*simix_clean_func_t)(void*);
 typedef void (*FPtr)(void); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
-  char            c;
-  short           s;
-  int             i;
-  long            l;
-  long long       ll;
-  unsigned char   uc;
-  unsigned short  us;
-  unsigned int    ui;
-  unsigned long   ul;
+  char c;
+  short s;
+  int i;
+  long l;
+  long long ll;
+  unsigned char uc;
+  unsigned short us;
+  unsigned int ui;
+  unsigned long ul;
   unsigned long long ull;
-  double          d;
-  void*           dp;
-  FPtr            fp;
+  double d;
+  void* dp;
+  FPtr fp;
 };
 
 /**
@@ -52,8 +52,8 @@ struct s_smx_simcall {
   smx_actor_t issuer;
   smx_timer_t timer;
   int mc_value;
-  union u_smx_scalar args[11];
-  union u_smx_scalar result;
+  u_smx_scalar args[11];
+  u_smx_scalar result;
 };
 
 #define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value))
@@ -64,17 +64,14 @@ struct s_smx_simcall {
 XBT_PRIVATE void SIMIX_simcall_answer(smx_simcall_t simcall);
 XBT_PRIVATE void SIMIX_simcall_handle(smx_simcall_t simcall, int value);
 XBT_PRIVATE void SIMIX_simcall_exit(smx_activity_t synchro);
-XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind);
+XBT_PRIVATE const charSIMIX_simcall_name(e_smx_simcall_t kind);
 XBT_PRIVATE void SIMIX_run_kernel(std::function<void()> const* code);
 XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
-
-SG_END_DECL()
-
-#ifdef __cplusplus
+}
 
 /* Defines the marshal/unmarshal functions for each type of parameters.
  *
- * They will be used in popping_accessors.h to define the functions allowing
+ * They will be used in popping_accessors.hpp to define the functions allowing
  * to retrieve/set each parameter of each simcall.
  *
  * There is a unmarshal_raw() function, which is exactly similar to unmarshal()
@@ -89,17 +86,15 @@ SG_END_DECL()
 namespace simgrid {
 namespace simix {
 
-template<class T>
-class type {
-  constexpr bool operator==(type) const    { return true; }
-  template<class U>
-  constexpr bool operator==(type<U>) const { return false; }
-  constexpr bool operator!=(type) const    { return false; }
-  template<class U>
-  constexpr bool operator!=(type<U>) const { return true; }
+template <class T> class type {
+  constexpr bool operator==(type) const { return true; }
+  template <class U> constexpr bool operator==(type<U>) const { return false; }
+  constexpr bool operator!=(type) const { return false; }
+  template <class U> constexpr bool operator!=(type<U>) const { return true; }
 };
 
-template<typename T> struct marshal_t {};
+template <typename T> struct marshal_t {
+};
 #define SIMIX_MARSHAL(T, field)                                                                                        \
   inline void marshal(type<T>, u_smx_scalar& simcall, T value) { simcall.field = value; }                              \
   inline T unmarshal(type<T>, u_smx_scalar const& simcall) { return simcall.field; }                                   \
@@ -129,13 +124,11 @@ inline void unmarshal_raw(type<void>, u_smx_scalar const& simcall)
   /* Nothing to do for void data */
 }
 
-template<class T> inline
-void marshal(type<T*>, u_smx_scalar& simcall, T* value)
+template <class T> inline void marshal(type<T*>, u_smx_scalar& simcall, T* value)
 {
-  simcall.dp = (void*) value;
+  simcall.dp = (void*)value;
 }
-template<class T> inline
-T* unmarshal(type<T*>, u_smx_scalar const& simcall)
+template <class T> inline T* unmarshal(type<T*>, u_smx_scalar const& simcall)
 {
   return static_cast<T*>(simcall.dp);
 }
@@ -165,28 +158,24 @@ template <class T> inline T* unmarshal_raw(type<boost::intrusive_ptr<T>>, u_smx_
   return static_cast<T*>(simcall.dp);
 }
 
-template<class R, class... T> inline
-void marshal(type<R(*)(T...)>, u_smx_scalar& simcall, R(*value)(T...))
+template <class R, class... T> inline void marshal(type<R (*)(T...)>, u_smx_scalar& simcall, R (*value)(T...))
 {
-  simcall.fp = (FPtr) value;
+  simcall.fp = (FPtr)value;
 }
-template<class R, class... T> inline
-auto unmarshal(type<R(*)(T...)>, u_smx_scalar simcall) -> R(*)(T...)
+template <class R, class... T> inline auto unmarshal(type<R (*)(T...)>, u_smx_scalar simcall) -> R (*)(T...)
 {
-  return (R(*)(T...)) simcall.fp;
+  return (R(*)(T...))simcall.fp;
 }
 template <class R, class... T> inline auto unmarshal_raw(type<R (*)(T...)>, u_smx_scalar simcall) -> R (*)(T...)
 {
   return (R(*)(T...))simcall.fp;
 }
 
-template<class T> inline
-void marshal(u_smx_scalar& simcall, T const& value)
+template <class T> inline void marshal(u_smx_scalar& simcall, T const& value)
 {
   return marshal(type<T>(), simcall, value);
 }
-template<class T> inline
-typename std::remove_reference<T>::type unmarshal(u_smx_scalar& simcall)
+template <class T> inline typename std::remove_reference<T>::type unmarshal(u_smx_scalar& simcall)
 {
   return unmarshal(type<T>(), simcall);
 }
@@ -195,37 +184,33 @@ template <class T> inline typename std::remove_reference<T>::type unmarshal_raw(
   return unmarshal(type<T>(), simcall);
 }
 
-template<std::size_t I>
-inline void marshalArgs(smx_simcall_t simcall) {}
+template <std::size_t I> inline void marshalArgs(smx_simcall_t simcall)
+{
+  /* Nothing to do when no args */
+}
 
-template<std::size_t I, class A>
-inline void marshalArgs(smx_simcall_t simcall, A const& a)
+template <std::size_t I, class A> inline void marshalArgs(smx_simcall_t simcall, A const& a)
 {
   marshal(simcall->args[I], a);
 }
 
-template<std::size_t I, class A, class... B>
-inline void marshalArgs(smx_simcall_t simcall, A const& a, B const&... b)
+template <std::size_t I, class A, class... B> inline void marshalArgs(smx_simcall_t simcall, A const& a, B const&... b)
 {
   marshal(simcall->args[I], a);
-  marshalArgs<I+1>(simcall, b...);
+  marshalArgs<I + 1>(simcall, b...);
 }
 
 /** Initialize the simcall */
-template<class... A> inline
-void marshal(smx_simcall_t simcall, e_smx_simcall_t call, A const&... a)
+template <class... A> inline void marshal(smx_simcall_t simcall, e_smx_simcall_t call, A const&... a)
 {
   simcall->call = call;
   memset(&simcall->result, 0, sizeof(simcall->result));
   memset(simcall->args, 0, sizeof(simcall->args));
   marshalArgs<0>(simcall, a...);
 }
-
 }
 }
 
-#endif
-
-#include "popping_accessors.h"
+#include "popping_accessors.hpp"
 
 #endif
index 4465a64..093fe97 100755 (executable)
@@ -41,8 +41,9 @@ class Simcall(object):
         if self.name not in self.simcalls_BODY:
             print ('# ERROR: No function calling simcall_BODY_%s' % self.name)
             print ('# Add something like this to libsmx.c:')
-            print ('%s simcall_%s(%s) {' % (self.res.rettype(), self.name, ', '.
+            print ('%s simcall_%s(%s)' % (self.res.rettype(), self.name, ', '.
                    join('%s %s' % (arg.rettype(), arg.name) for arg in self.args)))
+            print ('{')
             print ('  return simcall_BODY_%s(%s);' % (self.name, "..."))
             print ('}')
             return False
@@ -59,8 +60,9 @@ class Simcall(object):
             if self.name not in self.simcalls_PRE:
                 print ('# ERROR: No function called simcall_HANDLER_%s' % self.name)
                 print ('# Add something like this to the relevant C file (like smx_io.c if it\'s an IO call):')
-                print ('%s simcall_HANDLER_%s(smx_simcall_t simcall%s) {' % (self.res.rettype(), self.name, ''.
+                print ('%s simcall_HANDLER_%s(smx_simcall_t simcall%s)' % (self.res.rettype(), self.name, ''.
                        join(', %s %s' % (arg.rettype(), arg.name)for arg in self.args)))
+                print ('{')
                 print ('  // Your code handling the simcall')
                 print ('}')
                 return False
@@ -98,7 +100,7 @@ class Simcall(object):
             res.append('static inline void simcall_%s__set__%s(smx_simcall_t simcall, %s arg)' % (
                 self.name, arg.name, arg.rettype()))
             res.append('{')
-            res.append('    simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
+            res.append('  simgrid::simix::marshal<%s>(simcall->args[%i], arg);' % (arg.rettype(), i))
             res.append('}')
 
         # Return value getter/setters
@@ -107,16 +109,16 @@ class Simcall(object):
             res.append(
                 'static inline %s simcall_%s__get__result(smx_simcall_t simcall)' % (self.res.rettype(), self.name))
             res.append('{')
-
-            res.append('    return simgrid::simix::unmarshal<%s>(simcall->result);' % self.res.rettype())
+            res.append('  return simgrid::simix::unmarshal<%s>(simcall->result);' % self.res.rettype())
             res.append('}')
-            res.append(
-                'static inline %s simcall_%s__getraw__result(smx_simcall_t simcall){' % (rawtype, self.name))
-            res.append('    return simgrid::simix::unmarshal_raw<%s>(simcall->result);' % rawtype)
+            res.append('static inline %s simcall_%s__getraw__result(smx_simcall_t simcall)' % (rawtype, self.name))
+            res.append('{')
+            res.append('  return simgrid::simix::unmarshal_raw<%s>(simcall->result);' % rawtype)
             res.append('}')
             res.append(
-                'static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result){' % (self.name, self.res.rettype()))
-            res.append('    simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
+                'static inline void simcall_%s__set__result(smx_simcall_t simcall, %s result)' % (self.name, self.res.rettype()))
+            res.append('{')
+            res.append('  simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
             res.append('}')
         return '\n'.join(res)
 
@@ -132,36 +134,36 @@ class Simcall(object):
         else:
             call = "SIMIX_%s(%s)" % (self.name, ', '.join(args))
         if self.call_kind == 'Func':
-            res.append("      simgrid::simix::marshal<%s>(simcall->result, %s);" % (self.res.rettype(), call))
+            res.append("  simgrid::simix::marshal<%s>(simcall->result, %s);" % (self.res.rettype(), call))
         else:
-            res.append("      " + call + ";");
+            res.append("  " + call + ";");
         if self.call_kind != 'Blck':
-            res.append('      SIMIX_simcall_answer(simcall);')
-        res.append('      break;')
+            res.append('  SIMIX_simcall_answer(simcall);')
+        res.append('  break;')
         res.append('')
         return '\n'.join(res)
 
     def body(self):
         res = ['']
         res.append(
-            'inline static %s simcall_BODY_%s(%s) {' % (self.res.rettype(),
+            'inline static %s simcall_BODY_%s(%s)' % (self.res.rettype(),
                                                         self.name,
                                                         ', '.join('%s %s' % (arg.rettype(), arg.name) for arg in self.args)))
-        res.append(
-            '    /* Go to that function to follow the code flow through the simcall barrier */')
+        res.append('{')
+        res.append('  if (0) /* Go to that function to follow the code flow through the simcall barrier */')
         if self.need_handler:
-            res.append('    if (0) simcall_HANDLER_%s(%s);' % (self.name,
-                                                               ', '.join(["&SIMIX_process_self()->simcall"] + [arg.name for arg in self.args])))
+            res.append('    simcall_HANDLER_%s(%s);' % (self.name,
+                                                        ', '.join(["&SIMIX_process_self()->simcall"] + [arg.name for arg in self.args])))
         else:
-            res.append('    if (0) SIMIX_%s(%s);' % (self.name,
+            res.append('    SIMIX_%s(%s);' % (self.name,
                                                      ', '.join(arg.name for arg in self.args)))
-        res.append('    return simcall<%s%s>(SIMCALL_%s%s);' % (
+        res.append('  return simcall<%s%s>(SIMCALL_%s%s);' % (
             self.res.rettype(),
             "".join([ ", " + arg.rettype() for i, arg in enumerate(self.args) ]),
             self.name.upper(),
             "".join([ ", " + arg.name for i, arg in enumerate(self.args) ])
             ));
-        res.append('  }')
+        res.append('}')
         return '\n'.join(res)
 
     def handler_prototype(self):
@@ -272,10 +274,10 @@ if __name__ == '__main__':
     #  sys.exit(1)
 
     #
-    # smx_popping_accessors.c
+    # popping_accessors.hpp
     #
-    fd = header('popping_accessors.h')
-    fd.write('#include "src/simix/popping_private.h"');
+    fd = header('popping_accessors.hpp')
+    fd.write('#include "src/simix/popping_private.hpp"');
     handle(fd, Simcall.accessors, simcalls, simcalls_dict)
     fd.write(
         "\n\n/* The prototype of all simcall handlers, automatically generated for you */\n\n")
@@ -283,7 +285,7 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_enum.c
+    # popping_enum.h
     #
     fd = header("popping_enum.h")
     fd.write('/**\n')
@@ -299,13 +301,13 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_generated.cpp
+    # popping_generated.cpp
     #
 
     fd = header("popping_generated.cpp")
 
+    fd.write('#include "smx_private.hpp"\n')
     fd.write('#include <xbt/base.h>\n')
-    fd.write('#include "smx_private.h"\n')
     fd.write('#if SIMGRID_HAVE_MC\n')
     fd.write('#include "src/mc/mc_forward.hpp"\n')
     fd.write('#endif\n')
@@ -324,7 +326,7 @@ if __name__ == '__main__':
     fd.write('/** @private\n')
     fd.write(
         ' * @brief (in kernel mode) unpack the simcall and activate the handler\n')
-    fd.write(' * \n')
+    fd.write(' *\n')
     fd.write(' * This function is generated from src/simix/simcalls.in\n')
     fd.write(' */\n')
     fd.write(
@@ -354,13 +356,13 @@ if __name__ == '__main__':
     fd.close()
 
     #
-    # smx_popping_bodies.cpp
+    # popping_bodies.cpp
     #
     fd = header('popping_bodies.cpp')
-    fd.write('#include <functional>\n')
-    fd.write('#include "smx_private.h"\n')
+    fd.write('#include "smx_private.hpp"\n')
     fd.write('#include "src/mc/mc_forward.hpp"\n')
     fd.write('#include "xbt/ex.h"\n')
+    fd.write('#include <functional>\n')
     fd.write('#include <simgrid/simix.hpp>\n')
     fd.write("/** @cond */ // Please Doxygen, don't look at this\n")
     fd.write('''
@@ -380,5 +382,5 @@ inline static R simcall(e_smx_simcall_t call, T const&... t)
 }
 ''')
     handle(fd, Simcall.body, simcalls, simcalls_dict)
-    fd.write("/** @endcond */\n");
+    fd.write(" /** @endcond */\n");
     fd.close()
index e399163..6b0c54b 100644 (file)
 #include <xbt/range.hpp>
 #include <xbt/sysdep.h>
 
+#include "simgrid/modelchecker.h"
+#include "simgrid/sg_config.h"
+#include "smx_private.hpp"
 #include "src/internal_config.h"
 #include "xbt/log.h"
 #include "xbt/swag.h"
 #include "xbt/xbt_os_thread.h"
-#include "smx_private.h"
-#include "simgrid/sg_config.h"
-#include "src/internal_config.h"
-#include "simgrid/modelchecker.h"
-
 
 #ifdef _WIN32
 #include <windows.h>
index 6fad27e..3093fc5 100644 (file)
@@ -7,7 +7,7 @@
 #include <vector>
 
 #include "simgrid/s4u/Host.hpp"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
 #include <xbt/ex.hpp>
 
index d0c7d02..3332c1d 100644 (file)
@@ -1,15 +1,15 @@
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 <xbt/ex.hpp>
-#include "xbt/sysdep.h"
+#include "smx_private.hpp"
+#include "xbt/config.h"
 #include "xbt/log.h"
+#include "xbt/sysdep.h"
 #include "xbt/xbt_os_time.h"
-#include "xbt/config.h"
+#include <xbt/ex.hpp>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)");
 
index 61469fb..d612436 100644 (file)
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 
+#include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf.hpp"
-#include "smx_private.h"
-#include "xbt/ex.h"             /* ex_backtrace_display */
+#include "xbt/ex.h" /* ex_backtrace_display */
 
 #include "mc/mc.h"
 #include "simgrid/sg_config.h"
 #include "src/kernel/activity/SynchroRaw.hpp"
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
 #endif
 
-#include "src/mc/mc_record.h"
+#include "src/mc/mc_record.hpp"
 
 #if HAVE_SMPI
-#include "src/smpi/include/private.h"
 #include "src/smpi/include/private.hpp"
 #endif
 
@@ -54,15 +53,15 @@ std::unique_ptr<simgrid::simix::Global> simix_global;
 static xbt_heap_t simix_timers = nullptr;
 
 /** @brief Timer datatype */
-typedef class s_smx_timer {
+class s_smx_timer_t {
   double date = 0.0;
-  s_smx_timer() = default;
+  s_smx_timer_t() = default;
 
 public:
   simgrid::xbt::Task<void()> callback;
   double getDate() { return date; }
-  s_smx_timer(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
-} s_smx_timer_t;
+  s_smx_timer_t(double date, simgrid::xbt::Task<void()> callback) : date(date), callback(std::move(callback)) {}
+};
 
 void (*SMPI_switch_data_segment)(int) = nullptr;
 
@@ -236,8 +235,8 @@ void SIMIX_global_init(int *argc, char **argv)
     });
 
     simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::StorageImpl* storage) {
-      sg_storage_t s = simgrid::s4u::Storage::byName(storage->cname());
-      xbt_assert(s != nullptr, "Storage not found for name %s", storage->cname());
+      sg_storage_t s = simgrid::s4u::Storage::byName(storage->getCname());
+      xbt_assert(s != nullptr, "Storage not found for name %s", storage->getCname());
     });
   }
 
@@ -265,6 +264,15 @@ void SIMIX_clean()
   if (smx_cleaned)
     return; // to avoid double cleaning by java and C
 
+  smx_cleaned = 1;
+  XBT_DEBUG("SIMIX_clean called. Simulation's over.");
+  if (not simix_global->process_to_run.empty() && SIMIX_get_clock() <= 0.0) {
+    XBT_CRITICAL("   ");
+    XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
+    XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
+    xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
+  }
+
 #if HAVE_SMPI
   if (SIMIX_process_count()>0){
     if(smpi_process()->initialized()){
@@ -276,14 +284,6 @@ void SIMIX_clean()
   }
 #endif
 
-  smx_cleaned = 1;
-  XBT_DEBUG("SIMIX_clean called. Simulation's over.");
-  if (not simix_global->process_to_run.empty() && SIMIX_get_clock() <= 0.0) {
-    XBT_CRITICAL("   ");
-    XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
-    XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
-    xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
-  }
   /* Kill all processes (but maestro) */
   SIMIX_process_killall(simix_global->maestro_process, 1);
   SIMIX_context_runall();
@@ -498,7 +498,7 @@ void SIMIX_run()
       /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */
       if (simix_global->process_list.size() == simix_global->daemons.size())
         for (auto const& dmon : simix_global->daemons) {
-          XBT_DEBUG("Kill %s", dmon->cname());
+          XBT_DEBUG("Kill %s", dmon->getCname());
           SIMIX_process_kill(dmon, simix_global->maestro_process);
         }
     }
@@ -654,11 +654,11 @@ void SIMIX_display_process_status()
         synchro_description = "I/O";
 
       XBT_INFO("Process %lu (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
-               process->cname(), process->host->getCname(), synchro_description, process->waiting_synchro.get(),
+               process->getCname(), process->host->getCname(), synchro_description, process->waiting_synchro.get(),
                process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
     }
     else {
-      XBT_INFO("Process %lu (%s@%s)", process->pid, process->cname(), process->host->getCname());
+      XBT_INFO("Process %lu (%s@%s)", process->pid, process->getCname(), process->host->getCname());
     }
   }
 }
index 8698541..6565a4a 100644 (file)
@@ -1,15 +1,16 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "mc/mc.h"
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_replay.h"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "xbt/ex.hpp"
+#include <algorithm>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts");
 
@@ -81,8 +82,8 @@ void SIMIX_host_off(sg_host_t h, smx_actor_t issuer)
       smx_actor_t process = nullptr;
       xbt_swag_foreach(process, host->process_list) {
         SIMIX_process_kill(process, issuer);
-        XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process->cname(),
-                  process->host->getCname(), issuer->cname());
+        XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process->getCname(),
+                  process->host->getCname(), issuer->getCname());
       }
     }
   } else {
@@ -191,11 +192,6 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li
   simgrid::kernel::activity::ExecImplPtr exec =
       simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl(name, nullptr));
 
-  /* set surf's synchro */
-  sg_host_t *host_list_cpy = xbt_new0(sg_host_t, host_nb);
-  for (int i = 0; i < host_nb; i++)
-    host_list_cpy[i] = host_list[i];
-
   /* Check that we are not mixing VMs and PMs in the parallel task */
   bool is_a_vm = (nullptr != dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[0]));
   for (int i = 1; i < host_nb; i++) {
@@ -205,6 +201,9 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li
 
   /* set surf's synchro */
   if (not MC_is_active() && not MC_record_replay_is_active()) {
+    /* set surf's synchro */
+    sg_host_t* host_list_cpy = new sg_host_t[host_nb];
+    std::copy_n(host_list, host_nb, host_list_cpy);
     exec->surf_exec = surf_host_model->executeParallelTask(host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
     exec->surf_exec->setData(exec.get());
     if (timeout > 0) {
similarity index 74%
rename from src/simix/smx_host_private.h
rename to src/simix/smx_host_private.hpp
index d9a6b57..6943f19 100644 (file)
@@ -3,43 +3,43 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_HOST_PRIVATE_H
-#define SIMIX_HOST_PRIVATE_H
+#ifndef SIMIX_HOST_PRIVATE_HPP
+#define SIMIX_HOST_PRIVATE_HPP
 
 #include <functional>
 #include <map>
 #include <vector>
 
-#include <xbt/base.h>
 #include <xbt/Extendable.hpp>
+#include <xbt/base.h>
 
+#include "popping_private.hpp"
 #include "simgrid/simix.h"
-#include "popping_private.h"
 
 #include "src/kernel/activity/ExecImpl.hpp"
 
 /** @brief Host datatype from SIMIX POV */
 namespace simgrid {
-  namespace simix {
-    class ProcessArg;
+namespace simix {
+class ProcessArg;
 
-    class Host {
-    public:
-      static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
+class Host {
+public:
+  static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
 
-      explicit Host();
-      virtual ~Host();
+  explicit Host();
+  virtual ~Host();
 
-      xbt_swag_t process_list;
-      std::vector<ProcessArg*> auto_restart_processes;
-      std::vector<ProcessArg*> boot_processes;
+  xbt_swag_t process_list;
+  std::vector<ProcessArg*> auto_restart_processes;
+  std::vector<ProcessArg*> boot_processes;
 
-      void turnOn();
-    };
-  }
+  void turnOn();
+};
+}
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::function<void()> code,
                                                      void* data, double kill_time,
                                                      std::map<std::string, std::string>* properties, int auto_restart);
@@ -48,9 +48,8 @@ XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
 
 XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec);
 
-XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
-
-SG_END_DECL()
+XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char* category);
+}
 
 XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>
 SIMIX_execution_start(smx_actor_t issuer, const char* name, double flops_amount, double priority, double bound);
@@ -59,4 +58,3 @@ SIMIX_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_li
                                double* bytes_amount, double rate, double timeout);
 
 #endif
-
index 1493988..90c7f88 100644 (file)
@@ -14,8 +14,8 @@
 #include "src/surf/StorageImpl.hpp"
 #include "surf/surf.h"
 
+#include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "smx_private.h"
 
 #include "src/kernel/activity/SynchroIo.hpp"
 
similarity index 86%
rename from src/simix/smx_io_private.h
rename to src/simix/smx_io_private.hpp
index db1c66d..05846b7 100644 (file)
@@ -3,13 +3,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_IO_PRIVATE_H
-#define SIMIX_IO_PRIVATE_H
+#ifndef SIMIX_IO_PRIVATE_HPP
+#define SIMIX_IO_PRIVATE_HPP
 
 #include <xbt/base.h>
 
+#include "popping_private.hpp"
 #include "simgrid/simix.h"
-#include "popping_private.h"
 
 XBT_PRIVATE smx_activity_t SIMIX_file_read(surf_file_t fd, sg_size_t size);
 XBT_PRIVATE smx_activity_t SIMIX_file_write(surf_file_t fd, sg_size_t size);
index 591cf58..1c02f8c 100644 (file)
@@ -16,7 +16,7 @@
 #include "simgrid/s4u/Activity.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/mc/mc_replay.h"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 
@@ -476,11 +476,11 @@ static inline void SIMIX_comm_start(simgrid::kernel::activity::CommImplPtr comm)
       if (comm->src_proc->isSuspended())
         XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the "
                   "communication",
-                  comm->src_proc->cname(), comm->src_proc->host->getCname());
+                  comm->src_proc->getCname(), comm->src_proc->host->getCname());
       else
         XBT_DEBUG("The communication is suspended on startup because dst (%s@%s) was suspended since it initiated the "
                   "communication",
-                  comm->dst_proc->cname(), comm->dst_proc->host->getCname());
+                  comm->dst_proc->getCname(), comm->dst_proc->host->getCname());
 
       comm->surf_comm->suspend();
     }
@@ -562,7 +562,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
           XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
                     "detached:%d",
                     synchro.get(), comm->src_proc ? comm->src_proc->host->getCname() : nullptr,
-                    comm->dst_proc ? comm->dst_proc->host->getCname() : nullptr, simcall->issuer->cname(),
+                    comm->dst_proc ? comm->dst_proc->host->getCname() : nullptr, simcall->issuer->getCname(),
                     simcall->issuer, comm->detached);
           if (comm->src_proc == simcall->issuer) {
             XBT_DEBUG("I'm source");
similarity index 93%
rename from src/simix/smx_network_private.h
rename to src/simix/smx_network_private.hpp
index 0ed901f..0540c7b 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_NETWORK_PRIVATE_H
-#define SIMIX_NETWORK_PRIVATE_H
+#ifndef SIMIX_NETWORK_PRIVATE_HPP
+#define SIMIX_NETWORK_PRIVATE_HPP
 
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/kernel/activity/MailboxImpl.hpp"
similarity index 66%
rename from src/simix/smx_private.h
rename to src/simix/smx_private.hpp
index f10bf4d..a14ab8b 100644 (file)
@@ -3,12 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef SIMIX_PRIVATE_H
-#define SIMIX_PRIVATE_H
+#ifndef SIMIX_PRIVATE_HPP
+#define SIMIX_PRIVATE_HPP
 
 #include "simgrid/s4u/Actor.hpp"
 #include "src/kernel/context/Context.hpp"
-#include <signal.h>
+#include <csignal>
 
 #include <map>
 #include <vector>
@@ -37,7 +37,7 @@ public:
   xbt_dynar_t actors_vector = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
 #endif
   xbt_swag_t process_to_destroy = nullptr;
-  smx_actor_t maestro_process = nullptr;
+  smx_actor_t maestro_process   = nullptr;
 
   // Maps function names to actor code:
   std::unordered_map<std::string, simgrid::simix::ActorCodeFactory> registered_functions;
@@ -49,18 +49,17 @@ public:
   void_pfn_smxprocess_t kill_process_function = nullptr;
   /** Callback used when killing a SMX_process */
   void_pfn_smxprocess_t cleanup_process_function = nullptr;
-  xbt_os_mutex_t mutex = nullptr;
+  xbt_os_mutex_t mutex                           = nullptr;
 
   std::vector<simgrid::xbt::Task<void()>> tasks;
   std::vector<simgrid::xbt::Task<void()>> tasksTemp;
 
   std::vector<simgrid::simix::ActorImpl*> daemons;
 };
-
 }
 }
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC_DATA(std::unique_ptr<simgrid::simix::Global>) simix_global;
 
@@ -68,15 +67,15 @@ XBT_PUBLIC(void) SIMIX_clean();
 
 /******************************** Exceptions *********************************/
 /** @brief Ask to the provided simix process to raise the provided exception */
-#define SMX_EXCEPTION(issuer, cat, val, msg) \
-  if (1) { \
-  smx_actor_t _smx_throw_issuer = (issuer); /* evaluate only once */ \
-  xbt_ex e(XBT_THROW_POINT, msg); \
-  e.category = cat; \
-  e.value = val; \
-  _smx_throw_issuer->exception = std::make_exception_ptr(e); \
-  } else ((void)0)
-
-SG_END_DECL()
+#define SMX_EXCEPTION(issuer, cat, val, msg)                                                                           \
+  if (1) {                                                                                                             \
+    smx_actor_t _smx_throw_issuer = (issuer); /* evaluate only once */                                                 \
+    xbt_ex e(XBT_THROW_POINT, msg);                                                                                    \
+    e.category                   = cat;                                                                                \
+    e.value                      = val;                                                                                \
+    _smx_throw_issuer->exception = std::make_exception_ptr(e);                                                         \
+  } else                                                                                                               \
+  ((void)0)
+}
 
 #endif
index c47d04c..78c4935 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. */
 
-#include "smx_private.h"
+#include "smx_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include <xbt/ex.hpp>
@@ -168,7 +168,7 @@ void MutexImpl::unlock(smx_actor_t issuer)
   /* If the mutex is not owned by the issuer, that's not good */
   if (issuer != this->owner)
     THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%lu), not by you.",
-           this->owner->cname(), this->owner->pid);
+           this->owner->getCname(), this->owner->pid);
 
   if (xbt_swag_size(this->sleeping) > 0) {
     /*process to wake up */
@@ -232,7 +232,7 @@ smx_cond_t SIMIX_cond_init()
 {
   XBT_IN("()");
   simgrid::simix::ActorImpl p;
-  smx_cond_t cond = new s_smx_cond();
+  smx_cond_t cond = new s_smx_cond_t();
   cond->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
   cond->refcount_ = 1;
   XBT_OUT();
@@ -386,7 +386,7 @@ smx_sem_t SIMIX_sem_init(unsigned int value)
   XBT_IN("(%u)",value);
   simgrid::simix::ActorImpl p;
 
-  smx_sem_t sem = xbt_new0(s_smx_sem_t, 1);
+  smx_sem_t sem = new s_smx_sem_t;
   sem->sleeping = xbt_swag_new(xbt_swag_offset(p, synchro_hookup));
   sem->value = value;
   XBT_OUT();
@@ -402,7 +402,7 @@ void SIMIX_sem_destroy(smx_sem_t sem)
     xbt_assert(xbt_swag_size(sem->sleeping) == 0,
                 "Cannot destroy semaphore since someone is still using it");
     xbt_swag_free(sem->sleeping);
-    xbt_free(sem);
+    delete sem;
   }
   XBT_OUT();
 }
index 8eb66a5..7349982 100644 (file)
@@ -52,19 +52,19 @@ private:
 }
 }
 
-typedef struct s_smx_cond {
-  s_smx_cond() : cond_(this) {}
+struct s_smx_cond_t {
+  s_smx_cond_t() : cond_(this) {}
 
   std::atomic_int_fast32_t refcount_{1};
   smx_mutex_t mutex   = nullptr;
   xbt_swag_t sleeping = nullptr; /* list of sleeping process */
   simgrid::s4u::ConditionVariable cond_;
-} s_smx_cond_t;
+};
 
-typedef struct s_smx_sem {
+struct s_smx_sem_t {
   unsigned int value;
   xbt_swag_t sleeping; /* list of sleeping process */
-} s_smx_sem_t;
+};
 
 XBT_PRIVATE void SIMIX_post_synchro(smx_activity_t synchro);
 XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_actor_t process, smx_simcall_t simcall);
index ac71609..a482ce2 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
index 1d642da..9939a7b 100644 (file)
@@ -3,11 +3,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. */
 
-#include "private.h"
+#include "private.hpp"
+#include "smpi_coll.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
-#include "smpi_coll.hpp"
 
 extern "C" { // This should really use the C linkage to be usable from Fortran
 
index f0f56d0..ef0e4f6 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_info.hpp"
 
index f2e77ae..3fb2343 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_request.hpp"
index 1da7248..b40ab80 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 
index 9c9bdb6..7d519b1 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license ,(GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "simgrid/sg_config.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)");
index 59561a4..da15d37 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "smpi_comm.hpp"
index 29c9db4..b642343 100644 (file)
@@ -3,9 +3,9 @@
 /* This program 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 "smpi_comm.hpp"
+#include "private.hpp"
 #include "smpi_coll.hpp"
+#include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
 #include "smpi_process.hpp"
index f658bfe..faa15ab 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <climits>
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_process.hpp"
 
index 587c11b..4f1c188 100644 (file)
@@ -3,9 +3,9 @@
 /* This program 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 "smpi_comm.hpp"
+#include "private.hpp"
 #include "smpi_coll.hpp"
+#include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
 #include "smpi_process.hpp"
index 4cbd21c..ed0c2b3 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_info.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
index 013b780..4ca50de 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_op.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
index a896991..81dbe1b 100644 (file)
@@ -3,11 +3,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. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
-#include "smpi_request.hpp"
 #include "smpi_process.hpp"
+#include "smpi_request.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
@@ -650,13 +650,13 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
 
   smpi_bench_end();
   //save requests information for tracing
-  typedef struct {
+  struct savedvalstype {
     int src;
     int dst;
     int recv;
     int tag;
     MPI_Comm comm;
-  } savedvalstype;
+  };
   savedvalstype* savedvals = xbt_new0(savedvalstype, count);
 
   for (int i = 0; i < count; i++) {
@@ -696,14 +696,14 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
 {
   smpi_bench_end();
   //save information from requests
-  typedef struct {
+  struct savedvalstype {
     int src;
     int dst;
     int recv;
     int tag;
     int valid;
     MPI_Comm comm;
-  } savedvalstype;
+  };
   savedvalstype* savedvals=xbt_new0(savedvalstype, count);
 
   for (int i = 0; i < count; i++) {
index 6864b0f..0be7e5f 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
index e150b2b..ec5cc1b 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_datatype_derived.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
index 03b8438..6c72e88 100644 (file)
@@ -3,9 +3,9 @@
 /* This program 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 "smpi_comm.hpp"
+#include "private.hpp"
 #include "smpi_coll.hpp"
+#include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
 #include "smpi_process.hpp"
index 724373c..d1362f6 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 58927c9..118dc79 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index e87cae5..1303878 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index c4785d2..bf07ba8 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index a4a4b5e..df49aad 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 91eb582..bf24b81 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index f9b53fe..af61164 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index ddb11c2..1994579 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index e30e455..60efc28 100644 (file)
@@ -34,7 +34,7 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
- #include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 
index 4f2707e..08705f9 100644 (file)
@@ -62,7 +62,7 @@
  *         [5]    [5]    [5]    [5]    [5]    [5]
  */
 
- #include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 932d826..d515128 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 5e1d47b..d932ee1 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_status.hpp"
 
 namespace simgrid{
index 1c50923..11d2a44 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 66903fa..d3af9e6 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 42dad10..3d666a7 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index df47969..9ad92aa 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 2701c23..0963606 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 9226be1..c094c7d 100644 (file)
@@ -6,7 +6,7 @@
 /* Short or medium size message and power-of-two no. of processes. Use
  * recursive doubling algorithm */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_status.hpp"
 
 namespace simgrid{
index e2e973a..18608b8 100644 (file)
@@ -10,7 +10,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
  * Function: allgather_mpich_ring
index 8ae33f0..d57fd3f 100644 (file)
@@ -20,7 +20,7 @@
  * Additional copyrights may follow
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*
  * ompi_coll_tuned_allgatherv_intra_bruck
  *
@@ -89,8 +89,6 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
 {
    int sendto, recvfrom, blockcount, i;
    unsigned int distance;
-   int *new_rcounts = NULL, *new_rdispls = NULL;
-   int *new_scounts = NULL, *new_sdispls = NULL;
    ptrdiff_t slb, rlb, sext, rext;
    char *tmpsend = NULL, *tmprecv = NULL;
    MPI_Datatype new_rdtype = MPI_DATATYPE_NULL, new_sdtype = MPI_DATATYPE_NULL;
@@ -126,10 +124,10 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
       - blockcount doubles until the last step when only the remaining data is
       exchanged.
    */
-   new_rcounts = (int*) calloc(4*size, sizeof(int));
-   new_rdispls = new_rcounts + size;
-   new_scounts = new_rdispls + size;
-   new_sdispls = new_scounts + size;
+   int* new_rcounts = new int[4 * size];
+   int* new_rdispls = new_rcounts + size;
+   int* new_scounts = new_rdispls + size;
+   int* new_sdispls = new_scounts + size;
 
    for (distance = 1; distance < size; distance<<=1) {
 
@@ -170,7 +168,7 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
 
    }
 
-   free(new_rcounts);
+   delete[] new_rcounts;
 
    return MPI_SUCCESS;
 
index e88c188..6fd6ee3 100644 (file)
@@ -63,7 +63,7 @@
  *         [5]    [5]    [5]    [5]    [5]    [5]
  */
 
- #include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 9f1c95e..37bf859 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 8f4e17e..fc63b11 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index c9e10ab..871f1a6 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /* IMPLEMENTED BY PITCH PATARASUK
    Non-topoloty-specific all-reduce operation designed bandwidth optimally
index cc9e89b..1711f3b 100644 (file)
@@ -21,7 +21,7 @@
  *
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
index 730307b..aaece0d 100644 (file)
@@ -35,7 +35,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 #define MPIR_Allreduce_pt2pt_rd_MV2 Coll_allreduce_rdb::allreduce
 #define MPIR_Allreduce_pt2pt_rs_MV2 Coll_allreduce_mvapich2_rs::allreduce
index 2736daf..ebccf62 100644 (file)
         EARLY_BLOCK_COUNT = EARLY_BLOCK_COUNT + 1;                           \
     }                                                                        \
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 9cfbf1a..ea216cc 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count,
index 8f26894..31cd8d5 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 namespace simgrid{
 namespace smpi{
index ca9603b..6978a46 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 
 namespace simgrid{
@@ -23,7 +23,7 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 552698a..a7ee1d1 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 namespace simgrid{
 namespace smpi{
@@ -21,7 +21,7 @@ int Coll_allreduce_rdb::allreduce(void *sbuff, void *rbuff, int count,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index 9ed2084..6d72e76 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_allreduce_redbcast::allreduce(void *buf, void *buf2, int count,
index e372373..b14baa5 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /* IMPLEMENTED BY PITCH PATARASUK
    Non-topoloty-specific (however, number of cores/node need to be changed)
    all-reduce operation designed for smp clusters
index ff4e5d0..52df999 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /* IMPLEMENTED BY PITCH PATARASUK
    Non-topoloty-specific (however, number of cores/node need to be changed)
    all-reduce operation designed for smp clusters
index 52453c2..e94211a 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /* IMPLEMENTED BY PITCH PATARASUK
    Non-topoloty-specific (however, number of cores/node need to be changed)
    all-reduce operation designed for smp clusters
@@ -49,7 +49,7 @@ int Coll_allreduce_smp_rdb::allreduce(void *send_buf, void *recv_buf, int count,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index afc21e8..4b9b0cf 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 
 /*
@@ -37,7 +37,7 @@ int Coll_allreduce_smp_rsag_lr::allreduce(void *send_buf, void *recv_buf,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index c0915a0..275c7bd 100644 (file)
@@ -7,7 +7,7 @@
 /*
  * implemented by Pitch Patarasuk, 07/01/2007
  */
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 
 
index ea08353..c86b16a 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*
 This fucntion performs all-reduce operation as follow.
@@ -36,7 +36,7 @@ int Coll_allreduce_smp_rsag::allreduce(void *send_buf, void *recv_buf,
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
      #else
      MPI_User_function *uop;
-     struct MPIR_OP *op_ptr;
+     MPIR_OP *op_ptr;
      op_ptr = MPIR_ToPointer(op);
      uop  = op_ptr->op;
      #endif
index e75003a..9a1def0 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include <cmath>
 
 /*****************************************************************************
index 85baad3..e8c5347 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include <cmath>
 
 /*****************************************************************************
index 9b1b1a2..01aba9c 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. */
 
- #include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*Naive and simple basic alltoall implementation. */
 
index fe000c3..f8e15a5 100644 (file)
@@ -25,7 +25,7 @@
 
  ****************************************************************************/
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index 6745252..bb5edb4 100644 (file)
@@ -41,7 +41,7 @@
 //correct on stampede
 #define MV2_ALLTOALL_THROTTLE_FACTOR         4
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_alltoall_mvapich2_scatter_dest::alltoall(
index fff723c..80c6c94 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair_light_barrier
index d9f0aed..cbe69d8 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair_mpi_barrier
index f87779c..10dc656 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair
index 2dd6e00..2519526 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_win.hpp"
 
 /*****************************************************************************
index 5067aa7..31e521f 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_status.hpp"
 
 /*****************************************************************************
index 4cc7ee6..48ac6b0 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring_light_barrier
index add58fa..fd9287e 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring_mpi_barrier
index 8ebeab3..099c7ef 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring
index 5065e1d..bd648e7 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring
index 41b4abd..fd69ace 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /**
  * Alltoall Bruck
index 8c9bc29..cbfd6e0 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*
  * Linear functions are copied from the basic coll module.  For
  * some small number of nodes and/or small data sizes they are just as
index 738e2a5..19ecc4c 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair_light_barrier
index c440013..98dac23 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair_mpi_barrier
index 6dec9cd..eff63ca 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_pair
index e706a79..36290d6 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index 501c236..a68f4c8 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring_light_barrier
index 38bf38c..7e14f3f 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring_mpi_barrier
index 2d3996f..5f7025a 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring
index ddc591b..79dadaf 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 /*****************************************************************************
 
  * Function: alltoall_ring
index e5f743d..0a9b3b4 100644 (file)
@@ -39,8 +39,8 @@
  *
  */
 
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_barrier_mvapich2_pair::barrier(MPI_Comm comm)
index 12c3af3..0f4eec5 100644 (file)
@@ -20,9 +20,8 @@
  * Additional copyrights may follow
  */
 
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
-
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 /*
  * Barrier is ment to be a synchronous operation, as some BTLs can mark
@@ -266,7 +265,7 @@ int Coll_barrier_ompi_basic_linear::barrier(MPI_Comm comm)
     else {
         MPI_Request* requests;
 
-        requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) );
+        requests = new MPI_Request[size];
         for (i = 1; i < size; ++i) {
             requests[i] = Request::irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE,
                                      COLL_TAG_BARRIER, comm
@@ -281,7 +280,7 @@ int Coll_barrier_ompi_basic_linear::barrier(MPI_Comm comm)
                                      );
         }
         Request::waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
-        free( requests );
+        delete[] requests;
     }
 
     /* All done */
index 9e1e974..3055371 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 int bcast_NTSB_segment_size_in_byte = 8192;
 namespace simgrid{
index df3cf2b..0a3c948 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 static int bcast_NTSL_segment_size_in_byte = 8192;
 
index a9d3b83..957c80c 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 static int bcast_NTSL_segment_size_in_byte = 8192;
 
index f4eb6a2..bcec229 100644 (file)
@@ -4,8 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "../colls_private.h"
-
+#include "../colls_private.hpp"
 
 int bcast_SMP_binary_segment_byte = 8192;
 namespace simgrid{
index 3d6eb0b..dab6961 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int Coll_bcast_SMP_binomial::bcast(void *buf, int count,
index 691706e..a63e905 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 int bcast_SMP_linear_segment_byte = 8192;
 namespace simgrid{
index 3256363..21a549a 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 int bcast_arrival_pattern_aware_wait_segment_size_in_byte = 8192;
 
index 102be48..484ba79 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 static int bcast_NTSL_segment_size_in_byte = 8192;
 
index 3ecba94..c744088 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 #ifndef BCAST_ARRIVAL_PATTERN_AWARE_HEADER_SIZE
 #define BCAST_ARRIVAL_PATTERN_AWARE_HEADER_SIZE 128
index b8bc0e0..027b4b9 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*****************************************************************************
 
index f03eb3a..db597a5 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 int flattree_segment_in_byte = 8192;
 namespace simgrid{
index f89bd94..79e9fe7 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
 int
index b0c0f31..17e9ca0 100644 (file)
@@ -34,8 +34,8 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#include "../colls_private.h"
 
+#include "../colls_private.hpp"
 
 extern int (*MV2_Bcast_function) (void *buffer, int count, MPI_Datatype datatype,
                            int root, MPI_Comm comm_ptr);
index 425fcab..0de5fff 100644 (file)
@@ -4,8 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
- #include "../colls_private.h"
- #include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 #define MAXTREEFANOUT 32
 
@@ -85,7 +85,7 @@ int Coll_bcast_ompi_pipeline::bcast( void* buffer,
     tmpbuf = (char *) buffer;
 
     if( tree->tree_nextsize != 0 ) {
-        send_reqs = xbt_new(MPI_Request, tree->tree_nextsize  );
+      send_reqs = new MPI_Request[tree->tree_nextsize];
     }
 
     /* Root code */
@@ -205,8 +205,8 @@ int Coll_bcast_ompi_pipeline::bcast( void* buffer,
         Request::wait( &recv_reqs[req_index], MPI_STATUS_IGNORE );
     }
 
-    if( NULL != send_reqs ) free(send_reqs);
-    xbt_free(tree);
+    delete[] send_reqs;
+    ompi_coll_tuned_topo_destroy_tree(&tree);
 
     return (MPI_SUCCESS);
 }
index 52ad605..2ab6c7d 100644 (file)
@@ -55,9 +55,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-  #include "../colls_private.h"
-  #include "../coll_tuned_topo.h"
-  #define MAXTREEFANOUT 32
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
+#define MAXTREEFANOUT 32
 namespace simgrid{
 namespace smpi{
 
@@ -296,7 +296,7 @@ Coll_bcast_ompi_split_bintree::bcast ( void* buffer,
                                             comm, MPI_STATUS_IGNORE);
         }
     }
-    xbt_free(tree);
+    ompi_coll_tuned_topo_destroy_tree(&tree);
     return (MPI_SUCCESS);
 
 
index 6b304ad..6b7936d 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_status.hpp"
 
 /*****************************************************************************
index f48e31a..df78b16 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include "smpi_status.hpp"
 
 namespace simgrid{
index db88a99..7138c7e 100644 (file)
@@ -19,8 +19,8 @@
  * Additional copyrights may follow
  */
 
-#include "colls_private.h"
-#include "coll_tuned_topo.h"
+#include "coll_tuned_topo.hpp"
+#include "colls_private.hpp"
 /*
  * Some static helpers.
  */
@@ -101,7 +101,7 @@ ompi_coll_tuned_topo_build_tree( int fanout,
     size = comm->size();
     rank = comm->rank();
 
-    tree = (ompi_coll_tree_t*)malloc(sizeof(ompi_coll_tree_t));
+    tree = new ompi_coll_tree_t;
     if (not tree) {
       XBT_DEBUG("coll:tuned:topo_build_tree PANIC::out of memory");
       return NULL;
@@ -201,7 +201,7 @@ ompi_coll_tuned_topo_build_in_order_bintree( MPI_Comm comm )
     size = comm->size();
     rank = comm->rank();
 
-    tree = (ompi_coll_tree_t*)malloc(sizeof(ompi_coll_tree_t));
+    tree = new ompi_coll_tree_t;
     if (not tree) {
       XBT_DEBUG("coll:tuned:topo_build_tree PANIC::out of memory");
       return NULL;
@@ -304,7 +304,7 @@ int ompi_coll_tuned_topo_destroy_tree( ompi_coll_tree_t** tree )
 
     ptr = *tree;
 
-    free (ptr);
+    delete ptr;
     *tree = NULL;   /* mark tree as gone */
 
     return MPI_SUCCESS;
@@ -345,7 +345,7 @@ ompi_coll_tuned_topo_build_bmtree( MPI_Comm comm,
 
     index = rank -root;
 
-    bmtree = (ompi_coll_tree_t*)malloc(sizeof(ompi_coll_tree_t));
+    bmtree = new ompi_coll_tree_t;
     if (not bmtree) {
       XBT_DEBUG("coll:tuned:topo:build_bmtree PANIC out of memory");
       return NULL;
@@ -424,7 +424,7 @@ ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bmtree(MPI_Comm comm, int
 
     vrank = (rank - root + size) % size;
 
-    bmtree = (ompi_coll_tree_t*)xbt_malloc(sizeof(ompi_coll_tree_t));
+    bmtree = new ompi_coll_tree_t;
     if (not bmtree) {
       XBT_DEBUG("coll:tuned:topo:build_bmtree PANIC out of memory");
       return NULL;
@@ -494,7 +494,7 @@ ompi_coll_tuned_topo_build_chain( int fanout,
     /*
      * Allocate space for topology arrays if needed
      */
-    chain = (ompi_coll_tree_t*)malloc( sizeof(ompi_coll_tree_t) );
+    chain = new ompi_coll_tree_t;
     if (not chain) {
       XBT_DEBUG("coll:tuned:topo:build_chain PANIC out of memory");
       fflush(stdout);
diff --git a/src/smpi/colls/coll_tuned_topo.h b/src/smpi/colls/coll_tuned_topo.h
deleted file mode 100644 (file)
index 907fdec..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/*
- * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
- *                         University Research and Technology
- *                         Corporation.  All rights reserved.
- * Copyright (c) 2004-2005 The University of Tennessee and The University
- *                         of Tennessee Research Foundation.  All rights
- *                         reserved.
- * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
- *                         University of Stuttgart.  All rights reserved.
- * Copyright (c) 2004-2005 The Regents of the University of California.
- *                         All rights reserved.
- *
- * Additional copyrights may follow
- */
-
-#ifndef MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
-#define MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
-
-#include "colls_private.h"
-
-#define MAXTREEFANOUT 32
-
-#define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT)        \
-    if( ((SEGSIZE) >= (TYPELNG)) &&                                     \
-        ((SEGSIZE) < ((TYPELNG) * (SEGCOUNT))) ) {                      \
-        size_t residual;                                                \
-        (SEGCOUNT) = (int)((SEGSIZE) / (TYPELNG));                      \
-        residual = (SEGSIZE) - (SEGCOUNT) * (TYPELNG);                  \
-        if( residual > ((TYPELNG) >> 1) )                               \
-            (SEGCOUNT)++;                                               \
-    }                                                                   \
-
-
-    typedef struct ompi_coll_tree_t {
-        int32_t tree_root;
-        int32_t tree_fanout;
-        int32_t tree_bmtree;
-        int32_t tree_prev;
-        int32_t tree_next[MAXTREEFANOUT];
-        int32_t tree_nextsize;
-    } ompi_coll_tree_t;
-
-    ompi_coll_tree_t*
-    ompi_coll_tuned_topo_build_tree( int fanout,
-                                     MPI_Comm com,
-                                     int root );
-    ompi_coll_tree_t*
-    ompi_coll_tuned_topo_build_in_order_bintree( MPI_Comm comm );
-
-    ompi_coll_tree_t*
-    ompi_coll_tuned_topo_build_bmtree( MPI_Comm comm,
-                                       int root );
-    ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bmtree(MPI_Comm comm, int root);
-    ompi_coll_tree_t*
-    ompi_coll_tuned_topo_build_chain( int fanout,
-                                      MPI_Comm com,
-                                      int root );
-
-    int ompi_coll_tuned_topo_destroy_tree( ompi_coll_tree_t** tree );
-
-    /* debugging stuff, will be removed later */
-    int ompi_coll_tuned_topo_dump_tree (ompi_coll_tree_t* tree, int rank);
-
-#endif  /* MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED */
-
diff --git a/src/smpi/colls/coll_tuned_topo.hpp b/src/smpi/colls/coll_tuned_topo.hpp
new file mode 100644 (file)
index 0000000..e6ff4b4
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/*
+ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+ *                         University Research and Technology
+ *                         Corporation.  All rights reserved.
+ * Copyright (c) 2004-2005 The University of Tennessee and The University
+ *                         of Tennessee Research Foundation.  All rights
+ *                         reserved.
+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+ *                         University of Stuttgart.  All rights reserved.
+ * Copyright (c) 2004-2005 The Regents of the University of California.
+ *                         All rights reserved.
+ *
+ * Additional copyrights may follow
+ */
+
+#ifndef MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
+#define MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
+
+#include "colls_private.hpp"
+
+#define MAXTREEFANOUT 32
+
+#define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT)                                                       \
+  if (((SEGSIZE) >= (TYPELNG)) && ((SEGSIZE) < ((TYPELNG) * (SEGCOUNT)))) {                                            \
+    size_t residual;                                                                                                   \
+    (SEGCOUNT) = (int)((SEGSIZE) / (TYPELNG));                                                                         \
+    residual   = (SEGSIZE) - (SEGCOUNT) * (TYPELNG);                                                                   \
+    if (residual > ((TYPELNG) >> 1))                                                                                   \
+      (SEGCOUNT)++;                                                                                                    \
+  }
+
+struct ompi_coll_tree_t {
+  int32_t tree_root;
+  int32_t tree_fanout;
+  int32_t tree_bmtree;
+  int32_t tree_prev;
+  int32_t tree_next[MAXTREEFANOUT];
+  int32_t tree_nextsize;
+};
+
+ompi_coll_tree_t* ompi_coll_tuned_topo_build_tree(int fanout, MPI_Comm com, int root);
+ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bintree(MPI_Comm comm);
+
+ompi_coll_tree_t* ompi_coll_tuned_topo_build_bmtree(MPI_Comm comm, int root);
+ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bmtree(MPI_Comm comm, int root);
+ompi_coll_tree_t* ompi_coll_tuned_topo_build_chain(int fanout, MPI_Comm com, int root);
+
+int ompi_coll_tuned_topo_destroy_tree(ompi_coll_tree_t** tree);
+
+/* debugging stuff, will be removed later */
+int ompi_coll_tuned_topo_dump_tree(ompi_coll_tree_t* tree, int rank);
+
+#endif /* MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED */
similarity index 81%
rename from src/smpi/colls/colls_private.h
rename to src/smpi/colls/colls_private.hpp
index fc28459..63ff65c 100644 (file)
@@ -3,17 +3,17 @@
 /* This program 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 SMPI_COLLS_PRIVATE_H
-#define SMPI_COLLS_PRIVATE_H
+#ifndef SMPI_COLLS_PRIVATE_HPP
+#define SMPI_COLLS_PRIVATE_HPP
 
-#include <math.h>
+#include "private.hpp"
 #include "smpi/mpi.h"
-#include "private.h"
 #include "smpi_coll.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
 #include "smpi_request.hpp"
+#include <cmath>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_colls);
 
index 9cc9a36..79b7035 100644 (file)
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
-
-
-
-
+#include "../colls_private.hpp"
 
 #define MPIR_Gather_MV2_Direct Coll_gather_ompi_basic_linear::gather
 #define MPIR_Gather_MV2_two_level_Direct Coll_gather_ompi_basic_linear::gather
index 6190e56..3e4e65c 100644 (file)
@@ -19,8 +19,8 @@
  * Additional copyrights may follow
  */
 
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
@@ -181,7 +181,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
       /* other non-leaf nodes */
       smpi_free_tmp_buffer(tempbuf);
     }
-    xbt_free(bmtree);
+    ompi_coll_tuned_topo_destroy_tree(&bmtree);
     return MPI_SUCCESS;
 
  err_hndl:
@@ -266,8 +266,8 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
          - Waitall for all the second segments to complete.
 */
       char* ptmp;
-      MPI_Request *reqs = NULL, first_segment_req;
-      reqs              = (MPI_Request*)calloc(size, sizeof(MPI_Request));
+      MPI_Request first_segment_req;
+      MPI_Request* reqs = new (std::nothrow) MPI_Request[size];
       if (NULL == reqs) {
         ret  = -1;
         line = __LINE__;
@@ -319,7 +319,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
         ret = Request::waitall(size, reqs, MPI_STATUSES_IGNORE);
         if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; }
 
-        free(reqs);
+        delete[] reqs;
     }
 
     /* All done */
index b15c4f7..b11c99d 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 
 int reduce_NTSL_segment_size_in_byte = 8192;
index 91a371f..a25a1c6 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 
 int reduce_arrival_pattern_aware_segment_size_in_byte = 8192;
index 7321767..d36c30f 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 //#include <star-reduction.c>
 namespace simgrid{
index c4c2e7f..225b456 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 //#include <star-reduction.c>
 namespace simgrid{
 namespace smpi{
index 2ab0774..d5788fb 100644 (file)
@@ -38,7 +38,7 @@
  *
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 extern int mv2_reduce_intra_knomial_factor;
 extern int mv2_reduce_inter_knomial_factor;
 
index 6d031e0..3c3adc1 100644 (file)
@@ -35,7 +35,7 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #define MV2_INTRA_SHMEM_REDUCE_MSG 2048
 
 #define mv2_g_shmem_coll_max_msg_size (1 << 17)
index f5d593d..a4b540e 100644 (file)
@@ -19,8 +19,8 @@
  * Additional copyrights may follow
  */
 
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
@@ -261,10 +261,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
         else {
 
             int creq = 0;
-            MPI_Request* sreq = NULL;
-
-            sreq = (MPI_Request*) calloc( max_outstanding_reqs,
-                                              sizeof(MPI_Request ) );
+            MPI_Request* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs];
             if (NULL == sreq) { line = __LINE__; ret = -1; goto error_hndl; }
 
             /* post first group of requests */
@@ -303,10 +300,10 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
                                          MPI_STATUSES_IGNORE );
 
             /* free requests */
-            free(sreq);
+            delete[] sreq;
         }
     }
-    free(tree);
+    ompi_coll_tuned_topo_destroy_tree(&tree);
     return MPI_SUCCESS;
 
  error_hndl:  /* error handler */
index b2c90e0..5b2f4b2 100644 (file)
@@ -9,7 +9,7 @@
  * but this header must not be removed.
  */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 #include <cstdio>
 #include <cstdlib>
 
@@ -409,13 +409,31 @@ Benchmark results on CRAY T3E
 #endif
 #endif
 
-typedef enum {MPIM_SHORT, MPIM_INT, MPIM_LONG, MPIM_UNSIGNED_SHORT,
-              MPIM_UNSIGNED, MPIM_UNSIGNED_LONG, MPIM_UNSIGNED_LONG_LONG, MPIM_FLOAT,
-              MPIM_DOUBLE, MPIM_BYTE} MPIM_Datatype;
-
-typedef enum {MPIM_MAX, MPIM_MIN, MPIM_SUM, MPIM_PROD,
-              MPIM_LAND, MPIM_BAND, MPIM_LOR, MPIM_BOR,
-              MPIM_LXOR, MPIM_BXOR} MPIM_Op;
+enum MPIM_Datatype {
+  MPIM_SHORT,
+  MPIM_INT,
+  MPIM_LONG,
+  MPIM_UNSIGNED_SHORT,
+  MPIM_UNSIGNED,
+  MPIM_UNSIGNED_LONG,
+  MPIM_UNSIGNED_LONG_LONG,
+  MPIM_FLOAT,
+  MPIM_DOUBLE,
+  MPIM_BYTE
+};
+
+enum MPIM_Op {
+  MPIM_MAX,
+  MPIM_MIN,
+  MPIM_SUM,
+  MPIM_PROD,
+  MPIM_LAND,
+  MPIM_BAND,
+  MPIM_LOR,
+  MPIM_BOR,
+  MPIM_LXOR,
+  MPIM_BXOR
+};
 #define MPI_I_DO_OP_C_INTEGER(MPI_I_do_op_TYPE,TYPE)                   \
 static void MPI_I_do_op_TYPE(TYPE* b1,TYPE* b2,TYPE* rslt, int cnt,MPIM_Op op)\
 { int i;                                                               \
@@ -595,14 +613,14 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
     MPI_Type_extent(mpi_datatype, &typelng);
     scrlng  = typelng * count;
 #ifdef NO_CACHE_OPTIMIZATION
-    scr1buf = static_cast<char*>(xbt_malloc(scrlng));
-    scr2buf = static_cast<char*>(xbt_malloc(scrlng));
-    scr3buf = static_cast<char*>(xbt_malloc(scrlng));
+    scr1buf = new char[scrlng];
+    scr2buf = new char[scrlng];
+    scr3buf = new char[scrlng];
 #else
 #  ifdef SCR_LNG_OPTIM
     scrlng = SCR_LNG_OPTIM(scrlng);
 #  endif
-    scr2buf = static_cast<char*>(xbt_malloc(3*scrlng));   /* To test cache problems.     */
+    scr2buf = new char[3 * scrlng]; /* To test cache problems.     */
     scr1buf = scr2buf + 1*scrlng; /* scr1buf and scr3buf must not*/
     scr3buf = scr2buf + 2*scrlng; /* be used for malloc because  */
                                   /* they are interchanged below.*/
@@ -914,9 +932,11 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
     }
 
 #   ifdef NO_CACHE_TESTING
-     xbt_free(scr1buf); xbt_free(scr2buf); xbt_free(scr3buf);
+    delete[] scr1buf;
+    delete[] scr2buf;
+    delete[] scr3buf;
 #   else
-     xbt_free(scr2buf); /* scr1buf and scr3buf are part of scr2buf */
+    delete[] scr2buf;             /* scr1buf and scr3buf are part of scr2buf */
 #   endif
     return(MPI_SUCCESS);
   } /* new_prot */
index 4b987aa..fc55a39 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 /*
   reduce
index 39128a2..995f078 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. */
 
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 {
index 8a28d88..1bc913c 100644 (file)
@@ -21,8 +21,8 @@
  * Additional copyrights may follow
  */
 
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 /*
  * Recursive-halving function is (*mostly*) copied from the BASIC coll module.
index cd701f5..16f3781 100644 (file)
@@ -34,7 +34,7 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
-#include "../colls_private.h"
+#include "../colls_private.hpp"
 
 #define MPIR_Scatter_MV2_Binomial Coll_scatter_ompi_binomial::scatter
 #define MPIR_Scatter_MV2_Direct Coll_scatter_ompi_basic_linear::scatter
index 5a2da7f..6c14004 100644 (file)
@@ -19,9 +19,8 @@
  * Additional copyrights may follow
  */
 
-
-#include "../colls_private.h"
-#include "../coll_tuned_topo.h"
+#include "../coll_tuned_topo.hpp"
+#include "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
@@ -160,7 +159,7 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
     if (NULL != tempbuf)
       smpi_free_tmp_buffer(tempbuf);
     // not FIXME : store the tree, as done in ompi, instead of calculating it each time ?
-    xbt_free(bmtree);
+    ompi_coll_tuned_topo_destroy_tree(&bmtree);
 
     return MPI_SUCCESS;
 
index b6b3693..12ef8f3 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <exception>
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 #include "smpi_process.hpp"
 
 
 
 #define TRACE_AUTO_COLL(cat)                                                                                           \
   if (TRACE_is_enabled()) {                                                                                            \
-    simgrid::instr::Type* type = PJ_type_get_root()->getChildOrNull(#cat);                                             \
-    if (not type) {                                                                                                    \
-      type = simgrid::instr::Type::eventNew(#cat, PJ_type_get_root());                                                 \
-    }                                                                                                                  \
+    simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->getOrCreateEventType(#cat);                      \
+                                                                                                                       \
     char cont_name[25];                                                                                                \
     snprintf(cont_name, 25, "rank-%d", smpi_process()->index());                                                       \
     simgrid::instr::Value* val =                                                                                       \
-        simgrid::instr::Value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);           \
-    new simgrid::instr::NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val);                           \
+        simgrid::instr::Value::byNameOrCreate(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);       \
+    new simgrid::instr::NewEvent(SIMIX_get_clock(), simgrid::instr::Container::byName(cont_name), type, val);          \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
index a0760fe..57ddfa1 100644 (file)
@@ -5,8 +5,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
 #include "smpi_coll.hpp"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
index f218a4e..f48c4bf 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 #include "smpi_process.hpp"
 
 namespace simgrid{
index 6bec031..8c6630b 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 
 // This selector is based on information gathered on the Stampede cluster, with Intel MPI 4.1.3.049, and from the intel reference manual. The data was gathered launching runs with 1,2,4,8,16 processes per node.
 
 #define INTEL_MAX_NB_NUMPROCS  12
 #define INTEL_MAX_NB_PPN  5  /* 1 2 4 8 16 ppn */
 
-typedef struct {
+struct intel_tuning_table_size_element {
   unsigned int max_size;
   int algo;
-} intel_tuning_table_size_element;
+};
 
-typedef struct {
+struct intel_tuning_table_numproc_element {
   int max_num_proc;
   int num_elems;
   intel_tuning_table_size_element elems[INTEL_MAX_NB_THRESHOLDS];
-} intel_tuning_table_numproc_element;
+};
 
-typedef struct {
+struct intel_tuning_table_element {
   int ppn;
   intel_tuning_table_numproc_element elems[INTEL_MAX_NB_NUMPROCS];
-} intel_tuning_table_element;
+};
 
 /*
 I_MPI_ADJUST_ALLREDUCE
index b5a0858..758a9e4 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 
 /* This is the default implementation of allreduce. The algorithm is:
 
index 1d6978c..2d60cf1 100644 (file)
@@ -6,9 +6,9 @@
 /* This program 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 "colls_private.h"
+#include "colls_private.hpp"
 
-#include "smpi_mvapich2_selector_stampede.h"
+#include "smpi_mvapich2_selector_stampede.hpp"
 
 namespace simgrid{
 namespace smpi{
@@ -795,7 +795,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i
   int range = 0;
   int range_threshold = 0;
   int is_commutative = 0;
-  int *disps = static_cast<int*>(xbt_malloc(comm_size * sizeof (int)));
+  int* disps          = new int[comm_size];
 
   if(mv2_red_scat_thresholds_table==NULL)
     init_mv2_reduce_scatter_tables_stampede();
@@ -853,7 +853,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i
           recvcnts, datatype,
           op, comm);
   }
-  xbt_free(disps);
+  delete[] disps;
   return mpi_errno;
 
 }
@@ -998,28 +998,27 @@ int Coll_scatter_mvapich2::scatter(void *sendbuf,
 
 void smpi_coll_cleanup_mvapich2()
 {
-  int i = 0;
   if (mv2_alltoall_thresholds_table)
-    xbt_free(mv2_alltoall_thresholds_table[i]);
-  xbt_free(mv2_alltoall_thresholds_table);
-  xbt_free(mv2_size_alltoall_tuning_table);
-  xbt_free(mv2_alltoall_table_ppn_conf);
+    delete[] mv2_alltoall_thresholds_table[0];
+  delete[] mv2_alltoall_thresholds_table;
+  delete[] mv2_size_alltoall_tuning_table;
+  delete[] mv2_alltoall_table_ppn_conf;
 
-  xbt_free(mv2_gather_thresholds_table);
+  delete[] mv2_gather_thresholds_table;
   if (mv2_allgather_thresholds_table)
-    xbt_free(mv2_allgather_thresholds_table[0]);
-  xbt_free(mv2_size_allgather_tuning_table);
-  xbt_free(mv2_allgather_table_ppn_conf);
-  xbt_free(mv2_allgather_thresholds_table);
-
-  xbt_free(mv2_allgatherv_thresholds_table);
-  xbt_free(mv2_reduce_thresholds_table);
-  xbt_free(mv2_red_scat_thresholds_table);
-  xbt_free(mv2_allreduce_thresholds_table);
-  xbt_free(mv2_bcast_thresholds_table);
+    delete[] mv2_allgather_thresholds_table[0];
+  delete[] mv2_size_allgather_tuning_table;
+  delete[] mv2_allgather_table_ppn_conf;
+  delete[] mv2_allgather_thresholds_table;
+
+  delete[] mv2_allgatherv_thresholds_table;
+  delete[] mv2_reduce_thresholds_table;
+  delete[] mv2_red_scat_thresholds_table;
+  delete[] mv2_allreduce_thresholds_table;
+  delete[] mv2_bcast_thresholds_table;
   if (mv2_scatter_thresholds_table)
-    xbt_free(mv2_scatter_thresholds_table[0]);
-  xbt_free(mv2_scatter_thresholds_table);
-  xbt_free(mv2_size_scatter_tuning_table);
-  xbt_free(mv2_scatter_table_ppn_conf);
+    delete[] mv2_scatter_thresholds_table[0];
+  delete[] mv2_scatter_thresholds_table;
+  delete[] mv2_size_scatter_tuning_table;
+  delete[] mv2_scatter_table_ppn_conf;
 }
diff --git a/src/smpi/colls/smpi_mvapich2_selector_stampede.h b/src/smpi/colls/smpi_mvapich2_selector_stampede.h
deleted file mode 100644 (file)
index ca81613..0000000
+++ /dev/null
@@ -1,1987 +0,0 @@
-/* selector for collective algorithms based on mvapich decision logic, with calibration from Stampede cluster at TACC*/
-/* This is the tuning used by MVAPICH for Stampede platform based on (MV2_ARCH_INTEL_XEON_E5_2680_16, MV2_HCA_MLX_CX_FDR) */
-
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/************ Alltoall variables and initializers                        */
-
-#define MV2_MAX_NB_THRESHOLDS  32
-
-
-XBT_PUBLIC(void) smpi_coll_cleanup_mvapich2(void);
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Alltoall_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
-      void *recvbuf, int recvcount, MPI_Datatype recvtype,
-      MPI_Comm comm_ptr );
-} mv2_alltoall_tuning_element;
-
-typedef struct {
-  int numproc;
-  int size_table;
-  mv2_alltoall_tuning_element algo_table[MV2_MAX_NB_THRESHOLDS];
-  mv2_alltoall_tuning_element in_place_algo_table[MV2_MAX_NB_THRESHOLDS];
-} mv2_alltoall_tuning_table;
-
-int (*MV2_Alltoall_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr)=NULL;
-
-/* Indicates number of processes per node */
-int *mv2_alltoall_table_ppn_conf = NULL;
-/* Indicates total number of configurations */
-int mv2_alltoall_num_ppn_conf = 1;
-int *mv2_size_alltoall_tuning_table = NULL;
-mv2_alltoall_tuning_table **mv2_alltoall_thresholds_table = NULL;
-
-
-#define MPIR_Alltoall_bruck_MV2 simgrid::smpi::Coll_alltoall_bruck::alltoall
-#define MPIR_Alltoall_RD_MV2 simgrid::smpi::Coll_alltoall_rdb::alltoall
-#define MPIR_Alltoall_Scatter_dest_MV2 simgrid::smpi::Coll_alltoall_mvapich2_scatter_dest::alltoall
-#define MPIR_Alltoall_pairwise_MV2 simgrid::smpi::Coll_alltoall_pair::alltoall
-#define MPIR_Alltoall_inplace_MV2 simgrid::smpi::Coll_alltoall_ring::alltoall
-
-
-static void init_mv2_alltoall_tables_stampede(){
-  int i;
-  int agg_table_sum = 0;
-  mv2_alltoall_tuning_table **table_ptrs = NULL;
-  mv2_alltoall_num_ppn_conf = 3;
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_alltoall_thresholds_table = static_cast<mv2_alltoall_tuning_table**>(xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
-      * mv2_alltoall_num_ppn_conf));
-  table_ptrs = static_cast<mv2_alltoall_tuning_table**>(xbt_malloc(sizeof(mv2_alltoall_tuning_table *)
-      * mv2_alltoall_num_ppn_conf));
-  mv2_size_alltoall_tuning_table = static_cast<int*>(xbt_malloc(sizeof(int) *
-      mv2_alltoall_num_ppn_conf));
-  mv2_alltoall_table_ppn_conf = static_cast<int*>(xbt_malloc(mv2_alltoall_num_ppn_conf * sizeof(int)));
-  mv2_alltoall_table_ppn_conf[0] = 1;
-  mv2_size_alltoall_tuning_table[0] = 6;
-  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_1ppn[] = {
-      {2,
-          1,
-          {{0, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {4,
-          2,
-          {{0, 262144, &MPIR_Alltoall_Scatter_dest_MV2},
-              {262144, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {8,
-          2,
-          {{0, 8, &MPIR_Alltoall_RD_MV2},
-              {8, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {16,
-          3,
-          {{0, 64, &MPIR_Alltoall_RD_MV2},
-              {64, 512, &MPIR_Alltoall_bruck_MV2},
-              {512, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0,-1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {32,
-          3,
-          {{0, 32, &MPIR_Alltoall_RD_MV2},
-              {32, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {64,
-          3,
-          {{0, 8, &MPIR_Alltoall_RD_MV2},
-              {8, 1024, &MPIR_Alltoall_bruck_MV2},
-              {1024, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-  };
-  table_ptrs[0] = mv2_tmp_alltoall_thresholds_table_1ppn;
-  mv2_alltoall_table_ppn_conf[1] = 2;
-  mv2_size_alltoall_tuning_table[1] = 6;
-  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_2ppn[] = {
-      {4,
-          2,
-          {{0, 32, &MPIR_Alltoall_RD_MV2},
-              {32, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {8,
-          2,
-          {{0, 64, &MPIR_Alltoall_RD_MV2},
-              {64, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {16,
-          3,
-          {{0, 64, &MPIR_Alltoall_RD_MV2},
-              {64, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0,-1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {32,
-          3,
-          {{0, 16, &MPIR_Alltoall_RD_MV2},
-              {16, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {64,
-          3,
-          {{0, 8, &MPIR_Alltoall_RD_MV2},
-              {8, 1024, &MPIR_Alltoall_bruck_MV2},
-              {1024, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {128,
-          3,
-          {{0, 4, &MPIR_Alltoall_RD_MV2},
-              {4, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{0, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-  };
-  table_ptrs[1] = mv2_tmp_alltoall_thresholds_table_2ppn;
-  mv2_alltoall_table_ppn_conf[2] = 16;
-  mv2_size_alltoall_tuning_table[2] = 7;
-  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_16ppn[] = {
-      {16,
-          2,
-          {{0, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1,  &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{32768, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {32,
-          2,
-          {{0, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
-          },
-
-          {{16384, -1, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {64,
-          3,
-          {{0, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, 16384, &MPIR_Alltoall_Scatter_dest_MV2},
-              {16384, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{32768, 131072, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {128,
-          2,
-          {{0, 2048, &MPIR_Alltoall_bruck_MV2},
-              {2048, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{16384,65536, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {256,
-          2,
-          {{0, 1024, &MPIR_Alltoall_bruck_MV2},
-              {1024, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{16384, 65536, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-      {512,
-          2,
-          {{0, 1024, &MPIR_Alltoall_bruck_MV2},
-              {1024, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{16384, 65536, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-      {1024,
-          2,
-          {{0, 1024, &MPIR_Alltoall_bruck_MV2},
-              {1024, -1, &MPIR_Alltoall_pairwise_MV2},
-          },
-
-          {{16384, 65536, &MPIR_Alltoall_inplace_MV2},
-          },
-      },
-
-  };
-  table_ptrs[2] = mv2_tmp_alltoall_thresholds_table_16ppn;
-  agg_table_sum = 0;
-  for (i = 0; i < mv2_alltoall_num_ppn_conf; i++) {
-      agg_table_sum += mv2_size_alltoall_tuning_table[i];
-  }
-  mv2_alltoall_thresholds_table[0] =
-      static_cast<mv2_alltoall_tuning_table*>(xbt_malloc(agg_table_sum * sizeof (mv2_alltoall_tuning_table)));
-  memcpy(mv2_alltoall_thresholds_table[0], table_ptrs[0],
-      (sizeof(mv2_alltoall_tuning_table)
-          * mv2_size_alltoall_tuning_table[0]));
-  for (i = 1; i < mv2_alltoall_num_ppn_conf; i++) {
-      mv2_alltoall_thresholds_table[i] =
-          mv2_alltoall_thresholds_table[i - 1]
-                                        + mv2_size_alltoall_tuning_table[i - 1];
-      memcpy(mv2_alltoall_thresholds_table[i], table_ptrs[i],
-          (sizeof(mv2_alltoall_tuning_table)
-              * mv2_size_alltoall_tuning_table[i]));
-  }
-  xbt_free(table_ptrs);
-
-
-}
-
-
-/************ Allgather variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Allgatherction)(void *sendbuf,
-      int sendcount,
-      MPI_Datatype sendtype,
-      void *recvbuf,
-      int recvcount,
-      MPI_Datatype recvtype, MPI_Comm comm_ptr);
-} mv2_allgather_tuning_element;
-
-typedef struct {
-  int numproc;
-  int two_level[MV2_MAX_NB_THRESHOLDS];
-  int size_inter_table;
-  mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_allgather_tuning_table;
-
-int (*MV2_Allgatherction)(void *sendbuf,
-    int sendcount,
-    MPI_Datatype sendtype,
-    void *recvbuf,
-    int recvcount,
-    MPI_Datatype recvtype, MPI_Comm comm);
-
-int *mv2_allgather_table_ppn_conf = NULL;
-int mv2_allgather_num_ppn_conf = 1;
-int *mv2_size_allgather_tuning_table = NULL;
-mv2_allgather_tuning_table **mv2_allgather_thresholds_table = NULL;
-
-static int MPIR_Allgather_RD_Allgather_Comm_MV2( void *sendbuf,
-                                 int sendcount,
-                                 MPI_Datatype sendtype,
-                                 void *recvbuf,
-                                 int recvcount,
-                                 MPI_Datatype recvtype, MPI_Comm comm_ptr)
-{
-    return 0;
-}
-
-#define MPIR_Allgather_Bruck_MV2 simgrid::smpi::Coll_allgather_bruck::allgather
-#define MPIR_Allgather_RD_MV2 simgrid::smpi::Coll_allgather_rdb::allgather
-#define MPIR_Allgather_Ring_MV2 simgrid::smpi::Coll_allgather_ring::allgather
-#define MPIR_2lvl_Allgather_MV2 simgrid::smpi::Coll_allgather_mvapich2_smp::allgather
-
-static void init_mv2_allgather_tables_stampede(){
-  int i;
-  int agg_table_sum = 0;
-
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_allgather_tuning_table **table_ptrs = NULL;
-  mv2_allgather_num_ppn_conf = 3;
-  mv2_allgather_thresholds_table
-  = static_cast<mv2_allgather_tuning_table**>(xbt_malloc(sizeof(mv2_allgather_tuning_table *)
-      * mv2_allgather_num_ppn_conf));
-  table_ptrs = static_cast<mv2_allgather_tuning_table**>(xbt_malloc(sizeof(mv2_allgather_tuning_table *)
-      * mv2_allgather_num_ppn_conf));
-  mv2_size_allgather_tuning_table = static_cast<int*>(xbt_malloc(sizeof(int) *
-      mv2_allgather_num_ppn_conf));
-  mv2_allgather_table_ppn_conf
-  = static_cast<int*>(xbt_malloc(mv2_allgather_num_ppn_conf * sizeof(int)));
-  mv2_allgather_table_ppn_conf[0] = 1;
-  mv2_size_allgather_tuning_table[0] = 6;
-  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_1ppn[] = {
-      {
-          2,
-          {0},
-          1,
-          {
-              {0, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          4,
-          {0,0},
-          2,
-          {
-              {0, 262144, &MPIR_Allgather_RD_MV2},
-              {262144, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          8,
-          {0,0},
-          2,
-          {
-              {0, 131072, &MPIR_Allgather_RD_MV2},
-              {131072, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          16,
-          {0,0},
-          2,
-          {
-              {0, 131072, &MPIR_Allgather_RD_MV2},
-              {131072, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          32,
-          {0,0},
-          2,
-          {
-              {0, 65536, &MPIR_Allgather_RD_MV2},
-              {65536, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          64,
-          {0,0},
-          2,
-          {
-              {0, 32768, &MPIR_Allgather_RD_MV2},
-              {32768, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-  };
-  table_ptrs[0] = mv2_tmp_allgather_thresholds_table_1ppn;
-  mv2_allgather_table_ppn_conf[1] = 2;
-  mv2_size_allgather_tuning_table[1] = 6;
-  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_2ppn[] = {
-      {
-          4,
-          {0,0},
-          2,
-          {
-              {0, 524288, &MPIR_Allgather_RD_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          8,
-          {0,1,0},
-          2,
-          {
-              {0, 32768, &MPIR_Allgather_RD_MV2},
-              {32768, 524288, &MPIR_Allgather_Ring_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          16,
-          {0,1,0},
-          2,
-          {
-              {0, 16384, &MPIR_Allgather_RD_MV2},
-              {16384, 524288, &MPIR_Allgather_Ring_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          32,
-          {1,1,0},
-          2,
-          {
-              {0, 65536, &MPIR_Allgather_RD_MV2},
-              {65536, 524288, &MPIR_Allgather_Ring_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          64,
-          {1,1,0},
-          2,
-          {
-              {0, 32768, &MPIR_Allgather_RD_MV2},
-              {32768, 524288, &MPIR_Allgather_Ring_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          128,
-          {1,1,0},
-          2,
-          {
-              {0, 65536, &MPIR_Allgather_RD_MV2},
-              {65536, 524288, &MPIR_Allgather_Ring_MV2},
-              {524288, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-  };
-  table_ptrs[1] = mv2_tmp_allgather_thresholds_table_2ppn;
-  mv2_allgather_table_ppn_conf[2] = 16;
-  mv2_size_allgather_tuning_table[2] = 6;
-  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_16ppn[] = {
-      {
-          16,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          32,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          64,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          128,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          256,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-      {
-          512,
-          {0,0},
-          2,
-          {
-              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2},
-              {1024, -1, &MPIR_Allgather_Ring_MV2},
-          },
-      },
-
-  };
-  table_ptrs[2] = mv2_tmp_allgather_thresholds_table_16ppn;
-  agg_table_sum = 0;
-  for (i = 0; i < mv2_allgather_num_ppn_conf; i++) {
-      agg_table_sum += mv2_size_allgather_tuning_table[i];
-  }
-  mv2_allgather_thresholds_table[0] =
-      static_cast<mv2_allgather_tuning_table*>(xbt_malloc(agg_table_sum * sizeof (mv2_allgather_tuning_table)));
-  memcpy(mv2_allgather_thresholds_table[0], table_ptrs[0],
-      (sizeof(mv2_allgather_tuning_table)
-          * mv2_size_allgather_tuning_table[0]));
-  for (i = 1; i < mv2_allgather_num_ppn_conf; i++) {
-      mv2_allgather_thresholds_table[i] =
-          mv2_allgather_thresholds_table[i - 1]
-                                         + mv2_size_allgather_tuning_table[i - 1];
-      memcpy(mv2_allgather_thresholds_table[i], table_ptrs[i],
-          (sizeof(mv2_allgather_tuning_table)
-              * mv2_size_allgather_tuning_table[i]));
-  }
-  xbt_free(table_ptrs);
-}
-
-
-/************ Gather variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Gather_function)(void *sendbuf, int sendcnt,
-      MPI_Datatype sendtype, void *recvbuf, int recvcnt,
-      MPI_Datatype recvtype, int root, MPI_Comm  comm_ptr);
-} mv2_gather_tuning_element;
-
-
-typedef struct {
-  int numproc;
-  int size_inter_table;
-  mv2_gather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-  int size_intra_table;
-  mv2_gather_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_gather_tuning_table;
-
-int mv2_size_gather_tuning_table=7;
-mv2_gather_tuning_table * mv2_gather_thresholds_table=NULL;
-
-typedef int (*MV2_Gather_function_ptr) (void *sendbuf,
-    int sendcnt,
-    MPI_Datatype sendtype,
-    void *recvbuf,
-    int recvcnt,
-    MPI_Datatype recvtype,
-    int root, MPI_Comm comm);
-
-MV2_Gather_function_ptr MV2_Gather_inter_leader_function = NULL;
-MV2_Gather_function_ptr MV2_Gather_intra_node_function = NULL;
-
-
-
-#define MPIR_Gather_MV2_Direct simgrid::smpi::Coll_gather_ompi_basic_linear::gather
-#define MPIR_Gather_MV2_two_level_Direct simgrid::smpi::Coll_gather_mvapich2_two_level::gather
-#define MPIR_Gather_intra simgrid::smpi::Coll_gather_mpich::gather
-
-
-static void init_mv2_gather_tables_stampede(){
-
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_size_gather_tuning_table=7;
-  mv2_gather_thresholds_table = static_cast<mv2_gather_tuning_table*>(xbt_malloc(mv2_size_gather_tuning_table*
-      sizeof (mv2_gather_tuning_table)));
-  mv2_gather_tuning_table mv2_tmp_gather_thresholds_table[]={
-      {16,
-          2,{{0, 524288, &MPIR_Gather_MV2_Direct},
-              {524288, -1, &MPIR_Gather_intra}},
-              1,{{0, -1, &MPIR_Gather_MV2_Direct}}},
-              {32,
-                  3,{{0, 16384, &MPIR_Gather_MV2_Direct},
-                      {16384, 131072, &MPIR_Gather_intra},
-                      {131072, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                      1,{{0, -1, &MPIR_Gather_intra}}},
-                      {64,
-                          3,{{0, 256, &MPIR_Gather_MV2_two_level_Direct},
-                              {256, 16384, &MPIR_Gather_MV2_Direct},
-                              {256, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                              1,{{0, -1, &MPIR_Gather_intra}}},
-                              {128,
-                                  3,{{0, 512, &MPIR_Gather_MV2_two_level_Direct},
-                                      {512, 16384, &MPIR_Gather_MV2_Direct},
-                                      {16384, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                                      1,{{0, -1, &MPIR_Gather_intra}}},
-                                      {256,
-                                          3,{{0, 512, &MPIR_Gather_MV2_two_level_Direct},
-                                              {512, 16384, &MPIR_Gather_MV2_Direct},
-                                              {16384, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                                              1,{{0, -1, &MPIR_Gather_intra}}},
-                                              {512,
-                                                  3,{{0, 512, &MPIR_Gather_MV2_two_level_Direct},
-                                                      {512, 16384, &MPIR_Gather_MV2_Direct},
-                                                      {8196, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                                                      1,{{0, -1, &MPIR_Gather_intra}}},
-                                                      {1024,
-                                                          3,{{0, 512, &MPIR_Gather_MV2_two_level_Direct},
-                                                              {512, 16384, &MPIR_Gather_MV2_Direct},
-                                                              {8196, -1, &MPIR_Gather_MV2_two_level_Direct}},
-                                                              1,{{0, -1, &MPIR_Gather_intra}}},
-  };
-
-  memcpy(mv2_gather_thresholds_table, mv2_tmp_gather_thresholds_table,
-      mv2_size_gather_tuning_table * sizeof (mv2_gather_tuning_table));
-
-}
-
-
-/************ Allgatherv variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Allgatherv_function)(void *sendbuf,
-      int sendcount,
-      MPI_Datatype sendtype,
-      void *recvbuf,
-      int *recvcounts,
-      int *displs,
-      MPI_Datatype recvtype,
-      MPI_Comm commg);
-} mv2_allgatherv_tuning_element;
-
-typedef struct {
-  int numproc;
-  int size_inter_table;
-  mv2_allgatherv_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_allgatherv_tuning_table;
-
-int (*MV2_Allgatherv_function)(void *sendbuf,
-    int sendcount,
-    MPI_Datatype sendtype,
-    void *recvbuf,
-    int *recvcounts,
-    int *displs,
-    MPI_Datatype recvtype,
-    MPI_Comm comm);
-
-int mv2_size_allgatherv_tuning_table = 0;
-mv2_allgatherv_tuning_table *mv2_allgatherv_thresholds_table = NULL;
-
-#define MPIR_Allgatherv_Rec_Doubling_MV2 simgrid::smpi::Coll_allgatherv_mpich_rdb::allgatherv
-#define MPIR_Allgatherv_Bruck_MV2 simgrid::smpi::Coll_allgatherv_ompi_bruck::allgatherv
-#define MPIR_Allgatherv_Ring_MV2 simgrid::smpi::Coll_allgatherv_mpich_ring::allgatherv
-
-
-static void init_mv2_allgatherv_tables_stampede(){
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_size_allgatherv_tuning_table = 6;
-  mv2_allgatherv_thresholds_table = static_cast<mv2_allgatherv_tuning_table*>(xbt_malloc(mv2_size_allgatherv_tuning_table *
-      sizeof (mv2_allgatherv_tuning_table)));
-  mv2_allgatherv_tuning_table mv2_tmp_allgatherv_thresholds_table[] = {
-      {
-          16,
-          2,
-          {
-              {0, 512, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {512, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-      {
-          32,
-          2,
-          {
-              {0, 512, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {512, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-      {
-          64,
-          2,
-          {
-              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {256, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-      {
-          128,
-          2,
-          {
-              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {256, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-      {
-          256,
-          2,
-          {
-              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {256, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-      {
-          512,
-          2,
-          {
-              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2},
-              {256, -1, &MPIR_Allgatherv_Ring_MV2},
-          },
-      },
-
-  };
-  memcpy(mv2_allgatherv_thresholds_table, mv2_tmp_allgatherv_thresholds_table,
-      mv2_size_allgatherv_tuning_table * sizeof (mv2_allgatherv_tuning_table));
-}
-
-
-/************ Allreduce variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Allreducection)(void *sendbuf,
-      void *recvbuf,
-      int count,
-      MPI_Datatype datatype,
-      MPI_Op op, MPI_Comm comm);
-} mv2_allreduce_tuning_element;
-
-typedef struct {
-  int numproc;
-  int mcast_enabled;
-  int is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
-  int size_inter_table;
-  mv2_allreduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-  int size_intra_table;
-  mv2_allreduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_allreduce_tuning_table;
-
-
-int (*MV2_Allreducection)(void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm comm)=NULL;
-
-
-int (*MV2_Allreduce_intra_function)( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm comm)=NULL;
-
-int mv2_size_allreduce_tuning_table = 0;
-mv2_allreduce_tuning_table *mv2_allreduce_thresholds_table = NULL;
-
-
-
-
-
-static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm comm)
-{
-  return 0;
-}
-
-static  int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm  comm)
-{
-  return 0;
-}
-
-static  int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm  comm)
-{
-  simgrid::smpi::Colls::reduce(sendbuf,recvbuf,count,datatype,op,0,comm);
-  return MPI_SUCCESS;
-}
-
-static  int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op, MPI_Comm  comm)
-{
-  simgrid::smpi::Colls::reduce(sendbuf,recvbuf,count,datatype,op,0,comm);
-  return MPI_SUCCESS;
-}
-
-#define MPIR_Allreduce_pt2pt_rd_MV2 simgrid::smpi::Coll_allreduce_rdb::allreduce
-#define MPIR_Allreduce_pt2pt_rs_MV2 simgrid::smpi::Coll_allreduce_mvapich2_rs::allreduce
-#define MPIR_Allreduce_two_level_MV2 simgrid::smpi::Coll_allreduce_mvapich2_two_level::allreduce
-
-
-static void init_mv2_allreduce_tables_stampede(){
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_size_allreduce_tuning_table = 8;
-  mv2_allreduce_thresholds_table = static_cast<mv2_allreduce_tuning_table*>(xbt_malloc(mv2_size_allreduce_tuning_table *
-      sizeof (mv2_allreduce_tuning_table)));
-  mv2_allreduce_tuning_table mv2_tmp_allreduce_thresholds_table[] = {
-      {
-          16,
-          0,
-          {1, 0},
-          2,
-          {
-              {0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {1024, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 1024, &MPIR_Allreduce_reduce_shmem_MV2},
-              {1024, -1, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          32,
-          0,
-          {1, 1, 0},
-          3,
-          {
-              {0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {1024, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 1024, &MPIR_Allreduce_reduce_shmem_MV2},
-              {1024, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          64,
-          0,
-          {1, 1, 0},
-          3,
-          {
-              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          128,
-          0,
-          {1, 1, 0},
-          3,
-          {
-              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          256,
-          0,
-          {1, 1, 0},
-          3,
-          {
-              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          512,
-          0,
-          {1, 1, 0},
-          3,
-          {
-              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          1024,
-          0,
-          {1, 1, 1, 0},
-          4,
-          {
-              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {512, 8192, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {8192, 65536, &MPIR_Allreduce_pt2pt_rs_MV2},
-              {65536, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-      {
-          2048,
-          0,
-          {1, 1, 1, 0},
-          4,
-          {
-              {0, 64, &MPIR_Allreduce_pt2pt_rd_MV2},
-              {64, 512, &MPIR_Allreduce_reduce_p2p_MV2},
-              {512, 4096, &MPIR_Allreduce_mcst_reduce_two_level_helper_MV2},
-              {4096, 16384, &MPIR_Allreduce_pt2pt_rs_MV2},
-              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
-          },
-          2,
-          {
-              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2},
-              {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
-          },
-      },
-
-  };
-  memcpy(mv2_allreduce_thresholds_table, mv2_tmp_allreduce_thresholds_table,
-      mv2_size_allreduce_tuning_table * sizeof (mv2_allreduce_tuning_table));
-}
-
-
-
-
-typedef struct {
-    int min;
-    int max;
-    int (*MV2_pt_Bcast_function) (void *buf, int count, MPI_Datatype datatype,
-                                  int root, MPI_Comm comm_ptr);
-    int zcpy_pipelined_knomial_factor;
-} mv2_bcast_tuning_element;
-
-typedef struct {
-    int numproc;
-    int bcast_segment_size;
-    int intra_node_knomial_factor;
-    int inter_node_knomial_factor;
-    int is_two_level_bcast[MV2_MAX_NB_THRESHOLDS];
-    int size_inter_table;
-    mv2_bcast_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-    int size_intra_table;
-    mv2_bcast_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_bcast_tuning_table;
-
-int mv2_size_bcast_tuning_table = 0;
-mv2_bcast_tuning_table *mv2_bcast_thresholds_table = NULL;
-
-
-int (*MV2_Bcast_function) (void *buffer, int count, MPI_Datatype datatype,
-                           int root, MPI_Comm comm_ptr) = NULL;
-
-int (*MV2_Bcast_intra_node_function) (void *buffer, int count, MPI_Datatype datatype,
-                                      int root, MPI_Comm comm_ptr) = NULL;
-
-int zcpy_knomial_factor = 2;
-int mv2_pipelined_zcpy_knomial_factor = -1;
-int bcast_segment_size = 8192;
-int mv2_inter_node_knomial_factor = 4;
-int mv2_intra_node_knomial_factor = 4;
-#define mv2_bcast_two_level_system_size  64
-#define mv2_bcast_short_msg             16384
-#define mv2_bcast_large_msg            512*1024
-
-#define INTRA_NODE_ROOT 0
-
-#define MPIR_Pipelined_Bcast_Zcpy_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
-#define MPIR_Pipelined_Bcast_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
-#define MPIR_Bcast_binomial_MV2 simgrid::smpi::Coll_bcast_binomial_tree::bcast
-#define MPIR_Bcast_scatter_ring_allgather_shm_MV2 simgrid::smpi::Coll_bcast_scatter_LR_allgather::bcast
-#define MPIR_Bcast_scatter_doubling_allgather_MV2 simgrid::smpi::Coll_bcast_scatter_rdb_allgather::bcast
-#define MPIR_Bcast_scatter_ring_allgather_MV2 simgrid::smpi::Coll_bcast_scatter_LR_allgather::bcast
-#define MPIR_Shmem_Bcast_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
-#define MPIR_Bcast_tune_inter_node_helper_MV2 simgrid::smpi::Coll_bcast_mvapich2_inter_node::bcast
-#define MPIR_Bcast_inter_node_helper_MV2 simgrid::smpi::Coll_bcast_mvapich2_inter_node::bcast
-#define MPIR_Knomial_Bcast_intra_node_MV2 simgrid::smpi::Coll_bcast_mvapich2_knomial_intra_node::bcast
-#define MPIR_Bcast_intra_MV2 simgrid::smpi::Coll_bcast_mvapich2_intra_node::bcast
-
-static void init_mv2_bcast_tables_stampede(){
- //Stampede,
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_size_bcast_tuning_table=8;
-  mv2_bcast_thresholds_table = static_cast<mv2_bcast_tuning_table*>(xbt_malloc(mv2_size_bcast_tuning_table *
-  sizeof (mv2_bcast_tuning_table)));
-
-  mv2_bcast_tuning_table mv2_tmp_bcast_thresholds_table[]={
-    {
-            16,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
-            11,
-            {
-              {0, 8, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {8, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16, 1024, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {1024, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {8192, 16384, &MPIR_Bcast_binomial_MV2, -1},
-              {16384, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {32768, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {65536, 131072, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1},
-              {131072, 262144, &MPIR_Bcast_scatter_ring_allgather_MV2, -1},
-              {262144, 524288, &MPIR_Bcast_scatter_doubling_allgather_MV2, -1},
-              {524288, -1, &MPIR_Bcast_scatter_ring_allgather_MV2, -1}
-            },
-            11,
-            {
-              {0, 8, &MPIR_Shmem_Bcast_MV2, 2},
-              {8, 16, &MPIR_Shmem_Bcast_MV2, 4},
-              {16, 1024, &MPIR_Shmem_Bcast_MV2, 2},
-              {1024, 8192, &MPIR_Shmem_Bcast_MV2, 4},
-              {8192, 16384, &MPIR_Shmem_Bcast_MV2, -1},
-              {16384, 32768, &MPIR_Shmem_Bcast_MV2, 4},
-              {32768, 65536, &MPIR_Shmem_Bcast_MV2, 2},
-              {65536, 131072, &MPIR_Shmem_Bcast_MV2, -1},
-              {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
-              {262144, 524288, &MPIR_Shmem_Bcast_MV2, -1},
-              {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}
-            }
-    },
-    {
-            32,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1, 1, 1, 1},
-            8,
-            {
-              {0, 128, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {128, 256, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {256, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {32768, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {65536, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {131072, 262144, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {262144, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {524288, -1, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8}
-            },
-            8,
-            {
-              {0, 128, &MPIR_Shmem_Bcast_MV2, 2},
-              {128, 256, &MPIR_Shmem_Bcast_MV2, 4},
-              {256, 32768, &MPIR_Shmem_Bcast_MV2, 2},
-              {32768, 65536, &MPIR_Shmem_Bcast_MV2, 4},
-              {65536, 131072, &MPIR_Shmem_Bcast_MV2, 2},
-              {131072, 262144, &MPIR_Shmem_Bcast_MV2, 8},
-              {262144, 524288, &MPIR_Shmem_Bcast_MV2, 2},
-              {524288, -1, &MPIR_Shmem_Bcast_MV2, 8}
-            }
-    },
-    {
-            64,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1, 1, 1, 1, 1},
-            9,
-            {
-              {0, 2, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {2, 4, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {4, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16, 32, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {32, 128, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {128, 256, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {256, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {4096, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {32768, -1, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2}
-            },
-            9,
-            {
-              {0, 2, &MPIR_Shmem_Bcast_MV2, 4},
-              {2, 4, &MPIR_Shmem_Bcast_MV2, 8},
-              {4, 16, &MPIR_Shmem_Bcast_MV2, 4},
-              {16, 32, &MPIR_Shmem_Bcast_MV2, 8},
-              {32, 128, &MPIR_Shmem_Bcast_MV2, 4},
-              {128, 256, &MPIR_Shmem_Bcast_MV2, 8},
-              {256, 4096, &MPIR_Shmem_Bcast_MV2, 4},
-              {4096, 32768, &MPIR_Shmem_Bcast_MV2, 8},
-              {32768, -1, &MPIR_Shmem_Bcast_MV2, 2}
-            }
-    },
-    {
-            128,
-            8192, 4, 4,
-            {1, 1, 1, 0},
-            4,
-            {
-              {0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16384, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {524288, -1, &MPIR_Bcast_scatter_ring_allgather_MV2, -1}
-            },
-            4,
-            {
-              {0, 8192, &MPIR_Shmem_Bcast_MV2, 8},
-              {8192, 16384, &MPIR_Shmem_Bcast_MV2, 4},
-              {16384, 524288, &MPIR_Shmem_Bcast_MV2, 2},
-              {524288, -1, NULL, -1}
-            }
-    },
-    {
-            256,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1},
-            5,
-            {
-              {0, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16384, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {131072, 262144, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1},
-              {262144, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}
-            },
-            5,
-            {
-              {0, 16384, &MPIR_Shmem_Bcast_MV2, 4},
-              {16384, 131072, &MPIR_Shmem_Bcast_MV2, 2},
-              {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
-              {262144, 524288, &MPIR_Shmem_Bcast_MV2, 2},
-              {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}
-            }
-    },
-    {
-            512,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1},
-            5,
-            {
-              {0, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {4096, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16384, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {131072, 262144, &MPIR_Pipelined_Bcast_MV2, -1},
-              {262144, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}
-            },
-            5,
-            {
-              {0, 4096, &MPIR_Shmem_Bcast_MV2, 8},
-              {4096, 16384, &MPIR_Shmem_Bcast_MV2, 4},
-              {16384, 131072, &MPIR_Shmem_Bcast_MV2, 2},
-              {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
-              {262144, -1, &MPIR_Shmem_Bcast_MV2, -1}
-            }
-    },
-    {
-            1024,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1},
-            5,
-            {
-              {0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16384, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {65536, 524288, &MPIR_Pipelined_Bcast_MV2, -1},
-              {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}
-            },
-            5,
-            {
-              {0, 8192, &MPIR_Shmem_Bcast_MV2, 8},
-              {8192, 16384, &MPIR_Shmem_Bcast_MV2, 4},
-              {16384, 65536, &MPIR_Shmem_Bcast_MV2, 2},
-              {65536, 524288, &MPIR_Shmem_Bcast_MV2, -1},
-              {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}
-            }
-    },
-    {
-            2048,
-            8192, 4, 4,
-            {1, 1, 1, 1, 1, 1, 1},
-            7,
-            {
-              {0, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {16, 32, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {32, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
-              {4096, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
-              {16384, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
-              {32768, 524288, &MPIR_Pipelined_Bcast_MV2, -1},
-              {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}
-            },
-            7,
-            {
-              {0, 16, &MPIR_Shmem_Bcast_MV2, 8},
-              {16, 32, &MPIR_Shmem_Bcast_MV2, 4},
-              {32, 4096, &MPIR_Shmem_Bcast_MV2, 8},
-              {4096, 16384, &MPIR_Shmem_Bcast_MV2, 4},
-              {16384, 32768, &MPIR_Shmem_Bcast_MV2, 2},
-              {32768, 524288, &MPIR_Shmem_Bcast_MV2, -1},
-              {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}
-            }
-    }
-  };
-
-        memcpy(mv2_bcast_thresholds_table, mv2_tmp_bcast_thresholds_table,
-                    mv2_size_bcast_tuning_table * sizeof (mv2_bcast_tuning_table));
-}
-
-
-/************ Reduce variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Reduce_function)(void *sendbuf,
-      void *recvbuf,
-      int count,
-      MPI_Datatype datatype,
-      MPI_Op op,
-      int root,
-      MPI_Comm  comm_ptr);
-} mv2_reduce_tuning_element;
-
-typedef struct {
-  int numproc;
-  int inter_k_degree;
-  int intra_k_degree;
-  int is_two_level_reduce[MV2_MAX_NB_THRESHOLDS];
-  int size_inter_table;
-  mv2_reduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-  int size_intra_table;
-  mv2_reduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_reduce_tuning_table;
-
-int mv2_size_reduce_tuning_table = 0;
-mv2_reduce_tuning_table *mv2_reduce_thresholds_table = NULL;
-
-
-int mv2_reduce_intra_knomial_factor = -1;
-int mv2_reduce_inter_knomial_factor = -1;
-
-int (*MV2_Reduce_function)( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op,
-    int root,
-    MPI_Comm  comm_ptr)=NULL;
-
-int (*MV2_Reduce_intra_function)( void *sendbuf,
-    void *recvbuf,
-    int count,
-    MPI_Datatype datatype,
-    MPI_Op op,
-    int root,
-    MPI_Comm  comm_ptr)=NULL;
-
-
-#define MPIR_Reduce_inter_knomial_wrapper_MV2 simgrid::smpi::Coll_reduce_mvapich2_knomial::reduce
-#define MPIR_Reduce_intra_knomial_wrapper_MV2 simgrid::smpi::Coll_reduce_mvapich2_knomial::reduce
-#define MPIR_Reduce_binomial_MV2 simgrid::smpi::Coll_reduce_binomial::reduce
-#define MPIR_Reduce_redscat_gather_MV2 simgrid::smpi::Coll_reduce_scatter_gather::reduce
-#define MPIR_Reduce_shmem_MV2 simgrid::smpi::Coll_reduce_ompi_basic_linear::reduce
-#define MPIR_Reduce_two_level_helper_MV2 simgrid::smpi::Coll_reduce_mvapich2_two_level::reduce
-
-
-static void init_mv2_reduce_tables_stampede(){
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  /*Stampede*/
-  mv2_size_reduce_tuning_table = 8;
-  mv2_reduce_thresholds_table = static_cast<mv2_reduce_tuning_table*>(xbt_malloc(mv2_size_reduce_tuning_table *
-      sizeof (mv2_reduce_tuning_table)));
-  mv2_reduce_tuning_table mv2_tmp_reduce_thresholds_table[] = {
-      {
-          16,
-          4,
-          4,
-          {1, 0, 0},
-          3,
-          {
-              {0, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
-              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          2,
-          {
-              {0, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536,-1,  &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          32,
-          4,
-          4,
-          {1, 1, 1, 1, 0, 0, 0},
-          7,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 32768, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {32768, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
-              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          6,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 32768, &MPIR_Reduce_shmem_MV2},
-              {32768, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_shmem_MV2},
-              {262144,-1,  &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          64,
-          4,
-          4,
-          {1, 1, 1, 1, 0},
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          128,
-          4,
-          4,
-          {1, 0, 1, 0, 1, 0},
-          6,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
-              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          256,
-          4,
-          4,
-          {1, 1, 1, 0, 1, 1, 0},
-          7,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 32768, &MPIR_Reduce_binomial_MV2},
-              {32768, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_binomial_MV2},
-              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
-              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          6,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 32768, &MPIR_Reduce_shmem_MV2},
-              {32768, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          512,
-          4,
-          4,
-          {1, 0, 1, 1, 1, 0},
-          6,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_binomial_MV2},
-              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
-              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
-          },
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          1024,
-          4,
-          4,
-          {1, 0, 1, 1, 1},
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 262144, &MPIR_Reduce_binomial_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-          5,
-          {
-              {0, 8192, &MPIR_Reduce_shmem_MV2},
-              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {16384, 65536, &MPIR_Reduce_shmem_MV2},
-              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {262144, -1, &MPIR_Reduce_binomial_MV2},
-          },
-      },
-      {
-          2048,
-          4,
-          4,
-          {1, 0, 1, 1, 1,1},
-          6,
-          {
-              {0, 2048, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {2048, 4096, &MPIR_Reduce_inter_knomial_wrapper_MV2},
-              {4096, 16384, &MPIR_Reduce_binomial_MV2},
-              {16384, 65536, &MPIR_Reduce_binomial_MV2},
-              {65536, 131072, &MPIR_Reduce_binomial_MV2},
-              {131072, -1, &MPIR_Reduce_binomial_MV2},
-          },
-          6,
-          {
-              {0, 2048, &MPIR_Reduce_shmem_MV2},
-              {2048, 4096, &MPIR_Reduce_shmem_MV2},
-              {4096, 16384, &MPIR_Reduce_shmem_MV2},
-              {16384, 65536, &MPIR_Reduce_intra_knomial_wrapper_MV2},
-              {65536, 131072, &MPIR_Reduce_binomial_MV2},
-              {131072, -1, &MPIR_Reduce_shmem_MV2},
-          },
-      },
-
-  };
-  memcpy(mv2_reduce_thresholds_table, mv2_tmp_reduce_thresholds_table,
-      mv2_size_reduce_tuning_table * sizeof (mv2_reduce_tuning_table));
-}
-
-/************ Reduce scatter variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Red_scat_function)(void *sendbuf,
-      void *recvbuf,
-      int *recvcnts,
-      MPI_Datatype datatype,
-      MPI_Op op,
-      MPI_Comm comm_ptr);
-} mv2_red_scat_tuning_element;
-
-typedef struct {
-  int numproc;
-  int size_inter_table;
-  mv2_red_scat_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-} mv2_red_scat_tuning_table;
-
-int mv2_size_red_scat_tuning_table = 0;
-mv2_red_scat_tuning_table *mv2_red_scat_thresholds_table = NULL;
-
-
-int (*MV2_Red_scat_function)(void *sendbuf,
-    void *recvbuf,
-    int *recvcnts,
-    MPI_Datatype datatype,
-    MPI_Op op,
-    MPI_Comm comm_ptr);
-
-
-
-static  int MPIR_Reduce_Scatter_Basic_MV2(void *sendbuf,
-    void *recvbuf,
-    int *recvcnts,
-    MPI_Datatype datatype,
-    MPI_Op op,
-    MPI_Comm comm)
-{
-  simgrid::smpi::Coll_reduce_scatter_default::reduce_scatter(sendbuf,recvbuf,recvcnts,datatype,op,comm);
-  return MPI_SUCCESS;
-}
-#define MPIR_Reduce_scatter_non_comm_MV2 simgrid::smpi::Coll_reduce_scatter_mpich_noncomm::reduce_scatter
-#define MPIR_Reduce_scatter_Rec_Halving_MV2 simgrid::smpi::Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter
-#define MPIR_Reduce_scatter_Pair_Wise_MV2 simgrid::smpi::Coll_reduce_scatter_mpich_pair::reduce_scatter
-
-
-
-
-static void init_mv2_reduce_scatter_tables_stampede(){
-  if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-  mv2_size_red_scat_tuning_table = 6;
-  mv2_red_scat_thresholds_table = static_cast<mv2_red_scat_tuning_table*>(xbt_malloc(mv2_size_red_scat_tuning_table *
-      sizeof (mv2_red_scat_tuning_table)));
-  mv2_red_scat_tuning_table mv2_tmp_red_scat_thresholds_table[] = {
-      {
-          16,
-          3,
-          {
-              {0, 64, &MPIR_Reduce_Scatter_Basic_MV2},
-              {64, 65536, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-              {65536, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
-          },
-      },
-      {
-          32,
-          3,
-          {
-              {0, 64, &MPIR_Reduce_Scatter_Basic_MV2},
-              {64, 131072, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-              {131072, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
-          },
-      },
-      {
-          64,
-          3,
-          {
-              {0, 1024, &MPIR_Reduce_Scatter_Basic_MV2},
-              {1024, 262144, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-              {262144, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
-          },
-      },
-      {
-          128,
-          2,
-          {
-              {0, 128, &MPIR_Reduce_Scatter_Basic_MV2},
-              {128, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-          },
-      },
-      {
-          256,
-          2,
-          {
-              {0, 128, &MPIR_Reduce_Scatter_Basic_MV2},
-              {128, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-          },
-      },
-      {
-          512,
-          2,
-          {
-              {0, 256, &MPIR_Reduce_Scatter_Basic_MV2},
-              {256, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
-          },
-      },
-
-  };
-  memcpy(mv2_red_scat_thresholds_table, mv2_tmp_red_scat_thresholds_table,
-      mv2_size_red_scat_tuning_table * sizeof (mv2_red_scat_tuning_table));
-}
-
-/************ Scatter variables and initializers                        */
-
-typedef struct {
-  int min;
-  int max;
-  int (*MV2_pt_Scatter_function)(void *sendbuf,
-      int sendcnt,
-      MPI_Datatype sendtype,
-      void *recvbuf,
-      int recvcnt,
-      MPI_Datatype recvtype,
-      int root, MPI_Comm comm);
-} mv2_scatter_tuning_element;
-
-typedef struct {
-  int numproc;
-  int size_inter_table;
-  mv2_scatter_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
-  int size_intra_table;
-  mv2_scatter_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
-} mv2_scatter_tuning_table;
-
-
-int *mv2_scatter_table_ppn_conf = NULL;
-int mv2_scatter_num_ppn_conf = 1;
-int *mv2_size_scatter_tuning_table = NULL;
-mv2_scatter_tuning_table **mv2_scatter_thresholds_table = NULL;
-
-int (*MV2_Scatter_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
-    void *recvbuf, int recvcount, MPI_Datatype recvtype,
-    int root, MPI_Comm comm)=NULL;
-
-int (*MV2_Scatter_intra_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
-    void *recvbuf, int recvcount, MPI_Datatype recvtype,
-    int root, MPI_Comm comm)=NULL;
-int MPIR_Scatter_mcst_wrap_MV2(void *sendbuf,
-    int sendcnt,
-    MPI_Datatype sendtype,
-    void *recvbuf,
-    int recvcnt,
-    MPI_Datatype recvtype,
-    int root, MPI_Comm comm_ptr);
-
-int MPIR_Scatter_mcst_wrap_MV2(void *sendbuf,
-    int sendcnt,
-    MPI_Datatype sendtype,
-    void *recvbuf,
-    int recvcnt,
-    MPI_Datatype recvtype,
-    int root, MPI_Comm comm_ptr)
-{
-  return 0;
-}
-
-#define MPIR_Scatter_MV2_Binomial simgrid::smpi::Coll_scatter_ompi_binomial::scatter
-#define MPIR_Scatter_MV2_Direct  simgrid::smpi::Coll_scatter_ompi_basic_linear::scatter
-#define MPIR_Scatter_MV2_two_level_Binomial  simgrid::smpi::Coll_scatter_mvapich2_two_level_binomial::scatter
-#define MPIR_Scatter_MV2_two_level_Direct  simgrid::smpi::Coll_scatter_mvapich2_two_level_direct::scatter
-
-
-
-
-static void init_mv2_scatter_tables_stampede(){
-    if(simgrid::smpi::Colls::smpi_coll_cleanup_callback==NULL)
-      simgrid::smpi::Colls::smpi_coll_cleanup_callback=&smpi_coll_cleanup_mvapich2;
-
-    int agg_table_sum = 0;
-    int i;
-    mv2_scatter_tuning_table **table_ptrs = NULL;
-    mv2_scatter_num_ppn_conf = 3;
-    mv2_scatter_thresholds_table
-    = static_cast<mv2_scatter_tuning_table**>(xbt_malloc(sizeof(mv2_scatter_tuning_table *)
-        * mv2_scatter_num_ppn_conf));
-    table_ptrs = static_cast<mv2_scatter_tuning_table**>(xbt_malloc(sizeof(mv2_scatter_tuning_table *)
-        * mv2_scatter_num_ppn_conf));
-    mv2_size_scatter_tuning_table = static_cast<int*>(xbt_malloc(sizeof(int) *
-        mv2_scatter_num_ppn_conf));
-    mv2_scatter_table_ppn_conf
-    = static_cast<int*>(xbt_malloc(mv2_scatter_num_ppn_conf * sizeof(int)));
-    mv2_scatter_table_ppn_conf[0] = 1;
-    mv2_size_scatter_tuning_table[0] = 6;
-    mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_1ppn[] = {
-        {2,
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-
-        {4,
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {8,
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {16,
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {32,
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {64,
-            2,
-            {
-                {0, 32, &MPIR_Scatter_MV2_Binomial},
-                {32, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-    };
-    table_ptrs[0] = mv2_tmp_scatter_thresholds_table_1ppn;
-    mv2_scatter_table_ppn_conf[1] = 2;
-    mv2_size_scatter_tuning_table[1] = 6;
-    mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_2ppn[] = {
-        {4,
-            2,
-            {
-                {0, 4096, &MPIR_Scatter_MV2_Binomial},
-                {4096, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {8,
-            2,
-            {
-                {0, 512, &MPIR_Scatter_MV2_two_level_Direct},
-                {512, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-
-        {16,
-            2,
-            {
-                {0, 2048, &MPIR_Scatter_MV2_two_level_Direct},
-                {2048, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-
-        {32,
-            2,
-            {
-                {0, 2048, &MPIR_Scatter_MV2_two_level_Direct},
-                {2048, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-
-        {64,
-            2,
-            {
-                {0, 8192, &MPIR_Scatter_MV2_two_level_Direct},
-                {8192, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-
-        {128,
-            4,
-            {
-                {0, 16, &MPIR_Scatter_MV2_Binomial},
-                {16, 128, &MPIR_Scatter_MV2_two_level_Binomial},
-                {128, 16384, &MPIR_Scatter_MV2_two_level_Direct},
-                {16384, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                {0, 128, &MPIR_Scatter_MV2_Direct},
-                {128, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-    };
-    table_ptrs[1] = mv2_tmp_scatter_thresholds_table_2ppn;
-    mv2_scatter_table_ppn_conf[2] = 16;
-    mv2_size_scatter_tuning_table[2] = 8;
-    mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_16ppn[] = {
-        {
-            16,
-            2,
-            {
-                {0, 256, &MPIR_Scatter_MV2_Binomial},
-                {256, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {
-            32,
-            2,
-            {
-                {0, 512, &MPIR_Scatter_MV2_Binomial},
-                {512, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {
-            64,
-            2,
-            {
-                {0, 1024, &MPIR_Scatter_MV2_two_level_Direct},
-                {1024, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {
-            128,
-            4,
-            {
-                {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
-                {0, 16, &MPIR_Scatter_MV2_two_level_Direct},
-                {16, 2048, &MPIR_Scatter_MV2_two_level_Direct},
-                {2048, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {
-            256,
-            4,
-            {
-                {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
-                {0, 16, &MPIR_Scatter_MV2_two_level_Direct},
-                {16, 2048, &MPIR_Scatter_MV2_two_level_Direct},
-                {2048, -1,  &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-
-        {
-            512,
-            4,
-            {
-                {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
-                {16, 16, &MPIR_Scatter_MV2_two_level_Direct},
-                {16, 4096, &MPIR_Scatter_MV2_two_level_Direct},
-                {4096, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-        {
-            1024,
-            5,
-            {
-                {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
-                {0, 16,  &MPIR_Scatter_MV2_Binomial},
-                {16, 32, &MPIR_Scatter_MV2_Binomial},
-                {32, 4096, &MPIR_Scatter_MV2_two_level_Direct},
-                {4096, -1, &MPIR_Scatter_MV2_Direct},
-            },
-            1,
-            {
-                { 0, -1, &MPIR_Scatter_MV2_Binomial},
-            },
-        },
-        {
-            2048,
-            7,
-            {
-                {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
-                {0, 16,  &MPIR_Scatter_MV2_two_level_Binomial},
-                {16, 128, &MPIR_Scatter_MV2_two_level_Binomial},
-                {128, 1024, &MPIR_Scatter_MV2_two_level_Direct},
-                {1024, 16384, &MPIR_Scatter_MV2_two_level_Direct},
-                {16384, 65536, &MPIR_Scatter_MV2_Direct},
-                {65536, -1, &MPIR_Scatter_MV2_two_level_Direct},
-            },
-            6,
-            {
-                {0, 16, &MPIR_Scatter_MV2_Binomial},
-                {16, 128, &MPIR_Scatter_MV2_Binomial},
-                {128, 1024, &MPIR_Scatter_MV2_Binomial},
-                {1024, 16384, &MPIR_Scatter_MV2_Direct},
-                {16384, 65536, &MPIR_Scatter_MV2_Direct},
-                {65536, -1, &MPIR_Scatter_MV2_Direct},
-            },
-        },
-    };
-    table_ptrs[2] = mv2_tmp_scatter_thresholds_table_16ppn;
-    agg_table_sum = 0;
-    for (i = 0; i < mv2_scatter_num_ppn_conf; i++) {
-        agg_table_sum += mv2_size_scatter_tuning_table[i];
-    }
-    mv2_scatter_thresholds_table[0] =
-        static_cast<mv2_scatter_tuning_table*>(xbt_malloc(agg_table_sum * sizeof (mv2_scatter_tuning_table)));
-    memcpy(mv2_scatter_thresholds_table[0], table_ptrs[0],
-        (sizeof(mv2_scatter_tuning_table)
-            * mv2_size_scatter_tuning_table[0]));
-    for (i = 1; i < mv2_scatter_num_ppn_conf; i++) {
-        mv2_scatter_thresholds_table[i] =
-            mv2_scatter_thresholds_table[i - 1]
-                                         + mv2_size_scatter_tuning_table[i - 1];
-        memcpy(mv2_scatter_thresholds_table[i], table_ptrs[i],
-            (sizeof(mv2_scatter_tuning_table)
-                * mv2_size_scatter_tuning_table[i]));
-    }
-    xbt_free(table_ptrs);
-
-}
-
diff --git a/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp b/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
new file mode 100644 (file)
index 0000000..24cdf97
--- /dev/null
@@ -0,0 +1,1815 @@
+/* selector for collective algorithms based on mvapich decision logic, with calibration from Stampede cluster at TACC*/
+/* This is the tuning used by MVAPICH for Stampede platform based on (MV2_ARCH_INTEL_XEON_E5_2680_16,
+ * MV2_HCA_MLX_CX_FDR) */
+
+/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/************ Alltoall variables and initializers                        */
+
+#ifndef SMPI_MVAPICH2_SELECTOR_STAMPEDE_HPP
+#define SMPI_MVAPICH2_SELECTOR_STAMPEDE_HPP
+
+#include <algorithm>
+
+#define MV2_MAX_NB_THRESHOLDS 32
+
+XBT_PUBLIC(void) smpi_coll_cleanup_mvapich2(void);
+
+struct mv2_alltoall_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                                  MPI_Datatype recvtype, MPI_Comm comm_ptr);
+};
+
+struct mv2_alltoall_tuning_table {
+  int numproc;
+  int size_table;
+  mv2_alltoall_tuning_element algo_table[MV2_MAX_NB_THRESHOLDS];
+  mv2_alltoall_tuning_element in_place_algo_table[MV2_MAX_NB_THRESHOLDS];
+};
+
+int (*MV2_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                             MPI_Datatype recvtype, MPI_Comm comm_ptr) = NULL;
+
+/* Indicates number of processes per node */
+int* mv2_alltoall_table_ppn_conf = NULL;
+/* Indicates total number of configurations */
+int mv2_alltoall_num_ppn_conf                             = 1;
+int* mv2_size_alltoall_tuning_table                       = NULL;
+mv2_alltoall_tuning_table** mv2_alltoall_thresholds_table = NULL;
+
+#define MPIR_Alltoall_bruck_MV2 simgrid::smpi::Coll_alltoall_bruck::alltoall
+#define MPIR_Alltoall_RD_MV2 simgrid::smpi::Coll_alltoall_rdb::alltoall
+#define MPIR_Alltoall_Scatter_dest_MV2 simgrid::smpi::Coll_alltoall_mvapich2_scatter_dest::alltoall
+#define MPIR_Alltoall_pairwise_MV2 simgrid::smpi::Coll_alltoall_pair::alltoall
+#define MPIR_Alltoall_inplace_MV2 simgrid::smpi::Coll_alltoall_ring::alltoall
+
+static void init_mv2_alltoall_tables_stampede()
+{
+  int agg_table_sum                      = 0;
+  mv2_alltoall_tuning_table** table_ptrs = NULL;
+  mv2_alltoall_num_ppn_conf              = 3;
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_alltoall_thresholds_table                      = new mv2_alltoall_tuning_table*[mv2_alltoall_num_ppn_conf];
+  table_ptrs                                         = new mv2_alltoall_tuning_table*[mv2_alltoall_num_ppn_conf];
+  mv2_size_alltoall_tuning_table                     = new int[mv2_alltoall_num_ppn_conf];
+  mv2_alltoall_table_ppn_conf                        = new int[mv2_alltoall_num_ppn_conf];
+  mv2_alltoall_table_ppn_conf[0]    = 1;
+  mv2_size_alltoall_tuning_table[0] = 6;
+  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_1ppn[] = {
+      {
+          2,
+          1,
+          {
+              {0, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          4,
+          2,
+          {
+              {0, 262144, &MPIR_Alltoall_Scatter_dest_MV2}, {262144, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          8,
+          2,
+          {
+              {0, 8, &MPIR_Alltoall_RD_MV2}, {8, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          16,
+          3,
+          {
+              {0, 64, &MPIR_Alltoall_RD_MV2},
+              {64, 512, &MPIR_Alltoall_bruck_MV2},
+              {512, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          32,
+          3,
+          {
+              {0, 32, &MPIR_Alltoall_RD_MV2},
+              {32, 2048, &MPIR_Alltoall_bruck_MV2},
+              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          64,
+          3,
+          {
+              {0, 8, &MPIR_Alltoall_RD_MV2},
+              {8, 1024, &MPIR_Alltoall_bruck_MV2},
+              {1024, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+  };
+  table_ptrs[0]                                                      = mv2_tmp_alltoall_thresholds_table_1ppn;
+  mv2_alltoall_table_ppn_conf[1]                                     = 2;
+  mv2_size_alltoall_tuning_table[1]                                  = 6;
+  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_2ppn[] = {
+      {
+          4,
+          2,
+          {
+              {0, 32, &MPIR_Alltoall_RD_MV2}, {32, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          8,
+          2,
+          {
+              {0, 64, &MPIR_Alltoall_RD_MV2}, {64, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          16,
+          3,
+          {
+              {0, 64, &MPIR_Alltoall_RD_MV2},
+              {64, 2048, &MPIR_Alltoall_bruck_MV2},
+              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          32,
+          3,
+          {
+              {0, 16, &MPIR_Alltoall_RD_MV2},
+              {16, 2048, &MPIR_Alltoall_bruck_MV2},
+              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          64,
+          3,
+          {
+              {0, 8, &MPIR_Alltoall_RD_MV2},
+              {8, 1024, &MPIR_Alltoall_bruck_MV2},
+              {1024, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          128,
+          3,
+          {
+              {0, 4, &MPIR_Alltoall_RD_MV2},
+              {4, 2048, &MPIR_Alltoall_bruck_MV2},
+              {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {0, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+  };
+  table_ptrs[1]                                                       = mv2_tmp_alltoall_thresholds_table_2ppn;
+  mv2_alltoall_table_ppn_conf[2]                                      = 16;
+  mv2_size_alltoall_tuning_table[2]                                   = 7;
+  mv2_alltoall_tuning_table mv2_tmp_alltoall_thresholds_table_16ppn[] = {
+      {
+          16,
+          2,
+          {
+              {0, 2048, &MPIR_Alltoall_bruck_MV2}, {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {32768, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          32,
+          2,
+          {
+              {0, 2048, &MPIR_Alltoall_bruck_MV2}, {2048, -1, &MPIR_Alltoall_Scatter_dest_MV2},
+          },
+
+          {
+              {16384, -1, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          64,
+          3,
+          {
+              {0, 2048, &MPIR_Alltoall_bruck_MV2},
+              {2048, 16384, &MPIR_Alltoall_Scatter_dest_MV2},
+              {16384, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {32768, 131072, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          128,
+          2,
+          {
+              {0, 2048, &MPIR_Alltoall_bruck_MV2}, {2048, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {16384, 65536, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          256,
+          2,
+          {
+              {0, 1024, &MPIR_Alltoall_bruck_MV2}, {1024, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {16384, 65536, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+      {
+          512,
+          2,
+          {
+              {0, 1024, &MPIR_Alltoall_bruck_MV2}, {1024, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {16384, 65536, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+      {
+          1024,
+          2,
+          {
+              {0, 1024, &MPIR_Alltoall_bruck_MV2}, {1024, -1, &MPIR_Alltoall_pairwise_MV2},
+          },
+
+          {
+              {16384, 65536, &MPIR_Alltoall_inplace_MV2},
+          },
+      },
+
+  };
+  table_ptrs[2] = mv2_tmp_alltoall_thresholds_table_16ppn;
+  agg_table_sum = 0;
+  for (int i = 0; i < mv2_alltoall_num_ppn_conf; i++) {
+    agg_table_sum += mv2_size_alltoall_tuning_table[i];
+  }
+  mv2_alltoall_thresholds_table[0] = new mv2_alltoall_tuning_table[agg_table_sum];
+  std::copy_n(table_ptrs[0], mv2_size_alltoall_tuning_table[0], mv2_alltoall_thresholds_table[0]);
+  for (int i = 1; i < mv2_alltoall_num_ppn_conf; i++) {
+    mv2_alltoall_thresholds_table[i] = mv2_alltoall_thresholds_table[i - 1] + mv2_size_alltoall_tuning_table[i - 1];
+    std::copy_n(table_ptrs[i], mv2_size_alltoall_tuning_table[i], mv2_alltoall_thresholds_table[i]);
+  }
+  delete[] table_ptrs;
+}
+
+/************ Allgather variables and initializers                        */
+
+struct mv2_allgather_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                               MPI_Datatype recvtype, MPI_Comm comm_ptr);
+};
+
+struct mv2_allgather_tuning_table {
+  int numproc;
+  int two_level[MV2_MAX_NB_THRESHOLDS];
+  int size_inter_table;
+  mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+};
+
+int (*MV2_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                          MPI_Datatype recvtype, MPI_Comm comm);
+
+int* mv2_allgather_table_ppn_conf                           = NULL;
+int mv2_allgather_num_ppn_conf                              = 1;
+int* mv2_size_allgather_tuning_table                        = NULL;
+mv2_allgather_tuning_table** mv2_allgather_thresholds_table = NULL;
+
+static int MPIR_Allgather_RD_Allgather_Comm_MV2(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                                int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr)
+{
+  return 0;
+}
+
+#define MPIR_Allgather_Bruck_MV2 simgrid::smpi::Coll_allgather_bruck::allgather
+#define MPIR_Allgather_RD_MV2 simgrid::smpi::Coll_allgather_rdb::allgather
+#define MPIR_Allgather_Ring_MV2 simgrid::smpi::Coll_allgather_ring::allgather
+#define MPIR_2lvl_Allgather_MV2 simgrid::smpi::Coll_allgather_mvapich2_smp::allgather
+
+static void init_mv2_allgather_tables_stampede()
+{
+  int agg_table_sum = 0;
+
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_allgather_tuning_table** table_ptrs            = NULL;
+  mv2_allgather_num_ppn_conf                         = 3;
+  mv2_allgather_thresholds_table                     = new mv2_allgather_tuning_table*[mv2_allgather_num_ppn_conf];
+  table_ptrs                                         = new mv2_allgather_tuning_table*[mv2_allgather_num_ppn_conf];
+  mv2_size_allgather_tuning_table                    = new int[mv2_allgather_num_ppn_conf];
+  mv2_allgather_table_ppn_conf                       = new int[mv2_allgather_num_ppn_conf];
+  mv2_allgather_table_ppn_conf[0]    = 1;
+  mv2_size_allgather_tuning_table[0] = 6;
+  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_1ppn[] = {
+      {
+          2,
+          {0},
+          1,
+          {
+              {0, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          4,
+          {0, 0},
+          2,
+          {
+              {0, 262144, &MPIR_Allgather_RD_MV2}, {262144, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          8,
+          {0, 0},
+          2,
+          {
+              {0, 131072, &MPIR_Allgather_RD_MV2}, {131072, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          16,
+          {0, 0},
+          2,
+          {
+              {0, 131072, &MPIR_Allgather_RD_MV2}, {131072, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          32,
+          {0, 0},
+          2,
+          {
+              {0, 65536, &MPIR_Allgather_RD_MV2}, {65536, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          64,
+          {0, 0},
+          2,
+          {
+              {0, 32768, &MPIR_Allgather_RD_MV2}, {32768, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+  };
+  table_ptrs[0]                                                        = mv2_tmp_allgather_thresholds_table_1ppn;
+  mv2_allgather_table_ppn_conf[1]                                      = 2;
+  mv2_size_allgather_tuning_table[1]                                   = 6;
+  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_2ppn[] = {
+      {
+          4,
+          {0, 0},
+          2,
+          {
+              {0, 524288, &MPIR_Allgather_RD_MV2}, {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          8,
+          {0, 1, 0},
+          2,
+          {
+              {0, 32768, &MPIR_Allgather_RD_MV2},
+              {32768, 524288, &MPIR_Allgather_Ring_MV2},
+              {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          16,
+          {0, 1, 0},
+          2,
+          {
+              {0, 16384, &MPIR_Allgather_RD_MV2},
+              {16384, 524288, &MPIR_Allgather_Ring_MV2},
+              {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          32,
+          {1, 1, 0},
+          2,
+          {
+              {0, 65536, &MPIR_Allgather_RD_MV2},
+              {65536, 524288, &MPIR_Allgather_Ring_MV2},
+              {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          64,
+          {1, 1, 0},
+          2,
+          {
+              {0, 32768, &MPIR_Allgather_RD_MV2},
+              {32768, 524288, &MPIR_Allgather_Ring_MV2},
+              {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          128,
+          {1, 1, 0},
+          2,
+          {
+              {0, 65536, &MPIR_Allgather_RD_MV2},
+              {65536, 524288, &MPIR_Allgather_Ring_MV2},
+              {524288, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+  };
+  table_ptrs[1]                                                         = mv2_tmp_allgather_thresholds_table_2ppn;
+  mv2_allgather_table_ppn_conf[2]                                       = 16;
+  mv2_size_allgather_tuning_table[2]                                    = 6;
+  mv2_allgather_tuning_table mv2_tmp_allgather_thresholds_table_16ppn[] = {
+      {
+          16,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          32,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          64,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          128,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          256,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+      {
+          512,
+          {0, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allgather_RD_Allgather_Comm_MV2}, {1024, -1, &MPIR_Allgather_Ring_MV2},
+          },
+      },
+
+  };
+  table_ptrs[2] = mv2_tmp_allgather_thresholds_table_16ppn;
+  agg_table_sum = 0;
+  for (int i = 0; i < mv2_allgather_num_ppn_conf; i++) {
+    agg_table_sum += mv2_size_allgather_tuning_table[i];
+  }
+  mv2_allgather_thresholds_table[0] = new mv2_allgather_tuning_table[agg_table_sum];
+  std::copy_n(table_ptrs[0], mv2_size_allgather_tuning_table[0], mv2_allgather_thresholds_table[0]);
+  for (int i = 1; i < mv2_allgather_num_ppn_conf; i++) {
+    mv2_allgather_thresholds_table[i] = mv2_allgather_thresholds_table[i - 1] + mv2_size_allgather_tuning_table[i - 1];
+    std::copy_n(table_ptrs[i], mv2_size_allgather_tuning_table[i], mv2_allgather_thresholds_table[i]);
+  }
+  delete[] table_ptrs;
+}
+
+/************ Gather variables and initializers                        */
+
+struct mv2_gather_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Gather_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                                MPI_Datatype recvtype, int root, MPI_Comm comm_ptr);
+};
+
+struct mv2_gather_tuning_table {
+  int numproc;
+  int size_inter_table;
+  mv2_gather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+  int size_intra_table;
+  mv2_gather_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
+};
+
+int mv2_size_gather_tuning_table                     = 7;
+mv2_gather_tuning_table* mv2_gather_thresholds_table = NULL;
+
+typedef int (*MV2_Gather_function_ptr)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                                       MPI_Datatype recvtype, int root, MPI_Comm comm);
+
+MV2_Gather_function_ptr MV2_Gather_inter_leader_function = NULL;
+MV2_Gather_function_ptr MV2_Gather_intra_node_function   = NULL;
+
+#define MPIR_Gather_MV2_Direct simgrid::smpi::Coll_gather_ompi_basic_linear::gather
+#define MPIR_Gather_MV2_two_level_Direct simgrid::smpi::Coll_gather_mvapich2_two_level::gather
+#define MPIR_Gather_intra simgrid::smpi::Coll_gather_mpich::gather
+
+static void init_mv2_gather_tables_stampede()
+{
+
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_size_gather_tuning_table                       = 7;
+  mv2_gather_thresholds_table                               = new mv2_gather_tuning_table[mv2_size_gather_tuning_table];
+  mv2_gather_tuning_table mv2_tmp_gather_thresholds_table[] = {
+      {16,
+       2,
+       {{0, 524288, &MPIR_Gather_MV2_Direct}, {524288, -1, &MPIR_Gather_intra}},
+       1,
+       {{0, -1, &MPIR_Gather_MV2_Direct}}},
+      {32,
+       3,
+       {{0, 16384, &MPIR_Gather_MV2_Direct},
+        {16384, 131072, &MPIR_Gather_intra},
+        {131072, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+      {64,
+       3,
+       {{0, 256, &MPIR_Gather_MV2_two_level_Direct},
+        {256, 16384, &MPIR_Gather_MV2_Direct},
+        {256, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+      {128,
+       3,
+       {{0, 512, &MPIR_Gather_MV2_two_level_Direct},
+        {512, 16384, &MPIR_Gather_MV2_Direct},
+        {16384, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+      {256,
+       3,
+       {{0, 512, &MPIR_Gather_MV2_two_level_Direct},
+        {512, 16384, &MPIR_Gather_MV2_Direct},
+        {16384, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+      {512,
+       3,
+       {{0, 512, &MPIR_Gather_MV2_two_level_Direct},
+        {512, 16384, &MPIR_Gather_MV2_Direct},
+        {8196, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+      {1024,
+       3,
+       {{0, 512, &MPIR_Gather_MV2_two_level_Direct},
+        {512, 16384, &MPIR_Gather_MV2_Direct},
+        {8196, -1, &MPIR_Gather_MV2_two_level_Direct}},
+       1,
+       {{0, -1, &MPIR_Gather_intra}}},
+  };
+
+  std::copy_n(mv2_tmp_gather_thresholds_table, mv2_size_gather_tuning_table, mv2_gather_thresholds_table);
+}
+
+/************ Allgatherv variables and initializers                        */
+
+struct mv2_allgatherv_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
+                                    int* displs, MPI_Datatype recvtype, MPI_Comm commg);
+};
+
+struct mv2_allgatherv_tuning_table {
+  int numproc;
+  int size_inter_table;
+  mv2_allgatherv_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+};
+
+int (*MV2_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
+                               int* displs, MPI_Datatype recvtype, MPI_Comm comm);
+
+int mv2_size_allgatherv_tuning_table                         = 0;
+mv2_allgatherv_tuning_table* mv2_allgatherv_thresholds_table = NULL;
+
+#define MPIR_Allgatherv_Rec_Doubling_MV2 simgrid::smpi::Coll_allgatherv_mpich_rdb::allgatherv
+#define MPIR_Allgatherv_Bruck_MV2 simgrid::smpi::Coll_allgatherv_ompi_bruck::allgatherv
+#define MPIR_Allgatherv_Ring_MV2 simgrid::smpi::Coll_allgatherv_mpich_ring::allgatherv
+
+static void init_mv2_allgatherv_tables_stampede()
+{
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_size_allgatherv_tuning_table                   = 6;
+  mv2_allgatherv_thresholds_table = new mv2_allgatherv_tuning_table[mv2_size_allgatherv_tuning_table];
+  mv2_allgatherv_tuning_table mv2_tmp_allgatherv_thresholds_table[] = {
+      {
+          16,
+          2,
+          {
+              {0, 512, &MPIR_Allgatherv_Rec_Doubling_MV2}, {512, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+      {
+          32,
+          2,
+          {
+              {0, 512, &MPIR_Allgatherv_Rec_Doubling_MV2}, {512, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+      {
+          64,
+          2,
+          {
+              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2}, {256, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+      {
+          128,
+          2,
+          {
+              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2}, {256, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+      {
+          256,
+          2,
+          {
+              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2}, {256, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+      {
+          512,
+          2,
+          {
+              {0, 256, &MPIR_Allgatherv_Rec_Doubling_MV2}, {256, -1, &MPIR_Allgatherv_Ring_MV2},
+          },
+      },
+
+  };
+  std::copy_n(mv2_tmp_allgatherv_thresholds_table, mv2_size_allgatherv_tuning_table, mv2_allgatherv_thresholds_table);
+}
+
+/************ Allreduce variables and initializers                        */
+
+struct mv2_allreduce_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                               MPI_Comm comm);
+};
+
+struct mv2_allreduce_tuning_table {
+  int numproc;
+  int mcast_enabled;
+  int is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
+  int size_inter_table;
+  mv2_allreduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+  int size_intra_table;
+  mv2_allreduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
+};
+
+int (*MV2_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                          MPI_Comm comm) = NULL;
+
+int (*MV2_Allreduce_intra_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                                    MPI_Comm comm) = NULL;
+
+int mv2_size_allreduce_tuning_table                        = 0;
+mv2_allreduce_tuning_table* mv2_allreduce_thresholds_table = NULL;
+
+static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2(void* sendbuf, void* recvbuf, int count,
+                                                           MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+  return 0;
+}
+
+static int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
+                                                         MPI_Op op, MPI_Comm comm)
+{
+  return 0;
+}
+
+static int MPIR_Allreduce_reduce_p2p_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                                         MPI_Comm comm)
+{
+  simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
+  return MPI_SUCCESS;
+}
+
+static int MPIR_Allreduce_reduce_shmem_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
+                                           MPI_Comm comm)
+{
+  simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
+  return MPI_SUCCESS;
+}
+
+#define MPIR_Allreduce_pt2pt_rd_MV2 simgrid::smpi::Coll_allreduce_rdb::allreduce
+#define MPIR_Allreduce_pt2pt_rs_MV2 simgrid::smpi::Coll_allreduce_mvapich2_rs::allreduce
+#define MPIR_Allreduce_two_level_MV2 simgrid::smpi::Coll_allreduce_mvapich2_two_level::allreduce
+
+static void init_mv2_allreduce_tables_stampede()
+{
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_size_allreduce_tuning_table                    = 8;
+  mv2_allreduce_thresholds_table                     = new mv2_allreduce_tuning_table[mv2_size_allreduce_tuning_table];
+  mv2_allreduce_tuning_table mv2_tmp_allreduce_thresholds_table[] = {
+      {
+          16,
+          0,
+          {1, 0},
+          2,
+          {
+              {0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2}, {1024, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 1024, &MPIR_Allreduce_reduce_shmem_MV2}, {1024, -1, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          32,
+          0,
+          {1, 1, 0},
+          3,
+          {
+              {0, 1024, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {1024, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 1024, &MPIR_Allreduce_reduce_shmem_MV2}, {1024, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          64,
+          0,
+          {1, 1, 0},
+          3,
+          {
+              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          128,
+          0,
+          {1, 1, 0},
+          3,
+          {
+              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          256,
+          0,
+          {1, 1, 0},
+          3,
+          {
+              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          512,
+          0,
+          {1, 1, 0},
+          3,
+          {
+              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {512, 16384, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, 16384, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          1024,
+          0,
+          {1, 1, 1, 0},
+          4,
+          {
+              {0, 512, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {512, 8192, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {8192, 65536, &MPIR_Allreduce_pt2pt_rs_MV2},
+              {65536, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+      {
+          2048,
+          0,
+          {1, 1, 1, 0},
+          4,
+          {
+              {0, 64, &MPIR_Allreduce_pt2pt_rd_MV2},
+              {64, 512, &MPIR_Allreduce_reduce_p2p_MV2},
+              {512, 4096, &MPIR_Allreduce_mcst_reduce_two_level_helper_MV2},
+              {4096, 16384, &MPIR_Allreduce_pt2pt_rs_MV2},
+              {16384, -1, &MPIR_Allreduce_pt2pt_rs_MV2},
+          },
+          2,
+          {
+              {0, 512, &MPIR_Allreduce_reduce_shmem_MV2}, {512, -1, &MPIR_Allreduce_reduce_p2p_MV2},
+          },
+      },
+
+  };
+  std::copy_n(mv2_tmp_allreduce_thresholds_table, mv2_size_allreduce_tuning_table, mv2_allreduce_thresholds_table);
+}
+
+struct mv2_bcast_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Bcast_function)(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm_ptr);
+  int zcpy_pipelined_knomial_factor;
+};
+
+struct mv2_bcast_tuning_table {
+  int numproc;
+  int bcast_segment_size;
+  int intra_node_knomial_factor;
+  int inter_node_knomial_factor;
+  int is_two_level_bcast[MV2_MAX_NB_THRESHOLDS];
+  int size_inter_table;
+  mv2_bcast_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+  int size_intra_table;
+  mv2_bcast_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
+};
+
+int mv2_size_bcast_tuning_table                    = 0;
+mv2_bcast_tuning_table* mv2_bcast_thresholds_table = NULL;
+
+int (*MV2_Bcast_function)(void* buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm_ptr) = NULL;
+
+int (*MV2_Bcast_intra_node_function)(void* buffer, int count, MPI_Datatype datatype, int root,
+                                     MPI_Comm comm_ptr) = NULL;
+
+int zcpy_knomial_factor               = 2;
+int mv2_pipelined_zcpy_knomial_factor = -1;
+int bcast_segment_size                = 8192;
+int mv2_inter_node_knomial_factor     = 4;
+int mv2_intra_node_knomial_factor     = 4;
+#define mv2_bcast_two_level_system_size 64
+#define mv2_bcast_short_msg 16384
+#define mv2_bcast_large_msg 512 * 1024
+
+#define INTRA_NODE_ROOT 0
+
+#define MPIR_Pipelined_Bcast_Zcpy_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
+#define MPIR_Pipelined_Bcast_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
+#define MPIR_Bcast_binomial_MV2 simgrid::smpi::Coll_bcast_binomial_tree::bcast
+#define MPIR_Bcast_scatter_ring_allgather_shm_MV2 simgrid::smpi::Coll_bcast_scatter_LR_allgather::bcast
+#define MPIR_Bcast_scatter_doubling_allgather_MV2 simgrid::smpi::Coll_bcast_scatter_rdb_allgather::bcast
+#define MPIR_Bcast_scatter_ring_allgather_MV2 simgrid::smpi::Coll_bcast_scatter_LR_allgather::bcast
+#define MPIR_Shmem_Bcast_MV2 simgrid::smpi::Coll_bcast_mpich::bcast
+#define MPIR_Bcast_tune_inter_node_helper_MV2 simgrid::smpi::Coll_bcast_mvapich2_inter_node::bcast
+#define MPIR_Bcast_inter_node_helper_MV2 simgrid::smpi::Coll_bcast_mvapich2_inter_node::bcast
+#define MPIR_Knomial_Bcast_intra_node_MV2 simgrid::smpi::Coll_bcast_mvapich2_knomial_intra_node::bcast
+#define MPIR_Bcast_intra_MV2 simgrid::smpi::Coll_bcast_mvapich2_intra_node::bcast
+
+static void init_mv2_bcast_tables_stampede()
+{
+  // Stampede,
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_size_bcast_tuning_table                        = 8;
+  mv2_bcast_thresholds_table                         = new mv2_bcast_tuning_table[mv2_size_bcast_tuning_table];
+
+  mv2_bcast_tuning_table mv2_tmp_bcast_thresholds_table[] = {
+      {16,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+       11,
+       {{0, 8, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {8, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16, 1024, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {1024, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {8192, 16384, &MPIR_Bcast_binomial_MV2, -1},
+        {16384, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {32768, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {65536, 131072, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1},
+        {131072, 262144, &MPIR_Bcast_scatter_ring_allgather_MV2, -1},
+        {262144, 524288, &MPIR_Bcast_scatter_doubling_allgather_MV2, -1},
+        {524288, -1, &MPIR_Bcast_scatter_ring_allgather_MV2, -1}},
+       11,
+       {{0, 8, &MPIR_Shmem_Bcast_MV2, 2},
+        {8, 16, &MPIR_Shmem_Bcast_MV2, 4},
+        {16, 1024, &MPIR_Shmem_Bcast_MV2, 2},
+        {1024, 8192, &MPIR_Shmem_Bcast_MV2, 4},
+        {8192, 16384, &MPIR_Shmem_Bcast_MV2, -1},
+        {16384, 32768, &MPIR_Shmem_Bcast_MV2, 4},
+        {32768, 65536, &MPIR_Shmem_Bcast_MV2, 2},
+        {65536, 131072, &MPIR_Shmem_Bcast_MV2, -1},
+        {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
+        {262144, 524288, &MPIR_Shmem_Bcast_MV2, -1},
+        {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}}},
+      {32,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1, 1, 1, 1},
+       8,
+       {{0, 128, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {128, 256, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {256, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {32768, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {65536, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {131072, 262144, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {262144, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {524288, -1, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8}},
+       8,
+       {{0, 128, &MPIR_Shmem_Bcast_MV2, 2},
+        {128, 256, &MPIR_Shmem_Bcast_MV2, 4},
+        {256, 32768, &MPIR_Shmem_Bcast_MV2, 2},
+        {32768, 65536, &MPIR_Shmem_Bcast_MV2, 4},
+        {65536, 131072, &MPIR_Shmem_Bcast_MV2, 2},
+        {131072, 262144, &MPIR_Shmem_Bcast_MV2, 8},
+        {262144, 524288, &MPIR_Shmem_Bcast_MV2, 2},
+        {524288, -1, &MPIR_Shmem_Bcast_MV2, 8}}},
+      {64,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1, 1, 1, 1, 1},
+       9,
+       {{0, 2, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {2, 4, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {4, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16, 32, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {32, 128, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {128, 256, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {256, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {4096, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {32768, -1, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2}},
+       9,
+       {{0, 2, &MPIR_Shmem_Bcast_MV2, 4},
+        {2, 4, &MPIR_Shmem_Bcast_MV2, 8},
+        {4, 16, &MPIR_Shmem_Bcast_MV2, 4},
+        {16, 32, &MPIR_Shmem_Bcast_MV2, 8},
+        {32, 128, &MPIR_Shmem_Bcast_MV2, 4},
+        {128, 256, &MPIR_Shmem_Bcast_MV2, 8},
+        {256, 4096, &MPIR_Shmem_Bcast_MV2, 4},
+        {4096, 32768, &MPIR_Shmem_Bcast_MV2, 8},
+        {32768, -1, &MPIR_Shmem_Bcast_MV2, 2}}},
+      {128,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 0},
+       4,
+       {{0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16384, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {524288, -1, &MPIR_Bcast_scatter_ring_allgather_MV2, -1}},
+       4,
+       {{0, 8192, &MPIR_Shmem_Bcast_MV2, 8},
+        {8192, 16384, &MPIR_Shmem_Bcast_MV2, 4},
+        {16384, 524288, &MPIR_Shmem_Bcast_MV2, 2},
+        {524288, -1, NULL, -1}}},
+      {256,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1},
+       5,
+       {{0, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16384, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {131072, 262144, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1},
+        {262144, 524288, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}},
+       5,
+       {{0, 16384, &MPIR_Shmem_Bcast_MV2, 4},
+        {16384, 131072, &MPIR_Shmem_Bcast_MV2, 2},
+        {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
+        {262144, 524288, &MPIR_Shmem_Bcast_MV2, 2},
+        {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}}},
+      {512,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1},
+       5,
+       {{0, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {4096, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16384, 131072, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {131072, 262144, &MPIR_Pipelined_Bcast_MV2, -1},
+        {262144, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}},
+       5,
+       {{0, 4096, &MPIR_Shmem_Bcast_MV2, 8},
+        {4096, 16384, &MPIR_Shmem_Bcast_MV2, 4},
+        {16384, 131072, &MPIR_Shmem_Bcast_MV2, 2},
+        {131072, 262144, &MPIR_Shmem_Bcast_MV2, -1},
+        {262144, -1, &MPIR_Shmem_Bcast_MV2, -1}}},
+      {1024,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1},
+       5,
+       {{0, 8192, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {8192, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16384, 65536, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {65536, 524288, &MPIR_Pipelined_Bcast_MV2, -1},
+        {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}},
+       5,
+       {{0, 8192, &MPIR_Shmem_Bcast_MV2, 8},
+        {8192, 16384, &MPIR_Shmem_Bcast_MV2, 4},
+        {16384, 65536, &MPIR_Shmem_Bcast_MV2, 2},
+        {65536, 524288, &MPIR_Shmem_Bcast_MV2, -1},
+        {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}}},
+      {2048,
+       8192,
+       4,
+       4,
+       {1, 1, 1, 1, 1, 1, 1},
+       7,
+       {{0, 16, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {16, 32, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {32, 4096, &MPIR_Pipelined_Bcast_Zcpy_MV2, 8},
+        {4096, 16384, &MPIR_Pipelined_Bcast_Zcpy_MV2, 4},
+        {16384, 32768, &MPIR_Pipelined_Bcast_Zcpy_MV2, 2},
+        {32768, 524288, &MPIR_Pipelined_Bcast_MV2, -1},
+        {524288, -1, &MPIR_Bcast_scatter_ring_allgather_shm_MV2, -1}},
+       7,
+       {{0, 16, &MPIR_Shmem_Bcast_MV2, 8},
+        {16, 32, &MPIR_Shmem_Bcast_MV2, 4},
+        {32, 4096, &MPIR_Shmem_Bcast_MV2, 8},
+        {4096, 16384, &MPIR_Shmem_Bcast_MV2, 4},
+        {16384, 32768, &MPIR_Shmem_Bcast_MV2, 2},
+        {32768, 524288, &MPIR_Shmem_Bcast_MV2, -1},
+        {524288, -1, &MPIR_Shmem_Bcast_MV2, -1}}}};
+
+  std::copy_n(mv2_tmp_bcast_thresholds_table, mv2_size_bcast_tuning_table, mv2_bcast_thresholds_table);
+}
+
+/************ Reduce variables and initializers                        */
+
+struct mv2_reduce_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Reduce_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
+                                MPI_Comm comm_ptr);
+};
+
+struct mv2_reduce_tuning_table {
+  int numproc;
+  int inter_k_degree;
+  int intra_k_degree;
+  int is_two_level_reduce[MV2_MAX_NB_THRESHOLDS];
+  int size_inter_table;
+  mv2_reduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+  int size_intra_table;
+  mv2_reduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
+};
+
+int mv2_size_reduce_tuning_table                     = 0;
+mv2_reduce_tuning_table* mv2_reduce_thresholds_table = NULL;
+
+int mv2_reduce_intra_knomial_factor = -1;
+int mv2_reduce_inter_knomial_factor = -1;
+
+int (*MV2_Reduce_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
+                           MPI_Comm comm_ptr) = NULL;
+
+int (*MV2_Reduce_intra_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
+                                 MPI_Comm comm_ptr) = NULL;
+
+#define MPIR_Reduce_inter_knomial_wrapper_MV2 simgrid::smpi::Coll_reduce_mvapich2_knomial::reduce
+#define MPIR_Reduce_intra_knomial_wrapper_MV2 simgrid::smpi::Coll_reduce_mvapich2_knomial::reduce
+#define MPIR_Reduce_binomial_MV2 simgrid::smpi::Coll_reduce_binomial::reduce
+#define MPIR_Reduce_redscat_gather_MV2 simgrid::smpi::Coll_reduce_scatter_gather::reduce
+#define MPIR_Reduce_shmem_MV2 simgrid::smpi::Coll_reduce_ompi_basic_linear::reduce
+#define MPIR_Reduce_two_level_helper_MV2 simgrid::smpi::Coll_reduce_mvapich2_two_level::reduce
+
+static void init_mv2_reduce_tables_stampede()
+{
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  /*Stampede*/
+  mv2_size_reduce_tuning_table = 8;
+  mv2_reduce_thresholds_table                               = new mv2_reduce_tuning_table[mv2_size_reduce_tuning_table];
+  mv2_reduce_tuning_table mv2_tmp_reduce_thresholds_table[] = {
+      {
+          16,
+          4,
+          4,
+          {1, 0, 0},
+          3,
+          {
+              {0, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
+              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          2,
+          {
+              {0, 65536, &MPIR_Reduce_shmem_MV2}, {65536, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          32,
+          4,
+          4,
+          {1, 1, 1, 1, 0, 0, 0},
+          7,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 32768, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {32768, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
+              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          6,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 32768, &MPIR_Reduce_shmem_MV2},
+              {32768, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_shmem_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          64,
+          4,
+          4,
+          {1, 1, 1, 1, 0},
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          128,
+          4,
+          4,
+          {1, 0, 1, 0, 1, 0},
+          6,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
+              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          256,
+          4,
+          4,
+          {1, 1, 1, 0, 1, 1, 0},
+          7,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 32768, &MPIR_Reduce_binomial_MV2},
+              {32768, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_binomial_MV2},
+              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
+              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          6,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 32768, &MPIR_Reduce_shmem_MV2},
+              {32768, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          512,
+          4,
+          4,
+          {1, 0, 1, 1, 1, 0},
+          6,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_binomial_MV2},
+              {262144, 1048576, &MPIR_Reduce_binomial_MV2},
+              {1048576, -1, &MPIR_Reduce_redscat_gather_MV2},
+          },
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          1024,
+          4,
+          4,
+          {1, 0, 1, 1, 1},
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {8192, 16384, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 262144, &MPIR_Reduce_binomial_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+          5,
+          {
+              {0, 8192, &MPIR_Reduce_shmem_MV2},
+              {8192, 16384, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {16384, 65536, &MPIR_Reduce_shmem_MV2},
+              {65536, 262144, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {262144, -1, &MPIR_Reduce_binomial_MV2},
+          },
+      },
+      {
+          2048,
+          4,
+          4,
+          {1, 0, 1, 1, 1, 1},
+          6,
+          {
+              {0, 2048, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {2048, 4096, &MPIR_Reduce_inter_knomial_wrapper_MV2},
+              {4096, 16384, &MPIR_Reduce_binomial_MV2},
+              {16384, 65536, &MPIR_Reduce_binomial_MV2},
+              {65536, 131072, &MPIR_Reduce_binomial_MV2},
+              {131072, -1, &MPIR_Reduce_binomial_MV2},
+          },
+          6,
+          {
+              {0, 2048, &MPIR_Reduce_shmem_MV2},
+              {2048, 4096, &MPIR_Reduce_shmem_MV2},
+              {4096, 16384, &MPIR_Reduce_shmem_MV2},
+              {16384, 65536, &MPIR_Reduce_intra_knomial_wrapper_MV2},
+              {65536, 131072, &MPIR_Reduce_binomial_MV2},
+              {131072, -1, &MPIR_Reduce_shmem_MV2},
+          },
+      },
+
+  };
+  std::copy_n(mv2_tmp_reduce_thresholds_table, mv2_size_reduce_tuning_table, mv2_reduce_thresholds_table);
+}
+
+/************ Reduce scatter variables and initializers                        */
+
+struct mv2_red_scat_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Red_scat_function)(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op,
+                                  MPI_Comm comm_ptr);
+};
+
+struct mv2_red_scat_tuning_table {
+  int numproc;
+  int size_inter_table;
+  mv2_red_scat_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+};
+
+int mv2_size_red_scat_tuning_table                       = 0;
+mv2_red_scat_tuning_table* mv2_red_scat_thresholds_table = NULL;
+
+int (*MV2_Red_scat_function)(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op,
+                             MPI_Comm comm_ptr);
+
+static int MPIR_Reduce_Scatter_Basic_MV2(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op,
+                                         MPI_Comm comm)
+{
+  simgrid::smpi::Coll_reduce_scatter_default::reduce_scatter(sendbuf, recvbuf, recvcnts, datatype, op, comm);
+  return MPI_SUCCESS;
+}
+#define MPIR_Reduce_scatter_non_comm_MV2 simgrid::smpi::Coll_reduce_scatter_mpich_noncomm::reduce_scatter
+#define MPIR_Reduce_scatter_Rec_Halving_MV2                                                                            \
+  simgrid::smpi::Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter
+#define MPIR_Reduce_scatter_Pair_Wise_MV2 simgrid::smpi::Coll_reduce_scatter_mpich_pair::reduce_scatter
+
+static void init_mv2_reduce_scatter_tables_stampede()
+{
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+  mv2_size_red_scat_tuning_table                     = 6;
+  mv2_red_scat_thresholds_table                      = new mv2_red_scat_tuning_table[mv2_size_red_scat_tuning_table];
+  mv2_red_scat_tuning_table mv2_tmp_red_scat_thresholds_table[] = {
+      {
+          16,
+          3,
+          {
+              {0, 64, &MPIR_Reduce_Scatter_Basic_MV2},
+              {64, 65536, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+              {65536, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
+          },
+      },
+      {
+          32,
+          3,
+          {
+              {0, 64, &MPIR_Reduce_Scatter_Basic_MV2},
+              {64, 131072, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+              {131072, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
+          },
+      },
+      {
+          64,
+          3,
+          {
+              {0, 1024, &MPIR_Reduce_Scatter_Basic_MV2},
+              {1024, 262144, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+              {262144, -1, &MPIR_Reduce_scatter_Pair_Wise_MV2},
+          },
+      },
+      {
+          128,
+          2,
+          {
+              {0, 128, &MPIR_Reduce_Scatter_Basic_MV2}, {128, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+          },
+      },
+      {
+          256,
+          2,
+          {
+              {0, 128, &MPIR_Reduce_Scatter_Basic_MV2}, {128, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+          },
+      },
+      {
+          512,
+          2,
+          {
+              {0, 256, &MPIR_Reduce_Scatter_Basic_MV2}, {256, -1, &MPIR_Reduce_scatter_Rec_Halving_MV2},
+          },
+      },
+
+  };
+  std::copy_n(mv2_tmp_red_scat_thresholds_table, mv2_size_red_scat_tuning_table, mv2_red_scat_thresholds_table);
+}
+
+/************ Scatter variables and initializers                        */
+
+struct mv2_scatter_tuning_element {
+  int min;
+  int max;
+  int (*MV2_pt_Scatter_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                                 MPI_Datatype recvtype, int root, MPI_Comm comm);
+};
+
+struct mv2_scatter_tuning_table {
+  int numproc;
+  int size_inter_table;
+  mv2_scatter_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
+  int size_intra_table;
+  mv2_scatter_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
+};
+
+int* mv2_scatter_table_ppn_conf                         = NULL;
+int mv2_scatter_num_ppn_conf                            = 1;
+int* mv2_size_scatter_tuning_table                      = NULL;
+mv2_scatter_tuning_table** mv2_scatter_thresholds_table = NULL;
+
+int (*MV2_Scatter_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                            MPI_Datatype recvtype, int root, MPI_Comm comm) = NULL;
+
+int (*MV2_Scatter_intra_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                                  MPI_Datatype recvtype, int root, MPI_Comm comm) = NULL;
+int MPIR_Scatter_mcst_wrap_MV2(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                               MPI_Datatype recvtype, int root, MPI_Comm comm_ptr);
+
+int MPIR_Scatter_mcst_wrap_MV2(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
+                               MPI_Datatype recvtype, int root, MPI_Comm comm_ptr)
+{
+  return 0;
+}
+
+#define MPIR_Scatter_MV2_Binomial simgrid::smpi::Coll_scatter_ompi_binomial::scatter
+#define MPIR_Scatter_MV2_Direct simgrid::smpi::Coll_scatter_ompi_basic_linear::scatter
+#define MPIR_Scatter_MV2_two_level_Binomial simgrid::smpi::Coll_scatter_mvapich2_two_level_binomial::scatter
+#define MPIR_Scatter_MV2_two_level_Direct simgrid::smpi::Coll_scatter_mvapich2_two_level_direct::scatter
+
+static void init_mv2_scatter_tables_stampede()
+{
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback == NULL)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback = &smpi_coll_cleanup_mvapich2;
+
+  int agg_table_sum = 0;
+  mv2_scatter_tuning_table** table_ptrs = NULL;
+  mv2_scatter_num_ppn_conf              = 3;
+  mv2_scatter_thresholds_table          = new mv2_scatter_tuning_table*[mv2_scatter_num_ppn_conf];
+  table_ptrs                            = new mv2_scatter_tuning_table*[mv2_scatter_num_ppn_conf];
+  mv2_size_scatter_tuning_table         = new int[mv2_scatter_num_ppn_conf];
+  mv2_scatter_table_ppn_conf            = new int[mv2_scatter_num_ppn_conf];
+  mv2_scatter_table_ppn_conf[0]    = 1;
+  mv2_size_scatter_tuning_table[0] = 6;
+  mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_1ppn[] = {
+      {
+          2,
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+
+      {
+          4,
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          8,
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          16,
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          32,
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          64,
+          2,
+          {
+              {0, 32, &MPIR_Scatter_MV2_Binomial}, {32, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+  };
+  table_ptrs[0]                                                    = mv2_tmp_scatter_thresholds_table_1ppn;
+  mv2_scatter_table_ppn_conf[1]                                    = 2;
+  mv2_size_scatter_tuning_table[1]                                 = 6;
+  mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_2ppn[] = {
+      {
+          4,
+          2,
+          {
+              {0, 4096, &MPIR_Scatter_MV2_Binomial}, {4096, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          8,
+          2,
+          {
+              {0, 512, &MPIR_Scatter_MV2_two_level_Direct}, {512, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+
+      {
+          16,
+          2,
+          {
+              {0, 2048, &MPIR_Scatter_MV2_two_level_Direct}, {2048, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+
+      {
+          32,
+          2,
+          {
+              {0, 2048, &MPIR_Scatter_MV2_two_level_Direct}, {2048, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+
+      {
+          64,
+          2,
+          {
+              {0, 8192, &MPIR_Scatter_MV2_two_level_Direct}, {8192, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+
+      {
+          128,
+          4,
+          {
+              {0, 16, &MPIR_Scatter_MV2_Binomial},
+              {16, 128, &MPIR_Scatter_MV2_two_level_Binomial},
+              {128, 16384, &MPIR_Scatter_MV2_two_level_Direct},
+              {16384, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, 128, &MPIR_Scatter_MV2_Direct}, {128, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+  };
+  table_ptrs[1]                                                     = mv2_tmp_scatter_thresholds_table_2ppn;
+  mv2_scatter_table_ppn_conf[2]                                     = 16;
+  mv2_size_scatter_tuning_table[2]                                  = 8;
+  mv2_scatter_tuning_table mv2_tmp_scatter_thresholds_table_16ppn[] = {
+      {
+          16,
+          2,
+          {
+              {0, 256, &MPIR_Scatter_MV2_Binomial}, {256, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          32,
+          2,
+          {
+              {0, 512, &MPIR_Scatter_MV2_Binomial}, {512, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          64,
+          2,
+          {
+              {0, 1024, &MPIR_Scatter_MV2_two_level_Direct}, {1024, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          128,
+          4,
+          {
+              {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
+              {0, 16, &MPIR_Scatter_MV2_two_level_Direct},
+              {16, 2048, &MPIR_Scatter_MV2_two_level_Direct},
+              {2048, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          256,
+          4,
+          {
+              {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
+              {0, 16, &MPIR_Scatter_MV2_two_level_Direct},
+              {16, 2048, &MPIR_Scatter_MV2_two_level_Direct},
+              {2048, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+
+      {
+          512,
+          4,
+          {
+              {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
+              {16, 16, &MPIR_Scatter_MV2_two_level_Direct},
+              {16, 4096, &MPIR_Scatter_MV2_two_level_Direct},
+              {4096, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+      {
+          1024,
+          5,
+          {
+              {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
+              {0, 16, &MPIR_Scatter_MV2_Binomial},
+              {16, 32, &MPIR_Scatter_MV2_Binomial},
+              {32, 4096, &MPIR_Scatter_MV2_two_level_Direct},
+              {4096, -1, &MPIR_Scatter_MV2_Direct},
+          },
+          1,
+          {
+              {0, -1, &MPIR_Scatter_MV2_Binomial},
+          },
+      },
+      {
+          2048,
+          7,
+          {
+              {0, 16, &MPIR_Scatter_mcst_wrap_MV2},
+              {0, 16, &MPIR_Scatter_MV2_two_level_Binomial},
+              {16, 128, &MPIR_Scatter_MV2_two_level_Binomial},
+              {128, 1024, &MPIR_Scatter_MV2_two_level_Direct},
+              {1024, 16384, &MPIR_Scatter_MV2_two_level_Direct},
+              {16384, 65536, &MPIR_Scatter_MV2_Direct},
+              {65536, -1, &MPIR_Scatter_MV2_two_level_Direct},
+          },
+          6,
+          {
+              {0, 16, &MPIR_Scatter_MV2_Binomial},
+              {16, 128, &MPIR_Scatter_MV2_Binomial},
+              {128, 1024, &MPIR_Scatter_MV2_Binomial},
+              {1024, 16384, &MPIR_Scatter_MV2_Direct},
+              {16384, 65536, &MPIR_Scatter_MV2_Direct},
+              {65536, -1, &MPIR_Scatter_MV2_Direct},
+          },
+      },
+  };
+  table_ptrs[2] = mv2_tmp_scatter_thresholds_table_16ppn;
+  agg_table_sum = 0;
+  for (int i = 0; i < mv2_scatter_num_ppn_conf; i++) {
+    agg_table_sum += mv2_size_scatter_tuning_table[i];
+  }
+  mv2_scatter_thresholds_table[0] = new mv2_scatter_tuning_table[agg_table_sum];
+  std::copy_n(table_ptrs[0], mv2_size_scatter_tuning_table[0], mv2_scatter_thresholds_table[0]);
+  for (int i = 1; i < mv2_scatter_num_ppn_conf; i++) {
+    mv2_scatter_thresholds_table[i] = mv2_scatter_thresholds_table[i - 1] + mv2_size_scatter_tuning_table[i - 1];
+    std::copy_n(table_ptrs[i], mv2_size_scatter_tuning_table[i], mv2_scatter_thresholds_table[i]);
+  }
+  delete[] table_ptrs;
+}
+
+#endif
index 9770eb0..ead3440 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "colls_private.h"
+#include "colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
diff --git a/src/smpi/include/private.h b/src/smpi/include/private.h
deleted file mode 100644 (file)
index f17eccb..0000000
+++ /dev/null
@@ -1,419 +0,0 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
-
-/* This program 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 SMPI_PRIVATE_H
-#define SMPI_PRIVATE_H
-
-#include "smpi/smpi.h"
-#include "simgrid/msg.h" // msg_bar_t
-
-SG_BEGIN_DECL()
-
-#define PERSISTENT     0x1
-#define NON_PERSISTENT 0x2
-#define SEND           0x4
-#define RECV           0x8
-#define RECV_DELETE    0x10
-#define ISEND          0x20
-#define SSEND          0x40
-#define PREPARED       0x80
-#define FINISHED       0x100
-#define RMA            0x200
-#define ACCUMULATE     0x400
-
-enum smpi_process_state{
-  SMPI_UNINITIALIZED,
-  SMPI_INITIALIZED,
-  SMPI_FINALIZED
-};
-
-#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
-//SMPI_RMA_TAG has to be the smallest one, as it will be decremented for accumulate ordering.
-#define SMPI_RMA_TAG -6666
-
-/* Convert between Fortran and C */
-
-#define FORT_BOTTOM(addr)          ((*(int*)addr) == -200 ? MPI_BOTTOM : (void*)addr)
-#define FORT_IN_PLACE(addr)        ((*(int*)addr) == -100 ? MPI_IN_PLACE : (void*)addr)
-#define FORT_STATUS_IGNORE(addr)   (static_cast<MPI_Status*>((*(int*)addr) == -300 ? MPI_STATUS_IGNORE : (void*)addr))
-#define FORT_STATUSES_IGNORE(addr) (static_cast<MPI_Status*>((*(int*)addr) == -400 ? MPI_STATUSES_IGNORE : (void*)addr))
-
-extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
-
-typedef SMPI_Cart_topology *MPIR_Cart_Topology;
-
-typedef SMPI_Graph_topology *MPIR_Graph_Topology;
-
-typedef SMPI_Dist_Graph_topology *MPIR_Dist_Graph_Topology;
-
-XBT_PRIVATE SMPI_Process* smpi_process();
-XBT_PRIVATE SMPI_Process* smpi_process_remote(int index);
-XBT_PRIVATE int smpi_process_count();
-
-XBT_PRIVATE void smpi_deployment_register_process(const char* instance_id, int rank, int index);
-XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const char* instance_id);
-XBT_PRIVATE msg_bar_t smpi_deployment_finalization_barrier(const char* instance_id);
-XBT_PRIVATE void smpi_deployment_cleanup_instances();
-
-XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size);
-
-XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size);
-
-XBT_PRIVATE int smpi_enabled();
-XBT_PRIVATE void smpi_global_init();
-XBT_PRIVATE void smpi_global_destroy();
-XBT_PRIVATE double smpi_mpi_wtime();
-XBT_PRIVATE void smpi_mpi_init();
-
-// utilities
-extern XBT_PRIVATE double smpi_cpu_threshold;
-extern XBT_PRIVATE double smpi_host_speed;
-extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
-extern XBT_PRIVATE int smpi_data_exe_size;    // size of the data+bss segment of the executable
-
-typedef enum { shmalloc_none, shmalloc_local, shmalloc_global } shared_malloc_type;
-extern XBT_PRIVATE shared_malloc_type smpi_cfg_shared_malloc; // Whether to activate shared malloc
-
-XBT_PRIVATE void smpi_switch_data_segment(int dest);
-XBT_PRIVATE void smpi_really_switch_data_segment(int dest);
-XBT_PRIVATE int smpi_is_privatization_file(char* file);
-
-XBT_PRIVATE void smpi_get_executable_global_size();
-XBT_PRIVATE void smpi_initialize_global_memory_segments();
-XBT_PRIVATE void smpi_destroy_global_memory_segments();
-XBT_PRIVATE void smpi_bench_destroy();
-XBT_PRIVATE void smpi_bench_begin();
-XBT_PRIVATE void smpi_bench_end();
-XBT_PRIVATE void smpi_shared_destroy();
-
-XBT_PRIVATE void* smpi_get_tmp_sendbuffer(int size);
-XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size);
-XBT_PRIVATE void  smpi_free_tmp_buffer(void* buf);
-
-
-// f77 wrappers
-void mpi_init_(int* ierr);
-void mpi_finalize_(int* ierr);
-void mpi_abort_(int* comm, int* errorcode, int* ierr);
-void mpi_comm_rank_(int* comm, int* rank, int* ierr);
-void mpi_comm_size_(int* comm, int* size, int* ierr);
-double mpi_wtime_();
-double mpi_wtick_();
-void mpi_initialized_(int* flag, int* ierr);
-
-void mpi_comm_dup_(int* comm, int* newcomm, int* ierr);
-void mpi_comm_create_(int* comm, int* group, int* newcomm, int* ierr);
-void mpi_comm_free_(int* comm, int* ierr);
-void mpi_comm_split_(int* comm, int* color, int* key, int* comm_out, int* ierr);
-void mpi_group_incl_(int* group, int* n, int* key, int* group_out, int* ierr) ;
-void mpi_comm_group_(int* comm, int* group_out,  int* ierr);
-void mpi_comm_create_group_ (int* comm, int* group, int, int* comm_out, int* ierr);
-void mpi_send_init_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
-void mpi_isend_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
-void mpi_irsend_(void *buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
-void mpi_send_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr);
-void mpi_rsend_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr);
-void mpi_recv_init_(void *buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr);
-void mpi_irecv_(void *buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr);
-void mpi_recv_(void* buf, int* count, int* datatype, int* src, int* tag, int* comm, MPI_Status* status, int* ierr);
-void mpi_start_(int* request, int* ierr);
-void mpi_startall_(int* count, int* requests, int* ierr);
-void mpi_wait_(int* request, MPI_Status* status, int* ierr);
-void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int* ierr);
-void mpi_waitall_(int* count, int* requests, MPI_Status* status, int* ierr);
-
-void mpi_barrier_(int* comm, int* ierr);
-void mpi_bcast_(void* buf, int* count, int* datatype, int* root, int* comm, int* ierr);
-void mpi_reduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* ierr);
-void mpi_allreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr);
-void mpi_reduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype, int* op, int* comm, int* ierr) ;
-void mpi_scatter_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
-                   int* root, int* comm, int* ierr);
-void mpi_scatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
-                   void* recvbuf, int* recvcount, int* recvtype, int* root, int* comm, int* ierr);
-void mpi_gather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
-                  int* root, int* comm, int* ierr);
-void mpi_gatherv_(void* sendbuf, int* sendcount, int* sendtype,
-                  void* recvbuf, int* recvcounts, int* displs, int* recvtype, int* root, int* comm, int* ierr);
-void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype,
-                     void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr);
-void mpi_allgatherv_(void* sendbuf, int* sendcount, int* sendtype,
-                     void* recvbuf, int* recvcount,int* displs, int* recvtype, int* comm, int* ierr) ;
-void mpi_type_size_(int* datatype, int *size, int* ierr);
-
-void mpi_scan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr);
-void mpi_alltoall_(void* sendbuf, int* sendcount, int* sendtype,
-                    void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr);
-void mpi_alltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype,
-                    void* recvbuf, int* recvcounts, int* recvdisps, int* recvtype, int* comm, int* ierr);
-void mpi_get_processor_name_(char *name, int *resultlen, int* ierr);
-void mpi_test_ (int * request, int *flag, MPI_Status * status, int* ierr);
-void mpi_testall_ (int* count, int * requests,  int *flag, MPI_Status * statuses, int* ierr);
-void mpi_get_count_(MPI_Status * status, int* datatype, int *count, int* ierr);
-void mpi_type_extent_(int* datatype, MPI_Aint * extent, int* ierr);
-void mpi_attr_get_(int* comm, int* keyval, void* attr_value, int* flag, int* ierr );
-void mpi_type_commit_(int* datatype,  int* ierr);
-void mpi_type_vector_(int* count, int* blocklen, int* stride, int* old_type, int* newtype,  int* ierr);
-void mpi_type_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype,  int* ierr);
-void mpi_type_create_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype,  int* ierr);
-void mpi_type_free_(int* datatype, int* ierr);
-void mpi_type_lb_(int* datatype, MPI_Aint * extent, int* ierr);
-void mpi_type_ub_(int* datatype, MPI_Aint * extent, int* ierr);
-void mpi_win_fence_( int* assert,  int* win, int* ierr);
-void mpi_win_free_( int* win, int* ierr);
-void mpi_win_create_( int *base, MPI_Aint* size, int* disp_unit, int* info, int* comm, int *win, int* ierr);
-void mpi_win_set_name_ (int*  win, char * name, int* ierr, int size);
-void mpi_win_get_name_ (int*  win, char * name, int* len, int* ierr);
-void mpi_win_post_(int* group, int assert, int* win, int* ierr);
-void mpi_win_start_(int* group, int assert, int* win, int* ierr);
-void mpi_win_complete_(int* win, int* ierr);
-void mpi_win_wait_(int* win, int* ierr);
-void mpi_win_allocate_( MPI_Aint* size, int* disp_unit, int* info, int* comm, void* base, int* win, int* ierr);
-void mpi_win_attach_(int* win, int* base, MPI_Aint* size, int* ierr);
-void mpi_win_create_dynamic_( int* info, int* comm, int *win, int* ierr);
-void mpi_win_detach_(int* win, int* base, int* ierr);
-void mpi_win_set_info_(int*  win, int* info, int* ierr);
-void mpi_win_get_info_(int*  win, int* info, int* ierr);
-void mpi_win_get_group_(int*  win, int* group, int* ierr);
-void mpi_win_get_attr_(int* win, int* type_keyval, void* attribute_val, int* flag, int* ierr);
-void mpi_win_set_attr_(int* win, int* type_keyval, void* att, int* ierr);
-void mpi_win_delete_attr_(int* win, int* comm_keyval, int* ierr);
-void mpi_win_create_keyval_(void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr);
-void mpi_win_free_keyval_(int* keyval, int* ierr);
-void mpi_win_lock_(int* lock_type, int* rank, int* assert, int* win, int* ierr);
-void mpi_win_lock_all_(int* assert, int* win, int* ierr);
-void mpi_win_unlock_(int* rank, int* win, int* ierr);
-void mpi_win_unlock_all_(int* win, int* ierr);
-void mpi_win_flush_(int* rank, int* win, int* ierr);
-void mpi_win_flush_local_(int* rank, int* win, int* ierr);
-void mpi_win_flush_all_(int* win, int* ierr);
-void mpi_win_flush_local_all_(int* win, int* ierr);
-void mpi_info_create_( int *info, int* ierr);
-void mpi_info_set_( int *info, char *key, char *value, int* ierr, unsigned int keylen, unsigned int valuelen);
-void mpi_info_free_(int* info, int* ierr);
-void mpi_get_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* win, int* ierr);
-void mpi_put_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* win, int* ierr);
-void mpi_rget_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* win, int* request, int* ierr);
-void mpi_rput_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* win, int* request, int* ierr);
-void mpi_fetch_and_op_( int *origin_addr, int* result_addr, int* datatype, int* target_rank, MPI_Aint* target_disp, int* op, int* win, int* ierr);
-void mpi_compare_and_swap_( int *origin_addr, int* compare_addr, int* result_addr, 
-    int* datatype, int* target_rank, MPI_Aint* target_disp, int* win, int* ierr);
-void mpi_get_accumulate_(int *origin_addr, int* origin_count, int* origin_datatype, int* result_addr,
-                        int* result_count, int* result_datatype, int* target_rank, MPI_Aint* target_disp, int* target_count,
-                        int* target_datatype, int* op, int* win, int* ierr);
-void mpi_rget_accumulate_(int *origin_addr, int* origin_count, int* origin_datatype, int* result_addr,
-                        int* result_count, int* result_datatype, int* target_rank, MPI_Aint* target_disp, int* target_count,
-                        int* target_datatype, int* op, int* win, int* request, int* ierr);
-void mpi_accumulate_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* op, int* win, int* ierr);
-void mpi_raccumulate_( int *origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
-    MPI_Aint* target_disp, int* target_count, int* target_datatype, int* op, int* win, int* request, int* ierr);
-void mpi_error_string_(int* errorcode, char* string, int* resultlen, int* ierr);
-void mpi_sendrecv_(void* sendbuf, int* sendcount, int* sendtype, int* dst, int* sendtag, void *recvbuf, int* recvcount,
-                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, int size);
-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_op_commutative_ (int* op, int* commute, 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_ (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, int size);
-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, unsigned int keylen);
-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, unsigned int keylen);
-void mpi_info_delete_ (int* info, char *key, int* ierr, unsigned int keylen);
-void mpi_info_get_nkeys_ ( int* info, int *nkeys, int* ierr);
-void mpi_info_get_nthkey_ ( int* info, int* n, char *key, int* ierr, unsigned int keylen);
-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);
-void mpi_file_close_ ( int* file, int* ierr);
-void mpi_file_delete_ ( char* filename, int* info, int* ierr);
-void mpi_file_open_ ( int* comm, char* filename, int* amode, int* info, int* fh, int* ierr);
-void mpi_file_set_view_ ( int* fh, long long int* offset, int* etype, int* filetype, char* datarep, int* info, int* ierr);
-void mpi_file_read_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr);
-void mpi_file_write_ ( int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr);
-
-// TODO, make this static and expose it more cleanly
-
-typedef struct s_smpi_privatization_region {
-  void* address;
-  int file_descriptor;
-} s_smpi_privatization_region_t;
-typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
-
-extern XBT_PRIVATE smpi_privatization_region_t smpi_privatization_regions;
-extern XBT_PRIVATE int smpi_loaded_page;
-extern XBT_PRIVATE int smpi_universe_size;
-
-SG_END_DECL()
-#endif
index 4682540..4f0ca57 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 SMPI_PRIVATE_HPP
 #define SMPI_PRIVATE_HPP
 
-#include "src/instr/instr_smpi.h"
+#include "simgrid/msg.h" // msg_bar_t
+#include "smpi/smpi.h"
+#include "src/instr/instr_smpi.hpp"
+#include "src/internal_config.h"
 #include <unordered_map>
 #include <vector>
-#include "src/internal_config.h"
+
+extern "C" {
+
+#define PERSISTENT 0x1
+#define NON_PERSISTENT 0x2
+#define SEND 0x4
+#define RECV 0x8
+#define RECV_DELETE 0x10
+#define ISEND 0x20
+#define SSEND 0x40
+#define PREPARED 0x80
+#define FINISHED 0x100
+#define RMA 0x200
+#define ACCUMULATE 0x400
+
+enum smpi_process_state { SMPI_UNINITIALIZED, SMPI_INITIALIZED, SMPI_FINALIZED };
+
+#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
+// SMPI_RMA_TAG has to be the smallest one, as it will be decremented for accumulate ordering.
+#define SMPI_RMA_TAG -6666
+
+/* Convert between Fortran and C */
+
+#define FORT_BOTTOM(addr) ((*(int*)addr) == -200 ? MPI_BOTTOM : (void*)addr)
+#define FORT_IN_PLACE(addr) ((*(int*)addr) == -100 ? MPI_IN_PLACE : (void*)addr)
+#define FORT_STATUS_IGNORE(addr) (static_cast<MPI_Status*>((*(int*)addr) == -300 ? MPI_STATUS_IGNORE : (void*)addr))
+#define FORT_STATUSES_IGNORE(addr) (static_cast<MPI_Status*>((*(int*)addr) == -400 ? MPI_STATUSES_IGNORE : (void*)addr))
+
+extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
+
+typedef SMPI_Cart_topology* MPIR_Cart_Topology;
+
+typedef SMPI_Graph_topology* MPIR_Graph_Topology;
+
+typedef SMPI_Dist_Graph_topology* MPIR_Dist_Graph_Topology;
+
+XBT_PRIVATE SMPI_Process* smpi_process();
+XBT_PRIVATE SMPI_Process* smpi_process_remote(int index);
+XBT_PRIVATE int smpi_process_count();
+
+XBT_PRIVATE void smpi_deployment_register_process(const char* instance_id, int rank, int index);
+XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const char* instance_id);
+XBT_PRIVATE msg_bar_t smpi_deployment_finalization_barrier(const char* instance_id);
+XBT_PRIVATE void smpi_deployment_cleanup_instances();
+
+XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_activity_t comm, void* buff, size_t buff_size);
+
+XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void* buff, size_t buff_size);
+
+XBT_PRIVATE int smpi_enabled();
+XBT_PRIVATE void smpi_global_init();
+XBT_PRIVATE void smpi_global_destroy();
+XBT_PRIVATE double smpi_mpi_wtime();
+XBT_PRIVATE void smpi_mpi_init();
+
+// utilities
+extern XBT_PRIVATE double smpi_cpu_threshold;
+extern XBT_PRIVATE double smpi_host_speed;
+extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
+extern XBT_PRIVATE int smpi_data_exe_size;    // size of the data+bss segment of the executable
+
+enum shared_malloc_type { shmalloc_none, shmalloc_local, shmalloc_global };
+extern XBT_PRIVATE shared_malloc_type smpi_cfg_shared_malloc; // Whether to activate shared malloc
+
+XBT_PRIVATE void smpi_switch_data_segment(int dest);
+XBT_PRIVATE void smpi_really_switch_data_segment(int dest);
+XBT_PRIVATE int smpi_is_privatization_file(char* file);
+
+XBT_PRIVATE void smpi_get_executable_global_size();
+XBT_PRIVATE void smpi_initialize_global_memory_segments();
+XBT_PRIVATE void smpi_destroy_global_memory_segments();
+XBT_PRIVATE void smpi_bench_destroy();
+XBT_PRIVATE void smpi_bench_begin();
+XBT_PRIVATE void smpi_bench_end();
+XBT_PRIVATE void smpi_shared_destroy();
+
+XBT_PRIVATE void* smpi_get_tmp_sendbuffer(int size);
+XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size);
+XBT_PRIVATE void smpi_free_tmp_buffer(void* buf);
+
+// f77 wrappers
+void mpi_init_(int* ierr);
+void mpi_finalize_(int* ierr);
+void mpi_abort_(int* comm, int* errorcode, int* ierr);
+void mpi_comm_rank_(int* comm, int* rank, int* ierr);
+void mpi_comm_size_(int* comm, int* size, int* ierr);
+double mpi_wtime_();
+double mpi_wtick_();
+void mpi_initialized_(int* flag, int* ierr);
+
+void mpi_comm_dup_(int* comm, int* newcomm, int* ierr);
+void mpi_comm_create_(int* comm, int* group, int* newcomm, int* ierr);
+void mpi_comm_free_(int* comm, int* ierr);
+void mpi_comm_split_(int* comm, int* color, int* key, int* comm_out, int* ierr);
+void mpi_group_incl_(int* group, int* n, int* key, int* group_out, int* ierr);
+void mpi_comm_group_(int* comm, int* group_out, int* ierr);
+void mpi_comm_create_group_(int* comm, int* group, int, int* comm_out, int* ierr);
+void mpi_send_init_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
+void mpi_isend_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
+void mpi_irsend_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* request, int* ierr);
+void mpi_send_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr);
+void mpi_rsend_(void* buf, int* count, int* datatype, int* dst, int* tag, int* comm, int* ierr);
+void mpi_recv_init_(void* buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr);
+void mpi_irecv_(void* buf, int* count, int* datatype, int* src, int* tag, int* comm, int* request, int* ierr);
+void mpi_recv_(void* buf, int* count, int* datatype, int* src, int* tag, int* comm, MPI_Status* status, int* ierr);
+void mpi_start_(int* request, int* ierr);
+void mpi_startall_(int* count, int* requests, int* ierr);
+void mpi_wait_(int* request, MPI_Status* status, int* ierr);
+void mpi_waitany_(int* count, int* requests, int* index, MPI_Status* status, int* ierr);
+void mpi_waitall_(int* count, int* requests, MPI_Status* status, int* ierr);
+
+void mpi_barrier_(int* comm, int* ierr);
+void mpi_bcast_(void* buf, int* count, int* datatype, int* root, int* comm, int* ierr);
+void mpi_reduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* ierr);
+void mpi_allreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr);
+void mpi_reduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype, int* op, int* comm, int* ierr);
+void mpi_scatter_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* root,
+                  int* comm, int* ierr);
+void mpi_scatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype, void* recvbuf, int* recvcount,
+                   int* recvtype, int* root, int* comm, int* ierr);
+void mpi_gather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* root,
+                 int* comm, int* ierr);
+void mpi_gatherv_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcounts, int* displs,
+                  int* recvtype, int* root, int* comm, int* ierr);
+void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                    int* comm, int* ierr);
+void mpi_allgatherv_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* displs,
+                     int* recvtype, int* comm, int* ierr);
+void mpi_type_size_(int* datatype, int* size, int* ierr);
+
+void mpi_scan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr);
+void mpi_alltoall_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                   int* comm, int* ierr);
+void mpi_alltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype, void* recvbuf, int* recvcounts,
+                    int* recvdisps, int* recvtype, int* comm, int* ierr);
+void mpi_get_processor_name_(char* name, int* resultlen, int* ierr);
+void mpi_test_(int* request, int* flag, MPI_Status* status, int* ierr);
+void mpi_testall_(int* count, int* requests, int* flag, MPI_Status* statuses, int* ierr);
+void mpi_get_count_(MPI_Status* status, int* datatype, int* count, int* ierr);
+void mpi_type_extent_(int* datatype, MPI_Aint* extent, int* ierr);
+void mpi_attr_get_(int* comm, int* keyval, void* attr_value, int* flag, int* ierr);
+void mpi_type_commit_(int* datatype, int* ierr);
+void mpi_type_vector_(int* count, int* blocklen, int* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_create_hvector_(int* count, int* blocklen, MPI_Aint* stride, int* old_type, int* newtype, int* ierr);
+void mpi_type_free_(int* datatype, int* ierr);
+void mpi_type_lb_(int* datatype, MPI_Aint* extent, int* ierr);
+void mpi_type_ub_(int* datatype, MPI_Aint* extent, int* ierr);
+void mpi_win_fence_(int* assert, int* win, int* ierr);
+void mpi_win_free_(int* win, int* ierr);
+void mpi_win_create_(int* base, MPI_Aint* size, int* disp_unit, int* info, int* comm, int* win, int* ierr);
+void mpi_win_set_name_(int* win, char* name, int* ierr, int size);
+void mpi_win_get_name_(int* win, char* name, int* len, int* ierr);
+void mpi_win_post_(int* group, int assert, int* win, int* ierr);
+void mpi_win_start_(int* group, int assert, int* win, int* ierr);
+void mpi_win_complete_(int* win, int* ierr);
+void mpi_win_wait_(int* win, int* ierr);
+void mpi_win_allocate_(MPI_Aint* size, int* disp_unit, int* info, int* comm, void* base, int* win, int* ierr);
+void mpi_win_attach_(int* win, int* base, MPI_Aint* size, int* ierr);
+void mpi_win_create_dynamic_(int* info, int* comm, int* win, int* ierr);
+void mpi_win_detach_(int* win, int* base, int* ierr);
+void mpi_win_set_info_(int* win, int* info, int* ierr);
+void mpi_win_get_info_(int* win, int* info, int* ierr);
+void mpi_win_get_group_(int* win, int* group, int* ierr);
+void mpi_win_get_attr_(int* win, int* type_keyval, void* attribute_val, int* flag, int* ierr);
+void mpi_win_set_attr_(int* win, int* type_keyval, void* att, int* ierr);
+void mpi_win_delete_attr_(int* win, int* comm_keyval, int* ierr);
+void mpi_win_create_keyval_(void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr);
+void mpi_win_free_keyval_(int* keyval, int* ierr);
+void mpi_win_lock_(int* lock_type, int* rank, int* assert, int* win, int* ierr);
+void mpi_win_lock_all_(int* assert, int* win, int* ierr);
+void mpi_win_unlock_(int* rank, int* win, int* ierr);
+void mpi_win_unlock_all_(int* win, int* ierr);
+void mpi_win_flush_(int* rank, int* win, int* ierr);
+void mpi_win_flush_local_(int* rank, int* win, int* ierr);
+void mpi_win_flush_all_(int* win, int* ierr);
+void mpi_win_flush_local_all_(int* win, int* ierr);
+void mpi_info_create_(int* info, int* ierr);
+void mpi_info_set_(int* info, char* key, char* value, int* ierr, unsigned int keylen, unsigned int valuelen);
+void mpi_info_free_(int* info, int* ierr);
+void mpi_get_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank, MPI_Aint* target_disp,
+              int* target_count, int* target_datatype, int* win, int* ierr);
+void mpi_put_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank, MPI_Aint* target_disp,
+              int* target_count, int* target_datatype, int* win, int* ierr);
+void mpi_rget_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank, MPI_Aint* target_disp,
+               int* target_count, int* target_datatype, int* win, int* request, int* ierr);
+void mpi_rput_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank, MPI_Aint* target_disp,
+               int* target_count, int* target_datatype, int* win, int* request, int* ierr);
+void mpi_fetch_and_op_(int* origin_addr, int* result_addr, int* datatype, int* target_rank, MPI_Aint* target_disp,
+                       int* op, int* win, int* ierr);
+void mpi_compare_and_swap_(int* origin_addr, int* compare_addr, int* result_addr, int* datatype, int* target_rank,
+                           MPI_Aint* target_disp, int* win, int* ierr);
+void mpi_get_accumulate_(int* origin_addr, int* origin_count, int* origin_datatype, int* result_addr, int* result_count,
+                         int* result_datatype, int* target_rank, MPI_Aint* target_disp, int* target_count,
+                         int* target_datatype, int* op, int* win, int* ierr);
+void mpi_rget_accumulate_(int* origin_addr, int* origin_count, int* origin_datatype, int* result_addr,
+                          int* result_count, int* result_datatype, int* target_rank, MPI_Aint* target_disp,
+                          int* target_count, int* target_datatype, int* op, int* win, int* request, int* ierr);
+void mpi_accumulate_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank, MPI_Aint* target_disp,
+                     int* target_count, int* target_datatype, int* op, int* win, int* ierr);
+void mpi_raccumulate_(int* origin_addr, int* origin_count, int* origin_datatype, int* target_rank,
+                      MPI_Aint* target_disp, int* target_count, int* target_datatype, int* op, int* win, int* request,
+                      int* ierr);
+void mpi_error_string_(int* errorcode, char* string, int* resultlen, int* ierr);
+void mpi_sendrecv_(void* sendbuf, int* sendcount, int* sendtype, int* dst, int* sendtag, void* recvbuf, int* recvcount,
+                   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, int size);
+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_op_commutative_(int* op, int* commute, 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_(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, int size);
+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, unsigned int keylen);
+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, unsigned int keylen);
+void mpi_info_delete_(int* info, char* key, int* ierr, unsigned int keylen);
+void mpi_info_get_nkeys_(int* info, int* nkeys, int* ierr);
+void mpi_info_get_nthkey_(int* info, int* n, char* key, int* ierr, unsigned int keylen);
+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);
+void mpi_file_close_(int* file, int* ierr);
+void mpi_file_delete_(char* filename, int* info, int* ierr);
+void mpi_file_open_(int* comm, char* filename, int* amode, int* info, int* fh, int* ierr);
+void mpi_file_set_view_(int* fh, long long int* offset, int* etype, int* filetype, char* datarep, int* info, int* ierr);
+void mpi_file_read_(int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr);
+void mpi_file_write_(int* fh, void* buf, int* count, int* datatype, MPI_Status* status, int* ierr);
+
+// TODO, make this static and expose it more cleanly
+
+struct s_smpi_privatization_region_t {
+  void* address;
+  int file_descriptor;
+};
+typedef s_smpi_privatization_region_t* smpi_privatization_region_t;
+
+extern XBT_PRIVATE smpi_privatization_region_t smpi_privatization_regions;
+extern XBT_PRIVATE int smpi_loaded_page;
+extern XBT_PRIVATE int smpi_universe_size;
+}
 
 /**
  * Get the address of the beginning of the memory page where addr is located.
  *
  * This is used when privatizing.
  */
-#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
+#define TOPAGE(addr) (void*)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
 
 #if HAVE_PAPI
-typedef
-    std::vector<std::pair</* counter name */std::string, /* counter value */long long>> papi_counter_t;
+typedef std::vector<std::pair</* counter name */ std::string, /* counter value */ long long>> papi_counter_t;
 XBT_PRIVATE papi_counter_t& smpi_process_papi_counters();
 XBT_PRIVATE int smpi_process_papi_event_set();
 #endif
@@ -34,14 +437,13 @@ XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location();
 XBT_PUBLIC(smpi_trace_call_location_t*) smpi_trace_get_call_location();
 }
 
-typedef enum {
+enum smpi_priv_strategies {
   SMPI_PRIVATIZE_NONE    = 0,
   SMPI_PRIVATIZE_MMAP    = 1,
   SMPI_PRIVATIZE_DLOPEN  = 2,
   SMPI_PRIVATIZE_DEFAULT = SMPI_PRIVATIZE_MMAP
-} smpi_priv_strategies;
+};
 
 extern XBT_PRIVATE int smpi_privatize_global_variables;
 
 #endif
-
index 8410ae7..3993774 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef SMPI_COLL_HPP
 #define SMPI_COLL_HPP
 
+#include "private.hpp"
 #include "xbt/base.h"
 
 /** \brief MPI collective description */
@@ -81,12 +82,11 @@ static ret cat  (COLL_UNPAREN args); \
 namespace simgrid{
 namespace smpi{
 
-struct mpi_coll_description {
+struct s_mpi_coll_description_t {
   const char *name;
   const char *description;
   void *coll;
 };
-typedef struct mpi_coll_description  s_mpi_coll_description_t;
 
 class Colls{
   public:
index 3b1fd7d..2fc90cf 100644 (file)
 extern const MPI_Datatype MPI_PTR;
 
 //The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
-typedef struct {
+struct float_int {
   float value;
   int index;
-} float_int;
-typedef struct {
+};
+struct float_float {
   float value;
   float index;
-} float_float;
-typedef struct {
+};
+struct long_long {
   long value;
   long index;
-} long_long;
-typedef struct {
+};
+struct double_double {
   double value;
   double index;
-} double_double;
-typedef struct {
+};
+struct long_int {
   long value;
   int index;
-} long_int;
-typedef struct {
+};
+struct double_int {
   double value;
   int index;
-} double_int;
-typedef struct {
+};
+struct short_int {
   short value;
   int index;
-} short_int;
-typedef struct {
+};
+struct int_int {
   int value;
   int index;
-} int_int;
-typedef struct {
+};
+struct long_double_int {
   long double value;
   int index;
-} long_double_int;
-typedef struct {
+};
+struct integer128_t {
   int64_t value;
   int64_t index;
-} integer128_t;
-
+};
 
 namespace simgrid{
 namespace smpi{
index 7380364..4637dea 100644 (file)
@@ -8,6 +8,7 @@
 #define SMPI_GROUP_HPP_INCLUDED
 
 #include "smpi_f2c.hpp"
+#include <smpi/smpi.h>
 
 namespace simgrid{
 namespace smpi{
index c0ee395..48f60ac 100644 (file)
@@ -7,29 +7,28 @@
 #define SMPI_KEYVALS_HPP_INCLUDED
 
 #include "smpi/smpi.h"
-#include "xbt/ex.hpp"
 
 #include <unordered_map>
 
-typedef struct smpi_delete_fn{
+struct smpi_delete_fn {
   MPI_Comm_delete_attr_function          *comm_delete_fn;
   MPI_Type_delete_attr_function          *type_delete_fn;
   MPI_Win_delete_attr_function           *win_delete_fn;
-} smpi_delete_fn;
+};
 
-typedef struct smpi_copy_fn{
+struct smpi_copy_fn {
   MPI_Comm_copy_attr_function          *comm_copy_fn;
   MPI_Type_copy_attr_function          *type_copy_fn;
   MPI_Win_copy_attr_function           *win_copy_fn;
-} smpi_copy_fn;
+};
 
-typedef struct s_smpi_key_elem {
+struct s_smpi_key_elem_t {
   smpi_copy_fn copy_fn;
   smpi_delete_fn delete_fn;
   int refcount;
-} s_smpi_mpi_key_elem_t;
+};
 
-typedef struct s_smpi_key_elem *smpi_key_elem;
+typedef s_smpi_key_elem_t* smpi_key_elem;
 
 namespace simgrid{
 namespace smpi{
@@ -54,7 +53,7 @@ class Keyval{
 
 template <typename T> int Keyval::keyval_create(smpi_copy_fn copy_fn, smpi_delete_fn delete_fn, int* keyval, void* extra_state){
 
-  smpi_key_elem value = (smpi_key_elem) xbt_new0(s_smpi_mpi_key_elem_t,1);
+  smpi_key_elem value = new s_smpi_key_elem_t;
 
   value->copy_fn=copy_fn;
   value->delete_fn=delete_fn;
@@ -75,7 +74,7 @@ template <typename T> int Keyval::keyval_free(int* keyval){
   }
   if(elem->refcount==1){
     T::keyvals_.erase(*keyval);
-    xbt_free(elem);
+    delete elem;
   }else{
     elem->refcount--;
   }
index f532ec7..0e480b0 100644 (file)
@@ -7,8 +7,8 @@
 #ifndef SMPI_PROCESS_HPP
 #define SMPI_PROCESS_HPP
 
-#include "src/instr/instr_smpi.h"
 #include "simgrid/s4u/Mailbox.hpp"
+#include "src/instr/instr_smpi.hpp"
 #include "xbt/synchro.h"
 
 namespace simgrid{
index ea49c12..8106b22 100644 (file)
@@ -7,8 +7,10 @@
 #ifndef SMPI_WIN_HPP_INCLUDED
 #define SMPI_WIN_HPP_INCLUDED
 
+#include "smpi_f2c.hpp"
 #include "smpi_keyvals.hpp"
 #include "xbt/synchro.h"
+#include <simgrid/msg.h>
 
 #include <vector>
 #include <list>
index 69ffcb2..2d07348 100644 (file)
@@ -4,7 +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. */
 
-#include "private.h"
 #include "private.hpp"
 #include <cctype>
 #include <cstdarg>
@@ -190,7 +189,7 @@ void TRACE_smpi_init(int rank)
 
   container_t father;
   if (TRACE_smpi_is_grouped()){
-    father = PJ_container_get(sg_host_self_get_name());
+    father = simgrid::instr::Container::byName(sg_host_self_get_name());
   }else{
     father = PJ_container_get_root ();
   }
@@ -209,7 +208,7 @@ void TRACE_smpi_init(int rank)
      * multiple times but only the last one would be used...
      */
     if (s_type::getOrNull(it.first.c_str(), container->type_) == nullptr) {
-      Type::variableNew(it.first.c_str(), nullptr, container->type_);
+      Type::variableNew(it.first.c_str(), "", container->type_);
     }
   }
 #endif
@@ -221,8 +220,8 @@ void TRACE_smpi_finalize(int rank)
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
-  container_t container = PJ_container_get(smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE));
-  PJ_container_remove_from_parent (container);
+  container_t container = simgrid::instr::Container::byName(smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE));
+  container->removeFromParent();
   delete container;
 }
 
@@ -235,10 +234,10 @@ void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color (operation);
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type);
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
@@ -249,8 +248,8 @@ void TRACE_smpi_collective_out(int rank, const char *operation)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -263,11 +262,11 @@ void TRACE_smpi_computing_init(int rank)
 
  char str[INSTR_DEFAULT_STR_SIZE];
  smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
- container_t container = PJ_container_get(str);
- simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+ container_t container      = simgrid::instr::Container::byName(str);
+ simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
  const char* color     = instr_find_color("computing");
  new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type,
-                                    simgrid::instr::Value::get_or_new("computing", color, type));
+                                    simgrid::instr::Value::byNameOrCreate("computing", color, type));
 }
 
 void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
@@ -280,9 +279,9 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("computing", nullptr, type);
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("computing", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
@@ -292,8 +291,8 @@ void TRACE_smpi_computing_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -305,10 +304,10 @@ void TRACE_smpi_sleeping_init(int rank)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color ("sleeping");
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", color, type);
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("sleeping", color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val);
 }
 
@@ -322,9 +321,9 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", nullptr, type);
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("sleeping", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
@@ -334,8 +333,8 @@ void TRACE_smpi_sleeping_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -349,9 +348,9 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("test", nullptr, type);
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("test", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
@@ -361,8 +360,8 @@ void TRACE_smpi_testing_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -375,10 +374,10 @@ void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color (operation);
-  simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type);
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
@@ -389,8 +388,8 @@ void TRACE_smpi_ptp_out(int rank, int dst, const char *operation)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -405,8 +404,8 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(src, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
   XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
   new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
 }
@@ -421,8 +420,8 @@ void TRACE_smpi_recv(int src, int dst, int tag)
 
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(dst, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK");
+  container_t container      = simgrid::instr::Container::byName(str);
+  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
   XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
   new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
 }
index 24ba704..4e1243a 100644 (file)
@@ -3,7 +3,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. */
 
-#include "private.h"
 #include "private.hpp"
 #include "simgrid/modelchecker.h"
 #include "smpi_comm.hpp"
@@ -204,13 +203,13 @@ int smpi_usleep(useconds_t usecs)
 }
 
 #if _POSIX_TIMERS > 0
-int smpi_nanosleep(const struct timespec *tp, struct timespec * t)
+int smpi_nanosleep(const struct timespec* tp, struct timespec* /*t*/)
 {
   return static_cast<int>(private_sleep(static_cast<double>(tp->tv_sec + tp->tv_nsec / 1000000000.0)));
 }
 #endif
 
-int smpi_gettimeofday(struct timeval *tv, void* tz)
+int smpi_gettimeofday(struct timeval* tv, void* /*tz*/)
 {
   smpi_bench_end();
   double now = SIMIX_get_clock();
@@ -227,7 +226,7 @@ int smpi_gettimeofday(struct timeval *tv, void* tz)
 }
 
 #if _POSIX_TIMERS > 0
-int smpi_clock_gettime(clockid_t clk_id, struct timespec *tp)
+int smpi_clock_gettime(clockid_t /*clk_id*/, struct timespec* tp)
 {
   //there is only one time in SMPI, so clk_id is ignored.
   smpi_bench_end();
index 78a95fd..407fe67 100644 (file)
@@ -4,9 +4,9 @@
 /* This program 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/msg.h" /* barrier */
 #include "SmpiHost.hpp"
-#include "private.h"
+#include "private.hpp"
+#include "simgrid/msg.h" /* barrier */
 #include "smpi_comm.hpp"
 #include <map>
 
index f83165f..69e8a08 100644 (file)
@@ -79,14 +79,14 @@ typedef char *address;
 typedef short int shortint;
 typedef float real;
 typedef double doublereal;
-typedef struct {
+struct complex {
   real r;
   real i;
-} complex;
-typedef struct {
+};
+struct doublecomplex {
   doublereal r;
   doublereal i;
-} doublecomplex;
+};
 
 extern "C" XBT_PUBLIC(doublereal) smpi_get_host_power_peak_at_(integer *pstate_index);
 doublereal smpi_get_host_power_peak_at_(integer *pstate_index)
index 866f17f..5fc43b3 100644 (file)
@@ -3,21 +3,20 @@
 /* This program 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 "mc/mc.h"
-#include "simgrid/s4u/Mailbox.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "src/msg/msg_private.h"
-#include "src/simix/smx_private.h"
-#include "src/surf/surf_interface.hpp"
 #include "SmpiHost.hpp"
-#include "xbt/config.hpp"
-#include "private.h"
+#include "mc/mc.h"
 #include "private.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Mailbox.hpp"
 #include "smpi_coll.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_group.hpp"
 #include "smpi_info.hpp"
 #include "smpi_process.hpp"
+#include "src/msg/msg_private.hpp"
+#include "src/simix/smx_private.hpp"
+#include "src/surf/surf_interface.hpp"
+#include "xbt/config.hpp"
 
 #include <cfloat> /* DBL_MAX */
 #include <dlfcn.h>
index a94b870..7ac4abd 100644 (file)
@@ -24,7 +24,6 @@
 #include "src/internal_config.h"
 #include "src/xbt/memory_map.hpp"
 
-#include "private.h"
 #include "private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
@@ -147,8 +146,7 @@ void smpi_initialize_global_memory_segments()
     return;
   }
 
-  smpi_privatization_regions = static_cast<smpi_privatization_region_t>(
-      xbt_malloc(smpi_process_count() * sizeof(struct s_smpi_privatization_region)));
+  smpi_privatization_regions = new s_smpi_privatization_region_t[smpi_process_count()];
 
   for (int i=0; i< smpi_process_count(); i++){
     // create SIMIX_process_count() mappings of this size with the same data inside
@@ -216,7 +214,7 @@ void smpi_destroy_global_memory_segments(){
       XBT_WARN("Unmapping of fd %d failed: %s", smpi_privatization_regions[i].file_descriptor, strerror(errno));
     close(smpi_privatization_regions[i].file_descriptor);
   }
-  xbt_free(smpi_privatization_regions);
+  delete[] smpi_privatization_regions;
 #endif
 }
 
index 742af85..d073614 100644 (file)
@@ -3,16 +3,14 @@
 /* This program 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 "smpi_process.hpp"
 #include "mc/mc.h"
-#include "src/mc/mc_replay.h"
-#include "src/msg/msg_private.h"
-#include "src/simix/smx_private.h"
-#include "private.h"
 #include "private.hpp"
-#include "smpi_process.hpp"
-#include "smpi_group.hpp"
 #include "smpi_comm.hpp"
-
+#include "smpi_group.hpp"
+#include "src/mc/mc_replay.h"
+#include "src/msg/msg_private.hpp"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (kernel)");
 
index 90cac5b..98ef1da 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "private.hpp"
 #include "smpi_coll.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
index 728b97a..9f30550 100644 (file)
@@ -36,7 +36,6 @@
 #include <map>
 #include <cstring>
 
-#include "private.h"
 #include "private.hpp"
 #include <cerrno>
 
@@ -68,6 +67,7 @@ namespace{
 
 class smpi_source_location : public std::string {
 public:
+  smpi_source_location() = default;
   smpi_source_location(const char* filename, int line) : std::string(std::string(filename) + ":" + std::to_string(line))
   {
   }
@@ -239,16 +239,15 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
     xbt_free(huge_page_filename);
   }
   if(smpi_shared_malloc_bogusfile == -1) {
-    char *name                   = xbt_strdup("/tmp/simgrid-shmalloc-XXXXXX");
+    char name[]                  = "/tmp/simgrid-shmalloc-XXXXXX";
     smpi_shared_malloc_bogusfile = mkstemp(name);
     XBT_DEBUG("bogusfile         : %s\n", name);
     unlink(name);
-    xbt_free(name);
-    char* dumb = (char*)calloc(1, smpi_shared_malloc_blocksize);
+    char* dumb  = new char[smpi_shared_malloc_blocksize](); // zero initialized
     ssize_t err = write(smpi_shared_malloc_bogusfile, dumb, smpi_shared_malloc_blocksize);
     if(err<0)
       xbt_die("Could not write bogus file for shared malloc");
-    xbt_free(dumb);
+    delete[] dumb;
   }
 
   int mmap_base_flag = MAP_FIXED | MAP_SHARED | MAP_POPULATE;
@@ -314,7 +313,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
 
   shared_metadata_t newmeta;
   //register metadata for memcpy avoidance
-  shared_data_key_type* data = (shared_data_key_type*)xbt_malloc(sizeof(shared_data_key_type));
+  shared_data_key_type* data = new shared_data_key_type;
   data->second.fd = -1;
   data->second.count = 1;
   newmeta.size = size;
@@ -347,8 +346,8 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) {
     size_t shared_block_offsets[2] = {0, size};
     return smpi_shared_malloc_partial(size, shared_block_offsets, nb_shared_blocks);
   }
-  XBT_DEBUG("Classic malloc %zu", size);
-  return xbt_malloc(size);
+  XBT_DEBUG("Classic allocation of %zu bytes", size);
+  return ::operator new(size);
 }
 
 int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>> &private_blocks, size_t *offset){
@@ -442,13 +441,13 @@ void smpi_shared_free(void *ptr)
     if (meta != allocs_metadata.end()){
       meta->second.data->second.count--;
       if(meta->second.data->second.count==0)
-        xbt_free(meta->second.data);
+        delete meta->second.data;
     }
 
     munmap(ptr, meta->second.size);
   } else {
-    XBT_DEBUG("Classic free of %p", ptr);
-    xbt_free(ptr);
+    XBT_DEBUG("Classic deallocation of %p", ptr);
+    ::operator delete(ptr);
   }
 }
 #endif
index 7d26e57..0d504c4 100644 (file)
@@ -3,13 +3,13 @@
 /* This program 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.hpp"
 #include <stack>
-#include "private.h"
 
-typedef struct s_smpi_static {
+struct s_smpi_static_t {
   void *ptr;
   void_f_pvoid_t free_fn;
-} s_smpi_static_t;
+};
 
 /**
  * \brief Holds a reference to all static variables that were registered
index e70e205..2416e66 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "smpi_comm.hpp"
-#include "private.h"
 #include "private.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "smpi_coll.hpp"
@@ -13,7 +12,7 @@
 #include "smpi_request.hpp"
 #include "smpi_status.hpp"
 #include "smpi_win.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 #include <algorithm>
 #include <climits>
 #include <vector>
index 565ec99..e23986d 100644 (file)
@@ -5,7 +5,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/modelchecker.h"
-#include "private.h"
 #include "private.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
index ba77e82..3be87a2 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "smpi_datatype_derived.hpp"
 #include "smpi_op.hpp"
+#include <xbt/log.h>
 
 XBT_LOG_EXTERNAL_CATEGORY(smpi_datatype);
 
index 4a31be6..0b17daa 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
 #include "smpi_f2c.hpp"
+#include "private.hpp"
 #include "smpi_process.hpp"
 
 #include <cstdio>
index a3b3446..6f837af 100644 (file)
@@ -3,8 +3,10 @@
 /* This program 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 "smpi_comm.hpp"
 #include "smpi_group.hpp"
+#include "smpi_comm.hpp"
+#include <string>
+#include <xbt/log.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_group, smpi, "Logging specific to SMPI (group)");
 
@@ -224,7 +226,7 @@ int Group::excl(int n, int *ranks, MPI_Group * newgroup){
   int oldsize = size_;
   int newsize = oldsize - n;
   *newgroup = new  Group(newsize);
-  int* to_exclude=xbt_new0(int, size_);
+  int* to_exclude = new int[size_];
   for (int i     = 0; i < oldsize; i++)
     to_exclude[i]=0;
   for (int i            = 0; i < n; i++)
@@ -237,7 +239,7 @@ int Group::excl(int n, int *ranks, MPI_Group * newgroup){
       j++;
     }
   }
-  xbt_free(to_exclude);
+  delete[] to_exclude;
   return MPI_SUCCESS;
 
 }
index 559ef5c..9c1b900 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. */
 
-//#include "private.h"
+//#include "private.hpp"
 #include "smpi_keyvals.hpp"
 
 namespace simgrid{
index 67d6ae8..0112d9b 100644 (file)
@@ -3,7 +3,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. */
 
-#include "private.h"
 #include "private.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
index d490799..8834d32 100644 (file)
@@ -9,7 +9,6 @@
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_replay.h"
 #include "SmpiHost.hpp"
-#include "private.h"
 #include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
index 5750465..e282a22 100644 (file)
@@ -3,10 +3,10 @@
 /* This program 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 "src/simix/smx_private.h"
-#include "smpi_datatype.hpp"
 #include "smpi_status.hpp"
+#include "private.hpp"
+#include "smpi_datatype.hpp"
+#include "src/simix/smx_private.hpp"
 
 namespace simgrid{
 namespace smpi{
index b55b0e3..b56bc73 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "smpi/smpi.h"
-#include "private.h"
+#include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_topo.hpp"
 #include "xbt/sysdep.h"
index 02c7765..7cc829a 100644 (file)
@@ -3,7 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "private.h"
+#include "smpi_win.hpp"
+#include "private.hpp"
 #include "smpi_coll.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
@@ -11,7 +12,6 @@
 #include "smpi_keyvals.hpp"
 #include "smpi_process.hpp"
 #include "smpi_request.hpp"
-#include "smpi_win.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_rma, smpi, "Logging specific to SMPI (RMA operations)");
 
index ff0a830..d190065 100644 (file)
@@ -29,7 +29,7 @@ FileImpl::FileImpl(sg_storage_t st, std::string path, std::string mount) : path_
 
 Action* FileImpl::read(sg_size_t size)
 {
-  XBT_DEBUG("READ %s on disk '%s'", cname(), location_->cname());
+  XBT_DEBUG("READ %s on disk '%s'", getCname(), location_->getCname());
   if (current_position_ + size > size_) {
     if (current_position_ > size_) {
       size = 0;
@@ -45,7 +45,7 @@ Action* FileImpl::read(sg_size_t size)
 
 Action* FileImpl::write(sg_size_t size)
 {
-  XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", cname(), location_->cname(), size, size_);
+  XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getCname(), location_->getCname(), size, size_);
 
   StorageAction* action = location_->write(size);
   action->file_         = this;
@@ -79,10 +79,10 @@ int FileImpl::unlink()
 {
   /* Check if the file is on this storage */
   if (location_->getContent()->find(path_) == location_->getContent()->end()) {
-    XBT_WARN("File %s is not on disk %s. Impossible to unlink", cname(), location_->cname());
+    XBT_WARN("File %s is not on disk %s. Impossible to unlink", getCname(), location_->getCname());
     return -1;
   } else {
-    XBT_DEBUG("UNLINK %s on disk '%s'", cname(), location_->cname());
+    XBT_DEBUG("UNLINK %s on disk '%s'", getCname(), location_->getCname());
     location_->usedSize_ -= size_;
 
     // Remove the file from storage
index 6b2f9cc..94337fe 100644 (file)
@@ -18,8 +18,8 @@ public:
   FileImpl(sg_storage_t st, std::string path, std::string mount);
   ~FileImpl() = default;
 
-  std::string name() { return path_; }
-  const char* cname() { return path_.c_str(); }
+  const std::string& getName() const { return path_; }
+  const char* getCname() const { return path_.c_str(); }
   const char* mount() { return mount_point_.c_str(); }
   sg_size_t size() { return size_; }
   void setSize(sg_size_t size) { size_ = size; }
index f3530f5..18bf4bc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -80,13 +80,16 @@ Action* HostModel::executeParallelTask(int host_nb, simgrid::s4u::Host** host_li
       xbt_die("Cannot have a communication that is not a simple point-to-point in this model. You should consider "
           "using the ptask model");
     }
-  } else
+  } else {
     xbt_die(
         "This model only accepts one of the following. You should consider using the ptask model for the other cases.\n"
         " - execution with one host only and no communication\n"
         " - Self-comms with one host only\n"
         " - Communications with two hosts and no computation");
-  xbt_free(host_list);
+  }
+  delete[] host_list;
+  delete[] flops_amount;
+  delete[] bytes_amount;
   return action;
 }
 
@@ -104,7 +107,7 @@ void HostImpl::getAttachedStorageList(std::vector<const char*>* storages)
 {
   for (auto const& s : storage_)
     if (s.second->getHost() == piface_->getCname())
-      storages->push_back(s.second->piface_.getName());
+      storages->push_back(s.second->piface_.getCname());
 }
 
 }
index 122bfde..a4ddf1b 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "StorageImpl.hpp"
 
-#include "surf_private.h"
+#include "surf_private.hpp"
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include <boost/algorithm/string/split.hpp>
index b74d624..b5f52e1 100644 (file)
@@ -165,10 +165,10 @@ private:
 /** @ingroup SURF_storage_interface
  * @brief The possible type of action for the storage component
  */
-typedef enum {
+enum e_surf_action_storage_type_t {
   READ = 0, /**< Read a file */
   WRITE     /**< Write in a file */
-} e_surf_action_storage_type_t;
+};
 
 /** @ingroup SURF_storage_interface
  * @brief SURF storage action interface class
index 22eac86..ca7cae6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2011, 2013-2016. The SimGrid Team.
+/* Copyright (c) 2009-2011, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -179,7 +179,7 @@ CpuAction *CpuCas01::sleep(double duration)
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
-  XBT_IN("(%s,%g)", cname(), duration);
+  XBT_IN("(%s,%g)", getCname(), duration);
   CpuCas01Action* action = new CpuCas01Action(model(), 1.0, isOff(), speed_.scale * speed_.peak, constraint());
 
   // FIXME: sleep variables should not consume 1.0 in lmm_expand
index 7a6dc74..faa4ab5 100644 (file)
@@ -4,9 +4,9 @@
 /* This program 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/dynar.h>
 #include "cpu_interface.hpp"
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include <xbt/dynar.h>
 
 XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module");
@@ -30,8 +30,9 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/)
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
     if (TRACE_is_enabled()) {
       Cpu *cpu = static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)));
-      TRACE_surf_host_set_utilization(cpu->cname(), action->getCategory(), lmm_variable_getvalue(action->getVariable()),
-                                      action->getLastUpdate(), now - action->getLastUpdate());
+      TRACE_surf_host_set_utilization(cpu->getCname(), action->getCategory(),
+                                      lmm_variable_getvalue(action->getVariable()), action->getLastUpdate(),
+                                      now - action->getLastUpdate());
     }
 
     action->finish(Action::State::done);
@@ -71,8 +72,8 @@ void CpuModel::updateActionsStateFull(double now, double delta)
     if (TRACE_is_enabled()) {
       Cpu *cpu = static_cast<Cpu*> (lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)) );
 
-      TRACE_surf_host_set_utilization(cpu->cname(), action->getCategory(), lmm_variable_getvalue(action->getVariable()),
-                                      now - delta, delta);
+      TRACE_surf_host_set_utilization(cpu->getCname(), action->getCategory(),
+                                      lmm_variable_getvalue(action->getVariable()), now - delta, delta);
       TRACE_last_timestamp_to_dump = now - delta;
     }
 
@@ -123,7 +124,7 @@ int Cpu::getNbPStates()
 void Cpu::setPState(int pstate_index)
 {
   xbt_assert(pstate_index <= static_cast<int>(speedPerPstate_.size()),
-             "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", cname(), pstate_index,
+             "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", getCname(), pstate_index,
              static_cast<int>(speedPerPstate_.size()));
 
   double new_peak_speed = speedPerPstate_[pstate_index];
@@ -157,7 +158,7 @@ double Cpu::getAvailableSpeed()
 }
 
 void Cpu::onSpeedChange() {
-  TRACE_surf_host_set_speed(surf_get_clock(), cname(), coresAmount_ * speed_.scale * speed_.peak);
+  TRACE_surf_host_set_speed(surf_get_clock(), getCname(), coresAmount_ * speed_.scale * speed_.peak);
   s4u::Host::onSpeedChange(*host_);
 }
 
@@ -197,7 +198,7 @@ void CpuAction::updateRemainingLazy(double now)
 
     if (TRACE_is_enabled()) {
       Cpu *cpu = static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
-      TRACE_surf_host_set_utilization(cpu->cname(), getCategory(), lastValue_, lastUpdate_, now - lastUpdate_);
+      TRACE_surf_host_set_utilization(cpu->getCname(), getCategory(), lastValue_, lastUpdate_, now - lastUpdate_);
     }
     XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, remains_);
   }
index 454efa8..eea488f 100644 (file)
@@ -548,8 +548,8 @@ void CpuTi::updateActionsFinishTime(double now)
     if (min_finish > NO_MAX_DURATION)
       xbt_heap_push(static_cast<CpuTiModel*>(model())->tiActionHeap_, action, min_finish);
 
-    XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", cname(), action,
-              action->getStartTime(), action->finishTime_, action->getMaxDuration());
+    XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
+              action, action->getStartTime(), action->finishTime_, action->getMaxDuration());
   }
   /* remove from modified cpu */
   modified(false);
@@ -609,7 +609,7 @@ void CpuTi::updateRemainingAmount(double now)
 
 CpuAction *CpuTi::execution_start(double size)
 {
-  XBT_IN("(%s,%g)", cname(), size);
+  XBT_IN("(%s,%g)", getCname(), size);
   CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), size, isOff(), this);
 
   actionSet_->push_back(*action);
@@ -624,7 +624,7 @@ CpuAction *CpuTi::sleep(double duration)
   if (duration > 0)
     duration = MAX(duration, sg_surf_precision);
 
-  XBT_IN("(%s,%g)", cname(), duration);
+  XBT_IN("(%s,%g)", getCname(), duration);
   CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
 
   action->maxDuration_ = duration;
index fb1a77b..774ad4b 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
@@ -65,10 +65,10 @@ static container_t lowestCommonAncestor (container_t a1, container_t a2)
   return p;
 }
 
-static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
+static void linkContainers(container_t src, container_t dst, std::set<std::string>* filter)
 {
   //ignore loopback
-  if (strcmp(src->name_, "__loopback__") == 0 || strcmp(dst->name_, "__loopback__") == 0) {
+  if (src->name_ == "__loopback__" || dst->name_ == "__loopback__") {
     XBT_DEBUG ("  linkContainers: ignoring loopback link");
     return;
   }
@@ -79,36 +79,29 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
     xbt_die ("common father unknown, this is a tracing problem");
   }
 
-  if (filter != nullptr){
-    //check if we already register this pair (we only need one direction)
-    char aux1[INSTR_DEFAULT_STR_SIZE];
-    char aux2[INSTR_DEFAULT_STR_SIZE];
-    snprintf(aux1, INSTR_DEFAULT_STR_SIZE, "%s%s", src->name_, dst->name_);
-    snprintf(aux2, INSTR_DEFAULT_STR_SIZE, "%s%s", dst->name_, src->name_);
-    if (xbt_dict_get_or_null (filter, aux1)){
-      XBT_DEBUG("  linkContainers: already registered %s <-> %s (1)", src->name_, dst->name_);
-      return;
-    }
-    if (xbt_dict_get_or_null (filter, aux2)){
-      XBT_DEBUG("  linkContainers: already registered %s <-> %s (2)", dst->name_, src->name_);
-      return;
-    }
-
-    //ok, not found, register it
-    xbt_dict_set (filter, aux1, xbt_strdup ("1"), nullptr);
-    xbt_dict_set (filter, aux2, xbt_strdup ("1"), nullptr);
+  // check if we already register this pair (we only need one direction)
+  std::string aux1 = src->name_ + dst->name_;
+  std::string aux2 = dst->name_ + src->name_;
+  if (filter->find(aux1) != filter->end()) {
+    XBT_DEBUG("  linkContainers: already registered %s <-> %s (1)", src->name_.c_str(), dst->name_.c_str());
+    return;
+  }
+  if (filter->find(aux2) != filter->end()) {
+    XBT_DEBUG("  linkContainers: already registered %s <-> %s (2)", dst->name_.c_str(), src->name_.c_str());
+    return;
   }
 
+  // ok, not found, register it
+  filter->insert(aux1);
+  filter->insert(aux2);
+
   //declare type
-  char link_typename[INSTR_DEFAULT_STR_SIZE];
-  snprintf(link_typename, INSTR_DEFAULT_STR_SIZE, "%s-%s%s-%s%s", father->type_->name_, src->type_->name_,
-           src->type_->id_, dst->type_->name_, dst->type_->id_);
-  simgrid::instr::Type* link_type = father->type_->getChildOrNull(link_typename);
-  if (link_type == nullptr)
-    link_type = simgrid::instr::Type::linkNew(link_typename, father->type_, src->type_, dst->type_);
+  std::string link_typename = father->type_->getName() + "-" + src->type_->getName() + src->type_->getId() + "-" +
+                              dst->type_->getName() + dst->type_->getId();
+  simgrid::instr::Type* link_type = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
 
   //register EDGE types for triva configuration
-  trivaEdgeTypes.insert(link_type->name_);
+  trivaEdgeTypes.insert(link_type->getName());
 
   //create the link
   static long long counter = 0;
@@ -120,10 +113,11 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
   new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
   new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
 
-  XBT_DEBUG("  linkContainers %s <-> %s", src->name_, dst->name_);
+  XBT_DEBUG("  linkContainers %s <-> %s", src->name_.c_str(), dst->name_.c_str());
 }
 
-static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t container, xbt_dict_t filter)
+static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t container,
+                                     std::set<std::string>* filter)
 {
   if (not TRACE_platform_topology()) {
     XBT_DEBUG("Graph extraction disabled by user.");
@@ -133,7 +127,7 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
   if (not netzone->getChildren()->empty()) {
     //bottom-up recursion
     for (auto const& nz_son : *netzone->getChildren()) {
-      container_t child_container = static_cast<container_t>(xbt_dict_get(container->children_, nz_son->getCname()));
+      container_t child_container = container->children_.at(nz_son->getCname());
       recursiveGraphExtraction(nz_son, child_container, filter);
     }
   }
@@ -148,9 +142,8 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
 
   static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
   xbt_dict_foreach(edges,cursor,edge_name,edge) {
-    linkContainers(
-          PJ_container_get(static_cast<const char*>(edge->src->data)),
-          PJ_container_get(static_cast<const char*>(edge->dst->data)), filter);
+    linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
+                   simgrid::instr::Container::byName(static_cast<const char*>(edge->dst->data)), filter);
   }
   xbt_dict_free (&nodes);
   xbt_dict_free (&edges);
@@ -162,20 +155,17 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
  */
 static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
 {
-  const char* id = netzone.getCname();
+  std::string id = netzone.getName();
 
   if (PJ_container_get_root() == nullptr){
     container_t root = new simgrid::instr::Container(id, simgrid::instr::INSTR_AS, nullptr);
     PJ_container_set_root (root);
 
     if (TRACE_smpi_is_enabled()) {
-      simgrid::instr::Type* mpi = root->type_->getChildOrNull("MPI");
-      if (mpi == nullptr){
-        mpi = simgrid::instr::Type::containerNew("MPI", root->type_);
-        if (not TRACE_smpi_is_grouped())
-          simgrid::instr::Type::stateNew("MPI_STATE", mpi);
-        simgrid::instr::Type::linkNew("MPI_LINK", PJ_type_get_root(), mpi, mpi);
-      }
+      simgrid::instr::Type* mpi = root->type_->getOrCreateContainerType("MPI");
+      if (not TRACE_smpi_is_grouped())
+        mpi->getOrCreateStateType("MPI_STATE");
+      simgrid::instr::Type::getRootType()->getOrCreateLinkType("MPI_LINK", mpi, mpi);
     }
 
     if (TRACE_needs_platform()){
@@ -207,22 +197,16 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
   double bandwidth_value = link.bandwidth();
   double latency_value   = link.latency();
 
-  container_t container = new simgrid::instr::Container(link.name(), simgrid::instr::INSTR_LINK, father);
+  container_t container = new simgrid::instr::Container(link.getCname(), simgrid::instr::INSTR_LINK, father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
-    simgrid::instr::Type* bandwidth = container->type_->getChildOrNull("bandwidth");
-    if (bandwidth == nullptr)
-      bandwidth = simgrid::instr::Type::variableNew("bandwidth", nullptr, container->type_);
-    simgrid::instr::Type* latency = container->type_->getChildOrNull("latency");
-    if (latency == nullptr)
-      latency = simgrid::instr::Type::variableNew("latency", nullptr, container->type_);
+    simgrid::instr::Type* bandwidth = container->type_->getOrCreateVariableType("bandwidth", "");
+    simgrid::instr::Type* latency   = container->type_->getOrCreateVariableType("latency", "");
     new simgrid::instr::SetVariableEvent(0, container, bandwidth, bandwidth_value);
     new simgrid::instr::SetVariableEvent(0, container, latency, latency_value);
   }
   if (TRACE_uncategorized()) {
-    simgrid::instr::Type* bandwidth_used = container->type_->getChildOrNull("bandwidth_used");
-    if (bandwidth_used == nullptr)
-      simgrid::instr::Type::variableNew("bandwidth_used", "0.5 0.5 0.5", container->type_);
+    container->type_->getOrCreateVariableType("bandwidth_used", "0.5 0.5 0.5");
   }
 }
 
@@ -232,59 +216,40 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
   container_t container = new simgrid::instr::Container(host.getCname(), simgrid::instr::INSTR_HOST, father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
-    simgrid::instr::Type* speed = container->type_->getChildOrNull("power");
-    if (speed == nullptr){
-      speed = simgrid::instr::Type::variableNew("power", nullptr, container->type_);
-    }
+    simgrid::instr::Type* speed = container->type_->getOrCreateVariableType("power", "");
 
     double current_speed_state = host.getSpeed();
     new simgrid::instr::SetVariableEvent(0, container, speed, current_speed_state);
   }
-  if (TRACE_uncategorized()){
-    simgrid::instr::Type* speed_used = container->type_->getChildOrNull("power_used");
-    if (speed_used == nullptr){
-      simgrid::instr::Type::variableNew("power_used", "0.5 0.5 0.5", container->type_);
-    }
-  }
+  if (TRACE_uncategorized())
+    container->type_->getOrCreateVariableType("power_used", "0.5 0.5 0.5");
 
-  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
-    simgrid::instr::Type* mpi = container->type_->getChildOrNull("MPI");
-    if (mpi == nullptr){
-      mpi = simgrid::instr::Type::containerNew("MPI", container->type_);
-      simgrid::instr::Type::stateNew("MPI_STATE", mpi);
-    }
-  }
+  if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped())
+    container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE");
 
   if (TRACE_msg_process_is_enabled()) {
-    simgrid::instr::Type* msg_process = container->type_->getChildOrNull("MSG_PROCESS");
-    if (msg_process == nullptr){
-      msg_process                 = simgrid::instr::Type::containerNew("MSG_PROCESS", container->type_);
-      simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_PROCESS_STATE", msg_process);
-      new simgrid::instr::Value("suspend", "1 0 1", state);
-      simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
-      simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
-      simgrid::instr::Value::get_or_new("send", "0 0 1", state);
-      simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
-      simgrid::instr::Type::linkNew("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
-      simgrid::instr::Type::linkNew("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
-    }
+    simgrid::instr::Type* msg_process = container->type_->getOrCreateContainerType("MSG_PROCESS");
+    simgrid::instr::Type* state       = msg_process->getOrCreateStateType("MSG_PROCESS_STATE");
+    simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
+    simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
+    simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
+    simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
+    simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
+    simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_PROCESS_LINK", msg_process, msg_process);
+    simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_PROCESS_TASK_LINK", msg_process, msg_process);
   }
 
   if (TRACE_msg_vm_is_enabled()) {
-    simgrid::instr::Type* msg_vm = container->type_->getChildOrNull("MSG_VM");
-    if (msg_vm == nullptr){
-      msg_vm                      = simgrid::instr::Type::containerNew("MSG_VM", container->type_);
-      simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_VM_STATE", msg_vm);
-      new simgrid::instr::Value("suspend", "1 0 1", state);
-      simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
-      simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
-      simgrid::instr::Value::get_or_new("send", "0 0 1", state);
-      simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
-      simgrid::instr::Type::linkNew("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
-      simgrid::instr::Type::linkNew("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
-    }
+    simgrid::instr::Type* msg_vm = container->type_->getOrCreateContainerType("MSG_VM");
+    simgrid::instr::Type* state  = msg_vm->getOrCreateStateType("MSG_VM_STATE");
+    simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
+    simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
+    simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
+    simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
+    simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
+    simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_VM_LINK", msg_vm, msg_vm);
+    simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_VM_PROCESS_LINK", msg_vm, msg_vm);
   }
-
 }
 
 static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
@@ -293,26 +258,25 @@ static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
     return;
   if (TRACE_is_enabled() && TRACE_needs_platform()) {
     container_t father = currentContainer.back();
-    new simgrid::instr::Container(netpoint->cname(), simgrid::instr::INSTR_ROUTER, father);
+    new simgrid::instr::Container(netpoint->getCname(), simgrid::instr::INSTR_ROUTER, father);
   }
 }
 
 static void instr_routing_parse_end_platform ()
 {
   currentContainer.clear();
-  xbt_dict_t filter = xbt_dict_new_homogeneous(xbt_free_f);
+  std::set<std::string>* filter = new std::set<std::string>;
   XBT_DEBUG ("Starting graph extraction.");
   recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(), PJ_container_get_root(), filter);
   XBT_DEBUG ("Graph extraction finished.");
-  xbt_dict_free(&filter);
+  delete filter;
   platform_created = 1;
-  TRACE_paje_dump_buffer(1);
+  TRACE_paje_dump_buffer(true);
 }
 
 void instr_routing_define_callbacks ()
 {
-  //always need the call backs to ASes (we need only the root AS),
-  //to create the rootContainer and the rootType properly
+  // always need the callbacks to ASes (we need only the root AS), to create the rootContainer and the rootType properly
   if (not TRACE_is_enabled())
     return;
   if (TRACE_needs_platform()) {
@@ -329,88 +293,64 @@ void instr_routing_define_callbacks ()
  */
 static void recursiveNewVariableType(const char* new_typename, const char* color, simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name_, "HOST")) {
-    char tnstr[INSTR_DEFAULT_STR_SIZE];
-    snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
-    simgrid::instr::Type::variableNew(tnstr, color, root);
-  }
-  if (not strcmp(root->name_, "MSG_VM")) {
-    char tnstr[INSTR_DEFAULT_STR_SIZE];
-    snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
-    simgrid::instr::Type::variableNew(tnstr, color, root);
-  }
-  if (not strcmp(root->name_, "LINK")) {
-    char tnstr[INSTR_DEFAULT_STR_SIZE];
-    snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
-    simgrid::instr::Type::variableNew(tnstr, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  simgrid::instr::Type* child_type;
-  char *name;
-  xbt_dict_foreach (root->children_, cursor, name, child_type) {
-    recursiveNewVariableType (new_typename, color, child_type);
+  if (root->getName() == "HOST" || root->getName() == "MSG_VM")
+    root->getOrCreateVariableType(std::string("p") + new_typename, color == nullptr ? "" : color);
+
+  if (root->getName() == "LINK")
+    root->getOrCreateVariableType(std::string("b") + new_typename, color == nullptr ? "" : color);
+
+  for (auto elm : root->children_) {
+    recursiveNewVariableType(new_typename, color == nullptr ? "" : color, elm.second);
   }
 }
 
 void instr_new_variable_type (const char *new_typename, const char *color)
 {
-  recursiveNewVariableType (new_typename, color, PJ_type_get_root());
+  recursiveNewVariableType(new_typename, color, simgrid::instr::Type::getRootType());
 }
 
 static void recursiveNewUserVariableType(const char* father_type, const char* new_typename, const char* color,
                                          simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name_, father_type)) {
-    simgrid::instr::Type::variableNew(new_typename, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  simgrid::instr::Type* child_type;
-  char *name;
-  xbt_dict_foreach (root->children_, cursor, name, child_type) {
-    recursiveNewUserVariableType (father_type, new_typename, color, child_type);
+  if (root->getName() == father_type) {
+    root->getOrCreateVariableType(new_typename, color == nullptr ? "" : color);
   }
+  for (auto elm : root->children_)
+    recursiveNewUserVariableType(father_type, new_typename, color, elm.second);
 }
 
 void instr_new_user_variable_type  (const char *father_type, const char *new_typename, const char *color)
 {
-  recursiveNewUserVariableType (father_type, new_typename, color, PJ_type_get_root());
+  recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Type::getRootType());
 }
 
 static void recursiveNewUserStateType(const char* father_type, const char* new_typename, simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name_, father_type)) {
-    simgrid::instr::Type::stateNew(new_typename, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  simgrid::instr::Type* child_type;
-  char *name;
-  xbt_dict_foreach (root->children_, cursor, name, child_type) {
-    recursiveNewUserStateType (father_type, new_typename, child_type);
+  if (root->getName() == father_type) {
+    root->getOrCreateStateType(new_typename);
   }
+  for (auto elm : root->children_)
+    recursiveNewUserStateType(father_type, new_typename, elm.second);
 }
 
 void instr_new_user_state_type (const char *father_type, const char *new_typename)
 {
-  recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
+  recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Type::getRootType());
 }
 
 static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color,
                                               simgrid::instr::Type* root)
 {
-  if (not strcmp(root->name_, type_name)) {
-    new simgrid::instr::Value(val, color, root);
-  }
-  xbt_dict_cursor_t cursor = nullptr;
-  simgrid::instr::Type* child_type;
-  char *name;
-  xbt_dict_foreach (root->children_, cursor, name, child_type) {
-    recursiveNewValueForUserStateType(type_name, val, color, child_type);
-  }
+  if (root->getName() == type_name)
+    simgrid::instr::Value::byNameOrCreate(val, color, root);
+
+  for (auto elm : root->children_)
+    recursiveNewValueForUserStateType(type_name, val, color, elm.second);
 }
 
 void instr_new_value_for_user_state_type (const char *type_name, const char *value, const char *color)
 {
-  recursiveNewValueForUserStateType (type_name, value, color, PJ_type_get_root());
+  recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Type::getRootType());
 }
 
 int instr_platform_traced ()
@@ -426,8 +366,7 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, xbt_dict_t nodes, xbt
   if (not netzone->getChildren()->empty()) {
     //bottom-up recursion
     for (auto const& netzone_child : *netzone->getChildren()) {
-      container_t child_container =
-          static_cast<container_t>(xbt_dict_get(container->children_, netzone_child->getCname()));
+      container_t child_container = container->children_.at(netzone_child->getCname());
       recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container);
     }
   }
index 83f7e1e..8c6e0b1 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program 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 "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
@@ -12,8 +12,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
 void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
 {
   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
-    container_t container = PJ_container_get(resource);
-    simgrid::instr::Type* type = container->type_->getChild("power");
+    container_t container      = simgrid::instr::Container::byName(resource);
+    simgrid::instr::Type* type = container->type_->byName("power");
     new simgrid::instr::SetVariableEvent(date, container, type, speed);
   }
 }
@@ -21,8 +21,8 @@ void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
 {
   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
-    container_t container = PJ_container_get(resource);
-    simgrid::instr::Type* type = container->type_->getChild("bandwidth");
+    container_t container      = simgrid::instr::Container::byName(resource);
+    simgrid::instr::Type* type = container->type_->byName("bandwidth");
     new simgrid::instr::SetVariableEvent(date, container, type, bandwidth);
   }
 }
index 0f671f5..91073c0 100644 (file)
@@ -37,7 +37,9 @@ static double partial_diff_lambda(double lambda, void *param_cnst);
 
 static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list, int warn)
 {
-  void *_cnst, *_elem, *_var;
+  void* _cnst;
+  void* _elem;
+  void* _var;
   xbt_swag_t elem_list = nullptr;
   lmm_element_t elem = nullptr;
   lmm_constraint_t cnst = nullptr;
index 095d6e0..72d2005 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
 
-typedef struct s_dyn_light {
+struct s_dyn_light_t {
   int *data;
   int pos;
   int size;
-} s_dyn_light_t;
+};
 typedef s_dyn_light_t* dyn_light_t;
 
 double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */
@@ -298,7 +298,7 @@ int lmm_constraint_sharing_policy(lmm_constraint_t cnst)
 }
 
 /* @brief Remove a constraint
- * Currently this is dead code, but it is exposed in maxmin.h
+ * Currently this is dead code, but it is exposed in maxmin.hpp
  * Apparently, this call was designed assuming that constraint would no more have elements in it.
  * If not the case, assertion will fail, and you need to add calls e.g. to lmm_shrink before effectively removing it.
  */
@@ -333,7 +333,7 @@ lmm_variable_t lmm_variable_new(lmm_system_t sys, simgrid::surf::Action* id, dou
   lmm_variable_t var = (lmm_variable_t)xbt_mallocator_get(sys->variable_mallocator);
   var->id = id;
   var->id_int = Global_debug_id++;
-  var->cnsts = (s_lmm_element_t *) xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t));
+  var->cnsts = static_cast<s_lmm_element_t*>(xbt_realloc(var->cnsts, number_of_constraints * sizeof(s_lmm_element_t)));
   for (int i = 0; i < number_of_constraints; i++) {
     var->cnsts[i].enabled_element_set_hookup.next = nullptr;
     var->cnsts[i].enabled_element_set_hookup.prev = nullptr;
@@ -774,8 +774,8 @@ void lmm_solve(lmm_system_t sys)
     }
   }
 
-  s_lmm_constraint_light_t *cnst_light_tab =
-     (s_lmm_constraint_light_t *)xbt_malloc0(xbt_swag_size(cnst_list)*sizeof(s_lmm_constraint_light_t));
+  s_lmm_constraint_light_tcnst_light_tab =
+      static_cast<s_lmm_constraint_light_t*>(xbt_malloc0(xbt_swag_size(cnst_list) * sizeof(s_lmm_constraint_light_t)));
   int cnst_light_num = 0;
   dyn_light_t saturated_constraint_set = xbt_new0(s_dyn_light_t,1);
   saturated_constraint_set->size = 5;
index 44fac8c..976caa0 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef SURF_MAXMIN_PRIVATE_H
 #define SURF_MAXMIN_PRIVATE_H
 
-#include "surf/maxmin.h"
-#include "xbt/swag.h"
-#include "xbt/mallocator.h"
+#include "surf/maxmin.hpp"
 #include "surf_interface.hpp"
+#include "xbt/mallocator.h"
+#include "xbt/swag.h"
 
 /** @ingroup SURF_lmm
  * @brief LMM element
@@ -17,7 +17,7 @@
  * Basically, each variable will have a set of elements, one for each constraint where it is involved.
  * Then, it is used to list all variables involved in constraint through constraint's xxx_element_set lists, or vice-versa list all constraints for a given variable.
  */
-typedef struct lmm_element {
+struct s_lmm_element_t {
   /* hookup to constraint */
   s_xbt_swag_hookup_t enabled_element_set_hookup;
   s_xbt_swag_hookup_t disabled_element_set_hookup;
@@ -30,14 +30,14 @@ typedef struct lmm_element {
   //   - if CPU, then probably 1.
   //   - If network, then 1 in forward direction and 0.05 backward for the ACKs
   double consumption_weight;
-} s_lmm_element_t;
+};
 #define make_elem_active(elem) xbt_swag_insert_at_head(elem,&(elem->constraint->active_element_set))
 #define make_elem_inactive(elem) xbt_swag_remove(elem,&(elem->constraint->active_element_set))
 
-typedef struct lmm_constraint_light {
+struct s_lmm_constraint_light_t {
   double remaining_over_usage;
   lmm_constraint_t cnst;
-} s_lmm_constraint_light_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM constraint
@@ -47,7 +47,7 @@ typedef struct lmm_constraint_light {
  * \li Active elements which variable's weight is non-zero (i.e. it is enabled) AND its element value is non-zero. LMM_solve iterates over active elements during resolution, dynamically making them active or unactive.
  *
  */
-typedef struct lmm_constraint {
+struct s_lmm_constraint_t {
   /* hookup to system */
   s_xbt_swag_hookup_t constraint_set_hookup;
   s_xbt_swag_hookup_t active_constraint_set_hookup;
@@ -71,14 +71,14 @@ typedef struct lmm_constraint {
   double lambda;
   double new_lambda;
   lmm_constraint_light_t cnst_light;
-} s_lmm_constraint_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM variable
  *
  * When something prevents us from enabling a variable, we "stage" the weight that we would have like to set, so that as soon as possible we enable the variable with desired weight
  */
-typedef struct lmm_variable {
+struct s_lmm_variable_t {
   /* hookup to system */
   s_xbt_swag_hookup_t variable_set_hookup;
   s_xbt_swag_hookup_t saturated_variable_set_hookup;
@@ -103,16 +103,16 @@ typedef struct lmm_variable {
   /* \begin{For Lagrange only} */
   double mu;
   double new_mu;
-  double (*func_f) (struct lmm_variable * var, double x);       /* (f)    */
-  double (*func_fp) (struct lmm_variable * var, double x);      /* (f')    */
-  double (*func_fpi) (struct lmm_variable * var, double x);     /* (f')^{-1}    */
+  double (*func_f)(s_lmm_variable_t* var, double x);   /* (f)    */
+  double (*func_fp)(s_lmm_variable_t* var, double x);  /* (f')    */
+  double (*func_fpi)(s_lmm_variable_t* var, double x); /* (f')^{-1}    */
   /* \end{For Lagrange only} */
-} s_lmm_variable_t;
+};
 
 /** @ingroup SURF_lmm
  * @brief LMM system
  */
-typedef struct lmm_system {
+struct s_lmm_system_t {
   int modified;
   bool selective_update_active;  /* flag to update partially the system only selecting changed portions */
   unsigned visited_counter;     /* used by lmm_update_modified_set  and lmm_remove_modified_set to cleverly (un-)flag the constraints (more details in these functions)*/
@@ -130,7 +130,7 @@ typedef struct lmm_system {
   xbt_mallocator_t variable_mallocator;
 
   void (*solve_fun)(lmm_system_t self);
-} s_lmm_system_t;
+};
 
 #define extract_variable(sys) xbt_swag_extract(&(sys->variable_set))
 #define extract_constraint(sys) xbt_swag_extract(&(sys->constraint_set))
index d3e8809..9bd196a 100644 (file)
@@ -9,7 +9,7 @@
 #include "network_cm02.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.h"
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
@@ -186,7 +186,7 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
         NetworkCm02Link *link = static_cast<NetworkCm02Link*>(lmm_constraint_id(constraint));
         double value = lmm_variable_getvalue(action->getVariable())*
             lmm_get_cnst_weight_from_var(maxminSystem_, action->getVariable(), i);
-        TRACE_surf_link_set_utilization(link->cname(), action->getCategory(), value, action->getLastUpdate(),
+        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), value, action->getLastUpdate(),
                                         now - action->getLastUpdate());
       }
     }
@@ -239,7 +239,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta)
           lmm_constraint_t constraint = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i);
 
           NetworkCm02Link* link = static_cast<NetworkCm02Link*>(lmm_constraint_id(constraint));
-          TRACE_surf_link_set_utilization(link->cname(), action->getCategory(),
+          TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(),
                                           (lmm_variable_getvalue(action->getVariable()) *
                                            lmm_get_cnst_weight_from_var(maxminSystem_, action->getVariable(), i)),
                                           action->getLastUpdate(), now - action->getLastUpdate());
@@ -417,7 +417,7 @@ void NetworkCm02Link::setBandwidth(double value)
 
   lmm_update_constraint_bound(model()->getMaxminSystem(), constraint(),
                               sg_bandwidth_factor * (bandwidth_.peak * bandwidth_.scale));
-  TRACE_surf_link_set_bandwidth(surf_get_clock(), cname(), sg_bandwidth_factor * bandwidth_.peak * bandwidth_.scale);
+  TRACE_surf_link_set_bandwidth(surf_get_clock(), getCname(), sg_bandwidth_factor * bandwidth_.peak * bandwidth_.scale);
 
   if (sg_weight_S_parameter > 0) {
     double delta = sg_weight_S_parameter / value - sg_weight_S_parameter / (bandwidth_.peak * bandwidth_.scale);
index dcbc87f..1f97acc 100644 (file)
@@ -66,8 +66,8 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
     if (action->getMaxDuration() != NO_MAX_DURATION)
       action->updateMaxDuration(delta);
 
-    if (((action->getRemainsNoUpdate() <= 0) ||
-         ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0)))) {
+    if ((action->getRemainsNoUpdate() <= 0) ||
+        ((action->getMaxDuration() != NO_MAX_DURATION) && (action->getMaxDuration() <= 0))) {
       action->finish(Action::State::done);
     }
   }
index 6e2569a..0b5a2bb 100644 (file)
@@ -166,17 +166,17 @@ namespace simgrid {
     }
     void LinkImpl::setStateTrace(tmgr_trace_t trace)
     {
-      xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Link %s", cname());
+      xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Link %s", getCname());
       stateEvent_ = future_evt_set->add_trace(trace, this);
     }
     void LinkImpl::setBandwidthTrace(tmgr_trace_t trace)
     {
-      xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", cname());
+      xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", getCname());
       bandwidth_.event = future_evt_set->add_trace(trace, this);
     }
     void LinkImpl::setLatencyTrace(tmgr_trace_t trace)
     {
-      xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", cname());
+      xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", getCname());
       latency_.event = future_evt_set->add_trace(trace, this);
     }
 
index a9139b1..c2a7839 100644 (file)
 #include "ns3/core-module.h"
 #include "ns3/node.h"
 
-#include "ns3/ns3_simulator.h"
 #include "network_ns3.hpp"
+#include "ns3/ns3_simulator.hpp"
 
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 #include "src/kernel/routing/NetPoint.hpp"
 
 #include "simgrid/s4u/Engine.hpp"
@@ -84,19 +84,18 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
   if (link_list->size() == 1) {
     simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
 
-    XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->cname(), dst->cname(), link->cname(),
+    XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->getCname(), dst->getCname(), link->getCname(),
               (symmetrical ? "(symmetrical)" : "(not symmetrical)"));
 
     //   XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
-    XBT_DEBUG("\tLink (%s) bw:%fbps lat:%fs", link->cname(), link->bandwidth(),
-        link->latency());
+    XBT_DEBUG("\tLink (%s) bw:%fbps lat:%fs", link->getCname(), link->bandwidth(), link->latency());
 
     // create link ns3
     NetPointNs3* host_src = src->extension<NetPointNs3>();
     NetPointNs3* host_dst = dst->extension<NetPointNs3>();
 
-    xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->cname());
-    xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->cname());
+    xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->getCname());
+    xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->getCname());
 
     ns3_add_link(host_src, host_dst, link->bandwidth(), link->latency());
   } else {
@@ -108,7 +107,7 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
                "of length 1.\n"
                "WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently "
                "ignored.",
-               src->cname(), dst->cname(), link_list->size());
+               src->getCname(), dst->getCname(), link_list->size());
     warned_about_long_routes = true;
   }
 }
@@ -148,7 +147,7 @@ NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
 
   simgrid::kernel::routing::NetPoint::onCreation.connect([](simgrid::kernel::routing::NetPoint* pt) {
     pt->extension_set<NetPointNs3>(new NetPointNs3());
-    XBT_VERB("SimGrid's %s is known as node %d within NS3", pt->cname(), pt->extension<NetPointNs3>()->node_num);
+    XBT_VERB("SimGrid's %s is known as node %d within NS3", pt->getCname(), pt->extension<NetPointNs3>()->node_num);
   });
   simgrid::surf::on_cluster.connect(&clusterCreation_cb);
   simgrid::s4u::onPlatformCreated.connect(&postparse_cb);
@@ -228,7 +227,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
       action->src_->routeTo(action->dst_, &route, nullptr);
       for (auto const& link : route)
-        TRACE_surf_link_set_utilization(link->cname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
+        TRACE_surf_link_set_utilization(link->getCname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
                                         delta);
 
       action->lastSent_ = sgFlow->sentBytes_;
@@ -347,10 +346,10 @@ void ns3_create_flow(simgrid::s4u::Host* src, simgrid::s4u::Host* dst,
   ns3::Ptr<ns3::Node> dst_node = nodes.Get(node2);
 
   xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
-             dst->pimpl_netpoint->cname());
+             dst->pimpl_netpoint->getCname());
   char* addr = IPV4addr.at(node2);
   xbt_assert(addr != nullptr, "Element %s is unknown to NS3. Is it connected to any one-hop link?",
-             dst->pimpl_netpoint->cname());
+             dst->pimpl_netpoint->getCname());
 
   XBT_DEBUG("ns3_create_flow %u Bytes from %u to %u with Interface %s", TotalBytes, node1, node2, addr);
   ns3::PacketSinkHelper sink("ns3::TcpSocketFactory", ns3::InetSocketAddress (ns3::Ipv4Address::GetAny(), port_number));
index b30a7eb..fdb5683 100644 (file)
@@ -9,7 +9,7 @@
 #include "xbt/base.h"
 
 #include "network_interface.hpp"
-#include "src/surf/ns3/ns3_interface.h"
+#include "src/surf/ns3/ns3_interface.hpp"
 
 namespace simgrid {
 namespace surf {
similarity index 86%
rename from src/surf/ns3/ns3_interface.h
rename to src/surf/ns3/ns3_interface.hpp
index 9479f65..8b1bc35 100644 (file)
@@ -3,8 +3,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef NS3_INTERFACE_H
-#define NS3_INTERFACE_H
+#ifndef NS3_INTERFACE_HPP
+#define NS3_INTERFACE_HPP
 
 #include "simgrid/s4u/Host.hpp"
 
@@ -22,17 +22,15 @@ public:
   int node_num;
 };
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PUBLIC(void) ns3_initialize(const char* TcpProtocol);
 XBT_PUBLIC(void)
-ns3_create_flow(sg_host_t src, sg_host_t dst, u_int32_t TotalBytes,
-                simgrid::surf::NetworkNS3Action* action);
+ns3_create_flow(sg_host_t src, sg_host_t dst, u_int32_t TotalBytes, simgrid::surf::NetworkNS3Action* action);
 XBT_PUBLIC(void) ns3_simulator(double maxSeconds);
 XBT_PUBLIC(void*) ns3_add_router(const char* id);
 XBT_PUBLIC(void) ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat);
 XBT_PUBLIC(void) ns3_add_cluster(const char* id, double bw, double lat);
-
-SG_END_DECL()
+}
 
 #endif
similarity index 95%
rename from src/surf/ns3/ns3_simulator.cc
rename to src/surf/ns3/ns3_simulator.cpp
index 55df59e..3296808 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/surf/ns3/ns3_simulator.h"
+#include "src/surf/ns3/ns3_simulator.hpp"
 #include "xbt/dict.h"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
@@ -55,7 +55,7 @@ static void WriteUntilBufferFull(ns3::Ptr<ns3::Socket> sock, uint32_t txSpace)
     uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable()});
     if (toWrite == 0) // buffer full
       return;
-    int amountSent   = sock->Send(0, toWrite, 0);
+    int amountSent = sock->Send(0, toWrite, 0);
 
     xbt_assert(amountSent > 0, "Since TxAvailable>0, amountSent should also >0");
     flow->bufferedBytes_ += amountSent;
@@ -113,19 +113,18 @@ void StartFlow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number)
   sock->Connect(serverAddr);
   // tell the tcp implementation to call WriteUntilBufferFull again
   // if we blocked and new tx buffer space becomes available
-  sock->SetSendCallback (MakeCallback(&WriteUntilBufferFull));
+  sock->SetSendCallback(MakeCallback(&WriteUntilBufferFull));
   // Note when the send is over
   sock->SetRecvCallback(MakeCallback(&receive_callback));
   // Keep track of what was used (for the TRACING module)
   sock->SetDataSentCallback(MakeCallback(&datasent_callback));
   XBT_DEBUG("startFlow of F[%p, %p, %u] dest=%s port=%d", flow, flow->action_, flow->totalBytes_, to, port_number);
 
-  //WriteUntilBufferFull (sock, sock->GetTxAvailable ());
+  // WriteUntilBufferFull (sock, sock->GetTxAvailable ());
   /*
   sock->SetSendCallback(MakeCallback(&send_callback));
   sock->SetConnectCallback(MakeCallback(&succeededConnect_callback), MakeCallback(&failedConnect_callback));
   sock->SetCloseCallbacks(MakeCallback(&normalClose_callback), MakeCallback(&errorClose_callback));
   send_callback(sock, sock->GetTxAvailable ());
    */
-
 }
similarity index 93%
rename from src/surf/ns3/ns3_simulator.h
rename to src/surf/ns3/ns3_simulator.hpp
index c69c1a8..c007c25 100644 (file)
@@ -3,12 +3,12 @@
 /* This program 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 NS3_SIM_H
-#define NS3_SIM_H
+#ifndef NS3_SIMULATOR_HPP
+#define NS3_SIMULATOR_HPP
 
 #include <cstdint>
 
-#include "ns3_interface.h"
+#include "ns3_interface.hpp"
 
 #include <ns3/csma-helper.h>
 #include <ns3/global-route-manager.h>
index 6e102e4..380a871 100644 (file)
@@ -200,7 +200,7 @@ void HostEnergy::update()
 
     double energy_this_step = instantaneous_consumption * (finish_time - start_time);
 
-    // TODO Trace: Trace energy_this_step from start_time to finish_time in host->name()
+    // TODO Trace: Trace energy_this_step from start_time to finish_time in host->getName()
 
     this->total_energy = previous_energy + energy_this_step;
     this->last_updated = finish_time;
@@ -363,7 +363,7 @@ static void onCreation(simgrid::s4u::Host& host)
   if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
     return;
 
-  //TODO Trace: set to zero the energy variable associated to host->name()
+  // TODO Trace: set to zero the energy variable associated to host->getName()
 
   host.extension_set(new HostEnergy(&host));
 }
@@ -432,7 +432,7 @@ static void onSimulationEnd()
 }
 
 /* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup plugin_energy
  * \brief Enable host energy plugin
@@ -513,5 +513,4 @@ double sg_host_get_current_consumption(sg_host_t host)
   double cpu_load = lmm_constraint_get_usage(host->pimpl_cpu->constraint()) / host->getSpeed();
   return host->extension<HostEnergy>()->getCurrentWattsValue(cpu_load);
 }
-
-SG_END_DECL()
+}
index 99e7a39..f1e039a 100644 (file)
@@ -139,7 +139,7 @@ static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf:
 }
 
 /* **************************** Public interface *************************** */
-SG_BEGIN_DECL()
+extern "C" {
 
 /** \ingroup plugin_load
  * \brief Initializes the HostLoad plugin
@@ -185,5 +185,4 @@ void sg_host_load_reset(sg_host_t host)
 
   host->extension<HostLoad>()->reset();
 }
-
-SG_END_DECL()
+}
index b3d5bea..f11d8df 100644 (file)
@@ -186,7 +186,7 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
           latency = MAX(latency, lat);
 
           for (auto const& link : route)
-            affected_links.insert(link->cname());
+            affected_links.insert(link->getCname());
         }
       }
     }
@@ -226,14 +226,14 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
     this->setCost(1.0);
     this->setRemains(0.0);
   }
-  xbt_free(host_list);
+  delete[] host_list;
 }
 
 Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
 {
-  sg_host_t*host_list = xbt_new0(sg_host_t, 2);
-  double *flops_amount = xbt_new0(double, 2);
-  double *bytes_amount = xbt_new0(double, 4);
+  sg_host_t* host_list = new sg_host_t[2]();
+  double* flops_amount = new double[2]();
+  double* bytes_amount = new double[4]();
 
   host_list[0]    = src;
   host_list[1]    = dst;
@@ -280,8 +280,8 @@ LinkL07::LinkL07(NetworkL07Model* model, const std::string& name, double bandwid
 
 Action *CpuL07::execution_start(double size)
 {
-  sg_host_t*host_list = xbt_new0(sg_host_t, 1);
-  double *flops_amount = xbt_new0(double, 1);
+  sg_host_t* host_list = new sg_host_t[1]();
+  double* flops_amount = new double[1]();
 
   host_list[0] = getHost();
   flops_amount[0] = size;
@@ -325,7 +325,7 @@ bool LinkL07::isUsed(){
 
 void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
 {
-  XBT_DEBUG("Updating cpu %s (%p) with value %g", cname(), this, value);
+  XBT_DEBUG("Updating cpu %s (%p) with value %g", getCname(), this, value);
   if (triggered == speed_.event) {
     speed_.scale = value;
     onSpeedChange();
@@ -345,7 +345,7 @@ void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
 
 void LinkL07::apply_event(tmgr_trace_event_t triggered, double value)
 {
-  XBT_DEBUG("Updating link %s (%p) with value=%f", cname(), this, value);
+  XBT_DEBUG("Updating link %s (%p) with value=%f", getCname(), this, value);
   if (triggered == bandwidth_.event) {
     setBandwidth(value);
     tmgr_trace_event_unref(&bandwidth_.event);
@@ -392,8 +392,8 @@ LinkL07::~LinkL07() = default;
 
 L07Action::~L07Action(){
   delete hostList_;
-  free(communicationAmount_);
-  free(computationAmount_);
+  delete[] communicationAmount_;
+  delete[] computationAmount_;
 }
 
 void L07Action::updateBound()
index 354ba1c..d6f9e7d 100644 (file)
@@ -7,7 +7,7 @@
 #include "simgrid/s4u/Storage.hpp"
 
 #include "src/kernel/EngineImpl.hpp"
-#include "src/simix/smx_private.h"
+#include "src/simix/smx_private.hpp"
 
 #include "src/include/simgrid/sg_config.h"
 
@@ -600,10 +600,10 @@ simgrid::s4u::NetZone* sg_platf_new_Zone_begin(ZoneCreationArgs* zone)
       new_zone = new simgrid::kernel::routing::FatTreeZone(current_routing, zone->id);
       break;
     case A_surfxml_AS_routing_Dijkstra:
-      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, 0);
+      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, false);
       break;
     case A_surfxml_AS_routing_DijkstraCache:
-      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, 1);
+      new_zone = new simgrid::kernel::routing::DijkstraZone(current_routing, zone->id, true);
       break;
     case A_surfxml_AS_routing_Floyd:
       new_zone = new simgrid::kernel::routing::FloydZone(current_routing, zone->id);
@@ -676,7 +676,7 @@ void sg_platf_new_hostlink(HostLinkCreationArgs* hostlink)
   if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end())
     surf_parse_error(std::string("Host_link for '") + hostlink->id.c_str() + "' is already defined!");
 
-  XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->cname(), netpoint->id());
+  XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->getCname(), netpoint->id());
   as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
index d8bfca3..e25812c 100644 (file)
@@ -20,8 +20,8 @@ static void check_disk_attachment()
   for (auto const& s : *simgrid::surf::StorageImpl::storagesMap()) {
     simgrid::kernel::routing::NetPoint* host_elm = sg_netpoint_by_name_or_null(s.second->getHost().c_str());
     if (not host_elm)
-      surf_parse_error(std::string("Unable to attach storage ") + s.second->cname() + ": host " + s.second->getHost() +
-                       " does not exist.");
+      surf_parse_error(std::string("Unable to attach storage ") + s.second->getCname() + ": host " +
+                       s.second->getHost() + " does not exist.");
     else
       s.second->piface_.attached_to_ = sg_host_by_name(s.second->getHost().c_str());
   }
@@ -89,8 +89,8 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
       action->file_->incrPosition(current_progress);
       action->file_->setSize(action->file_->tell());
 
-      action->storage_->getContent()->erase(action->file_->cname());
-      action->storage_->getContent()->insert({action->file_->cname(), action->file_->size()});
+      action->storage_->getContent()->erase(action->file_->getCname());
+      action->storage_->getContent()->insert({action->file_->getCname(), action->file_->size()});
     }
 
     if (action->getMaxDuration() > NO_MAX_DURATION)
@@ -136,7 +136,7 @@ StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, Stora
                                    e_surf_action_storage_type_t type)
     : StorageAction(model, cost, failed, lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0, 3), storage, type)
 {
-  XBT_IN("(%s,%g", storage->cname(), cost);
+  XBT_IN("(%s,%g", storage->getCname(), cost);
 
   // Must be less than the max bandwidth for all actions
   lmm_expand(model->getMaxminSystem(), storage->constraint(), getVariable(), 1.0);
index 61e00b9..e57f843 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u/Engine.hpp"
-#include "src/instr/instr_private.h"
+#include "src/instr/instr_private.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_kernel);
@@ -100,7 +100,7 @@ double surf_solve(double max_date)
     XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
 
     while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) {
-      if (resource->isUsed() || (watched_hosts.find(resource->cname()) != watched_hosts.end())) {
+      if (resource->isUsed() || (watched_hosts.find(resource->getCname()) != watched_hosts.end())) {
         time_delta = next_event_date - NOW;
         XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta);
       }
@@ -109,7 +109,7 @@ double surf_solve(double max_date)
       NOW = next_event_date;
       /* update state of the corresponding resource to the new value. Does not touch lmm.
          It will be modified if needed when updating actions */
-      XBT_DEBUG("Calling update_resource_state for resource %s", resource->cname());
+      XBT_DEBUG("Calling update_resource_state for resource %s", resource->getCname());
       resource->apply_event(event, value);
       NOW = round_start;
     }
@@ -134,7 +134,7 @@ double surf_solve(double max_date)
   }
   simgrid::s4u::onTimeAdvance(time_delta);
 
-  TRACE_paje_dump_buffer (0);
+  TRACE_paje_dump_buffer(false);
 
   return time_delta;
 }
index b0007c1..c8fae21 100644 (file)
@@ -7,7 +7,7 @@
 #include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.h"
-#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/HostImpl.hpp"
 
@@ -577,7 +577,12 @@ Model* Resource::model() const
   return model_;
 }
 
-const char* Resource::cname() const
+const std::string& Resource::getName() const
+{
+  return name_;
+}
+
+const char* Resource::getCname() const
 {
   return name_.c_str();
 }
@@ -848,48 +853,5 @@ double Action::getRemainsNoUpdate()
   return remains_;
 }
 
-//FIXME split code in the right places
-void Action::updateRemainingLazy(double now)
-{
-  double delta = 0.0;
-
-  if (getModel() == surf_network_model) {
-    if (suspended_ != 0)
-      return;
-  } else {
-    xbt_assert(stateSet_ == getModel()->getRunningActionSet(), "You're updating an action that is not running.");
-    xbt_assert(sharingWeight_ > 0, "You're updating an action that seems suspended.");
-  }
-
-  delta = now - lastUpdate_;
-
-  if (remains_ > 0) {
-    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, remains_, lastUpdate_);
-    double_update(&remains_, lastValue_ * delta, sg_surf_precision*sg_maxmin_precision);
-
-    if (getModel() == surf_cpu_model_pm && TRACE_is_enabled()) {
-      simgrid::surf::Resource *cpu = static_cast<simgrid::surf::Resource*>(
-        lmm_constraint_id(lmm_get_cnst_from_var(getModel()->getMaxminSystem(), getVariable(), 0)));
-      TRACE_surf_host_set_utilization(cpu->cname(), getCategory(), lastValue_, lastUpdate_, now - lastUpdate_);
-    }
-    XBT_DEBUG("Updating action(%p): remains is now %f", this, remains_);
-  }
-
-  if (getModel() == surf_network_model) {
-    if (maxDuration_ != NO_MAX_DURATION)
-      double_update(&maxDuration_, delta, sg_surf_precision);
-
-    //FIXME: duplicated code
-    if (((remains_ <= 0) && (lmm_get_variable_weight(getVariable()) > 0)) ||
-        ((maxDuration_ > NO_MAX_DURATION) && (maxDuration_ <= 0))) {
-      finish(Action::State::done);
-      heapRemove(getModel()->getActionHeap());
-    }
-  }
-
-  lastUpdate_ = now;
-  lastValue_ = lmm_variable_getvalue(getVariable());
-}
-
 }
 }
index 0d3c6fd..6b9712d 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "xbt/signal.hpp"
 
-#include "src/surf/surf_private.h"
+#include "src/surf/surf_private.hpp"
 #include "surf/surf.h"
 #include "xbt/str.h"
 
@@ -227,7 +227,7 @@ private:
 
   /* LMM */
 public:
-  virtual void updateRemainingLazy(double now);
+  virtual void updateRemainingLazy(double now) { THROW_IMPOSSIBLE; };
   void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
   void heapRemove(xbt_heap_t heap);
   void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat);
@@ -345,11 +345,11 @@ private:
 /** @ingroup SURF_interface
  * @brief Resource which have a metric handled by a maxmin system
  */
-typedef struct {
+struct s_surf_metric_t {
   double peak;              /**< The peak of the metric, ie its max value */
   double scale;             /**< Current availability of the metric according to the traces, in [0,1] */
   tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
-} s_surf_metric_t;
+};
 
 namespace simgrid {
 namespace surf {
@@ -375,7 +375,9 @@ public:
   Model* model() const;
 
   /** @brief Get the name of the current Resource */
-  const char* cname() const;
+  const std::string& getName() const;
+  /** @brief Get the name of the current Resource */
+  const char* getCname() const;
 
   bool operator==(const Resource &other) const;
 
@@ -418,8 +420,8 @@ protected:
 namespace std {
 template <> class hash<simgrid::surf::Resource> {
 public:
-  std::size_t operator()(const simgrid::surf::Resource& r) const { return (std::size_t)xbt_str_hash(r.cname()); }
-  };
+  std::size_t operator()(const simgrid::surf::Resource& r) const { return (std::size_t)xbt_str_hash(r.getCname()); }
+};
 }
 
 #endif /* SURF_MODEL_H_ */
diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h
deleted file mode 100644 (file)
index fc90b62..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_SURF_PRIVATE_H
-#define SURF_SURF_PRIVATE_H
-
-#include "surf/surf.h"
-#include "surf/maxmin.h"
-#include "src/surf/trace_mgr.hpp"
-
-#define NO_MAX_DURATION -1.0
-
-SG_BEGIN_DECL()
-
-extern XBT_PRIVATE const char *surf_action_state_names[6];
-
-/** @ingroup SURF_interface
- * @brief Possible update mechanisms
- */
-typedef enum {
-  UM_FULL,      /**< Full update mechanism: the remaining time of every action is recomputed at each step */
-  UM_LAZY,      /**< Lazy update mechanism: only the modified actions get recomputed.
-                     It may be slower than full if your system is tightly coupled to the point where every action
-                     gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for
-                     a simple full update.  */
-  UM_UNDEFINED  /**< Mechanism not defined */
-} e_UM_t;
-
-/* Generic functions common to all models */
-
-XBT_PRIVATE FILE *surf_fopen(const char *name, const char *mode);
-XBT_PRIVATE std::ifstream* surf_ifsopen(std::string name);
-
-/* The __surf_is_absolute_file_path() returns 1 if
- * file_path is a absolute file path, in the other
- * case the function returns 0.
- */
-XBT_PRIVATE int __surf_is_absolute_file_path(const char *file_path);
-
-extern XBT_PRIVATE simgrid::trace_mgr::future_evt_set *future_evt_set;
-
-
-XBT_PUBLIC(void) storage_register_callbacks();
-
-XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, sg_netzone_t rc);
-XBT_PRIVATE void parse_after_config();
-
-/********** Tracing **********/
-/* from surf_instr.c */
-void TRACE_surf_host_set_speed(double date, const char *resource, double power);
-void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
-
-SG_END_DECL()
-
-#endif
diff --git a/src/surf/surf_private.hpp b/src/surf/surf_private.hpp
new file mode 100644 (file)
index 0000000..3e8d90c
--- /dev/null
@@ -0,0 +1,55 @@
+/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_SURF_PRIVATE_HPP
+#define SURF_SURF_PRIVATE_HPP
+
+#include "src/surf/trace_mgr.hpp"
+#include "surf/maxmin.hpp"
+#include "surf/surf.h"
+
+#define NO_MAX_DURATION -1.0
+
+extern "C" {
+
+extern XBT_PRIVATE const char* surf_action_state_names[6];
+
+/** @ingroup SURF_interface
+ * @brief Possible update mechanisms
+ */
+enum e_UM_t {
+  UM_FULL,     /**< Full update mechanism: the remaining time of every action is recomputed at each step */
+  UM_LAZY,     /**< Lazy update mechanism: only the modified actions get recomputed.
+                    It may be slower than full if your system is tightly coupled to the point where every action
+                    gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for
+                    a simple full update.  */
+  UM_UNDEFINED /**< Mechanism not defined */
+};
+
+/* Generic functions common to all models */
+
+XBT_PRIVATE FILE* surf_fopen(const char* name, const char* mode);
+XBT_PRIVATE std::ifstream* surf_ifsopen(std::string name);
+
+/* The __surf_is_absolute_file_path() returns 1 if
+ * file_path is a absolute file path, in the other
+ * case the function returns 0.
+ */
+XBT_PRIVATE int __surf_is_absolute_file_path(const char* file_path);
+
+extern XBT_PRIVATE simgrid::trace_mgr::future_evt_set* future_evt_set;
+
+XBT_PUBLIC(void) storage_register_callbacks();
+
+XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, sg_netzone_t rc);
+XBT_PRIVATE void parse_after_config();
+
+/********** Tracing **********/
+/* from surf_instr.c */
+void TRACE_surf_host_set_speed(double date, const char* resource, double power);
+void TRACE_surf_link_set_bandwidth(double date, const char* resource, double bandwidth);
+}
+
+#endif
index dbbf1ae..66e0d9e 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/trace_mgr.hpp"
-#include "surf_private.h"
+#include "surf_private.hpp"
 #include "xbt/RngStream.h"
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/join.hpp>
index 2cb74ce..b687772 100644 (file)
 #include "xbt/sysdep.h"
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Iterator within a trace */
-typedef struct tmgr_trace_event {
+struct s_tmgr_trace_event_t {
   tmgr_trace_t trace;
   unsigned int idx;
   sg_resource_t resource;
   int free_me;
-} s_tmgr_trace_event_t;
-typedef struct tmgr_trace_event* tmgr_trace_event_t;
+};
+typedef s_tmgr_trace_event_t* tmgr_trace_event_t;
 
 /**
  * \brief Free a trace event structure
@@ -35,10 +35,8 @@ XBT_PUBLIC(void) tmgr_finalize();
 
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(std::string filename);
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(std::string id, std::string input, double periodicity);
+}
 
-SG_END_DECL()
-
-#ifdef __cplusplus
 namespace simgrid {
 /** @brief Modeling of the availability profile (due to an external load) or the churn
  *
@@ -98,6 +96,5 @@ private:
 };
 
 }} // namespace simgrid::trace_mgr
-#endif /* C++ only */
 
 #endif /* SURF_TMGR_H */
index 17c6f9e..bd5c32f 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <xbt/signal.hpp>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 /* Module management functions */
 XBT_PUBLIC(void) sg_platf_init();;
@@ -29,7 +29,6 @@ XBT_PUBLIC(double) surf_parse_get_bandwidth(const char* string, const char* enti
 XBT_PUBLIC(double) surf_parse_get_speed(const char* string, const char* entity_kind, std::string name);
 
 XBT_PUBLIC(int) surf_parse(); /* Entry-point to the parser */
-
-SG_END_DECL()
+}
 
 #endif
index 9395880..db80cd7 100644 (file)
@@ -15,7 +15,7 @@
 #include <string>
 #include <vector>
 
-SG_BEGIN_DECL()
+extern "C" {
 #include "src/surf/xml/simgrid_dtd.h"
 
 #ifndef YY_TYPEDEF_YY_SIZE_T
@@ -23,12 +23,12 @@ SG_BEGIN_DECL()
 typedef size_t yy_size_t;
 #endif
 
-typedef enum {
-  SURF_CLUSTER_DRAGONFLY=3,
-  SURF_CLUSTER_FAT_TREE=2,
-  SURF_CLUSTER_FLAT = 1,
-  SURF_CLUSTER_TORUS = 0
-} e_surf_cluster_topology_t;
+enum e_surf_cluster_topology_t {
+  SURF_CLUSTER_DRAGONFLY = 3,
+  SURF_CLUSTER_FAT_TREE  = 2,
+  SURF_CLUSTER_FLAT      = 1,
+  SURF_CLUSTER_TORUS     = 0
+};
 
 /* ***************************************** */
 /*
@@ -41,7 +41,7 @@ typedef enum {
  * used, instead of malloced structures.
  */
 
-typedef struct {
+struct s_sg_platf_host_cbarg_t {
   const char* id;
   std::vector<double> speed_per_pstate;
   int pstate;
@@ -50,7 +50,7 @@ typedef struct {
   tmgr_trace_t state_trace;
   const char* coord;
   std::map<std::string, std::string>* properties;
-} s_sg_platf_host_cbarg_t;
+};
 typedef s_sg_platf_host_cbarg_t* sg_platf_host_cbarg_t;
 
 class HostLinkCreationArgs {
@@ -83,15 +83,15 @@ public:
   tmgr_trace_t state_trace;
 };
 
-typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t;
-typedef struct s_sg_platf_route_cbarg {
-  bool symmetrical;
-  sg_netpoint_t src;
-  sg_netpoint_t dst;
-  sg_netpoint_t gw_src;
-  sg_netpoint_t gw_dst;
-  std::vector<simgrid::surf::LinkImpl*>* link_list;
-} s_sg_platf_route_cbarg_t;
+struct s_sg_platf_route_cbarg_t {
+  bool symmetrical                                 = false;
+  sg_netpoint_t src                                = nullptr;
+  sg_netpoint_t dst                                = nullptr;
+  sg_netpoint_t gw_src                             = nullptr;
+  sg_netpoint_t gw_dst                             = nullptr;
+  std::vector<simgrid::surf::LinkImpl*>* link_list = nullptr;
+};
+typedef s_sg_platf_route_cbarg_t* sg_platf_route_cbarg_t;
 
 class ClusterCreationArgs {
 public:
@@ -152,11 +152,11 @@ public:
   std::string name;
 };
 
-typedef struct s_sg_platf_prop_cbarg *sg_platf_prop_cbarg_t;
-typedef struct s_sg_platf_prop_cbarg {
+struct s_sg_platf_prop_cbarg_t {
   const char *id;
   const char *value;
-} s_sg_platf_prop_cbarg_t;
+};
+typedef s_sg_platf_prop_cbarg_t* sg_platf_prop_cbarg_t;
 
 class TraceCreationArgs {
 public:
@@ -173,8 +173,7 @@ public:
   std::string element;
 };
 
-typedef struct s_sg_platf_process_cbarg *sg_platf_process_cbarg_t;
-typedef struct s_sg_platf_process_cbarg {
+struct s_sg_platf_process_cbarg_t {
   const char **argv;
   int argc;
   std::map<std::string, std::string>* properties;
@@ -183,7 +182,8 @@ typedef struct s_sg_platf_process_cbarg {
   double start_time;
   double kill_time;
   e_surf_process_on_failure_t on_failure;
-} s_sg_platf_process_cbarg_t;
+};
+typedef s_sg_platf_process_cbarg_t* sg_platf_process_cbarg_t;
 
 class ZoneCreationArgs {
 public:
@@ -237,8 +237,7 @@ XBT_PUBLIC(void) surf_parse_set_debug(int bdebug);
 XBT_PUBLIC(int) surf_parse_lex_destroy();
 
 XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route);
-
-SG_END_DECL()
+}
 
 namespace simgrid {
 namespace surf {
index f3f0e08..38e43ad 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. */
 
-#include "src/instr/instr_private.h" // TRACE_start(). FIXME: remove by subscribing tracing to the surf signals
+#include "src/instr/instr_private.hpp" // TRACE_start(). FIXME: remove by subscribing tracing to the surf signals
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 #include "xbt/log.h"
@@ -15,7 +15,7 @@
 
 #if SIMGRID_HAVE_LUA
 extern "C" {
-#include "src/bindings/lua/simgrid_lua.h"
+#include "src/bindings/lua/simgrid_lua.hpp"
 
 #include <lua.h>                /* Always include this when calling Lua */
 #include <lauxlib.h>            /* Always include this when calling Lua */
@@ -33,7 +33,7 @@ XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
 
-SG_BEGIN_DECL()
+extern "C" {
 void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
 {
   xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
@@ -170,5 +170,4 @@ void parse_platform_file(const char *file)
       surf_parse_error(std::string("Parse error in ") + file);
   }
 }
-
-SG_END_DECL()
+}
index 46fe64b..dfb894d 100644 (file)
@@ -17,7 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
 
-SG_BEGIN_DECL()
+extern "C" {
 
 int ETag_surfxml_include_state();
 
@@ -59,9 +59,8 @@ void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::stri
 
   std::vector<simgrid::kernel::routing::NetPoint*> list;
   simgrid::s4u::Engine::getInstance()->getNetpointList(&list);
-  std::sort(list.begin(), list.end(),
-      [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
-      return a->name() < b->name();
+  std::sort(list.begin(), list.end(), [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+    return a->getName() < b->getName();
   });
   bool first = true;
   for (auto const& np : list) {
@@ -71,7 +70,7 @@ void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::stri
     if (not first)
       msg += ",";
     first = false;
-    msg += "'" + np->name() + "'";
+    msg += "'" + np->getName() + "'";
     if (msg.length() > 4096) {
       msg.pop_back(); // remove trailing quote
       msg += "...(list truncated)......";
@@ -144,9 +143,8 @@ struct unit_scale {
 };
 
 /* Note: field `unit' for the last element of parameter `units' should be nullptr. */
-static double surf_parse_get_value_with_unit(const char* string, const struct unit_scale* units,
-                                             const char* entity_kind, std::string name, const char* error_msg,
-                                             const char* default_unit)
+static double surf_parse_get_value_with_unit(const char* string, const unit_scale* units, const char* entity_kind,
+                                             std::string name, const char* error_msg, const char* default_unit)
 {
   char* ptr;
   int i;
@@ -174,113 +172,91 @@ static double surf_parse_get_value_with_unit(const char* string, const struct un
 
 double surf_parse_get_time(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "w",  7 * 24 * 60 * 60 },
-    { "d",  24 * 60 * 60 },
-    { "h",  60 * 60 },
-    { "m",  60 },
-    { "s",  1.0 },
-    { "ms", 1e-3 },
-    { "us", 1e-6 },
-    { "ns", 1e-9 },
-    { "ps", 1e-12 },
-    { nullptr, 0 }
-  };
+  const unit_scale units[] = {{"w", 7 * 24 * 60 * 60},
+                              {"d", 24 * 60 * 60},
+                              {"h", 60 * 60},
+                              {"m", 60},
+                              {"s", 1.0},
+                              {"ms", 1e-3},
+                              {"us", 1e-6},
+                              {"ns", 1e-9},
+                              {"ps", 1e-12},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 's' to your time to get seconds", "s");
 }
 
 double surf_parse_get_size(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "EiB", pow(1024, 6) },
-    { "PiB", pow(1024, 5) },
-    { "TiB", pow(1024, 4) },
-    { "GiB", pow(1024, 3) },
-    { "MiB", pow(1024, 2) },
-    { "KiB", 1024 },
-    { "EB",  1e18 },
-    { "PB",  1e15 },
-    { "TB",  1e12 },
-    { "GB",  1e9 },
-    { "MB",  1e6 },
-    { "kB",  1e3 },
-    { "B",   1.0 },
-    { "Eib", 0.125 * pow(1024, 6) },
-    { "Pib", 0.125 * pow(1024, 5) },
-    { "Tib", 0.125 * pow(1024, 4) },
-    { "Gib", 0.125 * pow(1024, 3) },
-    { "Mib", 0.125 * pow(1024, 2) },
-    { "Kib", 0.125 * 1024 },
-    { "Eb",  0.125 * 1e18 },
-    { "Pb",  0.125 * 1e15 },
-    { "Tb",  0.125 * 1e12 },
-    { "Gb",  0.125 * 1e9 },
-    { "Mb",  0.125 * 1e6 },
-    { "kb",  0.125 * 1e3 },
-    { "b",   0.125 },
-    { nullptr,    0 }
-  };
+  const unit_scale units[] = {{"EiB", pow(1024, 6)},
+                              {"PiB", pow(1024, 5)},
+                              {"TiB", pow(1024, 4)},
+                              {"GiB", pow(1024, 3)},
+                              {"MiB", pow(1024, 2)},
+                              {"KiB", 1024},
+                              {"EB", 1e18},
+                              {"PB", 1e15},
+                              {"TB", 1e12},
+                              {"GB", 1e9},
+                              {"MB", 1e6},
+                              {"kB", 1e3},
+                              {"B", 1.0},
+                              {"Eib", 0.125 * pow(1024, 6)},
+                              {"Pib", 0.125 * pow(1024, 5)},
+                              {"Tib", 0.125 * pow(1024, 4)},
+                              {"Gib", 0.125 * pow(1024, 3)},
+                              {"Mib", 0.125 * pow(1024, 2)},
+                              {"Kib", 0.125 * 1024},
+                              {"Eb", 0.125 * 1e18},
+                              {"Pb", 0.125 * 1e15},
+                              {"Tb", 0.125 * 1e12},
+                              {"Gb", 0.125 * 1e9},
+                              {"Mb", 0.125 * 1e6},
+                              {"kb", 0.125 * 1e3},
+                              {"b", 0.125},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'B' to get bytes (or 'b' for bits but 1B = 8b).", "B");
 }
 
 double surf_parse_get_bandwidth(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "EiBps", pow(1024, 6) },
-    { "PiBps", pow(1024, 5) },
-    { "TiBps", pow(1024, 4) },
-    { "GiBps", pow(1024, 3) },
-    { "MiBps", pow(1024, 2) },
-    { "KiBps", 1024 },
-    { "EBps",  1e18 },
-    { "PBps",  1e15 },
-    { "TBps",  1e12 },
-    { "GBps",  1e9 },
-    { "MBps",  1e6 },
-    { "kBps",  1e3 },
-    { "Bps",   1.0 },
-    { "Eibps", 0.125 * pow(1024, 6) },
-    { "Pibps", 0.125 * pow(1024, 5) },
-    { "Tibps", 0.125 * pow(1024, 4) },
-    { "Gibps", 0.125 * pow(1024, 3) },
-    { "Mibps", 0.125 * pow(1024, 2) },
-    { "Kibps", 0.125 * 1024 },
-    { "Tbps",  0.125 * 1e12 },
-    { "Gbps",  0.125 * 1e9 },
-    { "Mbps",  0.125 * 1e6 },
-    { "kbps",  0.125 * 1e3 },
-    { "bps",   0.125 },
-    { nullptr,    0 }
-  };
+  const unit_scale units[] = {{"EiBps", pow(1024, 6)},
+                              {"PiBps", pow(1024, 5)},
+                              {"TiBps", pow(1024, 4)},
+                              {"GiBps", pow(1024, 3)},
+                              {"MiBps", pow(1024, 2)},
+                              {"KiBps", 1024},
+                              {"EBps", 1e18},
+                              {"PBps", 1e15},
+                              {"TBps", 1e12},
+                              {"GBps", 1e9},
+                              {"MBps", 1e6},
+                              {"kBps", 1e3},
+                              {"Bps", 1.0},
+                              {"Eibps", 0.125 * pow(1024, 6)},
+                              {"Pibps", 0.125 * pow(1024, 5)},
+                              {"Tibps", 0.125 * pow(1024, 4)},
+                              {"Gibps", 0.125 * pow(1024, 3)},
+                              {"Mibps", 0.125 * pow(1024, 2)},
+                              {"Kibps", 0.125 * 1024},
+                              {"Tbps", 0.125 * 1e12},
+                              {"Gbps", 0.125 * 1e9},
+                              {"Mbps", 0.125 * 1e6},
+                              {"kbps", 0.125 * 1e3},
+                              {"bps", 0.125},
+                              {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
 }
 
 double surf_parse_get_speed(const char* string, const char* entity_kind, std::string name)
 {
-  const struct unit_scale units[] = {
-    { "yottaflops", 1e24 },
-    { "Yf",         1e24 },
-    { "zettaflops", 1e21 },
-    { "Zf",         1e21 },
-    { "exaflops",   1e18 },
-    { "Ef",         1e18 },
-    { "petaflops",  1e15 },
-    { "Pf",         1e15 },
-    { "teraflops",  1e12 },
-    { "Tf",         1e12 },
-    { "gigaflops",  1e9 },
-    { "Gf",         1e9 },
-    { "megaflops",  1e6 },
-    { "Mf",         1e6 },
-    { "kiloflops",  1e3 },
-    { "kf",         1e3 },
-    { "flops",      1.0 },
-    { "f",          1.0 },
-    { nullptr,         0 }
-  };
+  const unit_scale units[] = {{"yottaflops", 1e24}, {"Yf", 1e24}, {"zettaflops", 1e21}, {"Zf", 1e21},
+                              {"exaflops", 1e18},   {"Ef", 1e18}, {"petaflops", 1e15},  {"Pf", 1e15},
+                              {"teraflops", 1e12},  {"Tf", 1e12}, {"gigaflops", 1e9},   {"Gf", 1e9},
+                              {"megaflops", 1e6},   {"Mf", 1e6},  {"kiloflops", 1e3},   {"kf", 1e3},
+                              {"flops", 1.0},       {"f", 1.0},   {nullptr, 0}};
   return surf_parse_get_value_with_unit(string, units, entity_kind, name,
       "Append 'f' or 'flops' to your speed to get flop per second", "f");
 }
@@ -391,7 +367,7 @@ static std::vector<char*> surf_parsed_filename_stack;
 
 void STag_surfxml_include()
 {
-  XBT_ERROR("<include> tag is deprecated, and will be removed in SimGrid v3.19. Please stop using it now (or tell us why you need it).");
+  XBT_ERROR("<include> tag is deprecated, and will be removed in SimGrid v3.18. Please stop using it now (or tell us why you need it).");
   parse_after_config();
   XBT_DEBUG("STag_surfxml_include '%s'",A_surfxml_include_file);
   surf_parsed_filename_stack.push_back(surf_parsed_filename); // save old file name
@@ -1124,5 +1100,4 @@ int surf_parse()
 {
   return surf_parse_lex();
 }
-
-SG_END_DECL()
+}
index 9bcdf55..5b23cb1 100644 (file)
@@ -38,10 +38,9 @@ struct trace_arg {
   int size;
 };
 
-static _Unwind_Reason_Code
-backtrace_helper (struct _Unwind_Context *ctx, void *a)
+static _Unwind_Reason_Code backtrace_helper(_Unwind_Context* ctx, void* a)
 {
-  struct trace_arg *arg = (struct trace_arg *) a;
+  trace_arg* arg = static_cast<trace_arg*>(a);
 
   /* We are first called with address in the __backtrace function.
      Skip it.  */
@@ -222,8 +221,8 @@ std::vector<std::string> resolveBacktrace(
       int found = 0;
 
       /* let's look for the offset of this library in our addressing space */
-      char* maps_name = bprintf("/proc/%d/maps", (int) getpid());
-      FILE* maps = fopen(maps_name, "r");
+      std::string maps_name = std::string("/proc/") + std::to_string(getpid()) + "maps";
+      FILE* maps            = fopen(maps_name.c_str(), "r");
 
       unsigned long int addr = strtoul(addrs[i].c_str(), &p, 16);
       if (*p != '\0') {
@@ -254,7 +253,6 @@ std::vector<std::string> resolveBacktrace(
         }
       }
       fclose(maps);
-      free(maps_name);
       addrs[i].clear();
 
       if (not found) {
@@ -286,27 +284,26 @@ std::vector<std::string> resolveBacktrace(
           *p2 = '\0';
 
         /* Here we go, fire an addr2line up */
-        char* subcmd = bprintf("%s -f -e %s %s", ADDR2LINE, p, addrs[i].c_str());
+        std::string subcmd = std::string(ADDR2LINE) + " -f -e " + p + " " + addrs[i];
         free(p);
-        XBT_VERB("Fire a new command: '%s'", subcmd);
-        FILE* subpipe = popen(subcmd, "r");
+        XBT_VERB("Fire a new command: '%s'", subcmd.c_str());
+        FILE* subpipe = popen(subcmd.c_str(), "r");
         if (not subpipe) {
           xbt_die("Cannot fork addr2line to display the backtrace");
         }
         if (fgets(line_func, 1024, subpipe)) {
           line_func[strlen(line_func) - 1] = '\0';
         } else {
-          XBT_VERB("Cannot read result of subcommand %s", subcmd);
+          XBT_VERB("Cannot read result of subcommand %s", subcmd.c_str());
           strncpy(line_func, "???",3);
         }
         if (fgets(line_pos, 1024, subpipe)) {
           line_pos[strlen(line_pos) - 1] = '\0';
         } else {
-          XBT_VERB("Cannot read result of subcommand %s", subcmd);
+          XBT_VERB("Cannot read result of subcommand %s", subcmd.c_str());
           strncpy(line_pos, backtrace_syms[i],1024);
         }
         pclose(subpipe);
-        free(subcmd);
       }
 
       /* check whether the trick worked */
index 3947248..cb6c810 100644 (file)
@@ -96,30 +96,34 @@ static long int parseLong(const char* value)
 // ***** ConfigType *****
 
 /// A trait which define possible options types:
-template<class T> struct ConfigType;
+template <class T> class ConfigType;
 
-template<> struct ConfigType<int> {
+template <> class ConfigType<int> {
+public:
   static constexpr const char* type_name = "int";
   static inline double parse(const char* value)
   {
     return parseLong(value);
   }
 };
-template<> struct ConfigType<double> {
+template <> class ConfigType<double> {
+public:
   static constexpr const char* type_name = "double";
   static inline double parse(const char* value)
   {
     return parseDouble(value);
   }
 };
-template<> struct ConfigType<std::string> {
+template <> class ConfigType<std::string> {
+public:
   static constexpr const char* type_name = "string";
   static inline std::string parse(const char* value)
   {
     return std::string(value);
   }
 };
-template<> struct ConfigType<bool> {
+template <> class ConfigType<bool> {
+public:
   static constexpr const char* type_name = "boolean";
   static inline bool parse(const char* value)
   {
index 87c869c..cde26d9 100644 (file)
@@ -40,11 +40,12 @@ static int _xbt_test_suite_disabled = 0;
 xbt_test_unit_t _xbt_test_current_unit = nullptr;
 
 /* test suite test log */
-typedef struct s_xbt_test_log {
+struct s_xbt_test_log {
   char *text;
   const char *file;
   int line;
-} *xbt_test_log_t;
+};
+typedef s_xbt_test_log* xbt_test_log_t;
 
 static void xbt_test_log_dump(xbt_test_log_t log)
 {
@@ -55,7 +56,7 @@ static void xbt_test_log_dump(xbt_test_log_t log)
 }
 
 /* test suite test check */
-typedef struct s_xbt_test_test {
+struct s_xbt_test_test {
   char *title;
   int failed;
   int expected_failure;
@@ -63,7 +64,8 @@ typedef struct s_xbt_test_test {
   const char *file;
   int line;
   xbt_dynar_t logs;
-} *xbt_test_test_t;
+};
+typedef s_xbt_test_test* xbt_test_test_t;
 
 static void xbt_test_test_dump(xbt_test_test_t test)
 {
@@ -165,7 +167,7 @@ static void xbt_test_log_free(void *log)
 /** @brief create test suite */
 xbt_test_suite_t xbt_test_suite_new(const char *name, const char *fmt, ...)
 {
-  xbt_test_suite_t suite = xbt_new0(struct s_xbt_test_suite, 1);
+  xbt_test_suite_t suite = xbt_new0(s_xbt_test_suite, 1);
   va_list ap;
 
   if (_xbt_test_suites == nullptr)
@@ -231,7 +233,7 @@ void xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t
   xbt_assert(func);
   xbt_assert(fmt);
 
-  unit = xbt_new0(struct s_xbt_test_unit, 1);
+  unit = xbt_new0(s_xbt_test_unit, 1);
   va_start(ap, fmt);
   unit->title = bvprintf(fmt, ap);
   va_end(ap);
@@ -646,7 +648,7 @@ void _xbt_test_add(const char *file, int line, const char *fmt, ...)
   xbt_assert(unit);
 
   va_list ap;
-  xbt_test_test_t test = xbt_new0(struct s_xbt_test_test, 1);
+  xbt_test_test_t test = xbt_new0(s_xbt_test_test, 1);
   va_start(ap, fmt);
   test->title = bvprintf(fmt, ap);
   va_end(ap);
@@ -668,7 +670,7 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...)
       "Test failed even before being declared (broken unit: %s)", unit->title);
 
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
+  xbt_test_log_t log = xbt_new(s_xbt_test_log, 1);
   va_start(ap, fmt);
   log->text = bvprintf(fmt, ap);
   va_end(ap);
@@ -711,7 +713,7 @@ void _xbt_test_log(const char *file, int line, const char *fmt, ...)
       "Test logged into even before being declared (broken test unit: %s)", unit->title);
 
   va_list ap;
-  xbt_test_log_t log = xbt_new(struct s_xbt_test_log, 1);
+  xbt_test_log_t log = xbt_new(s_xbt_test_log, 1);
   va_start(ap, fmt);
   log->text = bvprintf(fmt, ap);
   va_end(ap);
index 472a314..e511603 100644 (file)
@@ -7,9 +7,11 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/internal_config.h"
-#include "xbt/sysdep.h"
 #include "src/xbt/log_private.h"
+#include "xbt/sysdep.h"
+#include <errno.h>
 #include <stdio.h>
+#include <string.h>
 
 static void append_file(xbt_log_appender_t this_, char *str) {
   fputs(str, (FILE *) this_->data);
@@ -25,10 +27,13 @@ xbt_log_appender_t xbt_log_appender_file_new(char *arg) {
   xbt_log_appender_t res = xbt_new0(s_xbt_log_appender_t, 1);
   res->do_append         = &append_file;
   res->free_             = &free_;
-  if (arg)
+  if (arg) {
     res->data = (void *) fopen(arg, "w");
-  else
+    if (res->data == NULL)
+      xbt_die("Cannot open file: %s: %s", arg, strerror(errno));
+  } else {
     res->data = (void *) stderr;
+  }
   return res;
 }
 
@@ -46,9 +51,11 @@ typedef struct xbt_log_append2_file_s* xbt_log_append2_file_t;
 static void open_append2_file(xbt_log_append2_file_t data){
   if(data->count<0) {
     //Roll
-    if(!data->file)
+    if (!data->file) {
       data->file= fopen(data->filename, "w");
-    else{
+      if (data->file == NULL)
+        xbt_die("Cannot open file: %s: %s", data->filename, strerror(errno));
+    } else {
       fputs(APPEND2_END_TOKEN_CLEAR,data->file);
       fseek(data->file,0,SEEK_SET);
     }
@@ -66,7 +73,9 @@ static void open_append2_file(xbt_log_append2_file_t data){
     snprintf(newname,511,"%s%i%s",pre,data->count,post);
     data->count++;
     data->file= fopen(newname, "w");
-    xbt_assert(data->file);
+    if (data->file == NULL)
+      xbt_die("Cannot open file: %s: %s", newname, strerror(errno));
+    xbt_free(pre);
   }
 }
 
@@ -83,10 +92,13 @@ static void append2_file(xbt_log_appender_t this_, char *str) {
    }
 }
 
-static void free_append2_(xbt_log_appender_t this_) {
-  FILE* f=((xbt_log_append2_file_t)(this_->data))->file;
-  if (f)
-    fclose(f);
+static void free_append2_(xbt_log_appender_t this_)
+{
+  xbt_log_append2_file_t data = this_->data;
+  if (data->file)
+    fclose(data->file);
+  xbt_free(data->filename);
+  xbt_free(data);
 }
 
 
index 5cd9b46..b8e4bec 100644 (file)
@@ -12,7 +12,7 @@
 #include <cstdlib>
 #include <cstring>
 
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Type.hpp"
index 02c26ea..0bc60e6 100644 (file)
@@ -14,7 +14,7 @@
 #include <mc/mc.h>
 
 #include "mc/datatypes.h"
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
 
 #include "src/mc/ObjectInformation.hpp"
 #include "src/mc/Type.hpp"
@@ -105,11 +105,13 @@ static simgrid::mc::Member* find_member(simgrid::mc::Type& type, const char* nam
 
 int some_local_variable = 0;
 
-typedef struct foo {int i;} s_foo;
+struct s_foo {
+  int i;
+};
 
 static void test_type_by_name(simgrid::mc::RemoteClient& process, s_foo my_foo)
 {
-  assert(process.binary_info->full_types_by_name.find("struct foo") != process.binary_info->full_types_by_name.end());
+  assert(process.binary_info->full_types_by_name.find("struct s_foo") != process.binary_info->full_types_by_name.end());
 }
 
 int main(int argc, char** argv)
index 948eca2..46b464f 100644 (file)
@@ -26,7 +26,7 @@ static void master()
   simgrid::s4u::this_actor::getHost()->actorList(actor_list);
 
   for (auto const& actor : *actor_list) {
-    XBT_INFO("Actor (pid=%lu, ppid=%lu, name=%s)", actor->getPid(), actor->getPpid(), actor->getName().c_str());
+    XBT_INFO("Actor (pid=%lu, ppid=%lu, name=%s)", actor->getPid(), actor->getPpid(), actor->getCname());
     if (simgrid::s4u::this_actor::getPid() != actor->getPid())
       actor->kill();
   }
index 86dcc62..de948f3 100644 (file)
@@ -7,7 +7,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
 
-static int my_onexit(smx_process_exit_status_t status, int* pid)
+static int my_onexit(smx_process_exit_status_t /*status*/, int* pid)
 {
   XBT_INFO("Process \"%d\" killed.", *pid);
   return 0;
index df64ea9..52d9ace 100644 (file)
@@ -12,7 +12,7 @@ static void display_storage_properties(simgrid::s4u::Storage* storage)
 {
   std::map<std::string, std::string>* props = storage->getProperties();
   if (not props->empty()) {
-    XBT_INFO("\tProperties of mounted storage: %s", storage->getName());
+    XBT_INFO("\tProperties of mounted storage: %s", storage->getCname());
 
     for (auto const& elm : *props) {
       XBT_INFO("    %s->%s", elm.first.c_str(), elm.second.c_str());
@@ -27,7 +27,7 @@ static sg_size_t write_local_file(const char* dest, sg_size_t file_size)
   simgrid::s4u::File* file = new simgrid::s4u::File(dest, nullptr);
   sg_size_t written        = file->write(file_size);
   XBT_INFO("%llu bytes on %llu bytes have been written by %s on /sd1", written, file_size,
-           simgrid::s4u::Actor::self()->getName().c_str());
+           simgrid::s4u::Actor::self()->getCname());
   delete file;
   return written;
 }
@@ -38,7 +38,7 @@ static sg_size_t read_local_file(const char* src)
   sg_size_t file_size      = file->size();
   sg_size_t read           = file->read(file_size);
 
-  XBT_INFO("%s has read %llu on %s", simgrid::s4u::Actor::self()->getName().c_str(), read, src);
+  XBT_INFO("%s has read %llu on %s", simgrid::s4u::Actor::self()->getCname(), read, src);
   delete file;
 
   return read;
@@ -51,7 +51,7 @@ static void hsm_put(const char* remote_host, const char* src, const char* dest)
   sg_size_t read_size = read_local_file(src);
 
   // Send file
-  XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::getName().c_str(), read_size, remote_host);
+  XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::getCname(), read_size, remote_host);
   char* payload                    = bprintf("%s %llu", dest, read_size);
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(remote_host);
   mailbox->put(payload, static_cast<double>(read_size));
@@ -60,7 +60,7 @@ static void hsm_put(const char* remote_host, const char* src, const char* dest)
 
 static void display_storage_content(simgrid::s4u::Storage* storage)
 {
-  XBT_INFO("Print the content of the storage element: %s", storage->getName());
+  XBT_INFO("Print the content of the storage element: %s", storage->getCname());
   std::map<std::string, sg_size_t>* content = storage->getContent();
   if (not content->empty()) {
     for (auto const& entry : *content)
@@ -108,7 +108,7 @@ static void storage_info(simgrid::s4u::Host* host)
   for (auto const& elm : host->getMountedStorages()) {
     const char* mount_name         = elm.first.c_str();
     simgrid::s4u::Storage* storage = elm.second;
-    XBT_INFO("\tStorage name: %s, mount name: %s", storage->getName(), mount_name);
+    XBT_INFO("\tStorage name: %s, mount name: %s", storage->getCname(), mount_name);
 
     sg_size_t free_size = storage->getSizeFree();
     sg_size_t used_size = storage->getSizeUsed();
@@ -117,7 +117,7 @@ static void storage_info(simgrid::s4u::Host* host)
     XBT_INFO("\t\tUsed size: %llu bytes", used_size);
 
     display_storage_properties(storage);
-    dump_storage_by_name(storage->getName());
+    dump_storage_by_name(storage->getCname());
   }
 }
 
index 6c30832..622d3bc 100644 (file)
@@ -85,12 +85,12 @@ static void dump_platform()
   simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
   std::sort(netcardList.begin(), netcardList.end(),
             [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
-              return a->name() < b->name();
+              return a->getName() < b->getName();
             });
 
   for (auto const& srcCard : netcardList)
     if (srcCard->isRouter())
-      std::printf("  <router id=\"%s\"/>\n", srcCard->cname());
+      std::printf("  <router id=\"%s\"/>\n", srcCard->getCname());
 
   // Links
   unsigned int totalLinks    = sg_link_count();
@@ -103,7 +103,7 @@ static void dump_platform()
     simgrid::s4u::Link* link = links[i];
     std::printf("  <link id=\"");
 
-    std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->name(), link->bandwidth(), link->latency());
+    std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->getCname(), link->bandwidth(), link->latency());
     if (sg_link_is_shared(link)) {
       std::printf("/>\n");
     } else {
@@ -122,17 +122,17 @@ static void dump_platform()
       if (not route.empty()) {
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->getCname(), host2->getCname());
         for (auto const& link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
     for (auto const& netcardDst : netcardList) { // to router
       if (netcardDst->isRouter()) {
-        std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->getCname(), netcardDst->cname());
+        std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->getCname(), netcardDst->getCname());
         std::vector<simgrid::surf::LinkImpl*> route;
         simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
         for (auto const& link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
@@ -142,22 +142,22 @@ static void dump_platform()
     if (value1->isRouter()) {
       for (auto const& value2 : netcardList) { // to router
         if (value2->isRouter()) {
-          std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->cname(), value2->cname());
+          std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->getCname(), value2->getCname());
           std::vector<simgrid::surf::LinkImpl*> route;
           simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, &route, nullptr);
           for (auto const& link : route)
-            std::printf("<link_ctn id=\"%s\"/>", link->cname());
+            std::printf("<link_ctn id=\"%s\"/>", link->getCname());
           std::printf("\n  </route>\n");
         }
       }
       for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
         simgrid::s4u::Host* host2 = hosts[it_dst];
-        std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->cname(), host2->getCname());
+        std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->getCname(), host2->getCname());
         std::vector<simgrid::surf::LinkImpl*> route;
         simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
         simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, &route, nullptr);
         for (auto const& link : route)
-          std::printf("<link_ctn id=\"%s\"/>", link->cname());
+          std::printf("<link_ctn id=\"%s\"/>", link->getCname());
         std::printf("\n  </route>\n");
       }
     }
index 9858c0c..88b6530 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
   simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
   std::sort(netcardList.begin(), netcardList.end(),
             [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
-              return a->name() < b->name();
+              return a->getName() < b->getName();
             });
 
   int it;
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
 
   std::printf("NetCards count: %zu\n", netcardList.size());
   for (auto const& nc : netcardList)
-    std::printf("   - Seen: \"%s\". Type: %s\n", nc->cname(),
+    std::printf("   - Seen: \"%s\". Type: %s\n", nc->getCname(),
                 nc->isRouter() ? "router" : (nc->isNetZone() ? "netzone" : (nc->isHost() ? "host" : "buggy")));
 
   return 0;
index c35f437..73c34da 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "simgrid/msg.h"
 #include "src/surf/surf_interface.hpp"
-#include "surf/maxmin.h"
+#include "surf/maxmin.hpp"
 #include "xbt/log.h"
 #include "xbt/module.h"
 #include "xbt/sysdep.h"
@@ -23,11 +23,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 /*  ==l1==  L2  ==L3==           */
 /*        ------                 */
 
-typedef enum {
-  MAXMIN,
-  LAGRANGE_RENO,
-  LAGRANGE_VEGAS
-} method_t;
+enum method_t { MAXMIN, LAGRANGE_RENO, LAGRANGE_VEGAS };
 
 static double dichotomy(double func(double), double min, double max, double min_error)
 {
index 6bb1b1e..d3408b1 100644 (file)
@@ -6,7 +6,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "surf/maxmin.h"
+#include "surf/maxmin.hpp"
 #include "simgrid/msg.h"
 #include "xbt/module.h"
 #include "xbt/sysdep.h" /* time manipulation for benchmarking */
index a8fd743..70f58b3 100644 (file)
@@ -31,8 +31,10 @@ foreach(x heap_bench log_large parallel_log_crashtest parmap_test) #mallocator p
   ADD_TESH(tesh-xbt-${x} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/${x} ${x}.tesh)
 endforeach()
 
-if(NOT enable_debug)
-  ADD_TESH(tesh-xbt-log   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/log_usage --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage log_usage_ndebug.tesh)
+if(enable_debug)
+  ADD_TESH(tesh-xbt-log --cd ${CMAKE_BINARY_DIR}/teshsuite/xbt/log_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage/log_usage.tesh)
+else()
+  ADD_TESH(tesh-xbt-log --cd ${CMAKE_BINARY_DIR}/teshsuite/xbt/log_usage ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_usage/log_usage_ndebug.tesh)
 endif()
 
 if(HAVE_MMALLOC)
index dd9c606..e417d93 100644 (file)
@@ -6,7 +6,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "xbt.h"
+#include <simgrid/msg.h>
+#include <xbt.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");
 XBT_LOG_NEW_CATEGORY(top, "Useless test channel");
@@ -23,7 +24,7 @@ static void dolog(const char *settings)
 
 int main(int argc, char **argv)
 {
-  xbt_init(&argc, argv);
+  MSG_init(&argc, argv);
 
   dolog("");
   dolog(" ");
index 0ef0851..eace392 100644 (file)
@@ -1,5 +1,6 @@
 #! ./tesh
 
+p Check different log thresholds
 $ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Test with the settings ''
 > [  0.000000] [0:maestro@] val=2
@@ -19,3 +20,74 @@ $ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m
 > [  0.000000] [0:maestro@] false alarm!
 > [  0.000000] [0:maestro@] Test with the settings ' test.thres:critical '
 > [  0.000000] [0:maestro@] false alarm!
+
+p Check the "file" log appender
+$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:file:${bindir:=.}/log_usage.log
+$ cat ${bindir:=.}/log_usage.log
+> [  0.000000] [0:maestro@] Test with the settings ''
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:info root.thres:info  '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:debug '
+> [  0.000000] [0:maestro@] val=1
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:critical '
+> [  0.000000] [0:maestro@] false alarm!
+
+p Check the "rollfile" log appender
+$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:rollfile:500:${bindir:=.}/log_usage.log
+$ cat ${bindir:=.}/log_usage.log
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:critical '
+> [  0.000000] [0:maestro@] false alarm!
+>
+> [End of log]
+> ] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:debug '
+> [  0.000000] [0:maestro@] val=1
+>
+>                    
+
+p Check the "splitfile" log appender
+$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=root.app:splitfile:500:${bindir:=.}/log_usage_%.log
+$ cat ${bindir:=.}/log_usage_0.log
+> [  0.000000] [0:maestro@] Test with the settings ''
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:info root.thres:info  '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:debug '
+> [  0.000000] [0:maestro@] val=1
+
+$ cat ${bindir:=.}/log_usage_1.log
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:verbose root.thres:error '
+> [  0.000000] [0:maestro@] val=2
+> [  0.000000] [0:maestro@] false alarm!
+> [  0.000000] [0:maestro@] Test with the settings ' test.thres:critical '
+> [  0.000000] [0:maestro@] false alarm!
+
+$ rm -f ${bindir:=.}/log_usage.log ${bindir:=.}/log_usage_0.log ${bindir:=.}/log_usage_1.log
+
+# Would be nice for code coverage, but the early exit leads to lots of memory leaks
+#! output ignore
+#$ $SG_TEST_EXENV ${bindir:=.}/log_usage --help --help-log-categories
index 247836a..794398b 100644 (file)
@@ -8,33 +8,32 @@ set(EXTRA_DIST
   src/include/simgrid/sg_config.h
   src/include/smpi/smpi_utils.hpp
   src/include/surf/datatypes.h
-  src/include/surf/maxmin.h
+  src/include/surf/maxmin.hpp
   src/include/surf/surf.h
   src/include/xbt/parmap.hpp
-  src/mc/mc_mmu.h
-  src/mc/mc_record.h
+  src/mc/mc_mmu.hpp
+  src/mc/mc_record.hpp
   src/mc/PageStore.hpp
-  src/msg/msg_private.h
+  src/msg/msg_private.hpp
   src/simdag/dax.dtd
   src/simdag/dax_dtd.c
   src/simdag/dax_dtd.h
   src/simdag/simdag_private.hpp
   src/simix/simcalls.in
   src/simix/simcalls.py
-  src/simix/popping_private.h
+  src/simix/popping_private.hpp
   src/simix/popping_bodies.cpp
   src/simix/popping_generated.cpp
   src/simix/popping_enum.h
-  src/simix/popping_accessors.h
-  src/simix/smx_host_private.h
-  src/simix/smx_io_private.h
-  src/simix/smx_network_private.h
-  src/simix/smx_private.h
+  src/simix/popping_accessors.hpp
+  src/simix/smx_host_private.hpp
+  src/simix/smx_io_private.hpp
+  src/simix/smx_network_private.hpp
+  src/simix/smx_private.hpp
   src/simix/smx_synchro_private.hpp
-  src/smpi/colls/coll_tuned_topo.h
-  src/smpi/colls/colls_private.h
-  src/smpi/colls/smpi_mvapich2_selector_stampede.h
-  src/smpi/include/private.h
+  src/smpi/colls/coll_tuned_topo.hpp
+  src/smpi/colls/colls_private.hpp
+  src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
   src/smpi/include/private.hpp
   src/surf/cpu_cas01.hpp
   src/surf/cpu_interface.hpp
@@ -46,8 +45,8 @@ set(EXTRA_DIST
   src/surf/network_ns3.hpp
   src/surf/network_smpi.hpp
   src/surf/network_ib.hpp
-  src/surf/ns3/ns3_interface.h
-  src/surf/ns3/ns3_simulator.h
+  src/surf/ns3/ns3_interface.hpp
+  src/surf/ns3/ns3_simulator.hpp
   src/surf/trace_mgr_test.cpp
   src/surf/xml/simgrid.dtd
   src/surf/xml/simgrid_dtd.h
@@ -58,7 +57,7 @@ set(EXTRA_DIST
   src/surf/StorageImpl.hpp
   src/surf/storage_n11.hpp
   src/surf/surf_interface.hpp
-  src/surf/surf_private.h
+  src/surf/surf_private.hpp
   src/surf/PropertyHolder.hpp
   src/surf/host_clm03.hpp
   src/surf/HostImpl.hpp
@@ -303,7 +302,7 @@ if(HAVE_MMALLOC)
 endif()
 
 set(NS3_SRC  src/surf/network_ns3.cpp
-             src/surf/ns3/ns3_simulator.cc )
+             src/surf/ns3/ns3_simulator.cpp )
 
 set(SURF_SRC
   src/kernel/routing/ClusterZone.cpp
@@ -468,16 +467,16 @@ set(SIMDAG_SRC
   )
 
 set(BINDINGS_SRC
-  src/bindings/lua/lua_private.h
-  src/bindings/lua/lua_utils.h
-  src/bindings/lua/simgrid_lua.h
+  src/bindings/lua/lua_private.hpp
+  src/bindings/lua/lua_utils.hpp
+  src/bindings/lua/simgrid_lua.hpp
   )
 
 set(JMSG_C_SRC
   src/bindings/java/jmsg.cpp
-  src/bindings/java/jmsg.h
+  src/bindings/java/jmsg.hpp
   src/bindings/java/jmsg_as.cpp
-  src/bindings/java/jmsg_as.h
+  src/bindings/java/jmsg_as.hpp
   src/bindings/java/jmsg_comm.cpp
   src/bindings/java/jmsg_comm.h
   src/bindings/java/jmsg_file.cpp
@@ -495,7 +494,7 @@ set(JMSG_C_SRC
   src/bindings/java/jmsg_vm.cpp
   src/bindings/java/jmsg_vm.h
   src/bindings/java/jxbt_utilities.cpp
-  src/bindings/java/jxbt_utilities.h
+  src/bindings/java/jxbt_utilities.hpp
   src/bindings/java/JavaContext.cpp
   src/bindings/java/JavaContext.hpp
   src/bindings/java/jmsg_storage.cpp
@@ -553,8 +552,8 @@ set(TRACING_SRC
   src/instr/instr_paje_trace.cpp
   src/instr/instr_paje_types.cpp
   src/instr/instr_paje_values.cpp
-  src/instr/instr_private.h
-  src/instr/instr_smpi.h
+  src/instr/instr_private.hpp
+  src/instr/instr_smpi.hpp
   src/instr/instr_resource_utilization.cpp
   )
 
@@ -572,7 +571,7 @@ set(JEDULE_SRC
 set(MC_SRC_BASE
   src/mc/mc_base.cpp
   src/mc/mc_base.h
-  src/mc/mc_record.h
+  src/mc/mc_record.hpp
   src/mc/mc_replay.h
   src/mc/mc_record.cpp
   src/mc/mc_config.cpp
@@ -616,11 +615,11 @@ set(MC_SRC
   src/mc/mc_forward.hpp
   src/mc/Session.cpp
   src/mc/Session.hpp
-  src/mc/mc_unw.h
+  src/mc/mc_unw.hpp
   src/mc/mc_unw.cpp
   src/mc/mc_unw_vmread.cpp
   src/mc/mc_checkpoint.cpp
-  src/mc/mc_snapshot.h
+  src/mc/mc_snapshot.hpp
   src/mc/mc_snapshot.cpp
   src/mc/mc_page_snapshot.cpp
   src/mc/mc_comm_pattern.cpp
@@ -640,20 +639,20 @@ set(MC_SRC
   src/mc/mc_record.cpp
   src/mc/mc_member.cpp
   src/mc/mc_memory.cpp
-  src/mc/mc_private.h
-  src/mc/mc_request.h
+  src/mc/mc_private.hpp
+  src/mc/mc_request.hpp
   src/mc/mc_request.cpp
-  src/mc/mc_safety.h
-  src/mc/mc_state.h
+  src/mc/mc_safety.hpp
+  src/mc/mc_state.hpp
   src/mc/mc_state.cpp
   src/mc/VisitedState.cpp
   src/mc/VisitedState.hpp
   src/mc/mc_client_api.cpp
-  src/mc/mc_smx.h
+  src/mc/mc_smx.hpp
   src/mc/mc_smx.cpp
   src/mc/mc_xbt.hpp
   src/mc/mc_xbt.cpp
-  src/mc/mc_exit.h
+  src/mc/mc_exit.hpp
   src/mc/Transition.hpp
   )
 
@@ -1126,6 +1125,7 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/storage/storage.xml
   examples/platforms/small_platform.xml
   examples/platforms/small_platform.lua
+  examples/platforms/small_platform_constant.xml
   examples/platforms/small_platform_fatpipe.xml
   examples/platforms/small_platform_one_link_routes.xml
   examples/platforms/small_platform_with_failures.xml
index eff28d8..78f17b6 100644 (file)
@@ -16,7 +16,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_generated.cpp
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_bodies.cpp
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_enum.h
-      ${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.h
+      ${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.hpp
 
       DEPENDS
       ${CMAKE_HOME_DIRECTORY}/src/simix/simcalls.py
@@ -32,11 +32,11 @@ if(enable_maintainer_mode AND NOT WIN32)
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_generated.cpp
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_bodies.cpp
       ${CMAKE_HOME_DIRECTORY}/src/simix/popping_enum.h
-      ${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.h
+      ${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.hpp
       )
 
     SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
-      "${CMAKE_HOME_DIRECTORY}/src/simix/popping_enum.h;${CMAKE_HOME_DIRECTORY}/src/simix/popping_generated.cpp;${CMAKE_HOME_DIRECTORY}/src/simix/popping_bodies.cpp;${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.h"
+      "${CMAKE_HOME_DIRECTORY}/src/simix/popping_enum.h;${CMAKE_HOME_DIRECTORY}/src/simix/popping_generated.cpp;${CMAKE_HOME_DIRECTORY}/src/simix/popping_bodies.cpp;${CMAKE_HOME_DIRECTORY}/src/simix/popping_accessors.hpp"
       )
   endif()
 endif()
index 6aed72c..2375082 100644 (file)
@@ -95,6 +95,26 @@ if(enable_smpi AND APPLE)
   set(SIMGRID_DEP "${SIMGRID_DEP} -Wl,-U -Wl,_smpi_simulated_main")
 endif()
 
+# See https://github.com/HewlettPackard/foedus_code/blob/master/foedus-core/cmake/FindGccAtomic.cmake
+FIND_LIBRARY(GCCLIBATOMIC_LIBRARY NAMES atomic atomic.so.1 libatomic.so.1
+  HINTS
+    $ENV{HOME}/local/lib64
+    $ENV{HOME}/local/lib
+    /usr/local/lib64
+    /usr/local/lib
+    /opt/local/lib64
+    /opt/local/lib
+    /usr/lib64
+    /usr/lib
+    /lib64
+    /lib
+)
+
+# Fix a FTBFS on armel, mips, mipsel and friends (Debian's #872881)
+if(CMAKE_COMPILER_IS_GNUCC AND GCCLIBATOMIC_LIBRARY)
+    set(SIMGRID_DEP   "${SIMGRID_DEP}   -Wl,--as-needed -latomic -Wl,--no-as-needed")
+endif()
+
 target_link_libraries(simgrid  ${SIMGRID_DEP})
 
 # Dependencies from maintainer mode